From f9bd02af3c730a04236eceb7a6a711197126f732 Mon Sep 17 00:00:00 2001 From: zzp <34701892@qq.com> Date: Fri, 12 Sep 2025 10:40:08 +0800 Subject: [PATCH] =?UTF-8?q?feat(=E6=96=B0=E9=97=BB=E5=88=97=E8=A1=A8):=20?= =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E6=A6=82=E5=BF=B5=E5=92=8C=E8=A1=8C=E4=B8=9A?= =?UTF-8?q?=E6=A0=87=E7=AD=BE=E5=B1=95=E7=A4=BA=E5=B9=B6=E6=9B=B4=E6=96=B0?= =?UTF-8?q?API=E7=AB=AF=E7=82=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 在RankList组件中添加概念标签和行业标签的展示区域,使用不同样式区分两种标签。同时更新新闻API端点从"/top_news_h5_d"改为"/top_news_release_h5_all"以获取更多数据。 修改watch逻辑,将返回数据中的concept_label和industry_label字段解析为数组格式并合并到列表项中。 --- src/api/newsInfo.ts | 3 +- src/components/RankList.vue | 56 +++++++++++++++++++++++++++++++++++-- 2 files changed, 56 insertions(+), 3 deletions(-) diff --git a/src/api/newsInfo.ts b/src/api/newsInfo.ts index 5c52abd..49cbe37 100644 --- a/src/api/newsInfo.ts +++ b/src/api/newsInfo.ts @@ -17,7 +17,8 @@ export const getConceptCount = (data: any) => { // 概念标签贴标 export const getTopNews = (data: any) => { - return request.get("/top_news_h5_d", data); + // return request.get("/top_news_h5_d", data); + return request.get("/top_news_release_h5_all", data); }; // 概念标签贴标 export const getTopNewsAll = (data: any) => { diff --git a/src/components/RankList.vue b/src/components/RankList.vue index 3ba5c84..b78a090 100644 --- a/src/components/RankList.vue +++ b/src/components/RankList.vue @@ -19,6 +19,27 @@ {{ item.title }} {{ item.summary }} + + + + + + {{ + item + }} + + + + + + {{ + item + }} + + + + + {{ item.source }} @@ -67,7 +88,11 @@ watch( return; } - rankListLocal.value.push(item); + rankListLocal.value.push({ + ...item, + conceptLabels: JSON.parse(item.concept_label), + industryLabels: JSON.parse(item.industry_label), + }); }); loading.value = false; @@ -86,7 +111,11 @@ watch( return; } - rankListLocal.value.push(item); + rankListLocal.value.push({ + ...item, + conceptLabels: JSON.parse(item.concept_label), + industryLabels: JSON.parse(item.industry_label), + }); }); loading.value = false; } @@ -267,4 +296,27 @@ const handlePopupErrorCallback = () => { align-items: center; gap: 10rpx; } + +.r_r_tags { + // margin-left: 20rpx; + width: 85vw; + overflow-x: scroll; +} + +.r_tags { + display: flex; + gap: 10rpx; + + .tag { + font-family: PingFangSC, PingFang SC; + font-weight: 400; + font-size: 22rpx; + color: #3f80fa; + + padding: 5rpx 20rpx; + border-radius: 10rpx; + + white-space: nowrap; + } +}