|
@@ -200,8 +200,9 @@
|
|
|
// 监听寻找到新设备的事件
|
|
|
uni.onBluetoothDeviceFound(function (res) {
|
|
|
let devices = res.devices.filter(item => item.name == 'FAYA')
|
|
|
- console.log(devices,'devices list')
|
|
|
- if(devices.length){
|
|
|
+ const hasDev = _this.deviceList.find(item => item.deviceId == res.devices[0].deviceId)
|
|
|
+ console.log(devices,hasDev,'devices list')
|
|
|
+ if(devices.length&&!hasDev){
|
|
|
_this.statusStr = '已发现设备'
|
|
|
_this.deviceList = _this.deviceList.concat(res.devices)
|
|
|
_this.loading = false
|