From 4c219684da15394d1c942078be7fe9957914538d Mon Sep 17 00:00:00 2001 From: Kostya Date: Sun, 4 Feb 2024 16:07:01 +0300 Subject: [PATCH] added validation for crash-start window --- .../css/PagesStyles/games-pages/crash.css | 4 ++ .../src/pages/games-pages/CrashgamePage.vue | 38 +++++++++++++++++-- 2 files changed, 39 insertions(+), 3 deletions(-) diff --git a/luckydiamond/src/assets/css/PagesStyles/games-pages/crash.css b/luckydiamond/src/assets/css/PagesStyles/games-pages/crash.css index 179a940..2a0d997 100644 --- a/luckydiamond/src/assets/css/PagesStyles/games-pages/crash.css +++ b/luckydiamond/src/assets/css/PagesStyles/games-pages/crash.css @@ -127,6 +127,10 @@ z-index: 1; } +.crash-content .error-block { + top: 500px; +} + /* /Crash-Window */ /* Crash-Graph */ diff --git a/luckydiamond/src/pages/games-pages/CrashgamePage.vue b/luckydiamond/src/pages/games-pages/CrashgamePage.vue index 1b59947..0894571 100644 --- a/luckydiamond/src/pages/games-pages/CrashgamePage.vue +++ b/luckydiamond/src/pages/games-pages/CrashgamePage.vue @@ -35,8 +35,11 @@ +
+

Ошибка при заполнении

+
- +
@@ -82,8 +85,10 @@ export default { return { SaperNumbers, clickedBtn: null, + ErrorClick: false, + balance: 0, amountDeposit: 0, - autoRatio: 0, + autoRatio: '', crashObject: '' } }, @@ -105,7 +110,7 @@ export default { }, validations() { return { - amountDeposit: { required, numeric, minValue: minValue(1), maxValue: maxValue(100), integer }, + amountDeposit: { required, numeric, minValue: minValue(1), maxValue: maxValue(this.balance), integer }, autoRatio: { numeric, minValue: minValue(1.01) } } }, @@ -166,7 +171,34 @@ export default { } }, }, + async created() { + if (GetCookie('AUTHTOKEN') && GetCookie('SearchToken')) { + await GetCurrentMoney(GetCookie('AUTHTOKEN'), GetCookie('SearchToken')) + .then((response) => { + this.balance = response.currentMoney + }) + } + }, methods: { + clickPlayBtn() { + this.v$.$touch() + + if (this.v$.amountDeposit.$error) { + this.errorPlayButton() + } + if (this.v$.autoRatio.$error) { + this.errorPlayButton() + } + if (!this.v$.amountDeposit.$error && this.v$.autoRatio.$error) { + // + } + }, + errorPlayButton() { + this.ErrorClick = true + setTimeout(() => { + this.ErrorClick = false + }, 2000) + }, async clickedBtnChoice(index, content) { this.clickedBtn = index if (content === 'max') {