mirror of
https://github.com/yawaflua/LuckyDiamond.git
synced 2025-12-10 04:09:29 +02:00
delete closo modal on captcha
This commit is contained in:
@@ -16,7 +16,12 @@
|
|||||||
>
|
>
|
||||||
<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="{ 'animate-start-btn' : errorDeposit }" 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, index) in PaymentsModalNumbers" :key="index">
|
<li v-for="(number, index) in PaymentsModalNumbers" :key="index">
|
||||||
@@ -33,21 +38,36 @@
|
|||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
<div v-if="showPromocodeStatus" class="error-promocode">
|
<div v-if="showPromocodeStatus" class="error-promocode">
|
||||||
<h2 v-if="errorPromocode" class="error-text__promocode">{{ promoResponse }}</h2>
|
<h2 v-if="errorPromocode" class="error-text__promocode">
|
||||||
<h2 v-else class="correct-text__promocode">Промокод успешно применён</h2>
|
{{ promoResponse }}
|
||||||
|
</h2>
|
||||||
|
<h2 v-else class="correct-text__promocode">
|
||||||
|
Промокод успешно применён
|
||||||
|
</h2>
|
||||||
</div>
|
</div>
|
||||||
<div class="deposit-promocode deposit-promocode__padding--input">
|
<div class="deposit-promocode deposit-promocode__padding--input">
|
||||||
<h3>Промокод</h3>
|
<h3>Промокод</h3>
|
||||||
<div class="promokods">
|
<div class="promokods">
|
||||||
<input @focusout="checkValidationPromocode" v-model="promocode" class="promo-input" type="text" />
|
<input
|
||||||
<button class="vvod_promocoda" @click="handleApplyPromoCode">Ввод</button>
|
@focusout="checkValidationPromocode"
|
||||||
|
v-model="promocode"
|
||||||
|
class="promo-input"
|
||||||
|
type="text"
|
||||||
|
/>
|
||||||
|
<button class="vvod_promocoda" @click="handleApplyPromoCode">
|
||||||
|
Ввод
|
||||||
|
</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="error-checkbox" v-if="errorAgree">
|
<div class="error-checkbox" v-if="errorAgree">
|
||||||
<h2>Подтвердите согласие!</h2>
|
<h2>Подтвердите согласие!</h2>
|
||||||
</div>
|
</div>
|
||||||
<div class="deposit-checkbox checkbox-styles">
|
<div class="deposit-checkbox checkbox-styles">
|
||||||
<input @click="agreeUser = !agreeUser" type="checkbox" :class="{ 'animate-start-btn' : errorAgree }" />
|
<input
|
||||||
|
@click="agreeUser = !agreeUser"
|
||||||
|
type="checkbox"
|
||||||
|
:class="{ 'animate-start-btn': errorAgree }"
|
||||||
|
/>
|
||||||
<h3>Я согласен с пользовательским соглашением.</h3>
|
<h3>Я согласен с пользовательским соглашением.</h3>
|
||||||
</div>
|
</div>
|
||||||
<div
|
<div
|
||||||
@@ -56,12 +76,7 @@
|
|||||||
<p>
|
<p>
|
||||||
Вы подтверждаете правильность введенных данных при создании вывода.
|
Вы подтверждаете правильность введенных данных при создании вывода.
|
||||||
</p>
|
</p>
|
||||||
<button
|
<button type="submit" @click="RedirectedMethodDep">Пополнить</button>
|
||||||
type="submit"
|
|
||||||
@click="RedirectedMethodDep"
|
|
||||||
>
|
|
||||||
Пополнить
|
|
||||||
</button>
|
|
||||||
<p>
|
<p>
|
||||||
Перед пополнение прочитайте политику конфиденциальности и
|
Перед пополнение прочитайте политику конфиденциальности и
|
||||||
пользовательское соглашение.
|
пользовательское соглашение.
|
||||||
@@ -76,26 +91,40 @@
|
|||||||
<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="{ 'animate-start-btn' : errorDeposit }" class="with-input" v-model="amountWithdraw" type="number" />
|
<input
|
||||||
|
:class="{ 'animate-start-btn': errorDeposit }"
|
||||||
|
class="with-input"
|
||||||
|
v-model="amountWithdraw"
|
||||||
|
type="number"
|
||||||
|
/>
|
||||||
</div>
|
</div>
|
||||||
<div class="error-card" v-if="errorCard">
|
<div class="error-card" v-if="errorCard">
|
||||||
<h2>Ошибка с вводом карты</h2>
|
<h2>Ошибка с вводом карты</h2>
|
||||||
</div>
|
</div>
|
||||||
<div class="number-card deposit-promocode__padding--input">
|
<div class="number-card deposit-promocode__padding--input">
|
||||||
<h3>Введите номер карты</h3>
|
<h3>Введите номер карты</h3>
|
||||||
<input :class="{ 'animate-start-btn' : errorCard }" class="with-input" v-model="card" type="text" />
|
<input
|
||||||
|
:class="{ 'animate-start-btn': errorCard }"
|
||||||
|
class="with-input"
|
||||||
|
v-model="card"
|
||||||
|
type="text"
|
||||||
|
/>
|
||||||
</div>
|
</div>
|
||||||
<div class="error-checkbox" v-if="errorAgree">
|
<div class="error-checkbox" v-if="errorAgree">
|
||||||
<h2>Подтвердите согласие!</h2>
|
<h2>Подтвердите согласие!</h2>
|
||||||
</div>
|
</div>
|
||||||
<div class="withdraw-checkbox checkbox-styles">
|
<div class="withdraw-checkbox checkbox-styles">
|
||||||
<input @click="agreeUser = !agreeUser" type="checkbox"/>
|
<input @click="agreeUser = !agreeUser" type="checkbox" />
|
||||||
<h3>Я согласен с пользовательским соглашением.</h3>
|
<h3>Я согласен с пользовательским соглашением.</h3>
|
||||||
</div>
|
</div>
|
||||||
<div class="error-captcha" v-if="errorCaptcha && agreeUser === true">
|
<div class="error-captcha" v-if="errorCaptcha && agreeUser === true">
|
||||||
<h2>Пройдите проверку!</h2>
|
<h2>Пройдите проверку!</h2>
|
||||||
</div>
|
</div>
|
||||||
<captcha-component @captchatokendata="claimCaptchaToken" :showcaptcha="agreeUser" @captchadata="closeModal"></captcha-component>
|
<captcha-component
|
||||||
|
@captchatokendata="claimCaptchaToken"
|
||||||
|
:showcaptcha="agreeUser"
|
||||||
|
></captcha-component>
|
||||||
|
<!-- <captcha-component @captchatokendata="claimCaptchaToken" :showcaptcha="agreeUser" @captchadata="closeModal"></captcha-component> -->
|
||||||
<div
|
<div
|
||||||
class="btn-withdraw btn-text-style btn-display-deposit btn-style-payments"
|
class="btn-withdraw btn-text-style btn-display-deposit btn-style-payments"
|
||||||
>
|
>
|
||||||
@@ -117,16 +146,26 @@
|
|||||||
<script>
|
<script>
|
||||||
import "@/assets/css/ComponentsStyles/payments-modal.css";
|
import "@/assets/css/ComponentsStyles/payments-modal.css";
|
||||||
import PaymentsModalNumbers from "@/mocks/PaymentsModalNumbers";
|
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 { eventBus } from "@/main";
|
||||||
|
|
||||||
import {eventBus} from "@/main";
|
import { useVuelidate } from "@vuelidate/core";
|
||||||
|
import {
|
||||||
import { useVuelidate } from '@vuelidate/core'
|
maxValue,
|
||||||
import {maxValue, minValue, required, numeric, integer, minLength, maxLength} from "@vuelidate/validators";
|
minValue,
|
||||||
import {GetCurrentMoney} from "@/assets/js/rest/RestMethods";
|
required,
|
||||||
import {GetCookie} from "@/assets/js/storage/CookieStorage";
|
numeric,
|
||||||
|
integer,
|
||||||
|
minLength,
|
||||||
|
maxLength,
|
||||||
|
} from "@vuelidate/validators";
|
||||||
|
import { GetCurrentMoney } from "@/assets/js/rest/RestMethods";
|
||||||
|
import { GetCookie } from "@/assets/js/storage/CookieStorage";
|
||||||
import { ApplyPromoCode } from "@/assets/js/rest/RestMethods.js"; // Замените на правильный путь к файлу с функцией ApplyPromoCode
|
import { ApplyPromoCode } from "@/assets/js/rest/RestMethods.js"; // Замените на правильный путь к файлу с функцией ApplyPromoCode
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
@@ -137,9 +176,9 @@ export default {
|
|||||||
amount: 0,
|
amount: 0,
|
||||||
amountWithdraw: 0,
|
amountWithdraw: 0,
|
||||||
balance: 0,
|
balance: 0,
|
||||||
card: '',
|
card: "",
|
||||||
promocode: '',
|
promocode: "",
|
||||||
promocodeBase: ['ANTI-GRIF'],
|
promocodeBase: ["ANTI-GRIF"],
|
||||||
errorPromocode: false,
|
errorPromocode: false,
|
||||||
showPromocodeStatus: false,
|
showPromocodeStatus: false,
|
||||||
errorAgree: false,
|
errorAgree: false,
|
||||||
@@ -153,65 +192,77 @@ export default {
|
|||||||
amountsaving: true,
|
amountsaving: true,
|
||||||
cardsaving: false,
|
cardsaving: false,
|
||||||
agreesaving: false,
|
agreesaving: false,
|
||||||
captchatokensaving: false
|
captchatokensaving: false,
|
||||||
},
|
},
|
||||||
agreeUser: false,
|
agreeUser: false,
|
||||||
PaymentsModalNumbers,
|
PaymentsModalNumbers,
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
created() {
|
created() {
|
||||||
GetCurrentMoney(GetCookie("AUTHTOKEN"), GetCookie("SearchToken"))
|
GetCurrentMoney(GetCookie("AUTHTOKEN"), GetCookie("SearchToken")).then(
|
||||||
.then(response => {
|
(response) => {
|
||||||
this.balance = response.currentMoney
|
this.balance = response.currentMoney;
|
||||||
})
|
}
|
||||||
|
);
|
||||||
},
|
},
|
||||||
setup() {
|
setup() {
|
||||||
return { v$: useVuelidate() }
|
return { v$: useVuelidate() };
|
||||||
},
|
},
|
||||||
validations() {
|
validations() {
|
||||||
return {
|
return {
|
||||||
amount: { required, numeric, minValue: minValue(1), integer },
|
amount: { required, numeric, minValue: minValue(1), integer },
|
||||||
amountWithdraw: { required, numeric, minValue: minValue(1), maxValue: maxValue(this.balance), integer },
|
amountWithdraw: {
|
||||||
card: { required, numeric, minLength: minLength(5), maxLength: maxLength(5), integer }
|
required,
|
||||||
}
|
numeric,
|
||||||
|
minValue: minValue(1),
|
||||||
|
maxValue: maxValue(this.balance),
|
||||||
|
integer,
|
||||||
|
},
|
||||||
|
card: {
|
||||||
|
required,
|
||||||
|
numeric,
|
||||||
|
minLength: minLength(5),
|
||||||
|
maxLength: maxLength(5),
|
||||||
|
integer,
|
||||||
|
},
|
||||||
|
};
|
||||||
},
|
},
|
||||||
watch: {
|
watch: {
|
||||||
amount(DepositCount) {
|
amount(DepositCount) {
|
||||||
console.log(DepositCount)
|
console.log(DepositCount);
|
||||||
if (![1, 5, 10, 50, 100, 1000].includes(DepositCount)) {
|
if (![1, 5, 10, 50, 100, 1000].includes(DepositCount)) {
|
||||||
this.clickedBtn = null
|
this.clickedBtn = null;
|
||||||
}
|
} else {
|
||||||
else {
|
let index;
|
||||||
let index
|
|
||||||
switch (DepositCount) {
|
switch (DepositCount) {
|
||||||
case 1:
|
case 1:
|
||||||
index = 0
|
index = 0;
|
||||||
break
|
break;
|
||||||
case 5:
|
case 5:
|
||||||
index = 1
|
index = 1;
|
||||||
break
|
break;
|
||||||
case 10:
|
case 10:
|
||||||
index = 2
|
index = 2;
|
||||||
break
|
break;
|
||||||
case 50:
|
case 50:
|
||||||
index = 3
|
index = 3;
|
||||||
break
|
break;
|
||||||
case 100:
|
case 100:
|
||||||
index = 4
|
index = 4;
|
||||||
break
|
break;
|
||||||
case 1000:
|
case 1000:
|
||||||
index = 5
|
index = 5;
|
||||||
break
|
break;
|
||||||
}
|
}
|
||||||
this.clickedBtnChoice(index, DepositCount)
|
this.clickedBtnChoice(index, DepositCount);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
completeValidtaion: {
|
completeValidtaion: {
|
||||||
handler() {
|
handler() {
|
||||||
this.completeValidationCheck()
|
this.completeValidationCheck();
|
||||||
},
|
},
|
||||||
deep: true
|
deep: true,
|
||||||
}
|
},
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
closeModal() {
|
closeModal() {
|
||||||
@@ -222,76 +273,70 @@ export default {
|
|||||||
// this.showPromocodeStatus = true
|
// this.showPromocodeStatus = true
|
||||||
// },
|
// },
|
||||||
completeValidationCheck() {
|
completeValidationCheck() {
|
||||||
this.offBtn = true
|
this.offBtn = true;
|
||||||
|
|
||||||
if (
|
if (
|
||||||
this.completeValidtaion.amountsaving &&
|
this.completeValidtaion.amountsaving &&
|
||||||
this.completeValidtaion.cardsaving &&
|
this.completeValidtaion.cardsaving &&
|
||||||
this.completeValidtaion.agreesaving &&
|
this.completeValidtaion.agreesaving &&
|
||||||
this.completeValidtaion.captchatokensaving
|
this.completeValidtaion.captchatokensaving
|
||||||
) {
|
) {
|
||||||
this.offBtn = false
|
this.offBtn = false;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
claimCaptchaToken(Token) {
|
claimCaptchaToken(Token) {
|
||||||
this.captchaToken = Token
|
this.captchaToken = Token;
|
||||||
this.completeValidtaion.captchatokensaving = true
|
this.completeValidtaion.captchatokensaving = true;
|
||||||
},
|
},
|
||||||
async handleApplyPromoCode() {
|
async handleApplyPromoCode() {
|
||||||
const authToken = GetCookie("AUTHTOKEN");
|
const authToken = GetCookie("AUTHTOKEN");
|
||||||
const searchToken = GetCookie("SearchToken");
|
const searchToken = GetCookie("SearchToken");
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const response = await ApplyPromoCode(authToken, searchToken, this.promocode);
|
const response = await ApplyPromoCode(
|
||||||
|
authToken,
|
||||||
|
searchToken,
|
||||||
|
this.promocode
|
||||||
|
);
|
||||||
|
|
||||||
console.log(response);
|
console.log(response);
|
||||||
|
|
||||||
if (response === 'Promo dont exist.')
|
if (response === "Promo dont exist.") {
|
||||||
{
|
this.showPromocodeStatus = true;
|
||||||
this.showPromocodeStatus = true;
|
this.errorPromocode = true;
|
||||||
this.errorPromocode = true;
|
this.promoResponse = "Промокод не найден";
|
||||||
this.promoResponse = 'Промокод не найден';
|
} else if (response === "promotional code has expired") {
|
||||||
}
|
this.showPromocodeStatus = true;
|
||||||
else if(response === 'promotional code has expired')
|
this.errorPromocode = true;
|
||||||
{
|
this.promoResponse = "Не действителен";
|
||||||
this.showPromocodeStatus = true;
|
} else if (response === "User is alredy use the promo") {
|
||||||
this.errorPromocode = true;
|
this.showPromocodeStatus = true;
|
||||||
this.promoResponse = 'Не действителен';
|
this.errorPromocode = true;
|
||||||
}
|
this.promoResponse = "Уже использован";
|
||||||
else if(response === 'User is alredy use the promo')
|
} else {
|
||||||
{
|
this.showPromocodeStatus = true;
|
||||||
this.showPromocodeStatus = true;
|
this.errorPromocode = false;
|
||||||
this.errorPromocode = true;
|
this.promoResponse = response;
|
||||||
this.promoResponse = 'Уже использован';
|
}
|
||||||
}
|
} catch (error) {
|
||||||
else
|
console.error("Ошибка при применении промокода:", error);
|
||||||
{
|
}
|
||||||
this.showPromocodeStatus = true;
|
},
|
||||||
this.errorPromocode = false;
|
|
||||||
this.promoResponse = response;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
catch (error)
|
|
||||||
{
|
|
||||||
console.error("Ошибка при применении промокода:", error);
|
|
||||||
}
|
|
||||||
},
|
|
||||||
async RedirectedMethodDep() {
|
async RedirectedMethodDep() {
|
||||||
this.v$.$touch()
|
this.v$.$touch();
|
||||||
|
|
||||||
if (this.v$.amount.$error) {
|
if (this.v$.amount.$error) {
|
||||||
this.errorDeposit = true
|
this.errorDeposit = true;
|
||||||
|
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
this.errorDeposit = false
|
this.errorDeposit = false;
|
||||||
}, 1500)
|
}, 1500);
|
||||||
}
|
}
|
||||||
if (this.agreeUser !== true) {
|
if (this.agreeUser !== true) {
|
||||||
this.errorAgree = true
|
this.errorAgree = true;
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
this.errorAgree = false
|
this.errorAgree = false;
|
||||||
}, 1500)
|
}, 1500);
|
||||||
}
|
}
|
||||||
if (!this.v$.amount.$error && this.agreeUser === true) {
|
if (!this.v$.amount.$error && this.agreeUser === true) {
|
||||||
try {
|
try {
|
||||||
@@ -300,7 +345,7 @@ export default {
|
|||||||
this.url = response;
|
this.url = response;
|
||||||
this.offBtn = false;
|
this.offBtn = false;
|
||||||
|
|
||||||
window.location.href = this.url
|
window.location.href = this.url;
|
||||||
});
|
});
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
console.error("Error in PaymentModal!", e);
|
console.error("Error in PaymentModal!", e);
|
||||||
@@ -308,54 +353,61 @@ export default {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
async RedirectedMethodTransferMoneyToSp() {
|
async RedirectedMethodTransferMoneyToSp() {
|
||||||
this.v$.$touch()
|
this.v$.$touch();
|
||||||
|
|
||||||
if (this.v$.amountWithdraw.$error) {
|
if (this.v$.amountWithdraw.$error) {
|
||||||
this.errorDeposit = true
|
this.errorDeposit = true;
|
||||||
|
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
this.errorDeposit = false
|
this.errorDeposit = false;
|
||||||
}, 1500)
|
}, 1500);
|
||||||
}
|
}
|
||||||
if (this.v$.card.$error) {
|
if (this.v$.card.$error) {
|
||||||
this.errorCard = true
|
this.errorCard = true;
|
||||||
|
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
this.errorCard = false
|
this.errorCard = false;
|
||||||
}, 1500)
|
}, 1500);
|
||||||
}
|
}
|
||||||
if (this.agreeUser !== true) {
|
if (this.agreeUser !== true) {
|
||||||
this.errorAgree = true
|
this.errorAgree = true;
|
||||||
|
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
this.errorAgree = false
|
this.errorAgree = false;
|
||||||
}, 1500)
|
}, 1500);
|
||||||
}
|
}
|
||||||
if (this.captchaToken === null) {
|
if (this.captchaToken === null) {
|
||||||
this.errorCaptcha = true
|
this.errorCaptcha = true;
|
||||||
|
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
this.errorCaptcha = false
|
this.errorCaptcha = false;
|
||||||
}, 1500)
|
}, 1500);
|
||||||
}
|
}
|
||||||
if (!this.v$.amountWithdraw.$error && !this.v$.card.$error && this.agreeUser === true && this.captchaToken !== null) {
|
if (
|
||||||
WithdrawMoneyOperation(this.amountWithdraw, this.card.toString(), this.captchaToken)
|
!this.v$.amountWithdraw.$error &&
|
||||||
.then(async response => {
|
!this.v$.card.$error &&
|
||||||
try {
|
this.agreeUser === true &&
|
||||||
console.log('work', response)
|
this.captchaToken !== null
|
||||||
}
|
) {
|
||||||
catch (e) {
|
WithdrawMoneyOperation(
|
||||||
console.error(e)
|
this.amountWithdraw,
|
||||||
}
|
this.card.toString(),
|
||||||
await this.$emit('notifacetionmoney')
|
this.captchaToken
|
||||||
eventBus.emit('Updatebalance')
|
).then(async (response) => {
|
||||||
})
|
try {
|
||||||
|
console.log("work", response);
|
||||||
|
} catch (e) {
|
||||||
|
console.error(e);
|
||||||
|
}
|
||||||
|
await this.$emit("notifacetionmoney");
|
||||||
|
eventBus.emit("Updatebalance");
|
||||||
|
});
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
clickedBtnChoice(index, content) {
|
clickedBtnChoice(index, content) {
|
||||||
this.clickedBtn = index;
|
this.clickedBtn = index;
|
||||||
this.amount = content;
|
this.amount = content;
|
||||||
console.log(index)
|
console.log(index);
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user