소스 검색

[fix] bug

wenliming 2 년 전
부모
커밋
3e07e630f2

+ 1 - 1
src/view/components/input-action-sheet.vue

@@ -166,7 +166,7 @@ const confirm = () => {
             font-weight: 500;
             font-size: 13px;
             color: #888888;
-            height: 40px;
+            min-height: 40px;
         }
         .btn-wrapper {
             display: flex;

+ 25 - 9
src/view/iframe/publish/give-dialog.vue

@@ -320,7 +320,15 @@
                                         <img class="icon" src="@/assets/subject/icon-balance.png" />
                                         <div class="con">
                                             <div class="desc">Balance</div>
-                                            <div class="price">{{currentCurrencyInfo.balance}} {{currentCurrencyInfo.currencyCode == 'USD' ? '$' :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 }"
@@ -996,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;
+                }
+            }
+        })
+    }
 }
 
 /**

+ 1 - 0
src/view/iframe/publish/tool-box/child/guide.vue

@@ -43,6 +43,7 @@ const confirm = async () => {
     siteUrl.value = siteUrl.value.trim();
 
     if (!checkURL(siteUrl.value)) {
+        message.info('Incorrect URL entered');
         return;
     }
 

+ 23 - 1
src/view/popup/currency-detail.vue

@@ -186,6 +186,7 @@ const clickDeposit = () => {
       if(currencyInfo.currencyCode == 'USD') {
         // 法币充值
         showDepositInput.value = true;
+        setDepositDesc();
           
       } else {
         depositHandle(currencyInfo);
@@ -193,6 +194,20 @@ const clickDeposit = () => {
     }
 }
 
+const setDepositDesc = async () => {
+  let res = await payCalcFee({
+      params: {
+          amountValue: 0,
+          currencyCode: currencyInfo.value.currencyCode,
+          payChannel: 'ach',
+      },
+  });
+  if(res.code == 0) {
+    let {feeDesc} = res.data;
+    depositDesc.value = `${feeDesc}`;
+  }
+}
+
 const depositHandle = (_params) => {
   top_up_info.token = _params.currencyName || ''
   top_up_info.token_chain = _params.tokenChain 
@@ -288,6 +303,9 @@ const confirmDeposit = (params) => {
 const onDepositAmountInput = async (params = {}) => {
   let {inputVal} = params;
   reqCalcIng = true;
+  if(inputVal === '') {
+    inputVal = 0;
+  }
   let res = await payCalcFee({
       params: {
           amountValue: inputVal,
@@ -299,7 +317,11 @@ const onDepositAmountInput = async (params = {}) => {
   if(res.code == 0) {
     let {feeAmountValue, feeDesc} = res.data;
     finalAmountData.value = res.data;
-    depositDesc.value = `Charge Fee:${feeAmountValue} USD(${feeDesc})`;
+    if(inputVal === 0) {
+      depositDesc.value = `${feeDesc}`;
+    } else {
+      depositDesc.value = `Charge Fee:${feeAmountValue} USD(${feeDesc})`;
+    }
   }
 }