Commit f953e760 by 张卓

绑定分销关系

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