deming/pageA/welcome/welcome.vue

81 lines
1.5 KiB
Vue
Raw Permalink Normal View History

2020-06-01 03:41:09 +00:00
<template>
<view class="welcome">
<!-- 倒计时跳过 -->
2020-07-31 00:45:30 +00:00
<remaining v-if="guidePages"></remaining>
2020-06-01 03:41:09 +00:00
</view>
</template>
<script>
2020-07-31 00:45:30 +00:00
import {
mapState
} from 'vuex';
2020-06-02 00:49:13 +00:00
import remaining from '@/components/remaining/remaining';
2020-06-01 03:41:09 +00:00
export default {
2020-07-31 00:45:30 +00:00
computed: {
...mapState(['hasLogin', 'token'])
},
2020-06-01 03:41:09 +00:00
data() {
return {
2020-07-31 00:45:30 +00:00
guidePages: true
2020-06-01 03:41:09 +00:00
}
},
2020-07-31 00:45:30 +00:00
onLoad() {
this.loadExecution();
2020-06-01 03:41:09 +00:00
},
methods: {
2020-07-31 00:45:30 +00:00
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;
}
}
}
2020-06-01 03:41:09 +00:00
}
</script>
<style>
.welcome {}
2020-07-31 00:45:30 +00:00
.welcome_jumpes {
2020-06-02 00:49:13 +00:00
width: 90rpx;
height: 35rpx;
2020-07-31 00:45:30 +00:00
opacity: 0.5;
border-radius: 18rpx;
2020-06-02 00:49:13 +00:00
position: absolute;
right: 37rpx;
top: 34rpx;
2020-07-31 00:45:30 +00:00
font-size: 20rpx;
2020-06-02 00:49:13 +00:00
text-align: center;
line-height: 35rpx;
color: #fff;
background: #C4CAC6;
}
2020-07-31 00:45:30 +00:00
2020-06-01 03:41:09 +00:00
.welcome_images {
width: 100%;
position: fixed;
width: 100%;
height: 100%
}
</style>