为改新的浅蓝色做准备

This commit is contained in:
lym
2026-03-10 16:57:45 +08:00
parent 0f6e2af469
commit cf6b5179fc
10 changed files with 126 additions and 227 deletions

View File

@@ -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
})
}
},