From 685bcc76a8248c2906beaf71cd9a86f85dd0eb00 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=82=85=E5=85=89=E5=AD=9F?= Date: Fri, 27 Feb 2026 17:57:51 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E6=9B=B4=E6=96=B0=E8=8F=9C=E5=8D=95?= =?UTF-8?q?=E9=A1=B9=E5=B1=9E=E6=80=A7=E5=90=8D=E7=A7=B0=E4=B8=BAlabel?= =?UTF-8?q?=EF=BC=8C=E5=B9=B6=E8=B0=83=E6=95=B4=E6=9D=83=E9=99=90=E5=88=A4?= =?UTF-8?q?=E6=96=AD=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/HeaderView/index.vue | 37 +++++++++------- .../components/TopNewsView/index.vue | 15 ++++++- src/stores/user/index.ts | 42 ++++++++++++++++--- 3 files changed, 73 insertions(+), 21 deletions(-) diff --git a/src/pages/realtimeInfo/components/HeaderView/index.vue b/src/pages/realtimeInfo/components/HeaderView/index.vue index 1758bc3..2d3db93 100644 --- a/src/pages/realtimeInfo/components/HeaderView/index.vue +++ b/src/pages/realtimeInfo/components/HeaderView/index.vue @@ -4,9 +4,9 @@ 数据更新时间:{{ date }} - + - {{ menu.name }} + {{ menu.label }} @@ -24,33 +24,33 @@ import { useUserStore } from "@/stores/user"; const menus = reactive([ { - name: "海外先机", + label: "海外先机", + name: "hwxj", icon: MENUICON1, - // auth: "menu1", path: "/pages/foreign/index", }, { - name: "编辑精选", + label: "编辑精选", + name: "bjjx", icon: MENUICON2, - // auth: "menu2", path: "/pages/recommend/index", }, { - name: "宏观知微", + label: "宏观知微", + name: "hgzw", icon: MENUICON3, - // auth: "menu3", path: "/pages/macroscopic/index", }, { - name: "热门行业", + label: "热门行业", + name: "rthx", icon: MENUICON4, - // auth: "menu4", path: "/pages/industry/index", }, { - name: "风口概念", + label: "风口概念", + name: "fkgn", icon: MENUICON5, - // auth: "menu5", path: "/pages/concept/index", }, ]); @@ -61,7 +61,7 @@ const userInfos = computed(() => { }); const emit = defineEmits(["onShow"]); -const goto = (path: string, auth: string) => { +const goto = (menu: any) => { if (!userStore.isLogin) { emit("onShow"); return; @@ -76,8 +76,17 @@ const goto = (path: string, auth: string) => { return; } + const isAuth = userInfos.value?.auth?.findIndex((item) => item.name === menu.name); + if (isAuth === -1 || userInfos.value?.auth[isAuth]?.enabled === 0) { + uni.showToast({ + title: "暂未开通本栏目", + icon: "none", + }); + return; + } + uni.navigateTo({ - url: path, + url: menu.path, }); }; diff --git a/src/pages/realtimeInfo/components/TopNewsView/index.vue b/src/pages/realtimeInfo/components/TopNewsView/index.vue index eb5141d..54121dc 100644 --- a/src/pages/realtimeInfo/components/TopNewsView/index.vue +++ b/src/pages/realtimeInfo/components/TopNewsView/index.vue @@ -36,11 +36,14 @@