From 5320e0fc3520de4bbd9d08e5cadbbe10f87f74c5 Mon Sep 17 00:00:00 2001 From: blak-kong <546598185@qq.com> Date: Mon, 25 Mar 2024 15:07:36 +0800 Subject: [PATCH 01/14] =?UTF-8?q?=E6=89=93=E5=8D=A1=E8=AE=B0=E5=BD=95?= =?UTF-8?q?=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../pages/instrumentClickinUpload/index.tsx | 45 ++- src/recoding/pages/recording/recording.tsx | 327 +++++++++--------- 2 files changed, 215 insertions(+), 157 deletions(-) diff --git a/src/instrument/pages/instrumentClickinUpload/index.tsx b/src/instrument/pages/instrumentClickinUpload/index.tsx index bc6b85c..71c777c 100644 --- a/src/instrument/pages/instrumentClickinUpload/index.tsx +++ b/src/instrument/pages/instrumentClickinUpload/index.tsx @@ -191,10 +191,15 @@ export default class InstrumentClickInUpload extends Component { let { punchInInfo, instrumentDetail } = this.state; let obj = punchInInfo; if (obj.clockImageList.length === 0) { - msg("至少上传一张图片"); + msg("至少上传一张图片!"); + return; + } + if (!obj.clockContent) { + msg("请输入打卡心得!"); return; } + // 批量上传图片 let promiseTasks: any = []; let imgList: any[] = []; obj.clockImageList.map((imgUrl: string) => { @@ -226,6 +231,11 @@ export default class InstrumentClickInUpload extends Component { } } + Taro.showLoading({ + title: "请求中...", + mask: true, + }); + let clockParmas = { clockImageList: imgList, clockContent: obj.clockContent, @@ -238,8 +248,13 @@ export default class InstrumentClickInUpload extends Component { params ); console.log(instrumentRes, "添加仪器成功"); - + // 上传护理记录 + await this.PostNursingLogClock(); + // 上传打卡记录 let res = await InstrumentInfo.apiClock.postInsertClockLog(clockParmas); + + Taro.hideLoading(); + // 打卡完成 if (res.data.code === 200) { msg("打卡成功"); setTimeout(() => { @@ -250,6 +265,32 @@ export default class InstrumentClickInUpload extends Component { } }; + /** 提交护理记录 */ + PostNursingLogClock = async (data: any = null) => { + let { instrumentDetail, currentInfo } = this.state; + + let params = { + instrumentId: instrumentDetail.id, + instrumentName: instrumentDetail.name, + modeId: currentInfo.id, + modeName: currentInfo.modeName, + nursingTime: "00:01:00", + }; + + let res: any = await InstrumentInfo.apiNursingLog.addLog(params); + console.log("PostNursingLogClock", res); + + if (res.data.code === 200) { + let params = { + instrumentId: instrumentDetail.id, + }; + // 上传护理完成的仪器ID + let res = await InstrumentInfo.apiClock.addClockInstrument(params); + console.log(res, "护理完成"); + } + }; + /*** 护理记录 END ***/ + onPlayTap = async () => { let { videoContext } = this.state; videoContext.play(); diff --git a/src/recoding/pages/recording/recording.tsx b/src/recoding/pages/recording/recording.tsx index f3c6f1a..628459d 100644 --- a/src/recoding/pages/recording/recording.tsx +++ b/src/recoding/pages/recording/recording.tsx @@ -61,14 +61,14 @@ export default class Recording extends Component { clockImageList: [], clockContent: "", }, - navigationBarHeight: '', - statusBarHeight: '' + navigationBarHeight: "", + statusBarHeight: "", }; } - componentDidMount() { } + componentDidMount() {} - componentWillUnmount() { } + componentWillUnmount() {} // 格式化时间 getTime(time) { const hour = time.slice(0, 2); @@ -270,15 +270,13 @@ export default class Recording extends Component { this.getClockStatistics(); this.DayTime(); this.setStatusBar(); - } - componentDidShow() { } + componentDidShow() {} - componentDidHide() { } + componentDidHide() {} - async initData() { - } + async initData() {} // 选择年份 onChangeYear(event) { this.setState({ year: event.detail.value }); @@ -294,12 +292,12 @@ export default class Recording extends Component { }; // 跳转到护理报告 toReport(id, recordId, item) { - this.state.bindingInstrumentList.map(instrument => { + this.state.bindingInstrumentList.map((instrument) => { if (instrument.id == id) { setStorageSync("instrument_detail", instrument); } - }) - console.log(item, '查看'); + }); + console.log(item, "查看"); if ([1, 2, 3, 4, 5].includes(item.jumpType)) { this.One(item); @@ -316,22 +314,23 @@ export default class Recording extends Component { } // 打开第一种类型 One = async (item) => { - let ids = Number(item.id) + let ids = Number(item.id); // 获取echarts数据 这个是获取接口更新echarts页面 let res2 = await InstrumentInfo.apiNursingLog.getStatiCDE(ids); - let nursingData = JSON.parse(res2.data.data.nursingData) + let nursingData = JSON.parse(res2.data.data.nursingData); let obj = { modeName: res2.data.data.modeName, - data: nursingData - } + data: nursingData, + }; let report = false; go( "/recoding/pages/face_report_one/face_report_one?id=" + - item.id + - "&report=" + - report + "&obj=" + - JSON.stringify(obj) + item.id + + "&report=" + + report + + "&obj=" + + JSON.stringify(obj) ); }; // 打开第二种类型 @@ -340,64 +339,74 @@ export default class Recording extends Component { let report = false; go( "/recoding/pages/face_report/face_report?id=" + - item.id + - "&recordId=" + item.instrumentId + - "&report=" + - report + item.id + + "&recordId=" + + item.instrumentId + + "&report=" + + report ); }; // 打开第三种类型 three = async (item) => { - this.moistureTest(item) + this.moistureTest(item); }; async moistureTest(allData) { let data = { queryDate: allData.createTime, - instrumentId: allData.instrumentId - } + instrumentId: allData.instrumentId, + }; let res = await InstrumentInfo.fr200.moistureTest(data); - console.log(res,'查看返回数据'); - - let echartsData = res.data.rows + console.log(res, "查看返回数据"); + + let echartsData = res.data.rows; for (let i = 0; i < echartsData.length; i++) { for (let j = i + 1; j < echartsData.length; j++) { - if (echartsData[i].createTime.split(' ')[0] == echartsData[j].createTime.split(' ')[0]) { - let result = Date.parse(echartsData[i].createTime) - Date.parse(echartsData[j].createTime) + if ( + echartsData[i].createTime.split(" ")[0] == + echartsData[j].createTime.split(" ")[0] + ) { + let result = + Date.parse(echartsData[i].createTime) - + Date.parse(echartsData[j].createTime); if (result < 0) { - echartsData.splice(i, 1) + echartsData.splice(i, 1); } else { - echartsData.splice(j, 1) + echartsData.splice(j, 1); } } } } - let gears: any = [] - let eDate: any = [] - console.log(echartsData,'echartsDataechartsData'); - - echartsData.map(item => { - - const result = item.createTime.split(' ')[0].substring(5); - eDate.push(result) - item.nursingData = JSON.parse(item.nursingData) - let level: any = 0 - item.nursingData?.GearData?.map(gear => { - level = level + gear.forehead - }) - level = Math.floor(level / 3) - gears.push(level) - }) + let gears: any = []; + let eDate: any = []; + console.log(echartsData, "echartsDataechartsData"); + + echartsData.map((item) => { + const result = item.createTime.split(" ")[0].substring(5); + eDate.push(result); + item.nursingData = JSON.parse(item.nursingData); + let level: any = 0; + item.nursingData?.GearData?.map((gear) => { + level = level + gear.forehead; + }); + level = Math.floor(level / 3); + gears.push(level); + }); echartsData = { - gears, eDate - } - setStorageSync('moistureEachtsData', JSON.stringify(echartsData)) - - go(`/recoding/pages/moisture_test_report/moisture_test_report?data=${allData.nursingData}&date=${allData.createTime}&modeId=${allData.modeId}&id=${allData.instrumentId}&echartsData=${JSON.stringify(echartsData)}`); + gears, + eDate, + }; + setStorageSync("moistureEachtsData", JSON.stringify(echartsData)); + go( + `/recoding/pages/moisture_test_report/moisture_test_report?data=${ + allData.nursingData + }&date=${allData.createTime}&modeId=${allData.modeId}&id=${ + allData.instrumentId + }&echartsData=${JSON.stringify(echartsData)}` + ); } - // 打开其他类型 AllDevice = async (item) => { console.log("打开其他类型", item); @@ -476,7 +485,6 @@ export default class Recording extends Component { } setStatusBar() { - Taro.getSystemInfoAsync({ success: (res) => { const statusBarHeight = res.statusBarHeight || 0; @@ -511,17 +519,20 @@ export default class Recording extends Component { show, punchInInfo, navigationBarHeight, - statusBarHeight + statusBarHeight, } = this.state; const statusBarHeightRpx = statusBarHeight * 2; const navigationBarHeightRpx = navigationBarHeight * 2; - const height = statusBarHeightRpx + navigationBarHeightRpx + const height = statusBarHeightRpx + navigationBarHeightRpx; return ( - - + { {current === 0 && ( - { onClick={this.onChangeProduct.bind(this, item.id)} > - {item.name} + {item.name} ))} @@ -576,17 +591,17 @@ export default class Recording extends Component { {current === 0 && recordList.length === 0 && ( - + - 暂无数据 + 暂无数据 )} {current === 0 && ( - + {/* @@ -613,12 +628,12 @@ export default class Recording extends Component { */} - + {recordList.map((item: any, index: any) => ( - - - - {item.createTime} + + + + {item.createTime} { {item.instrumentType === 2 && ( { > 回看报告 )} - + - - {item.instrumentName} - - 模式:{item.modeName} - - 护理时间:{item.nursingTime} + + {item.instrumentName} + + 模式:{item.modeName} + + {item.instrumentType === 2 && ( + 护理时间:{item.nursingTime} + )} @@ -667,7 +684,7 @@ export default class Recording extends Component { )} {current === 1 && ( - + {/* { > 暂无数据 */} - - - - 年度打卡统计 + + + + 年度打卡统计 - + {year}年 - + {monthTime.map((item) => ( - + {item.time > 0 && ( - {item.time}天 + {item.time}天 )} - {item.month} + {item.month} ))} - - + + {clockStatistics.map((item) => ( - - - + + + {item.year}年{item.month}月 { item.month )} > - + {" "} {!item.isMore ? "展开更多" : "收起更多"} @@ -738,51 +755,51 @@ export default class Recording extends Component { ? "rotate(180deg)" : "rotate(0deg)", }} - className='more_icon' + className="more_icon" src={require("@/img/arrow-down.png")} - mode='widthFix' + mode="widthFix" > - - - - {item.clockNum} - 本月打卡天数 + + + + {item.clockNum} + 本月打卡天数 - - + + {(item.percentage * 100).toFixed(2)}% - 超越花至用户 + 超越花至用户 - + {item.isMore && item.detail && ( {item.detail.map((obj) => ( - - - + + + {obj.updateTime} - + {obj.clockImg.map((img) => ( ))} - + {/* 小紫弹智能射频仪、花至抗老射频仪PRO{" "} */} {obj.instrumentName === null ? "" : obj.instrumentName} - + {obj.clockContent} @@ -797,8 +814,8 @@ export default class Recording extends Component { )} {!clockShow && ViewAddInstrument === "true" && ( - - + + 前往打卡 {/* @@ -808,64 +825,64 @@ export default class Recording extends Component { )} this.setState({ show: false })}> - + - 今日打卡 - + 今日打卡 + 本月您已打卡 - {clockStatistics[0]?.clockNum}{" "} + {clockStatistics[0]?.clockNum}{" "} 天,超越 - + {(clockStatistics[0]?.percentage * 100).toFixed(1)}% 花至用户 - + {punchInInfo.clockImageList.map((item, index) => ( - - + + ))} {punchInInfo.clockImageList.length < 3 && ( )} - - + + - + {"(" + (punchInInfo.clockContent.length || 0) + "/120)"} - - + + 确认提交 From 722482e8dd80ca5d3e29cc01c582c1e0d0c71396 Mon Sep 17 00:00:00 2001 From: blak-kong <546598185@qq.com> Date: Mon, 25 Mar 2024 16:00:10 +0800 Subject: [PATCH 02/14] =?UTF-8?q?=E4=B8=B4=E6=97=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/recoding/pages/recording/recording.tsx | 25 ---------------------- 1 file changed, 25 deletions(-) diff --git a/src/recoding/pages/recording/recording.tsx b/src/recoding/pages/recording/recording.tsx index f880aa3..5cd93cc 100644 --- a/src/recoding/pages/recording/recording.tsx +++ b/src/recoding/pages/recording/recording.tsx @@ -357,13 +357,7 @@ export default class Recording extends Component { instrumentId: allData.instrumentId, }; let res = await InstrumentInfo.fr200.moistureTest(data); -<<<<<<< HEAD - console.log(res, "查看返回数据"); - let echartsData = res.data.rows; -======= - let echartsData = res.data.rows ->>>>>>> e0ab75bf023ef77e66013692d9b9e57f5e9315cc for (let i = 0; i < echartsData.length; i++) { for (let j = i + 1; j < echartsData.length; j++) { if ( @@ -381,11 +375,8 @@ export default class Recording extends Component { } } } -<<<<<<< HEAD let gears: any = []; let eDate: any = []; - console.log(echartsData, "echartsDataechartsData"); - echartsData.map((item) => { const result = item.createTime.split(" ")[0].substring(5); eDate.push(result); @@ -397,22 +388,6 @@ export default class Recording extends Component { level = Math.floor(level / 3); gears.push(level); }); -======= - let gears: any = [] - let eDate: any = [] - echartsData.map(item => { - - const result = item.createTime.split(' ')[0].substring(5); - eDate.push(result) - item.nursingData = JSON.parse(item.nursingData) - let level: any = 0 - item.nursingData?.GearData?.map(gear => { - level = level + gear.forehead - }) - level = Math.floor(level / 3) - gears.push(level) - }) ->>>>>>> e0ab75bf023ef77e66013692d9b9e57f5e9315cc echartsData = { gears, eDate, From e148e5c48cceafe164c3ca72bbabc82fa8a4b9e9 Mon Sep 17 00:00:00 2001 From: qsj <731458905@qq.com> Date: Mon, 25 Mar 2024 16:07:55 +0800 Subject: [PATCH 03/14] =?UTF-8?q?=E4=B8=B4=E6=97=B6=E6=8F=90=E4=BA=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/moduleIOT/pages/iotCarePlan/FR200.tsx | 10 +++---- .../pages/face_report/face_report.less | 4 +++ .../pages/face_report_one/face_report_one.tsx | 6 ++-- .../moisture_test_report.tsx | 28 +++++++++++++------ src/recoding/pages/recording/recording.tsx | 4 +-- 5 files changed, 32 insertions(+), 20 deletions(-) diff --git a/src/moduleIOT/pages/iotCarePlan/FR200.tsx b/src/moduleIOT/pages/iotCarePlan/FR200.tsx index 8c804e2..c5ae3d8 100644 --- a/src/moduleIOT/pages/iotCarePlan/FR200.tsx +++ b/src/moduleIOT/pages/iotCarePlan/FR200.tsx @@ -747,12 +747,12 @@ class IotCarePlanFR200 extends Component { eDate, }; setStorageSync("moistureEachtsData", JSON.stringify(echartsData)); - + let report =true // go(`/recoding/pages/moisture_test_report/moisture_test_report?data=${allData.nursingData}&date=${allData.createTime}&modeId=${allData.modeId}&id=${allData.instrumentId}&echartsData=${JSON.stringify(echartsData)}`); go( `/recoding/pages/moisture_test_report/moisture_test_report?data=${nursingData}&date=${formattedDate}&modeId=${ActiveModeItemId}&id=${currentDeviceId}&echartsData=${JSON.stringify( echartsData - )}` + )}&report=${report }` ); } @@ -2669,7 +2669,7 @@ class IotCarePlanFR200 extends Component { showFullscreenBtn={false} onLoadedMetaData={this.GetVideosTime} /> - + {errorTips && ( @@ -2714,8 +2714,8 @@ class IotCarePlanFR200 extends Component { onModeLockOpen={this.onModeLockOpen} /> )} - - + {/* + */} diff --git a/src/recoding/pages/face_report/face_report.less b/src/recoding/pages/face_report/face_report.less index 1eb5e22..e181a9d 100644 --- a/src/recoding/pages/face_report/face_report.less +++ b/src/recoding/pages/face_report/face_report.less @@ -139,6 +139,10 @@ page { height: 100% !important; border-radius: 20rpx; } + .showImg:last-child{ + width: 40rpx !important; + height: 40rpx !important; + } } .info4 { position: relative; diff --git a/src/recoding/pages/face_report_one/face_report_one.tsx b/src/recoding/pages/face_report_one/face_report_one.tsx index e68d682..f91a4aa 100644 --- a/src/recoding/pages/face_report_one/face_report_one.tsx +++ b/src/recoding/pages/face_report_one/face_report_one.tsx @@ -17,7 +17,6 @@ import { InstrumentInfo } from "@/utils/Interface"; // 引入ecahrts图表 // import EchartsForm from '@/moduleIOT/pages/iotCarePlan/components/Echart_face' import EchartsForm from '../../../moduleIOT/pages/iotCarePlan/components/Echart_face' -import Echarts1 from '../../../moduleIOT/pages/iotCarePlan/components/Echart' /** 自定义组件 **/ @@ -348,11 +347,10 @@ export default class Index extends Component { {statistics.nursingTime} 本月护理时间 - {/* */} + - { 能量等级图谱-{recordData.modeName} - {/* */} + diff --git a/src/recoding/pages/moisture_test_report/moisture_test_report.tsx b/src/recoding/pages/moisture_test_report/moisture_test_report.tsx index 617950a..656070f 100644 --- a/src/recoding/pages/moisture_test_report/moisture_test_report.tsx +++ b/src/recoding/pages/moisture_test_report/moisture_test_report.tsx @@ -22,6 +22,7 @@ class MoistureTestReport extends Component { this.state = { name: "重新登录", imgUrl: '', + reportShow:true, reportData: { curDate: '', shuifenLevel: { @@ -58,10 +59,16 @@ class MoistureTestReport extends Component { onLoad(option) { console.log(option); - + let Bool = JSON.parse(option?.report) + if(!Bool){ + this.setState({ + reportShow: Bool + }) + } let data = JSON.parse(option.data) let { reportData } = this.state reportData.curDate = option.date + reportData.curDate = option.report data.GearData.map(item => { if (item.name == '额头') { reportData.shuifenLevel.head = item.forehead @@ -92,7 +99,7 @@ class MoistureTestReport extends Component { } render() { - let { name, imgUrl, reportData, reportData1, isClock, xinde, imglist, id, show, modeId, echartsData, showEcharts } = this.state + let { name, imgUrl, reportData, reportData1, reportShow,isClock, xinde, imglist, id, show, modeId, echartsData, showEcharts } = this.state const getStatusData = (level) => { var bgCssData = { @@ -295,13 +302,16 @@ class MoistureTestReport extends Component { - - 继续护理 - - 主页 - - - + {reportShow ? ( + + 继续护理 + + 主页 + + + + ) : null} + ); diff --git a/src/recoding/pages/recording/recording.tsx b/src/recoding/pages/recording/recording.tsx index 6c49b82..8e1b9be 100644 --- a/src/recoding/pages/recording/recording.tsx +++ b/src/recoding/pages/recording/recording.tsx @@ -388,8 +388,8 @@ export default class Recording extends Component { gears, eDate } setStorageSync('moistureEachtsData', JSON.stringify(echartsData)) - - go(`/recoding/pages/moisture_test_report/moisture_test_report?data=${allData.nursingData}&date=${allData.createTime}&modeId=${allData.modeId}&id=${allData.instrumentId}&echartsData=${JSON.stringify(echartsData)}`); + let report =false + go(`/recoding/pages/moisture_test_report/moisture_test_report?data=${allData.nursingData}&date=${allData.createTime}&modeId=${allData.modeId}&id=${allData.instrumentId}&echartsData=${JSON.stringify(echartsData)}&report=${report }`); } From 8922944cccb9fb2e4c006accb7e208234972ca82 Mon Sep 17 00:00:00 2001 From: qsj <731458905@qq.com> Date: Mon, 25 Mar 2024 18:26:35 +0800 Subject: [PATCH 04/14] =?UTF-8?q?=E4=BF=AE=E6=94=B9bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../face_report_one/face_report_one.less | 27 +++++++++++-------- .../pages/face_report_one/face_report_one.tsx | 22 ++++++++++++--- .../moisture_test_report.tsx | 27 ++++++++++--------- src/recoding/pages/recording/recording.tsx | 6 ++--- 4 files changed, 53 insertions(+), 29 deletions(-) diff --git a/src/recoding/pages/face_report_one/face_report_one.less b/src/recoding/pages/face_report_one/face_report_one.less index a96cb79..c8bce06 100644 --- a/src/recoding/pages/face_report_one/face_report_one.less +++ b/src/recoding/pages/face_report_one/face_report_one.less @@ -82,6 +82,7 @@ page { .text-title{ font-size: 18rpx; color: #999999; + margin: 8rpx 0rpx; } .main { border-radius: 30rpx; @@ -179,6 +180,10 @@ page { height: 100% !important; border-radius: 20rpx; } + .showImg:last-child{ + width: 40rpx !important; + height: 40rpx !important; + } } .info4 { position: relative; @@ -309,18 +314,18 @@ page { // background-color: red; } -.content { - display: flex; - flex-flow: column; - justify-content: space-between; - background-color: #f8f8f8; - border-radius: 30rpx; - padding: 21rpx; - border-radius: 20rpx; - width: 457rpx; - height: 195rpx; +// .content { +// display: flex; +// flex-flow: column; +// justify-content: space-between; +// background-color: #f8f8f8; +// border-radius: 30rpx; +// padding: 21rpx; +// border-radius: 20rpx; +// width: 457rpx; +// height: 195rpx; -} +// } .content_top{ height: 140rpx; diff --git a/src/recoding/pages/face_report_one/face_report_one.tsx b/src/recoding/pages/face_report_one/face_report_one.tsx index f91a4aa..e78f5c9 100644 --- a/src/recoding/pages/face_report_one/face_report_one.tsx +++ b/src/recoding/pages/face_report_one/face_report_one.tsx @@ -212,6 +212,8 @@ export default class Index extends Component { if (res.data.code === 200) { this.state.clockStatistics.map((item) => { + console.log(item,'iiiiiiii',id); + if (item.id === id) { item.detail = res.data.data; item.detail.map((obj) => { @@ -257,13 +259,27 @@ export default class Index extends Component { punchInInfo.clockImageList.splice(i, 1); this.setState({ punchInInfo }); } - getRouteId() { + async getRouteId() { + let clockStatistics =this.state.clockStatistics const searchParams = new URLSearchParams(window.location.search); const id = searchParams.get("id"); const recordId = searchParams.get("recordId"); this.getStatistics(id); - // this.getRecord(id, recordId); - // console.log(recordId); + let res1 = await InstrumentInfo.apiClock.getLatestClockRecord(); + + let obj:any ={} + obj.detail = res1.data.data; + obj.updateTime = getdates(res1.data.data.updateTime).replace(/-/g, "."); + let arr:any =[] + arr.push(obj) + + this.setState({ clockStatistics:arr }); + +setTimeout(function() { + +}, ) + + } getTime(time) { const hour = time.slice(0, 2); diff --git a/src/recoding/pages/moisture_test_report/moisture_test_report.tsx b/src/recoding/pages/moisture_test_report/moisture_test_report.tsx index 656070f..4f95a06 100644 --- a/src/recoding/pages/moisture_test_report/moisture_test_report.tsx +++ b/src/recoding/pages/moisture_test_report/moisture_test_report.tsx @@ -22,7 +22,7 @@ class MoistureTestReport extends Component { this.state = { name: "重新登录", imgUrl: '', - reportShow:true, + reportShow: true, reportData: { curDate: '', shuifenLevel: { @@ -60,7 +60,7 @@ class MoistureTestReport extends Component { onLoad(option) { console.log(option); let Bool = JSON.parse(option?.report) - if(!Bool){ + if (!Bool) { this.setState({ reportShow: Bool }) @@ -99,7 +99,7 @@ class MoistureTestReport extends Component { } render() { - let { name, imgUrl, reportData, reportData1, reportShow,isClock, xinde, imglist, id, show, modeId, echartsData, showEcharts } = this.state + let { name, imgUrl, reportData, reportData1, reportShow, isClock, xinde, imglist, id, show, modeId, echartsData, showEcharts } = this.state const getStatusData = (level) => { var bgCssData = { @@ -272,7 +272,10 @@ class MoistureTestReport extends Component { 促渗档位推荐 - 前往护理 + {reportShow ? ( + 前往护理 + ) : null} + @@ -303,15 +306,15 @@ class MoistureTestReport extends Component { {reportShow ? ( - - 继续护理 - - 主页 - - - + + 继续护理 + + 主页 + + + ) : null} - + ); diff --git a/src/recoding/pages/recording/recording.tsx b/src/recoding/pages/recording/recording.tsx index 9768892..9d39d6a 100644 --- a/src/recoding/pages/recording/recording.tsx +++ b/src/recoding/pages/recording/recording.tsx @@ -322,7 +322,7 @@ export default class Recording extends Component { modeName: res2.data.data.modeName, data: nursingData, }; - let report = false; + let report = true; go( "/recoding/pages/face_report_one/face_report_one?id=" + @@ -336,7 +336,7 @@ export default class Recording extends Component { // 打开第二种类型 two = async (item) => { console.log("打开第二种类型", item); - let report = false; + let report = true; go( "/recoding/pages/face_report/face_report?id=" + item.id + @@ -724,7 +724,7 @@ export default class Recording extends Component { {clockStatistics.map((item) => ( - + {item.year}年{item.month}月 Date: Mon, 25 Mar 2024 18:29:26 +0800 Subject: [PATCH 05/14] =?UTF-8?q?=E4=BF=AE=E6=94=B9bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/recoding/pages/recording/recording.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/recoding/pages/recording/recording.tsx b/src/recoding/pages/recording/recording.tsx index 9d39d6a..bcef546 100644 --- a/src/recoding/pages/recording/recording.tsx +++ b/src/recoding/pages/recording/recording.tsx @@ -322,7 +322,7 @@ export default class Recording extends Component { modeName: res2.data.data.modeName, data: nursingData, }; - let report = true; + let report = false; go( "/recoding/pages/face_report_one/face_report_one?id=" + @@ -336,7 +336,7 @@ export default class Recording extends Component { // 打开第二种类型 two = async (item) => { console.log("打开第二种类型", item); - let report = true; + let report = false; go( "/recoding/pages/face_report/face_report?id=" + item.id + 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 06/14] =?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}年 From fe8fc9fd829c97dab947e42074613d07432530b2 Mon Sep 17 00:00:00 2001 From: blak-kong <546598185@qq.com> Date: Tue, 26 Mar 2024 15:12:14 +0800 Subject: [PATCH 07/14] . --- src/moduleIOT/pages/iotCarePlan/FR200.tsx | 42 +++++++++++++++++-- .../iotCarePlan/components/ModeList/FR200.tsx | 1 - 2 files changed, 39 insertions(+), 4 deletions(-) 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(); // 点击了锁定模式 From 73e792cabb3dd09ced24c09ef31c8d7c6050dd7b Mon Sep 17 00:00:00 2001 From: qsj <731458905@qq.com> Date: Tue, 26 Mar 2024 15:23:01 +0800 Subject: [PATCH 08/14] =?UTF-8?q?=E4=BF=AE=E6=94=B9bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../pages/face_report/face_report.tsx | 17 +++-- .../pages/face_report_one/face_report_one.tsx | 68 ++++--------------- 2 files changed, 27 insertions(+), 58 deletions(-) diff --git a/src/recoding/pages/face_report/face_report.tsx b/src/recoding/pages/face_report/face_report.tsx index 69cefe4..26bb22c 100644 --- a/src/recoding/pages/face_report/face_report.tsx +++ b/src/recoding/pages/face_report/face_report.tsx @@ -67,9 +67,9 @@ export default class Index extends Component { async getStatistics(id) { let data = {}; if (id != null) { - data["instrumentId"] = id; + data["nursingId"] = id; } - let res = await InstrumentInfo.apiNursingLog.getStatistics(data); + let res = await InstrumentInfo.apiNursingLog.getStatisticsFace(data); if (res.data.code === 200) { this.setState({ statistics: res.data.data }); @@ -193,7 +193,6 @@ export default class Index extends Component { }; let res = await InstrumentInfo.apiClock.getList(data); if (res.data.code === 200) { - console.log(this.state.clockStatistics, 88888); this.state.clockStatistics.map((item) => { if (item.id === id) { @@ -241,12 +240,20 @@ export default class Index extends Component { punchInInfo.clockImageList.splice(i, 1); this.setState({ punchInInfo }); } - getRouteId() { + async getRouteId() { + let punchInInfo =this.state.punchInInfo const searchParams = new URLSearchParams(window.location.search); const id = searchParams.get("id"); const recordId = searchParams.get("recordId"); this.getStatistics(id); this.getRecord(id, recordId); + let res1 = await InstrumentInfo.apiClock.getLatestClockRecord(); + punchInInfo.clockContent =res1.data.data.clockContent + punchInInfo.clockImageList =res1.data.data.clockImg + + + this.setState({ punchInInfo }); + // 获取图片和文本 console.log(recordId); } getTime(time) { @@ -262,7 +269,7 @@ export default class Index extends Component { } async onLoad(options) { console.log(options, "查看传过来的参数"); - + let Bool = JSON.parse(options?.report); if (!Bool) { this.setState({ diff --git a/src/recoding/pages/face_report_one/face_report_one.tsx b/src/recoding/pages/face_report_one/face_report_one.tsx index e78f5c9..7f8d8b6 100644 --- a/src/recoding/pages/face_report_one/face_report_one.tsx +++ b/src/recoding/pages/face_report_one/face_report_one.tsx @@ -81,16 +81,7 @@ export default class Index extends Component { data["nursingId"] = ids; } let res = await InstrumentInfo.apiNursingLog.getStatisticsFace(data); - // // 获取echarts数据 这个是获取接口更新echarts页面 - // let res2 = await InstrumentInfo.apiNursingLog.getStatiCDE(ids); - // let nursingData=JSON.parse(res2.data.data.nursingData) - // let obj ={ - // modeName:res2.data.data.modeName, - // data:nursingData - // } - // this.init({ - // obj:JSON.stringify(obj) - // }) + if (res.data.code === 200) { this.setState({ statistics: res.data.data }); } @@ -168,38 +159,13 @@ export default class Index extends Component { res.data.data.reverse(); if (res.data.data.length > 0) { - res.data.data.map((item, index) => { - item.isMore = false; - item.detail = []; - if (index === 0) { - item.isMore = true; - this.getList(item.id, item.year, item.month); - } - this.state.monthTime.map((monthItem) => { - if (monthItem.month == item.month) { - monthItem.time = item.clockNum; - } - }); - }); - this.setState({ monthTime: this.state.monthTime }); - } else { - let monthTime = [ - { month: 1, time: 0 }, - { month: 2, time: 0 }, - { month: 3, time: 0 }, - { month: 4, time: 0 }, - { month: 5, time: 0 }, - { month: 6, time: 0 }, - { month: 7, time: 0 }, - { month: 8, time: 0 }, - { month: 9, time: 0 }, - { month: 10, time: 0 }, - { month: 11, time: 0 }, - { month: 12, time: 0 }, - ]; - this.setState({ monthTime }); - } - this.setState({ clockStatistics: res.data.data }); + let clockStatistics = this.state.clockStatistics + clockStatistics=res.data.data + + + this.setState({ clockStatistics }); + } + } } // 获取当月打卡记录 @@ -212,8 +178,7 @@ export default class Index extends Component { if (res.data.code === 200) { this.state.clockStatistics.map((item) => { - console.log(item,'iiiiiiii',id); - + if (item.id === id) { item.detail = res.data.data; item.detail.map((obj) => { @@ -260,20 +225,17 @@ export default class Index extends Component { this.setState({ punchInInfo }); } async getRouteId() { - let clockStatistics =this.state.clockStatistics + let punchInInfo =this.state.punchInInfo const searchParams = new URLSearchParams(window.location.search); const id = searchParams.get("id"); const recordId = searchParams.get("recordId"); this.getStatistics(id); let res1 = await InstrumentInfo.apiClock.getLatestClockRecord(); - - let obj:any ={} - obj.detail = res1.data.data; - obj.updateTime = getdates(res1.data.data.updateTime).replace(/-/g, "."); - let arr:any =[] - arr.push(obj) + punchInInfo.clockContent =res1.data.data.clockContent + punchInInfo.clockImageList =res1.data.data.clockImg + - this.setState({ clockStatistics:arr }); + this.setState({ punchInInfo }); setTimeout(function() { @@ -302,7 +264,7 @@ setTimeout(function() { } this.init(options) this.getRouteId(); - // this.getClockStatistics() + this.getClockStatistics() } init(options){ From 71d57fc628d4583b10a2d3943bf73c75a3d33b5f Mon Sep 17 00:00:00 2001 From: blak-kong <546598185@qq.com> Date: Tue, 26 Mar 2024 18:02:02 +0800 Subject: [PATCH 09/14] . --- src/moduleIOT/pages/iotCarePlan/FR200.tsx | 297 +-------------- .../iotCarePlan/components/Bluetoot/FR200.ts | 357 ++++++++++++++++++ 2 files changed, 374 insertions(+), 280 deletions(-) create mode 100644 src/moduleIOT/pages/iotCarePlan/components/Bluetoot/FR200.ts diff --git a/src/moduleIOT/pages/iotCarePlan/FR200.tsx b/src/moduleIOT/pages/iotCarePlan/FR200.tsx index 774d027..ff050d4 100644 --- a/src/moduleIOT/pages/iotCarePlan/FR200.tsx +++ b/src/moduleIOT/pages/iotCarePlan/FR200.tsx @@ -22,10 +22,7 @@ import { Button, } from "@tarojs/components"; -import { - notifyBLECharacteristicValueChange, - sendCommand, -} from "@/utils/bluetoothWXAPI"; +import { sendCommand } from "@/utils/bluetoothWXAPI"; import { deviceCommandSamples, bleCommandSamples, @@ -69,6 +66,8 @@ import Gears from "./components/Gears"; import "./FR200.less"; +import BluetoothContainer from "./components/Bluetoot/FR200"; + const deviceToolKitInstanceFR200 = new DeviceToolKitWM("FR200"); let deviceToolKitInstance = deviceToolKitInstanceFR200; @@ -469,9 +468,16 @@ class IotCarePlanFR200 extends Component { // 监听蓝牙连接状态改变 Taro.onBLEConnectionStateChange(this.listener); - await this.notifyBLECharacteristicValueChange(); + let bluetoothContainer = new BluetoothContainer( + this.props.bluetoothInfo, + deviceToolKitInstance, + this + ); + bluetoothContainer.notifyBLECharacteristicValueChange(); - // this.handleWorkStatus(false, MODE_WORKING_ENUM.STANDBY); + setTimeout(() => { + this.handleWorkStatus(false, MODE_WORKING_ENUM.STANDBY); + }, 1000); } listener = (res) => { console.log("listener res", res); @@ -973,275 +979,6 @@ class IotCarePlanFR200 extends Component { } }; - // 蓝牙特征更改 - notifyBLECharacteristicValueChange = () => { - console.log("notifyBLECharacteristicValueChange deviceInfo 参数为=>"); - const bluetoothInfo = this.props.bluetoothInfo; - notifyBLECharacteristicValueChange({ - deviceId: bluetoothInfo.deviceId, - servicesuuid: bluetoothInfo.servicesuuid, - characteristicsuuid1: bluetoothInfo.characteristicsuuid1, - characteristicsuuid0: bluetoothInfo.characteristicsuuid0, - }).then((res) => { - Taro.onBLECharacteristicValueChange((value) => { - const jsonStatus: any = deviceToolKitInstance.toJsonStatus(value.value); - console.log( - "onBLECharacteristicValueChange jsonStatus => ", - jsonStatus - ); - if (!jsonStatus || jsonStatus == null) { - return; - } - this.workStatus = jsonStatus.workStatus; // 记录工作状态 - // end 和 endWork 都是护理结束, endWork不关机, end 关机, 对小程序而言处理流程都一样 - if (jsonStatus.workStatus && jsonStatus.workStatus == "endWork") { - jsonStatus.workStatus = "end"; - console.log(jsonStatus.workStatus, "护理结束"); - } - - switch (jsonStatus?.commandType) { - //设备配对和连接的返回 - case "BleMatch": - // 蓝牙相关指令 - this.switchBLEMatch(jsonStatus); - break; - //设备状态同步 - case "DeviceStatusSync": - if (jsonStatus.battery) { - // 防止抖动 - this.setState({ - Electricity: jsonStatus.battery, - }); - } - - switch (jsonStatus.workStatus) { - case "standby": - //设备的待机状态 可能workMode字段为空 - console.log("设备状态同步 待机状态", jsonStatus); - if (this.BaseModeType.includes(jsonStatus.workMode)) { - this.openTips("检测到您的设备没有紧贴肌肤,请紧贴肌肤"); - } - break; - case "pause": - //设备的暂停状态 - console.log("设备状态同步 暂停状态", jsonStatus); - if (this.BaseModeType.includes(jsonStatus.workMode)) { - this.openTips( - "检测到您的设备没有紧贴肌肤,请紧贴肌肤后重新尝试" - ); - } - break; - case "working": - //设备的运行中状态 - console.log("设备状态同步 工作中状态", jsonStatus.workMode); - - // 脸部模式 - if (this.BaseModeType.includes(jsonStatus.workMode)) { - this.closeTips(); - } - - break; - default: - break; - } - if (jsonStatus.workMode === "moistureTest") { - if ("success" === jsonStatus.testStatus) { - let waterStepList = this.state.waterStepList; - // 到达第几个step - let waterStepIndex = this.state.waterStepIndex; - - // 代表5秒以后最后拿到的结果 - if (waterStepList[waterStepIndex].finish) { - // 获取等级 - waterStepList[waterStepIndex].forehead = - jsonStatus.waterLevel; - // 检测完成 - if (waterStepIndex === 2) { - this.setState({ - isRuningTest: 4, - }); - } else { - // 启动检测 - this.setState({ - isRuningTest: 1, - }); - } - // 一共有3条数据 - let num = waterStepIndex; - if (waterStepIndex < 2) { - num = waterStepIndex + 1; - this.waterTestNext(num); - } - this.setState({ - waterStepIndex: num, - waterStepList, - }); - } - } else { - let waterStepList = this.state.waterStepList; - let waterStepIndex = this.state.waterStepIndex; - // 5秒后获取的结果 - if (waterStepList[waterStepIndex].finish) { - // 获取失败后,把进度条清理0 - waterStepList[waterStepIndex].schedule = 0; - waterStepList[waterStepIndex].finish = false; - this.setState({ - waterStepList, - isRuningTest: 3, - }); - } - } - // 水分测试 - // testStatus:success - } - - console.log("设备运行中?", this.isRuning); - if (jsonStatus?.workMode === this.state.ActiveModeItem.modeType) { - if (this.state.workMode !== jsonStatus?.workMode) { - this.setState({ - workMode: jsonStatus?.workMode, // 仅当设备上报模式与小程序一致时,才允许改变小程序变量缓存 - }); - } - - // 判断设备是否在运行中(护理中) - // 仅当设备模式与小程序是否一致,才允许更改设备运行时间 - if (this.isRuning) { - if ( - this.state.DeviceConnectStatus === 1 && - jsonStatus.workStatus !== MODE_WORKING_ENUM.END - ) { - // 水分测试手动检测时间,不自动计算倒计时 - if (jsonStatus?.workMode !== "moistureTest") - this.updateDeviceSyncData( - { - totalWorkingMinutes: jsonStatus.totalWorkingMinutes, - totalWorkingSeconds: jsonStatus.totalWorkingSeconds, - }, - jsonStatus - ); - } - } - } - - break; - //设备对控制指令的响应 - case "DeviceControl": - console.log("设备控制响应", jsonStatus); - if (jsonStatus.responseStatus == "OK") { - console.log("发送控制指令成功"); - this.workJsonStatus = jsonStatus; - this.workStatus = jsonStatus.workStatus; - - setTimeout(() => console.log("this.workStatus", this.workStatus)); - if (jsonStatus.battery) { - this.setState({ - Electricity: jsonStatus.battery, - }); - } - - // 判断设备主动上报的关机事件 - if (jsonStatus.workStatus === MODE_WORKING_ENUM.END) { - // 判断id是否一致, 一致的话则生成护理报表, 并提示 - if (jsonStatus.id == this.FR200NursingHistory.id) { - debounce( - this.checkInstrumentRecord.bind(this, jsonStatus), - 500 - ); - } - return; - } - - if (jsonStatus?.workMode === this.state.ActiveModeItem.modeType) { - this.setState({ - workMode: jsonStatus?.workMode, // 仅当设备上报模式与小程序一致时,才允许改变小程序变量缓存 - }); - - // 判断是否在isRuning(护理中) - // 仅当设备模式与小程序是否一致,才允许更改设备运行时间 - if ( - this.state.DeviceConnectStatus === 1 && - this.isRuning && - jsonStatus.workStatus !== MODE_WORKING_ENUM.END - ) { - this.updateDeviceSyncData( - { - totalWorkingMinutes: jsonStatus.totalWorkingMinutes, - totalWorkingSeconds: jsonStatus.totalWorkingSeconds, - }, - jsonStatus - ); - } - } - - if ( - jsonStatus.workMode === MODE_WORKING_ENUM.WORKING && - this.isRuning - ) { - const { ActiveModeItem } = this.state; - const item = ActiveModeItem; - if (jsonStatus.workMode !== item.modeType) { - clearTimeout(loadingTipsTimer); - this.setState({ - isShowCountdown: false, - }); - } - } - } - break; - // 设备对信息查询指令的响应 - case "InfoQuery": - console.log("设备对信息查询指令的响应 InfoQuery", jsonStatus); - switch (jsonStatus.infoQueryType) { - // 离线记录 - case "offlineClockInInfo": - console.log("离线记录", jsonStatus); - break; - // 版本信息 - case "versionInfo": - console.log("版本信息", jsonStatus); - break; - // 时间同步 - case "timeSync": - console.log("时间同步", jsonStatus); - break; - default: - break; - } - break; - default: - break; - } - }); - - /** - * 延迟600毫秒获取附属设备状态 - */ - const querySubDeviceArrayBuffer = deviceToolKitInstance.toBleCommand({ - ...bleCommandSamples.querySubDevice, - queryType: "WL200", - } as any); - setTimeout(() => { - console.log("发送查询附属设备指令 querySubDeviceArrayBuffer"); - sendCommand({ - value: querySubDeviceArrayBuffer, - }); - }, 600); - - /** - * 延迟500毫秒获取设备电量 - */ - const queryDeviceArrayBuffer = deviceToolKitInstance.toBleCommand( - bleCommandSamples.queryDeviceStatus as any - ); - setTimeout(() => { - console.log("发送查询设备电量指令"); - sendCommand({ - value: queryDeviceArrayBuffer, - }); - }, 500); - }); - }; - /**监听关机事件*/ onEndDevice = () => { this.rmFR200NursingHistory(this.FR200NursingHistory, true); @@ -1270,15 +1007,15 @@ class IotCarePlanFR200 extends Component { const { totalWorkingMinutes, totalWorkingSeconds } = DeviceSyncData; let { ActiveModeItem, currentTime } = this.state; const totalTime = totalWorkingMinutes * 60 + totalWorkingSeconds; - console.log("仪器上报的已经运行的总秒数", totalTime); - console.log("时间校准频率,默认5秒一次", TIME_CALIBRATION_FREQUENCY); + // console.log("仪器上报的已经运行的总秒数", totalTime); + // console.log("时间校准频率,默认5秒一次", TIME_CALIBRATION_FREQUENCY); //对比仪器上报运行的总秒数 和小程序页面运行的已经运行的总秒数,如果不一致就进行校准 let sceneTime = ActiveModeItem?.breakTimeStr ? minSecToS(ActiveModeItem.breakTimeStr) : minSecToS(this.state.currentVideoTime); // 场景时间 - console.log("场景时间 sceneTime", sceneTime); - console.log("当前显示时间 currentTime", currentTime); + // console.log("场景时间 sceneTime", sceneTime); + // console.log("当前显示时间 currentTime", currentTime); console.log("设备运行时间 totalTime", totalTime); // 更新界面倒计时 @@ -2137,7 +1874,7 @@ class IotCarePlanFR200 extends Component { } Taro.setStorageSync("FR200NursingHistory", params); - console.log("更新updateFR200NursingHistory"); + // console.log("更新updateFR200NursingHistory"); // 基础模式可在这里调用函数更新图标Echarts // 最新一条数据jsonStatus diff --git a/src/moduleIOT/pages/iotCarePlan/components/Bluetoot/FR200.ts b/src/moduleIOT/pages/iotCarePlan/components/Bluetoot/FR200.ts new file mode 100644 index 0000000..e6d1c77 --- /dev/null +++ b/src/moduleIOT/pages/iotCarePlan/components/Bluetoot/FR200.ts @@ -0,0 +1,357 @@ +import Taro from "@tarojs/taro"; +import { debounce } from "lodash"; + +import { + notifyBLECharacteristicValueChange, + sendCommand, +} from "@/utils/bluetoothWXAPI"; +import { + deviceCommandSamples, + bleCommandSamples, +} from "@/components/bluetoot/connection/wl200"; + +/** 基础版:脸部/眼部/PRO 设备使用时,会自动开启暂停 */ +const BaseModeType: string[] = [ + "face", + "eyes", + "nasolabialFold", + "mandibularLine", + "headLiftingPro", +]; + +/** + * @name 蓝牙控制函数 + * @description 响应功能需要直接修改私有函数,仅仅是蓝牙解耦,将从页面中抽离出来。 +*/ +export default class BluetoothContainer { + bluetoothInfo: any; + deviceToolKitInstance: any; + that: any; + counter: number = 0; // 初始化后,同步执行次数 + + constructor(bluetoothInfo: any, deviceToolKitInstance: any, that: any) { + this.bluetoothInfo = bluetoothInfo; + this.deviceToolKitInstance = deviceToolKitInstance; + this.that = that; + } + + + /** @name 设备响应:待机 */ + private syncStandby(jsonStatus) { + if (BaseModeType.includes(jsonStatus.workMode)) { + this.that.openTips("检测到您的设备没有紧贴肌肤,请紧贴肌肤"); + } + } + + /** @name 设备响应:工作 */ + private syncWorking(jsonStatus) { + // 脸部模式 + if (BaseModeType.includes(jsonStatus.workMode)) { + this.that.closeTips(); + } + } + + /** @name 设备响应:暂停 */ + private syncPause(jsonStatus) { + if (BaseModeType.includes(jsonStatus.workMode)) { + this.that.openTips( + "检测到您的设备没有紧贴肌肤,请紧贴肌肤后重新尝试" + ); + } + } + + + /** @name 查询信息响应 */ + private InfoQuery = { + /** @name 设备响应:离线记录 */ + syncOfflineClockInInfo: function (jsonStatus) { + console.log("离线记录", jsonStatus); + }, + /** @name 设备响应:版本信息 */ + syncVersionInfo: function (jsonStatus) { + console.log("版本信息", jsonStatus); + }, + /** @name 设备响应:时间同步 */ + syncTimeSync: function (jsonStatus) { + console.log("时间同步", jsonStatus); + } + } + + /** @name 设备响应:通用状态响应 */ + private syncCommonStatus(jsonStatus) { + // 1.判断是否水分测试 + if (jsonStatus.workMode === "moistureTest") { + if (jsonStatus.testStatus === "success") { + let waterStepList = this.that.state.waterStepList; + // 到达第几个step + let waterStepIndex = this.that.state.waterStepIndex; + + // 代表5秒以后最后拿到的结果 + if (waterStepList[waterStepIndex].finish) { + // 获取等级 + waterStepList[waterStepIndex].forehead = + jsonStatus.waterLevel; + // 检测完成 + if (waterStepIndex === 2) { + this.that.setState({ + isRuningTest: 4, + }); + } else { + // 启动检测 + this.that.setState({ + isRuningTest: 1, + }); + } + // 一共有3条数据 + let num = waterStepIndex; + if (waterStepIndex < 2) { + num = waterStepIndex + 1; + this.that.waterTestNext(num); + } + this.that.setState({ + waterStepIndex: num, + waterStepList, + }); + } + } else { + let waterStepList = this.that.state.waterStepList; + let waterStepIndex = this.that.state.waterStepIndex; + // 5秒后获取的结果 + if (waterStepList[waterStepIndex].finish) { + // 获取失败后,把进度条清理0 + waterStepList[waterStepIndex].schedule = 0; + waterStepList[waterStepIndex].finish = false; + this.that.setState({ + waterStepList, + isRuningTest: 3, + }); + } + } + } + + // 2.判断工作状态是否与选中仪器一致 + if (jsonStatus?.workMode === this.that.state.ActiveModeItem.modeType) { + if (this.that.state.workMode !== jsonStatus?.workMode) { + this.that.setState({ + workMode: jsonStatus?.workMode, // 仅当设备上报模式与小程序一致时,才允许改变小程序变量缓存 + }); + } + // 判断设备是否在运行中(护理中) + // 仅当设备模式与小程序是否一致,才允许更改设备运行时间 + if (this.that.isRuning) { + if ( + this.that.state.DeviceConnectStatus === 1 && + jsonStatus.workStatus !== 'end' + ) { + // 水分测试手动检测时间,不自动计算倒计时 + if (jsonStatus?.workMode !== "moistureTest") + this.that.updateDeviceSyncData( + { + totalWorkingMinutes: jsonStatus.totalWorkingMinutes, + totalWorkingSeconds: jsonStatus.totalWorkingSeconds, + }, + jsonStatus + ); + } + } + } + } + + /** @name 设备响应:控制指令响应 */ + private syncDeviceControl(jsonStatus) { + console.log("设备控制响应", jsonStatus); + if (jsonStatus.responseStatus == "OK") { + console.log("发送控制指令成功"); + this.that.workJsonStatus = jsonStatus; + this.that.workStatus = jsonStatus.workStatus; + + setTimeout(() => console.log("this.workStatus", this.that.workStatus)); + if (jsonStatus.battery) { + this.that.setState({ + Electricity: jsonStatus.battery, + }); + } + + // 判断设备主动上报的关机事件 + if (jsonStatus.workStatus === 'end') { + // 判断id是否一致, 一致的话则生成护理报表, 并提示 + if (jsonStatus.id == this.that.FR200NursingHistory.id) { + debounce( + this.that.checkInstrumentRecord.bind(this, jsonStatus), + 500 + ); + } + return; + } + + if (jsonStatus?.workMode === this.that.state.ActiveModeItem.modeType) { + this.that.setState({ + workMode: jsonStatus?.workMode, // 仅当设备上报模式与小程序一致时,才允许改变小程序变量缓存 + }); + + // 判断是否在isRuning(护理中) + // 仅当设备模式与小程序是否一致,才允许更改设备运行时间 + if ( + this.that.state.DeviceConnectStatus === 1 && + this.that.isRuning && + jsonStatus.workStatus !== 'end' + ) { + this.that.updateDeviceSyncData( + { + totalWorkingMinutes: jsonStatus.totalWorkingMinutes, + totalWorkingSeconds: jsonStatus.totalWorkingSeconds, + }, + jsonStatus + ); + } + } + + if ( + jsonStatus.workMode === 'working' && + this.that.isRuning + ) { + const { ActiveModeItem } = this.that.state; + const item = ActiveModeItem; + if (jsonStatus.workMode !== item.modeType) { + // clearTimeout(loadingTipsTimer); + this.that.setState({ + isShowCountdown: false, + }); + } + } + } + } + + + + + + notifyBLECharacteristicValueChange() { + notifyBLECharacteristicValueChange({ + deviceId: this.bluetoothInfo.deviceId, + servicesuuid: this.bluetoothInfo.servicesuuid, + characteristicsuuid1: this.bluetoothInfo.characteristicsuuid1, + characteristicsuuid0: this.bluetoothInfo.characteristicsuuid0, + }).then((res) => { + Taro.onBLECharacteristicValueChange((value) => { + const jsonStatus: any = this.deviceToolKitInstance.toJsonStatus(value.value); + console.log("onBLECharacteristicValueChange 订阅改变:", jsonStatus); + if (!jsonStatus || jsonStatus == null) { + return; + } + this.that.workStatus = jsonStatus.workStatus; // 记录工作状态 + + // end 和 endWork 都是护理结束, endWork不关机, end 关机, 对小程序而言处理流程都一样 + if (jsonStatus.workStatus && jsonStatus.workStatus == "endWork") { + jsonStatus.workStatus = "end"; + console.log(jsonStatus.workStatus, "护理结束"); + } + + switch (jsonStatus?.commandType) { + //设备配对和连接的返回 + case "BleMatch": + // 蓝牙相关指令 + this.that.switchBLEMatch(jsonStatus); + break; + //设备状态同步 + case "DeviceStatusSync": + if (jsonStatus.battery) { + // 防止抖动 + this.that.setState({ + Electricity: jsonStatus.battery, + }); + } + + switch (jsonStatus.workStatus) { + case "standby": + //设备的待机状态 可能workMode字段为空 + + this.syncStandby(jsonStatus) + break; + case "pause": + this.syncPause(jsonStatus) + break; + case "working": + this.syncWorking(jsonStatus) + break; + default: + break; + } + + this.syncCommonStatus(jsonStatus); + break; + //设备对控制指令的响应 + case "DeviceControl": + this.syncDeviceControl(jsonStatus); + break; + // 设备对信息查询指令的响应 + case "InfoQuery": + console.log("设备对信息查询指令的响应 InfoQuery", jsonStatus); + switch (jsonStatus.infoQueryType) { + // 离线记录 + case "offlineClockInInfo": + this.InfoQuery.syncOfflineClockInInfo(jsonStatus); + break; + // 版本信息 + case "versionInfo": + this.InfoQuery.syncVersionInfo(jsonStatus); + break; + // 时间同步 + case "timeSync": + this.InfoQuery.syncTimeSync(jsonStatus); + break; + default: + break; + } + break; + default: + break; + } + }); + + + if (this.counter < 3) { + /** + * 延迟600毫秒获取附属设备状态 + */ + const querySubDeviceArrayBuffer = this.deviceToolKitInstance.toBleCommand({ + ...bleCommandSamples.querySubDevice, + queryType: "WL200", + } as any); + setTimeout(() => { + console.log("发送查询附属设备指令 querySubDeviceArrayBuffer"); + sendCommand({ + value: querySubDeviceArrayBuffer, + }); + }, 600); + + /** + * 延迟500毫秒获取设备电量 + */ + const queryDeviceArrayBuffer = this.deviceToolKitInstance.toBleCommand( + bleCommandSamples.queryDeviceStatus as any + ); + setTimeout(() => { + console.log("发送查询设备电量指令"); + sendCommand({ + value: queryDeviceArrayBuffer, + }); + }, 500); + this.counter++; + } else { + /** + * 延迟500毫秒获取设备电量 + */ + const queryDeviceArrayBuffer = this.deviceToolKitInstance.toBleCommand( + bleCommandSamples.queryDeviceStatus as any + ); + setTimeout(() => { + console.log("发送查询设备电量指令"); + sendCommand({ + value: queryDeviceArrayBuffer, + }); + }, 20000); + } + }); + } +} \ No newline at end of file From 22b030211362b4b20954871f96c64a9883b36135 Mon Sep 17 00:00:00 2001 From: blak-kong <546598185@qq.com> Date: Tue, 26 Mar 2024 18:17:04 +0800 Subject: [PATCH 10/14] =?UTF-8?q?=E5=88=A0=E9=99=A4=E6=84=8F=E5=A4=96?= =?UTF-8?q?=E5=A4=9A=E5=87=BA=E6=9D=A5=E7=9A=84=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/moduleIOT/pages/iotCarePlan/FR200.tsx | 267 +++++----------------- 1 file changed, 57 insertions(+), 210 deletions(-) diff --git a/src/moduleIOT/pages/iotCarePlan/FR200.tsx b/src/moduleIOT/pages/iotCarePlan/FR200.tsx index ff050d4..a9d3c3e 100644 --- a/src/moduleIOT/pages/iotCarePlan/FR200.tsx +++ b/src/moduleIOT/pages/iotCarePlan/FR200.tsx @@ -346,6 +346,7 @@ class IotCarePlanFR200 extends Component { ], }; } + bluetoothContainer: any = null; isFullScreen: boolean = false; // 不涉及渲染的页面变量 isRuning: any = true; // 设备默认运行中:fr200贴脸就会自动开始工作 @@ -468,12 +469,12 @@ class IotCarePlanFR200 extends Component { // 监听蓝牙连接状态改变 Taro.onBLEConnectionStateChange(this.listener); - let bluetoothContainer = new BluetoothContainer( + this.bluetoothContainer = new BluetoothContainer( this.props.bluetoothInfo, deviceToolKitInstance, this ); - bluetoothContainer.notifyBLECharacteristicValueChange(); + this.bluetoothContainer.notifyBLECharacteristicValueChange(); setTimeout(() => { this.handleWorkStatus(false, MODE_WORKING_ENUM.STANDBY); @@ -2463,7 +2464,7 @@ class IotCarePlanFR200 extends Component { showFullscreenBtn={false} onLoadedMetaData={this.GetVideosTime} /> - + {/* */} {errorTips && ( @@ -2477,30 +2478,22 @@ class IotCarePlanFR200 extends Component { )} - {ActiveModeItem.modeType !== "moistureTest" && ( - - - - 倒计时:{currentTime} - - - - - 档位: - - {ActiveModeItem.modeType === "led" - ? "-" - : currentGear} - - 档 - - - + + + + 倒计时:{currentTime} + + + + + 档位:{currentGear} - )} + + + {ModeList.length > 0 && ( @@ -2516,194 +2509,48 @@ class IotCarePlanFR200 extends Component { onModeLockOpen={this.onModeLockOpen} /> )} - {/* - */} - - - - - - - 当前模式已护理部分时间 - 是否保存护理记录 - - } - cancelButtonText="取消" - confirmButtonText="确认" - textAlgin="center" - close={this.closeTipsSave} - cancel={this.cancelTipsSave} - confirm={this.confirmTipsSave} - /> - - { - /*不需要做处理*/ - }} - /> - - {isConnectShow && ( - {}} - pairingChange={this.pairingChange} - upgradeFun={() => {}} - /> + + {/* */} + + + + + + + + {(ActiveModeItem.modeType === "maskPenetration" || + ActiveModeItem.modeType === "essence") && ( + )} - - 正在同步护理记录... - + {ActiveModeItem.modeType === "moistureTest" && ( + + )} - - - - - - - - - - 倒计时:{currentTime} - - - - - 档位:{currentGear}档 - - - - - - - {ModeList.length > 0 && ( - - )} - - {/* */} - - - - - - - {/* {(ActiveModeItem.modeType === "face" || - ActiveModeItem.modeType === "eyes") && } */} - - {(ActiveModeItem.modeType === "maskPenetration" || - ActiveModeItem.modeType === "essence") && ( - - )} - - {ActiveModeItem.modeType === "moistureTest" && ( - - )} - - - {/*