diff --git a/pages/100J/HBY100-J.vue b/pages/100J/HBY100-J.vue index c9b7e72..2de22b4 100644 --- a/pages/100J/HBY100-J.vue +++ b/pages/100J/HBY100-J.vue @@ -466,7 +466,6 @@ deviceInfo: {}, } }, - onUnload() {}, onLoad: function() { const eventChannel = this.getOpenerEventChannel(); var these = this; @@ -488,12 +487,12 @@ these.Status.apiType = data.apiType; these.Status.isRightIconVisible = these.Status.apiType === 'listA'; - this.mqttClient = new MqttClient(); + these.mqttClient = new MqttClient(); - this.mqttClient.connect(() => { + these.mqttClient.connect(() => { // 订阅来自设备的状态更新 const statusTopic = `status/894078/HBY100/${data.data.deviceImei}`; - this.mqttClient.subscribe(statusTopic, (payload) => { + these.mqttClient.subscribe(statusTopic, (payload) => { try { // 解析MQTT返回的payload const payloadObj = typeof payload === 'string' ? JSON.parse( @@ -615,8 +614,8 @@ if (these.Status.apiType === 'listA') { these.fetchDeviceDetail(data.data.id) } else { - this.activePermissions = data.data.permission ? data.data.permission.split(',') : []; - console.log(this.activePermissions, 'this.activePermissions'); + these.activePermissions = data.data.permission ? data.data.permission.split(',') : []; + console.log(these.activePermissions, 'activePermissions'); these.fetchDeviceDetail(data.data.deviceId) } // 尝试连接蓝牙:需先扫描获取 BLE deviceId,不能直接用 MAC;延迟 500ms 确保蓝牙适配器就绪