From 58c78011ca0567a597d8c1e51696e317a3086604 Mon Sep 17 00:00:00 2001 From: peng <peng.com> Date: 星期一, 29 九月 2025 10:52:20 +0800 Subject: [PATCH] Merge branch 'dev_fix_sub' into user_action --- pages/tabbar/user/my.vue | 45 +++++++++++++++++++++++++++++++++++++++++---- 1 files changed, 41 insertions(+), 4 deletions(-) diff --git a/pages/tabbar/user/my.vue b/pages/tabbar/user/my.vue index 81b5994..f4f3e1e 100644 --- a/pages/tabbar/user/my.vue +++ b/pages/tabbar/user/my.vue @@ -144,6 +144,7 @@ import { getUserWallet } from "@/api/members"; import configs from '@/config/config' import storage from '@/utils/storage.js' +import { getSessionId, userAction } from "@/api/userAction.js"; export default { components: { tool @@ -160,6 +161,16 @@ couponNum: "", footNum: "", walletNum: "", + pageSessionNo:"", + actionParam:{ + sessionId:'', + actionType:"PAGE", + joinType:"SELF", + pageCode:"TBA_BAR_MY", + pageParams:"{}", + pageStatus:"JOIN", + pageType:"DETAIL" + } }; }, onLoad(option) { @@ -196,9 +207,35 @@ } } this.initCOS() + }, + 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) + }, + onLoad(options) { + this.actionParam.pageParams = JSON.stringify(options) + this.initCOS() }, onShow() { - + getSessionId().then(res=>{ + this.pageSessionNo = res.data.data + this.actionParam.sessionId = res.data.data + if(this.pageSessionNo){ + let param = Object.assign({}, this.actionParam); + param.sessionId = this.pageSessionNo + userAction(param) + } + }) + this.userInfo = this.$options.filters.isLogin() || {}; if (this.$options.filters.isLogin("auth")) { this.getUserOrderNum(); @@ -207,7 +244,7 @@ this.couponNum = 0; this.footNum = 0; } - + let shareStoreId = uni.getStorageSync('shareStoreId'); let shareTime = uni.getStorageSync('shareTime'); console.log('浠庣紦瀛樿鍙栧弬鏁�:', { shareStoreId, shareTime }); @@ -239,7 +276,7 @@ // 澶勭悊鍙兘瀛樺湪鐨刪ash锛堝鏋滄湁鐨勮瘽锛� const cleanUrl = url.split('#')[0]; const queryStr = cleanUrl.split('?')[1] || ''; - + queryStr.split('&').forEach(pair => { const [key, value] = pair.split('='); if (key) { @@ -247,7 +284,7 @@ params[key] = value ? decodeURIComponent(value) : ''; } }); - + return params; }, async bindMemberAndStore(shareStoreId, shareTime){ -- Gitblit v1.8.0