柒零 1 ano atrás
pai
commit
16e6523534
1 arquivos alterados com 8 adições e 0 exclusões
  1. 8 0
      subpages/addMattresses/addMattresses.js

+ 8 - 0
subpages/addMattresses/addMattresses.js

@@ -177,6 +177,12 @@ Page({
         return false;
       }
     });
+
+    var oldDeviceList = wx.getStorageSync('deviceList');
+    self.setData({
+      deviceList: oldDeviceList,
+      showBluetoothList: true
+    });
     //第二步关闭适配器,重新来搜索
     wx.openBluetoothAdapter({
       success: function (res) {
@@ -185,6 +191,7 @@ Page({
             wx.stopBluetoothDevicesDiscovery({
               success: function (res) {
                 wx.startBluetoothDevicesDiscovery({
+                  services: ['0000FFF0-0000-1000-8000-00805F9B34FB'],
                   success: function (res) {
                     wx.onBluetoothDeviceFound(function (res) {
                       console.log(res);
@@ -766,6 +773,7 @@ Page({
     wx.offWifiConnected({});
     wx.stopWifi({})
     wx.offBluetoothDeviceFound()
+    wx.removeStorageSync('deviceList')
     this.closeConnect()
   },