diff --git a/pages/100J/HBY100-J.vue b/pages/100J/HBY100-J.vue index 8a11147..1007201 100644 --- a/pages/100J/HBY100-J.vue +++ b/pages/100J/HBY100-J.vue @@ -700,12 +700,18 @@ } }, bleStatuToggle() { + const mac = (this.device && this.device.deviceMac) || (this.deviceInfo && this.deviceInfo.deviceMac); + if (!mac) return; + const macNorm = (m) => (m || '').replace(/:/g, '').toUpperCase(); + const targetMacNorm = macNorm(mac); + const last6 = targetMacNorm.slice(-6); let f = bleTool.data.LinkedList.find((v) => { - return v.macAddress == this.device.deviceMac; + const m = macNorm(v.macAddress || ''); + return m === targetMacNorm || (m.length >= 6 && m.slice(-6) === last6); }); if (!f) { - this.tryConnect100JBle(this.device.deviceMac); + this.tryConnect100JBle(mac); return; } if (this.formData.bleStatu === true) { @@ -757,8 +763,8 @@ // 关闭状态 that.formData.sta_LightType = '-1'; } - if (this.formData_VoiceType == 7) { - this.formData.sta_VoiceType = res.data.voiceStrobeAlarm ?? 0; + if (this.formData.sta_VoiceType === '7' || this.formData.sta_VoiceType === 7) { + this.formData.sta_VoiceType = (res.data.voiceStrobeAlarm ?? 0) + ''; } else { this.formData.sta_VoiceType = res.data.alarmMode + '' }