Xiao_123 3 dní pred
rodič
commit
5e036f3d02

+ 1 - 0
pages/index/jobFair.vue

@@ -79,6 +79,7 @@ const getList = async () => {
 
 // 加载更多
 const loadingMore = () => {
+  if (total.value <= 0) return
   if (more.value === 'noMore') return
 
   more.value = 'loading'

+ 4 - 1
pages/index/position.vue

@@ -107,6 +107,7 @@ onLoad(() => {
 })
 
 const more = ref('more')
+const total = ref(0)
 // 轮播图-优选集团信息
 const preferredGroup = ref({})
 
@@ -261,7 +262,8 @@ const getData = async () => {
       e.enterprise = { ...e.enterprise, ...dealDictObjData({}, e.enterprise)}
       return e
     }))
-    if (positionListData.value.length === +res.data.total) {
+    total.value = res?.data?.total || 0
+    if (positionListData.value.length === total.value) {
       more.value = 'noMore'
       return
     }
@@ -302,6 +304,7 @@ const onSearch = () => {
 
 // 加载更多
 const loadingMore = () => {
+  if (total.value <= 0) return
   more.value = 'loading'
   query.pageNo++
   getData()

+ 3 - 0
pagesA/balance/index.vue

@@ -93,6 +93,9 @@ async function getList () {
   }
 }
 function loadingMore () {
+  if (total.value <= 0) {
+    return
+  }
   if (more.value === 'noMore') {
     return
   }

+ 4 - 1
pagesA/collect/company.vue

@@ -46,6 +46,7 @@ import { formatName } from '@/utils/getText'
 
 const items = ref([])
 const status = ref('more')
+const total = ref(0)
 const queryParams = ref({
   pageSize: 10,
   pageNo: 1
@@ -58,12 +59,14 @@ const getList = async () => {
     list = dealDictArrayData([], list)
     items.value = items.value.concat(list)
   }
-  status.value = items.value?.length === +data.total ? 'noMore' : 'more'
+  total.value = data?.total || 0
+  status.value = items.value?.length === total.value ? 'noMore' : 'more'
 }
 getList()
 
 // 加载更多
 const loadingMore = () => {
+  if (total.value <= 0) return
   status.value = 'loading'
   queryParams.value.pageNo++
   getList()

+ 4 - 1
pagesA/collect/position.vue

@@ -19,6 +19,7 @@ import { dealDictObjData } from '@/utils/position'
 import PositionList from '@/components/PositionList'
 
 const status = ref('more')
+const total = ref(0)
 const queryParams = ref({
   pageSize: 10,
   pageNo: 1
@@ -35,11 +36,13 @@ const getList = async () => {
     })
     items.value = items.value.concat(list)
   }
-  status.value = items.value?.length === +data.total ? 'noMore' : 'more'
+  total.value = data?.total || 0
+  status.value = items.value?.length === total.value ? 'noMore' : 'more'
 }
 getList()
 
 const loadingMore = () => {
+  if (total.value <= 0) return
   status.value = 'loading'
   queryParams.value.pageNo++
   getList()

+ 4 - 1
pagesA/coupon/index.vue

@@ -73,7 +73,7 @@ async function getMyCoupon () {
         used: (e.usePrice / 100).toFixed(2)
       }
     }))
-    total.value = +data.total
+    total.value = +data.total || 0
     more.value = items.value.length >= total.value ? 'noMore' : 'more'
   } catch (error) {
     if (pageInfo.value.pageNo === 1) {
@@ -107,6 +107,9 @@ function handleTo (status) {
 }
 
 function loadingMore () {
+  if (total.value <= 0) {
+    return
+  }
   if (more.value === 'noMore') {
     return
   }

+ 4 - 1
pagesA/integral/index.vue

@@ -84,7 +84,7 @@ async function getList () {
       }
     })
     items.value.push(..._data)
-    total.value = +data.total
+    total.value = +data.total || 0
     more.value = total.value <= items.value.length ? 'noMore' : 'more'
   } catch (error) {
     if (pageInfo.value.pageNo === 1) {
@@ -95,6 +95,9 @@ async function getList () {
   }
 }
 function loadingMore () {
+  if (total.value <= 0) {
+    return
+  }
   if (more.value === 'noMore') {
     return
   }

+ 4 - 1
pagesA/interview/index.vue

@@ -37,6 +37,7 @@ const statusList = [0, 1, 3, 98]
 
 const more = ref('more')
 const items = ref([])
+const total = ref(0)
 const queryParams = ref({
   pageNo: 1,
   pageSize: 10
@@ -69,7 +70,8 @@ const getList = async () => {
     })
     items.value = items.value.concat(list)
   }
-  more.value = items.value?.length === +data.total ? 'noMore' : 'more'
+  total.value = data?.total || 0
+  more.value = items.value?.length === total.value ? 'noMore' : 'more'
 }
 
 const handleChange = (e) => {
@@ -81,6 +83,7 @@ const handleChange = (e) => {
 
 // 加载更多
 const loadingMore = () => {
+  if (total.value <= 0) return
   more.value = 'loading'
   queryParams.value.pageNo++
   getList()

+ 4 - 1
pagesA/seenMe/index.vue

@@ -62,6 +62,7 @@ const queryParams = ref({
   pageNo: 1,
   pageSize: 10
 })
+const total = ref(0)
 const useUserStore = userStore()
 const userInfo = computed(() => useUserStore?.userInfo)
 // 当前会员套餐是否可查看此模块
@@ -77,7 +78,8 @@ const getList = async () => {
     })
     list.value = list.value.concat(arr)
   }
-  status.value = list.value?.length === +res.data.total ? 'noMore' : 'more'
+  total.value = res?.data?.total || 0
+  status.value = list.value?.length === total.value ? 'noMore' : 'more'
 }
 
 onShow(() => {
@@ -87,6 +89,7 @@ onShow(() => {
 
 // 加载更多
 const loadingMore = () => { 
+  if (total.value <= 0) return
   status.value = 'loading'
   queryParams.value.pageNo++
   getList()

+ 4 - 1
pagesA/student/internshipRecord.vue

@@ -82,6 +82,7 @@ const query = ref({
   pageNo: 1,
   pageSize: 10
 })
+const total = ref(0)
 
 const dataList = ref([])
 const getData = async () => {
@@ -101,7 +102,8 @@ const getData = async () => {
     })
     //
     dataList.value = dataList.value.concat(list)
-    more.value = dataList.value?.length === data?.total ? 'noMore' : 'more'
+    total.value = data?.total || 0
+    more.value = dataList.value?.length === total.value ? 'noMore' : 'more'
   } catch (error) {
     query.pageNo--
     more.value = 'more'
@@ -117,6 +119,7 @@ const handleChange = (e) => {
 
 // 加载更多
 const loadingMore = () => {
+  if (total.value <= 0) return
   more.value = 'loading'
   query.value.pageNo++
   getData()

+ 3 - 0
pagesB/companyDetail/index.vue

@@ -170,6 +170,7 @@ const business = [
   { name: '统一社会信用代码', value: 'code' },
 ]
 const status = ref('more')
+const total = ref(0)
 const queryParams = ref({
   pageNo: 1,
   pageSize: 10,
@@ -228,10 +229,12 @@ const getPositionList = async () => {
     })
     positionList.value = positionList.value.concat(list)
   }
+  total.value = data?.total || 0
   status.value = list?.length < queryParams.value.pageSize ? 'noMore' : 'more'
 }
 
 const loadingMore = () => {
+  if (total.value <= 0) return
   status.value = 'loading'
   queryParams.value.pageNo++
   getPositionList()

+ 3 - 0
pagesB/jobFair/enterprisesClassification.vue

@@ -175,6 +175,7 @@ const onSearch = () => {
   getEnterpriseList()
 }
 
+const total = ref(0)
 const getEnterpriseList = async () => {
   if (!query.jobFairId) return
   try {
@@ -185,6 +186,7 @@ const getEnterpriseList = async () => {
 
     const res = await getJobFairEnterprisePage(params)
     const list = res?.data?.list || []
+	  total.value = res?.data?.total || 0
     listData.value = listData.value.concat(dealDictArrayData([], list))
     loading.value = false
     if (listData.value?.length === +res?.data?.total) {
@@ -207,6 +209,7 @@ const onScroll = (e) =>{
 
 // 加载更多
 const loadingMore = () => {
+	if (total.value <= 0) return
   more.value = 'loading'
   query.pageNo++
   getEnterpriseList()

+ 4 - 1
pagesB/jobFair/positionClassification.vue

@@ -99,6 +99,7 @@ import { getEnterpriseDetails } from '@/api/user'
 
 const loading = ref(true)
 const more = ref('more')
+const total = ref(0)
 const listData = ref([])
 const query = reactive({
   pageSize: 20, 
@@ -238,7 +239,8 @@ const getEntPositionList = async () => {
     })
     listData.value = listData.value.concat(list)
     loading.value = false
-    if (listData.value?.length === +res?.data?.total) {
+    total.value = res?.data?.total || 0
+    if (listData.value?.length === total.value) {
       more.value = 'noMore'
       return
     }
@@ -258,6 +260,7 @@ const onScroll = (e) =>{
 
 // 加载更多
 const loadingMore = () => {
+  if (total.value <= 0) return
   more.value = 'loading'
   query.pageNo++
   getEntPositionList()

+ 4 - 1
pagesB/positionDetail/similar.vue

@@ -19,6 +19,7 @@ const props = defineProps({
   id: String
 })
 const more = ref('more')
+const total = ref(0)
 
 const positionListData = ref([])
 const query = reactive({
@@ -34,7 +35,8 @@ const getData = async () => {
     // 推荐接口返回数据需要拼接
     const list = arr
     positionListData.value.push(...dealDictArrayData(list))
-    if (positionListData.value.length === +res.data.total) {
+    total.value = res?.data?.total || 0
+    if (positionListData.value.length === total.value) {
       more.value = 'noMore'
       return
     }
@@ -54,6 +56,7 @@ const onScroll = (e) =>{
 
 // 加载更多
 const loadingMore = () => {
+  if (total.value <= 0) return
   more.value = 'loading'
   query.pageNo++
   getData()

+ 3 - 0
pagesB/preferredGroup/index.vue

@@ -135,6 +135,7 @@ const change = (e) => {
 
 // 招聘职位
 const status = ref('more')
+const total = ref(0)
 const queryParams = ref({
   pageNo: 1,
   pageSize: 10,
@@ -154,10 +155,12 @@ const getPositionList = async () => {
     })
     positionList.value = positionList.value.concat(list)
   }
+  total.value = data?.total || 0
   status.value = list?.length < queryParams.value.pageSize ? 'noMore' : 'more'
 }
 
 const loadingMore = () => {
+  if (total.value <= 0) return
   status.value = 'loading'
   queryParams.value.pageNo++
   getPositionList()

+ 4 - 1
pagesB/recommendEnterprise/index.vue

@@ -59,6 +59,7 @@ import { formatName } from '@/utils/getText'
 
 const more = ref('more')
 const items = ref([])
+const total = ref(0)
 const query = ref({
   pageNo: 1,
   pageSize: 10
@@ -79,12 +80,14 @@ const getPopularEnterprise = async () => {
     })
     items.value = items.value.concat(list)
   }
-  more.value = items.value.length === +data.total ? 'noMore' : 'more'
+  total.value = data?.total || 0
+  more.value = items.value.length === total.value ? 'noMore' : 'more'
 }
 getPopularEnterprise()
 
 // 加载更多
 const loadingMore = () => {
+  if (total.value <= 0) return
   more.value = 'loading'
   query.value.pageNo++
   getPopularEnterprise()