完成7305,添加在详情页去绑定蓝牙设备

This commit is contained in:
liub
2025-09-17 15:21:20 +08:00
parent ed8f02fb39
commit da9a9f4874
19 changed files with 5311 additions and 1523 deletions

View File

@ -12,7 +12,7 @@
设备名:{{device.deviceName}}
</view>
<view class="deviceId">
ID:{{device.deviceId}}
设备Mac:{{device.macAddress}}
</view>
<view class="bound" v-bind:class="boundStatu">
{{Statu.boundRemark}}
@ -86,15 +86,16 @@
onLoad(option) {
these = this;
ble = bleTool.getBleTool();
console.log("LinkBle")
ble.addReceiveCallback((receive, f, path) => {
console.log("收到设备消息,", receive);
if (these.device.deviceId == receive.deviceId) {
// console.log("11111");
console.log("11111:",receive);
if (receive.bytes[0] == 0xFC || receive.str.indexOf('mac address:') == 0) {
if (f && f.macAddress) {
these.device.macAddress = f.macAddress;
// console.log("222222");
console.log("222222");
these.initDevice();
}
}
@ -233,7 +234,7 @@
v.device[key] = data[key];
}
ble.setBleData();
ble.updateCache();
}
});