mirror of
https://github.com/yawaflua/LuckyDiamond.git
synced 2025-12-10 04:09:29 +02:00
added changed with btns crash
This commit is contained in:
@@ -113,9 +113,17 @@
|
|||||||
border-radius: 10px;
|
border-radius: 10px;
|
||||||
width: 300px;
|
width: 300px;
|
||||||
height: 60px;
|
height: 60px;
|
||||||
font-family: 'Montserrat Alternates';
|
font-family: 'Inter';
|
||||||
font-weight: 700;
|
font-weight: 700;
|
||||||
font-size: 16px;
|
font-size: 18px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.claim-btn-crash__prize {
|
||||||
|
background: #4E5EF2 !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.waiting-btn-crash {
|
||||||
|
background: #3D3F48 !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
.crash-window__line {
|
.crash-window__line {
|
||||||
|
|||||||
@@ -33,8 +33,9 @@
|
|||||||
<h2>{{ textError }}</h2>
|
<h2>{{ textError }}</h2>
|
||||||
</div>
|
</div>
|
||||||
<div class="crash-game-window__btn-start">
|
<div class="crash-game-window__btn-start">
|
||||||
<button v-if="startGame && crashObject.Status !== 'WaitingForPlayers'" @click="clickClaimDep">Забрать</button>
|
<button v-if="startGame && crashObject.Status !== 'WaitingForPlayers'" @click="clickClaimDep" class="claim-btn-crash__prize">Забрать {{ prizeUser.toFixed(2) }} АР</button>
|
||||||
<button v-else @click="clickPlayBtn" :class="{ 'animate-start-btn': ErrorClick }">Начать игру</button>
|
<button v-if="startGame && crashObject.Status === 'WaitingForPlayers'" class="waiting-btn-crash">Ожидание игроков...</button>
|
||||||
|
<button v-if="!startGame" @click="clickPlayBtn" :class="{ 'animate-start-btn': ErrorClick }">Начать игру</button>
|
||||||
</div>
|
</div>
|
||||||
<div class="crash-window__line">
|
<div class="crash-window__line">
|
||||||
<div class="line-crash">
|
<div class="line-crash">
|
||||||
@@ -113,6 +114,7 @@ export default {
|
|||||||
crashObject: '',
|
crashObject: '',
|
||||||
textError: '',
|
textError: '',
|
||||||
startGame: false,
|
startGame: false,
|
||||||
|
prizeUser: 0,
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
setup() {
|
setup() {
|
||||||
@@ -130,8 +132,13 @@ export default {
|
|||||||
console.error(e)
|
console.error(e)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (this.crashObject.CurrentX !== null && this.crashObject.Players.some(player => player.UserName === GetCookie('SpUserName'))) {
|
||||||
|
this.getUserPrizer()
|
||||||
|
}
|
||||||
|
|
||||||
if (this.crashObject.Status === 'GameEnd' && this.startGame === true && this.crashObject.Players.some(player => player.UserName === GetCookie('SpUserName'))) {
|
if (this.crashObject.Status === 'GameEnd' && this.startGame === true && this.crashObject.Players.some(player => player.UserName === GetCookie('SpUserName'))) {
|
||||||
this.startGame = false
|
this.startGame = false
|
||||||
|
this.prizeUser = 0
|
||||||
this.updateUserMoney()
|
this.updateUserMoney()
|
||||||
}
|
}
|
||||||
if (
|
if (
|
||||||
@@ -231,6 +238,17 @@ export default {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
async getUserPrizer() {
|
||||||
|
const currentUser = this.crashObject.Players.find(player => player.UserName === GetCookie('SpUserName'));
|
||||||
|
|
||||||
|
if (currentUser) {
|
||||||
|
setTimeout(async () => {
|
||||||
|
this.prizeUser = currentUser.Bid * this.crashObject.CurrentX
|
||||||
|
}, 100)
|
||||||
|
} else {
|
||||||
|
return 0
|
||||||
|
}
|
||||||
|
},
|
||||||
async clickPlayBtn() {
|
async clickPlayBtn() {
|
||||||
this.v$.$touch()
|
this.v$.$touch()
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user