|
@@ -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) {
|