|
@@ -316,11 +316,11 @@
|
|
|
@showDepositMask="showDepositMessageBox = true"
|
|
|
@payFinish="payFinish">
|
|
|
<template v-slot:balance>
|
|
|
- <div class="balance" v-if="Number(baseFormData.amountValue) <= Number(currentCurrencyInfo.balance)">
|
|
|
+ <div class="balance" v-if="Number(baseFormData.amountValue) <= Number(currentCurrencyInfo.balance) || currentCurrencyInfo.currencyCode == 'USD' ">
|
|
|
<img class="icon" src="@/assets/subject/icon-balance.png" />
|
|
|
<div class="con">
|
|
|
<div class="desc">Balance</div>
|
|
|
- <div class="price">{{currentCurrencyInfo.balance}} {{currentCurrencyInfo.tokenSymbol}}</div>
|
|
|
+ <div class="price">{{currentCurrencyInfo.balance}} {{currentCurrencyInfo.currencyCode == 'USD' ? '$' :currentCurrencyInfo.tokenSymbol}}</div>
|
|
|
</div>
|
|
|
<img class="refresh"
|
|
|
:class="{ 'icon-refresh-rotate': refreshRotate }"
|
|
@@ -721,6 +721,7 @@ watch(
|
|
|
() => props.dialogData,
|
|
|
(newVal) => {
|
|
|
visible.value = newVal.visible;
|
|
|
+ USDepositStatus.value = "DEFAULT"
|
|
|
|
|
|
if (newVal.visible) {
|
|
|
publishType.value = newVal.type;
|
|
@@ -750,6 +751,7 @@ watch(
|
|
|
const emits = defineEmits(["close", "confirm", "postPublishFinish"]);
|
|
|
|
|
|
const close = () => {
|
|
|
+ USDepositStatus.value = "DEFAULT"
|
|
|
if(publishType.value == 'TOOL_BOX') {
|
|
|
closeToolBoxPage()
|
|
|
} else {
|
|
@@ -1851,6 +1853,21 @@ const submitReward = (reward) => {
|
|
|
onIptSetErrorTxt();
|
|
|
}
|
|
|
|
|
|
+const updateUSDeposit = async () => {
|
|
|
+ if(showDepositMessageBox.value) {
|
|
|
+ let currencyInfoRes = await getCurrencyByCode({currencyCode: currentCurrencyInfo.value.currencyCode});
|
|
|
+
|
|
|
+ if(currencyInfoRes.code == 0 && currencyInfoRes.data) {
|
|
|
+ currentCurrencyInfo.value = currencyInfoRes.data;
|
|
|
+ let {balance} = currencyInfoRes.data;
|
|
|
+ if(balance >= finalAmountData.value.orderAmountValue) {
|
|
|
+ USDepositStatus.value = 'SUCCESS';
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+};
|
|
|
+
|
|
|
+
|
|
|
const depositAchCancel = async () => {
|
|
|
showDepositMessageBox.value = false;
|
|
|
let currencyInfoRes = await getCurrencyByCode({currencyCode: currentCurrencyInfo.value.currencyCode});
|
|
@@ -1864,6 +1881,7 @@ const depositAchCancel = async () => {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+
|
|
|
const depositAchConfirm = async () => {
|
|
|
let currencyInfoRes = await getCurrencyByCode({currencyCode: currentCurrencyInfo.value.currencyCode});
|
|
|
|
|
@@ -1874,16 +1892,27 @@ const depositAchConfirm = async () => {
|
|
|
let {balance} = currencyInfoRes.data;
|
|
|
if(balance >= finalAmountData.value.orderAmountValue) {
|
|
|
USDepositStatus.value = 'SUCCESS';
|
|
|
+ payButtonDom.value && payButtonDom.value.balancePay();
|
|
|
} else {
|
|
|
message.info('Deposit failed, please try again later');
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+const onPageVisbile = () => {
|
|
|
+ document.addEventListener('visibilitychange', function () {
|
|
|
+ let isHidden = document.hidden;
|
|
|
+ if (!isHidden) {
|
|
|
+ updateUSDeposit();
|
|
|
+ }
|
|
|
+ });
|
|
|
+}
|
|
|
+
|
|
|
onMounted(() => {
|
|
|
setFrontConfig();
|
|
|
setPayConfig();
|
|
|
getLocalCurrencyInfoByCode();
|
|
|
+ onPageVisbile();
|
|
|
window.addEventListener('resize', function () {
|
|
|
setDialogStyle(true);
|
|
|
})
|