Sfoglia il codice sorgente

沟通-面试邀请

Xiao_123 1 mese fa
parent
commit
e66ace5917
2 ha cambiato i file con 59 aggiunte e 14 eliminazioni
  1. 32 10
      pagesA/chart/index.vue
  2. 27 4
      pagesB/InviteInterview/index.vue

+ 32 - 10
pagesA/chart/index.vue

@@ -54,6 +54,26 @@
               </div>
             </view>
           </template>
+          <!-- 面试邀请 -->
+          <template v-if="val.payload?.type === 101">
+            <view class="jobCard color-primary">
+              <view class="font-size-15 ss-m-b-20">面试邀请</view>
+              <view class="jobCard-title"> {{ formatName(val.payload?.content?.positionInfo?.data?.name) }}</view>
+              <view
+                v-if="!val.payload?.content?.positionInfo?.data?.payFrom && !val.payload?.content?.positionInfo?.data?.payTo"
+                class="jobCard-subtitle">
+                薪酬待遇: 面议
+              </view>
+              <view v-else class="jobCard-subtitle">
+                薪酬待遇: 
+                {{ val.payload?.content?.positionInfo?.data?.payFrom ? val.payload?.content?.positionInfo?.data?.payFrom + ' - ' : '' }}
+                {{ val.payload?.content?.positionInfo?.data?.payTo }}
+              </view>
+              <view class="font-size-15">面试时间: {{ timesTampChange(val.payload?.content?.time) }}</view>
+              <view class="font-size-15">面试地点: {{ val.payload?.content?.address }}</view>
+              <view class="font-size-15">联系电话: {{ val.payload?.content?.invitePhone }}</view>
+            </view>
+          </template>
           <view :class="['message-view_item', val.from_uid === IM.uid ? 'is-self' : 'is-other']">
             <view class="image">
               <image
@@ -116,10 +136,10 @@
       </scroll-view>
       
     <view class="box-bottom" v-if="channelItem?.channelID !== 'system'">
-      <!-- <view class="box-bottom-tool" style="display: flex; justify-content: start;">
+      <view class="box-bottom-tool" style="display: flex; justify-content: start;">
         <text class="toolBtn" @tap="handleFindResume">求简历</text>
-        <text class="toolBtn ss-m-l-10" @tap="handleInviteInterview">面试邀约</text>
-      </view> -->
+        <text class="toolBtn ss-m-l-30" @tap="handleInviteInterview">面试邀约</text>
+      </view>
       
       <view class="d-flex align-end textBox" v-if="channelItem?.channelID !== 'system'">
         <textarea
@@ -273,7 +293,6 @@ const handleFindResume = async () => {
 }
 
 // 邀约面试
-const invitePopup = ref()
 const handleInviteInterview = () => {
   if (!getAccessToken()) {
     showAuthModal()
@@ -288,11 +307,14 @@ const handleInviteInterview = () => {
 		})
 		return
 	}
-  console.log(info.value, '邀请面试', jobList.value, invitePopup.value)
-  invitePopup.value.open()
-	// uni.navigateTo({
-	//   url: `/pagesB/InviteInterview/index?id=${info.value.id}`
-	// })
+
+  const chartData = {
+    ...channelItem.value,
+    id: info.value.id
+  }
+	uni.navigateTo({
+	  url: `/pagesB/InviteInterview/index?chartData=${encodeURIComponent(JSON.stringify(chartData))}`
+	})
 }
 
 // 预览简历
@@ -339,7 +361,7 @@ onLoad(async (options) => {
   }
   await init(info.value.id, info.value.enterpriseId)
 
-  // await getJobList() // 获取招聘中的职位
+  await getJobList() // 获取招聘中的职位
 
   // 清除未读消息
   resetUnread(channelItem.value, userInfo.value?.enterpriseId)

+ 27 - 4
pagesB/InviteInterview/index.vue

@@ -30,6 +30,7 @@ import { getJobAdvertised } from '@/api/new/position'
 import { formatName } from '@/utils/getText'
 import { getInterviewInviteDefaultTime } from '@/utils/date'
 import { saveInterviewInvite } from '@/api/interview'
+import { send } from '@/hooks/useIM'
 
 const formRef = ref(null)
 const useUserStore = userStore()
@@ -61,22 +62,27 @@ const jobList = ref([])
 const getJobList = async (jobId) => {
   const { data } = await getJobAdvertised({ status: 0 })
   jobList.value = data.map(e => {
-    return { text: formatName(e.name), value: e.id, ...e }
+    return { text: formatName(e.name), value: e.id, data: e }
   })
+
 	// 有职位id的则默认选中
 	if (jobId) {
 		formData.value.jobId = jobId
-		formData.value.address = jobList.value.find(item => item.value === jobId)?.address
+		formData.value.address = jobList.value.find(item => item.value === jobId)?.data.address
 		jobDisabled.value = true
 	}
 }
 
-const handleChangeJob = (e) =>{
+const handleChangeJob = (e) => {
 	const job = jobList.value.find(item => item.value === e)
 	if (!job) return
-	formData.value.address = job.address
+	formData.value.address = job.data.address
+
+	// 沟通-面试邀请需携带职位信息
+	if (channerl.value && Object.keys(channerl.value).length > 0) formData.value.positionInfo = job
 }
 
+const channerl = ref({})
 onLoad(async (options) => {
 	// 编辑面试、重新邀约
 	if (options?.editData) {
@@ -95,6 +101,18 @@ onLoad(async (options) => {
 		return
 	}
 
+	// 沟通-面试邀请
+	if (options?.chartData) {
+		const obj = JSON.parse(decodeURIComponent(options.chartData))
+		formData.value.userId = obj.id
+		channerl.value = {
+			channelID: obj.channelID,
+			channelType: obj.channelType
+		}
+		await getJobList()
+		return
+	}
+
 	const { id, jobId } = options
 	if (!id) {
 		uni.showToast({
@@ -119,11 +137,16 @@ const handleSubmit = async () => {
 	uni.showLoading({ title: '提交中' })
 	try {
 		await saveInterviewInvite(formData.value)
+		
+		// 从沟通过来的需要发消息
+		if (channerl.value && Object.keys(channerl.value).length > 0) send(JSON.stringify(formData.value), channerl.value, 101)
+		
 		uni.hideLoading()
 		uni.showToast({
 			title: '提交成功',
 			icon: 'success'
 		})
+		channerl.value = {}
 		setTimeout(() => {
 			uni.navigateBack({ delta: 1 })
 		}, 1000)