Ver código fonte

add:新增search接口

zlong 1 ano atrás
pai
commit
668f57d9ca

+ 6 - 0
src/api/carousal.ts

@@ -11,6 +11,12 @@ function getTypeList() {
 function getArticleList(data: ArticleParams) {
   return httpClient.get<PageResult<Article>>('/articles', data)
 }
+function getSearchRecords() {
+  return httpClient.get<string[]>('/articles/search-records')
+}
+function getSearchRecommends() {
+  return httpClient.get<string[]>('/articles/active-search-recommends')
+}
 export default {
   getCarousalList,
   getTypeList,

+ 7 - 2
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<ContentText>({
   contentdown: '查看更多',
   contentrefresh: '加载中',
@@ -27,6 +29,9 @@ const contentText = ref<ContentText>({
 })
 
 function handleLoadMore() {
+  if (props.pagination.size > props.pagination.total) {
+    return
+  }
   emit('loadMore')
 }
 </script>
@@ -50,7 +55,7 @@ function handleLoadMore() {
       </view>
     </view>
   </view>
-  <uni-load-more status="more" :content-text="contentText" @click-load-more="handleLoadMore" />
+  <uni-load-more :status="loadMoreStatus" :content-text="contentText" @click-load-more="handleLoadMore" />
 </template>
 
 <style scoped>

+ 1 - 1
src/pages/pet-manual/index.vue

@@ -58,7 +58,7 @@ async function handleClickType(item: Category) {
   typeList.value.forEach(i => (i.isClick = false))
   item.isClick = true
   articleParams.value.categoryId = item.id
-  cardState.value = 'updatePage'
+  cardState.value = 'update'
   await updateArticleList()
 }
 const isSearch = ref<boolean>(true)