Merge branch 'master' of https://gitea.zianxin.com/zax/biz-mobile-react-cloud
This commit is contained in:
commit
e3dbc06b43
2 files changed
+36
-6
No files matched your search
+3
-2
@@ -27,7 +27,8 @@ const tabbar: TabbarItem[] = [
|
||||
iconPath: "/static/tabbar/canteen.png",
|
||||
selectedIconPath: "/static/tabbar/canteen-select.png",
|
||||
launchParam: ["canteen"],
|
||||
auth: [],
|
||||
// 诗画 setTabbar(launchParam, "user") 会校验 auth;空数组会导致食堂 Tab 不显示
|
||||
auth: ["user"],
|
||||
},
|
||||
{
|
||||
pagePath: "pages/tabbar/canteenAnalyse",
|
||||
@@ -35,7 +36,7 @@ const tabbar: TabbarItem[] = [
|
||||
iconPath: "/static/tabbar/canteen-analyse.png",
|
||||
selectedIconPath: "/static/tabbar/canteen-analyse-select.png",
|
||||
launchParam: ["canteen"],
|
||||
auth: [],
|
||||
auth: ["user"],
|
||||
},
|
||||
{
|
||||
pagePath: "pages/tabbar/selfMerchant",
|
||||
|
||||
@@ -49,14 +49,43 @@ const userRole = ref("user")
|
||||
|
||||
const selectRole = (role: "user" | "merchant" | "doorAdmin") => (userRole.value = role)
|
||||
|
||||
/** 普通用户确认后按入口跳转(原先只处理了少数 launchParam,canteen 等会 break 无跳转,像点不动) */
|
||||
const relaunchByLaunchParam = () => {
|
||||
const launchParam = getLaunchParam()
|
||||
uni.setStorageSync("userRole", "user")
|
||||
if (launchParam) uni.setStorageSync("launchParam", launchParam)
|
||||
switch (launchParam) {
|
||||
case "canteen":
|
||||
return uni.reLaunch({ url: "/pages/tabbar/canteen" })
|
||||
case "selfMerchant":
|
||||
return uni.reLaunch({ url: "/pages/tabbar/selfMerchant" })
|
||||
case "coopMerchant":
|
||||
return uni.reLaunch({ url: "/pages/tabbar/coopMerchant" })
|
||||
case "onlineShop":
|
||||
return uni.reLaunch({ url: "/pages/tabbar/onlineShop" })
|
||||
case "prosperityShop":
|
||||
return uni.reLaunch({ url: "/pages/tabbar/prosperityShop" })
|
||||
case "prosperityShopMchList":
|
||||
return uni.reLaunch({ url: "/pages/tabbar/prosperityShopMchList" })
|
||||
case "integrated":
|
||||
return uni.reLaunch({ url: "/pages/tabbar/integrated" })
|
||||
case "cabinet":
|
||||
return uni.reLaunch({ url: "/pages/tabbar/cabinet" })
|
||||
case "thirdApp":
|
||||
return uni.reLaunch({ url: "/pages/thirdApp/happyMall" })
|
||||
default:
|
||||
if (launchParam) {
|
||||
return uni.reLaunch({ url: `/pages/tabbar/index?launchParam=${encodeURIComponent(launchParam)}` })
|
||||
}
|
||||
uni.showToast({ title: "缺少入口参数,请从门户重新进入", icon: "none", duration: 3500 })
|
||||
}
|
||||
}
|
||||
|
||||
// 确认选择
|
||||
const confirmRole = async () => {
|
||||
switch (userRole.value) {
|
||||
case "user":
|
||||
uni.setStorageSync("userRole", userRole.value)
|
||||
if (getLaunchParam() === "selfMerchant") return uni.reLaunch({ url: "/pages/tabbar/selfMerchant" })
|
||||
if (getLaunchParam() === "coopMerchant") return uni.reLaunch({ url: "/pages/tabbar/coopMerchant" })
|
||||
if (getLaunchParam() === "onlineShop") return uni.reLaunch({ url: "/pages/tabbar/onlineShop" })
|
||||
relaunchByLaunchParam()
|
||||
break
|
||||
case "merchant":
|
||||
uni.showLoading({ title: "正在验证身份", mask: true })
|
||||
|
||||
Reference in new issue
Block a user