deming/pageA/welcome/welcome.vue
2020-07-31 08:45:30 +08:00

81 lines
1.5 KiB
Vue
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<template>
<view class="welcome">
<!-- 倒计时跳过 -->
<remaining v-if="guidePages"></remaining>
</view>
</template>
<script>
import {
mapState
} from 'vuex';
import remaining from '@/components/remaining/remaining';
export default {
computed: {
...mapState(['hasLogin', 'token'])
},
data() {
return {
guidePages: true
}
},
onLoad() {
this.loadExecution();
},
methods: {
loadExecution() {
/**
* 获取本地存储中launchFlag的值
* 若存在,说明不是首次启动,直接进入首页;
* 若不存在,说明是首次启动,进入引导页;
*/
// 获取本地存储中launchFlag标识
const value = uni.getStorageSync('launchFlag') || "";
// console.log(value, this.hasLogin);
if (value) {
this.guidePages = false;
if (this.hasLogin) {
uni.switchTab({
url: '../../pages/index/index'
});
} else {
// launchFlag=true直接跳转到首页
uni.navigateTo({
url: '../../pageA/login/login'
});
}
} else {
// launchFlag!=true显示引导页
this.guidePages = true;
}
}
}
}
</script>
<style>
.welcome {}
.welcome_jumpes {
width: 90rpx;
height: 35rpx;
opacity: 0.5;
border-radius: 18rpx;
position: absolute;
right: 37rpx;
top: 34rpx;
font-size: 20rpx;
text-align: center;
line-height: 35rpx;
color: #fff;
background: #C4CAC6;
}
.welcome_images {
width: 100%;
position: fixed;
width: 100%;
height: 100%
}
</style>