|
@@ -5,13 +5,15 @@
|
|
<rich-text class="title" :nodes="jobFairInfo?.title?.replace(/<\/?p[^>]*>/gi, '')"></rich-text>
|
|
<rich-text class="title" :nodes="jobFairInfo?.title?.replace(/<\/?p[^>]*>/gi, '')"></rich-text>
|
|
</view>
|
|
</view>
|
|
|
|
|
|
- <scroll-view class="scrollBox" :scroll-y="true" style="position:relative;">
|
|
|
|
|
|
+ <uni-segmented-control :current="tab" :values="controlList" @clickItem="tabChange" styleType="text" activeColor="#00B760" />
|
|
|
|
+ <scroll-view class="scrollBox" :scroll-y="true" style="position:relative;" @scrolltolower="loadingMore">
|
|
<JobItem
|
|
<JobItem
|
|
v-if="jobFairPosition?.length"
|
|
v-if="jobFairPosition?.length"
|
|
:list="jobFairPosition"
|
|
:list="jobFairPosition"
|
|
:jobFairId="id"
|
|
:jobFairId="id"
|
|
|
|
+ :tab="tab"
|
|
:jobFairName="jobFairInfo?.title?.replace(/<\/?p[^>]*>/gi, '')"
|
|
:jobFairName="jobFairInfo?.title?.replace(/<\/?p[^>]*>/gi, '')"
|
|
- @refresh="getJobFairPositionList"
|
|
|
|
|
|
+ @refresh="tabChange({ currentIndex: tab })"
|
|
/>
|
|
/>
|
|
<uni-load-more v-else status="noMore" />
|
|
<uni-load-more v-else status="noMore" />
|
|
</scroll-view>
|
|
</scroll-view>
|
|
@@ -29,10 +31,13 @@
|
|
import { ref } from 'vue'
|
|
import { ref } from 'vue'
|
|
import { onLoad, onShow } from '@dcloudio/uni-app'
|
|
import { onLoad, onShow } from '@dcloudio/uni-app'
|
|
import { getJobFair, getJobFairPosition } from '@/api/jobFair.js'
|
|
import { getJobFair, getJobFairPosition } from '@/api/jobFair.js'
|
|
|
|
+import { getJobAdvertisedList } from '@/api/new/position'
|
|
import { dealDictArrayData } from '@/utils/position.js'
|
|
import { dealDictArrayData } from '@/utils/position.js'
|
|
import JobItem from './jobItem.vue'
|
|
import JobItem from './jobItem.vue'
|
|
|
|
|
|
const id = ref(null)
|
|
const id = ref(null)
|
|
|
|
+const tab = ref(0)
|
|
|
|
+const controlList = ['招聘中', '已关闭']
|
|
|
|
|
|
// 获取招聘会信息
|
|
// 获取招聘会信息
|
|
const jobFairInfo = ref({})
|
|
const jobFairInfo = ref({})
|
|
@@ -42,11 +47,11 @@ const getJobFairInfo = async () => {
|
|
jobFairInfo.value = data || {}
|
|
jobFairInfo.value = data || {}
|
|
}
|
|
}
|
|
|
|
|
|
-// 获取招聘会职位
|
|
|
|
|
|
+// 招聘中职位
|
|
const jobFairPosition = ref([])
|
|
const jobFairPosition = ref([])
|
|
-const getJobFairPositionList = async () => {
|
|
|
|
|
|
+const getJobList = async () => {
|
|
try {
|
|
try {
|
|
- uni.showLoading({ title: '加载中' })
|
|
|
|
|
|
+ uni.showLoading({ title: '加载中' })
|
|
const { data } = await getJobFairPosition(id.value)
|
|
const { data } = await getJobFairPosition(id.value)
|
|
if (!data || !data.length) {
|
|
if (!data || !data.length) {
|
|
jobFairPosition.value = []
|
|
jobFairPosition.value = []
|
|
@@ -58,6 +63,57 @@ const getJobFairPositionList = async () => {
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+// 已关闭职位
|
|
|
|
+const more = ref('more')
|
|
|
|
+const pageTotal = ref(0)
|
|
|
|
+const pageInfo = ref({
|
|
|
|
+ pageSize: 10,
|
|
|
|
+ pageNo: 1
|
|
|
|
+})
|
|
|
|
+const getProgressJobList = async () => {
|
|
|
|
+ if (pageInfo.value.pageNo < 1) return
|
|
|
|
+ if (pageInfo.value.pageNo === 1) jobFairPosition.value = []
|
|
|
|
+ try {
|
|
|
|
+ more.value = 'loading'
|
|
|
|
+ const res = await getJobAdvertisedList({ ...pageInfo.value, status: '1', jobFairId: id.value, hire: false })
|
|
|
|
+ const list = res?.data?.list?.length ? res.data.list : []
|
|
|
|
+ pageTotal.value = res.data.total-0
|
|
|
|
+ if (!list?.length) {
|
|
|
|
+ more.value = 'noMore'
|
|
|
|
+ return
|
|
|
|
+ }
|
|
|
|
+ jobFairPosition.value.push(...dealDictArrayData([], list))
|
|
|
|
+ more.value = 'more'
|
|
|
|
+ if (jobFairPosition.value.length === pageTotal.value) {
|
|
|
|
+ more.value = 'noMore'
|
|
|
|
+ return
|
|
|
|
+ }
|
|
|
|
+ } catch (error) {
|
|
|
|
+ pageInfo.value.pageNo--
|
|
|
|
+ more.value = 'more'
|
|
|
|
+ }
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+// 加载更多
|
|
|
|
+const loadingMore = () => {
|
|
|
|
+ // 招聘中职位列表不需要加载更多,属于一次性拿回全部
|
|
|
|
+ if (tab.value === 0) return
|
|
|
|
+ if (more.value === 'noMore') return
|
|
|
|
+
|
|
|
|
+ more.value = 'loading'
|
|
|
|
+ pageInfo.value.pageNo++
|
|
|
|
+ getProgressJobList()
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+const tabChange = (e) => {
|
|
|
|
+ tab.value = e.currentIndex
|
|
|
|
+ jobFairPosition.value = []
|
|
|
|
+
|
|
|
|
+ if (tab.value === 0) return getJobList()
|
|
|
|
+ pageInfo.value.pageNo = 1
|
|
|
|
+ getProgressJobList()
|
|
|
|
+}
|
|
|
|
+
|
|
onLoad((options) => {
|
|
onLoad((options) => {
|
|
id.value = options.id
|
|
id.value = options.id
|
|
if (!id.value) {
|
|
if (!id.value) {
|
|
@@ -72,11 +128,19 @@ onLoad((options) => {
|
|
}
|
|
}
|
|
|
|
|
|
getJobFairInfo()
|
|
getJobFairInfo()
|
|
- getJobFairPositionList()
|
|
|
|
|
|
+ getJobList()
|
|
})
|
|
})
|
|
|
|
|
|
onShow(() => {
|
|
onShow(() => {
|
|
- if (id.value) getJobFairPositionList()
|
|
|
|
|
|
+ if (id.value) {
|
|
|
|
+ jobFairPosition.value = []
|
|
|
|
+ if (tab.value) {
|
|
|
|
+ pageInfo.value.pageNo = 1
|
|
|
|
+ getProgressJobList()
|
|
|
|
+ return
|
|
|
|
+ }
|
|
|
|
+ getJobList()
|
|
|
|
+ }
|
|
})
|
|
})
|
|
|
|
|
|
// 加入招聘会
|
|
// 加入招聘会
|