Browse Source

职位收藏

Xiao_123 8 months ago
parent
commit
927e7e5aa4

+ 1 - 2
pages/index/position.vue

@@ -41,7 +41,7 @@ const filterList = ref([
 // 
 const positionListData = ref([])
 const noMore = ref(false)
-const query = reactive({ pageSize: 8, pageNo: 1 })
+const query = reactive({ pageSize: 10, pageNo: 1 })
 //
 const getData = async () => {
   query.content = searchContent
@@ -49,7 +49,6 @@ const getData = async () => {
   const list = res?.data?.list || []
   if (list?.length) {
     list.forEach(e => {
-      e.active = false
       e.job = { ...e.job, ...dealDictObjData({}, e.job) }
       e.enterprise = { ...e.enterprise, ...dealDictObjData({}, e.enterprise)}
     })

+ 42 - 1
pagesA/collect/position.vue

@@ -1,8 +1,49 @@
 <template>
-  <div>position</div>
+  <view class="defaultBgc">
+    <scroll-view class="scrollBox" scroll-y="true" @scrolltolower="loadingMore">
+      <view v-if="items.length">
+        <PositionList class="pb-10" :list="items" :noMore="false"></PositionList>
+        <uni-load-more :status="status" />
+      </view>
+      <view v-else class="nodata-img-parent">
+        <image src="https://minio.citupro.com/dev/static/nodata.png" mode="widthFix" style="width: 100vw;height: 100vh;"></image>
+      </view>
+    </scroll-view>
+  </view>
 </template>
 
 <script setup>
+import { ref } from 'vue'
+import { getJobFavoriteList } from '@/api/user'
+import { dealDictObjData } from '@/utils/position'
+import PositionList from '@/components/PositionList'
+
+const status = ref('more')
+const queryParams = ref({
+  pageSize: 10,
+  pageNo: 1
+})
+const items = ref([])
+
+const getList = async () => {
+  const { data } = await getJobFavoriteList(queryParams.value)
+  const list = data?.list || []
+  if (list?.length) {
+    list.forEach(e => {
+      e.job = { ...e.job, ...dealDictObjData({}, e.job) }
+      e.enterprise = { ...e.enterprise, ...dealDictObjData({}, e.enterprise)}
+    })
+    items.value = items.value.concat(list)
+  }
+  status.value = list?.length < queryParams.value.pageSize ? 'noMore' : 'more'
+}
+getList()
+
+const loadingMore = () => {
+  status.value = 'loading'
+  queryParams.value.pageNo++
+  getList()
+}
 </script>
 
 <style scoped lang="scss">

+ 19 - 9
pagesA/seenMe/index.vue

@@ -1,5 +1,5 @@
 <template>
-  <view>
+  <scroll-view class="scrollBox" scroll-y="true" @scrolltolower="loadingMore">
     <view v-if="list.length > 0">
 			<uni-card v-for="(item,index) in list" :key="index" :is-shadow="true" :border='false' shadow="0px 0px 3px 1px rgba(0,0,0,0.1)" >
         <view class="f-horizon">
@@ -25,11 +25,12 @@
           </text>
         </view>
       </uni-card>
+      <uni-load-more :status="status" />
 		</view>
 		<view v-else class="nodata-img-parent">
 			<image src="https://minio.citupro.com/dev/static/nodata.png" mode="widthFix" style="width: 100vw;height: 100vh;"></image>
 		</view>
-  </view>
+  </scroll-view>
 </template>
 
 <script setup>
@@ -38,6 +39,7 @@ import { getInterestedMePage } from '@/api/user'
 import { dealDictObjData } from '@/utils/position'
 import { getUserAvatar } from '@/utils/avatar'
 
+const status = ref('more')
 const queryParams = ref({
   pageNo: 1,
   pageSize: 10
@@ -46,16 +48,24 @@ const queryParams = ref({
 const list = ref([])
 const getList = async () => {
   const res = await getInterestedMePage(queryParams.value)
-  const { data } = res
-  if (!data.list.length) return
-  list.value = data.list.map(e => {
-    e.enterprise = dealDictObjData({}, e.enterprise)
-    e.active = false
-    return e
-  })
+  const arr = res?.data?.list || []
+  if (arr?.length) {
+    arr.forEach(e => {
+      e.enterprise = dealDictObjData({}, e.enterprise)
+    })
+    list.value = list.value.concat(arr)
+  }
+  status.value = arr?.length < queryParams.value.pageSize ? 'noMore' : 'more'
 }
 
 getList()
+
+// 加载跟多
+const loadingMore = () => { 
+  status.value = 'loading'
+  queryParams.value.pageNo++
+  getList()
+}
 </script>
 
 <style scoped lang="scss">

+ 17 - 1
static/style/index.css

@@ -196,7 +196,7 @@
 }
 
 .list-shape {
-  padding: 10px 30rpx;
+  padding: 10px 30rpx 10px;
   margin-top: 10px;
   background-color: #fff;
 }
@@ -205,10 +205,22 @@
   margin: 10rpx 10rpx 10rpx 0;
 }
 
+.tag-gap1 {
+  margin: 10rpx;
+}
+
 .viewider {
   margin: 0 10rpx;
 }
 
+.mt {
+  margin-top: 10rpx;
+}
+
+.mb {
+  margin-bottom: 10rpx;
+}
+
 .ml {
   margin-left: 20rpx;
 }
@@ -9130,3 +9142,7 @@
   font-size: 19px;
   margin: 10px 0;
 }
+
+.scrollBox {
+  height: 100%;
+}

File diff suppressed because it is too large
+ 0 - 0
static/style/index.min.css


+ 3 - 0
static/style/index.scss

@@ -518,4 +518,7 @@
   color: #3f424f;
   font-size: 19px;
   margin: 10px 0;
+}
+.scrollBox{
+  height: 100%;
 }

Some files were not shown because too many files changed in this diff