You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
37 lines
824 B
JavaScript
37 lines
824 B
JavaScript
// pages/verify-loading/verify-loading.js
|
|
const app = getApp();
|
|
Component({
|
|
options: {
|
|
addGlobalClass: true,
|
|
},
|
|
/**
|
|
* 页面的初始数据
|
|
*/
|
|
data: {
|
|
canLogin: true,
|
|
inteval: null
|
|
},
|
|
lifetimes:{
|
|
attached: function(){
|
|
this.setData({
|
|
canLogin: app.globalData.status !== 1
|
|
})
|
|
let that=this;
|
|
this.data.inteval=setInterval(() => {
|
|
app.utils.util.request({
|
|
url: '/info',
|
|
success: function(res){
|
|
if(res.data.flag===1&&res.data.status===0){
|
|
app.globalData.status = res.data.status
|
|
app.globalData.flag = res.data.flag
|
|
that.triggerEvent('reflush')
|
|
}
|
|
}
|
|
})
|
|
}, 5000);
|
|
},
|
|
detached: function(){
|
|
clearInterval(this.data.inteval);
|
|
}
|
|
}
|
|
}) |