Commit 56306100 by chenwq

数据上报

1 parent 8222152a
......@@ -35,4 +35,11 @@ module.exports = {
getImgVersion() {
return http.getMock();
},
// 埋点/数据上报
trackHttp(data) {
return http.post({
method: "entmicro.api.customercollect.reportCustomer",
...data,
});
},
};
......@@ -58,12 +58,25 @@ Page({
wx.$LoginStatus = false
wx.p.storage.set('userInfo', data)
wx.p.storage.set('sessionId', data.sessionId)
let { nickName, headImgUrl } = data
let { nickName, headImgUrl, phone } = data
this.setData({
userInfo: data,
authStatus: false
})
console.log(data, 'data--')
let item = {
add_way: '104',
customer_phone: phone
}
if (nickName) {
item.customer_name = nickName
}
if (headImgUrl) {
item.avatar = headImgUrl
}
let json = JSON.stringify(item)
// 数据上报
wx.p.api.common.trackHttp({ json }).then(response => { })
if (nickName || headImgUrl) {
this.setData({
hasUserInfo: true
......
......@@ -43,7 +43,7 @@
position: relative;
box-sizing: border-box;
width: 100vw;
padding: 20rpx 32rpx;
padding: 20rpx 32rpx 40rpx;
color: #fff;
.tips {
......
......@@ -15,8 +15,6 @@
<button wx:elif="{{!hasUserInfo}}" catchtap="jumpAuthUserInfo" class="text-center btn-defalut">头像昵称</button>
<view wx:else>
<view class="btn-defalut" bindtap="toCheckMember">免费领取</view>
<!-- <view class="btn-defalut" bindtap="tofreeReceive">免费领取</view> -->
<!-- <view class="btn-defalut" bindtap="receiveRed">免费领取</view> -->
</view>
</view>
</view>
......
......@@ -24,6 +24,16 @@ Page({
headImgUrl: info.avatarUrl,
hasUserInfo: true
})
let item = {
add_way: '104',
customer_phone: res.data.userInfo.phone,
customer_name: info.nickName,
avatar: info.avatarUrl,
merchant_id: res.data.merchantId
}
let json = JSON.stringify(item)
// 数据上报
wx.p.api.common.trackHttp({ json }).then(response => {})
})
},
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!