From 7158293d8dbfa226c401dba29ee756a9320504cb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BE=AE=E5=BE=AE=E4=B8=80=E7=AC=91?= <709648985@qq.com> Date: Tue, 24 Mar 2026 15:30:30 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D100J=E4=BD=8E=E7=94=B5?= =?UTF-8?q?=E9=87=8F=E6=8F=90=E7=A4=BA=E5=8F=AF=E8=83=BD=E9=87=8D=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/100J/HBY100-J.vue | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) 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 确保蓝牙适配器就绪