Commit 3765d75d by Lightsnow

小程序修复客流渠道扫码数据存储

parent 44a027f1
......@@ -82,6 +82,29 @@ export default {
}
}
}
// 小程序登录绑定手机号后回调页面记录客流渠道记录数据。
if (wx.getStorageSync('sessionid') && wx.getStorageSync('attractingCustomerChannelId') && this.pageUrl.indexOf('open_id') != -1) {
console.log('绑定手机号后登陆回调页')
let openId = this.pageUrl.split('open_id=')[1].split('&')[0]
let unionId = null
if (this.pageUrl.split('unionId=')[1]) {
unionId = this.pageUrl.split('unionId=')[1].split('&')[0]
}
indexApi.addRecord(
{
attractingCustomersChannelId: wx.getStorageSync('attractingCustomerChannelId'),
miniOpenId: openId,
unionId: unionId,
registerFlag: 1,
newRegisterFlag: 0,
}
).then(ele=>{
if (ele.data.data) {
//清空引客渠道id
wx.setStorageSync('attractingCustomerChannelId','');
}
})
}
}
},
onLoad(options) {
......@@ -217,7 +240,7 @@ export default {
success: res => {
login.get_open_id_by_code({ code: res.code}).then(res1 => {
if (res1.data.code == 200) {
wx.setStorage({
wx.setStorageSync({
key: "openid",
data: res1.data.data
});
......
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