zycp-ddxcx/pages/start/start.js

44 lines
944 B
JavaScript

Page({
data: {
timeNumber: 3,
isInFirst: false
},
onShow(){
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')){
// 前往首页
dd.navigateTo({url:'/pages/home/home'});
}else{
// 前往登录页
dd.navigateTo({url:'/pages/login/login'});
}
}, 3000);
}else{
if(dd.$toolAll.getCache('userData')){
// 前往首页
dd.navigateTo({url:'/pages/home/home'});
}else{
// 前往登录页
dd.navigateTo({url:'/pages/login/login'});
}
}
},
onLoad() {
},
});