Преглед на файлове

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

zhangwei преди 2 години
родител
ревизия
9ff815d7a8
променени са 4 файла, в които са добавени 56 реда и са изтрити 9 реда
  1. 2 2
      src/view/components/popup-transactions.vue
  2. 43 3
      src/view/iframe/buy-nft/buy/home.vue
  3. 10 0
      src/view/iframe/buy-nft/buy/pay.vue
  4. 1 4
      src/view/popup/withdraw/info.vue

+ 2 - 2
src/view/components/popup-transactions.vue

@@ -19,8 +19,8 @@
                     <div class="img-wrapper">
                         <!-- 收入- 任务红包领取 -->
                         <template v-if="item.bizType == 1 || item.bizType == 5 || item.bizType == 10 || item.bizType == 11 || item.bizType == 12">
-                            <img class="icon-avatar" style="margin-right: 0" :src="item.bizType != 12 ? item.bizData.avatarUrl : require('@/assets/svg/icon-treasure-return.svg')" />
-                            <img class="icon-give" style="right: -4px" :src="item.bizType == 10 || item.bizType == 11 ? require('@/assets/svg/icon-small-treasure.svg') : require('@/assets/svg/icon-get-giveaways-s.svg')" />
+                            <img class="icon-avatar" style="margin-right: 0" :src="item.bizType != 12 && item.bizData ? item.bizData.avatarUrl : require('@/assets/svg/icon-treasure-return.svg')" />
+                            <img class="icon-give" style="right: -4px" :src="item.bizType == 10 || item.bizType == 11 || item.bizType == 12 ? require('@/assets/svg/icon-small-treasure.svg') : require('@/assets/svg/icon-get-giveaways-s.svg')" />
                         </template>
 
                         <!-- 收入- 任务红包结余退款, -->

+ 43 - 3
src/view/iframe/buy-nft/buy/home.vue

@@ -28,8 +28,11 @@
                 </template>
 
                 <template v-for="item in state.data.salePlans.slice(0, 2).reverse()">
-                    <div class="buy1" @click="clickJump(item)" v-if="item.itemCount == 1 && (state.data.perUserBuyLimit - state.data.userBuyCount) >= 1
-                    && (state.data.itemTotalCount - state.data.itemSoldCount) >= 1">
+                    <div
+                        class="buy1"
+                        :class="{ grey: payNext }"
+                        @click="clickJump(item)"
+                        v-if="item.itemCount == 1 && (state.data.perUserBuyLimit - state.data.userBuyCount) >= 1 && (state.data.itemTotalCount - state.data.itemSoldCount) >= 1">
                         <template v-if="(item.price.length + item.currencyInfo.tokenSymbol.length) > 30">
                             <div class="left">Buy 1</div>
                             <div class="right">
@@ -112,6 +115,8 @@ import { getNftMysteryBoxSaleInfo, redeemNft } from "@/http/nft";
 import BtnLoading from '../components/btn-loading.vue'
 import Report from "@/log-center/log"
 import { getQueryString } from "@/uilts/help";
+import { calcRechargePayAmount } from "@/http/account";
+import { getCurrencyInfoByCode } from "@/http/publishApi";
 import { sendChromeTabMessage } from '@/uilts/chromeExtension.js';
 let postId = inject('post_Id');
 let pay_info = inject('pay_info');
@@ -119,6 +124,7 @@ let router = useRouter()
 let showDesc = ref(true)
 let showRedeem = ref(false)
 let redeemNext = ref(false)
+let payNext = ref(false)
 let redeemStr = ref('')
 let refInput = ref('')
 let groupId = ref('')
@@ -155,7 +161,41 @@ const clickClose = () => {
 }
 const clickJump = (item) => {
     pay_info.home.sale_plan = item
-    router.push({ path: '/pay' });
+    payNext.value = true;
+    if (item.currencyCode === 'USD') {
+        const p1 = calcRechargePayAmount({
+            params: {
+                currencyCode: item.currencyCode,
+                orderAmountValue: item.price,
+                payChannel: 'ach'
+            }
+        });
+
+        const p2 = getCurrencyInfoByCode({
+            params: {
+                currencyCode: item.currencyCode,
+            }
+        })
+        
+        Promise.all([p1, p2]).then(([res1, res2]) => {
+            if (res1.code == 0 && res2.code == 0) {
+                router.push({
+                    path: '/pay',
+                    query: {
+                        finalAmount: JSON.stringify(res1.data),
+                        currentCurrencyInfo: JSON.stringify(res2.data),
+                    }
+                });
+            } else {
+                router.push({ path: '/pay' });
+            }
+        }).finally(() => {
+            payNext.value = false;
+        })
+    } else {
+        router.push({ path: '/pay' });
+        payNext.value = false;
+    }
     // report
     Report.reportLog({
         pageSource: Report.pageSource.nftShopPage,

+ 10 - 0
src/view/iframe/buy-nft/buy/pay.vue

@@ -373,6 +373,16 @@ onMounted(() => {
     currentCurrencyInfo.currencyCode = pay_info.home.sale_plan.currencyCode
     getLocalCurrencyInfoByCode();
     setDialogStyle()
+
+    // setParams
+    if (router.currentRoute.value?.query?.finalAmount) {
+        finalAmountData.value = JSON.parse(router.currentRoute.value.query.finalAmount);
+    }
+
+    if (router.currentRoute.value?.query?.currentCurrencyInfo) {
+        tempCurrentCurrencyInfo.value = JSON.parse(router.currentRoute.value.query.currentCurrencyInfo);
+    }
+
     // report
     Report.reportLog({
         pageSource: Report.pageSource.nftPreviewPage,

+ 1 - 4
src/view/popup/withdraw/info.vue

@@ -93,12 +93,9 @@ let state = reactive({
 })
 
 const inputWithdrawCalcFee = () => {
-  if(!state.input_amount) {
-    state.input_amount = 0;
-  }
   withdrawCalcFee({
     params: {
-      "amountValue": state.input_amount,
+      "amountValue": state.input_amount || 0,
       "currencyCode": withdraw_info.currency_code,
       "withdrawNetwork": withdraw_info.token_chain
     }