为改新的浅蓝色做准备
This commit is contained in:
@@ -23,75 +23,24 @@ Page( {
|
||||
keyword:"",
|
||||
},onShow: function () {
|
||||
if (typeof this.getTabBar === 'function' && this.getTabBar()) {
|
||||
that0=this;
|
||||
var userId = wx.getStorageSync("userId")
|
||||
var userInfodata = wx.getStorageSync("userInfo")
|
||||
var sel=2;
|
||||
var ifsel=0;
|
||||
if(userId&&userInfodata){
|
||||
var userInfo = JSON.parse(userInfodata)
|
||||
|
||||
ifsel=userInfo.bdshEnable;
|
||||
const userId = wx.getStorageSync("userId")
|
||||
const userInfodata = wx.getStorageSync("userInfo")
|
||||
let sel = 3;
|
||||
|
||||
// 根据用户权限调整选中索引
|
||||
if (userId && userInfodata) {
|
||||
const userInfo = JSON.parse(userInfodata);
|
||||
if (userInfo.bdshEnable == 1) {
|
||||
sel = 3; // 在特殊权限菜单中,"门店"选项不存在,"我的"选项索引为3
|
||||
} else {
|
||||
sel = 3; // 在普通菜单中,"门店"选项索引为3
|
||||
}
|
||||
|
||||
if(ifsel==1){
|
||||
that0.getTabBar().setData({
|
||||
"list": [
|
||||
{
|
||||
"pagePath": "/pages/index/index",
|
||||
"text": "首页",
|
||||
"iconPath": "/images/footer-icon-01.png",
|
||||
"selectedIconPath": "/images/footer-icon-01-active.png"
|
||||
},
|
||||
{
|
||||
"pagePath": "/pages/news/index",
|
||||
"iconPath": "/images/footer-icon-05.png",
|
||||
"selectedIconPath": "/images/footer-icon-05-active.png",
|
||||
"text": "资讯"
|
||||
},
|
||||
|
||||
{
|
||||
"pagePath": "/pages/my/index",
|
||||
"text": "我的",
|
||||
"iconPath": "/images/footer-icon-04.png",
|
||||
"selectedIconPath": "/images/footer-icon-04-active.png"
|
||||
}
|
||||
]
|
||||
})
|
||||
}else{
|
||||
that0.getTabBar().setData({
|
||||
"list": [
|
||||
{
|
||||
"pagePath": "/pages/index/index",
|
||||
"text": "首页",
|
||||
"iconPath": "/images/footer-icon-01.png",
|
||||
"selectedIconPath": "/images/footer-icon-01-active.png"
|
||||
},
|
||||
{
|
||||
"pagePath": "/pages/news/index",
|
||||
"iconPath": "/images/footer-icon-05.png",
|
||||
"selectedIconPath": "/images/footer-icon-05-active.png",
|
||||
"text": "资讯"
|
||||
},
|
||||
{
|
||||
"pagePath": "/pages/business/index",
|
||||
"iconPath": "/images/footer-icon-02.png",
|
||||
"selectedIconPath": "/images/footer-icon-02-active.png",
|
||||
"text": "门店"
|
||||
},
|
||||
|
||||
{
|
||||
"pagePath": "/pages/my/index",
|
||||
"text": "我的",
|
||||
"iconPath": "/images/footer-icon-04.png",
|
||||
"selectedIconPath": "/images/footer-icon-04-active.png"
|
||||
}
|
||||
]
|
||||
})
|
||||
}
|
||||
that0.getTabBar().setData({
|
||||
selected: sel
|
||||
})
|
||||
}
|
||||
|
||||
// 只设置选中状态,菜单列表由全局配置管理
|
||||
this.getTabBar().setData({
|
||||
selected: sel
|
||||
})
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
Reference in New Issue
Block a user