nieyuge 2 vuotta sitten
vanhempi
commit
0e5389e66f
1 muutettua tiedostoa jossa 12 lisäystä ja 14 poistoa
  1. 12 14
      pages/payment/index.vue

+ 12 - 14
pages/payment/index.vue

@@ -38,7 +38,7 @@
                         </div>
                     </div>
                     <div class="item" @click="maskPay">
-                        <a class="maskLink" :href="maskUrlLink" v-if="Number(currencyInfoData.balance) < Number(salePlans.price)"></a>
+                        <a class="maskLink" :href="maskUrlLink" v-if="Number(usdAmountData.rechargeAmountValue) > 0"></a>
                         <img src="../../static/payment/icon_meta_mask.png" />
                         <span>MetaMask</span>
                     </div>
@@ -104,7 +104,7 @@
                 <div>
                     <div
                         class="btn"
-                        :class="{ disabled: (Number(currencyInfoData.balance) < Number(salePlans.price)) || payDisabled }"
+                        :class="{ disabled: (Number(usdAmountData.rechargeAmountValue) > 0) || payDisabled }"
                         @click="pay">
                         Pay Now
                     </div>
@@ -126,7 +126,7 @@
                             <div class="r">
                                 <FontZoom width="260" :unColor="true">
                                     <img :src="currencyInfoData.iconPath" />
-                                    <span>{{ (salePlans.price - currencyInfoData.balance) > 0 ? (salePlans.price - currencyInfoData.balance) : 0 }} {{currencyInfoData.tokenSymbol}}</span>
+                                    <span>{{ usdAmountData.rechargeAmountValue || 0 }} {{currencyInfoData.tokenSymbol}}</span>
                                 </FontZoom>
                             </div>
                         </div>
@@ -177,7 +177,7 @@
                     <div>
                         <div
                             class="btn"
-                            :class="{ disabled: (Number(currencyInfoData.balance) < Number(salePlans.price)) || payDisabled }"
+                            :class="{ disabled: (Number(usdAmountData.rechargeAmountValue) > 0) || payDisabled }"
                             @click="payToken">
                             Pay Now
                         </div>
@@ -531,7 +531,7 @@ export default {
         maskUrlToLink() {
             // MetaMask Link
             let url;
-            let price = Number(this.salePlans.price) > Number(this.currencyInfoData.balance) ? Number(this.salePlans.price) - Number(this.currencyInfoData.balance) : Number(this.salePlans.price)
+            let price = this.usdAmountData.rechargeAmountValue;
             if (this.salePlans.currencyInfo?.contractAddress) {
                 // 代币
                 url = maskUrl({
@@ -558,7 +558,7 @@ export default {
             })
         },
         pay(isReport = true) {
-            if (this.payDisabled || Number(this.currencyInfoData.balance) < Number(this.salePlans.price)) return;
+            if (this.payDisabled || Number(this.usdAmountData.rechargeAmountValue) > 0) return;
 
             this.payDisabled = true;
             postRequest(Api.payNftMysteryBoxWithBalance, {
@@ -635,16 +635,14 @@ export default {
         deNetPay() {
             if (!this.salePlans) return;
 
-            let where, pageSource;
+            let pageSource;
             if (this.salePlans.currencyCode === 'USD') {
-                where = Number(this.usdAmountData.rechargeAmountValue) > 0
                 pageSource = Report.pageSource.nftDepositCashPage
             } else {
-                where = Number(this.salePlans.price) > Number(this.currencyInfoData.balance)
                 pageSource = Report.pageSource.nftDepositTokenPage
             }
 
-            if (where) {
+            if (Number(this.usdAmountData.rechargeAmountValue) > 0) {
                 // 余额不够
                 this.step = 3;
                 this.currencyInfoTimer();
@@ -658,7 +656,7 @@ export default {
             this.reportPaymentBtnClick(Report.objectType.denetPayButton)
         },
         maskPay() {
-            if (Number(this.salePlans.price) > Number(this.currencyInfoData.balance)) {
+            if (Number(this.usdAmountData.rechargeAmountValue) > 0) {
                 this.step = 2;
                 this.waitRefresh = true;
                 this.currencyInfoTimer();
@@ -869,6 +867,9 @@ body,
         align-items: center;
         justify-content: center;
         margin-top: 10px;
+        color: #000;
+        font-size: 20px;
+        font-weight: 700;
         .icon {
             overflow: hidden;
             width: 26px;
@@ -879,9 +880,6 @@ body,
             background-color: #f5f5f5;
         }
         .info {
-            color: #000;
-            font-size: 20px;
-            font-weight: 700;
             &.usd {
                 margin-top: -5px;
             }