fix:允许开发者工具直接跳转

master
blak-kong 2 years ago
parent 43f8ed43ea
commit 7f029b26c4

@ -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",

@ -87,6 +87,7 @@ export default defineAppConfig({
root: 'moduleIOT',
pages: [
"pages/iotCarePlan/iotCarePlan",
"pages/iotCarePlan/FR200",
]
}
]

@ -445,13 +445,14 @@ class ConnectionBluetoot extends Component<any, any> {
}
} 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<any, any> {
.catch((e) => {
// 下发配对指令失败,走重连操作
clearInterval(sendPairingTimer);
// wx.closeBLEConnection();
this.createBLEConnection();
});
}

@ -839,6 +839,16 @@ class Index extends Component<any, any> {
// 跳转仪器介绍页
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<any, any> {
*/
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;
}

Loading…
Cancel
Save