diff --git a/pages/bluetooth/connect.vue b/pages/bluetooth/connect.vue index 5331d4f..17d6ab7 100644 --- a/pages/bluetooth/connect.vue +++ b/pages/bluetooth/connect.vue @@ -219,10 +219,11 @@ if (that.connectDev && v.deviceId == that.connectDev.deviceId) v.isConnect = '1'; if (v.name && v.deviceId) return v; }) - + console.log(that.keyword,"搜索的设备"); uni.getBluetoothDevices({ success(res){ res.devices.filter(v => { + console.log(v.name,"查找到的设备"); if (!that.blist.find(v2 => v2.deviceId == v.deviceId)) { 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 (v.name && v.deviceId) return v; }) - + console.log(that.keyword,"搜索的设备"); + uni.onBluetoothDeviceFound((res) => { res.devices.filter(v => { + console.log(v.name,"查找到的设备"); //判断blist中如果没有就添加 if (!that.blist.find(v2 => v2.deviceId == v.deviceId)) { if (v.name.toLowerCase() == that.keyword.toLowerCase()) that.blist.push(v);