diff --git a/src/moduleIOT/pages/iotCarePlan/FR200.tsx b/src/moduleIOT/pages/iotCarePlan/FR200.tsx index 4431f47..bc25fcf 100644 --- a/src/moduleIOT/pages/iotCarePlan/FR200.tsx +++ b/src/moduleIOT/pages/iotCarePlan/FR200.tsx @@ -168,7 +168,8 @@ class IotCarePlanFR200 extends Component { countdown: 3, // 是否结束护理 isEndCarePlan: false, - currentTime: "01:00", + currentTime: "10:00", // 倒计时时间:WR200以视频为准 + currentVideoTime: "10:00", // 当前视频时间 // 护理时间不够 isNotEnoughTime: false, @@ -383,18 +384,15 @@ class IotCarePlanFR200 extends Component { }); if (this.state.activeModeID != "") { - this.state.ModeList.map((item) => { - if (item.id === this.state.activeModeID) { - this.setState({ - ActiveModeItem: item, - }); - } - }); + let res1 = res.data.data.find((e) => e.id == this.state.activeModeID); + setTimeout(() => { + this.modeCurrentFun(res1); + }, 100); + } else { + setTimeout(() => { + this.modeCurrentFun(res.data.data[0]); + }, 100); } - let res1 = res.data.data.find((e) => e.id == this.state.activeModeID); - setTimeout(() => { - this.modeCurrentFun(res1); - }, 100); } else { this.setState({ ModeList: [] }); } @@ -447,14 +445,12 @@ class IotCarePlanFR200 extends Component { } // 如果按钮不可点击则报错,内部自带检查底部按钮函数 - this.onEmitErrorTips(); + // this.onEmitErrorTips(); if (!isNotCheck) { let isReturn = this.modeRuningChange(); if (isReturn) return; } - let currentTime = data.modeTimeStr; - // 根据模式,动态设置底部按钮样式 let currentWorkModeType = 1; if (data.modeType === "moistureTest") { @@ -472,7 +468,6 @@ class IotCarePlanFR200 extends Component { ModeID: "mode_" + data.id, ModeStepIndex: 0, ModeType: this.ModeTypeArray[data.modeClass], - currentTime, currentWorkModeType, }); @@ -621,9 +616,11 @@ class IotCarePlanFR200 extends Component { if (isStopNurse) { // 开始光照逻辑 this.onNursingTap(); + this.switchVideoPlay(); // 开始 } else { // 暂停光照逻辑 this.handleWorkStatus(false, MODE_WORKING_ENUM.PAUSE); + this.switchVideoPause(); // 暂停 } this.setState({ isStopNurse: !isStopNurse, @@ -930,10 +927,9 @@ class IotCarePlanFR200 extends Component { console.log("仪器上报的已经运行的总秒数", totalTime); console.log("时间校准频率,默认5秒一次", TIME_CALIBRATION_FREQUENCY); //对比仪器上报运行的总秒数 和小程序页面运行的已经运行的总秒数,如果不一致就进行校准 - const currentScene = ActiveModeItem; // 获取当前的场景 let sceneTime = ActiveModeItem?.breakTimeStr ? minSecToS(ActiveModeItem.breakTimeStr) - : minSecToS(currentScene.modeTimeStr); // 场景时间 + : minSecToS(this.state.currentVideoTime); // 场景时间 console.log("场景时间 sceneTime", sceneTime); console.log("当前显示时间 currentTime", currentTime); @@ -1221,6 +1217,10 @@ class IotCarePlanFR200 extends Component { } } + if (ActiveModeItem.modeType === "maskPenetration") { + sendParams.gear = 10; // 点击开始再开始 + } + console.log("准备发送自定义或工作指令", ActiveModeItem, sendParams); const pauseArrayBuffer = deviceToolKitInstance.toBleCommand( sendParams as any @@ -1808,27 +1808,6 @@ class IotCarePlanFR200 extends Component { console.log("组合时间ModeStepTimeArray", ModeStepTimeArray); } - /* 组合模式 */ - /** 获取自定义组合模式数组 */ - getCustomModesArray = () => { - const { ModeList, ActiveModeItem } = this.state; - const combineIds = ActiveModeItem.combineData.map( - (item) => item.combineModeId - ); - let modesArray = ModeList.filter((item) => - combineIds.includes(item.id) - ).map((item) => { - let totalWorkingMinutes = parseInt(item.modeTimeStr.split(":")[0]); // 仅分钟数 - let totalWorkingSeconds = parseInt(item.modeTimeStr.split(":")[1]); // 仅秒数 - return { - workMode: item.modeType, - totalWorkingMinutes, - totalWorkingSeconds, - }; - }); - return modesArray; - }; - // 护理的错误提示 showTips(ctx) { if (!ctx) return; @@ -2015,6 +1994,28 @@ class IotCarePlanFR200 extends Component { this.setState({ isModeLock: false }); }; + // 获取并设置视频时间 + GetVideosTime = (event) => { + if (event?.detail?.duration) { + let duration = Math.floor(event?.detail?.duration); + let currentTime = s_to_ms(duration); + this.setState({ currentTime }); + } + }; + + switchVideoPlay = () => { + setTimeout(() => { + let videoRef = Taro.createVideoContext("myVideo", this); + videoRef.play(); + }, 100); + }; + switchVideoPause = () => { + setTimeout(() => { + let videoRef = Taro.createVideoContext("myVideo", this); + videoRef.pause(); + }, 100); + }; + render() { let { title, @@ -2026,7 +2027,6 @@ class IotCarePlanFR200 extends Component { ModeList, ModeType, ModeStepIndex, - currentServiceData, ActiveModeItem, currentWorkModeType, isSwitchActiveMode, @@ -2049,7 +2049,6 @@ class IotCarePlanFR200 extends Component { isShowTipsSave, isFirstTipShow, nurseInfo, - isShowReReadRecordSave, isRuningTest, isShowHistoryMsg, isModeLock, @@ -2218,33 +2217,17 @@ class IotCarePlanFR200 extends Component { - {!isShowNurse && ( -