Browse Source

加载中不显示暂无数据图片,

lifanagju_citu 2 tháng trước cách đây
mục cha
commit
30646bf6c7
1 tập tin đã thay đổi với 6 bổ sung1 xóa
  1. 6 1
      pages/index/position.vue

+ 6 - 1
pages/index/position.vue

@@ -35,7 +35,7 @@
             <view class="white-bgc px-10 stickFilter ss-p-t-10">
             <FilterList :list="filterList" idValue="label" @change="handleSearch"></FilterList>
           </view>
-          <PositionList :list="positionListData" :noMore="false" :showJobFairEntrance="false"></PositionList>
+          <PositionList v-if="positionListData?.length || more !== 'loading'" :list="positionListData" :noMore="false" :showJobFairEntrance="false"></PositionList>
           <uni-load-more :status="more" />
         </view>
       </scroll-view>
@@ -209,8 +209,13 @@ const getData = async () => {
   if (params.pageNo === 1) positionListData.value = []
   type.value = hasValue ? 'position' : 'recommend'
   try {
+    more.value = 'loading'
     const res = await api(params)
     const arr = res?.data?.list || []
+    if (!arr?.length) {
+      more.value = 'noMore'
+      return
+    }
     // 推荐接口返回数据需要拼接
     const list = !hasValue ? arr.map(e => {
       const { anotherName, logoUrl, scale, industryId, enterpriseId, enterpriseName, ...job } = e