Browse Source

Merge branch 'dev_1.1.7' of https://git.yishihui.com/DeNet/de-net into dev_1.1.7

zhangwei 2 năm trước cách đây
mục cha
commit
62dcad52f8
2 tập tin đã thay đổi với 42 bổ sung19 xóa
  1. 38 18
      src/view/iframe/buy-nft/buy/home.vue
  2. 4 1
      src/view/iframe/buy-nft/buy/pay.vue

+ 38 - 18
src/view/iframe/buy-nft/buy/home.vue

@@ -66,8 +66,11 @@
                         </template>
                     </div>
 
-                    <div class="buy5" v-if="item.itemCount == 5 && (state.data.perUserBuyLimit - state.data.userBuyCount) >= 5 &&
-                    (state.data.itemTotalCount - state.data.itemSoldCount) >= 5" @click="clickJump(item)">
+                    <div
+                        class="buy5"
+                        :class="{ grey: payNext }"
+                        @click="clickJump(item)"
+                        v-if="item.itemCount == 5 && (state.data.perUserBuyLimit - state.data.userBuyCount) >= 5 && (state.data.itemTotalCount - state.data.itemSoldCount) >= 5">
                         <div class="left">Buy {{ item.itemCount }}</div>
 
                         <div class="right" v-if="(item.price.length + item.currencyInfo.tokenSymbol.length) > 30">
@@ -162,21 +165,21 @@ const clickClose = () => {
 const clickJump = (item) => {
     pay_info.home.sale_plan = item
     payNext.value = true;
-    if (item.currencyCode === 'USD') {
-        const p1 = calcRechargePayAmount({
-            params: {
-                currencyCode: item.currencyCode,
-                orderAmountValue: item.price,
-                payChannel: 'ach'
-            }
-        });
+    // post
+    const p1 = calcRechargePayAmount({
+        params: {
+            currencyCode: item.currencyCode,
+            orderAmountValue: item.price,
+            payChannel: 'ach'
+        }
+    });
+    const p2 = getCurrencyInfoByCode({
+        params: {
+            currencyCode: item.currencyCode,
+        }
+    });
 
-        const p2 = getCurrencyInfoByCode({
-            params: {
-                currencyCode: item.currencyCode,
-            }
-        })
-        
+    if (item.currencyCode === 'USD') {
         Promise.all([p1, p2]).then(([res1, res2]) => {
             if (res1.code == 0 && res2.code == 0) {
                 router.push({
@@ -193,8 +196,20 @@ const clickJump = (item) => {
             payNext.value = false;
         })
     } else {
-        router.push({ path: '/pay' });
-        payNext.value = false;
+        Promise.all([p2]).then(([res2]) => {
+            if (res2.code == 0) {
+                router.push({
+                    path: '/pay',
+                    query: {
+                        currentCurrencyInfo: JSON.stringify(res2.data),
+                    }
+                });
+            } else {
+                router.push({ path: '/pay' });
+            }
+        }).finally(() => {
+            payNext.value = false;
+        })
     }
     // report
     Report.reportLog({
@@ -536,6 +551,11 @@ onMounted(() => {
             .grey {
                 background: #CDCDCD;
                 cursor: not-allowed;
+                border: unset;
+                color: #FFFFFF;
+                .usdt {
+                    color: #FFFFFF!important;
+                }
             }
 
             .redeem {

+ 4 - 1
src/view/iframe/buy-nft/buy/pay.vue

@@ -371,7 +371,10 @@ const setDialogStyle = () => {
 
 onMounted(() => {
     currentCurrencyInfo.currencyCode = pay_info.home.sale_plan.currencyCode
-    getLocalCurrencyInfoByCode();
+    let timer = currentCurrencyInfo.currencyCode === 'USD' ? 10000 : 0;
+    setTimeout(() => {
+        getLocalCurrencyInfoByCode();
+    }, timer);
     setDialogStyle()
 
     // setParams