Commit f953e760 by 张卓

绑定分销关系

parent d538278f
......@@ -7,7 +7,6 @@
<div v-if="showSpokesManHome">
<get-index-homepage class="getIndexHomePage"></get-index-homepage>
</div>
{{options}}
<ThemeDataPlant></ThemeDataPlant>
<div v-for="(item,index) in pageData" :key="index">
<div v-if="item.componentCode=='banner' && item.componentInfo.visible == 1">
......@@ -211,6 +210,13 @@ export default {
}
},
onLoad(options) {
//进页面存储需要绑定的信息
if(options.userId||options.spokesmanRelId) {
wx.setStorage({
key: "becomeInfo",
data: JSON.stringify(options)
});
}
Object.assign(this.$data, this.$options.data());
if (options.from && options.from == "logout") {
//来自用户登出
......@@ -236,7 +242,7 @@ export default {
that.showMyCard = res;
})
//获取分销信息
this.getSpokesmanInit(options)
this.getSpokesmanInit(wx.getStorage("becomeInfo"))
}else {
let footerVal = {...app.globalData.footerVal};
console.log('"分销员中心"',footerVal)
......@@ -354,8 +360,12 @@ export default {
getSpokesmanInit(extConfig) {
//绑定上下级关系
app.fenxiaoModel.becomeRelation(extConfig).then(res=>{
if(!res) {
wx.removeStorage({
key: "becomeInfo"
});
}
//获取分销基本信息
console.log(res,333333344444444)
this.getSpokesmanInfo(extConfig)
})
},
......@@ -460,15 +470,25 @@ export default {
console.log(res)
let newHref = '/pages/home/main';
let title = app.globalData.shopInfo.shopName;
let hasInvitationStatus = 0;
await app.fenxiaoModel.getSpokesmanidByShare().then(data=>{
if (data.hasInvitationStatus == 1) {
let newData = {
hasInvitationStatus = data.hasInvitationStatus;
})
await app.fenxiaoModel.getSpokesmanInfo().then(data=>{
let newData = {}
if (hasInvitationStatus == 1) {
newData = {
spokesmanGroupId: data.groupId,
spokesmanShopId: data.shopId,
spokesmanRelId: data.spokesmanId,
spokesmanRelId: data.id,
userId: data.userId
}
}else {
newData = {
userId: data.userId
}
newHref = concatUrl(newHref,newData)
}
newHref = concatUrl(newHref,newData)
})
console.log(newHref,3333555666,title,res)
return {
......
......@@ -33,6 +33,7 @@ import login from "@/api/login";
import shop from "@/api/shop";
import indexApi from "@/api/index.js";
var WXBizDataCrypt = require("@/utils/WXBizDataCrypt");
const app = getApp();
export default {
name:'login',
components: {
......@@ -311,6 +312,14 @@ export default {
},
// 是否跳转h5或小程序
pushPageType(){
//绑定上下级关系
app.fenxiaoModel.becomeRelation(wx.getStorage("becomeInfo")).then(res=>{
if(!res) {
wx.removeStorage({
key: "becomeInfo"
});
}
})
if(this.fromType=='mini'){
wx.navigateBack({
delta: 1
......
......@@ -89,7 +89,7 @@ class fenxiaoModel{
}
})
}else {
resolve()
resolve(false)
}
})
}
......
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