Browse Source

modify ios gaming was broken

叶振荣 3 years ago
parent
commit
a901d85604
1 changed files with 10 additions and 2 deletions
  1. 10 2
      src/utils/bluetooth.js

+ 10 - 2
src/utils/bluetooth.js

@@ -252,7 +252,15 @@ export default {
           deviceId: $deviceInfo.deviceId,
           success(res) {
             Notify({type: 'success', message: `第${$connect_count}次重新连接成功`});
-            that.openNotify($this)
+            let $system = wx.getSystemInfoSync()
+            if ($system.platform == 'ios') {
+              that.getBLEDeviceServices($deviceInfo.deviceId)
+              that.watchingDevice($this)
+            } else {
+              that.openNotify($this)
+              that.watch_bluetooth_status($this);
+            }
+
             clearInterval($rec)
           },
           fail(res) {
@@ -661,7 +669,7 @@ export default {
       },
       fail: function (err) {
         console.log($hex + "写入失败");
-        console.log(err,$deviceInfo);
+        console.log(err, $deviceInfo);
       },
     });
   },