feat: 卡片数据调整对应

This commit is contained in:
2026-07-14 09:17:49 +08:00
parent 68ffab28bd
commit b3a15eee9b
2 changed files with 19 additions and 4 deletions

View File

@@ -2,6 +2,7 @@
width: 100%;
height: 356px;
overflow: hidden;
padding-bottom: 12px;
}
.explore-scroll {

View File

@@ -6,9 +6,8 @@
<scroll-view class="discovery-scroll" scroll-y @scroll="handleContentScroll">
<view class="discovery-body">
<ExploreCards v-if="discoveryCards.length > 0 && isPanoramaGuideTab" :list="discoveryCards"
@didSelectItem="handleCardClick" />
<CardSwiper v-else-if="discoveryCards.length > 0" :list="discoveryCards" @didSelectItem="handleCardClick" />
<CardSwiper v-if="discoveryCards.length > 0" :list="discoveryCards" @didSelectItem="handleCardClick" />
<ExploreCards v-if="exploreCards.length > 0" :list="exploreCards" @didSelectItem="handleCardClick" />
<QuickQuestions v-if="discoveryQuickQuestions.length > 0" :list="discoveryQuickQuestions"
@didSelectItem="handleQuickQuestionClick" />
@@ -47,6 +46,7 @@ const sceneId = appStore.sceneId || "";
const activeIndex = ref(0);
const discoveryTabs = ref([]);
const discoveryCards = ref([]);
const exploreCards = ref([]);
const discoveryQuickQuestions = ref([]);
const emit = defineEmits(["content-scroll"]);
@@ -106,12 +106,26 @@ const queryDiscoveryData = async (tabId) => {
/// 请求发现页卡片数据
const queryDiscoveryCards = async (tabId) => {
const res = await homeTabContentData({ tagId: tabId });
loadDiscoveryCards(tabId);
loadExploreCards(tabId);
}
/// 请求发现页卡片数据 轮播
const loadDiscoveryCards = async (tabId) => {
const res = await homeTabContentData({ tagId: tabId, resourceType: 0 });
if (res.code === 0) {
discoveryCards.value = configDataList(res.data);
}
}
/// 请求发现页探索卡片数据 大卡片
const loadExploreCards = async (tabId) => {
const res = await homeTabContentData({ tagId: tabId, resourceType: 1 });
if (res.code === 0) {
exploreCards.value = configDataList(res.data);
}
}
/// 请求快速问题列表数据
const queryQuickQuestionData = async (tabId) => {
const res = await homeQuickQuestionData({ tagId: tabId });