|
@@ -227,6 +227,8 @@ export default {
|
|
|
//停止控制游戏
|
|
|
bluetooth.sendPause($this._deviceId, $this._serviceId, $this._characteristicId)
|
|
|
bluetooth.sendEnd($this._deviceId, $this._serviceId, $this._characteristicId)
|
|
|
+ bluetooth.shutdownSendControl($this._deviceId, $this._serviceId, $this._characteristicId)
|
|
|
+
|
|
|
const countDown = $this.$mp.page.selectComponent('.control-count-down');
|
|
|
countDown.pause();
|
|
|
//取消监听低功耗蓝牙设备
|
|
@@ -401,11 +403,15 @@ export default {
|
|
|
let $userinfo = wx.getStorageSync('userinfo')
|
|
|
$play_time = $userinfo['play_time'] - $current_time
|
|
|
}
|
|
|
+ console.log('当前结束时间', $current_time)
|
|
|
+ console.log('游玩时间:', $this.play_time)
|
|
|
let $params = {
|
|
|
- record_id: game_store.getters.getGameRecordId,
|
|
|
+ game_record_id: game_store.getters.getGameRecordId,
|
|
|
type: $this.mode,
|
|
|
play_time: $play_time
|
|
|
}
|
|
|
+ console.log("结束游戏参数", $params)
|
|
|
+ //
|
|
|
gameEnd($params).then((res) => {
|
|
|
let $data = res.data
|
|
|
})
|
|
@@ -444,14 +450,16 @@ export default {
|
|
|
onLoad() {
|
|
|
},
|
|
|
onUnload() {
|
|
|
- const countDown = $this.$mp.page.selectComponent('.control-count-down');
|
|
|
- countDown.pause();
|
|
|
- bluetooth.sendPause($this._deviceId, $this._serviceId, $this._characteristicId)
|
|
|
- bluetooth.sendEnd($this._deviceId, $this._serviceId, $this._characteristicId)
|
|
|
-
|
|
|
- let $play_time = $this.timeData.minutes * 60 + $this.timeData.seconds
|
|
|
- console.log($play_time)
|
|
|
- game_store.commit('setPlayTime', $play_time)
|
|
|
+ // 返回 的时候 暂停
|
|
|
+ // const countDown = $this.$mp.page.selectComponent('.control-count-down');
|
|
|
+ // countDown.pause();
|
|
|
+ // bluetooth.sendPause($this._deviceId, $this._serviceId, $this._characteristicId)
|
|
|
+ // bluetooth.sendEnd($this._deviceId, $this._serviceId, $this._characteristicId)
|
|
|
+
|
|
|
+ // let $play_time = $this.timeData.minutes * 60 + $this.timeData.seconds
|
|
|
+ // console.log($play_time)
|
|
|
+ // game_store.commit('setPlayTime', $play_time)
|
|
|
+ this.pop_show = false
|
|
|
}
|
|
|
}
|
|
|
</script>
|