From bd78f21615a40aa555fd618543439ec78eba6b83 Mon Sep 17 00:00:00 2001 From: Kostya Date: Thu, 25 Jan 2024 19:37:55 +0300 Subject: [PATCH] update logic for end game --- .../src/pages/games-pages/SapergamePage.vue | 21 ++++++++++++------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/luckydiamond/src/pages/games-pages/SapergamePage.vue b/luckydiamond/src/pages/games-pages/SapergamePage.vue index 6566ecd..bac9942 100644 --- a/luckydiamond/src/pages/games-pages/SapergamePage.vue +++ b/luckydiamond/src/pages/games-pages/SapergamePage.vue @@ -132,7 +132,7 @@

Вы подорвались! Игра закончена

- Продолжить +
@@ -212,6 +212,7 @@ export default { }, flippedCards: { async handler(value) { + if (value.length < 1 || this.ValidationPlay.endGame === true) return const maxCircles = 25 - this.amountCrystals if (this.gamesCircle < maxCircles && this.gameStart !== false) { @@ -252,7 +253,7 @@ export default { .then(response => { AnswerServer = response this.winningAmount = response.Item1.WinningMoney - console.log(response) + console.log(response.Item1.WinningMoney) }) } catch (e) { @@ -264,7 +265,10 @@ export default { this.gamesCircle = this.gamesCircle + 1 this.offEventPointers = true if (AnswerServer === 'You dead') { - this.ValidationPlay.endGame = true + this.offEventPointers = false + this.gameStart = false + this.winningAmount = 0 + this.flippedCards = [] } } @@ -336,9 +340,9 @@ export default { console.error(e) } }, - updatePage() { - window.location.reload() - }, + // updatePage() { + // window.location.reload() + // }, async claimWinningAmount() { if (this.winningAmount >= 1) { try { @@ -371,8 +375,9 @@ export default { }, flipCard(index) { if (this.flippedCards.includes(index)) { - this.flippedCards.splice(this.flippedCards.indexOf(index), 1); - console.log(index, this.flippedCards) + // this.flippedCards.splice(this.flippedCards.indexOf(index), 1); + // console.log(index, this.flippedCards) + return } else { this.flippedCards.push(index); }