|
|
@ -1251,7 +1251,8 @@ Page({ |
|
|
|
this.personnelmanagement() |
|
|
|
} |
|
|
|
} else { |
|
|
|
this.searchDevicesMethods() |
|
|
|
this.searchDevicesMethods() |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
}, |
|
|
@ -1268,10 +1269,10 @@ Page({ |
|
|
|
|
|
|
|
searchDevicesMethods() { |
|
|
|
var that = this; |
|
|
|
wx.showLoading({ |
|
|
|
title: '正在搜索', |
|
|
|
// mask: true
|
|
|
|
}) |
|
|
|
// wx.showLoading({
|
|
|
|
// title: '正在搜索',
|
|
|
|
// // mask: true
|
|
|
|
// })
|
|
|
|
this.setData({ |
|
|
|
searchClick: false |
|
|
|
}) |
|
|
@ -1279,11 +1280,24 @@ Page({ |
|
|
|
success: function (res) { |
|
|
|
wx.startBluetoothDevicesDiscovery({ |
|
|
|
success: function (res) { |
|
|
|
let it={name:that.data.deviceinfo.deviceNum,deviceId:that.data.deviceinfo.bluetoothMac,mac:that.data.deviceinfo.bluetoothMac,localName:that.data.deviceinfo.deviceId} |
|
|
|
lockModel = util1.getLockModel(that.data.deviceinfo.deviceNum) |
|
|
|
it.lockType = util1.getLockType(lockModel) |
|
|
|
app.addDeviceWithDevName(it.name, it) |
|
|
|
connectedDeviceId = it.deviceId |
|
|
|
lockDevice = it |
|
|
|
app.globalData.isSearch = true |
|
|
|
that.data.isSearch = true |
|
|
|
console.log(that.data.deviceinfo.deviceNum,it.name,'ppppp') |
|
|
|
that.connectTo() |
|
|
|
return |
|
|
|
wx.getBluetoothDevices({ |
|
|
|
success: function (res) { |
|
|
|
console.log(res) |
|
|
|
let i=1 |
|
|
|
res.devices.map(it => { |
|
|
|
var status = it.name.indexOf('WSL') |
|
|
|
i++ |
|
|
|
if (status != -1) { |
|
|
|
if (it.RSSI != 127) { |
|
|
|
if (it.advertisData != null) { |
|
|
@ -1344,9 +1358,10 @@ Page({ |
|
|
|
} |
|
|
|
} |
|
|
|
}) |
|
|
|
if (!that.data.isSearch && that.data.toSearch) { |
|
|
|
that.searchDevicesMethods() |
|
|
|
} |
|
|
|
// if (!that.data.isSearch) {
|
|
|
|
// that.searchDevicesMethods()
|
|
|
|
// console.log(i,'iii1')
|
|
|
|
// }
|
|
|
|
} |
|
|
|
}) |
|
|
|
}, |
|
|
@ -1552,7 +1567,6 @@ Page({ |
|
|
|
deviceId: lockDevice.deviceId, |
|
|
|
timeout: config.ble.connectTimeOut, |
|
|
|
success: function (res) { |
|
|
|
console.debug('connectTo', res) |
|
|
|
isConnected = true |
|
|
|
wx.hideLoading() |
|
|
|
setTimeout(function () { |
|
|
|