From 07d684ff5f364d910a2b9bd7ed1035f9336c2d1a Mon Sep 17 00:00:00 2001 From: rongweikang <1174906669@qq.com> Date: Wed, 20 Mar 2024 10:37:51 +0800 Subject: [PATCH] =?UTF-8?q?=E9=A1=B5=E9=9D=A2=E8=B7=B3=E8=BD=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/moduleIOT/pages/iotCarePlan/FR200.tsx | 27 ++++++++++++++----- .../moisture_test_report.tsx | 17 ++++++------ src/recoding/pages/recording/recording.tsx | 10 ++++--- 3 files changed, 35 insertions(+), 19 deletions(-) diff --git a/src/moduleIOT/pages/iotCarePlan/FR200.tsx b/src/moduleIOT/pages/iotCarePlan/FR200.tsx index 19c376d..4957d35 100644 --- a/src/moduleIOT/pages/iotCarePlan/FR200.tsx +++ b/src/moduleIOT/pages/iotCarePlan/FR200.tsx @@ -242,7 +242,7 @@ class IotCarePlanFR200 extends Component { /** 基础版:脸部/眼部 */ BaseModeType: string[] = ["face", "eyes"]; - async onLoad() { + async onLoad(option) { // 保持屏幕常亮 Taro.setKeepScreenOn({ keepScreenOn: true, @@ -250,10 +250,13 @@ class IotCarePlanFR200 extends Component { this.initData(); this.getInstrumentClockSummary(); this.getInstrumentClockDetail(); + if (option.modeId) { + this.setState({ activeModeID: option.modeId }) + } } - componentDidMount() {} + componentDidMount() { } - componentWillUnmount() {} + componentWillUnmount() { } componentDidShow() { console.log("页面显示了"); @@ -389,6 +392,16 @@ class IotCarePlanFR200 extends Component { ModeList: res.data.data, }); + if (this.state.activeModeID != '') { + this.state.ModeList.map(item => { + if (item.id === this.state.activeModeID) { + this.setState({ + ActiveModeItem: item + }); + } + }) + } + setTimeout(() => { this.modeCurrentFun(res.data.data[0]); }, 100); @@ -587,7 +600,7 @@ class IotCarePlanFR200 extends Component { this.onNursingTap(); // 倒计时弹窗: 倒计时完成后,自动开始,并判断弹窗 let downNum = CountDownTime[this.state.ActiveModeItem.modeType] || 3; - this.showCountdownFun(downNum, () => {}); + this.showCountdownFun(downNum, () => { }); }, 500); return; @@ -613,7 +626,7 @@ class IotCarePlanFR200 extends Component { }; // 绘制能量图 - drawProwerPicture() {} + drawProwerPicture() { } /** 切换光照 */ onSwitchChange = async () => { @@ -2083,9 +2096,9 @@ class IotCarePlanFR200 extends Component { deviceInfo={currentDevice} close={this.connectionClose} isDisconnect={!isConnectionBlutoot} - offlineChange={() => {}} + offlineChange={() => { }} pairingChange={this.pairingChange} - upgradeFun={() => {}} + upgradeFun={() => { }} /> )} 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 c23639c..5203dd7 100644 --- a/src/recoding/pages/moisture_test_report/moisture_test_report.tsx +++ b/src/recoding/pages/moisture_test_report/moisture_test_report.tsx @@ -38,7 +38,8 @@ class MoistureTestReport extends Component { xinde: '', imglist: [], id: 0, - show: false + show: false, + modeId: 0 }; } @@ -71,20 +72,18 @@ class MoistureTestReport extends Component { reportData.shuifenGear.rightFace = gear } }) - this.setState({ reportData }); - setTimeout(() => { - console.log(this.state.reportData); - - }, 50); + this.setState({ reportData, modeId: option.modeId }); } async initData() { } toIndex() { Taro.reLaunch({ url: "/pages/index/index" }); } - + toNursing() { + go(`/moduleIOT/pages/iotCarePlan/FR200?modeId=${this.state.modeId}`) + } render() { - let { name, imgUrl, reportData, reportData1, isClock, xinde, imglist, id, show } = this.state + let { name, imgUrl, reportData, reportData1, isClock, xinde, imglist, id, show, modeId } = this.state const getStatusData = (level) => { var bgCssData = { @@ -288,7 +287,7 @@ class MoistureTestReport extends Component { - 继续护理 + 继续护理 主页 diff --git a/src/recoding/pages/recording/recording.tsx b/src/recoding/pages/recording/recording.tsx index 3da46f5..676d707 100644 --- a/src/recoding/pages/recording/recording.tsx +++ b/src/recoding/pages/recording/recording.tsx @@ -1,4 +1,4 @@ -import Taro from "@tarojs/taro"; +import Taro, { setStorageSync } from "@tarojs/taro"; import classnames from "classnames"; import { Component, PropsWithChildren, useEffect, useState } from "react"; @@ -289,7 +289,11 @@ export default class Recording extends Component { }; // 跳转到护理报告 toReport(id, recordId, item) { - console.log(item, "查看类型", item.jumpType); + this.state.bindingInstrumentList.map(instrument => { + if (instrument.id == id) { + setStorageSync("instrument_detail", instrument); + } + }) switch (item.jumpType) { case 1: this.One(item); @@ -325,7 +329,7 @@ export default class Recording extends Component { }; // 打开第三种类型 three = async (item) => { - go(`/recoding/pages/moisture_test_report/moisture_test_report?data=${item.nursingData}&date=${item.createTime}`); + go(`/recoding/pages/moisture_test_report/moisture_test_report?data=${item.nursingData}&date=${item.createTime}&modeId=${item.modeId}`); }; // 打开其他类型 AllDevice = async (item) => {