From 7f029b26c4db404dbaa74ff9d9f10d8d7d835ed5 Mon Sep 17 00:00:00 2001 From: blak-kong <546598185@qq.com> Date: Thu, 14 Mar 2024 17:43:16 +0800 Subject: [PATCH] =?UTF-8?q?fix:=E5=85=81=E8=AE=B8=E5=BC=80=E5=8F=91?= =?UTF-8?q?=E8=80=85=E5=B7=A5=E5=85=B7=E7=9B=B4=E6=8E=A5=E8=B7=B3=E8=BD=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- package.json | 2 +- src/app.config.ts | 1 + src/components/bluetoot/connection/index.tsx | 6 ++--- src/pages/index/index.tsx | 23 ++++++++++++++++++-- 4 files changed, 26 insertions(+), 6 deletions(-) diff --git a/package.json b/package.json index 0cee936..6f41926 100644 --- a/package.json +++ b/package.json @@ -37,7 +37,7 @@ "author": "", "dependencies": { "@antmjs/vantui": "^3.3.5", - "@flossom-npm/iot-translater": "^1.0.8", + "@flossom-npm/iot-translater": "^1.1.2", "@flossom-npm/iot-translater-we100": "^1.1.1", "@reduxjs/toolkit": "^2.0.1", "@tarojs/components": "~3.6.24", diff --git a/src/app.config.ts b/src/app.config.ts index a4e9b69..07477fd 100644 --- a/src/app.config.ts +++ b/src/app.config.ts @@ -87,6 +87,7 @@ export default defineAppConfig({ root: 'moduleIOT', pages: [ "pages/iotCarePlan/iotCarePlan", + "pages/iotCarePlan/FR200", ] } ] diff --git a/src/components/bluetoot/connection/index.tsx b/src/components/bluetoot/connection/index.tsx index 4a06de4..707ba39 100644 --- a/src/components/bluetoot/connection/index.tsx +++ b/src/components/bluetoot/connection/index.tsx @@ -445,13 +445,14 @@ class ConnectionBluetoot extends Component { } } else if (deviceInfo.model == "M01") { this.setState({ currentDeviceType: "M01" }); - jsonStatus = deviceToolKitInstanceM01.toJsonStatus(value.value); + jsonStatus = deviceToolKitInstanceM01.toJsonStatus(value); querySubDeviceArrayBuffer = deviceToolKitInstanceM01.toBleCommand( bleCommandSamples.querySubDevice as any ); } else if (deviceInfo.model === "FR200") { // FR200 不需要查询子设备 - jsonStatus = deviceToolKitInstanceFR200.toJsonStatus(value.value); + jsonStatus = deviceToolKitInstanceFR200.toJsonStatus(value); + console.log("FR200 jsonStatus", jsonStatus); this.setState({ currentDeviceType: "FR200" }); } // if (querySubDeviceArrayBuffer) this.sendQuerySubDevice(querySubDeviceArrayBuffer) @@ -832,7 +833,6 @@ class ConnectionBluetoot extends Component { .catch((e) => { // 下发配对指令失败,走重连操作 clearInterval(sendPairingTimer); - // wx.closeBLEConnection(); this.createBLEConnection(); }); } diff --git a/src/pages/index/index.tsx b/src/pages/index/index.tsx index fbfc699..6cef3cf 100644 --- a/src/pages/index/index.tsx +++ b/src/pages/index/index.tsx @@ -839,6 +839,16 @@ class Index extends Component { // 跳转仪器介绍页 goNursing = (item) => { + // 仅开发者工具调试使用 + const platform = Taro.getSystemInfoSync().platform; + if (platform === "devtools") { + setStorageSync("instrument_detail", item); + this.setState({ connectInstrument: item }); + setTimeout(() => this.goIot()); + return; + } + + // 移动端真正逻辑 if (item.status === 0) { setStorageSync("instrument_detail", item); this.setState({ connectInstrument: item }); @@ -897,13 +907,22 @@ class Index extends Component { */ pairingChange = (e) => { console.log("===epairingChange===》", e); - go("/moduleIOT/pages/iotCarePlan/iotCarePlan"); // 画页面直接跳转 + + if (this.state.connectInstrument.model === "FR200") { + go("/moduleIOT/pages/iotCarePlan/FR200"); // 画页面直接跳转 + } else { + go("/moduleIOT/pages/iotCarePlan/iotCarePlan"); // 画页面直接跳转 + } this.connectionClose(); }; async goIot() { - go("/moduleIOT/pages/iotCarePlan/iotCarePlan"); // 画页面直接跳转 + if (this.state.connectInstrument.model === "FR200") { + go("/moduleIOT/pages/iotCarePlan/FR200"); // 画页面直接跳转 + } else { + go("/moduleIOT/pages/iotCarePlan/iotCarePlan"); // 画页面直接跳转 + } // return; }