Ver Fonte

接口数据等待时间过长,加上Loading

lifanagju_citu há 1 mês atrás
pai
commit
814b29e8d5

+ 3 - 3
pages/index/components/condition.vue

@@ -18,7 +18,7 @@
 		
 		<scroll-view class="scrollBox" :scroll-y="true" @scrolltolower="loadingMore" style="position:relative;">
 			<TalentItem v-if="items?.length" :items="items" :showLastWorkExp="false" />
-			<uni-load-more v-if="items.length" :status="more" />
+			<uni-load-more v-if="more" :status="more" />
 			<view v-else class="noJobId">请选择条件搜索人才</view>
 		</scroll-view>
 	</view>
@@ -46,7 +46,7 @@ const params = ref({
   eduType: ''
 })
 const items = ref([])
-const more = ref('more')
+const more = ref('') // 没有筛选条件默认为空,展示提示语。
 const total = ref(0)
 const filterList = ref([
   { label: '职位', dictType: 'positionTreeData',key: 'positionId', map: { text: 'nameCn', value: 'id' } },
@@ -108,7 +108,7 @@ const handleSearch = (key, value) => {
 			icon: 'none',
 			duration: 2000
 		})
-		more.value = 'noMore'
+		more.value = ''
 		items.value = []
 		total.value = 0
 		return

+ 7 - 2
pages/index/jobFair.vue

@@ -42,8 +42,13 @@ const navbarHeight = ref(uni.getStorageSync('navbarHeight'))
 
 // 获得招聘会列表
 const getList = async () => {
-  const res = await getJobFairList()
-  items.value = res?.data || []
+  try {
+	  uni.showLoading({ title: '加载中' })
+    const res = await getJobFairList()
+    items.value = res?.data || []
+  } finally {
+    uni.hideLoading()
+  }
 }
 
 watch(() => useUserStore.refreshToken, () => {

+ 11 - 6
pagesB/jobFair/details.vue

@@ -45,12 +45,17 @@ const getJobFairInfo = async () => {
 // 获取招聘会职位
 const jobFairPosition = ref([])
 const getJobFairPositionList = async () => {
-  const { data } = await getJobFairPosition(id.value)
-  if (!data || !data.length) {
-		jobFairPosition.value = []
-		return
-	}
-  jobFairPosition.value = dealDictArrayData([], data)
+  try {
+	  uni.showLoading({ title: '加载中' })
+		const { data } = await getJobFairPosition(id.value)
+		if (!data || !data.length) {
+			jobFairPosition.value = []
+			return
+		}
+		jobFairPosition.value = dealDictArrayData([], data)
+  } finally {
+    uni.hideLoading()
+  }
 }
 
 onLoad((options) => {