浏览代码

招聘会-选择已发布的职位加入到招聘会

Xiao_123 2 月之前
父节点
当前提交
22d90003d3
共有 4 个文件被更改,包括 249 次插入3 次删除
  1. 26 0
      api/jobFair.js
  2. 6 0
      pages.json
  3. 13 3
      pagesB/jobFair/details.vue
  4. 204 0
      pagesB/jobFair/join.vue

+ 26 - 0
api/jobFair.js

@@ -77,6 +77,19 @@ export const quitJobFairPosition = (data) => {
   })
 }
 
+// 企业将职位加入招聘会
+export const joinJobFairPosition = (data) => {
+  return request({
+    url: '/app-api/menduner/system/recruit/job-fair/join',
+    method: 'POST',
+    data,
+    custom: {
+      showLoading: false,
+      auth: true
+    }
+  })
+}
+
 // 保存分享参数
 export const saveShareQuery = (data) => {
   return request({
@@ -102,3 +115,16 @@ export const getShareQueryById = (params) => {
     }
   })
 }
+
+// 根据招聘会id获取未加入招聘会的职位列表
+export const getJobFairPositionList = (params) => {
+  return request({
+    url: '/app-api/menduner/system/recruit/job-fair/get/not-joined-job/page',
+    method: 'GET',
+    params,
+    custom: {
+      showLoading: false,
+      auth: true
+    }
+  })
+}

+ 6 - 0
pages.json

@@ -178,6 +178,12 @@
 						"navigationBarTitleText": "招聘会详情"
 					}
 				},
