mirror of
https://github.com/yawaflua/LuckyDiamond.git
synced 2025-12-10 12:19:31 +02:00
fixed validation for deposit-payments
This commit is contained in:
@@ -180,6 +180,19 @@
|
|||||||
color: #EA3D38;
|
color: #EA3D38;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.error-deposit {
|
||||||
|
position: absolute;
|
||||||
|
left: 190px;
|
||||||
|
top: 52px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.error-deposit h2 {
|
||||||
|
color: #BA3636;
|
||||||
|
font-family: "Montserrat Alternates";
|
||||||
|
font-weight: 700;
|
||||||
|
font-size: 11px;
|
||||||
|
}
|
||||||
|
|
||||||
/* Media */
|
/* Media */
|
||||||
|
|
||||||
@media screen and (min-device-width: 1400px) and (max-device-width: 1600px) {
|
@media screen and (min-device-width: 1400px) and (max-device-width: 1600px) {
|
||||||
|
|||||||
@@ -8,12 +8,15 @@
|
|||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
<div v-if="payments" class="payments-modal__deposit">
|
<div v-if="payments" class="payments-modal__deposit">
|
||||||
|
<div class="error-deposit" v-if="errorDeposit">
|
||||||
|
<h2>Ошибка с суммой депозита</h2>
|
||||||
|
</div>
|
||||||
<div
|
<div
|
||||||
class="deposit-input deposit-text deposit-icon-diamond deposit-icon__input"
|
class="deposit-input deposit-text deposit-icon-diamond deposit-icon__input"
|
||||||
>
|
>
|
||||||
<h3>Сумма пополнения</h3>
|
<h3>Сумма пополнения</h3>
|
||||||
<img src="@/assets/icons-games/saper-game/icon-diamond-ore-saper.png" />
|
<img src="@/assets/icons-games/saper-game/icon-diamond-ore-saper.png" />
|
||||||
<input class="deposit-amount__input" v-model="amount" type="number" />
|
<input :class="{ 'animate-start-btn' : errorDeposit }" class="deposit-amount__input" v-model="amount" type="number" />
|
||||||
<div class="deposit-btns">
|
<div class="deposit-btns">
|
||||||
<ul class="display-btns btns-style-diamonds">
|
<ul class="display-btns btns-style-diamonds">
|
||||||
<li v-for="number in PaymentsModalNumbers" :key="number">
|
<li v-for="number in PaymentsModalNumbers" :key="number">
|
||||||
@@ -36,9 +39,12 @@
|
|||||||
<div class="deposit-promocode deposit-promocode__padding--input">
|
<div class="deposit-promocode deposit-promocode__padding--input">
|
||||||
<h3>Промокод</h3>
|
<h3>Промокод</h3>
|
||||||
<input @focusout="checkValidationPromocode" v-model="promocode" class="promo-input" type="text" />
|
<input @focusout="checkValidationPromocode" v-model="promocode" class="promo-input" type="text" />
|
||||||
|
</div>
|
||||||
|
<div class="error-checkbox" v-if="errorAgree">
|
||||||
|
<h2>Подтвердите согласие!</h2>
|
||||||
</div>
|
</div>
|
||||||
<div class="deposit-checkbox checkbox-styles">
|
<div class="deposit-checkbox checkbox-styles">
|
||||||
<input @click="agreeUser = !agreeUser" type="checkbox" />
|
<input @click="agreeUser = !agreeUser" type="checkbox" :class="{ 'animate-start-btn' : errorAgree }" />
|
||||||
<h3>Я согласен с пользовательским соглашением.</h3>
|
<h3>Я согласен с пользовательским соглашением.</h3>
|
||||||
</div>
|
</div>
|
||||||
<div
|
<div
|
||||||
@@ -49,7 +55,6 @@
|
|||||||
</p>
|
</p>
|
||||||
<button
|
<button
|
||||||
type="submit"
|
type="submit"
|
||||||
:disabled="checkOffBtn"
|
|
||||||
@click="RedirectedMethodDep"
|
@click="RedirectedMethodDep"
|
||||||
>
|
>
|
||||||
Пополнить
|
Пополнить
|
||||||
@@ -65,7 +70,7 @@
|
|||||||
<div class="count-withdraw deposit-icon-diamond">
|
<div class="count-withdraw deposit-icon-diamond">
|
||||||
<h3>Сумма вывода</h3>
|
<h3>Сумма вывода</h3>
|
||||||
<img src="@/assets/icons-games/saper-game/icon-diamond-ore-saper.png" />
|
<img src="@/assets/icons-games/saper-game/icon-diamond-ore-saper.png" />
|
||||||
<input class="with-input" v-model="amountWithdraw" type="number" />
|
<input class="with-input" v-model="amount" type="number" />
|
||||||
</div>
|
</div>
|
||||||
<div class="number-card deposit-promocode__padding--input">
|
<div class="number-card deposit-promocode__padding--input">
|
||||||
<h3>Введите номер карты</h3>
|
<h3>Введите номер карты</h3>
|
||||||
@@ -103,6 +108,11 @@ import PaymentsModalNumbers from "@/mocks/PaymentsModalNumbers";
|
|||||||
import { GettingMoneyOperation, WithdrawMoneyOperation } from "@/assets/js/moneyoperation/Claimmoney";
|
import { GettingMoneyOperation, WithdrawMoneyOperation } from "@/assets/js/moneyoperation/Claimmoney";
|
||||||
import CaptchaComponent from "@/components/CaptchaComponent.vue";
|
import CaptchaComponent from "@/components/CaptchaComponent.vue";
|
||||||
|
|
||||||
|
import { useVuelidate } from '@vuelidate/core'
|
||||||
|
import { maxValue, minValue, required, numeric, integer } from "@vuelidate/validators";
|
||||||
|
import {GetCurrentMoney} from "@/assets/js/rest/RestMethods";
|
||||||
|
import {GetCookie} from "@/assets/js/storage/CookieStorage";
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
components: { CaptchaComponent },
|
components: { CaptchaComponent },
|
||||||
props: ["payments"],
|
props: ["payments"],
|
||||||
@@ -110,6 +120,7 @@ export default {
|
|||||||
return {
|
return {
|
||||||
amount: 0,
|
amount: 0,
|
||||||
amountWithdraw: 1,
|
amountWithdraw: 1,
|
||||||
|
balance: 0,
|
||||||
amountSave: 1,
|
amountSave: 1,
|
||||||
card: '',
|
card: '',
|
||||||
promocode: '',
|
promocode: '',
|
||||||
@@ -117,6 +128,7 @@ export default {
|
|||||||
errorPromocode: false,
|
errorPromocode: false,
|
||||||
showPromocodeStatus: false,
|
showPromocodeStatus: false,
|
||||||
errorAgree: false,
|
errorAgree: false,
|
||||||
|
errorDeposit: false,
|
||||||
captchaToken: null,
|
captchaToken: null,
|
||||||
clickedBtn: "",
|
clickedBtn: "",
|
||||||
url: "",
|
url: "",
|
||||||
@@ -132,45 +144,61 @@ export default {
|
|||||||
PaymentsModalNumbers,
|
PaymentsModalNumbers,
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
|
created() {
|
||||||
|
GetCurrentMoney(GetCookie("AUTHTOKEN"), GetCookie("SearchToken"))
|
||||||
|
.then(response => {
|
||||||
|
this.balance = response.currentMoney
|
||||||
|
})
|
||||||
|
},
|
||||||
|
setup() {
|
||||||
|
return { v$: useVuelidate() }
|
||||||
|
},
|
||||||
|
validations() {
|
||||||
|
return {
|
||||||
|
amount: { required, numeric, minValue: minValue(1), integer },
|
||||||
|
amountWithdraw: { required, numeric, minValue: minValue(1), maxValue: maxValue(this.balance), integer },
|
||||||
|
card: { required, numeric, minValue: (6), maxValue: (6), integer }
|
||||||
|
}
|
||||||
|
},
|
||||||
watch: {
|
watch: {
|
||||||
amount(newAmount) {
|
// amount(newAmount) {
|
||||||
this.offBtn = true;
|
// this.offBtn = true;
|
||||||
if (this.amount > 0 && this.amount !== "") {
|
// if (this.amount > 0 && this.amount !== "") {
|
||||||
setTimeout(() => {
|
// setTimeout(() => {
|
||||||
try {
|
// try {
|
||||||
GettingMoneyOperation(newAmount).then((response) => {
|
// GettingMoneyOperation(newAmount).then((response) => {
|
||||||
console.log("Payments Modal Working!: ", response);
|
// console.log("Payments Modal Working!: ", response);
|
||||||
this.url = response;
|
// this.url = response;
|
||||||
this.offBtn = false;
|
// this.offBtn = false;
|
||||||
});
|
// });
|
||||||
} catch (e) {
|
// } catch (e) {
|
||||||
console.error("Error in PaymentModal!", e);
|
// console.error("Error in PaymentModal!", e);
|
||||||
}
|
// }
|
||||||
}, 2000);
|
// }, 2000);
|
||||||
}
|
// }
|
||||||
},
|
// },
|
||||||
amountWithdraw(newAmount) {
|
// amountWithdraw(newAmount) {
|
||||||
this.completeValidtaion.amountsaving = false
|
// this.completeValidtaion.amountsaving = false
|
||||||
if (newAmount > 0) {
|
// if (newAmount > 0) {
|
||||||
this.amountSave = newAmount
|
// this.amountSave = newAmount
|
||||||
this.completeValidtaion.amountsaving = true
|
// this.completeValidtaion.amountsaving = true
|
||||||
console.log(this.completeValidtaion)
|
// console.log(this.completeValidtaion)
|
||||||
}
|
// }
|
||||||
},
|
// },
|
||||||
card(newAmount) {
|
// card(newAmount) {
|
||||||
this.completeValidtaion.cardsaving = false
|
// this.completeValidtaion.cardsaving = false
|
||||||
const cardPattern = /^\d{5}$/;
|
// const cardPattern = /^\d{5}$/;
|
||||||
if(cardPattern.test(newAmount)) {
|
// if(cardPattern.test(newAmount)) {
|
||||||
this.offAgree = false
|
// this.offAgree = false
|
||||||
this.completeValidtaion.cardsaving = true
|
// this.completeValidtaion.cardsaving = true
|
||||||
}
|
// }
|
||||||
},
|
// },
|
||||||
agreeUser(newAgree) {
|
// agreeUser(newAgree) {
|
||||||
this.completeValidtaion.agreesaving = false
|
// this.completeValidtaion.agreesaving = false
|
||||||
if (newAgree !== false) {
|
// if (newAgree !== false) {
|
||||||
this.completeValidtaion.agreesaving = true
|
// this.completeValidtaion.agreesaving = true
|
||||||
}
|
// }
|
||||||
},
|
// },
|
||||||
completeValidtaion: {
|
completeValidtaion: {
|
||||||
handler() {
|
handler() {
|
||||||
this.completeValidationCheck()
|
this.completeValidationCheck()
|
||||||
@@ -207,9 +235,35 @@ export default {
|
|||||||
this.captchaToken = Token
|
this.captchaToken = Token
|
||||||
this.completeValidtaion.captchatokensaving = true
|
this.completeValidtaion.captchatokensaving = true
|
||||||
},
|
},
|
||||||
RedirectedMethodDep() {
|
async RedirectedMethodDep() {
|
||||||
console.log(`From /profile to - ${this.url} url`)
|
this.v$.$touch()
|
||||||
|
|
||||||
|
if (this.v$.amount.$error) {
|
||||||
|
this.errorDeposit = true
|
||||||
|
|
||||||
|
setTimeout(() => {
|
||||||
|
this.errorDeposit = false
|
||||||
|
}, 1500)
|
||||||
|
}
|
||||||
|
if (this.agreeUser !== true) {
|
||||||
|
this.errorAgree = true
|
||||||
|
setTimeout(() => {
|
||||||
|
this.errorAgree = false
|
||||||
|
}, 1500)
|
||||||
|
}
|
||||||
|
if (!this.v$.amount.$error && this.agreeUser === true) {
|
||||||
|
try {
|
||||||
|
GettingMoneyOperation(this.amount).then((response) => {
|
||||||
|
console.log("Payments Modal Working!: ", response);
|
||||||
|
this.url = response;
|
||||||
|
this.offBtn = false;
|
||||||
|
|
||||||
window.location.href = this.url
|
window.location.href = this.url
|
||||||
|
});
|
||||||
|
} catch (e) {
|
||||||
|
console.error("Error in PaymentModal!", e);
|
||||||
|
}
|
||||||
|
}
|
||||||
},
|
},
|
||||||
async RedirectedMethodTransferMoneyToSp() {
|
async RedirectedMethodTransferMoneyToSp() {
|
||||||
setTimeout(async () => {
|
setTimeout(async () => {
|
||||||
|
|||||||
@@ -388,10 +388,10 @@ export default {
|
|||||||
if (this.v$.amountDeposit.$error) {
|
if (this.v$.amountDeposit.$error) {
|
||||||
this.errorPlayButton()
|
this.errorPlayButton()
|
||||||
}
|
}
|
||||||
else if (this.v$.amountCrystals.$error) {
|
if (this.v$.amountCrystals.$error) {
|
||||||
this.errorPlayButton()
|
this.errorPlayButton()
|
||||||
}
|
}
|
||||||
else {
|
if (!this.v$.amountCrystals.$error && !this.v$.amountDeposit.$error) {
|
||||||
this.flippedCards = []
|
this.flippedCards = []
|
||||||
this.unCorrectClick = []
|
this.unCorrectClick = []
|
||||||
this.CorrectsClick = []
|
this.CorrectsClick = []
|
||||||
|
|||||||
Reference in New Issue
Block a user