From ef3c530df5cee48981b950dddb7bcf3c3c49e27d Mon Sep 17 00:00:00 2001
From: zzp <34701892@qq.com>
Date: Sat, 13 Sep 2025 15:05:05 +0800
Subject: [PATCH] =?UTF-8?q?refactor(=E9=A1=B5=E9=9D=A2=E5=B8=83=E5=B1=80):?=
=?UTF-8?q?=20=E9=87=8D=E6=9E=84=E5=AE=9E=E6=97=B6=E8=B5=84=E8=AE=AF?=
=?UTF-8?q?=E9=A1=B5=E9=9D=A2=E5=B8=83=E5=B1=80=EF=BC=8C=E5=B0=86=E7=83=AD?=
=?UTF-8?q?=E5=BA=A6=E7=BB=9F=E8=AE=A1=E5=92=8C=E6=90=9C=E7=B4=A2=E5=8A=9F?=
=?UTF-8?q?=E8=83=BD=E7=A7=BB=E8=87=B3=E5=8F=91=E5=B8=83=E7=89=88=E6=9C=AC?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
- 将7天热度统计图表和相关功能从index.vue移至indexRelease.vue
- 在RankList组件中添加hasTag属性控制标签显示
- 清理未使用的代码和样式
- 更新API注释说明各接口用途
---
src/api/newsInfo.ts | 6 +-
src/components/RankList.vue | 6 +-
src/pages/realtimeInfo/index.vue | 188 +----------------------
src/pages/realtimeInfo/indexRelease.vue | 195 +++++++++++++++++++++++-
4 files changed, 201 insertions(+), 194 deletions(-)
diff --git a/src/api/newsInfo.ts b/src/api/newsInfo.ts
index ec52baf..406d0a7 100644
--- a/src/api/newsInfo.ts
+++ b/src/api/newsInfo.ts
@@ -40,16 +40,16 @@ export const getNews_cnt_d = (data: any) => {
return request.get("/news_cnt_d", data);
};
-// 热门标签某时间段内topN列表
+// 热门标签某时间段内topN列表(左边第一个)
export const getTopConceptPeriod = (data: any) => {
return request.get("/top_concept_period?start_date=" + data.start_time + "&end_date=" + data.end_time + "&limit_num=" + data.limit_num, data);
};
-// 热门行业某时间段内topN列表
+// 热门行业某时间段内topN列表(中间第二个)
export const getTopIndustryPeriod = (data: any) => {
return request.get("/top_industry_period?start_date=" + data.start_time + "&end_date=" + data.end_time + "&limit_num=" + data.limit_num, data);
};
-// 热门标签某时间段内topN列表
+// 热门标签某时间段内topN列表(右边)
export const getTopSourcePeriod = (data: any) => {
return request.get("/top_source_period?start_date=" + data.start_date + "&end_date=" + data.end_time + "&limit_num=" + data.limit_num, data);
};
diff --git a/src/components/RankList.vue b/src/components/RankList.vue
index b78a090..29fa395 100644
--- a/src/components/RankList.vue
+++ b/src/components/RankList.vue
@@ -21,7 +21,7 @@
{{ item.summary }}
-
+
{{
@@ -132,6 +132,10 @@ const props = defineProps({
type: Boolean,
default: true,
},
+ hasTag: {
+ type: Boolean,
+ default: false,
+ },
});
const clickItem = ref({});
diff --git a/src/pages/realtimeInfo/index.vue b/src/pages/realtimeInfo/index.vue
index 1b5fddf..01927e6 100644
--- a/src/pages/realtimeInfo/index.vue
+++ b/src/pages/realtimeInfo/index.vue
@@ -64,36 +64,6 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- 搜索资讯
-
-
-
-
@@ -143,26 +113,13 @@ 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,
- getTopConceptPeriod,
- getTopIndustryPeriod,
- getTopSourcePeriod,
-} 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"; // 路径根据实际调整
import indexMenuTitle from "@/components/indexMenuTitle.vue"; // 路径根据实际调整
import dayjs from "dayjs/esm/index";
import HotIndustryList from "@/components/HotIndustryList.vue"; // 路径根据实际调整
-import LineHol from "@/components/charts/LineHol.vue";
-import LineHolYellow from "@/components/charts/LineHolYellow.vue";
const newsList = ref([]);
@@ -276,52 +233,6 @@ function loginOut() {
window.location.reload();
}
-const lineTabIndex = ref(0);
-function handleTabClick(index) {
- lineTabIndex.value = index;
- getLineDataFn();
-}
-
-const lineTopData = ref({});
-async function getLineDataFn() {
- if (lineTabIndex.value == 0) {
- getTopConceptPeriod({
- start_time: "2025-09-06",
- end_time: "2025-09-13",
- limit_num: 10,
- }).then((res) => {
- lineTopData.value = res;
- });
- } else if (lineTabIndex.value == 1) {
- getTopIndustryPeriod({
- start_time: "2025-09-06",
- end_time: "2025-09-13",
- limit_num: 10,
- }).then((res) => {
- lineTopData.value = res;
- });
- } else if (lineTabIndex.value == 2) {
- getTopSourcePeriod({
- start_time: "2025-09-06",
- end_time: "2025-09-13",
- limit_num: 10,
- }).then((res) => {
- lineTopData.value = res;
- });
- }
-}
-
-function goSreach() {
- if (uni.getStorageSync("token")) {
- uni.navigateTo({
- url: "/pages/sreachReq/index",
- });
- } else {
- uni.navigateTo({
- url: "/pages/login/indexMini",
- });
- }
-}
onUnmounted(() => {
clearInterval(timer);
});
@@ -331,8 +242,6 @@ onMounted(async () => {
if (!Session.get("token")) {
LoginShow.value = true;
}
-
- getLineDataFn();
});
@@ -464,99 +373,4 @@ onMounted(async () => {
margin-right: 20rpx;
margin-bottom: 20rpx;
}
-
-.tabs {
- display: flex;
- align-items: center;
- height: 30px;
- border-radius: 10px;
-
- .tab {
- width: 100px;
- height: 100%;
- display: flex;
- text-align: center;
- justify-content: center;
- align-items: center;
- border: 1px solid #e7e7e7;
- color: #000;
- font-size: 12px;
- }
-
- .tab_left {
- border-start-start-radius: 10px;
- border-end-start-radius: 10px;
- border-right: 0;
- }
-
- .tab_right {
- border-start-end-radius: 10px;
- border-end-end-radius: 10px;
- border-left: 0;
- }
-
- .active {
- border: 1px solid #3c74f1;
- background-color: #3c74f1;
- color: #fff;
- }
-}
-
-.r_sreach {
- height: 60px;
- display: flex;
- align-items: center;
- padding: 0 30rpx;
- // position: absolute;
- // top: 10px;
- // left: 0;
- // z-index: 9999;
- // background: url("https://cankao.obs.cn-east-3.myhuaweicloud.com/mini/newmini/top_bg.png");
-}
-
-.logo_text {
- width: 88rpx;
- height: 40rpx;
-}
-
-.sreach {
- display: flex;
- align-items: center;
- padding: 0rpx 30rpx;
- background-color: #fff;
- border-radius: 100rpx;
- // width: 90vw;
- height: 63rpx;
- margin-left: 20rpx;
- border: 1px solid #e7e7e7;
- margin-top: 5rpx;
- // box-shadow: 0 0 10rpx rgba(97, 97, 97, 0.1);
-}
-
-.sreach_icon {
- margin-right: 10rpx;
- display: flex;
- align-items: center;
-
- image {
- width: 35rpx;
- height: 35rpx;
- margin-top: 5rpx;
- }
-}
-
-.sreach_text {
- font-family: PingFangSC, PingFang SC;
- font-weight: 400;
- font-size: 24rpx;
- color: #999999;
- line-height: 33rpx;
- text-align: left;
- font-style: normal;
-}
-
-.top_bk {
- width: 100vw;
- height: 60px;
-}
diff --git a/src/pages/realtimeInfo/indexRelease.vue b/src/pages/realtimeInfo/indexRelease.vue
index 07236da..24cdb22 100644
--- a/src/pages/realtimeInfo/indexRelease.vue
+++ b/src/pages/realtimeInfo/indexRelease.vue
@@ -54,6 +54,21 @@
+
+
+
+
+
+
+
+
+
@@ -64,8 +79,23 @@
-
-
+
+
+
+
+
+
+
+
+
+
+ 搜索资讯
+
+
+
+
+
+
退出登录
@@ -89,8 +119,21 @@ import tagicon_1 from "@/assets/zixun/tagicon_1.png";
import tagicon_2 from "@/assets/zixun/tagicon_2.png";
import LoginPopup from "@/components/loginPopup/index.vue";
import { Session } from "@/utils/storage";
+import LineHol from "@/components/charts/LineHol.vue";
+import LineHolYellow from "@/components/charts/LineHolYellow.vue";
-import { getindustryCount, getConceptCount, getTopNewsAll, getTopIndustry_d, getTopConcept_d, getNews_cnt_d, newsInfoScore } from "@/api/newsInfo";
+import {
+ getindustryCount,
+ getConceptCount,
+ getTopNewsAll,
+ getTopIndustry_d,
+ getTopConcept_d,
+ getNews_cnt_d,
+ newsInfoScore,
+ getTopConceptPeriod,
+ getTopIndustryPeriod,
+ getTopSourcePeriod,
+} from "@/api/newsInfo";
import countTo from "@/components/count-to/vue-countTo.vue";
import RankList from "@/components/RankList.vue"; // 路径根据实际调整
import InfoSummary from "@/components/InfoSummary.vue"; // 路径根据实际调整
@@ -210,6 +253,56 @@ function loginOut() {
window.location.reload();
}
+const lineTabIndex = ref(0);
+function handleTabClick(index) {
+ lineTabIndex.value = index;
+ getLineDataFn();
+}
+
+const lineTopData = ref({});
+async function getLineDataFn() {
+ if (lineTabIndex.value == 0) {
+ // 行业
+ getTopConceptPeriod({
+ start_time: "2025-09-06",
+ end_time: "2025-09-13",
+ limit_num: 10,
+ }).then((res) => {
+ lineTopData.value = res;
+ });
+ } else if (lineTabIndex.value == 1) {
+ // 概念
+ getTopIndustryPeriod({
+ start_time: "2025-09-06",
+ end_time: "2025-09-13",
+ limit_num: 10,
+ }).then((res) => {
+ lineTopData.value = res;
+ });
+ } else if (lineTabIndex.value == 2) {
+ // 媒体
+ getTopSourcePeriod({
+ start_time: "2025-09-06",
+ end_time: "2025-09-13",
+ limit_num: 10,
+ }).then((res) => {
+ lineTopData.value = res;
+ });
+ }
+}
+
+function goSreach() {
+ if (uni.getStorageSync("token")) {
+ uni.navigateTo({
+ url: "/pages/sreachReq/index",
+ });
+ } else {
+ uni.navigateTo({
+ url: "/pages/login/indexMini",
+ });
+ }
+}
+
onUnmounted(() => {
clearInterval(timer);
});
@@ -219,6 +312,7 @@ onMounted(async () => {
if (!Session.get("token")) {
LoginShow.value = true;
}
+ getLineDataFn();
});
@@ -350,4 +444,99 @@ onMounted(async () => {
margin-right: 20rpx;
margin-bottom: 20rpx;
}
+
+.tabs {
+ display: flex;
+ align-items: center;
+ height: 30px;
+ border-radius: 10px;
+
+ .tab {
+ width: 100px;
+ height: 100%;
+ display: flex;
+ text-align: center;
+ justify-content: center;
+ align-items: center;
+ border: 1px solid #e7e7e7;
+ color: #000;
+ font-size: 12px;
+ }
+
+ .tab_left {
+ border-start-start-radius: 10px;
+ border-end-start-radius: 10px;
+ border-right: 0;
+ }
+
+ .tab_right {
+ border-start-end-radius: 10px;
+ border-end-end-radius: 10px;
+ border-left: 0;
+ }
+
+ .active {
+ border: 1px solid #3c74f1;
+ background-color: #3c74f1;
+ color: #fff;
+ }
+}
+
+.r_sreach {
+ height: 60px;
+ display: flex;
+ align-items: center;
+ padding: 0 30rpx;
+ // position: absolute;
+ // top: 10px;
+ // left: 0;
+ // z-index: 9999;
+ // background: url("https://cankao.obs.cn-east-3.myhuaweicloud.com/mini/newmini/top_bg.png");
+}
+
+.logo_text {
+ width: 88rpx;
+ height: 40rpx;
+}
+
+.sreach {
+ display: flex;
+ align-items: center;
+ padding: 0rpx 30rpx;
+ background-color: #fff;
+ border-radius: 100rpx;
+ // width: 90vw;
+ height: 63rpx;
+ margin-left: 20rpx;
+ border: 1px solid #e7e7e7;
+ margin-top: 5rpx;
+ // box-shadow: 0 0 10rpx rgba(97, 97, 97, 0.1);
+}
+
+.sreach_icon {
+ margin-right: 10rpx;
+ display: flex;
+ align-items: center;
+
+ image {
+ width: 35rpx;
+ height: 35rpx;
+ margin-top: 5rpx;
+ }
+}
+
+.sreach_text {
+ font-family: PingFangSC, PingFang SC;
+ font-weight: 400;
+ font-size: 24rpx;
+ color: #999999;
+ line-height: 33rpx;
+ text-align: left;
+ font-style: normal;
+}
+
+.top_bk {
+ width: 100vw;
+ height: 60px;
+}