From 30b227b892d403f594f7ca51d2e478ccca39fc22 Mon Sep 17 00:00:00 2001 From: blak-kong <546598185@qq.com> Date: Tue, 26 Mar 2024 11:06:21 +0800 Subject: [PATCH] =?UTF-8?q?fix:=E4=BF=AE=E5=A4=8D=E6=A8=AA=E5=90=91?= =?UTF-8?q?=E6=BB=9A=E5=8A=A8=E6=9D=A1=E5=88=87=E6=8D=A2item=EF=BC=8C?= =?UTF-8?q?=E9=A1=B5=E9=9D=A2=E6=95=B0=E6=8D=AE=E5=88=B7=E6=96=B0=E5=AF=BC?= =?UTF-8?q?=E8=87=B4=E6=A8=AA=E5=90=91=E6=BB=9A=E5=8A=A8=E9=97=AA=E5=8A=A8?= =?UTF-8?q?=E5=9B=9E=E5=88=9D=E5=A7=8B=E4=BD=8D=E7=BD=AE=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/app.config.ts | 2 + .../pages/instrument_manage/index.tsx | 2 +- src/moduleIOT/pages/iotCarePlan/FR200.tsx | 92 +++--- .../iotCarePlan/components/Footer/FR200.tsx | 35 ++- .../iotCarePlan/components/ModeList/FR200.tsx | 4 +- src/pages/index/index.config.ts | 1 + src/pages/index/index.tsx | 13 + src/recoding/pages/recording/recording.tsx | 265 +++++++++--------- 8 files changed, 228 insertions(+), 186 deletions(-) diff --git a/src/app.config.ts b/src/app.config.ts index 25015c7..2f1c6bc 100644 --- a/src/app.config.ts +++ b/src/app.config.ts @@ -71,9 +71,11 @@ export default defineAppConfig({ navigationBarBackgroundColor: "#fff", navigationBarTitleText: "WeChat", navigationBarTextStyle: "black", + // pageOrientation: "auto", // enablePullDownRefresh: true }, requiredPrivateInfos: ["getLocation"], + subPackages: [ { root: "moduleIOT", diff --git a/src/instrument/pages/instrument_manage/index.tsx b/src/instrument/pages/instrument_manage/index.tsx index 2d8f338..71a21ee 100644 --- a/src/instrument/pages/instrument_manage/index.tsx +++ b/src/instrument/pages/instrument_manage/index.tsx @@ -204,7 +204,7 @@ export default class InstrumentManage extends Component { 未绑定的仪器 - + {unBindList.map((item, index) => { if (item.status === 0) { return ( diff --git a/src/moduleIOT/pages/iotCarePlan/FR200.tsx b/src/moduleIOT/pages/iotCarePlan/FR200.tsx index 8c804e2..7a3f0c8 100644 --- a/src/moduleIOT/pages/iotCarePlan/FR200.tsx +++ b/src/moduleIOT/pages/iotCarePlan/FR200.tsx @@ -508,7 +508,8 @@ class IotCarePlanFR200 extends Component { currentWorkModeType = 3; } else if ( data.modeType === "maskPenetration" || - data.modeType === "essence" + data.modeType === "essence" || + data.modeType === "led" ) { currentWorkModeType = 2; } @@ -918,7 +919,7 @@ class IotCarePlanFR200 extends Component { let waterStepList = this.state.waterStepList; // 到达第几个step let waterStepIndex = this.state.waterStepIndex; - + // 代表5秒以后最后拿到的结果 if (waterStepList[waterStepIndex].finish) { // 获取等级 @@ -949,9 +950,9 @@ class IotCarePlanFR200 extends Component { } else { let waterStepList = this.state.waterStepList; let waterStepIndex = this.state.waterStepIndex; - // 5秒后获取的结果 + // 5秒后获取的结果 if (waterStepList[waterStepIndex].finish) { - // 获取失败后,把进度条清理0 + // 获取失败后,把进度条清理0 waterStepList[waterStepIndex].schedule = 0; waterStepList[waterStepIndex].finish = false; this.setState({ @@ -1598,15 +1599,14 @@ class IotCarePlanFR200 extends Component { executePromises = async () => { let waterStepList = this.state.waterStepList; let waterStepIndex = this.state.waterStepIndex; - let that =this + let that = this; await new Promise((resolve) => { setTimeout(() => { waterStepList[waterStepIndex].schedule = 100; - that.setState({ - - waterStepList, - }); - + that.setState({ + waterStepList, + }); + resolve(); }, 3000); }).then(() => { @@ -1614,19 +1614,14 @@ class IotCarePlanFR200 extends Component { setTimeout(() => { waterStepList[waterStepIndex].finish = true; that.setState({ - waterStepList, - }); + waterStepList, + }); resolve(); }, 2000); }); }); - - }; - - - // 检测并控制工作状态 handleWorkStatus = async (isBtnClick: boolean, workStatus) => { const { DeviceConnectStatus, ActiveModeItem } = this.state; @@ -1654,22 +1649,24 @@ class IotCarePlanFR200 extends Component { if (ActiveModeItem.modeType === "moistureTest") { let that = this; sendParams.testStatus = "standby"; // 切换为准备 - - // 3秒定时器,逻辑3秒把进度条弄成100,再加2秒获取最后结果 + // 3秒定时器,逻辑3秒把进度条弄成100,再加2秒获取最后结果 if (isBtnClick) { that.setState({ isRuningTest: 2, - }); - this.executePromises() - + this.executePromises(); + sendParams.testStatus = "start"; // 点击开始再开始 console.log("点击开始", isBtnClick); } } - if (ActiveModeItem.modeType === "maskPenetration") { + // 面膜促渗和精华促渗 + if ( + ActiveModeItem.modeType === "maskPenetration" || + ActiveModeItem.modeType === "essence" + ) { sendParams.gear = this.state.currentGear; // 点击开始再开始 } @@ -2120,7 +2117,12 @@ class IotCarePlanFR200 extends Component { return nursingData; } - return { nursingData: JSON.stringify({ workMode: nowFR200NursingHistory.workMode, }), showFace: true } + return { + nursingData: JSON.stringify({ + workMode: nowFR200NursingHistory.workMode, + }), + showFace: true, + }; }; // 计算挡位 @@ -2669,7 +2671,7 @@ class IotCarePlanFR200 extends Component { showFullscreenBtn={false} onLoadedMetaData={this.GetVideosTime} /> - + {/* */} {errorTips && ( @@ -2683,22 +2685,28 @@ class IotCarePlanFR200 extends Component { )} - - - - 倒计时:{currentTime} - - - - - 档位:{currentGear}档 + {ActiveModeItem.modeType !== "moistureTest" && ( + + + + 倒计时:{currentTime} + + + + + 档位: + + {ActiveModeItem.modeType === "led" ? "-" : currentGear} + + 档 + + + - - - + )} {ModeList.length > 0 && ( @@ -2714,8 +2722,8 @@ class IotCarePlanFR200 extends Component { onModeLockOpen={this.onModeLockOpen} /> )} - - + {/* + */} diff --git a/src/moduleIOT/pages/iotCarePlan/components/Footer/FR200.tsx b/src/moduleIOT/pages/iotCarePlan/components/Footer/FR200.tsx index 9607bc1..101b4b0 100644 --- a/src/moduleIOT/pages/iotCarePlan/components/Footer/FR200.tsx +++ b/src/moduleIOT/pages/iotCarePlan/components/Footer/FR200.tsx @@ -9,7 +9,7 @@ interface Props { onEmitStartNurse: Function; // 每次点击item,回调事件和数据给父组件 onEmitSwitchChange: Function; onEmitEndPlan: Function; - onsuccess:Function + onsuccess: Function; } function Index({ currentWorkModeType, @@ -18,7 +18,7 @@ function Index({ onEmitStartNurse, onEmitSwitchChange, onEmitEndPlan, - onsuccess + onsuccess, }: Props) { const onStartNurse = () => { onEmitStartNurse(); @@ -31,24 +31,31 @@ function Index({ const onEndPlan = () => { onEmitEndPlan(); }; + const onSuccessNurse = () => { + onsuccess(); + }; return ( {currentWorkModeType === 3 && ( - {isRuningTest === 1 ? ( - - 启动检测 - - ) : isRuningTest === 2 ? ( - 检测中... - ) : isRuningTest === 3 ? ( - 重新检测 - ) : ( - 检测完成 - )} - + {isRuningTest === 1 ? ( + + 启动检测 + + ) : isRuningTest === 2 ? ( + 检测中... + ) : isRuningTest === 3 ? ( + + 重新检测 + + ) : ( + + 检测完成 + + )} + )} {currentWorkModeType === 2 && ( diff --git a/src/moduleIOT/pages/iotCarePlan/components/ModeList/FR200.tsx b/src/moduleIOT/pages/iotCarePlan/components/ModeList/FR200.tsx index 06782db..8de1635 100644 --- a/src/moduleIOT/pages/iotCarePlan/components/ModeList/FR200.tsx +++ b/src/moduleIOT/pages/iotCarePlan/components/ModeList/FR200.tsx @@ -85,7 +85,9 @@ function Index({ {item.modeName} - {item.modeTimeStr} + {item.modeTimeStr === "00:00" + ? "--:--" + : item.modeTimeStr} { // return; } + goTest() { + go("/pages/consultant/consultant"); + } + //连接完成时数据的回调 offlineChange = async (e) => { console.log("offlineChange", e); @@ -1122,6 +1127,7 @@ class Index extends Component { return ( + {/* */} { 你已绑定所有设备 + {/* */} + {/* + 横屏了 + */} ); } diff --git a/src/recoding/pages/recording/recording.tsx b/src/recoding/pages/recording/recording.tsx index 5cd93cc..8fe8c05 100644 --- a/src/recoding/pages/recording/recording.tsx +++ b/src/recoding/pages/recording/recording.tsx @@ -1,5 +1,6 @@ import Taro, { setStorageSync } from "@tarojs/taro"; import classnames from "classnames"; +import dayjs from "dayjs"; import { Component, PropsWithChildren, useEffect, useState } from "react"; import { @@ -40,8 +41,11 @@ export default class Recording extends Component { curIndex: null, clockStatistics: [], statistics: [], + yearValue: dayjs().format("YYYY-MM-DD"), year: new Date().getFullYear(), - today: new Date(), + + startYear: "2000-01-01", + endYear: dayjs().format("YYYY-MM-DD"), monthTime: [ { month: 1, time: 0 }, { month: 2, time: 0 }, @@ -264,21 +268,31 @@ export default class Recording extends Component { ViewAddInstrument: ViewAddInstrument, }); - this.getRecord(null); - this.getBindingInstrumentList(); - this.getLatestClockRecord(); - this.getClockStatistics(); - this.DayTime(); - this.setStatusBar(); + this.initData(); } componentDidShow() {} componentDidHide() {} - async initData() {} + initData = async () => { + this.getRecord(null); + Taro.showLoading({ + title: "请求中...", + mask: true, + }); + await Promise.all([ + this.getBindingInstrumentList(), + this.getLatestClockRecord(), + this.getClockStatistics(), + this.DayTime(), + this.setStatusBar(), + ]); + Taro.hideLoading(); + }; // 选择年份 onChangeYear(event) { + console.log("event", event); this.setState({ year: event.detail.value }); this.getClockStatistics(event.detail.value); } @@ -510,12 +524,13 @@ export default class Recording extends Component { clockStatistics, statistics, year, - today, monthTime, show, punchInInfo, navigationBarHeight, statusBarHeight, + startYear, + endYear, } = this.state; const statusBarHeightRpx = statusBarHeight * 2; const navigationBarHeightRpx = navigationBarHeight * 2; @@ -549,136 +564,128 @@ export default class Recording extends Component { 打卡统计 - {current === 0 && ( - - - 全部 - - {bindingInstrumentList.map((item: any, index: any) => ( - + {current === 0 && ( + + - - {item.name} - - ))} - - )} - - {current === 0 && recordList.length === 0 && ( - - - - 暂无数据 - - - )} - {current === 0 && ( - - {/* - - - 2024.1.23 - 在线 - - - 回看报告 - - - - - - - 小子弹智能射频仪 - - 模式:基础场景版 - 护理时间:15分00秒 + + + 全部 - - - */} - - - {recordList.map((item: any, index: any) => ( - - - - {item.createTime} + {bindingInstrumentList.map((item: any, index: any) => { + return ( - {item.online === 1 ? "在线" : "离线"} - - - {item.instrumentType === 2 && ( - - 回看报告 + {item.name} - )} + ); + })} + + + + {recordList.length === 0 && ( + + + + 暂无数据 + - - - - {item.instrumentName} - - 模式:{item.modeName} - - {item.instrumentType === 2 && ( - 护理时间:{item.nursingTime} - )} + )} + {recordList.length > 0 && ( + + + {recordList.map((item: any, index: any) => ( + + + + {item.createTime} + + {item.online === 1 ? "在线" : "离线"} + + + {item.instrumentType === 2 && ( + + 回看报告 + + + )} + + + + + + {item.instrumentName} + + + + 模式:{item.modeName} + + + {item.instrumentType === 2 && ( + 护理时间:{item.nursingTime} + )} + + + + - + ))} - - ))} - - - )} + )} + + + )} + {current === 1 && ( {/* @@ -693,11 +700,13 @@ export default class Recording extends Component { 年度打卡统计 {year}年