|
@@ -316,11 +316,19 @@
|
|
|
@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">
|
|
|
+ <template v-if="currentCurrencyInfo.currencyCode == 'USD'">
|
|
|
+ $
|
|
|
+ </template>
|
|
|
+ {{currentCurrencyInfo.balance}}
|
|
|
+ <template v-if="currentCurrencyInfo.currencyCode != 'USD'">
|
|
|
+ {{currentCurrencyInfo.tokenSymbol}}
|
|
|
+ </template>
|
|
|
+ </div>
|
|
|
</div>
|
|
|
<img class="refresh"
|
|
|
:class="{ 'icon-refresh-rotate': refreshRotate }"
|
|
@@ -721,6 +729,7 @@ watch(
|
|
|
() => props.dialogData,
|
|
|
(newVal) => {
|
|
|
visible.value = newVal.visible;
|
|
|
+ USDepositStatus.value = "DEFAULT"
|
|
|
|
|
|
if (newVal.visible) {
|
|
|
publishType.value = newVal.type;
|
|
@@ -750,6 +759,7 @@ watch(
|
|
|
const emits = defineEmits(["close", "confirm", "postPublishFinish"]);
|
|
|
|
|
|
const close = () => {
|
|
|
+ USDepositStatus.value = "DEFAULT"
|
|
|
if(publishType.value == 'TOOL_BOX') {
|
|
|
closeToolBoxPage()
|
|
|
} else {
|
|
@@ -994,21 +1004,29 @@ const topUpDone = () => {
|
|
|
/**
|
|
|
* 更新货币余额
|
|
|
*/
|
|
|
-const updateCurrencyBanlce = () => {
|
|
|
+const updateCurrencyBanlce = async () => {
|
|
|
if(!refreshRotate.value) {
|
|
|
refreshRotate.value = true;
|
|
|
setTimeout(() => {
|
|
|
refreshRotate.value = false;
|
|
|
}, 1000)
|
|
|
}
|
|
|
- asyncTokenRechRecord((res) => {
|
|
|
- if(res.code == 0 && res.data && res.data.length) {
|
|
|
- let currencyInfo = res.data[0];
|
|
|
- if(currencyInfo.currencyCode == currentCurrencyInfo.value.currencyCode) {
|
|
|
- currentCurrencyInfo.value.balance = currencyInfo.balance;
|
|
|
- }
|
|
|
+ if(currentCurrencyInfo.value.currencyCode == 'USD') {
|
|
|
+ let currencyInfoRes = await getCurrencyByCode({currencyCode: currentCurrencyInfo.value.currencyCode});
|
|
|
+
|
|
|
+ if(currencyInfoRes.code == 0 && currencyInfoRes.data) {
|
|
|
+ currentCurrencyInfo.value = currencyInfoRes.data;
|
|
|
}
|
|
|
- })
|
|
|
+ } else {
|
|
|
+ asyncTokenRechRecord((res) => {
|
|
|
+ if(res.code == 0 && res.data && res.data.length) {
|
|
|
+ let currencyInfo = res.data[0];
|
|
|
+ if(currencyInfo.currencyCode == currentCurrencyInfo.value.currencyCode) {
|
|
|
+ currentCurrencyInfo.value.balance = currencyInfo.balance;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
/**
|
|
@@ -1851,6 +1869,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 +1897,7 @@ const depositAchCancel = async () => {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+
|
|
|
const depositAchConfirm = async () => {
|
|
|
let currencyInfoRes = await getCurrencyByCode({currencyCode: currentCurrencyInfo.value.currencyCode});
|
|
|
|
|
@@ -1874,16 +1908,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);
|
|
|
})
|