zycp-ddxcx/pages/start/start.js

44 lines
944 B
JavaScript
Raw Normal View History

2022-03-09 15:06:54 +08:00
Page({
data: {
2022-03-10 17:35:29 +08:00
timeNumber: 3,
isInFirst: false
2022-03-09 15:06:54 +08:00
},
onShow(){
2022-03-10 17:35:29 +08:00
let inFirst = dd.$toolAll.getCache('isInFirst');
if(!inFirst){
setTimeout(() => {
this.setData({
timeNumber:2
})
}, 1000);
setTimeout(() => {
this.setData({
timeNumber:1
})
}, 2000);
setTimeout(() => {
dd.$toolAll.setCache('isInFirst',60000000000000);
if(dd.$toolAll.getCache('userData')){
// 前往首页
2022-03-23 13:40:04 +08:00
dd.navigateTo({url:'/pages/home/home'});
2022-03-10 17:35:29 +08:00
}else{
// 前往登录页
2022-03-23 13:40:04 +08:00
dd.navigateTo({url:'/pages/login/login'});
2022-03-10 17:35:29 +08:00
}
}, 3000);
}else{
2022-03-09 16:39:27 +08:00
if(dd.$toolAll.getCache('userData')){
2022-03-09 15:48:29 +08:00
// 前往首页
2022-03-23 13:40:04 +08:00
dd.navigateTo({url:'/pages/home/home'});
2022-03-09 15:48:29 +08:00
}else{
// 前往登录页
2022-03-23 13:40:04 +08:00
dd.navigateTo({url:'/pages/login/login'});
2022-03-09 15:48:29 +08:00
}
2022-03-10 17:35:29 +08:00
}
2022-03-09 15:06:54 +08:00
},
onLoad() {
},
});