diff --git a/pages/7305/BJQ7305.vue b/pages/7305/BJQ7305.vue index 5c92671..7006bc8 100644 --- a/pages/7305/BJQ7305.vue +++ b/pages/7305/BJQ7305.vue @@ -390,6 +390,7 @@ } if (res.deviceId == these.formData.deviceId) { this.formData.bleStatu = true; + // 重新连接后状态以设备上报为准 setTimeout(() => { hideLoading(these, 1000); }); @@ -406,6 +407,9 @@ } if (res.deviceId == these.formData.deviceId) { this.formData.bleStatu = false; + // 断开连接时先将充电状态复位,避免保持旧值 + this.formData.statu = '未充电'; + this.setBleFormData(); setTimeout(() => { hideLoading(these, 1000); }); @@ -491,7 +495,9 @@ } }); if ('statu' in json) { - these.formData.statu = json.statu == '1' ? '充电中' : '未充电'; + const chargingVal = json.statu; + const isCharging = chargingVal === 1 || chargingVal === '1' || chargingVal === true || chargingVal === '充电中'; + these.formData.statu = isCharging ? '充电中' : '未充电'; } if ('xuhang' in json) { these.formData.xuhang = json.xuhang;