Commit 3f2af358 by 柳士祥

Merge branch 'nativehome_tst' of http://code.mayi888.com/chengmo/mayi-mp-shop into nativehome_tst

parents 2aa3458d 3765d75d
...@@ -51,6 +51,7 @@ export default { ...@@ -51,6 +51,7 @@ export default {
}, },
}, },
onLoad(options) { onLoad(options) {
let tabIndex = this.index>=this.mpApp.globalData.footerVal.componentData.list.length?this.mpApp.globalData.footerVal.componentData.list.length-1:this.index;
this.params = this.$options.data.call(this).params this.params = this.$options.data.call(this).params
let ss = wx.getStorageSync("sessionid"); let ss = wx.getStorageSync("sessionid");
this.ss = ss ? `&sessionid=${ss}` : ""; this.ss = ss ? `&sessionid=${ss}` : "";
...@@ -64,21 +65,22 @@ export default { ...@@ -64,21 +65,22 @@ export default {
} }
// tabbar 跳转 // tabbar 跳转
let homeIndex = checkTabbarPage("/"); let homeIndex = checkTabbarPage("/");
homeIndex != 0 && homeIndex == this.index && (this.index = 0); homeIndex != 0 && homeIndex == tabIndex && (tabIndex = 0);
if (this.mpApp.globalData.footerVal.componentData.list[this.index].link) { console.log(this.mpApp.globalData.footerVal,tabIndex,this.mpApp.globalData.footerVal.componentData.list.length,'--this.mpApp.globalData.footerVal')
if (this.mpApp.globalData.footerVal.componentData.list[tabIndex].link) {
this.page = getUrlofLink( this.page = getUrlofLink(
this.mpApp.globalData.footerVal.componentData.list[this.index].link this.mpApp.globalData.footerVal.componentData.list[tabIndex].link
); );
let query=serialize(options) let query=serialize(options)
console.log(query,'==================', this.params,'-----------------') console.log(query,'==================', this.params,'-----------------')
this.params+=query?'&'+query:'' this.params+=query?'&'+query:''
} }
let reg = /^\/pages\//; let reg = /^\/pages\//;
console.log(this.pageUrl,'pageUrl======================',this.mpApp.globalData.footerVal.componentData.list[this.index].link) console.log(this.pageUrl,'pageUrl======================',this.mpApp.globalData.footerVal.componentData.list[tabIndex].link)
if (this.mpApp.globalData.footerVal.componentData.list[this.index].link) { if (this.mpApp.globalData.footerVal.componentData.list[tabIndex].link) {
if(reg.test(this.mpApp.globalData.footerVal.componentData.list[this.index].link.link)){ if(reg.test(this.mpApp.globalData.footerVal.componentData.list[tabIndex].link.link)){
wx.reLaunch({ wx.reLaunch({
url: this.mpApp.globalData.footerVal.componentData.list[this.index].link.link, url: this.mpApp.globalData.footerVal.componentData.list[tabIndex].link.link,
}); });
} }
} }
......
...@@ -299,7 +299,9 @@ export default { ...@@ -299,7 +299,9 @@ export default {
} }
).then(ele=>{ ).then(ele=>{
//清空引客渠道id //清空引客渠道id
wx.setStorageSync('attractingCustomerChannelId',''); if(ele.data.data) {
wx.setStorageSync('attractingCustomerChannelId','');
}
}) })
} }
} }
...@@ -444,7 +446,7 @@ export default { ...@@ -444,7 +446,7 @@ export default {
(data.visibleCopy == 3 && !wx.getStorageSync('sessionid')) (data.visibleCopy == 3 && !wx.getStorageSync('sessionid'))
) { ) {
data.visible = 1; data.visible = 1;
} else if ((data.visibleCopy == 2 && !wx.getStorageSync('sessionid')) || } else if ((data.visibleCopy == 2 && !wx.getStorageSync('sessionid')) ||
(data.visibleCopy == 3 && wx.getStorageSync('sessionid')) (data.visibleCopy == 3 && wx.getStorageSync('sessionid'))
) { ) {
data.visible = 0; data.visible = 0;
...@@ -470,7 +472,7 @@ export default { ...@@ -470,7 +472,7 @@ export default {
(element.visibleCopy == 3 && !wx.getStorageSync('sessionid')) (element.visibleCopy == 3 && !wx.getStorageSync('sessionid'))
) { ) {
element.visible = 1; element.visible = 1;
} else if ((element.visibleCopy == 2 && !wx.getStorageSync('sessionid')) || } else if ((element.visibleCopy == 2 && !wx.getStorageSync('sessionid')) ||
(element.visibleCopy == 3 && wx.getStorageSync('sessionid')) (element.visibleCopy == 3 && wx.getStorageSync('sessionid'))
) { ) {
element.visible = 0; element.visible = 0;
......
...@@ -82,10 +82,33 @@ export default { ...@@ -82,10 +82,33 @@ 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) { onLoad(options) {
if(wx.getStorageSync("sessionid")) { if(wx.getStorageSync("sessionid")) {
//清空门店id //清空门店id
wx.setStorageSync(this.$store.state.mixid+'storeId','') wx.setStorageSync(this.$store.state.mixid+'storeId','')
...@@ -104,7 +127,7 @@ export default { ...@@ -104,7 +127,7 @@ export default {
this.withoutScene = true; this.withoutScene = true;
}else{ }else{
//获取openId //获取openId
wx.login({ wx.login({
success: res => { success: res => {
this.code = res.code; this.code = res.code;
console.log(this.code,'-----------------------------110---code') console.log(this.code,'-----------------------------110---code')
...@@ -119,7 +142,7 @@ export default { ...@@ -119,7 +142,7 @@ export default {
this.withoutScene = true; this.withoutScene = true;
}) })
}, },
}) })
} }
// 移除重复参数 // 移除重复参数
if (options.params) { if (options.params) {
...@@ -213,21 +236,44 @@ export default { ...@@ -213,21 +236,44 @@ export default {
wx.setStorageSync(this.$store.state.mixid+'storeId',paramsObj.storeId); wx.setStorageSync(this.$store.state.mixid+'storeId',paramsObj.storeId);
wx.setStorageSync(this.$store.state.mixid+'sellerId',paramsObj.sellerId); wx.setStorageSync(this.$store.state.mixid+'sellerId',paramsObj.sellerId);
console.log(res.data.data) console.log(res.data.data)
console.log(wx.getStorageSync("openid")) wx.login({
console.log(333333) success: res => {
if(wx.getStorageSync("openid")) { login.get_open_id_by_code({ code: res.code}).then(res1 => {
indexApi.addRecord( if (res1.data.code == 200) {
{ wx.setStorageSync({
attractingCustomersChannelId: paramsObj.attractingCustomerChannelId, key: "openid",
miniOpenId: wx.getStorageSync("openid"), data: res1.data.data
registerFlag: 1, });
newRegisterFlag: 0, console.log('判断是否登录过=登陆过直接调用..未登录过需要授权头像昵称信息。')
} if (wx.getStorageSync('sessionid')) {
).then(ele=>{ console.log('已登陆了')
//清空引客渠道id indexApi.addRecord(
wx.setStorageSync('attractingCustomerChannelId',''); {
}) attractingCustomersChannelId: paramsObj.attractingCustomerChannelId,
} miniOpenId: res1.data.data,
registerFlag: 1,
newRegisterFlag: 0,
}
).then(ele=>{
if (ele.data.data) {
//清空引客渠道id
wx.setStorageSync('attractingCustomerChannelId','');
}
})
} else {
console.log('未登录过需要授权头像昵称信息。')
const url = `/pages/login/main?back=${encodeURIComponent(this.page)}&param=${
encodeURIComponent(JSON.stringify(paramsObj))
}`;
console.log(url)
wx.navigateTo({url});
}
}
})
},
})
let params = ''; let params = '';
for(let i in paramsObj){ for(let i in paramsObj){
params += "&"+i+'='+paramsObj[i] params += "&"+i+'='+paramsObj[i]
...@@ -236,9 +282,9 @@ export default { ...@@ -236,9 +282,9 @@ export default {
} }
}).catch((err)=>{ }).catch((err)=>{
this.withoutScene = true; this.withoutScene = true;
}) })
}); });
}else { }else {
//来自扫码 //来自扫码
// options 中的scene需要使用decodeURIComponent才能获取到生成二维码时传入的scene // options 中的scene需要使用decodeURIComponent才能获取到生成二维码时传入的scene
...@@ -255,12 +301,12 @@ export default { ...@@ -255,12 +301,12 @@ export default {
// }else{ // }else{
// this.params += `&spokesmanGroupId=${querys[2]}&spokesmanShopId=${querys[3]}&spokesmanRelId=${querys[4]}` // this.params += `&spokesmanGroupId=${querys[2]}&spokesmanShopId=${querys[3]}&spokesmanRelId=${querys[4]}`
// } // }
// }else if(querys.length == 3){ // }else if(querys.length == 3){
// this.params += `&userId=${querys[2]}` // this.params += `&userId=${querys[2]}`
// } // }
} else if (querys[0] == "activty") { } else if (querys[0] == "activty") {
//活动页面activty_turntable_123 //活动页面activty_turntable_123
this.params += `&pageInfo=${scene}`; this.params += `&pageInfo=${scene}`;
...@@ -274,11 +320,11 @@ export default { ...@@ -274,11 +320,11 @@ export default {
// }else{ // }else{
// this.params += `&spokesmanGroupId=${querys[1]}&spokesmanShopId=${querys[2]}&spokesmanRelId=${querys[3]}` // this.params += `&spokesmanGroupId=${querys[1]}&spokesmanShopId=${querys[2]}&spokesmanRelId=${querys[3]}`
// } // }
// }else if(querys.length == 2){ // }else if(querys.length == 2){
// this.params += `&userId=${querys[1]}` // this.params += `&userId=${querys[1]}`
// } // }
}else if(querys[0] == "home"){ }else if(querys[0] == "home"){
this.page = `/`; this.page = `/`;
this.params += this.paramsHander(querys,2) this.params += this.paramsHander(querys,2)
...@@ -288,7 +334,7 @@ export default { ...@@ -288,7 +334,7 @@ export default {
// }else{ // }else{
// this.params += `&spokesmanGroupId=${querys[1]}&spokesmanShopId=${querys[2]}&spokesmanRelId=${querys[3]}` // this.params += `&spokesmanGroupId=${querys[1]}&spokesmanShopId=${querys[2]}&spokesmanRelId=${querys[3]}`
// } // }
// }else if(querys.length == 2){ // }else if(querys.length == 2){
// this.params += `&userId=${querys[1]}` // this.params += `&userId=${querys[1]}`
// } // }
...@@ -305,7 +351,7 @@ export default { ...@@ -305,7 +351,7 @@ export default {
// }else{ // }else{
// this.params += `&orderSn=${querys[1]}&spokesmanGroupId=${querys[2]}&spokesmanShopId=${querys[3]}&spokesmanRelId=${querys[4]}` // this.params += `&orderSn=${querys[1]}&spokesmanGroupId=${querys[2]}&spokesmanShopId=${querys[3]}&spokesmanRelId=${querys[4]}`
// } // }
// }else if(querys.length == 3){ // }else if(querys.length == 3){
// this.params += `&orderSn=${querys[1]}&userId=${querys[2]}` // this.params += `&orderSn=${querys[1]}&userId=${querys[2]}`
// } // }
...@@ -328,8 +374,8 @@ export default { ...@@ -328,8 +374,8 @@ export default {
console.log(this.page) console.log(this.page)
console.log(this.params) console.log(this.params)
} }
// var query = options.query.dentistId; // 参数二维码传递过来的场景参数 // var query = options.query.dentistId; // 参数二维码传递过来的场景参数
} }
this.init(); this.init();
...@@ -415,7 +461,7 @@ export default { ...@@ -415,7 +461,7 @@ export default {
console.log(res, "h5消息", res.target.data[len]); console.log(res, "h5消息", res.target.data[len]);
this.shareShopName = res.target.data[len].shareShopName || ""; this.shareShopName = res.target.data[len].shareShopName || "";
this.shareLogoUrl = DFSImg(res.target.data[len].shareLogoUrl, 500, 400); this.shareLogoUrl = DFSImg(res.target.data[len].shareLogoUrl, 500, 400);
//分享内容中有订单信息为送礼活动 //分享内容中有订单信息为送礼活动
this.shareOrderSn = res.target.data[len].orderSn; this.shareOrderSn = res.target.data[len].orderSn;
this.shareTid = res.target.data[len].shareTid; this.shareTid = res.target.data[len].shareTid;
...@@ -433,7 +479,7 @@ export default { ...@@ -433,7 +479,7 @@ export default {
} }
} }
indexApi.forward({articleId: articleId,}).then(res=>{ indexApi.forward({articleId: articleId,}).then(res=>{
}) })
} }
}, },
...@@ -470,7 +516,7 @@ export default { ...@@ -470,7 +516,7 @@ export default {
}else{ }else{
params += `&spokesmanGroupId=${querys[midNum - 1]}&spokesmanShopId=${querys[midNum]}&spokesmanRelId=${querys[midNum+1]}` params += `&spokesmanGroupId=${querys[midNum - 1]}&spokesmanShopId=${querys[midNum]}&spokesmanRelId=${querys[midNum+1]}`
} }
}else if(querys.length == midNum){ }else if(querys.length == midNum){
params += `&userId=${querys[midNum - 1]}` params += `&userId=${querys[midNum - 1]}`
} }
...@@ -534,7 +580,7 @@ export default { ...@@ -534,7 +580,7 @@ export default {
}else{ }else{
this.shareUrl = url ; this.shareUrl = url ;
} }
console.log(this.shareUrl, "index12"); console.log(this.shareUrl, "index12");
console.log(`/pages/index/main?share=${encodeURIComponent(this.shareUrl)}`, '测试直播分享相关') console.log(`/pages/index/main?share=${encodeURIComponent(this.shareUrl)}`, '测试直播分享相关')
......
...@@ -205,12 +205,14 @@ export default { ...@@ -205,12 +205,14 @@ export default {
{ {
attractingCustomersChannelId: wx.getStorageSync('attractingCustomerChannelId'), attractingCustomersChannelId: wx.getStorageSync('attractingCustomerChannelId'),
miniOpenId: this.openid, miniOpenId: this.openid,
unionId: this.unionId,
registerFlag: 1, registerFlag: 1,
newRegisterFlag: flag?1:0,//1是新注册用户 newRegisterFlag: flag?1:0,//1是新注册用户
} }
).then(ele=>{ ).then(ele=>{
if (ele.data.data) {
wx.setStorageSync('attractingCustomerChannelId','') wx.setStorageSync('attractingCustomerChannelId','')
}
}) })
} }
}, },
...@@ -340,7 +342,6 @@ export default { ...@@ -340,7 +342,6 @@ export default {
//不是会员需要绑定手机号 //不是会员需要绑定手机号
this.isShowPhone = true; this.isShowPhone = true;
wx.hideLoading() wx.hideLoading()
this.addRecord(true)
} }
} }
}) })
...@@ -353,7 +354,6 @@ export default { ...@@ -353,7 +354,6 @@ export default {
//不是会员需要绑定手机号 //不是会员需要绑定手机号
this.isShowPhone = true; this.isShowPhone = true;
wx.hideLoading() wx.hideLoading()
this.addRecord(true)
} }
} }
...@@ -516,13 +516,14 @@ export default { ...@@ -516,13 +516,14 @@ export default {
const query = { const query = {
openId: this.openid, openId: this.openid,
unionId: this.unionId, unionId: this.unionId,
headImgUrl: this.userInfo.avatarUrl, headImgUrl: encodeURIComponent(this.userInfo.avatarUrl),
gender: this.userInfo.gender, gender: this.userInfo.gender,
nickname: this.userInfo.nickName, nickname: this.userInfo.nickName,
country: this.userInfo.country, country: this.userInfo.country,
province: this.userInfo.province, province: this.userInfo.province,
city: this.userInfo.city, city: this.userInfo.city,
...this.queryOptions, param: this.queryOptions.param,
back: this.queryOptions.back,
}; };
console.log(query,'-------------------519') console.log(query,'-------------------519')
console.log( serialize(query),'------------------- serialize(query)') console.log( serialize(query),'------------------- serialize(query)')
......
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
duration="{{duration}}" duration="{{duration}}"
circular="true" circular="true"
bindchange="bannerChange" bindchange="bannerChange"
style="height:{{bannerHeight}};border-radius:{{datas.componentData.borderRadius/3}}em" style="height:{{bannerHeight}};border-radius:{{datas.componentData.borderRadius*2}}px"
> >
<block wx:for="{{newArr}}" wx:key="index"> <block wx:for="{{newArr}}" wx:key="index">
<swiper-item data-item="{{item}}" bindtap="onClick"> <swiper-item data-item="{{item}}" bindtap="onClick">
......
...@@ -1248,7 +1248,9 @@ ...@@ -1248,7 +1248,9 @@
} }
.img-view{ .img-view{
margin:auto; display: flex;
align-items: center;
justify-content: center;
} }
.img-view image{ .img-view image{
/* object-fit: contain; */ /* object-fit: contain; */
......
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