From 0e66d375fcbfc48a83b05ee3f5b7136cf909d5b0 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: Fri, 20 Mar 2026 09:09:49 +0800 Subject: [PATCH] =?UTF-8?q?100J=E5=A2=9E=E5=8A=A0=E7=89=A9=E8=81=94?= =?UTF-8?q?=E6=8C=89=E9=94=AE=E8=93=9D=E7=89=99=E5=90=8C=E6=AD=A5=E7=8A=B6?= =?UTF-8?q?=E6=80=81=E5=88=B0APP?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/100J/HBY100-J.vue | 53 ++++++++++++++++++++++++++++++++++++++++- 1 file changed, 52 insertions(+), 1 deletion(-) diff --git a/pages/100J/HBY100-J.vue b/pages/100J/HBY100-J.vue index 6daba74..518460e 100644 --- a/pages/100J/HBY100-J.vue +++ b/pages/100J/HBY100-J.vue @@ -1145,8 +1145,59 @@ } if (this.deviceInfo.batteryPercentage <= 20) { - this.showMsg("设备电量低"); + uni.showToast({ title: '设备电量低', icon: 'none', duration: 2000 }); } + + // 设备物理按键切换:蓝牙响应同步到 APP 页面(与 4G MQTT 逻辑一致) + const fc = parsedData.funcCode; + // 0x0C 强制报警:设备按键切换报警状态 + if (fc === 0x0C && parsedData.alarmEnable !== undefined) { + if (parsedData.alarmEnable === 1) { + this.$set(this.deviceInfo, 'voiceStrobeAlarm', 1); + this.formData.sta_VoiceType = (parsedData.alarmMode ?? 0) + ''; + } else { + this.$set(this.deviceInfo, 'voiceStrobeAlarm', -1); + this.formData.sta_VoiceType = (parsedData.alarmMode ?? 0) + ''; + } + } + // 0x0A 爆闪模式:警示灯开关/模式 + if (fc === 0x0A && parsedData.strobeEnable !== undefined) { + if (parsedData.strobeEnable === 1) { + this.formData.sta_LightType = (parsedData.strobeMode ?? 0) + ''; + } else { + this.formData.sta_LightType = '-1'; + } + } + // 0x0E 工作方式:综合状态(设备按键切换后上报) + if (fc === 0x0E) { + if (parsedData.strobeEnable !== undefined) { + if (parsedData.strobeEnable === 1) { + this.formData.sta_LightType = (parsedData.strobeMode ?? 0) + ''; + } else { + this.formData.sta_LightType = '-1'; + } + } + if (parsedData.alarmEnable !== undefined) { + if (parsedData.alarmEnable === 1) { + this.$set(this.deviceInfo, 'voiceStrobeAlarm', 1); + this.formData.sta_VoiceType = (parsedData.alarmMode ?? 0) + ''; + } else { + this.$set(this.deviceInfo, 'voiceStrobeAlarm', -1); + this.formData.sta_VoiceType = (parsedData.alarmMode ?? 0) + ''; + } + } + if (parsedData.voiceBroadcast !== undefined) { + if (parsedData.voiceBroadcast === 1) this.formData.sta_VoiceType = '7'; + else if (this.formData.sta_VoiceType === '7') this.formData.sta_VoiceType = '-1'; + } + if (parsedData.volume !== undefined) this.formData.volume = parsedData.volume; + if (parsedData.strobeFrequency !== undefined) this.formData.strobeFrequency = parsedData.strobeFrequency; + if (parsedData.redBrightness !== undefined) this.formData.lightBrightness = parsedData.redBrightness; + } + // 0x09 音量、0x0D 亮度:单独响应时同步 + if (fc === 0x09 && parsedData.volume !== undefined) this.formData.volume = parsedData.volume; + if (fc === 0x0B && parsedData.strobeFrequency !== undefined) this.formData.strobeFrequency = parsedData.strobeFrequency; + if (fc === 0x0D && parsedData.redBrightness !== undefined) this.formData.lightBrightness = parsedData.redBrightness; }, showBleUnConnect() {},