From 2a0d988b1439a9e2d3604350fa14034191f50140 Mon Sep 17 00:00:00 2001
From: peng <peng.com>
Date: 星期二, 30 九月 2025 22:31:55 +0800
Subject: [PATCH] 埋点调整

---
 pages/tabbar/user/my.vue |   46 ++++++++++++++++++++++++++++++++++++++++++----
 1 files changed, 42 insertions(+), 4 deletions(-)

diff --git a/pages/tabbar/user/my.vue b/pages/tabbar/user/my.vue
index 81b5994..7e56634 100644
--- a/pages/tabbar/user/my.vue
+++ b/pages/tabbar/user/my.vue
@@ -144,6 +144,7 @@
 import { getUserWallet } from "@/api/members";
 import configs from '@/config/config'
 import storage from '@/utils/storage.js'
+import { getSessionId, userAction } from "@/api/userAction.js";
 export default {
   components: {
     tool
@@ -160,9 +161,20 @@
       couponNum: "",
       footNum: "",
       walletNum: "",
+	  pageSessionNo:"",
+	  actionParam:{
+			sessionId:'',
+			actionType:"PAGE",
+			joinType:"SELF",
+			pageCode:"TBA_BAR_MY",
+			pageParams:"{}",
+			pageStatus:"JOIN",
+			pageType:"DETAIL"
+		}
     };
   },
   onLoad(option) {
+    this.actionParam.pageParams = JSON.stringify(option)
     console.log('-----------鍒嗕韩鍑虹殑鏁版嵁---------->', option)
     let shareStoreId = null;
     let shareTime = null;
@@ -196,9 +208,35 @@
       }
     }
     this.initCOS()
+	},
+  onUnload() {
+    let	param = Object.assign({}, this.actionParam);
+    if (this.sendOnShow)return
+    param.pageStatus = "LEAVE"
+    userAction(param)
   },
+  onHide() {
+    this.startHidenTime = Date.now()
+    let	param =Object.assign({}, this.actionParam);
+    this.sendOnShow = true;
+    param.pageStatus = "LEAVE"
+    userAction(param)
+  },
+  // onLoad(options) {
+	//
+	//   this.initCOS()
+  // },
   onShow() {
-	 
+	  getSessionId().then(res=>{
+		this.pageSessionNo = res.data.data
+		this.actionParam.sessionId = res.data.data
+		if(this.pageSessionNo){
+		let	param = Object.assign({}, this.actionParam);
+			param.sessionId = this.pageSessionNo
+			userAction(param)
+		}
+	  })
+
     this.userInfo = this.$options.filters.isLogin() || {};
     if (this.$options.filters.isLogin("auth")) {
       this.getUserOrderNum();
@@ -207,7 +245,7 @@
       this.couponNum = 0;
       this.footNum = 0;
     }
-	
+
 	let shareStoreId = uni.getStorageSync('shareStoreId');
 	let shareTime = uni.getStorageSync('shareTime');
 	console.log('浠庣紦瀛樿鍙栧弬鏁�:', { shareStoreId, shareTime });
@@ -239,7 +277,7 @@
 	  	// 澶勭悊鍙兘瀛樺湪鐨刪ash锛堝鏋滄湁鐨勮瘽锛�
 	  	const cleanUrl = url.split('#')[0];
 	  	const queryStr = cleanUrl.split('?')[1] || '';
-	  
+
 	  	queryStr.split('&').forEach(pair => {
 	  		const [key, value] = pair.split('=');
 	  		if (key) {
@@ -247,7 +285,7 @@
 	  			params[key] = value ? decodeURIComponent(value) : '';
 	  		}
 	  	});
-	  
+
 	  	return params;
 	  },
     async bindMemberAndStore(shareStoreId, shareTime){

--
Gitblit v1.8.0