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

---
 pages/order/afterSales/afterSalesSelect.vue |   38 +++++++++++++++++++++++++++++++++++++-
 1 files changed, 37 insertions(+), 1 deletions(-)

diff --git a/pages/order/afterSales/afterSalesSelect.vue b/pages/order/afterSales/afterSalesSelect.vue
index a10e5b8..ceb4a8b 100644
--- a/pages/order/afterSales/afterSalesSelect.vue
+++ b/pages/order/afterSales/afterSalesSelect.vue
@@ -58,15 +58,51 @@
 import '@/components/uview-components/uview-ui'
 import { getAfterSaleInfo } from "@/api/after-sale";
 import storage from "@/utils/storage";
+import { getSessionId, userAction } from "@/api/userAction.js";
 export default {
   data() {
     return {
       sn: "",
       sku: {}, //sku
-      applyInfo:""
+      applyInfo:"",
+	  pageSessionNo:"",
+    sendOnShow:false,
+	  actionParam:{
+			sessionId:'',
+			actionType:"PAGE",
+			joinType:"SELF",
+			pageCode:"APPLY_SALE",
+			pageParams:"{}",
+			pageStatus:"JOIN",
+			pageType:"LIST"
+		}
     };
   },
+  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)
+  },
+  onShow() {
+	  getSessionId().then(res=>{
+		this.pageSessionNo = res.data.data
+		if(this.pageSessionNo){
+		let	param = this.actionParam;
+			param.sessionId = this.pageSessionNo
+			userAction(param)
+		}
+	  })
+  },
   onLoad(options) {
+	this.actionParam.pageParams = JSON.stringify(options)
     this.sn = options.sn;
     this.sku = storage.getAfterSaleData();
     // 鏌ョ湅褰撳墠鍟嗗搧鏄惁鏀寔閫�娆鹃��璐�

--
Gitblit v1.8.0