This commit is contained in:
weiwei committed 2025-03-25 13:28:49 +08:00
1 parent a0155981eb
commit ed79db43ab
6 files changed
+69 -30

No files matched your search

+60 -23
View File
@@ -4,12 +4,14 @@
// onShow(() => {})
// onHide(() => {})
// zhezhengding:浙政钉 | shihua:诗画
const tabbar = [
{
pagePath: "pages/tabbar/home",
text: "首页",
iconPath: "/static/tabbar/home.png",
selectedIconPath: "/static/tabbar/home-select.png",
pagePath: "pages/tabbar/canteen",
text: "食堂",
iconPath: "/static/tabbar/canteen.png",
selectedIconPath: "/static/tabbar/canteen-select.png",
auth: ["zhezhengding", "shihua"],
},
// {
// "pagePath": "pages/tabbar/shop",
@@ -22,24 +24,28 @@ const tabbar = [
text: "订单",
iconPath: "/static/tabbar/order.png",
selectedIconPath: "/static/tabbar/order-select.png",
auth: ["zhezhengding"],
},
{
pagePath: "pages/tabbar/flowStatistics",
text: "流水统计",
iconPath: "/static/tabbar/order.png",
selectedIconPath: "/static/tabbar/order-select.png",
auth: ["shihua"],
},
{
pagePath: "pages/tabbar/individualOrder",
text: "订单",
iconPath: "/static/tabbar/order.png",
selectedIconPath: "/static/tabbar/order-select.png",
auth: ["shihua"],
},
{
pagePath: "pages/tabbar/my",
text: "我的",
iconPath: "/static/tabbar/my.png",
selectedIconPath: "/static/tabbar/my-select.png",
auth: ["zhezhengding", "shihua"],
},
]
@@ -50,27 +56,58 @@ export default {
methods: {
_initTabbar() {
tabbar.forEach(({ pagePath, text, iconPath, selectedIconPath }, index) => {
if (index === 2 || index === 3) {
uni.setTabBarItem({
index: index,
pagePath,
text,
iconPath,
selectedIconPath,
visible: false,
console.log("环境判断")
let appEnv = 1 // 1:浙政钉 2:诗画
switch (appEnv) {
case 1:
tabbar.forEach(({ pagePath, text, iconPath, selectedIconPath, auth }, index) => {
if (auth.includes("zhezhengding")) {
uni.setTabBarItem({
index,
pagePath,
text,
iconPath,
selectedIconPath,
visible: true,
})
} else {
uni.setTabBarItem({
index,
pagePath,
text,
iconPath,
selectedIconPath,
visible: false,
})
}
})
} else {
uni.setTabBarItem({
index: index,
pagePath,
text,
iconPath,
selectedIconPath,
visible: true,
break
case 2:
tabbar.forEach(({ pagePath, text, iconPath, selectedIconPath, auth }, index) => {
if (auth.includes("shihua")) {
uni.setTabBarItem({
index,
pagePath,
text,
iconPath,
selectedIconPath,
visible: true,
})
} else {
uni.setTabBarItem({
index,
pagePath,
text,
iconPath,
selectedIconPath,
visible: false,
})
}
})
}
})
break
}
},
},
}
+7 -7
View File
@@ -10,9 +10,9 @@
},
"pages": [
{
"path": "pages/tabbar/home",
"path": "pages/tabbar/canteen",
"style": {
"navigationBarTitleText": "首页",
"navigationBarTitleText": "食堂",
"disableScroll": true
}
},
@@ -294,7 +294,7 @@
"tabBar": {
"list": [
{
"pagePath": "pages/tabbar/home",
"pagePath": "pages/tabbar/canteen",
"text": "",
"iconPath": "",
"selectedIconPath": ""
@@ -331,10 +331,10 @@
}
// {
// "pagePath": "pages/tabbar/home",
// "text": "首页",
// "iconPath": "static/tabbar/home.png",
// "selectedIconPath": "static/tabbar/home-select.png"
// "pagePath": "pages/tabbar/canteen",
// "text": "食堂",
// "iconPath": "static/tabbar/canteen.png",
// "selectedIconPath": "static/tabbar/canteen-select.png"
// },
// {
// "pagePath": "pages/tabbar/shop",
File renamed without changes.
+2
View File
@@ -113,6 +113,8 @@ const checkAndRefreshToken = async (tokenStorage: any) => {
// 请求拦截器
http.interceptors.request.use(async (config) => {
console.log("请求之前")
const tokenStorage = uni.getStorageSync(TOKEN_KEY)
const config_header: any = config?.header || {}
Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB