Files
YGChatCS/pages/module/discovery/DiscoveryCardComponent.vue
2025-09-13 22:13:38 +08:00

39 lines
947 B
Vue

<template>
<view class="container">
<view v-for="item in themeDTOList" :key="item.title">
<RecommendPostsList :recommendTheme="item" />
</view>
</view>
</template>
<script setup>
import { ref, nextTick } from "vue";
import { onMounted } from "vue";
import { discoveryCradComponent } from "@/request/api/MainPageDataApi";
import RecommendPostsList from "../recommend/RecommendPostsList.vue";
import { SCROLL_TO_BOTTOM } from "@/constant/constant";
const themeDTOList = ref([]);
const loadDiscoveryCradComponent = async () => {
const res = await discoveryCradComponent();
if (res.code === 0 && res.data) {
themeDTOList.value = res.data.themeDTOList;
nextTick(() => {
setTimeout(() => {
uni.$emit(SCROLL_TO_BOTTOM, true);
}, 300);
});
}
};
onMounted(() => {
loadDiscoveryCradComponent();
});
</script>
<style scoped lang="scss">
@import "./styles/DiscoveryCardComponent.scss";
</style>