diff --git a/src/pages/foreign/index.vue b/src/pages/foreign/index.vue index 918d5c3..2045c30 100644 --- a/src/pages/foreign/index.vue +++ b/src/pages/foreign/index.vue @@ -3,7 +3,7 @@ - + 海外先机 @@ -147,6 +147,13 @@ \ No newline at end of file + diff --git a/src/pages/realtimeInfo/components/HeaderView/index.vue b/src/pages/realtimeInfo/components/HeaderView/index.vue index c63e062..5927c45 100644 --- a/src/pages/realtimeInfo/components/HeaderView/index.vue +++ b/src/pages/realtimeInfo/components/HeaderView/index.vue @@ -4,7 +4,7 @@ 数据更新时间:{{ date }} - + {{ menu.name }} @@ -20,30 +20,58 @@ import MENUICON2 from "@/assets/images/page/icon_2@2x.png"; import MENUICON3 from "@/assets/images/page/icon_3@2x.png"; import MENUICON4 from "@/assets/images/page/icon_4@2x.png"; import MENUICON5 from "@/assets/images/page/icon_5@2x.png"; +import { useUserStore } from "@/stores/user"; const menus = reactive([ { name: "海外先机", icon: MENUICON1, + auth: "menu1", + path: "/pages/foreign/index", }, { name: "编辑精选", icon: MENUICON2, + auth: "menu2", + path: "/pages/recommend/index", }, { name: "宏观知微", icon: MENUICON3, + auth: "menu3", + path: "/pages/macroscopic/index", }, { name: "热门行业", icon: MENUICON4, + auth: "menu4", + path: "/pages/foreign/index", }, { name: "风口概念", icon: MENUICON5, + auth: "menu5", + path: "/pages/foreign/index", }, ]); const date = computed(() => dayjs().format("YYYY-MM-DD")); +const userStore = useUserStore(); +const userInfos = computed(() => { + return userStore.getUserInfos(); +}); + +const goto = (path: string, auth: string) => { + if (userInfos.value.auth.includes(auth)) { + uni.navigateTo({ + url: path, + }); + } else { + uni.showToast({ + title: "无权限访问", + icon: "none", + }); + } +}; diff --git a/src/pages/realtimeInfo/index.vue b/src/pages/realtimeInfo/index.vue index fd6be50..9c2a9e4 100644 --- a/src/pages/realtimeInfo/index.vue +++ b/src/pages/realtimeInfo/index.vue @@ -26,8 +26,16 @@ - + + + + + @@ -40,6 +48,47 @@ import HotNewsView from "./components/HotNewsView/index.vue"; import ConceptNewsView from "./components/ConceptNewsView/index.vue"; import TodayNewsView from "./components/TodayNewsView/index.vue"; import FooterView from "./components/FooterView/index.vue"; +import LoginDialog from "./components/LoginDialog/index.vue"; +import { Session } from "@/utils/storage"; +import { doLogout } from "@/api"; + +// 登录弹框 +const LoginShow = ref(false); +const isLoginStatus = ref(); +// 关闭弹框 +const handleLoginCancel = () => { + LoginShow.value = false; +}; + +// 登录成功之后的回调 +const handleLoginSuccess = () => { + LoginShow.value = false; +}; + +// 登录失败之后的回调 +const handlePopupErrorCallback = () => { + console.log("登录失败"); +}; +function loginOut() { + doLogout({ + financialAccount: Session.get("userPhone"), + }); + + Session.clear(); + window.location.reload(); +} + +onMounted(async () => { + if (!Session.get("token")) { + LoginShow.value = true; + } + + const { aplus_queue } = window; + aplus_queue.push({ + action: "aplus.sendPV", + arguments: [{ is_auto: false }], // 此处上报的数据暂时在后台没有展示 + }); +});