12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970 |
- <template>
- <view>
- <image src="../../static/startupImg.png" style="width: 100vw;height: 100vh;"></image>
- <view :class="hasNotchInScreen?'skip hasNotch':'skip'" @click="skip()">跳过 {{clock}}</view>
- </view>
- </template>
- <script>
- export default {
- data() {
- return {
- clock: 3,
- inter: undefined,
- hasNotchInScreen: false
- }
- },
- onLoad() {},
- mounted() {
- var _this = this
- _this.hasNotchInScreen = plus.navigator.hasNotchInScreen()
- _this.inter = setInterval(function() {
- _this.clock = _this.clock - 1
- if (_this.clock <= 0) {
- _this.skip()
- clearInterval(_this.inter)
- }
- }, 1000);
- },
- methods: {
- skip() {
- clearInterval(this.inter)
- //let token = uni.getStorageSync('uni_id_token')
- var token = this.$preToken + ' ' + this.$store.state.accessToken;
- console.log("111")
- console.log(token)
- console.log(token!=""&&token!=undefined)
- if (token!=""&&token!=undefined) {
- uni.switchTab({
- url: '/pages/index/index'
- })
- } else {
- uni.reLaunch({
- url: '/pages/public/login'
- })
- /* uni.redirectTo({
- url: '/pages/public/login'
- }); */
- }
- }
- }
- }
- </script>
- <style>
- .skip {
- position: absolute;
- background-color: #30313350;
- right: 20px;
- top: 20px;
- color: #dcdcdc;
- border-radius: 25px;
- border: 1px solid #dcdcdc;
- padding: 5rpx 12rpx 5rpx 12rpx;
- }
- .hasNotch {
- right: 50px;
- top: 50px;
- }
- </style>
|