From 67070731facdfce0a04989a6e3864f2df7878e4b Mon Sep 17 00:00:00 2001 From: blak-kong <546598185@qq.com> Date: Wed, 13 Mar 2024 11:07:03 +0800 Subject: [PATCH] =?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 --- config/prod.ts | 23 ++++++++++++++++++- .../pages/iotCarePlan/iotCarePlan.tsx | 13 +++++++---- src/pages/index/index.tsx | 16 ++++++++----- src/pages/instrument/intro.tsx | 8 +++++-- 4 files changed, 46 insertions(+), 14 deletions(-) diff --git a/config/prod.ts b/config/prod.ts index e148666..5b660c8 100644 --- a/config/prod.ts +++ b/config/prod.ts @@ -4,7 +4,28 @@ module.exports = { }, defineConstants: { }, - mini: {}, + mini: { + debugReact: true, + webpackChain: (chain, webpack) => { + chain.merge({ + plugin: { + install: { + plugin: require('terser-webpack-plugin'), + args: [ + { + terserOptions: { + compress: true, // 默认使用terser压缩 + // mangle: false, + keep_classnames: true, // 不改变class名称 + keep_fnames: true, // 不改变函数名称 + }, + }, + ], + }, + }, + }) + }, + }, h5: { /** * WebpackChain 插件配置 diff --git a/src/moduleIOT/pages/iotCarePlan/iotCarePlan.tsx b/src/moduleIOT/pages/iotCarePlan/iotCarePlan.tsx index 34f42fd..c84de6d 100644 --- a/src/moduleIOT/pages/iotCarePlan/iotCarePlan.tsx +++ b/src/moduleIOT/pages/iotCarePlan/iotCarePlan.tsx @@ -373,9 +373,9 @@ class IotCarePlan extends Component { ModeList: res.data.data, }); - setTimeout(() => { - this.modeCurrentFun(res.data.data[0]); - }, 100); + // setTimeout(() => { + // this.modeCurrentFun(res.data.data[0]); + // }, 100); } else { this.setState({ ModeList: res.data.data }); } @@ -1468,7 +1468,7 @@ class IotCarePlan extends Component { // 仪器缓存模式,判断是否存在于现有模式中 let recordModeItem = ModeList.find((item) => { - return item.id == WL200NursingHistory.id; + return item.id == WL200NursingHistory.currentServiceData.id; }); if (!WL200NursingHistory || !recordModeItem) { console.log("仪器有数据, 但是缓存没有数据, 忽略"); @@ -1838,8 +1838,11 @@ class IotCarePlan extends Component { pairingChange = () => { this.setState({ isConnectShow: false, + isShowNurse: true, + }); + setTimeout(() => { + this.onNursingTap("switch"); }); - this.onNursingTap("switch"); }; connectionClose = () => { this.setState({ diff --git a/src/pages/index/index.tsx b/src/pages/index/index.tsx index 2442747..c284c79 100644 --- a/src/pages/index/index.tsx +++ b/src/pages/index/index.tsx @@ -255,16 +255,16 @@ class Index extends Component { } // 页面初始化 - async initData() { + initData = async () => { let token = getStorageSync("token"); if (!token) { // 如果token过期,先登录,登录完成后自动初始化 - // await this.WCUserLogin(); + await this.WCUserLogin(); } else { // token没过期,直接请求数据 this.initPageData(); } - } + }; initPageData = async () => { const mobile = Taro.getStorageSync("mobile"); @@ -292,7 +292,9 @@ class Index extends Component { await this.unbindingInstrumentInfoList(); // 获取未绑定设备 await this.getInstrumentInfoBySerial(); // 扫码序列号查询:注册后才调用,因为扫码未注册直接跳转注册页 + console.log("this.props.isShowIndexFlag", this.props.isShowIndexFlag); if (!this.props.isShowIndexFlag) { + this.initDeviceNursingHistory(); this.GetSitePopupList(); // 全局内存缓存,仅初次进入首页运行 this.props.setIndexFlag(true); @@ -897,7 +899,9 @@ class Index extends Component { isShowReConnectDeviceRecordWL200: false, }); - // this.goNursing() + let item = getStorageSync("instrument_detail"); + this.setState({ connectInstrument: item }); + setTimeout(() => this.bindBlockLeft()); }; // 扫码绑定必须先完成注册弹窗:确定以后删除扫码缓存,防止死循环 @@ -996,8 +1000,8 @@ class Index extends Component { 是否重新读取 } - cancelButtonText="暂不绑定" - confirmButtonText="确认" + cancelButtonText="取消" + confirmButtonText="连接设备" textAlgin="center" close={this.closeReConnectDeviceRecordWL200} confirm={this.confirmReConnectDeviceRecordWL200} diff --git a/src/pages/instrument/intro.tsx b/src/pages/instrument/intro.tsx index 9a72fd0..c713b25 100644 --- a/src/pages/instrument/intro.tsx +++ b/src/pages/instrument/intro.tsx @@ -300,6 +300,10 @@ class Intro extends Component { this.setState({ isShowReConnectDeviceRecordWL200: false, }); + + let item = getStorageSync("instrument_detail"); + this.setState({ connectInstrument: item }); + setTimeout(() => this.bindBlockLeft()); }; render() { @@ -354,8 +358,8 @@ class Intro extends Component { 是否重新读取 } - cancelButtonText="暂不绑定" - confirmButtonText="确认" + cancelButtonText="取消" + confirmButtonText="连接设备" textAlgin="center" close={this.closeReConnectDeviceRecordWL200} confirm={this.confirmReConnectDeviceRecordWL200}