From 89efee9a2e20fc04b4537d859917b47cf68a814c Mon Sep 17 00:00:00 2001
From: peng <peng.com>
Date: 星期五, 26 九月 2025 18:28:40 +0800
Subject: [PATCH] 用户行为分享基础埋点
---
pages/tabbar/user/my.vue | 38 ++++++++++++++++++++++++++++++++++++--
1 files changed, 36 insertions(+), 2 deletions(-)
diff --git a/pages/tabbar/user/my.vue b/pages/tabbar/user/my.vue
index d86d2e2..d67d898 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,12 +161,44 @@
couponNum: "",
footNum: "",
walletNum: "",
+ pageSessionNo:"",
+ actionParam:{
+ sessionId:'',
+ actionType:"PAGE",
+ joinType:"SELF",
+ pageCode:"TBA_BAR_MY",
+ pageParams:"{}",
+ pageStatus:"JOIN",
+ pageType:"DETAIL"
+ }
};
},
- onLoad() {
+ 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)
this.initCOS()
},
onShow() {
+ getSessionId().then(res=>{
+ this.pageSessionNo = res.data.data
+ if(this.pageSessionNo){
+ let param = this.actionParam;
+ param.sessionId = this.pageSessionNo
+ userAction(param)
+ }
+ })
this.userInfo = this.$options.filters.isLogin() || {};
if (this.$options.filters.isLogin("auth")) {
this.getUserOrderNum();
@@ -242,6 +275,7 @@
</script>
<style lang="scss" scoped>
+ @import url("/pages/subComponents/static/bgStyle.css");
html,
body {
overflow: auto;
@@ -333,7 +367,7 @@
background-size: cover;
border-bottom-left-radius: 30rpx;
border-bottom-right-radius: 30rpx;
- background-image: url("/pages/subComponents/static/img/main-bg.png");
+ background-image: var(--main-bg);
background-position: bottom;
background-repeat: no-repeat;
color: #ffffff;
--
Gitblit v1.8.0