Browse Source

首次进来不走onShow请求

znjjxt
lzp 3 months ago
parent
commit
c153c6280c
  1. 14
      pages/index/index.vue

14
pages/index/index.vue

@ -210,6 +210,7 @@ export default {
// 湿Co2Tvoc
deviceInfo: {},
falt: false,
timer: null,
};
},
@ -267,6 +268,7 @@ export default {
});
const { data, code } = res;
if (code == 200) {
this.falt = true; //
uni.setStorageSync("userToken", data.token);
this.getqueryProjectInfoByKey();
}
@ -395,7 +397,7 @@ export default {
};
console.log("this.deviceInfo", this.deviceInfo);
// 10
setTimeout(() => {
this.timer = setTimeout(() => {
this.getAttributes(this.deviceId); // id
}, 30000);
}
@ -404,7 +406,15 @@ export default {
created() {
this.handleLogin();
},
onShow() {},
onShow() {
if (this.falt) {
this.getAttributes(this.deviceId); // id
}
},
//
onUnload() {
clearTimeout(this.timer);
},
};
</script>

Loading…
Cancel
Save