完成7305,添加在详情页去绑定蓝牙设备
This commit is contained in:
@ -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();
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user