From 18eaff89e6e97a3fe60b2426ef6ce88a620f7072 Mon Sep 17 00:00:00 2001 From: blak-kong <546598185@qq.com> Date: Fri, 1 Mar 2024 20:31:28 +0800 Subject: [PATCH] . --- src/pages/iotCarePlan/iotCarePlan.tsx | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/src/pages/iotCarePlan/iotCarePlan.tsx b/src/pages/iotCarePlan/iotCarePlan.tsx index f1a0d01..520a078 100644 --- a/src/pages/iotCarePlan/iotCarePlan.tsx +++ b/src/pages/iotCarePlan/iotCarePlan.tsx @@ -204,25 +204,26 @@ class IotCarePlan extends Component { WL200NursingHistory: any = null; // 护理缓存历史 hadCheckReport = false; // 是否已检查仪器护理记录 hadGotInstrumentHistoryData = false; // 是否已缓存仪器历史数据 + hadLoadedPage = false; // 判断是否首次进入页面 async onLoad() { // 保持屏幕常亮 Taro.setKeepScreenOn({ keepScreenOn: true, }); + this.initData(); } - componentDidMount() { - this.setState({ - videoContext: Taro.createVideoContext("myVideo"), - standVideoContext: null, - }); - } + componentDidMount() {} componentWillUnmount() {} componentDidShow() { console.log("页面显示了"); - this.initData(); + + if (!this.hadLoadedPage) { + this.hadLoadedPage = true; // 二次进入页面(非首次进入) + return; + } this.getWL200NursingHistory(); // 重置初始值,每次进入页面重新检查面罩护理记录