Commit baad3538 by 李嘉林

获取openid

parent ad9ecfd0
......@@ -104,7 +104,7 @@ export default {
this.withoutScene = true;
}else{
//获取openId
wx.login({
wx.login({
success: res => {
this.code = res.code;
console.log(this.code,'-----------------------------110---code')
......@@ -213,21 +213,29 @@ export default {
wx.setStorageSync(this.$store.state.mixid+'storeId',paramsObj.storeId);
wx.setStorageSync(this.$store.state.mixid+'sellerId',paramsObj.sellerId);
console.log(res.data.data)
console.log(wx.getStorageSync("openid"))
console.log(333333)
if(wx.getStorageSync("openid")) {
indexApi.addRecord(
{
attractingCustomersChannelId: paramsObj.attractingCustomerChannelId,
miniOpenId: wx.getStorageSync("openid"),
registerFlag: 1,
newRegisterFlag: 0,
}
).then(ele=>{
//清空引客渠道id
wx.setStorageSync('attractingCustomerChannelId','');
})
}
wx.login({
success: res => {
login.get_open_id_by_code({ code: res.code}).then(res1 => {
if (res1.data.code == 200) {
wx.setStorage({
key: "openid",
data: res1.data.data
});
indexApi.addRecord(
{
attractingCustomersChannelId: paramsObj.attractingCustomerChannelId,
miniOpenId: res1.data.data,
registerFlag: 1,
newRegisterFlag: 0,
}
).then(ele=>{
//清空引客渠道id
wx.setStorageSync('attractingCustomerChannelId','');
})
}
})
},
})
let params = '';
for(let i in paramsObj){
params += "&"+i+'='+paramsObj[i]
......
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