1
0
forked from dyf/APP
This commit is contained in:
fengerli
2025-11-21 11:10:49 +08:00
2 changed files with 11 additions and 3 deletions

View File

@ -574,13 +574,22 @@
if (!json) { if (!json) {
return; return;
} }
console.log("收到设备数据:", json);
let keys = Object.keys(json); let keys = Object.keys(json);
keys.forEach((key) => { keys.forEach((key) => {
if (key in these.formData) { if (key in these.formData) {
these.formData[key] = json[key]; // 确保响应式更新
console.log(`更新字段 ${key}: ${these.formData[key]} -> ${json[key]}`);
these.$set(these.formData, key, json[key]);
} else {
console.log(`字段 ${key} 不在 formData 中,跳过更新`);
} }
}); });
// 强制触发视图更新,确保电量显示同步
these.$forceUpdate();
console.log("更新后的电量:", these.formData.battary);
if (this.formData.battary <= 20) { if (this.formData.battary <= 20) {
this.showPop({ this.showPop({
message: "设备电量低", message: "设备电量低",

View File

@ -476,8 +476,7 @@ class BleReceive {
let recCnt = recArr.find(v => { let recCnt = recArr.find(v => {
return v.key.replace(/\//g, "").toLowerCase() === f.device.detailPageUrl.replaceAll( return v.key.replace(/\//g, "").toLowerCase() === f.device.detailPageUrl.replace(/\//g, '').toLowerCase();
'/', '').toLowerCase();