feat(资讯): 新增获取全部热门资讯接口并修复列表显示逻辑
添加获取全部热门资讯的接口getTopNewsAll,替换原有接口 修复RankList组件中资讯评分显示条件错误的问题 当needExp为false时自动展开列表
This commit is contained in:
parent
413d374786
commit
c2d8a180af
|
|
@ -19,6 +19,10 @@ export const getConceptCount = (data: any) => {
|
|||
export const getTopNews = (data: any) => {
|
||||
return request.get("/top_news_h5_d", data);
|
||||
};
|
||||
// 概念标签贴标
|
||||
export const getTopNewsAll = (data: any) => {
|
||||
return request.get("/top_news_release_h5_all", data);
|
||||
};
|
||||
|
||||
// 热门行业top10:
|
||||
export const getTopIndustry_d = (data: any) => {
|
||||
|
|
|
|||
|
|
@ -24,7 +24,7 @@
|
|||
<text class="source">{{ item.source }}</text>
|
||||
<text class="time">{{ dayjs(item.publish_time).format("YYYY-MM-DD HH:MM:ss") }}</text>
|
||||
</view>
|
||||
<text class="score" v-if="!needExp">
|
||||
<text class="score" v-if="needExp">
|
||||
<text v-if="index < 3">资讯评分:</text>
|
||||
{{ item.news_score }}</text
|
||||
>
|
||||
|
|
@ -77,6 +77,9 @@ watch(
|
|||
watch(
|
||||
() => props.newsList,
|
||||
(newValue, oldValue) => {
|
||||
if (!props.needExp) {
|
||||
isExp.value = true;
|
||||
}
|
||||
rankListLocal.value = [];
|
||||
props.newsList.forEach((item, index) => {
|
||||
if (!isExp.value && index > 9) {
|
||||
|
|
|
|||
|
|
@ -27,7 +27,7 @@ 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, getTopNewsAll, 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"; // 路径根据实际调整
|
||||
|
|
@ -64,7 +64,7 @@ async function getTopNum() {
|
|||
|
||||
// 概念标签贴标
|
||||
async function getNewsList() {
|
||||
newsList.value = await getTopNews({});
|
||||
newsList.value = await getTopNewsAll({});
|
||||
}
|
||||
|
||||
// 热门行业top10
|
||||
|
|
|
|||
Loading…
Reference in New Issue