Commit e2f48a88 authored by 俞嘉婷's avatar 俞嘉婷

feat: 埋点

parent a251c1ee
// components/AlreadyGetPanel/AlreadyGetPanel.ts
Component({
import { ComponentWithStore } from "mobx-miniprogram-bindings";
import { store } from "../../store/store";
ComponentWithStore({
/**
* 组件的属性列表
......@@ -15,6 +18,9 @@ Component({
* 组件的方法列表
*/
methods: {
onShow() {
store.doLog(507, 2)
},
onClose() {
this.triggerEvent('close');
},
......
// components/GetPanel/GetPanel.ts
Component({
import { ComponentWithStore } from "mobx-miniprogram-bindings";
import { store } from "../../store/store";
ComponentWithStore({
/**
* 组件的属性列表
......@@ -15,6 +18,10 @@ Component({
* 组件的方法列表
*/
methods: {
onShow() {
store.doLog(507, 1)
},
onClose() {
this.triggerEvent('close');
},
......
......@@ -23,9 +23,15 @@ ComponentWithStore({
store.updateActivity();
},
methods: {
onShow() {
store.doLog(507, 9)
},
// 跳转活动详情页
jumpDetailPage: _asyncThrottle(async function (e) {
const item = e.currentTarget.dataset.item
console.log('item', item);
store.doLog(508, 5 + item.index)
wx.navigateTo({ url: `/pages/activityDetail/activityDetail?imgUrl=${item.detailImg}` })
}),
......
......@@ -19,6 +19,7 @@
hover-stay-time="0"
bindtap="jumpDetailPage"
data-item="{{item}}"
data-index="{{index}}"
/>
</view>
</view>
......
......@@ -31,6 +31,7 @@ ComponentWithStore({
},
methods: {
async onShow() {
store.doLog(507, 10)
await this.updateHomeInfo();
const {channel, city} = this.options || {};
store.paramsObj = {channel, city};
......@@ -81,6 +82,7 @@ ComponentWithStore({
clickSubscribe: _asyncThrottle(async function () {
console.log('clickSubscribe', this)
store.doLog(508, 3)
await request({
url: API_PATH.subscribe,
});
......@@ -89,6 +91,7 @@ ComponentWithStore({
// 跳转活动页
jumpActPage: _asyncThrottle(async function () {
store.doLog(508, 4)
wx.switchTab({ url: "/pages/activity/activity" })
}),
......
......@@ -19,6 +19,7 @@ ComponentWithStore({
},
methods: {
onShow() {
store.doLog(507, 11)
this.setData({
userInfo: {
avatarUrl: store.homeInfo.avatar || defaultInfo.avatar,
......
......@@ -84,6 +84,17 @@ class Store {
if (!success) return '';
return data;
}
async doLog(pageBizId: number, eventId: number) {
await request({
url: API_PATH.buried,
data: {
pageBizId, // 埋点号
eventId, // 事件id
},
});
}
}
// 数据仓库
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment