Commit cf08618e by 程默

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

parents 33765322 061aa819
......@@ -3,6 +3,7 @@ import shop from "@/api/shop";
import spokesman from "@/api/spokesman";
import { themeColor, checkShowConditionIds } from "@/utils/mayi";
import { query_isEntry } from "@/utils/mayi_fenxiao";
export default {
created() {
......@@ -167,6 +168,11 @@ export default {
// 显示条件(未处理)
footerVal.componentData.list=footerVal.componentData.list.filter(item=>item.visible==undefined || item.visible==1) || [];
footerVal.componentData.list.forEach(ele=>{
if(ele.link.name=="分销员中心" || ele.link.name=="分销商中心") {
ele.show = false;
}
})
this.mpApp.globalData.footerVal = footerVal;
// app中异步数据回调 底部栏数据
if (mpApp.footerCallBack) {
......
......@@ -233,23 +233,6 @@ export default {
getHomePageQuickAccess().then(res=>{
that.showMyCard = res;
})
query_isEntry().then((data)=>{
//分销弹框信息
app.globalData.applySucessEntry = data;
console.log(app.globalData.applySucessEntry,1111112222222222,data)
if (
data.applyRemind == "true" &&
data.displayEntry == "true"
) {
that.applySucessEntry = true
}else if (
data.applyRemindByDistributor == "true" &&
data.displayEntryByDistributor == "true"
) {
that.applySucessEntry = true
}
// that.applySucessEntry = res;
})
//获取分销信息
this.getSpokesmanInit(options)
// 来源
......@@ -317,6 +300,38 @@ export default {
wx.setNavigationBarTitle({title : app.globalData.shopInfo.shopName})
wx.stopPullDownRefresh()
query_isEntry().then((data)=>{
//分销弹框信息
app.globalData.applySucessEntry = data;
console.log(app.globalData.applySucessEntry,3333444)
if (
data.applyRemind == "true" &&
data.displayEntry == "true"
) {
this.applySucessEntry = true;
}else if (
data.applyRemindByDistributor == "true" &&
data.displayEntryByDistributor == "true"
) {
this.applySucessEntry = true
}
let footerVal = {...app.globalData.footerVal};
footerVal.componentData.list.forEach(res=>{
if(res.link.name=="分销员中心"&&data.displayEntry == 'true') {
res.show = true
}else if(res.link.name=="分销员中心"&&data.displayEntry == 'false') {
res.show = false
}else if(res.link.name=="分销商中心"&&data.displayEntryByDistributor == 'true') {
res.show = true
}else if(res.link.name=="分销商中心"&&data.displayEntryByDistributor == 'false') {
res.show = false
}
})
app.globalData.footerVal = footerVal;
this.$mp.page.selectComponent(".custom-tab-bar").init();
// that.applySucessEntry = res;
})
},
async getSpokesmanInit(extConfig) {
//绑定上下级关系
......
......@@ -38,40 +38,44 @@ Component({
});
},
attached() {
let that = this;
if (app.globalData.footerVal) {
let mm =
Math.ceil(app.globalData.footerVal.componentData.list.length / 2 - 1) ==
that.data.selected &&
app.globalData.footerVal.componentData["styleSelectionNum"] == 1;
this.init()
},
methods: {
init() {
let that = this;
if (app.globalData.footerVal) {
let mm =
Math.ceil(app.globalData.footerVal.componentData.list.length / 2 - 1) ==
that.data.selected &&
app.globalData.footerVal.componentData["styleSelectionNum"] == 1;
that.setData({
componentData: app.globalData.footerVal.componentData,
list: app.globalData.footerVal.componentData.list,
mm: mm
});
} else {
app.footerCallBack = function(params) {
params.componentData.selectIconColor = app.globalData.footerVal.componentData.selectIconBackground == 1 ? 'val(--main-color)':params.componentData.selectIconColor
that.setData({
componentData: params.componentData,
list: params.componentData.list
// mm:(Math.ceil(params.componentData.list.length/2-1)==that.data.selected&&params.componentData['styleSelectionNum']==1)
componentData: app.globalData.footerVal.componentData,
list: app.globalData.footerVal.componentData.list,
mm: mm
});
console.log(this.data.list,1111111132333)
} else {
app.footerCallBack = function(params) {
params.componentData.selectIconColor = app.globalData.footerVal.componentData.selectIconBackground == 1 ? 'val(--main-color)':params.componentData.selectIconColor
that.setData({
componentData: params.componentData,
list: params.componentData.list
// mm:(Math.ceil(params.componentData.list.length/2-1)==that.data.selected&&params.componentData['styleSelectionNum']==1)
});
let mm =
Math.ceil(params.componentData.list.length / 2 - 1) ==
that.data.selected &&
params.componentData["styleSelectionNum"] == 1;
};
}
this.setData({
mm:
Math.ceil(this.data.list.length / 2 - 1) == this.data.selected &&
this.data.componentData["styleSelectionNum"] == 1
});
},
methods: {
let mm =
Math.ceil(params.componentData.list.length / 2 - 1) ==
that.data.selected &&
params.componentData["styleSelectionNum"] == 1;
};
}
this.setData({
mm:
Math.ceil(this.data.list.length / 2 - 1) == this.data.selected &&
this.data.componentData["styleSelectionNum"] == 1
});
},
switchTab(e) {
const { index } = e.currentTarget.dataset;
app.$themeToLink(this.data.list[index]["link"], 1);
......
......@@ -6,6 +6,7 @@
<view class="tab-bar-border"></view>
<view
wx:for="{{list}}"
wx:if="{{item.show}}"
wx:key="index"
class="tab-bar-item {{(mmm==index&&componentData['styleSelectionNum']==1)?'isItem':''}}"
data-path="{{item.link}}"
......
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