From d50a3ed44e2edab2a7a661c43491c3aa42c57794 Mon Sep 17 00:00:00 2001 From: peng <peng.com> Date: 星期四, 25 九月 2025 14:17:05 +0800 Subject: [PATCH] 用户行为分享基础埋点 --- pages/cart/coupon/myCoupon.vue | 55 ++++++++++++++++++++++++++++++++++++++++++++++++++----- 1 files changed, 50 insertions(+), 5 deletions(-) diff --git a/pages/cart/coupon/myCoupon.vue b/pages/cart/coupon/myCoupon.vue index b7d1392..b99614f 100644 --- a/pages/cart/coupon/myCoupon.vue +++ b/pages/cart/coupon/myCoupon.vue @@ -97,12 +97,12 @@ <image class="no-icon" v-if="navIndex == 1" - src="@/static/img/used.png" + src="@/pages/subComponents/static/img/used.png" ></image> <image class="no-icon" v-if="navIndex == 2" - src="@/static/img/overdue.png" + src="@/pages/subComponents/static/img/overdue.png" ></image> <view class="receive" @@ -126,6 +126,7 @@ import '@/components/uview-components/uview-ui'; import { getMemberCoupons } from "@/api/members.js"; +import { getSessionId, userAction } from "@/api/userAction.js"; export default { data() { @@ -171,10 +172,44 @@ }, ], couponList: [], //浼樻儬鍒稿垪琛� + pageSessionNo:"", + actionParam:{ + sessionId:'', + actionType:"PAGE", + joinType:"SELF", + pageCode:"MY_COUPON", + 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) + }, + 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.navList[this.tabCurrentIndex].params.pageNumber = 1; this.navList[this.tabCurrentIndex].dataList = []; this.getData(); @@ -204,6 +239,7 @@ title: "鍔犺浇涓�", }); let index = this.tabCurrentIndex; + console.log(this.navList[index].params) getMemberCoupons(this.navList[index].params).then((res) => { uni.stopPullDownRefresh(); if (res.data.success) { @@ -247,9 +283,18 @@ * 绔嬪嵆浣跨敤浼樻儬鍒� */ useItNow(item) { - uni.navigateTo({ - url: `/pages/navigation/search/searchPage?promotionsId=${item.couponId}&promotionType=COUPON`, - }); + + console.log('浼樻儬鍗疯鎯�--------------------->',JSON.stringify(item)) + // uni.navigateTo({ + // url: `/pages/navigation/search/searchPage?promotionsId=${item.couponId}&promotionType=COUPON`, + // }); + if(item.scopeType ==='PORTION_GOODS'){ + //鑾峰彇浼樻儬鍗峰搴旂殑鍟嗗搧 + //鎸囧畾璺宠浆鍒板晢鍝佽鎯呴〉闈㈣繘琛岃喘涔� + } + uni.navigateTo({ + url: `/pages/commodity-square/coups-goods-list?promotionsId=${item.couponId}&promotionType=COUPON` + }); }, /** -- Gitblit v1.8.0