启动路径判断
This commit is contained in:
1 parent
aa0fad8350
commit
a6952de614
1 file changed
+12
-32
+12
-32
@@ -104,6 +104,17 @@ export default {
|
||||
console.log("tabbar launch 启动路径参数", launchParam)
|
||||
|
||||
if (isDevEnv()) {
|
||||
tabbar.forEach(({ pagePath, text, iconPath, selectedIconPath, authPath, auth }, index) => {
|
||||
uni.setTabBarItem({
|
||||
index,
|
||||
pagePath,
|
||||
text,
|
||||
iconPath,
|
||||
selectedIconPath,
|
||||
visible: true,
|
||||
})
|
||||
})
|
||||
} else {
|
||||
switch (launchParam) {
|
||||
case "canteen":
|
||||
tabbar.forEach(({ pagePath, text, iconPath, selectedIconPath, authPath }, index) => {
|
||||
@@ -153,40 +164,9 @@ export default {
|
||||
break
|
||||
default:
|
||||
uni.hideTabBar()
|
||||
// tabbar.forEach(({ pagePath, text, iconPath, selectedIconPath, authPath }, index) => {
|
||||
// uni.setTabBarItem({
|
||||
// index,
|
||||
// pagePath,
|
||||
// text,
|
||||
// iconPath,
|
||||
// selectedIconPath,
|
||||
// visible: false,
|
||||
// })
|
||||
// })
|
||||
uni.showToast({ title: "启动参数不合法", icon: "none" })
|
||||
break
|
||||
}
|
||||
} else {
|
||||
tabbar.forEach(({ pagePath, text, iconPath, selectedIconPath, authPath, 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,
|
||||
})
|
||||
}
|
||||
})
|
||||
}
|
||||
},
|
||||
},
|
||||
|
||||
Reference in new issue
Block a user