diff --git a/src/moduleIOT/pages/iotCarePlan/FR200.tsx b/src/moduleIOT/pages/iotCarePlan/FR200.tsx index d27368c..e4926d2 100644 --- a/src/moduleIOT/pages/iotCarePlan/FR200.tsx +++ b/src/moduleIOT/pages/iotCarePlan/FR200.tsx @@ -789,8 +789,14 @@ class IotCarePlanFR200 extends Component { /** 切换光照 */ onSwitchChange = async () => { - // todo - let { isStopNurse } = this.state; + let { isStopNurse, ActiveModeItem } = this.state; + + console.log("切换光照,", ActiveModeItem); + if (ActiveModeItem.modeType === "led") { + this.onSwitchChangeLED(); + return; + } + if (isStopNurse) { // 开始光照逻辑 this.onNursingTap(); @@ -804,6 +810,37 @@ class IotCarePlanFR200 extends Component { isStopNurse: !isStopNurse, }); }; + /** LED切换模式 */ + onSwitchChangeLED = () => { + let { isStopNurse } = this.state; + if (isStopNurse) { + // 开始光照逻辑 + this.onNursingTap(); + this.switchVideoPlay(); // 开始 + } else { + // 暂停光照逻辑 + let sendParams: any = { + ...deviceCommandSamples.pause, + workMode: "led", // 使用模式 + workStatus: "standby", + }; + const pauseArrayBuffer = deviceToolKitInstance.toBleCommand( + sendParams as any + ); + sendCommand({ + value: pauseArrayBuffer, + }).then(() => { + this.workStatus = "pause"; + this.resetTimer(); + console.info(`发送暂停指令成功 参数为 =>`, sendParams); + }); + // this.handleWorkStatus(false, MODE_WORKING_ENUM.PAUSE); + this.switchVideoPause(); // 暂停 + } + this.setState({ + isStopNurse: !isStopNurse, + }); + }; /** * @name 每次进入设备运行页,打开首个模式的介绍弹窗 @@ -1642,7 +1679,6 @@ class IotCarePlanFR200 extends Component { workMode: ActiveModeItem.modeType, // 使用模式 workStatus: newWorkStatus, }; - console.log(ActiveModeItem, "查看工作状态"); // 水分测试需要特殊处理 // 水分测试准备 水分测试工作 水分测试启动 diff --git a/src/moduleIOT/pages/iotCarePlan/components/ModeList/FR200.tsx b/src/moduleIOT/pages/iotCarePlan/components/ModeList/FR200.tsx index 8de1635..02f1f6e 100644 --- a/src/moduleIOT/pages/iotCarePlan/components/ModeList/FR200.tsx +++ b/src/moduleIOT/pages/iotCarePlan/components/ModeList/FR200.tsx @@ -31,7 +31,6 @@ function Index({ let PermeationList = ModeList.filter((item) => item.modeClass === 3); // 专研促渗 let SensitiveList = ModeList.filter((item) => item.modeClass === 4); // 敏感期护理 let IntelligenceList = ModeList.filter((item) => item.modeClass === 5); // 智能测肤 - console.log(activeModeID, "查看id", BaseList, ModeList); const onItemClick = (item) => { if (item.lock) { onModeLockOpen(); // 点击了锁定模式