智方网络_吖荣 3 vuotta sitten
vanhempi
commit
b01fb7efb4
3 muutettua tiedostoa jossa 6 lisäystä ja 27 poistoa
  1. 2 22
      src/components/device/device.vue
  2. 3 4
      src/pages/index/index.vue
  3. 1 1
      src/utils/bluetooth.js

+ 2 - 22
src/components/device/device.vue

@@ -340,7 +340,7 @@ export default {
       //当脑环断开
       if ($status == 0) {
         game_store.setters.setGameStatus(0);
-        bluetooth.shutdownSendControl();
+        // bluetooth.shutdownSendControl();
         // 清空链接得设备 三值
         game_store.setters.clearDeviceToy();
         $this.connect_toy = $status;
@@ -413,8 +413,6 @@ export default {
               game_store.setters.setDeviceId(device.deviceId);
               $this._deviceId = device.deviceId;
 
-              // console.log("蓝牙搜索状态 device_status", $this.device_status);
-
               $this.createBLEConnection();
             }
           });
@@ -425,12 +423,6 @@ export default {
     },
     // 停止蓝牙搜索
     stopBluetoothDevicesDiscovery() {
-      // console.log(
-      //   "脑环被占用的情况下我能获取到吗?",
-      //   $this.device_status,
-      //   "是否有id _deviceId",
-      //   $this._deviceId
-      // );
       wx.stopBluetoothDevicesDiscovery();
     },
     //连接低功耗蓝牙设备。
@@ -438,7 +430,7 @@ export default {
       wx.createBLEConnection({
         deviceId: $this.device.deviceId,
         success: (res) => {
-          // console.log("成功连接");
+          console.log("成功连接");
           //成功连接脑环蓝牙
           $this.change_device_status(2);
           bluetooth.watch_bluetooth_status($this);
@@ -511,25 +503,13 @@ export default {
         bluetooth.watch_bluetooth_status($this);
         $this._deviceId = "";
 
-        // 清空三个id值
-        let $deviceId = game_store.getters.getDeviceId();
-        let $serviceId = game_store.getters.getServiceId();
-        let $cid = game_store.getters.getCharacterId();
-        bluetooth.shutdownSendControl();
         // 清空链接的设备
         game_store.setters.clearDeviceToy();
 
-        console.log("返回时出现,我触发了嘛", $deviceId, $serviceId, $cid);
       }
     }
   },
   onHide() {
-    console.log(
-      "你好啊,我触发了嘛?",
-      $this.connect_show,
-      $this.device_status,
-      game_store.getters.getGameStatus()
-    );
     // game_store.setters.setGameStatus(0);
   },
   onLoad(options) {

+ 3 - 4
src/pages/index/index.vue

@@ -190,10 +190,9 @@ export default {
   },
   onHide() {},
   onLoad($option) {
-    if (process.env.NODE_ENV == "development") {
-      // wx.setStorageSync("token", "05qCTeq-SxX2L-3Uscu1iUdCaeFZp54D");
-      // wx.setStorageSync("token", "aPaNBi1BXyic7P9o-NVPeGhkdCZUbWlx");
-    }
+    // if (process.env.NODE_ENV == "development") {
+    //   wx.setStorageSync("token", "ZbNv-hpdpmxk895iqUrEwe4kCJjEWCJD");
+    // }
 
 
     if (game_store.getters.getGameStatus() == 1) {

+ 1 - 1
src/utils/bluetooth.js

@@ -415,7 +415,7 @@ export default {
         console.log($hex + ',写入成功')
       },
       fail: function (err) {
-        console.log("开启脑电数据包失败");
+        console.log($hex + "写入失败");
         console.log(err);
       },
     });