ソースを参照

蓝牙设备连接检测玩具连接状态,优化蓝牙发送数据

yerong 4 年 前
コミット
33d4773e6d
3 ファイル変更9 行追加1 行削除
  1. 1 1
      src/pages/coupons/index.vue
  2. 2 0
      src/pages/start/index.vue
  3. 6 0
      src/utils/bluetooth.js

+ 1 - 1
src/pages/coupons/index.vue

@@ -74,7 +74,7 @@ export default {
   components: {},
   data() {
     return {
-      active: '0',
+      active: '1',
       rec_list: [],
       cp_list: [],
       limit: 10

+ 2 - 0
src/pages/start/index.vue

@@ -438,6 +438,8 @@ export default {
       }
     })
 
+    bluetooth.watch_bluetooth_status($this)
+
   },
   onLoad() {
   },

+ 6 - 0
src/utils/bluetooth.js

@@ -391,6 +391,12 @@ export default {
         $that.status = 0
         //断开玩具连接
         $that.connect_toy = 0
+
+        //判断游戏是否游戏中
+        let $game_status = game_store.getters.getGameStatus;
+        if ($game_status == 1) {
+          $that.game_finished()
+        }
       }
     })
   },