xlolic 2ヶ月前
コミット
eee229ad6b
1個のファイルの変更5行の追加2行の削除
  1. +5
    -2
      pages/bluetooth/connect.vue

+ 5
- 2
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);


||||||
x
 
000:0
読み込み中…
キャンセル
保存