From d50a3ed44e2edab2a7a661c43491c3aa42c57794 Mon Sep 17 00:00:00 2001
From: peng <peng.com>
Date: 星期四, 25 九月 2025 14:17:05 +0800
Subject: [PATCH] 用户行为分享基础埋点

---
 pages/cusbar/cart/cartList.vue |   39 ++++++++++++++++++++++++++++++++++++++-
 1 files changed, 38 insertions(+), 1 deletions(-)

diff --git a/pages/cusbar/cart/cartList.vue b/pages/cusbar/cart/cartList.vue
index da6bd4a..594c272 100644
--- a/pages/cusbar/cart/cartList.vue
+++ b/pages/cusbar/cart/cartList.vue
@@ -188,6 +188,7 @@
 import '@/components/uview-components/uview-ui';
 import * as API_Trade from "@/api/trade";
 import { debounce } from "@/utils/tools.js";
+import { getSessionId, userAction } from "@/api/userAction.js";
 // import uniNumberBox from '@/components/uni-number-box'
 export default {
   data() {
@@ -220,7 +221,18 @@
       checkout: false, //鍏ㄩ�夋寜閽�
       WEIXIN_num: "", //璐墿杞﹀吋瀹瑰井淇℃杩涘櫒
 	  marginBottom: 0 ,// 搴曢儴瀹夊叏鍖哄煙
-	  windowHeight: 0 // 鍙娇鐢ㄥ睆骞曢珮搴�
+	  windowHeight: 0 ,// 鍙娇鐢ㄥ睆骞曢珮搴�
+	  pageSessionNo:"",
+    sendOnShow:false,
+	  actionParam:{
+			sessionId:'',
+			actionType:"PAGE",
+			joinType:"SELF",
+			pageCode:"CART_LIST",
+			pageParams:"{}",
+			pageStatus:"JOIN",
+			pageType:"DETAIL"
+		}
     };
   },
 
@@ -235,10 +247,35 @@
   onPullDownRefresh(){
     this.getCardData();
   },
+  onUnload() {
+    let	param = this.actionParam;
+    if (this.sendOnShow)return
+    param.pageStatus = "LEAVE"
+    userAction(param)
+  },
+  onHide() {
+    this.startHidenTime = Date.now()
+    let	param = this.actionParam;
+    this.sendOnShow = true;
+    param.pageStatus = "LEAVE"
+    userAction(param)
+  },
+  onLoad(options) {
+  		this.actionParam.pageParams = JSON.stringify(options)
+
+  },
   /**
    * 鍒濆鍖栦俊鎭�
    */
   onShow() {
+	  getSessionId().then(res=>{
+		this.pageSessionNo = res.data.data
+		if(this.pageSessionNo){
+		let	param = this.actionParam;
+			param.sessionId = this.pageSessionNo
+			userAction(param)
+		}
+	  })	
     this.deleteShow ? (this.deleteShow = false) : true;
 	this.getCardData();
 		// if (this.$refs.swiperAction) {

--
Gitblit v1.8.0