From 455aa810c24028e8f9828acb03b008fc6674ad69 Mon Sep 17 00:00:00 2001 From: zzp <34701892@qq.com> Date: Sat, 31 Jan 2026 11:25:58 +0800 Subject: [PATCH 1/3] =?UTF-8?q?feat(=E6=96=B0=E9=97=BB=E4=BF=A1=E6=81=AF):?= =?UTF-8?q?=20=E6=B7=BB=E5=8A=A0=E6=97=A5=E6=9C=9F=E9=80=89=E6=8B=A9?= =?UTF-8?q?=E5=8A=9F=E8=83=BD=E5=B9=B6=E6=9B=B4=E6=96=B0API?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 在新闻信息页面添加日期选择器组件,允许用户选择日期查询新闻 新增getTopNewsAllRelease API接口,支持按日期查询新闻数据 更新页面样式和交互逻辑以支持日期选择功能 --- src/api/newsInfo.ts | 6 ++ src/pages/realtimeInfo/indexRelease.vue | 77 +++++++++++++++++++++++-- 2 files changed, 77 insertions(+), 6 deletions(-) diff --git a/src/api/newsInfo.ts b/src/api/newsInfo.ts index 43b43f7..54df9c7 100644 --- a/src/api/newsInfo.ts +++ b/src/api/newsInfo.ts @@ -29,6 +29,12 @@ export const getTopNews = (data: any) => { // 概念标签贴标 export const getTopNewsAll = (data: any) => { return request.get("/top_news_release_h5_all", data); + // return request.get("/news_release_ratingrank_h5_d", data); +}; + +// 概念标签贴标 release +export const getTopNewsAllRelease = (data: any) => { + return request.get("/news_release_ratingrank_h5_d?input_date=" + data.input_date + "&limit_num=10"); }; // 热门行业top10: diff --git a/src/pages/realtimeInfo/indexRelease.vue b/src/pages/realtimeInfo/indexRelease.vue index 8687f43..7f4e794 100644 --- a/src/pages/realtimeInfo/indexRelease.vue +++ b/src/pages/realtimeInfo/indexRelease.vue @@ -79,6 +79,7 @@ + @@ -93,11 +94,31 @@ + + + {{ chooseDate.startDate.split(" ")[0] }} + + + + 退出登录 + + + { const topNum = ref({}); +const d = new Date(); +const year = d.getFullYear(); +let month = d.getMonth() + 1; +month = month < 10 ? `0${month}` : month; +const date = d.getDate(); +const maxDate = ref(`${year}-${month}-${date} 23:59:59`); +const minDate = ref(`${year}-${month}-${date}`); + +const calendarShow = ref(false); + +const chooseDate = reactive({ + startDate: `${year}-${month}-${date}`, + endDate: null, +}); +function showCalendar() { + calendarShow.value = true; +} + +function calendarConfirm(dateList) { + console.log("🚀 ~ calendarConfirm ~ dateList:", dateList); + if (dateList && dateList.length > 0) { + chooseDate.startDate = dateList[0] + " 00:00:00"; + chooseDate.endDate = dateList[dateList.length - 1] + " 23:59:59"; + } + getNewsList(); + calendarShow.value = false; + console.log("🚀 ~ calendarConfirm ~ chooseDate:", chooseDate); +} + // 获取顶部两个统计数据 async function getTopNum() { let res1 = await getindustryCount({}); @@ -170,7 +221,11 @@ async function getTopNum() { // 概念标签贴标 async function getNewsList() { - newsList.value = await getTopNewsAll({}); + console.log(`🚀 ~ getNewsList ~ chooseDate.startDate.split(" ")[0]:`, chooseDate.startDate.split(" ")[0]); + + newsList.value = await getTopNewsAllRelease({ + input_date: chooseDate.startDate.split(" ")[0], + }); } // 热门行业top10 @@ -350,7 +405,9 @@ onMounted(async () => { } text { - font-family: PingFangSC, PingFang SC; + font-family: + PingFangSC, + PingFang SC; font-weight: 400; font-size: 24rpx; color: rgba(255, 255, 255, 0.8); @@ -393,7 +450,9 @@ onMounted(async () => { } .tag_title { - font-family: PingFangSC, PingFang SC; + font-family: + PingFangSC, + PingFang SC; font-weight: 400; font-size: 24rpx; color: #222222; @@ -401,7 +460,9 @@ onMounted(async () => { } .tag_num { - font-family: PingFangSC, PingFang SC; + font-family: + PingFangSC, + PingFang SC; font-weight: bold; font-size: 38rpx; color: #222222; @@ -409,7 +470,9 @@ onMounted(async () => { } .tag_status { - font-family: PingFangSC, PingFang SC; + font-family: + PingFangSC, + PingFang SC; font-weight: 400; font-size: 22rpx; color: #999999; @@ -532,7 +595,9 @@ onMounted(async () => { } .sreach_text { - font-family: PingFangSC, PingFang SC; + font-family: + PingFangSC, + PingFang SC; font-weight: 400; font-size: 24rpx; color: #999999; From ef818b9c2238061d2a8c01b40b7df53ddc829330 Mon Sep 17 00:00:00 2001 From: "34701892@qq.com" <34701892@qq.com> Date: Mon, 2 Feb 2026 17:18:13 +0800 Subject: [PATCH 2/3] =?UTF-8?q?fix(realtimeInfo):=20=E5=B0=86=E6=97=A5?= =?UTF-8?q?=E5=8E=86=E7=BB=84=E4=BB=B6=E6=98=BE=E7=A4=BA=E6=9C=88=E4=BB=BD?= =?UTF-8?q?=E6=95=B0=E4=BB=8E12=E4=B8=AA=E6=9C=88=E8=B0=83=E6=95=B4?= =?UTF-8?q?=E4=B8=BA24=E4=B8=AA=E6=9C=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 修改日历组件的monthNum属性,扩展显示范围以满足用户查看更长时间范围的需求 --- src/pages/realtimeInfo/indexRelease.vue | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/src/pages/realtimeInfo/indexRelease.vue b/src/pages/realtimeInfo/indexRelease.vue index 7f4e794..9e02f04 100644 --- a/src/pages/realtimeInfo/indexRelease.vue +++ b/src/pages/realtimeInfo/indexRelease.vue @@ -95,7 +95,17 @@ - + {{ chooseDate.startDate.split(" ")[0] }} @@ -112,7 +122,7 @@ closeOnClickOverlay :max-date="maxDate" :default-date="chooseDate.startDate" - monthNum="12" + monthNum="24" :key="chooseDate.startDate" @confirm="calendarConfirm" @close="calendarShow = false" From e20ed0c7db3ba35849db0536e1b2c04a2e88601f Mon Sep 17 00:00:00 2001 From: "34701892@qq.com" <34701892@qq.com> Date: Fri, 13 Feb 2026 12:01:48 +0800 Subject: [PATCH 3/3] =?UTF-8?q?refactor(realtimeInfo):=20=E7=A7=BB?= =?UTF-8?q?=E9=99=A4=E8=87=AA=E5=8A=A8=E5=88=B7=E6=96=B0=E5=AE=9A=E6=97=B6?= =?UTF-8?q?=E5=99=A8=E5=B9=B6=E4=BC=98=E5=8C=96=E6=A0=B7=E5=BC=8F=E6=A0=BC?= =?UTF-8?q?=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 注释掉自动刷新数据的定时器以减少不必要的请求 - 统一调整字体样式声明格式为多行以提高可读性 - 优化部分布局代码的格式 --- src/pages/realtimeInfo/index.vue | 69 ++++++++++++++++++++----- src/pages/realtimeInfo/indexRelease.vue | 26 +++++++--- 2 files changed, 73 insertions(+), 22 deletions(-) diff --git a/src/pages/realtimeInfo/index.vue b/src/pages/realtimeInfo/index.vue index a1ad0a6..1bc8b70 100644 --- a/src/pages/realtimeInfo/index.vue +++ b/src/pages/realtimeInfo/index.vue @@ -58,7 +58,16 @@ - + @@ -66,7 +75,17 @@
- + {{ chooseDate.startDate.split(" ")[0] }} @@ -81,7 +100,9 @@ - + 查看全部 @@ -93,7 +114,9 @@ - + 查看全部 @@ -110,7 +133,8 @@ :show="LoginShow" @handlePopupClose="handlePopupClose" @handlePopupSuccessCallback="handlePopupSuccessCallback" - @handlePopupErrorCallback="handlePopupErrorCallback" /> + @handlePopupErrorCallback="handlePopupErrorCallback" + /> + @close="calendarShow = false" + > @@ -138,7 +163,15 @@ import tagicon_2 from "@/assets/zixun/tagicon_2.png"; import LoginPopup from "@/components/loginPopup/index.vue"; import { Session } from "@/utils/storage"; -import { getindustryCount, getConceptCount, getTopNews, getTopIndustry_d, getTopConcept_d, getNews_cnt_d, newsInfoScore } from "@/api/newsInfo"; +import { + getindustryCount, + getConceptCount, + getTopNews, + getTopIndustry_d, + getTopConcept_d, + getNews_cnt_d, + newsInfoScore, +} from "@/api/newsInfo"; import countTo from "@/components/count-to/vue-countTo.vue"; import RankList from "@/components/RankList.vue"; // 路径根据实际调整 import InfoSummary from "@/components/InfoSummary.vue"; // 路径根据实际调整 @@ -261,9 +294,9 @@ function onViewAll(type1) { } } -const timer = setInterval(() => { - initData(); -}, 5000); +// const timer = setInterval(() => { +// initData(); +// }, 5000); function showCalendar() { calendarShow.value = true; @@ -396,7 +429,9 @@ function timeFormat(dateTime = null, formatStr = "yyyy-mm-dd hh:MM:ss") { } text { - font-family: PingFangSC, PingFang SC; + font-family: + PingFangSC, + PingFang SC; font-weight: 400; font-size: 24rpx; color: rgba(255, 255, 255, 0.8); @@ -439,7 +474,9 @@ function timeFormat(dateTime = null, formatStr = "yyyy-mm-dd hh:MM:ss") { } .tag_title { - font-family: PingFangSC, PingFang SC; + font-family: + PingFangSC, + PingFang SC; font-weight: 400; font-size: 24rpx; color: #222222; @@ -447,7 +484,9 @@ function timeFormat(dateTime = null, formatStr = "yyyy-mm-dd hh:MM:ss") { } .tag_num { - font-family: PingFangSC, PingFang SC; + font-family: + PingFangSC, + PingFang SC; font-weight: bold; font-size: 38rpx; color: #222222; @@ -455,7 +494,9 @@ function timeFormat(dateTime = null, formatStr = "yyyy-mm-dd hh:MM:ss") { } .tag_status { - font-family: PingFangSC, PingFang SC; + font-family: + PingFangSC, + PingFang SC; font-weight: 400; font-size: 22rpx; color: #999999; diff --git a/src/pages/realtimeInfo/indexRelease.vue b/src/pages/realtimeInfo/indexRelease.vue index 8687f43..5be70e8 100644 --- a/src/pages/realtimeInfo/indexRelease.vue +++ b/src/pages/realtimeInfo/indexRelease.vue @@ -223,9 +223,9 @@ function onViewAll(type) { } } -const timer = setInterval(() => { - initData(); -}, 5000); +// const timer = setInterval(() => { +// initData(); +// }, 5000); const LoginShow = ref(false); const isLoginStatus = ref(); @@ -350,7 +350,9 @@ onMounted(async () => { } text { - font-family: PingFangSC, PingFang SC; + font-family: + PingFangSC, + PingFang SC; font-weight: 400; font-size: 24rpx; color: rgba(255, 255, 255, 0.8); @@ -393,7 +395,9 @@ onMounted(async () => { } .tag_title { - font-family: PingFangSC, PingFang SC; + font-family: + PingFangSC, + PingFang SC; font-weight: 400; font-size: 24rpx; color: #222222; @@ -401,7 +405,9 @@ onMounted(async () => { } .tag_num { - font-family: PingFangSC, PingFang SC; + font-family: + PingFangSC, + PingFang SC; font-weight: bold; font-size: 38rpx; color: #222222; @@ -409,7 +415,9 @@ onMounted(async () => { } .tag_status { - font-family: PingFangSC, PingFang SC; + font-family: + PingFangSC, + PingFang SC; font-weight: 400; font-size: 22rpx; color: #999999; @@ -532,7 +540,9 @@ onMounted(async () => { } .sreach_text { - font-family: PingFangSC, PingFang SC; + font-family: + PingFangSC, + PingFang SC; font-weight: 400; font-size: 24rpx; color: #999999;