nieyuge 2 lat temu
rodzic
commit
93ccd44e4d
2 zmienionych plików z 55 dodań i 8 usunięć
  1. 2 0
      log-center/logEnum.js
  2. 53 8
      pages/payment/index.vue

+ 2 - 0
log-center/logEnum.js

@@ -36,4 +36,6 @@ export const pageSource = {
 	nftRedeemPage: 'denet-web-NFT-redeem-page',
 	nftDepositCashPage: 'denet-web-NFT-deposit-cash-page',
 	nftDepositTokenPage: 'denet-web-NFT-deposit-token-page',
+	nftBalancePage: 'denet-web-NFT-balance-page',
+	nftPaymentBalancePage: 'denet-web-NFT-payment-balance-page',
 };

+ 53 - 8
pages/payment/index.vue

@@ -427,7 +427,7 @@ export default {
                 this.reportDepositTokenPageClick(Report.objectType.refreshBalanceButton)
             }
         },
-        checkWaitInfo() {
+        checkWaitInfo(isReport = true) {
             if (!this.refreshRotate) {
                 this.refreshRotate = true;
                 if (this.salePlans.currencyCode === 'USD') {
@@ -439,6 +439,9 @@ export default {
                     this.refreshRotate = false;
                 }, 1000)
             }
+            if (isReport) {
+                this.reportBalanceRefresh()
+            }
         },
         showRedeem() {
             this.redeemStr = '';
@@ -548,7 +551,7 @@ export default {
                 path: `/nft/${this.$route.query.nftProjectId}/${this.$route.query.account}/show`,
             })
         },
-        pay() {
+        pay(isReport = true) {
             if (this.payDisabled || Number(this.currencyInfoData.balance) < Number(this.salePlans.price)) return;
 
             this.payDisabled = true;
@@ -571,16 +574,21 @@ export default {
             }).finally(() => {
                 this.payDisabled = false;
             })
+
+            // report
+            if (isReport) {
+                this.reportBalanceBuy()
+            }
         },
         payUSD() {
             if (Number(this.usdAmountData.rechargeAmountValue) <= 0) {
-                this.pay()
+                this.pay(false)
                 this.reportDepositCashPageClick(Report.objectType.purchaseNftButton)
             }
         },
         payToken() {
             if (Number(this.currencyInfoData.balance) >= Number(this.salePlans.price)) {
-                this.pay()
+                this.pay(false)
                 this.reportDepositTokenPageClick(Report.objectType.purchaseNftButton)
             }
         },
@@ -639,6 +647,7 @@ export default {
             } else {
                 // 余额足够
                 this.step = 2;
+                this.reportView(Report.pageSource.nftBalancePage);
             }
             this.reportPaymentBtnClick(Report.objectType.denetPayButton)
         },
@@ -655,12 +664,14 @@ export default {
                     cancelButtonText: 'NO',
                     cancelButtonColor: '#1D9BF0',
                 }).then(() => {
-                    this.checkWaitInfo()
+                    this.checkWaitInfo(false)
                 }).catch(() => {
-                    this.checkWaitInfo()
+                    this.checkWaitInfo(false)
                 });
+                this.reportView(Report.pageSource.nftPaymentBalancePage);
             } else {
                 this.step = 2;
+                this.reportView(Report.pageSource.nftBalancePage);
             }
 
             this.reportPaymentBtnClick(Report.objectType.metamaskPayButton)
@@ -669,6 +680,7 @@ export default {
             if (Number(this.usdAmountData.rechargeAmountValue) > 0) {
                 if (modifyStep) {
                     this.step = 2;
+                    this.reportView(Report.pageSource.nftPaymentBalancePage);
                 }
                 this.waitRefresh = true;
                 this.currencyInfoTimer();
@@ -680,9 +692,9 @@ export default {
                     cancelButtonText: 'NO',
                     cancelButtonColor: '#1D9BF0',
                 }).then(() => {
-                    this.checkWaitInfo()
+                    this.checkWaitInfo(false)
                 }).catch(() => {
-                    this.checkWaitInfo()
+                    this.checkWaitInfo(false)
                 });
 
                 this.$nextTick(() => {
@@ -700,6 +712,7 @@ export default {
             } else {
                 if (modifyStep) {
                     this.step = 2;
+                    this.reportView(Report.pageSource.nftBalancePage);
                 }
             }
 
@@ -782,6 +795,38 @@ export default {
                 }
             })
         },
+        reportBalanceRefresh() {
+            let pageSource = this.waitRefresh ? Report.pageSource.nftPaymentBalancePage : Report.pageSource.nftBalancePage;
+
+            Report.log({
+                pageSource: pageSource,
+                params: {
+                    eventData: {
+                        objectType: Report.objectType.refreshBalanceButton,
+                        businessType: Report.businessType.buttonClick,
+                    },
+                    extParams: {
+                        userAgent: window.navigator.userAgent,
+                    }
+                }
+            })
+        },
+        reportBalanceBuy() {
+            let pageSource = this.waitRefresh ? Report.pageSource.nftPaymentBalancePage : Report.pageSource.nftBalancePage;
+
+            Report.log({
+                pageSource: pageSource,
+                params: {
+                    eventData: {
+                        objectType: Report.objectType.purchaseNftButton,
+                        businessType: Report.businessType.buttonClick,
+                    },
+                    extParams: {
+                        userAgent: window.navigator.userAgent,
+                    }
+                }
+            })
+        },
     }
 }
 </script>