|
@@ -471,6 +471,7 @@ export default {
|
|
|
startTheGame() {
|
|
|
LOG_DEBUG("开始游戏");
|
|
|
game_store.setters.setGameStatus(2);
|
|
|
+ game_store.setters.setGameDataLength(0);
|
|
|
wx.setKeepScreenOn({
|
|
|
keepScreenOn: true,
|
|
|
});
|
|
@@ -559,17 +560,6 @@ export default {
|
|
|
$this.$connection.sendControlClose();
|
|
|
// 结束游戏提交数据
|
|
|
$this.postGameData();
|
|
|
- // 跳转到报告页
|
|
|
- Toast.loading({
|
|
|
- forbidClick: true,
|
|
|
- mask: true,
|
|
|
- message: "正在生成报告...",
|
|
|
- duration: 2000,
|
|
|
- onClose() {
|
|
|
- $this.toReportPage();
|
|
|
- $this.end_loading = false;
|
|
|
- }
|
|
|
- });
|
|
|
let $code = ble_store.getters.getDeviceSn();
|
|
|
LOG_WECHAT($code, "结束训练record_id:", game_store.getters.getGameRecordId());
|
|
|
},
|
|
@@ -590,15 +580,14 @@ export default {
|
|
|
...post_data,
|
|
|
sn: ble_store.getters.getDeviceSn()
|
|
|
};
|
|
|
- if (!$dataParams.line) {
|
|
|
- return false;
|
|
|
+ if ($dataParams.line) {
|
|
|
+ gameAddLine($dataParams).then((res) => {
|
|
|
+ let $data = res.data;
|
|
|
+ if ($data.code*1 === 0) {
|
|
|
+ $this.game_data = [];
|
|
|
+ }
|
|
|
+ });
|
|
|
}
|
|
|
- gameAddLine($dataParams).then((res) => {
|
|
|
- let $data = res.data;
|
|
|
- if ($data.code*1 === 0) {
|
|
|
- $this.game_data = [];
|
|
|
- }
|
|
|
- });
|
|
|
let $params = {
|
|
|
game_record_id: game_store.getters.getGameRecordId(),
|
|
|
type: $this.mode,
|
|
@@ -607,6 +596,8 @@ export default {
|
|
|
gameEnd($params).then(() => {
|
|
|
$this.resetGameData();
|
|
|
});
|
|
|
+ // 跳转到报告页
|
|
|
+ $this.toReportPage();
|
|
|
},
|
|
|
/**
|
|
|
* 重置游戏数据
|
|
@@ -646,14 +637,25 @@ export default {
|
|
|
* 跳转到报告页
|
|
|
*/
|
|
|
toReportPage() {
|
|
|
- mpvue.redirectTo({
|
|
|
- url: "/pages/games/report/main?id=" + game_store.getters.getGameRecordId() + "&size=" + game_store.getters.getGameDataLength(),
|
|
|
- success() {
|
|
|
- $this.attList = [];
|
|
|
- $this.medList = [];
|
|
|
- $this.ampList = [];
|
|
|
- LOG_DEBUG("生成报告成功")
|
|
|
- },
|
|
|
+ let report_url = "/pages/games/report/main?id=" + game_store.getters.getGameRecordId() + "&size=" + game_store.getters.getGameDataLength();
|
|
|
+ console.log(report_url);
|
|
|
+ Toast.loading({
|
|
|
+ forbidClick: true,
|
|
|
+ mask: true,
|
|
|
+ message: "正在生成报告...",
|
|
|
+ duration: 2000,
|
|
|
+ onClose() {
|
|
|
+ mpvue.redirectTo({
|
|
|
+ url: report_url,
|
|
|
+ success() {
|
|
|
+ $this.attList = [];
|
|
|
+ $this.medList = [];
|
|
|
+ $this.ampList = [];
|
|
|
+ LOG_DEBUG("生成报告成功")
|
|
|
+ },
|
|
|
+ });
|
|
|
+ $this.end_loading = false;
|
|
|
+ }
|
|
|
});
|
|
|
},
|
|
|
},
|