|
@@ -245,7 +245,7 @@ export default {
|
|
|
that.SendOrder("09", "关闭脑控");
|
|
|
ble_store.setters.setCurrentToyId("00");
|
|
|
},1000);
|
|
|
-
|
|
|
+
|
|
|
if (isJELLYFISH()) {
|
|
|
setTimeout(()=>{
|
|
|
that.sendConnectOneToMore('00');
|
|
@@ -263,11 +263,10 @@ export default {
|
|
|
let { deviceId, serviceId, characteristicWriteId } = getDeviceWriteInfo();
|
|
|
let $code = ble_store.getters.getDeviceSn();
|
|
|
if (deviceId && serviceId && characteristicWriteId) {
|
|
|
- let that = this;
|
|
|
let $hex_header = "aa cc ";
|
|
|
let $hex_sum = 0;
|
|
|
let $hex_ary = $hex.split(" ");
|
|
|
- $hex_ary.forEach(($val, $index) => {
|
|
|
+ $hex_ary.forEach(($val) => {
|
|
|
$hex_sum += parseInt($val, 16);
|
|
|
})
|
|
|
let $checksum = ($hex_sum ^ parseInt("ffffffff", 16)) & parseInt("ff", 16);
|
|
@@ -283,7 +282,7 @@ export default {
|
|
|
serviceId: serviceId,
|
|
|
characteristicId: characteristicWriteId,
|
|
|
value: buffer,
|
|
|
- success: function (res) {
|
|
|
+ success: function () {
|
|
|
LOG_WECHAT($code, "写入指令:", $hex, $comments);
|
|
|
},
|
|
|
fail: function (err) {
|
|
@@ -504,7 +503,9 @@ export default {
|
|
|
|
|
|
let $game_status = game_store.getters.getGameStatus();
|
|
|
if ($game_status === 1 || $game_status === 2) {
|
|
|
- $this.endTheGame();
|
|
|
+ if($this && $this.$options.name && $this.$options.name === "StartGames"){
|
|
|
+ $this.endTheGame();
|
|
|
+ }
|
|
|
Notify({
|
|
|
type: 'danger',
|
|
|
duration: 0,
|
|
@@ -519,7 +520,7 @@ export default {
|
|
|
|
|
|
|
|
|
game_store.setters.setGameStatus(0);
|
|
|
-
|
|
|
+
|
|
|
ble_store.setters.clearDeviceToy();
|
|
|
$this.connect_toy = 0;
|
|
|
|
|
@@ -540,7 +541,7 @@ export default {
|
|
|
*/
|
|
|
reconnect($deviceId, $this) {
|
|
|
let that = this;
|
|
|
- let $deviceInfo = getServicesAndCharateristc();
|
|
|
+ let $deviceInfo = getDeviceWriteInfo();
|
|
|
|
|
|
let $connect_count = 0;
|
|
|
let $rec = setInterval(() => {
|
|
@@ -563,7 +564,7 @@ export default {
|
|
|
}
|
|
|
|
|
|
},
|
|
|
- fail(res) {
|
|
|
+ fail() {
|
|
|
Notify({type: 'danger', message: `第${$connect_count}次重新连接失败`});
|
|
|
game_store.setters.setGameCloseStatus(1);
|
|
|
}
|
|
@@ -595,11 +596,10 @@ export default {
|
|
|
|
|
|
$this.device_bg = false;
|
|
|
|
|
|
-
|
|
|
|
|
|
- that.SendOrder("31", "断开教具及蓝牙连接");
|
|
|
setTimeout(()=>{
|
|
|
- that.SendOrder("09", "关闭脑控");
|
|
|
+ that.SendOrder("31", "断开教具及蓝牙连接");
|
|
|
+
|
|
|
|
|
|
wx.offBluetoothDeviceFound();
|
|
|
|