From dd2a627f8a0d3de159912b98bf73d69c781bba4e Mon Sep 17 00:00:00 2001 From: blak-kong <546598185@qq.com> Date: Mon, 18 Mar 2024 14:41:08 +0800 Subject: [PATCH 1/2] =?UTF-8?q?fix:=E8=AE=BE=E5=A4=87=E8=93=9D=E7=89=99?= =?UTF-8?q?=E8=BF=9E=E6=8E=A5=E5=A2=9E=E5=8A=A0=E9=99=90=E5=88=B6=EF=BC=8C?= =?UTF-8?q?wl200=E5=88=87=E6=8D=A2=E6=A8=A1=E5=BC=8F=E5=A2=9E=E5=8A=A0?= =?UTF-8?q?=E9=99=90=E5=88=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/bluetoot/connection/index.tsx | 27 +-- src/moduleIOT/pages/iotCarePlan/WL200.tsx | 22 ++- src/pages/index/index.less | 2 +- src/pages/index/index.tsx | 184 +++++++++---------- 4 files changed, 123 insertions(+), 112 deletions(-) diff --git a/src/components/bluetoot/connection/index.tsx b/src/components/bluetoot/connection/index.tsx index 16753da..c4b5df8 100644 --- a/src/components/bluetoot/connection/index.tsx +++ b/src/components/bluetoot/connection/index.tsx @@ -117,11 +117,11 @@ class ConnectionBluetoot extends Component { // WL200匹配 tranType: [ - "WE100", // 发箍 - "WE200", // 发箍 - "WL200", // 面罩 - "12CAA", // 面罩前缀名 - "FR200", // FR200 + // "WE100", // 发箍 + // "WE200", // 发箍 + // "WL200", // 面罩 + // "12CAA", // 面罩前缀名 + // "FR200", // FR200 ], currentDeviceType: "", // 现在的设备类型: WE200 WL200 @@ -319,14 +319,15 @@ class ConnectionBluetoot extends Component { /** 4.蓝牙查找 */ onBluetoothDeviceFound() { Taro.onBluetoothDeviceFound((item: any) => { - console.log("蓝牙查找item", item, item.devices[0].name); - console.info("搜索到到蓝牙设备 value => ", item.devices[0]?.name); - console.log(">>>>>>>当前传入设备类型>>>>>", this.props.deviceInfo.model); - // 先匹配到哪个连接哪个 - let tranType = [ - this.props.deviceInfo.model, // 当前传入设备类型 - ...this.state.tranType, - ]; + let model = this.props.deviceInfo.model; // 限制只匹配当前传入的设备类型 + // 匹配数组:先匹配到哪个连接哪个 + let tranType: string[] = []; + // 判断条件随着设备的增加而增加 + if (model === "WL200") { + tranType = ["WL200", "WE200", "WE100", "12CAA"]; + } else if (model === "FR200") { + tranType = ["FR200"]; + } for (let i = 0; i < item.devices.length; i++) { let devicesName = item.devices[i].localName || item.devices[i].name; // 是否匹配可连接设备 diff --git a/src/moduleIOT/pages/iotCarePlan/WL200.tsx b/src/moduleIOT/pages/iotCarePlan/WL200.tsx index c02f734..3444020 100644 --- a/src/moduleIOT/pages/iotCarePlan/WL200.tsx +++ b/src/moduleIOT/pages/iotCarePlan/WL200.tsx @@ -11,8 +11,8 @@ import React, { useRef, } from "react"; -import Echarts from "./components/Echart/index"; -import EchartFace from "./components/Echart_face/index"; +// import Echarts from "./components/Echart/index"; +// import EchartFace from "./components/Echart_face/index"; import { Block, View, @@ -378,9 +378,12 @@ class IotCarePlanWL200 extends Component { let res = await InstrumentInfo.modeInfoList(params); if (res.data.code === 200) { if (res.data.data.length > 0) { + this.tempModeCurrent = res.data.data[0]; this.setState({ ActiveModeItem: res.data.data[0], ModeList: res.data.data, + activeModeID: res.data.data[0].id, + ModeID: "mode_" + res.data.data[0].id, }); // setTimeout(() => { @@ -458,9 +461,16 @@ class IotCarePlanWL200 extends Component { currentServiceData, ModeStepIndex: 0, currentTime, - ModeType: modeArray[data.modeClass], + // ModeType: modeArray[data.modeClass], }); + // 只有点击过开始,才隐藏其他模式类型 + if (isShowNurse) { + this.setState({ + ModeType: modeArray[data.modeClass], + }); + } + setTimeout(() => { // 设置时间组合 if (data.serviceData.length > 0) { @@ -2271,7 +2281,7 @@ class IotCarePlanWL200 extends Component { onTimeUpdate={this.GetVideosTime} /> )} - + {/* */} {/* */} {/* */} {isShowNurse && ( @@ -2340,8 +2350,8 @@ class IotCarePlanWL200 extends Component { /> )} - - + {/* + */}