diff --git a/src/pages/base/home/index.vue b/src/pages/base/home/index.vue index 252b8a0..bead2cd 100644 --- a/src/pages/base/home/index.vue +++ b/src/pages/base/home/index.vue @@ -85,7 +85,7 @@ import { useUserStore } from "@/store/modules/user"; import { useDataStore } from "@/store/modules/data"; import { hasPermission } from "@/utils/permission"; -const { getCurXs } = useUserStore(); +const { getCurXs, toHome } = useUserStore(); const { setData, getAppCode } = useDataStore(); // 刷新相关变量 @@ -220,18 +220,21 @@ const menuItems = ref([ icon: "/static/base/home/file-text-line.png", path: "/pages/base/gzs/xkXqk", permissionKey: "school-xqkxk", // 兴趣课选课权限编码 + type: 1, }, { title: "俱乐部选课", icon: "/static/base/home/contacts-book-3-line.png", path: "/pages/base/gzs/xkJlb", permissionKey: "school-jlbxk", // 俱乐部选课权限编码 + type: 2, }, { title: "就餐缴费", icon: "/static/base/home/contacts-book-3-line.png", path: "/pages/base/gzs/jc", permissionKey: "school-jcjf", + type: 3, }, ]); @@ -274,9 +277,13 @@ const goToGlxs = () => { // 处理菜单点击 function handleMenuClick(item: any) { if (item.path) { - uni.navigateTo({ - url: item.path, - }); + if (!item.type) { + uni.navigateTo({ + url: item.path, + }); + } else { + toHome(item.type); + } } }