Commit 5bc9e302 by 杨北旺

问券添加埋点

1 parent 340a360c
......@@ -70,6 +70,7 @@ Page({
this.shareTitle = data.cardTitle || data.title
this.shareQuery = `id=${data.id}`
this.shareImage = data.cardCover || ''
this.addTrackInfo()
} else throw '获取问卷失败'
} catch (error) {
console.log(error)
......@@ -172,5 +173,25 @@ Page({
*/
onShareAppMessage() {
},
// 添加埋点信息
addTrackInfo(){
const {userInfo} = this.data
let item = {
add_way: '104',
customer_phone: userInfo.phone
}
if (userInfo.nickName) {
item.customer_qw_nickname = userInfo.nickName
}
if (userInfo.headImgUrl) {
item.avatar = userInfo.headImgUrl
}
if (userInfo.unionId) {
item.union_id = userInfo.unionId
}
let json = JSON.stringify(item)
// 数据上报
wx.p.api.common.trackHttp({ json }).then(response => { })
}
})
\ No newline at end of file
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!