From 487903cf4331c63a287678cb141c261482090261 Mon Sep 17 00:00:00 2001 From: blak-kong <546598185@qq.com> Date: Wed, 13 Mar 2024 15:04:14 +0800 Subject: [PATCH 1/3] . --- src/components/bluetoot/connection/index.tsx | 24 ++++------ .../device-connection-popup.tsx | 47 +++++++++++++++++-- .../components/ModeContent/index.tsx | 38 ++++++++------- .../pages/iotCarePlan/iotCarePlan.tsx | 3 +- src/pages/index/index.tsx | 24 ++++++++++ src/pages/instrument/instrument.tsx | 4 +- 6 files changed, 101 insertions(+), 39 deletions(-) diff --git a/src/components/bluetoot/connection/index.tsx b/src/components/bluetoot/connection/index.tsx index 91da10e..8ac11a8 100644 --- a/src/components/bluetoot/connection/index.tsx +++ b/src/components/bluetoot/connection/index.tsx @@ -104,7 +104,7 @@ class ConnectionBluetoot extends Component { searchError: false, //是否没有搜索到设备 connectionStatus: false, //是否连接成功状态 hasVersionInfo: false, // 是否已获得版本信息 - hasSyncRecord: false, + hasSyncRecord: false, // 是否已同步记录 subDeviceConnectedStatus: false, //子设备是否连接成功状态 synchronousStatus: false, // 设备同步记录状态 islian: false, //是否获取离线记录状态 @@ -131,11 +131,6 @@ class ConnectionBluetoot extends Component { // 只有非断开状态的弹窗才自动连接蓝牙 if (!this.props.isDisconnect) { this.connection(); - } else { - // 断开状态弹窗:自动设置为错误模式 - this.setState({ - error: true, - }); } } @@ -989,22 +984,17 @@ class ConnectionBluetoot extends Component { this.sendGetVersion(); } } - }, 1000); + }, 600); // 5秒后没有收到版本返回,直接跳去护理页 - // if (isGetVersionTimer) clearTimeout(isGetVersionTimer); - // isGetVersionTimer = setTimeout(() => { - // that.setData({ - // connectionStatus: true, - // // subDeviceConnectedStatus: true, // 子设备连接状态 - // }) - // this.sendSyncRecording() - // }, 5000); + if (isGetVersionTimer) clearTimeout(isGetVersionTimer); + isGetVersionTimer = setTimeout(() => { + this.sendSyncRecording(); + }, 5000); } /** 发送同步记录 */ sendSyncRecording() { - const { deviceInfo } = this.props; const versionCommand = { commandType: "InfoQuery", infoQueryType: "offlineClockSummary", @@ -1035,6 +1025,7 @@ class ConnectionBluetoot extends Component { console.log("onReconnect"); // 重置信息并重连 this.setState({ + isBreak: false, error: false, searchError: false, errorText: "", @@ -1077,6 +1068,7 @@ class ConnectionBluetoot extends Component { connectionSuccess={connectionSuccess} isConnection={isConnection} error={error} + isDisconnect={isDisconnect} title="面罩模式启动中" /> diff --git a/src/components/bluetoot/device-connection-popup/device-connection-popup.tsx b/src/components/bluetoot/device-connection-popup/device-connection-popup.tsx index a4cdf1b..f288875 100644 --- a/src/components/bluetoot/device-connection-popup/device-connection-popup.tsx +++ b/src/components/bluetoot/device-connection-popup/device-connection-popup.tsx @@ -84,6 +84,7 @@ export default class DeviceConnectPopup extends Component { isConnection, currentDeviceType, error, + isDisconnect, } = this.props; return ( @@ -103,7 +104,7 @@ export default class DeviceConnectPopup extends Component { > {/* 非错误弹窗 */} - {!error && ( + {!error && !isDisconnect && ( { )} - {/* 错误与失败弹窗 */} - {error && ( + {/* 断开弹窗 */} + {!error && isDisconnect && ( + + + {data.bluetoothClosedTitle} + + + {!this.isImage(data.bluetoothClosed) ? ( + + + + + + + )} + + {/* 错误失败弹窗 */} + {error && !isDisconnect && ( 模式功效 {ActiveModeItem.modeDesc} - - 当前输出技术 - - {ActiveModeItem.combineData.map((item) => { - return ( - - - - {item.effectContent}({item.technologyInfo}) + {ActiveModeItem.combineData.length > 0 && ( + + 当前输出技术 + + {ActiveModeItem.combineData.map((item) => { + return ( + + + + {item.effectContent}({item.technologyInfo}) + - - ); - })} + ); + })} + - + )} )} diff --git a/src/moduleIOT/pages/iotCarePlan/iotCarePlan.tsx b/src/moduleIOT/pages/iotCarePlan/iotCarePlan.tsx index c84de6d..8cb13ae 100644 --- a/src/moduleIOT/pages/iotCarePlan/iotCarePlan.tsx +++ b/src/moduleIOT/pages/iotCarePlan/iotCarePlan.tsx @@ -1468,8 +1468,9 @@ class IotCarePlan extends Component { // 仪器缓存模式,判断是否存在于现有模式中 let recordModeItem = ModeList.find((item) => { - return item.id == WL200NursingHistory.currentServiceData.id; + return item.id == WL200NursingHistory.currentServiceData.modeId; }); + console.log("recordModeItem", recordModeItem); if (!WL200NursingHistory || !recordModeItem) { console.log("仪器有数据, 但是缓存没有数据, 忽略"); return; diff --git a/src/pages/index/index.tsx b/src/pages/index/index.tsx index c284c79..a44ac5a 100644 --- a/src/pages/index/index.tsx +++ b/src/pages/index/index.tsx @@ -106,6 +106,7 @@ class Index extends Component { isBindingError: false, // 绑定失败 isBeforeBindingError: false, // 绑定前校验错误弹窗 BeforeBindingErrorText: "", // 绑定前校验错误文本 + isBindingError203: false, // 绑定失败弹窗:已被别人绑定 instrumentList: [], // 仪器列表 unbindingInstrumentList: [], // 未绑定仪器列表 @@ -661,6 +662,8 @@ class Index extends Component { this.getInstrumentIntroInfo(instrumentInfo.id); }, 1000); return; + } else if (data.code === 203) { + this.setState({ isBindingError203: true }); } else if (data.code === 202) { // 换绑操作 this.setState({ isExchangeBinding: true, isVisibleBinding: true }); @@ -705,6 +708,7 @@ class Index extends Component { } }; // 仪器绑定失败弹窗 + // 绑定失败 onBindErrorClose = () => { this.setState({ isBindingError: false }); this.removeScanFun(); @@ -713,6 +717,15 @@ class Index extends Component { this.onBindErrorClose(); go("/pages/consultant/consultant?customBack=true"); }; + // 已被别人绑定 + onBindErrorClose203 = () => { + this.setState({ isBindingError203: false }); + }; + onBindErrorConfirm203 = () => { + this.onBindErrorClose203(); + go("/pages/consultant/consultant"); + }; + // 绑定后弹窗 onBeforeBindClose = () => { this.setState({ isBeforeBindingError: false }); this.removeScanFun(); @@ -951,6 +964,7 @@ class Index extends Component { isBindingError, isBeforeBindingError, BeforeBindingErrorText, + isBindingError203, isRegisterBoolean, isExchangeBinding, instrumentInfo, @@ -1080,6 +1094,16 @@ class Index extends Component { confirm={this.onBeforeBindConfirm} /> + + { let code = Number(res.code); // 强制类型转换 if (code === 200) { this.openBindingVisible(); - } else if (code === 204) { + } else if (code === 204 || code === 205) { this.setState({ isBindingCheckError: true }); } else { this.setState({ isBindingError: true }); @@ -345,6 +345,8 @@ export default class Instrument extends Component { go("/pages/instrument/intro?id=" + channelInfo.id); } else if (res.data.code === 204) { this.setState({ isBindingCheckError: false }); + } else if (res.data.code === 203) { + this.setState({ isBindingError203: true }); } else { this.setState({ isBindingError: true }); } From 474dfe26375419cf85bc84833135015c1bb61a45 Mon Sep 17 00:00:00 2001 From: blak-kong <546598185@qq.com> Date: Wed, 13 Mar 2024 16:42:28 +0800 Subject: [PATCH 2/3] =?UTF-8?q?fix:=E5=B0=8F=E7=A8=8B=E5=BA=8F=E5=86=85?= =?UTF-8?q?=E6=89=AB=E7=A0=81=E7=BB=91=E5=AE=9A=E5=BC=B9=E7=AA=97=E5=A4=B1?= =?UTF-8?q?=E6=95=88=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- package.json | 1 + .../pages/iotCarePlan/iotCarePlan.tsx | 17 +-- src/pages/instrument/instrument.tsx | 119 ++++++++++++------ src/utils/request.js | 31 +++-- 4 files changed, 114 insertions(+), 54 deletions(-) diff --git a/package.json b/package.json index d08cd69..0cee936 100644 --- a/package.json +++ b/package.json @@ -18,6 +18,7 @@ "build:qq": "taro build --type qq", "build:jd": "taro build --type jd", "build:quickapp": "taro build --type quickapp", + "dev": "npm run build:weapp -- --watch", "dev:weapp": "npm run build:weapp -- --watch", "dev:swan": "npm run build:swan -- --watch", "dev:alipay": "npm run build:alipay -- --watch", diff --git a/src/moduleIOT/pages/iotCarePlan/iotCarePlan.tsx b/src/moduleIOT/pages/iotCarePlan/iotCarePlan.tsx index 7d27996..7437404 100644 --- a/src/moduleIOT/pages/iotCarePlan/iotCarePlan.tsx +++ b/src/moduleIOT/pages/iotCarePlan/iotCarePlan.tsx @@ -208,7 +208,7 @@ class IotCarePlan extends Component { // 按钮是否不可运行 isFooterBtnDisabled: true, - isFirstEntryMode: false, // 模式首次打开 + // isFirstEntryMode: false, // 模式首次打开 }; } @@ -1470,7 +1470,6 @@ class IotCarePlan extends Component { let recordModeItem = ModeList.find((item) => { return item.id == WL200NursingHistory.currentServiceData.modeId; }); - console.log("recordModeItem", recordModeItem); if (!WL200NursingHistory || !recordModeItem) { console.log("仪器有数据, 但是缓存没有数据, 忽略"); return; @@ -1542,6 +1541,11 @@ class IotCarePlan extends Component { /** 获取小程序本地缓存的历史记录 */ getWL200NursingHistory() { this.WL200NursingHistory = Taro.getStorageSync("WL200NursingHistory"); + // 同步历史记录 + if (this.state.isSyncHistory) { + // 同步历史记录 + this.setState({}); + } } /** 设置WL200护理历史 */ setWL200NursingHistory = (jsonStatus: any) => { @@ -1608,7 +1612,7 @@ class IotCarePlan extends Component { /** 提交护理记录 */ PostNursingLogClock = async (data: any = null, isJump = true) => { - let { currentDevice, ActiveModeItem, } = this.state; + let { currentDevice, ActiveModeItem } = this.state; let params = {}; if (data) { @@ -1632,8 +1636,8 @@ class IotCarePlan extends Component { }; // 上传护理完成的仪器ID let res = await InstrumentInfo.apiClock.addClockInstrument(params); - console.log(res,'护理完成'); - + console.log(res, "护理完成"); + this.rmWL200NursingHistory(this.WL200NursingHistory); // 护理完成,删除记录 if (isJump) { this.setState({ @@ -1976,7 +1980,6 @@ class IotCarePlan extends Component { nurseInfo, isShowReReadRecordSave, isFooterBtnDisabled, - isFirstEntryMode, } = this.state; return ( @@ -2041,7 +2044,7 @@ class IotCarePlan extends Component { { showLoginPopup: "", fromUrl: "", + // 提示绑定与换绑 isVisibleBinding: false, isRegisterBoolean: false, isExchangeBinding: false, @@ -150,7 +152,7 @@ export default class Instrument extends Component { setTimeout(() => { this.scanCodeBinding(); - }, 10); + }, 100); }, fail(err) {}, complete(res) {}, @@ -180,13 +182,9 @@ export default class Instrument extends Component { console.log("success", res); const tempFilePath = res.tempFiles[0].tempFilePath; let img = await getImgInfo(tempFilePath); - console.log("img", img); let compressImage = await contraction(img, "compressImage"); - console.log("compressImage", compressImage); // 压缩后文件地址 let compressTempFilePath = compressImage.tempFilePath; - console.log("tempFilePath", tempFilePath); - console.log("compressTempFilePath", compressTempFilePath); setTimeout(() => { let { channelInfo } = this.state; channelInfo.serialImage = compressTempFilePath; @@ -291,14 +289,21 @@ export default class Instrument extends Component { }); Taro.hideLoading(); // 文件上传接口返回格式,不需要加data - console.log("res.data", res); let code = Number(res.code); // 强制类型转换 if (code === 200) { - this.openBindingVisible(); - } else if (code === 204 || code === 205) { - this.setState({ isBindingCheckError: true }); - } else { - this.setState({ isBindingError: true }); + msg("绑定成功"); + setTimeout(() => { + setStorageSync("instrument_item", JSON.stringify(channelInfo)); + go("/pages/instrument/intro?id=" + channelInfo.id); + }, 1000); + } else if (res.data.code === 202) { + this.changeBindBox(); + } else if (res.data.code === 203) { + this.setState({ isBindingError203: true }); + } else if (res.data.code === 204) { + this.onBindCheckErrorOpen(); + } else if (res.data.code === 205 || res.data.code === 206) { + this.onBindErrorOpen(); } }; /** @@ -306,24 +311,37 @@ export default class Instrument extends Component { * @return code===204 用户选择的仪器与序列号对应的仪器不一致 */ scanCodeBinding = async () => { - Taro.showLoading({ - title: "请求中...", - mask: true, - }); + // Taro.showLoading({ + // title: "请求中...", + // mask: true, + // }); let { channelInfo } = this.state; let res = await InstrumentInfo.scanCodeBinding({ serial: channelInfo.serialCode, instrumentId: channelInfo.id, }); - Taro.hideLoading(); - if (res.data.code === 200) { - // this.bindingInstrument(); - this.openBindingVisible(); - } else if (res.data.code === 204 || res.data.code === 205) { - this.setState({ isBindingCheckError: true }); - } else { - this.setState({ isBindingError: true }); - } + + // Taro.hideLoading(); + let code = Number(res.data.code); + console.log("scanCodeBinding code", code); + setTimeout(() => { + console.log("scanCodeBinding code", code, code === 204); + if (code === 200) { + msg("绑定成功"); + setTimeout(() => { + setStorageSync("instrument_item", JSON.stringify(channelInfo)); + go("/pages/instrument/intro?id=" + channelInfo.id); + }, 1000); + } else if (res.data.code === 202) { + this.changeBindBox(); + } else if (res.data.code === 203) { + this.setState({ isBindingError203: true }); + } else if (res.data.code === 204) { + this.onBindCheckErrorOpen(); + } else if (res.data.code === 205 || res.data.code === 206) { + this.onBindErrorOpen(); + } + }, 100); }; // 调用绑定接口 @@ -338,18 +356,24 @@ export default class Instrument extends Component { serial: channelInfo.serialCode, }); Taro.hideLoading(); - if (res.data.code === 200) { - // this.setState({ isVisibleBinding: false }); - msg("绑定成功"); - setStorageSync("instrument_item", JSON.stringify(channelInfo)); - go("/pages/instrument/intro?id=" + channelInfo.id); - } else if (res.data.code === 204) { - this.setState({ isBindingCheckError: false }); - } else if (res.data.code === 203) { - this.setState({ isBindingError203: true }); - } else { - this.setState({ isBindingError: true }); - } + setTimeout(() => { + if (res.data.code === 200) { + // this.setState({ isVisibleBinding: false }); + msg("绑定成功"); + setStorageSync("instrument_item", JSON.stringify(channelInfo)); + setTimeout(() => { + go("/pages/instrument/intro?id=" + channelInfo.id); + }, 1000); + } else if (res.data.code === 202) { + this.changeBindBox(); + } else if (res.data.code === 203) { + this.setState({ isBindingError203: true }); + } else if (res.data.code === 204) { + this.onBindCheckErrorOpen(); + } else if (res.data.code === 205 || res.data.code === 206) { + this.onBindErrorOpen(); + } + }, 100); }; // 换绑仪器 exchangeBinding = async () => { @@ -369,6 +393,10 @@ export default class Instrument extends Component { } }; + /**绑定错误弹窗*/ + onBindErrorOpen = () => { + this.setState({ isBindingError: true }); + }; onBindErrorClose = () => { this.setState({ isBindingError: false }); }; @@ -376,6 +404,11 @@ export default class Instrument extends Component { this.onBindErrorClose(); go("/pages/consultant/consultant"); }; + + /**绑定错误:已被别人绑定弹窗*/ + onBindErrorOpen203 = () => { + this.setState({ isBindingError203: true }); + }; onBindErrorClose203 = () => { this.setState({ isBindingError203: false }); }; @@ -383,10 +416,17 @@ export default class Instrument extends Component { this.onBindErrorClose203(); go("/pages/consultant/consultant"); }; - + /**绑定错误:检查序列号弹窗*/ + onBindCheckErrorOpen = () => { + this.setState({ isBindingCheckError: true }); + }; onBindCheckErrorClose = () => { this.setState({ isBindingCheckError: false }); }; + /** 换绑弹窗 */ + changeBindBox() { + this.setState({ isVisibleBinding: true, isExchangeBinding: true }); + } customBack = () => { Taro.reLaunch({ url: "/pages/index/index" }); @@ -659,7 +699,10 @@ export default class Instrument extends Component { {inputType == 1 && ( - + 确认绑定 )} diff --git a/src/utils/request.js b/src/utils/request.js index db74ffe..888e69c 100644 --- a/src/utils/request.js +++ b/src/utils/request.js @@ -75,7 +75,7 @@ export const Ajax = (params) => { content: String(msg), showCancel: false, }); - // reject(res); + reject(res); return false; } @@ -108,6 +108,7 @@ export const Ajax = (params) => { }); }; +// 文件上传 export const AjaxUploadFile = (params, formData) => { const app = Taro.getApp(); const global = store.getState().globalStore; @@ -141,12 +142,14 @@ export const AjaxUploadFile = (params, formData) => { } if ( o.code !== 200 && + o.code !== 202 && o.code !== 203 && o.code !== 204 && - o.code !== 205 + o.code !== 205 && + o.code !== 206 ) { - let msg = - typeof o.msg == "string" ? o.msg : "系统异常,请联系管理人员"; + // let msg = typeof o.msg == "string" ? o.msg : "系统异常,请联系管理人员"; + let msg = "系统异常,请联系管理人员"; Taro.showModal({ title: "提示", content: msg, @@ -171,6 +174,7 @@ export const AjaxUploadFile = (params, formData) => { }); }; +// 表单上传 export const AjaxFormData = (params) => { const app = Taro.getApp(); const global = store.getState().globalStore; @@ -213,11 +217,20 @@ export const AjaxFormData = (params) => { }); return false; } - if (res.data.code !== 200 && o.code !== 204 && o.code !== 205) { - let msg = - typeof res.data.msg == "string" - ? res.data.msg - : "系统异常,请联系管理人员"; + let code = res.data.code; + if ( + code !== 200 && + code !== 202 && + code !== 203 && + code !== 204 && + code !== 205 && + code !== 206 + ) { + // let msg = + // typeof res.data.msg == "string" + // ? res.data.msg + // : "系统异常,请联系管理人员"; + let msg = "系统异常,请联系管理人员"; if (msg == "请不要操作太快哦") { reject(res); return false; From 40f33ed5a6f1c436b110d7533376942417ccac34 Mon Sep 17 00:00:00 2001 From: blak-kong <546598185@qq.com> Date: Wed, 13 Mar 2024 18:19:56 +0800 Subject: [PATCH 3/3] =?UTF-8?q?=E4=B8=B4=E6=97=B6=E6=8F=90=E4=BA=A4?= =?UTF-8?q?=EF=BC=8C=E5=87=86=E5=A4=87=E5=90=88=E5=B9=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/app.tsx | 3 ++ .../components/ModeContent/index.tsx | 2 +- .../pages/iotCarePlan/iotCarePlan.tsx | 54 +++++++++++++------ src/pages/index/index.tsx | 11 ++-- src/pages/instrument/instrument.tsx | 1 - 5 files changed, 46 insertions(+), 25 deletions(-) diff --git a/src/app.tsx b/src/app.tsx index 610524b..17f46bc 100644 --- a/src/app.tsx +++ b/src/app.tsx @@ -24,6 +24,9 @@ class App extends Component { return; } + // 每次进入小程序,删除可能残留的同步状态 + Taro.removeStorageSync("isSyncHistory"); + // go("/pages/iotCarePlan/iotCarePlan"); // go("/pages/instrument_clickin_upload/index"); // go("/pages/instrument/intro"); diff --git a/src/moduleIOT/pages/iotCarePlan/components/ModeContent/index.tsx b/src/moduleIOT/pages/iotCarePlan/components/ModeContent/index.tsx index eaa8cc4..9e76729 100644 --- a/src/moduleIOT/pages/iotCarePlan/components/ModeContent/index.tsx +++ b/src/moduleIOT/pages/iotCarePlan/components/ModeContent/index.tsx @@ -22,7 +22,7 @@ function Index({ isShowNurse, ActiveModeItem }: Props) { 模式功效 {ActiveModeItem.modeDesc} - {ActiveModeItem.combineData.length > 0 && ( + {ActiveModeItem?.combineData && ( 当前输出技术 diff --git a/src/moduleIOT/pages/iotCarePlan/iotCarePlan.tsx b/src/moduleIOT/pages/iotCarePlan/iotCarePlan.tsx index 7437404..d97ffcd 100644 --- a/src/moduleIOT/pages/iotCarePlan/iotCarePlan.tsx +++ b/src/moduleIOT/pages/iotCarePlan/iotCarePlan.tsx @@ -209,6 +209,8 @@ class IotCarePlan extends Component { // 按钮是否不可运行 isFooterBtnDisabled: true, // isFirstEntryMode: false, // 模式首次打开 + + isShowHistoryMsg: false, // 是否显示正在同步历史 }; } @@ -260,6 +262,7 @@ class IotCarePlan extends Component { if (obj) { this.setState({ currentDevice: obj, + title: obj.name, }); await this.GetModeList(obj.id); @@ -377,7 +380,7 @@ class IotCarePlan extends Component { // this.modeCurrentFun(res.data.data[0]); // }, 100); } else { - this.setState({ ModeList: res.data.data }); + this.setState({ ModeList: [] }); } } }; @@ -797,6 +800,13 @@ class IotCarePlan extends Component { jsonStatus ); + this.workStatus = jsonStatus.workStatus; + this.setState({ + Electricity: jsonStatus.battery, + // fr200Electricity: jsonStatus.battery, + matrixElectricity: jsonStatus.matrixBattery, + }); + // 判断设备主动上报的关机事件 if (jsonStatus.workStatus === MODE_WORKING_ENUM.END) { // 判断id是否一致, 一致的话则生成护理报表, 并提示 @@ -810,13 +820,6 @@ class IotCarePlan extends Component { return; } - this.workStatus = jsonStatus.workStatus; - this.setState({ - Electricity: jsonStatus.battery, - // fr200Electricity: jsonStatus.battery, - matrixElectricity: jsonStatus.matrixBattery, - }); - if (jsonStatus?.workMode === this.state.ActiveModeItem.modeType) { this.setState({ workMode: jsonStatus?.workMode, // 仅当设备上报模式与小程序一致时,才允许改变小程序变量缓存 @@ -1444,6 +1447,12 @@ class IotCarePlan extends Component { await sleep(2); } + let isSyncHistory = Taro.getStorageSync("isSyncHistory"); + if (isSyncHistory) { + this.setState({ isShowHistoryMsg: false }); + Taro.removeStorageSync("isSyncHistory"); + } + // 2.判断是否已存在缓存的护理记录:如果没有历史,则缓存 let workStatus = this.workStatus; let WL200NursingHistory = this.WL200NursingHistory; @@ -1541,10 +1550,16 @@ class IotCarePlan extends Component { /** 获取小程序本地缓存的历史记录 */ getWL200NursingHistory() { this.WL200NursingHistory = Taro.getStorageSync("WL200NursingHistory"); - // 同步历史记录 - if (this.state.isSyncHistory) { - // 同步历史记录 - this.setState({}); + + // 是否同步历史记录 + let isSyncHistory = Taro.getStorageSync("isSyncHistory"); + if (isSyncHistory) { + // 直接进入开始护理状态 + + this.setState({ + isShowNurse: true, + isShowHistoryMsg: true, + }); } } /** 设置WL200护理历史 */ @@ -1980,6 +1995,7 @@ class IotCarePlan extends Component { nurseInfo, isShowReReadRecordSave, isFooterBtnDisabled, + isShowHistoryMsg, } = this.state; return ( @@ -2120,6 +2136,10 @@ class IotCarePlan extends Component { )} + {isShowHistoryMsg && ( + 正在同步护理记录... + )} + @@ -2189,10 +2209,12 @@ class IotCarePlan extends Component { /> )} - + {ActiveModeItem.combineData && ( + + )} {/* */} diff --git a/src/pages/index/index.tsx b/src/pages/index/index.tsx index 834fb7b..333fe79 100644 --- a/src/pages/index/index.tsx +++ b/src/pages/index/index.tsx @@ -417,8 +417,6 @@ class Index extends Component { }; gourl = (e) => { - - const { url } = e.currentTarget.dataset; if (this.isRegister()) { go(url); @@ -481,11 +479,11 @@ class Index extends Component { mask: true, }); let { data: res } = await InstrumentInfo.bindingInstrumentList(); - console.log(res,'查看绑定的设备'); - + console.log(res, "查看绑定的设备"); + // Taro.hideLoading(); if (res.code === 200) { - if(res.data.length === 0){ + if (res.data.length === 0) { this.setState({ ViewAddInstrument: false }); } this.setState({ instrumentList: res.data }); @@ -752,7 +750,6 @@ class Index extends Component { // 跳转仪器介绍页 goNursing = (item) => { - if (item.status === 0) { setStorageSync("instrument_detail", item); this.setState({ connectInstrument: item }); @@ -768,7 +765,6 @@ class Index extends Component { /** 蓝牙逻辑 */ bindBlockLeft() { - if (!this.state.isRegisterBoolean) { //未注册授权 this.alertRegister(); @@ -927,6 +923,7 @@ class Index extends Component { let item = getStorageSync("instrument_detail"); this.setState({ connectInstrument: item }); setTimeout(() => this.bindBlockLeft()); + Taro.setStorageSync("isSyncHistory", true); }; // 扫码绑定必须先完成注册弹窗:确定以后删除扫码缓存,防止死循环 diff --git a/src/pages/instrument/instrument.tsx b/src/pages/instrument/instrument.tsx index 3b08cfa..94ca1aa 100644 --- a/src/pages/instrument/instrument.tsx +++ b/src/pages/instrument/instrument.tsx @@ -385,7 +385,6 @@ export default class Instrument extends Component { let { data } = await InstrumentInfo.exchangeBinding({ serial: channelInfo.serialCode, }); - console.log("exchangeBinding", data); Taro.hideLoading(); this.closeBinding(); if (data.code === 200) {