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

---
 pages/order/myOrder.vue |   33 +++++++++++++++++++++++++++++++++
 1 files changed, 33 insertions(+), 0 deletions(-)

diff --git a/pages/order/myOrder.vue b/pages/order/myOrder.vue
index 7e00d25..6821cde 100644
--- a/pages/order/myOrder.vue
+++ b/pages/order/myOrder.vue
@@ -241,6 +241,7 @@
 import { getClearReason } from "@/api/after-sale.js";
 import LiLiWXPay from "@/js_sdk/lili-pay/wx-pay.js";
 import {buyBack} from "@/api/trade.js";
+import { getSessionId, userAction } from "@/api/userAction.js";
 export default {
 
   data() {
@@ -327,6 +328,16 @@
       reason: "", //鍙栨秷鍘熷洜
       cancelList: "", //鍙栨秷鍒楄〃
       rogShow: false, //鏄剧ず鏄惁鏀惰揣
+	  pageSessionNo:"",
+	  actionParam:{
+	  		sessionId:'',
+	  		actionType:"PAGE",
+	  		joinType:"SELF",
+	  		pageCode:"ORDER_LIST",
+	  		pageParams:"{}",
+	  		pageStatus:"JOIN",
+	  		pageType:"DETAIL"
+	  	}
     };
   },
 
@@ -349,7 +360,28 @@
     }
     // this.loadData(this.status);
   },
+  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)
+	  	}
+	  })	
     if(this.$options.filters.tipsToLogin()){
       if (!this.tabCurrentIndex) {
         this.initData(0);
@@ -359,6 +391,7 @@
   },
 
   onLoad(options) {
+	  this.actionParam.pageParams = JSON.stringify(options)
     /**
      * 淇app绔偣鍑婚櫎鍏ㄩ儴璁㈠崟澶栫殑鎸夐挳杩涘叆鏃朵笉鍔犺浇鏁版嵁鐨勯棶棰�
      * 鏇挎崲onLoad涓嬩唬鐮佸嵆鍙�

--
Gitblit v1.8.0