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"; ...@@ -3,6 +3,7 @@ import shop from "@/api/shop";
import spokesman from "@/api/spokesman"; import spokesman from "@/api/spokesman";
import { themeColor, checkShowConditionIds } from "@/utils/mayi"; import { themeColor, checkShowConditionIds } from "@/utils/mayi";
import { query_isEntry } from "@/utils/mayi_fenxiao";
export default { export default {
created() { created() {
...@@ -167,6 +168,11 @@ export default { ...@@ -167,6 +168,11 @@ export default {
// 显示条件(未处理) // 显示条件(未处理)
footerVal.componentData.list=footerVal.componentData.list.filter(item=>item.visible==undefined || item.visible==1) || []; 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; this.mpApp.globalData.footerVal = footerVal;
// app中异步数据回调 底部栏数据 // app中异步数据回调 底部栏数据
if (mpApp.footerCallBack) { if (mpApp.footerCallBack) {
......
...@@ -233,23 +233,6 @@ export default { ...@@ -233,23 +233,6 @@ export default {
getHomePageQuickAccess().then(res=>{ getHomePageQuickAccess().then(res=>{
that.showMyCard = 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) this.getSpokesmanInit(options)
// 来源 // 来源
...@@ -317,6 +300,38 @@ export default { ...@@ -317,6 +300,38 @@ export default {
wx.setNavigationBarTitle({title : app.globalData.shopInfo.shopName}) wx.setNavigationBarTitle({title : app.globalData.shopInfo.shopName})
wx.stopPullDownRefresh() 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) { async getSpokesmanInit(extConfig) {
//绑定上下级关系 //绑定上下级关系
......
...@@ -38,40 +38,44 @@ Component({ ...@@ -38,40 +38,44 @@ Component({
}); });
}, },
attached() { attached() {
let that = this; this.init()
if (app.globalData.footerVal) { },
let mm = methods: {
Math.ceil(app.globalData.footerVal.componentData.list.length / 2 - 1) == init() {
that.data.selected && let that = this;
app.globalData.footerVal.componentData["styleSelectionNum"] == 1; 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({ that.setData({
componentData: params.componentData, componentData: app.globalData.footerVal.componentData,
list: params.componentData.list list: app.globalData.footerVal.componentData.list,
// mm:(Math.ceil(params.componentData.list.length/2-1)==that.data.selected&&params.componentData['styleSelectionNum']==1) 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 = let mm =
Math.ceil(params.componentData.list.length / 2 - 1) == Math.ceil(params.componentData.list.length / 2 - 1) ==
that.data.selected && that.data.selected &&
params.componentData["styleSelectionNum"] == 1; params.componentData["styleSelectionNum"] == 1;
}; };
} }
this.setData({ this.setData({
mm: mm:
Math.ceil(this.data.list.length / 2 - 1) == this.data.selected && Math.ceil(this.data.list.length / 2 - 1) == this.data.selected &&
this.data.componentData["styleSelectionNum"] == 1 this.data.componentData["styleSelectionNum"] == 1
}); });
}, },
methods: {
switchTab(e) { switchTab(e) {
const { index } = e.currentTarget.dataset; const { index } = e.currentTarget.dataset;
app.$themeToLink(this.data.list[index]["link"], 1); app.$themeToLink(this.data.list[index]["link"], 1);
......
...@@ -6,6 +6,7 @@ ...@@ -6,6 +6,7 @@
<view class="tab-bar-border"></view> <view class="tab-bar-border"></view>
<view <view
wx:for="{{list}}" wx:for="{{list}}"
wx:if="{{item.show}}"
wx:key="index" wx:key="index"
class="tab-bar-item {{(mmm==index&&componentData['styleSelectionNum']==1)?'isItem':''}}" class="tab-bar-item {{(mmm==index&&componentData['styleSelectionNum']==1)?'isItem':''}}"
data-path="{{item.link}}" 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