added logic for check balance user

This commit is contained in:
Kostya
2024-01-21 00:45:20 +03:00
parent 6bbd7e0195
commit a7064a716f

View File

@@ -148,6 +148,7 @@ SwiperCore.use([Navigation]);
import '@/assets/css/PagesStyles/games-pages/saper.css'
import SaperNumbers from "@/mocks/SaperNumbers";
import {GetCurrentMoney} from "@/assets/js/rest/RestMethods";
export default {
components: {ChatComponent, HeaderElementPage, AsideBarElement, Swiper, SwiperSlide },
@@ -173,11 +174,24 @@ export default {
}
},
watch: {
amountDeposit(DiamondCount) {
async amountDeposit(DiamondCount) {
if (DiamondCount >= 1) {
try {
let balance = 0
await GetCurrentMoney(GetCookie('AUTHTOKEN'), GetCookie('SearchToken'))
.then((response) => {
this.balance = response
console.log(balance)
})
if (balance >= DiamondCount) {
this.amountSaveDeposit = DiamondCount
this.ValidationPlay.DiamondValidate = true
}
}
catch (e) {
console.error('Error amountdep', e)
}
}
},
async amountCrystals(CrystalsCount) {
this.PercentageGameSteps = []
@@ -190,7 +204,6 @@ export default {
response.forEach((item) => {
if (item !== 'Infinity' && item !== '-Infinity') {
this.PercentageGameSteps.push(Number(item))
console.log(this.PercentageGameSteps)
}
})
})