From be6df55226b155a1567ce3bac9c6d25df6c68b98 Mon Sep 17 00:00:00 2001
From: zxl <763096477@qq.com>
Date: 星期一, 29 九月 2025 17:21:56 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/user_action' into send_coupon

---
 pages/cart/coupon/couponCenter.vue |   38 +++++++++++++++++++++++++++++++++++++-
 1 files changed, 37 insertions(+), 1 deletions(-)

diff --git a/pages/cart/coupon/couponCenter.vue b/pages/cart/coupon/couponCenter.vue
index 958c482..78a8618 100644
--- a/pages/cart/coupon/couponCenter.vue
+++ b/pages/cart/coupon/couponCenter.vue
@@ -54,6 +54,7 @@
 	import {
 		getAllCoupons
 	} from "@/api/promotions.js";
+	import { getSessionId, userAction } from "@/api/userAction.js";
 	export default {
 		data() {
 			return {
@@ -65,10 +66,45 @@
 					pageSize: 10,
 				},
 				storeId: "", //搴楅摵 id,
-				couponData: ""
+				couponData: "",
+        sendOnShow:false,
+				  pageSessionNo:"",
+				  actionParam:{
+						sessionId:'',
+						actionType:"PAGE",
+						joinType:"SELF",
+						pageCode:"COUPON_CENTER",
+						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(option) {
+			this.actionParam.pageParams = JSON.stringify(option)
 			this.storeId = option.storeId;
 			this.getCoupon();
 		},

--
Gitblit v1.8.0