From 4be150d344e414f6652e9bbf0b3d1b0a4797f580 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=82=85=E5=85=89=E5=AD=9F?= Date: Wed, 4 Feb 2026 13:10:15 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E6=B7=BB=E5=8A=A0=E7=99=BB=E5=BD=95?= =?UTF-8?q?=E9=AA=8C=E8=AF=81=E5=92=8C=E5=AE=9E=E6=97=B6=E6=95=B0=E6=8D=AE?= =?UTF-8?q?=E6=9B=B4=E6=96=B0=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 在HeaderView组件中添加登录验证逻辑,未登录时触发onShow事件 - 实现TodayNewsView组件的实时数据更新,每5秒刷新一次新闻计数 - 重构TopNewsView组件为轮播展示模式,添加点击跳转和登录验证 - 在realtimeInfo页面中统一处理各组件的登录弹窗事件 - 删除无用的RadarView组件文件 - 重构topNews页面,实现完整的新闻列表展示和日历筛选功能 - 修复分享存储中的appId空值问题 - 将sessionStorage改为localStorage以增强数据持久性 --- .../components/HeaderView/index.vue | 6 + .../components/TodayNewsView/index.vue | 36 +- .../components/TopNewsView/index.vue | 97 ++++- src/pages/realtimeInfo/index.vue | 29 +- src/pages/topNews/components/RadarView.vue | 116 ------ src/pages/topNews/index.vue | 345 +++++++++++++++--- src/stores/shareStore.ts | 1 + src/utils/storage.ts | 8 +- 8 files changed, 435 insertions(+), 203 deletions(-) delete mode 100644 src/pages/topNews/components/RadarView.vue diff --git a/src/pages/realtimeInfo/components/HeaderView/index.vue b/src/pages/realtimeInfo/components/HeaderView/index.vue index 7a33cb2..d3bb101 100644 --- a/src/pages/realtimeInfo/components/HeaderView/index.vue +++ b/src/pages/realtimeInfo/components/HeaderView/index.vue @@ -60,7 +60,13 @@ const userInfos = computed(() => { return userStore.getUserInfos(); }); +const emit = defineEmits(["onShow"]); const goto = (path: string, auth: string) => { + if (!userStore.isLogin) { + emit("onShow"); + return; + } + if (userInfos.value.auth.includes(auth)) { uni.navigateTo({ url: path, diff --git a/src/pages/realtimeInfo/components/TodayNewsView/index.vue b/src/pages/realtimeInfo/components/TodayNewsView/index.vue index d5261ad..c563039 100644 --- a/src/pages/realtimeInfo/components/TodayNewsView/index.vue +++ b/src/pages/realtimeInfo/components/TodayNewsView/index.vue @@ -1,17 +1,37 @@ - - \ No newline at end of file + diff --git a/src/pages/realtimeInfo/components/TopNewsView/index.vue b/src/pages/realtimeInfo/components/TopNewsView/index.vue index c05b95a..eb5141d 100644 --- a/src/pages/realtimeInfo/components/TopNewsView/index.vue +++ b/src/pages/realtimeInfo/components/TopNewsView/index.vue @@ -1,6 +1,6 @@ diff --git a/src/pages/topNews/index.vue b/src/pages/topNews/index.vue index 805787c..3db3484 100644 --- a/src/pages/topNews/index.vue +++ b/src/pages/topNews/index.vue @@ -10,76 +10,263 @@ - + + 24h AI追踪海外资讯 +
+ + {{ chooseDate.startDate.split(" ")[0] }} + + +
- - - - 1 + + + + {{ index + 1 }} - 三星生物风险投资基金将投资拓济医药 - 98.52 + {{ item.title }} + {{ item.news_score }} - 三星集团宣布,其生物风险基金将投资中国生物技术公司phronline - Biopharma,以扩大其抗体药物偶联物(A ... + {{ item.summary }} - 中国证券报 - 2025-06-23 11:51 - - - - - 1 - - - 三星生物风险投资基金将投资拓济医药 - 98.5 - - - 三星集团宣布,其生物风险基金将投资中国生物技术公司phronline - Biopharma,以扩大其抗体药物偶联物(A ... - - - 中国证券报 - 2025-06-23 11:51 + {{ item.source }} + {{ + dayjs(item.publish_time).format("YYYY-MM-DD hh:mm:ss") + }} - - 1 + + {{ index + 1 + topNum }} - 三星生物风险投资基金将投资拓济医药三星生物风险投资基金将投资拓济医药 + {{ item.title }} - 98.5 + {{ item.news_score }} - - 1 - - 三星生物风险投资基金将投资拓济医药三星生物风险投资基金将投资拓济医药 - - 98.5 - - - 1 - - 三星生物风险投资基金将投资拓济医药三星生物风险投资基金将投资拓济医药 - - 98.5 + + + 查看更多 + + + + + + + + + + diff --git a/src/stores/shareStore.ts b/src/stores/shareStore.ts index dc3d4d5..aa8e584 100644 --- a/src/stores/shareStore.ts +++ b/src/stores/shareStore.ts @@ -56,6 +56,7 @@ export const useShareStore = defineStore("share", { }).then((res: any) => { const data: IWxConfig = res.data.data; // console.log("🚀 ~ getWeChatSdkData ~ data:", data); + if(!data?.appId) return; wx.config({ debug: false, appId: data.appId, diff --git a/src/utils/storage.ts b/src/utils/storage.ts index 30664d5..54c8bf6 100644 --- a/src/utils/storage.ts +++ b/src/utils/storage.ts @@ -43,24 +43,24 @@ export const Session = { // 设置临时缓存 set(key: string, val: T) { if (key === 'token' || key === 'userPhone') return Cookies.set(key, val); - window.sessionStorage.setItem(Local.setKey(key), JSON.stringify(val)); + window.localStorage.setItem(Local.setKey(key), JSON.stringify(val)); }, // 获取临时缓存 get(key: string) { // console.log("🚀 ~ get ~ key:", key) if (key === 'token' || key === 'userPhone') return Cookies.get(key); - let json = window.sessionStorage.getItem(Local.setKey(key)); + let json = window.localStorage.getItem(Local.setKey(key)); return JSON.parse(json); }, // 移除临时缓存 remove(key: string) { if (key === 'token' || key === 'userPhone') return Cookies.remove(key); - window.sessionStorage.removeItem(Local.setKey(key)); + window.localStorage.removeItem(Local.setKey(key)); }, // 移除全部临时缓存 clear() { Cookies.remove('token'); Cookies.remove('userPhone'); - window.sessionStorage.clear(); + window.localStorage.clear(); }, };