From d50a3ed44e2edab2a7a661c43491c3aa42c57794 Mon Sep 17 00:00:00 2001 From: peng <peng.com> Date: 星期四, 25 九月 2025 14:17:05 +0800 Subject: [PATCH] 用户行为分享基础埋点 --- pages/order/fillorder.vue | 37 ++++++++++++++++++++++++++++++++++++- 1 files changed, 36 insertions(+), 1 deletions(-) diff --git a/pages/order/fillorder.vue b/pages/order/fillorder.vue index 7661f62..f5c108f 100644 --- a/pages/order/fillorder.vue +++ b/pages/order/fillorder.vue @@ -387,6 +387,7 @@ <div class="tabbar-right">绔嬪嵆鏀粯</div> <!-- #endif --> </div> + </div> </div> </template> @@ -399,9 +400,11 @@ import LiLiWXPay from "@/js_sdk/lili-pay/wx-pay.js"; import invoices from "@/pages/order/invoice/setInvoice"; import { mapState } from "vuex"; +import { getSessionId, userAction } from "@/api/userAction.js"; export default { onLoad: function (val) { this.routerVal = val; + this.actionParam.pageParams = JSON.stringify(val) }, components: { invoices, @@ -453,6 +456,17 @@ storeAddress: "", originOrderData:"", // 鍘熷璁㈠崟鏁版嵁 + pageSessionNo:"", + sendOnShow:false, + actionParam:{ + sessionId:'', + actionType:"PAGE", + joinType:"SELF", + pageCode:"FILL_ORDER", + pageParams:"{}", + pageStatus:"JOIN", + pageType:"DETAIL" + } }; }, watch: { @@ -515,8 +529,28 @@ return true; //闃绘榛樿杩斿洖琛屼负 } }, - + 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) + }, async onShow() { + getSessionId().then(res=>{ + this.pageSessionNo = res.data.data + if(this.pageSessionNo){ + let param = this.actionParam; + param.sessionId = this.pageSessionNo + userAction(param) + } + }) // 鍒ゆ柇鏄惁瀛樺湪鍐欒繃澶囨敞淇℃伅鐨勫晢鍝� if (this.remark && this.remark.length > 0) { this.remarkFlag = true; @@ -540,6 +574,7 @@ mounted() {}, methods: { + //鍙戠エ鍥炶皟 閫夋嫨鍙戠エ涔嬪悗鍒锋柊璐墿杞� async callbackInvoice(val) { this.invoiceFlag = false; -- Gitblit v1.8.0