| @@ -219,10 +219,11 @@ | |||||
| if (that.connectDev && v.deviceId == that.connectDev.deviceId) v.isConnect = '1'; | if (that.connectDev && v.deviceId == that.connectDev.deviceId) v.isConnect = '1'; | ||||
| if (v.name && v.deviceId) return v; | if (v.name && v.deviceId) return v; | ||||
| }) | }) | ||||
| console.log(that.keyword,"搜索的设备"); | |||||
| uni.getBluetoothDevices({ | uni.getBluetoothDevices({ | ||||
| success(res){ | success(res){ | ||||
| res.devices.filter(v => { | res.devices.filter(v => { | ||||
| console.log(v.name,"查找到的设备"); | |||||
| if (!that.blist.find(v2 => v2.deviceId == v.deviceId)) { | if (!that.blist.find(v2 => v2.deviceId == v.deviceId)) { | ||||
| if (v.name.toLowerCase() == that.keyword.toLowerCase()) that.blist.push(v); | if (v.name.toLowerCase() == that.keyword.toLowerCase()) that.blist.push(v); | ||||
| } | } | ||||
| @@ -241,9 +242,11 @@ | |||||
| if (that.connectDev && v.deviceId == that.connectDev.deviceId) v.isConnect = '1'; | if (that.connectDev && v.deviceId == that.connectDev.deviceId) v.isConnect = '1'; | ||||
| if (v.name && v.deviceId) return v; | if (v.name && v.deviceId) return v; | ||||
| }) | }) | ||||
| console.log(that.keyword,"搜索的设备"); | |||||
| uni.onBluetoothDeviceFound((res) => { | uni.onBluetoothDeviceFound((res) => { | ||||
| res.devices.filter(v => { | res.devices.filter(v => { | ||||
| console.log(v.name,"查找到的设备"); | |||||
| //判断blist中如果没有就添加 | //判断blist中如果没有就添加 | ||||
| if (!that.blist.find(v2 => v2.deviceId == v.deviceId)) { | if (!that.blist.find(v2 => v2.deviceId == v.deviceId)) { | ||||
| if (v.name.toLowerCase() == that.keyword.toLowerCase()) that.blist.push(v); | if (v.name.toLowerCase() == that.keyword.toLowerCase()) that.blist.push(v); | ||||