From 668f57d9ca96fb81b6a7c287f411c74de38bf88a Mon Sep 17 00:00:00 2001 From: zlong <953829746@qq.com> Date: Thu, 12 Dec 2024 18:26:52 +0800 Subject: [PATCH] =?UTF-8?q?add:=E6=96=B0=E5=A2=9Esearch=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/carousal.ts | 6 ++++++ src/pages/pet-manual/components/CardList.vue | 9 +++++++-- src/pages/pet-manual/index.vue | 2 +- 3 files changed, 14 insertions(+), 3 deletions(-) diff --git a/src/api/carousal.ts b/src/api/carousal.ts index c2e71ca..e052cad 100644 --- a/src/api/carousal.ts +++ b/src/api/carousal.ts @@ -11,6 +11,12 @@ function getTypeList() { function getArticleList(data: ArticleParams) { return httpClient.get>('/articles', data) } +function getSearchRecords() { + return httpClient.get('/articles/search-records') +} +function getSearchRecommends() { + return httpClient.get('/articles/active-search-recommends') +} export default { getCarousalList, getTypeList, diff --git a/src/pages/pet-manual/components/CardList.vue b/src/pages/pet-manual/components/CardList.vue index b848608..76603a0 100644 --- a/src/pages/pet-manual/components/CardList.vue +++ b/src/pages/pet-manual/components/CardList.vue @@ -18,8 +18,10 @@ const props = withDefaults(defineProps<{ total: 0, }, }) - const emit = defineEmits(['loadMore']) +const loadMoreStatus = computed(() => { + return props.pagination.size > props.pagination.total ? 'nomore' : 'more' +}) const contentText = ref({ contentdown: '查看更多', contentrefresh: '加载中', @@ -27,6 +29,9 @@ const contentText = ref({ }) function handleLoadMore() { + if (props.pagination.size > props.pagination.total) { + return + } emit('loadMore') } @@ -50,7 +55,7 @@ function handleLoadMore() { - +