浏览代码

modify ios gaming was broken

叶振荣 3 年之前
父节点
当前提交
a901d85604
共有 1 个文件被更改,包括 10 次插入2 次删除
  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);
       },
     });
   },