new-20250827 #39
@ -1145,8 +1145,59 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (this.deviceInfo.batteryPercentage <= 20) {
|
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() {},
|
showBleUnConnect() {},
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user