优化100j
This commit is contained in:
@ -185,7 +185,7 @@
|
||||
},
|
||||
onHide: function() {
|
||||
this.Status.isPageHidden = true;
|
||||
ble.StopSearch();
|
||||
if (ble) ble.StopSearch();
|
||||
},
|
||||
|
||||
onUnload() {
|
||||
@ -205,7 +205,6 @@
|
||||
}
|
||||
},
|
||||
onLoad(option) {
|
||||
debugger;
|
||||
eventChannel = this.getOpenerEventChannel();
|
||||
|
||||
eventChannel.on('detailData', function(rec) {
|
||||
@ -351,11 +350,10 @@
|
||||
// console.log("+++ 发现新设备,准备添加到列表:", JSON.stringify(device));
|
||||
|
||||
if (these.device && these.device.bluetoothName && device.name) {
|
||||
if (these.device.bluetoothName === device.name || (device.name && device.name
|
||||
.indexOf(these
|
||||
.device.bluetoothName) > -1) || (device.name && this.device
|
||||
.bluetoothName.indexOf(
|
||||
device.name) > -1)) {
|
||||
const bn = these.device.bluetoothName;
|
||||
if (these.device.bluetoothName === device.name ||
|
||||
(device.name.indexOf(bn) > -1) ||
|
||||
(bn.indexOf(device.name) > -1)) {
|
||||
device.isTarget = true;
|
||||
}
|
||||
}
|
||||
@ -629,7 +627,7 @@
|
||||
|
||||
if (f && f.macAddress) {
|
||||
|
||||
if (!this.device.deviceMac) { //走服务端验证
|
||||
if (!these.device || !these.device.deviceMac) { //走服务端验证
|
||||
console.error("走服务端验证")
|
||||
request({
|
||||
url: '/app/device/getDeviceInfoByDeviceMac',
|
||||
|
||||
@ -300,7 +300,7 @@
|
||||
},
|
||||
bleStateRecovery() {
|
||||
console.log("蓝牙适配器恢复可用,重连断开的设备");
|
||||
ble.linkAllDevices();
|
||||
if (ble && ble.linkAllDevices) ble.linkAllDevices();
|
||||
|
||||
},
|
||||
bleBreak(res) {
|
||||
@ -327,7 +327,7 @@
|
||||
let f = null;
|
||||
if (ble.data && ble.data.LinkedList) {
|
||||
f = ble.data.LinkedList.find(v => {
|
||||
|
||||
if (!v) return false;
|
||||
if (v.macAddress && v.device && v.device.id) {
|
||||
return v.device.id == this.deviceList[i].id;
|
||||
}
|
||||
@ -749,6 +749,9 @@
|
||||
onLoad() {
|
||||
|
||||
// console.error("首页加载");
|
||||
// 必须先初始化 ble:getTab/downCallback 会触发 updateBleStatu,否则会访问 null
|
||||
ble = bleTool.getBleTool();
|
||||
recei = BleReceive.getBleReceive();
|
||||
this.getTab()
|
||||
this.downCallback();
|
||||
|
||||
@ -763,8 +766,6 @@
|
||||
console.log('列表收到消息了么');
|
||||
this.downCallback();
|
||||
});
|
||||
ble = bleTool.getBleTool();
|
||||
recei = BleReceive.getBleReceive();
|
||||
//蓝牙连接成功的回调
|
||||
ble.addRecoveryCallback((res) => {
|
||||
// console.log("蓝牙连接成功的回调");
|
||||
|
||||
Reference in New Issue
Block a user