|
@@ -380,11 +380,7 @@ export default {
|
|
|
game_finished() {
|
|
|
if (!$this.executed) {
|
|
|
LogInDb(`${$this.$bluetooth.getNowTime()} 游戏结束`)
|
|
|
- // 打开LED
|
|
|
- $this.$bluetooth.SendLedOrder("01");
|
|
|
- // 断开教具及蓝牙连接
|
|
|
- $this.$bluetooth.SendOrder("31");
|
|
|
-
|
|
|
+ // 关闭脑控
|
|
|
$this.$bluetooth.sendControlClose();
|
|
|
|
|
|
$this.$emit("closePop", true);
|
|
@@ -450,22 +446,24 @@ export default {
|
|
|
});
|
|
|
$this.$bluetooth.sendAutoConnectRf(true, Math.round($this.played_time / 60));
|
|
|
$this.$bluetooth.watchingDevice($this);
|
|
|
- // 获取LED灯状态并设置
|
|
|
- let led_status = game_store.getters.getLED();
|
|
|
- console.log("开始游戏获取LED灯状态", led_status)
|
|
|
- if(led_status){
|
|
|
- $this.$bluetooth.SendLedOrder("01");
|
|
|
- }else{
|
|
|
- $this.$bluetooth.SendLedOrder("00");
|
|
|
- }
|
|
|
- // 获取教具类型 发送陀螺仪开关指令
|
|
|
- let $toy_sn = game_store.getters.getToySn();
|
|
|
- if("SW".indexOf($toy_sn)>=0 || "KL".indexOf($toy_sn)>=0 || "SC".indexOf($toy_sn)>=0){
|
|
|
- // todo 关闭陀螺仪
|
|
|
- } else {
|
|
|
- // todo 打开陀螺仪
|
|
|
- }
|
|
|
-
|
|
|
+ setTimeout(()=>{
|
|
|
+ // 获取LED灯状态并设置
|
|
|
+ let led_status = game_store.getters.getLED();
|
|
|
+ console.log("开始游戏获取LED灯状态", led_status)
|
|
|
+ if(led_status){
|
|
|
+ $this.$bluetooth.SendLedOrder("01");
|
|
|
+ }else{
|
|
|
+ $this.$bluetooth.SendLedOrder("00");
|
|
|
+ }
|
|
|
+ },500);
|
|
|
+ setTimeout(()=>{
|
|
|
+ // 获取教具类型 发送陀螺仪开关指令
|
|
|
+ let $toy_sn = game_store.getters.getToySn().toUpperCase();
|
|
|
+ if($toy_sn.includes("SW") || $toy_sn.includes("KL") || $toy_sn.includes("SC")){
|
|
|
+ // 设置教具为无运动状态 AA CC 03 00 00 00 34 CKS
|
|
|
+ $this.$bluetooth.SendOrder("34");
|
|
|
+ }
|
|
|
+ },1000);
|
|
|
// 开始倒计时
|
|
|
clearInterval($timeout)
|
|
|
$timeout = setInterval(() => {
|
|
@@ -475,7 +473,7 @@ export default {
|
|
|
game_store.setters.setPlayedTime($this.played_time)
|
|
|
$this.played_time_text = $this.$bluetooth.formatPlaySeconds($this.played_time);
|
|
|
}
|
|
|
- if ($this.played_time == 0) {
|
|
|
+ if ($this.played_time === 0) {
|
|
|
$this.post_data();
|
|
|
//判断是否隐藏 隐藏则不绘画
|
|
|
$this.$bluetooth.sendControlClose();
|
|
@@ -486,8 +484,6 @@ export default {
|
|
|
clearInterval($timeout)
|
|
|
}
|
|
|
}, 1000)
|
|
|
-
|
|
|
-
|
|
|
},
|
|
|
|
|
|
// ArrayBuffer转16进度字符串示例
|
|
@@ -556,8 +552,6 @@ export default {
|
|
|
wx.removeStorageSync("over_play_time");
|
|
|
game_store.setters.setMode(0);
|
|
|
});
|
|
|
- // 打开LED
|
|
|
- $this.$bluetooth.SendLedOrder("01");
|
|
|
},
|
|
|
// 处理游戏中数据的方法
|
|
|
do_datas: function ($data) {
|