Commit 2b80b8e1 authored by haiyoucuv's avatar haiyoucuv

11

parent 054eb652
...@@ -21,6 +21,7 @@ class GameStore { ...@@ -21,6 +21,7 @@ class GameStore {
countdownSeconds: 180, countdownSeconds: 180,
remainTipTimes: 0, remainTipTimes: 0,
cd: 180, cd: 180,
isSubmit: false,
} }
async start() { async start() {
...@@ -35,6 +36,7 @@ class GameStore { ...@@ -35,6 +36,7 @@ class GameStore {
this.gameInfo.levelIdxArr = LevelArr.map((_, index) => index); this.gameInfo.levelIdxArr = LevelArr.map((_, index) => index);
this.gameInfo.levelIdxArr.sort(() => Math.random() - 0.5); this.gameInfo.levelIdxArr.sort(() => Math.random() - 0.5);
this.gameInfo.levelIndex = -1; this.gameInfo.levelIndex = -1;
this.gameInfo.isSubmit = false;
this.gameInfo.recordId = data.recordId; this.gameInfo.recordId = data.recordId;
this.gameInfo.countdownSeconds = data.countdownSeconds; this.gameInfo.countdownSeconds = data.countdownSeconds;
this.gameInfo.remainTipTimes = data.remainTipTimes this.gameInfo.remainTipTimes = data.remainTipTimes
...@@ -48,6 +50,10 @@ class GameStore { ...@@ -48,6 +50,10 @@ class GameStore {
} }
async middleSubmit(score: number) { async middleSubmit(score: number) {
if (this.gameInfo.isSubmit) {
return;
}
const d = { const d = {
recordId: this.gameInfo.recordId, recordId: this.gameInfo.recordId,
score, score,
...@@ -61,6 +67,12 @@ class GameStore { ...@@ -61,6 +67,12 @@ class GameStore {
} }
async submit(score: number) { async submit(score: number) {
if (this.gameInfo.isSubmit) {
return;
}
this.gameInfo.isSubmit = true;
const d = { const d = {
recordId: this.gameInfo.recordId, recordId: this.gameInfo.recordId,
score, score,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment