zycp-ddxcx/pages/start/start.js

44 lines
944 B
JavaScript
Raw Permalink Normal View History

2022-03-09 07:06:54 +00:00
Page({
data: {
2022-03-10 09:35:29 +00:00
timeNumber: 3,
isInFirst: false
2022-03-09 07:06:54 +00:00
},
onShow(){
2022-03-10 09:35:29 +00: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 05:40:04 +00:00
dd.navigateTo({url:'/pages/home/home'});
2022-03-10 09:35:29 +00:00
}else{
// 前往登录页
2022-03-23 05:40:04 +00:00
dd.navigateTo({url:'/pages/login/login'});
2022-03-10 09:35:29 +00:00
}
}, 3000);
}else{
2022-03-09 08:39:27 +00:00
if(dd.$toolAll.getCache('userData')){
2022-03-09 07:48:29 +00:00
// 前往首页
2022-03-23 05:40:04 +00:00
dd.navigateTo({url:'/pages/home/home'});
2022-03-09 07:48:29 +00:00
}else{
// 前往登录页
2022-03-23 05:40:04 +00:00
dd.navigateTo({url:'/pages/login/login'});
2022-03-09 07:48:29 +00:00
}
2022-03-10 09:35:29 +00:00
}
2022-03-09 07:06:54 +00:00
},
onLoad() {
},
});