feat(资讯): 新增获取全部热门资讯接口并修复列表显示逻辑

添加获取全部热门资讯的接口getTopNewsAll,替换原有接口
修复RankList组件中资讯评分显示条件错误的问题
当needExp为false时自动展开列表
This commit is contained in:
zzp 2025-09-04 17:35:10 +08:00
parent 413d374786
commit c2d8a180af
3 changed files with 10 additions and 3 deletions

View File

@ -19,6 +19,10 @@ export const getConceptCount = (data: any) => {
export const getTopNews = (data: any) => { export const getTopNews = (data: any) => {
return request.get("/top_news_h5_d", data); return request.get("/top_news_h5_d", data);
}; };
// 概念标签贴标
export const getTopNewsAll = (data: any) => {
return request.get("/top_news_release_h5_all", data);
};
// 热门行业top10 // 热门行业top10
export const getTopIndustry_d = (data: any) => { export const getTopIndustry_d = (data: any) => {

View File

@ -24,7 +24,7 @@
<text class="source">{{ item.source }}</text> <text class="source">{{ item.source }}</text>
<text class="time">{{ dayjs(item.publish_time).format("YYYY-MM-DD HH:MM:ss") }}</text> <text class="time">{{ dayjs(item.publish_time).format("YYYY-MM-DD HH:MM:ss") }}</text>
</view> </view>
<text class="score" v-if="!needExp"> <text class="score" v-if="needExp">
<text v-if="index < 3">资讯评分</text> <text v-if="index < 3">资讯评分</text>
{{ item.news_score }}</text {{ item.news_score }}</text
> >
@ -77,6 +77,9 @@ watch(
watch( watch(
() => props.newsList, () => props.newsList,
(newValue, oldValue) => { (newValue, oldValue) => {
if (!props.needExp) {
isExp.value = true;
}
rankListLocal.value = []; rankListLocal.value = [];
props.newsList.forEach((item, index) => { props.newsList.forEach((item, index) => {
if (!isExp.value && index > 9) { if (!isExp.value && index > 9) {

View File

@ -27,7 +27,7 @@ import tagicon_2 from "@/assets/zixun/tagicon_2.png";
import LoginPopup from "@/components/loginPopup/index.vue"; import LoginPopup from "@/components/loginPopup/index.vue";
import { Session } from "@/utils/storage"; import { Session } from "@/utils/storage";
import { getindustryCount, getConceptCount, getTopNews, getTopIndustry_d, getTopConcept_d, getNews_cnt_d, newsInfoScore } from "@/api/newsInfo"; import { getindustryCount, getConceptCount, getTopNewsAll, getTopIndustry_d, getTopConcept_d, getNews_cnt_d, newsInfoScore } from "@/api/newsInfo";
import countTo from "@/components/count-to/vue-countTo.vue"; import countTo from "@/components/count-to/vue-countTo.vue";
import RankList from "@/components/RankList.vue"; // import RankList from "@/components/RankList.vue"; //
import InfoSummary from "@/components/InfoSummary.vue"; // import InfoSummary from "@/components/InfoSummary.vue"; //
@ -64,7 +64,7 @@ async function getTopNum() {
// //
async function getNewsList() { async function getNewsList() {
newsList.value = await getTopNews({}); newsList.value = await getTopNewsAll({});
} }
// top10 // top10