Quellcode durchsuchen

职位管理:克隆职位发布

Xiao_123 vor 7 Stunden
Ursprung
Commit
6df1e663e7
5 geänderte Dateien mit 59 neuen und 9 gelöschten Zeilen
  1. 6 0
      pages.json
  2. 2 2
      pages/index/position.vue
  3. 7 6
      pagesB/jobFair/join.vue
  4. 40 0
      pagesB/positionAdd/select.vue
  5. 4 1
      pagesB/positionEdit/index.vue

+ 6 - 0
pages.json

@@ -154,6 +154,12 @@
 						"navigationBarTitleText": "新增职位"
 					}
 				},
+				{
+					"path": "positionAdd/select",
+					"style": {
+						"navigationBarTitleText": "新增职位方式选择"
+					}
+				},
 				{
 					"path": "positionEdit/index",
 					"style": {

+ 2 - 2
pages/index/position.vue

@@ -76,6 +76,7 @@ const tabList = [
   // { label: '到期职位', value: 3 }
 ]
 const controlList = tabList.map(e => e.label)
+
 const tabChange = (e) => {
   tab.value = e.currentIndex
   query.value.pageNo = 1
@@ -141,7 +142,6 @@ onShow(() => {
 const publishJobCount = ref(0)
 const getPublishJobCount = async () => {
   const info = await useUserStore.getUserInfos()
-  console.log('info:', info)
   publishJobCount.value = info?.entitlement?.publishJobCount - 0 || 0
 }
 
@@ -179,7 +179,7 @@ const handleClickAdd = () => {
 		showAuthModal()
 		return
 	}
-  uni.navigateTo({ url: '/pagesB/positionAdd/index' })
+  uni.navigateTo({ url: '/pagesB/positionAdd/select' })
 }
 
 </script>

+ 7 - 6
pagesB/jobFair/join.vue

@@ -117,21 +117,22 @@ const loadingMore = () => {
 	getData()
 }
 
-const jobFairId = ref('')
+const jobFairId = ref(null)
 onLoad(async (options) => {
-	jobFairId.value = options.jobFairId
+	if (options && options?.jobFairId) jobFairId.value = options.jobFairId
 
 	query.value.pageNo = 1
 	await getData()
 })
 
-// 克隆职位-跳转招聘会职位编辑
+// 克隆职位-跳转职位编辑
 const handleJoin = async (item) => {
 	if (!item.id) return uni.showToast({ title: '缺少职位ID', icon: 'none' })
 
-	uni.navigateTo({
-		url: `/pagesB/jobFair/editJob?jobId=${item.id}&jobFairId=${jobFairId.value}&isClone=1`
-	})
+	const url = jobFairId.value ? 
+	`/pagesB/jobFair/editJob?jobId=${item.id}&jobFairId=${jobFairId.value}&isClone=1`
+	: `/pagesB/positionEdit/index?jobId=${item.id}&isClone=1`
+	uni.navigateTo({ url })
 }
 </script>
 

+ 40 - 0
pagesB/positionAdd/select.vue

@@ -0,0 +1,40 @@
+<template>
+  <view class="ss-p-50">
+    <uni-card class="ss-m-t-30" @tap="handleToAdd">
+      <view class="d-flex flex-column align-center ss-p-y-50">
+        <image src="https://minio.citupro.com/dev/static/clone.png" class="svg ss-m-l-10"></image>
+        <view class="color-primary text-center MiSans-Medium" style="font-size: 24px">填写职位信息发布</view>
+      </view>
+    </uni-card>
+    <uni-card class="ss-m-t-80" @tap="handleToClone">
+      <view class="d-flex flex-column align-center ss-p-y-50">
+        <image src="https://minio.citupro.com/dev/static/edit.png" class="svg ss-m-l-10"></image>
+        <view class="color-primary text-center MiSans-Medium" style="font-size: 24px">克隆已有职位发布</view>
+      </view>
+    </uni-card>
+  </view>
+</template>
+
+<script setup>
+// 克隆职位发布
+const handleToClone = () => {
+	uni.navigateTo({
+		url: '/pagesB/jobFair/join'
+	})
+}
+
+// 填写职位信息发布
+const handleToAdd = () => {
+	uni.reLaunch({
+		url: '/pagesB/positionAdd/index'
+	})
+}
+</script>
+
+<style lang="scss" scoped>
+.svg {
+  width: 80px;
+  height: 80px;
+  margin-bottom: 30px;
+}
+</style>

+ 4 - 1
pagesB/positionEdit/index.vue

@@ -1,6 +1,6 @@
 <template>
   <view>
-    <position :jobId="jobId"></position>
+    <position :jobId="jobId" :isClone="isClone"></position>
   </view>
 </template>
 <script setup>
@@ -9,12 +9,15 @@ import { onLoad } from '@dcloudio/uni-app'
 import position from '@/components/positionItem'
 
 const jobId = ref('')
+const isClone = ref(false)
 const props = defineProps({
   jobId: String
 })
 
 onLoad((options) => {
   jobId.value = options?.jobId || props.jobId || ''
+
+  if (options?.isClone) isClone.value = true
 })
 
 </script>