From bc9b6bc487f75b8b54841e506744b29388ec7094 Mon Sep 17 00:00:00 2001 From: blak-kong <546598185@qq.com> Date: Wed, 6 Mar 2024 16:02:21 +0800 Subject: [PATCH] =?UTF-8?q?fix=E7=BB=99=E8=87=AA=E5=8A=A8=E9=87=8D?= =?UTF-8?q?=E6=96=B0=E7=99=BB=E5=BD=95=E5=8A=A0=E4=B8=8A2=E7=A7=92?= =?UTF-8?q?=E5=BB=B6=E8=BF=9F=E5=AE=9A=E6=97=B6=E5=99=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages/index/index.tsx | 4 ++- src/pages/iotCarePlan/iotCarePlan.tsx | 39 +++++++-------------------- 2 files changed, 13 insertions(+), 30 deletions(-) diff --git a/src/pages/index/index.tsx b/src/pages/index/index.tsx index 0dd9eef..62e23ee 100644 --- a/src/pages/index/index.tsx +++ b/src/pages/index/index.tsx @@ -438,7 +438,9 @@ class Index extends Component { }, 300); } else { msg("请求失败,尝试重新请求"); - this.WCUserLogin(); + setTimeout(() => { + this.WCUserLogin(); + }, 2000); } } closeBinding = () => { diff --git a/src/pages/iotCarePlan/iotCarePlan.tsx b/src/pages/iotCarePlan/iotCarePlan.tsx index ae8bb70..6d9b4f2 100644 --- a/src/pages/iotCarePlan/iotCarePlan.tsx +++ b/src/pages/iotCarePlan/iotCarePlan.tsx @@ -46,11 +46,6 @@ import { go, getStorageSync, setStorageSync } from "@/utils/traoAPI"; import { InstrumentInfo } from "@/utils/Interface"; import "./iotCarePlan.less"; -import UpdateIotWL200 from "@/components/bluetoot/update-wl200/index"; - -// import log from "@/utils/log"; -// log.info("123456info", 123456, { sdfasdf: 123 }); - import { notifyBLECharacteristicValueChange, sendCommand, @@ -60,15 +55,7 @@ import { bleCommandSamples, } from "@/components/bluetoot/connection/test"; -import { Progress } from "@antmjs/vantui"; -import { - s_to_s, - s_to_m, - minSecToS, - s_to_ms, - s_to_hms, - sleep, -} from "@/utils/util"; +import { minSecToS, s_to_ms, s_to_hms, sleep } from "@/utils/util"; import { DeviceToolKit as DeviceToolKitWE100 } from "@flossom-npm/iot-translater-we100"; import commandMap from "@/utils/commandMap"; @@ -77,7 +64,6 @@ const deviceToolKitInstanceWL200 = new DeviceToolKitWE100("WL200", "WL200"); let currentTimeTimer: any = null; // 当前项目时间定时器 let CountdownTimer: any = null; let timer: any = null; -let checkVersionTimeout: any = null; let showTipsTimer: any = null; let loadingTipsTimer: any = null; // 蓝牙连接提示 let switchModeStatus = "free"; // 用于标记是否在切换模式中, free: 空闲, switching: 切换中 @@ -277,7 +263,6 @@ class IotCarePlan extends Component { }); await this.GetModeList(info.id); - console.log("info"); // 如果不存在设备模式值,则判断为首次进入,弹窗提示 let isFirstTipShow = getStorageSync("first_instrument_" + info.id); @@ -439,14 +424,7 @@ class IotCarePlan extends Component { if (isReturn) return; } - let { isStandStatus, isShowNurse } = this.state; - - // let isCabinMode = data.isCabinMode === 1; - // if (isStandStatus === isCabinMode) { - // this.setState({ isCanClick: true }); // 是否舱体一致时,可以点击 - // } else { - // this.setState({ isCanClick: false }); - // } + let { isShowNurse } = this.state; let currentServiceData = { startSource: "", @@ -713,6 +691,7 @@ class IotCarePlan extends Component { // 设备断开时,给定一个断开时间 ActiveModeItem.breakTimeStr = this.state.currentTime; + this.setState({ isStandStatus: false, isStopNurse: true, @@ -977,6 +956,11 @@ class IotCarePlan extends Component { }); this.judgementWorkStatus(MODE_WORKING_ENUM.END, jsonStatus.workMode); } + + // 每次同步后,更新历史缓存 + setTimeout(() => { + this.updateWL200NursingHistory(); + }, 100); }, }; @@ -1192,9 +1176,6 @@ class IotCarePlan extends Component { "仅在时间达到下一步,步骤切换时更新currentServiceData", currentServiceData ); - - this.updateWL200NursingHistory(currentServiceData); - this.setState({ ModeStepIndex: index, currentServiceData, @@ -1527,6 +1508,8 @@ class IotCarePlan extends Component { if (this.WL200NursingHistory) { let params: any = this.WL200NursingHistory; + + // 设置当前时间 params.currentTime = this.state.currentTime; // 设置正确封面 @@ -1860,11 +1843,9 @@ class IotCarePlan extends Component { render() { let { - name, title, isConnectShow, isShowStepTips, - isCanClick, isShowNurse, isStopNurse, ModeList,