|
@@ -985,10 +985,22 @@ export default {
|
|
|
},
|
|
|
onShow() {
|
|
|
this.showModle = true;
|
|
|
+ },
|
|
|
+ onLoad(options) {
|
|
|
+ const devItem = JSON.parse(options.devItem);
|
|
|
+ const { devId, clientId } = devItem;
|
|
|
+ this.getFrequency(clientId);
|
|
|
+ this.getdevInfo(devId);
|
|
|
+ this.getdevRoomInfo(devId);
|
|
|
+ this.autoPlayinterval = setTimeout(() => {
|
|
|
+ this.autoSwipe();
|
|
|
+ }, 3000);
|
|
|
+ this.getCurrentDate();
|
|
|
+
|
|
|
this.clientId = uni.getStorageSync("clientIDetail");
|
|
|
console.log(this.clientId, "clientIDetail");
|
|
|
if (this.mqttData) {
|
|
|
- this.mqttData.end(); // 或 close() 根据你使用的 MQTT 库
|
|
|
+ this.mqttData.end(true);
|
|
|
this.mqttData = null;
|
|
|
console.log("页面 MQTT 已关闭");
|
|
|
}
|
|
@@ -1013,36 +1025,25 @@ export default {
|
|
|
});
|
|
|
}
|
|
|
},
|
|
|
- onLoad(options) {
|
|
|
- const devItem = JSON.parse(options.devItem);
|
|
|
- const { devId, clientId } = devItem;
|
|
|
- this.getFrequency(clientId);
|
|
|
- this.getdevInfo(devId);
|
|
|
- this.getdevRoomInfo(devId);
|
|
|
- this.autoPlayinterval = setTimeout(() => {
|
|
|
- this.autoSwipe();
|
|
|
- }, 3000);
|
|
|
- this.getCurrentDate();
|
|
|
- },
|
|
|
onUnload() {
|
|
|
this.inactivityTimer = null;
|
|
|
this.autoPlayinterval = null;
|
|
|
this.showModle = false;
|
|
|
if (this.mqttData) {
|
|
|
- this.mqttData.end(); // 或 close() 根据你使用的 MQTT 库
|
|
|
+ this.mqttData.end(true);
|
|
|
this.mqttData = null;
|
|
|
console.log("页面 MQTT1 已关闭");
|
|
|
}
|
|
|
},
|
|
|
onHide() {
|
|
|
- this.inactivityTimer = null;
|
|
|
- this.autoPlayinterval = null;
|
|
|
- this.showModle = false;
|
|
|
- if (this.mqttData) {
|
|
|
- this.mqttData.end(); // 或 close() 根据你使用的 MQTT 库
|
|
|
- this.mqttData = null;
|
|
|
- console.log("页面 MQTT2 已关闭");
|
|
|
- }
|
|
|
+ // this.inactivityTimer = null;
|
|
|
+ // this.autoPlayinterval = null;
|
|
|
+ // this.showModle = false;
|
|
|
+ // if (this.mqttData) {
|
|
|
+ // this.mqttData.end(true);
|
|
|
+ // this.mqttData = null;
|
|
|
+ // console.log("页面 MQTT2 已关闭");
|
|
|
+ // }
|
|
|
},
|
|
|
beforeDestroy() {
|
|
|
console.log("组件销毁时调用");
|