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 {
},
},
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
let ss = wx.getStorageSync("sessionid");
this.ss = ss ? `&sessionid=${ss}` : "";
......@@ -64,21 +65,22 @@ export default {
}
// tabbar 跳转
let homeIndex = checkTabbarPage("/");
homeIndex != 0 && homeIndex == this.index && (this.index = 0);
if (this.mpApp.globalData.footerVal.componentData.list[this.index].link) {
homeIndex != 0 && homeIndex == tabIndex && (tabIndex = 0);
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.mpApp.globalData.footerVal.componentData.list[this.index].link
this.mpApp.globalData.footerVal.componentData.list[tabIndex].link
);
let query=serialize(options)
console.log(query,'==================', this.params,'-----------------')
this.params+=query?'&'+query:''
}
let reg = /^\/pages\//;
console.log(this.pageUrl,'pageUrl======================',this.mpApp.globalData.footerVal.componentData.list[this.index].link)
if (this.mpApp.globalData.footerVal.componentData.list[this.index].link) {
if(reg.test(this.mpApp.globalData.footerVal.componentData.list[this.index].link.link)){
console.log(this.pageUrl,'pageUrl======================',this.mpApp.globalData.footerVal.componentData.list[tabIndex].link)
if (this.mpApp.globalData.footerVal.componentData.list[tabIndex].link) {
if(reg.test(this.mpApp.globalData.footerVal.componentData.list[tabIndex].link.link)){
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 {
}
).then(ele=>{
//清空引客渠道id
if(ele.data.data) {
wx.setStorageSync('attractingCustomerChannelId','');
}
})
}
}
......
......@@ -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) {
......@@ -213,21 +236,44 @@ 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")) {
wx.login({
success: res => {
login.get_open_id_by_code({ code: res.code}).then(res1 => {
if (res1.data.code == 200) {
wx.setStorageSync({
key: "openid",
data: res1.data.data
});
console.log('判断是否登录过=登陆过直接调用..未登录过需要授权头像昵称信息。')
if (wx.getStorageSync('sessionid')) {
console.log('已登陆了')
indexApi.addRecord(
{
attractingCustomersChannelId: paramsObj.attractingCustomerChannelId,
miniOpenId: wx.getStorageSync("openid"),
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 = '';
for(let i in paramsObj){
params += "&"+i+'='+paramsObj[i]
......
......@@ -205,12 +205,14 @@ export default {
{
attractingCustomersChannelId: wx.getStorageSync('attractingCustomerChannelId'),
miniOpenId: this.openid,
unionId: this.unionId,
registerFlag: 1,
newRegisterFlag: flag?1:0,//1是新注册用户
}
).then(ele=>{
if (ele.data.data) {
wx.setStorageSync('attractingCustomerChannelId','')
}
})
}
},
......@@ -340,7 +342,6 @@ export default {
//不是会员需要绑定手机号
this.isShowPhone = true;
wx.hideLoading()
this.addRecord(true)
}
}
})
......@@ -353,7 +354,6 @@ export default {
//不是会员需要绑定手机号
this.isShowPhone = true;
wx.hideLoading()
this.addRecord(true)
}
}
......@@ -516,13 +516,14 @@ export default {
const query = {
openId: this.openid,
unionId: this.unionId,
headImgUrl: this.userInfo.avatarUrl,
headImgUrl: encodeURIComponent(this.userInfo.avatarUrl),
gender: this.userInfo.gender,
nickname: this.userInfo.nickName,
country: this.userInfo.country,
province: this.userInfo.province,
city: this.userInfo.city,
...this.queryOptions,
param: this.queryOptions.param,
back: this.queryOptions.back,
};
console.log(query,'-------------------519')
console.log( serialize(query),'------------------- serialize(query)')
......
......@@ -9,7 +9,7 @@
duration="{{duration}}"
circular="true"
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">
<swiper-item data-item="{{item}}" bindtap="onClick">
......
......@@ -1248,7 +1248,9 @@
}
.img-view{
margin:auto;
display: flex;
align-items: center;
justify-content: center;
}
.img-view image{
/* 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