From f1d0c08bbef3ffef0b9bbd0c181d2047c9866a7f Mon Sep 17 00:00:00 2001
From: peng <peng.com>
Date: 星期六, 11 十月 2025 14:42:40 +0800
Subject: [PATCH] 定制模板
---
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..37ad1ad 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 = 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)
+ },
+ onShow() {
+ getSessionId().then(res=>{
+ this.pageSessionNo = res.data.data
+ this.actionParam.sessionId = this.pageSessionNo
+ if(this.pageSessionNo){
+ let param = Object.assign({}, this.actionParam);
+ userAction(param)
+ }
+ })
+ },
onLoad(option) {
+ this.actionParam.pageParams = JSON.stringify(option)
this.storeId = option.storeId;
this.getCoupon();
},
--
Gitblit v1.8.0