智方网络_吖荣 4 éve
szülő
commit
2278992abc
3 módosított fájl, 22 hozzáadás és 6 törlés
  1. 12 0
      src/components/device/device.vue
  2. 9 5
      src/pages/start/index.vue
  3. 1 1
      src/utils/bluetooth.js

+ 12 - 0
src/components/device/device.vue

@@ -325,6 +325,18 @@ export default {
     open_choose_toy() {
       // $this.choose_toy_window.show = false;
       $this.choose_toy_window.show = true;
+      let $serviceId = game_store.getters.getServiceId();
+      let $charateristic = game_store.getters.getCharacterId();
+      
+      bluetooth.shutdownSendControl(
+            $this._deviceId,
+            $serviceId,
+            $charateristic
+          );
+      bluetooth.sendEnd(
+            $this._deviceId,
+            $serviceId,
+            $charateristic);
     },
     // 选好玩具
     choose_ok() {

+ 9 - 5
src/pages/start/index.vue

@@ -285,11 +285,15 @@ export default {
         message: "正在生成报告...",
         duration: 0,
         onClose() {
-          bluetooth.shutdownSendControl(
-            $this._deviceId,
-            $this._serviceId,
-            $this._characteristicId
-          );
+          for (var i = 0; i < 2; i++) {
+              bluetooth.shutdownSendControl(
+                $this._deviceId,
+                $this._serviceId,
+                $this._characteristicId
+              );
+              bluetooth.sendEnd();
+          }
+          
         },
       });
     },

+ 1 - 1
src/utils/bluetooth.js

@@ -447,7 +447,7 @@ export default {
             duration: 0,
             message: '智脑环已断开连接,请重新扫码智脑环'
           });
-          game_store.setters.setGameCloseStatus(1);
+          game_store.setters.setGameStatus(0);
 
 
         }