added notification crash

This commit is contained in:
Kostya
2024-02-04 23:11:35 +03:00
parent 910ac16ea9
commit 06c29ec26c
2 changed files with 40 additions and 7 deletions

View File

@@ -163,4 +163,18 @@
height: 300px; height: 300px;
} }
/* /Crash-Players */ /* /Crash-Players */
/* Notification */
.notification-crash {
text-align: center;
top: 20%;
left: 50%;
position: absolute;
background: #000;
width: 200px;
height: 40px;
}
/* /Notification */

View File

@@ -63,7 +63,9 @@
</div> </div>
</section> </section>
</div> </div>
<div class="notification-crash" v-if="notificationShow">
<h2>{{ notificationText }}</h2>
</div>
</div> </div>
</template> </template>
@@ -92,10 +94,12 @@ export default {
clickedBtn: null, clickedBtn: null,
ErrorClick: false, ErrorClick: false,
ErrorJoin: false, ErrorJoin: false,
notificationShow: false,
balance: 0, balance: 0,
amountDeposit: 0, amountDeposit: 0,
crashObject: '', crashObject: '',
textError: '', textError: '',
notificationText: '',
startGame: false, startGame: false,
} }
}, },
@@ -246,6 +250,15 @@ export default {
return return
} }
else if (response === 'Success') {
this.notificationText = 'Успешное добавление в очередь'
this.notificationShow = true
setTimeout(() => {
this.notificationText = ''
this.notificationShow = false
}, 1000)
}
this.startGame = true this.startGame = true
}) })
} }
@@ -268,13 +281,19 @@ export default {
.then((response) => { .then((response) => {
console.log(response) console.log(response)
this.startGame = false this.startGame = false
if (response.startsWith('Win')) {
this.notificationText = 'Деньги успешно зачислены. Игра покинута.'
this.notificationShow = true
setTimeout(() => {
this.notificationText = ''
this.notificationShow = false
}, 1500)
}
this.updateUserMoney() this.updateUserMoney()
}) })
// await GetCurrentMoney(GetCookie('AUTHTOKEN'), GetCookie('SearchToken'))
// .then((response) => {
// this.balance = response.currentMoney
// return eventBus.emit('Updatebalance')
// })
} }
}, },
async clickedBtnChoice(index, content) { async clickedBtnChoice(index, content) {