feat: 卡片数据调整对应
This commit is contained in:
@@ -2,6 +2,7 @@
|
|||||||
width: 100%;
|
width: 100%;
|
||||||
height: 356px;
|
height: 356px;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
|
padding-bottom: 12px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.explore-scroll {
|
.explore-scroll {
|
||||||
|
|||||||
@@ -6,9 +6,8 @@
|
|||||||
|
|
||||||
<scroll-view class="discovery-scroll" scroll-y @scroll="handleContentScroll">
|
<scroll-view class="discovery-scroll" scroll-y @scroll="handleContentScroll">
|
||||||
<view class="discovery-body">
|
<view class="discovery-body">
|
||||||
<ExploreCards v-if="discoveryCards.length > 0 && isPanoramaGuideTab" :list="discoveryCards"
|
<CardSwiper v-if="discoveryCards.length > 0" :list="discoveryCards" @didSelectItem="handleCardClick" />
|
||||||
@didSelectItem="handleCardClick" />
|
<ExploreCards v-if="exploreCards.length > 0" :list="exploreCards" @didSelectItem="handleCardClick" />
|
||||||
<CardSwiper v-else-if="discoveryCards.length > 0" :list="discoveryCards" @didSelectItem="handleCardClick" />
|
|
||||||
|
|
||||||
<QuickQuestions v-if="discoveryQuickQuestions.length > 0" :list="discoveryQuickQuestions"
|
<QuickQuestions v-if="discoveryQuickQuestions.length > 0" :list="discoveryQuickQuestions"
|
||||||
@didSelectItem="handleQuickQuestionClick" />
|
@didSelectItem="handleQuickQuestionClick" />
|
||||||
@@ -47,6 +46,7 @@ const sceneId = appStore.sceneId || "";
|
|||||||
const activeIndex = ref(0);
|
const activeIndex = ref(0);
|
||||||
const discoveryTabs = ref([]);
|
const discoveryTabs = ref([]);
|
||||||
const discoveryCards = ref([]);
|
const discoveryCards = ref([]);
|
||||||
|
const exploreCards = ref([]);
|
||||||
const discoveryQuickQuestions = ref([]);
|
const discoveryQuickQuestions = ref([]);
|
||||||
const emit = defineEmits(["content-scroll"]);
|
const emit = defineEmits(["content-scroll"]);
|
||||||
|
|
||||||
@@ -106,12 +106,26 @@ const queryDiscoveryData = async (tabId) => {
|
|||||||
|
|
||||||
/// 请求发现页卡片数据
|
/// 请求发现页卡片数据
|
||||||
const queryDiscoveryCards = 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) {
|
if (res.code === 0) {
|
||||||
discoveryCards.value = configDataList(res.data);
|
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 queryQuickQuestionData = async (tabId) => {
|
||||||
const res = await homeQuickQuestionData({ tagId: tabId });
|
const res = await homeQuickQuestionData({ tagId: tabId });
|
||||||
|
|||||||
Reference in New Issue
Block a user