+				{
+					"path": "jobFair/join",
+					"style": {
+						"navigationBarTitleText": "职位加入到招聘会"
+					}
+				},
 				{
 					"path": "jobFair/jobFairEntShare",
 					"style": {

+ 13 - 3
pagesB/jobFair/details.vue

@@ -13,7 +13,7 @@
 		<view class="bottom-sticky">
 			<view class="bottom-content">
 				<button class="btnStyle bgButtons ss-m-l-15" type="primary" plain="true">我的分享海报</button>
-        <button class="buttons btnStyle" type="primary">职位加入</button>
+        <button class="buttons btnStyle" type="primary" @tap="handleJoinJobFair">职位加入</button>
       </view>
 		</view>
 	</view>
@@ -21,7 +21,7 @@
 
 <script setup>
 import { ref } from 'vue'
-import { onLoad } from '@dcloudio/uni-app'
+import { onLoad, onShow } from '@dcloudio/uni-app'
 import { getJobFair, getJobFairPosition } from '@/api/jobFair.js'
 import { dealDictArrayData } from '@/utils/position.js'
 import JobItem from './jobItem.vue'
@@ -61,9 +61,19 @@ onLoad((options) => {
 	}
 
 	getJobFairInfo()
-	console.log('onLoad')
 	getJobFairPositionList()
 })
+
+onShow(() => {
+	if (id.value) getJobFairPositionList()
+})
+
+// 加入招聘会
+const handleJoinJobFair = () => {
+  uni.navigateTo({
+		url: '/pagesB/jobFair/join?jobFairId=' + id.value
+	})
+}
 </script>
 
 <style scoped lang="scss">

+ 204 - 0
pagesB/jobFair/join.vue

@@ -0,0 +1,204 @@
+<template>
+	<view class="box defaultBgc">
+		<view style="background-color: #fff;">
+			<uni-search-bar
+        v-model="query.name"
+        radius="5"
+        placeholder="输入关键字"
+        cancelButton="none"
+        :focus="false"
+				@clear="handleSearch"
+        @confirm="handleSearch"
+      ></uni-search-bar>
+		</view>
+		
+		<scroll-view class="scrollBox ss-m-t-20" :scroll-y="true" @scrolltolower="loadingMore" style="position:relative;">
+			<view v-for="(item, index) in items" :key="index" class="mList  ss-m-x-20">
+        <view class="list-shape" style="border-radius: 12px;">
+          <view>
+						<view class="titleBox">
+							<view style="display: flex;align-items: center;">
+								<rich-text v-if="item.name?.indexOf('style') !== -1" class="job-name" :nodes="item.name"></rich-text>
+								<view v-else class="job-name">{{ formatName(item.name) }}</view>
+							</view>
+						</view>
+						<view class="d-flex align-center justify-space-between ss-m-t-20">
+							<view class="font-size-13 ellipsis" style="flex: 1;">
+								<span class="tag-gap" style="color: #808080;">
+									<span>{{item.area?.str ?? '全国' }}</span>
+									<span class="divider-mx" v-if="item.eduName">|</span>
+									<span>{{item.eduName }}</span>
+									<span class="divider-mx" v-if="item.expName">|</span>
+									<span>{{item.expName }}</span>
+									<span class="divider-mx">|</span>
+									<span>{{!item.payFrom && !item.payTo ? '面议' : `${item.payFrom}-${item.payTo}${item.payName ? '/' + item.payName : ''}` }}</span>
+								</span>
+							</view>
+						</view>
+					</view>
+          <view class="sub-li-bottom">
+						<view class="sub-li-bottom-item" @tap.stop="handleJoin(item)">添加至招聘会</view>
+          </view>
+        </view>
+      </view>
+			<uni-load-more :status="more" />
+		</scroll-view>
+	</view>
+</template>
+
+<script setup>
+import { ref } from 'vue'
+import { onLoad } from '@dcloudio/uni-app'
+import { formatName } from '@/utils/getText.js'
+import { joinJobFairPosition, getJobFairPositionList } from '@/api/jobFair.js'
+import { dealDictArrayData } from '@/utils/position'
+
+const query = ref({
+	pageSize: 10,
+	pageNo: 1,
+	name: null,
+	jobFairId: null
+})
+const items = ref([])
+const more = ref('more')
+const total = ref(0)
+
+const getData = async () => {
+  try {
+		more.value = 'loading'
+		const { data } = await getJobFairPositionList(query.value)
+
+		if (!data.list.length) {
+			more.value = 'noMore'
+			items.value = []
+			total.value = 0
+			return
+		}
+
+		const list = dealDictArrayData([], data.list)
+		items.value = items.value.concat(list)
+		total.value = data.total
+
+		if (items.value.length === +data.total) {
+      more.value = 'noMore'
+      return
+    }
+	} catch {
+		query.value.pageNo--
+		more.value = 'more'
+	}
+}
+
+// 关键字搜索
+const handleSearch = () => {
+	total.value = 0
+	items.value = []
+	query.value.pageNo = 1
+	getData()
+}
+
+// 加载更多
+const loadingMore = () => {
+	if (more.value === 'noMore') return
+
+  more.value = 'loading'
+  query.value.pageNo++
+	getData()
+}
+
+onLoad(async (options) => {
+	query.value.jobFairId = options.jobFairId
+
+	query.value.pageNo = 1
+	await getData()
+})
+
+// 加入职位
+const handleJoin = async (item) => {
+	uni.showLoading({ title: '加载中' })
+	try {
+		await joinJobFairPosition({ jobId: item.id, jobFairId: query.value.jobFairId })
+		uni.hideLoading()
+		uni.showToast({ title: '加入成功', icon: 'success' })
+
+		setTimeout(() => {
+			uni.navigateBack({ delta: 1 })
+		}, 1000)
+	} catch (e) {
+		uni.hideLoading()
+		uni.showToast({ title: e.message })
+	}
+}
+</script>
+
+<style scoped lang="scss">
+.box {
+  height: 100vh;
+  overflow: hidden;
+  box-sizing: border-box;
+  display: flex;
+  flex-direction: column;
+}
+.scrollBox{
+	flex: 1;
+  padding-bottom: 24rpx;
+  box-sizing: border-box;
+	height: 0 !important;
+}
+.stickFilter {
+  z-index: 1;
+  position: sticky;
+  box-shadow: 0px 10rpx 12rpx 0px rgba(195, 195, 195, .25);
+  top: 110rpx;
+	background-color: #fff;
+}
+.job-name {
+  font-size: 16px;
+  font-weight: 700;
+  color: #0E100F;
+  max-width: 80vw;
+  overflow: hidden;
+  white-space: nowrap;
+  text-overflow: ellipsis;
+}
+
+.sub-li-bottom {
+  display: flex;
+  justify-content: space-between;
+  margin-top: 10px;
+  padding-top: 10px;
+  font-size: 13px;
+  color: #00B760;
+	&-item {
+		width: 100%;
+		height: 35px;
+		line-height: 35px;
+		text-align: center;
+		background-color: #f7f8fa;
+		border-radius: 4px;
+	}
+}
+
+.list-shape {
+	padding: 10px 30rpx 10px;
+  background-color: #fff;
+  border-radius: 12px 12px 0 0;
+  .titleBox {
+    display: flex;
+    align-items: center;
+    justify-content: space-between;
+  }
+}
+.tag-gap{
+	margin: 10rpx 10rpx 10rpx 0;
+}
+.divider-mx{
+	margin: 0 10rpx;
+}
+.divider {
+	color:#e4d4d2;
+}
+.mList {
+  margin-bottom: 20rpx;
+}
+</style>