nieyuge 2 years ago
parent
commit
527bb4f249
2 changed files with 46 additions and 5 deletions
  1. 2 0
      log-center/logEnum.js
  2. 44 5
      pages/payment/index.vue

+ 2 - 0
log-center/logEnum.js

@@ -24,6 +24,7 @@ export const objectType = {
 	purchaseNftButton: 'purchase-nft-button',
 	refreshBalanceButton: 'refresh-balance-button',
 	copyButtion: 'copy-buttion',
+	finishPurchaseButton: 'finish-purchase-button',
 };
 
 export const pageSource = {
@@ -38,4 +39,5 @@ export const pageSource = {
 	nftDepositTokenPage: 'denet-web-NFT-deposit-token-page',
 	nftBalancePage: 'denet-web-NFT-balance-page',
 	nftPaymentBalancePage: 'denet-web-NFT-payment-balance-page',
+	nftPurchaseSuccessPage: 'denet-web-NFT-purchase-success-page',
 };

+ 44 - 5
pages/payment/index.vue

@@ -57,11 +57,17 @@
                             Balance:{{currencyInfoData.balance | floatPrice(2)}} {{currencyInfoData.tokenSymbol}}
                         </div>
                     </div>
-                    <div class="item" @click="achPay(true, Report.objectType.mastercardPayButton)">
+                    <div
+                        v-if="ifShowAch"
+                        class="item"
+                        @click="achPay(true, Report.objectType.mastercardPayButton)">
                         <img src="../../static/payment/icon_master_card.png" />
                         <span>MasterCard</span>
                     </div>
-                    <div class="item" @click="achPay(true, Report.objectType.visaPayButton)">
+                    <div
+                        v-if="ifShowAch"
+                        class="item"
+                        @click="achPay(true, Report.objectType.visaPayButton)">
                         <img src="../../static/payment/icon_visa.png" />
                         <span>VISA</span>
                     </div>
@@ -336,6 +342,7 @@ export default {
             usdAmountData: {},
             Report: Report,
             ifShowMetaMask: false,
+            ifShowAch: false,
         }
     },
     head() {
@@ -541,6 +548,7 @@ export default {
                     }
                     // 购买成功
                     this.step = 4;
+                    this.reportSuccessView();
                 } else {
                     this.payError(code)
                 }
@@ -591,9 +599,12 @@ export default {
             this.maskUrlLink = url;
         },
         goNext() {
-            this.$router.push({
-                path: `/nft/${this.$route.query.nftProjectId}/${this.$route.query.account}/show`,
-            })
+            this.reportSuccessClick()
+            setTimeout(() => {
+                this.$router.push({
+                    path: `/nft/${this.$route.query.nftProjectId}/${this.$route.query.account}/show`,
+                })
+            }, 300)
         },
         pay(isReport = true) {
             if (this.payDisabled || Number(this.usdAmountData.rechargeAmountValue) > 0) return;
@@ -612,6 +623,7 @@ export default {
                     }
                     // 购买成功
                     this.step = 4;
+                    this.reportSuccessView();
                 } else {
                     this.payError(code)
                 }
@@ -872,6 +884,33 @@ export default {
                 }
             })
         },
+        reportSuccessView() {
+            Report.log({
+                pageSource: Report.pageSource.nftPurchaseSuccessPage,
+                params: {
+                    eventData: {
+                        businessType: Report.businessType.pageView,
+                    },
+                    extParams: {
+                        userAgent: window.navigator.userAgent,
+                    }
+                }
+            })
+        },
+        reportSuccessClick() {
+            Report.log({
+                pageSource: Report.pageSource.nftPurchaseSuccessPage,
+                params: {
+                    eventData: {
+                        businessType: Report.businessType.buttonClick,
+                        objectType: Report.objectType.finishPurchaseButton,
+                    },
+                    extParams: {
+                        userAgent: window.navigator.userAgent,
+                    }
+                }
+            })
+        },
     }
 }
 </script>