index.vue 31 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012
  1. <template>
  2. <view class="box">
  3. <view class="box-top">
  4. <view class="box-top-title">
  5. {{ info.name }}
  6. <text class="subText">
  7. {{ info?.postName && info?.postName !== 'null' && info?.postName !== 'undefined' ? info.postName : '' }}
  8. <text v-if="info?.postName && info?.postName !== 'null' && info?.postName !== 'undefined' && info.enterpriseName" class="gun">|</text>
  9. {{ formatName(info.enterpriseName) }}
  10. </text>
  11. </view>
  12. <!-- <view class="box-top-content" v-if="interview.length">
  13. <view v-for="val in interview" :key="val.id" class="color-666">
  14. <view class="box-top-content-t">
  15. <view class="font-weight-bold color-primary">
  16. <text>{{ val.job.name }}</text>
  17. <text v-if="!val.job.payFrom && !val.job.payTo" class="ml-3">面议</text>
  18. <text v-else class="ml-3">{{ val.job.payFrom ? val.job.payFrom + '-' : '' }}{{ val.job.payTo }}</text>
  19. </view>
  20. <view :style="`color: ${val.statusColor};`" >
  21. {{ val.statusText }}
  22. </view>
  23. </view>
  24. <view class="mt-1 font-size-14 ellipsis" style="max-width: 100%;">
  25. <view class="py-1">面试时间:{{ timesTampChange(val.time, 'Y-M-D h:m') }}</view>
  26. <view class="py-1">面试地点:{{ val.address }}</view>
  27. <view class="py-1">联系电话:{{ val.invitePhone }}</view>
  28. </view>
  29. <view class="bottom">
  30. <view class="tipsText" @click="handleToCenter">在“个人中心-面试”中管理我的面试</view>
  31. <view v-if="val.status === '0'" class="btnBox">
  32. <button size="mini" type="warn" @click="handleRefuse(val)">拒绝邀请</button>
  33. <button size="mini" type="primary" @click="handleAgree(val)">接受邀请</button>
  34. </view>
  35. </view>
  36. </view>
  37. </view> -->
  38. <uni-notice-bar v-if="hasWaitingProcessingInterview" show-get-more single text="您有待处理的面试邀请,点击查看详情" @click="handleToCenter"/>
  39. </view>
  40. <!-- newsId 需要和聊天列表里面的id对应 永远取最后列表中的最后一个就可以做到发送消息即时滚动到底部 -->
  41. <scroll-view ref="chatRef" :scroll-with-animation="scrollAnimation" :scroll-into-view="newsId" class="box-main" scroll-y="true">
  42. <view class="box-main-more" v-if="hasMore">
  43. <text @click="handleMore">查看更多</text>
  44. </view>
  45. <view v-for="(val, index) in items" :key="val.id" :id="'s'+val.id+index">
  46. <view class="box-main-time">{{ timesTampChange(+(val.timestamp.padEnd(13, '0'))) }}</view>
  47. <template v-if="val.payload?.type === 102">
  48. <view class="jobCard">
  49. <!-- <view style="display: flex;">
  50. <image v-if="info.jobFairId" src="/static/svg/jobFair.svg" class=" ss-m-r-10" style="width: 20px; height: 20px;"></image>
  51. </view> -->
  52. <view class="jobCard-title"> {{ formatName(val.payload?.content?.positionInfo?.name) }}</view>
  53. <view
  54. v-if="!val.payload?.content?.positionInfo?.payFrom && !val.payload?.content?.positionInfo?.payTo"
  55. class="jobCard-subtitle">
  56. 薪酬待遇: 面议
  57. </view>
  58. <view
  59. v-else
  60. class="jobCard-subtitle"
  61. >
  62. 薪酬待遇:
  63. {{ val.payload?.content?.positionInfo?.payFrom ? val.payload?.content?.positionInfo?.payFrom + ' - ' : '' }}
  64. {{ val.payload?.content?.positionInfo?.payTo }}
  65. </view>
  66. <view class="jobCard-tag">
  67. <view
  68. v-for="(v, i) in (val.payload?.content?.positionInfo?.enterprise?.welfareList || [])"
  69. :key="val.message_id + v + i"
  70. style="margin: 10rpx"
  71. >
  72. <uni-tag
  73. :text="v"
  74. type="success"
  75. />
  76. </view>
  77. </view>
  78. <view class="jobCard-divider"></view>
  79. <view class="jobCard-subtitle text-right">
  80. <v-avatar size="24">
  81. <v-img :src="val.payload?.content?.positionInfo?.contact?.avatar"></v-img>
  82. </v-avatar>
  83. {{ val.payload?.content?.positionInfo?.contact?.name }}
  84. {{ val.payload?.content?.positionInfo?.contact?.postNameCn }}
  85. {{ formatName(val.payload?.content?.positionInfo?.enterprise?.anotherName || val.payload?.content?.positionInfo?.enterprise?.name) }}
  86. </view>
  87. <div class="jobCard-subtitle text-right">
  88. 地址:{{ val.payload?.content?.positionInfo?.address }}
  89. </div>
  90. </view>
  91. </template>
  92. <view :class="['message-view_item', val.from_uid === IM.uid ? 'is-self' : 'is-other']">
  93. <view class="image">
  94. <image
  95. :data-target="getUserAvatar(info.avatar, info.sex, info.channelID === 'system' ? true : false)"
  96. class="header"
  97. :src="(
  98. val.from_uid === IM.uid ?
  99. getUserAvatar(useUserStore.baseInfo?.avatar, useUserStore.baseInfo?.sex) :
  100. getUserAvatar(info.avatar, info.sex, info.channelID === 'system' ? true : false)
  101. )"
  102. ></image>
  103. </view>
  104. <!-- 显示沟通职位 -->
  105. <template v-if="val.payload?.type === 102">
  106. <view class="message-text" :class="val.from_uid === IM.uid ? 'active' : ''">
  107. {{ val.payload?.content.text }}
  108. </view>
  109. </template>
  110. <!-- 发起面试邀请 -->
  111. <view class="message-text none" v-else-if="val.payload?.type === 101">
  112. <uni-tag text="发起了面试邀请" custom-style="background-color: #00B760; border-color: #00B760; color: #fff;" />
  113. </view>
  114. <view class="message-text none" v-else-if="val.payload?.type === 103">
  115. <uni-tag text="拒绝了面试邀请" type="error" />
  116. </view>
  117. <view class="message-text none" v-else-if="val.payload?.type === 104">
  118. <uni-tag text="接受了面试邀请" custom-style="background-color: #00B760; border-color: #00B760; color: #fff;" />
  119. </view>
  120. <view v-else-if="val.payload.type === 105" class="text-end">
  121. <uni-tag
  122. v-if="val.from_uid === IM.uid"
  123. :text="val.payload.content?.type === 1 ? '附件简历已发送' : '简历请求已发送'"
  124. custom-style="background-color: #00B760; border-color: #00B760; color: #fff;"
  125. />
  126. <view
  127. v-if="val.payload.content?.type !== 2 || val.from_uid !== IM.uid"
  128. class="message-text card"
  129. >
  130. <view class="text-left">
  131. <text v-if="val.payload.content?.type === 1">{{
  132. val.payload.content?.query?.title || '附件简历' }}
  133. </text>
  134. <text v-if="val.payload.content?.type === 2">
  135. 我想要一份您的简历,您是否同意
  136. </text>
  137. </view>
  138. <view class="btn-actions">
  139. <text class="btn" v-if="val.payload.content?.type === 1" @tap="handlePreview(val.payload)">点击预览附件简历</text>
  140. <text class="btn" v-if="val.payload.content?.type === 2" @tap="handleFindResume">点击发送附件简历</text>
  141. </view>
  142. </view>
  143. </view>
  144. <view v-else-if="val.payload.type === -1" class="message-text" :class="{ active: val.from_uid === IM.uid}">
  145. {{ val.payload?.content?.text }}
  146. </view>
  147. <view v-else class="message-text" :class="{ active: val.from_uid === IM.uid}">
  148. {{ val.payload?.content }}
  149. </view>
  150. </view>
  151. </view>
  152. </scroll-view>
  153. <view class="box-bottom" v-if="channelItem?.channelID !== 'system'">
  154. <view class="box-bottom-tool" style="display: flex; justify-content: space-between;">
  155. <text class="toolBtn" :class="{ disabled: !isSendResume }" @tap="handleFindResume">{{ isSendResume ? '简历已投递' : '发送简历' }}</text>
  156. <!-- <uni-tag :text="isSendResume ? '简历已投递' : '发送简历'" :disabled="isSendResume" type="success" @tap="handleFindResume"/> -->
  157. <!-- <uni-tag text="发 送" type="success" @tap="handleSend"/> -->
  158. </view>
  159. <view class="d-flex align-end textBox" v-if="channelItem?.channelID !== 'system'">
  160. <textarea
  161. v-model="inputValue"
  162. :cursor-spacing="25"
  163. :show-confirm-bar="false"
  164. :disable-default-padding="true"
  165. confirm-type="send"
  166. auto-height
  167. @confirm="handleSend"
  168. />
  169. <text class="submitBtn" @tap="handleSend">发 送</text>
  170. </view>
  171. </view>
  172. <uni-popup ref="positionPopup" background-color="#fff">
  173. <view style="max-width: 85vw;">
  174. <view class="popup-title" style="min-width: 260px;">
  175. <text>请选择要投递的职位</text>
  176. <uni-icons type="closeempty" size="20" @tap="positionPopupClose"></uni-icons>
  177. </view>
  178. <view v-for="job in entPositionList" :key="job.value" class="popup-content" @tap="selectJobId = job.value">
  179. <view class="iconBox">
  180. <uni-icons
  181. v-show="selectJobId === job.value"
  182. type="checkmarkempty"
  183. size="20"
  184. :color="selectJobId === job.value ? '#43AC57' : '#999'"></uni-icons>
  185. </view>
  186. <text class="text" :class="selectJobId === job.value ? 'active' : ''">{{ job.label }}</text>
  187. </view>
  188. <view v-if="entPositionTotal > 5" class="popup-upload ss-m-x-30" @click="changePositionData">
  189. <text style="color: #43AC57;">{{ entPositionListLastData ? '没有更多职位了~ 再选一遍' : '换一批'}}</text>
  190. </view>
  191. </view>
  192. <view class="popup-actions">
  193. <button class="default" type="default" @click="selectPositionSubmit">确认</button>
  194. </view>
  195. </uni-popup>
  196. <uni-popup ref="popup" background-color="#fff">
  197. <view class="popup-title" style="min-width: 260px;">
  198. <text>发送简历选择</text>
  199. <uni-icons type="closeempty" size="20" @tap="handleClose"></uni-icons>
  200. </view>
  201. <view v-if="isStudent" class="ss-p-x-50" style="width: 272px;">
  202. <studentDeliveryForm ref="studentDeliveryFormRef" prefix="实习" formLabelWidth="110px" />
  203. </view>
  204. <view v-for="resume in resumeList" :key="resume.id" class="popup-content" @tap="resumeCheck = resume">
  205. <view class="iconBox">
  206. <uni-icons
  207. v-show="resumeCheck.id === resume.id"
  208. type="checkmarkempty"
  209. size="20"
  210. :color="resumeCheck.id === resume.id ? '#43AC57' : '#999'"></uni-icons>
  211. </view>
  212. <text class="text" :class="resumeCheck.id === resume.id ? 'active' : ''">{{ resume.title }}</text>
  213. </view>
  214. <view v-if="!resumeList.length" class="popup-upload" @click="handleUploadResume">
  215. <view class="popup-upload-box">
  216. <uni-icons type="plusempty" size="50" color="#f1f1f1"></uni-icons>
  217. </view>
  218. <text>温馨提示:您还未上传过简历,点击选取微信聊天文件投递。请在手机上打开此小程序进行文件上传,暂不支持在桌面版小程序中上传文件。</text>
  219. </view>
  220. <view v-if="resumeList.length" class="popup-actions">
  221. <button class="default" type="default" @click="handleSendResume">发送简历</button>
  222. </view>
  223. </uni-popup>
  224. <!-- <uni-popup ref="confirm" type="dialog">
  225. <uni-popup-dialog
  226. :type="isAgree ? 'success' : 'warn'"
  227. cancelText="取消"
  228. confirmText="确认"
  229. title="系统提示"
  230. :content="isAgree ? '确认接受面试吗?' : '确认拒绝面试吗?'"
  231. @confirm="handleConfirm"
  232. @close="handleCloseConfirm"
  233. ></uni-popup-dialog>
  234. </uni-popup> -->
  235. </view>
  236. </template>
  237. <script setup>
  238. import { ref, watch, onMounted, computed } from 'vue'
  239. import { onLoad } from '@dcloudio/uni-app'
  240. import { useIMStore } from '@/store/im'
  241. import { userStore } from '@/store/user'
  242. import { initConnect, send, initChart, getMoreMessages, toChannel } from '@/hooks/useIM'
  243. import { getDict } from '@/hooks/useDictionaries'
  244. import { timesTampChange } from '@/utils/date'
  245. import { getUserAvatar } from '@/utils/avatar'
  246. import { formatName } from '@/utils/getText'
  247. import { preview } from '@/utils/preview'
  248. import { getPersonResumeCv, saveResume } from '@/api/user'
  249. import { uploadFile } from '@/api/file'
  250. import { getInterviewInviteListByInviteUserId, getMessageType } from '@/api/common'
  251. // import { userInterviewInviteReject } from '@/api/personalCenter'
  252. import {
  253. getJobAdvertisedSearch,
  254. jobCvRelSend,
  255. jobCvRelCheckSend,
  256. jobCvRelHireSend
  257. } from '@/api/position'
  258. import studentDeliveryForm from '@/components/studentDeliveryForm'
  259. const useUserStore = userStore()
  260. const IM = useIMStore()
  261. const info = ref({})
  262. const chatRef = ref()
  263. const items = ref([])
  264. const channelItem = ref(null)
  265. const hasMore = ref(false)
  266. const popup = ref()
  267. const resumeCheck = ref({})
  268. const resumeList = ref([]) // 简历列表
  269. const pageSize = ref(1)
  270. // 求职者面试列表
  271. const interview = ref([])
  272. // 求职端-获取求职者与当前邀请人的面试记录
  273. const statusList = ref([])
  274. const inputValue = ref('')
  275. // const isAgree = ref(false)
  276. // const confirm = ref()
  277. // const chooseInvite = ref(null)
  278. const newsId = ref('') // newsId 需要和聊天列表里面的id对应 永远取最后列表中的最后一个就可以做到发送消息即时滚动到底部
  279. const scrollAnimation = ref(false)
  280. const isSendResume = ref(false)
  281. const positionInfo = ref({})
  282. const isEmployment = ref('-1')
  283. // const isStudent = ref(false) // 已测试,待开放上线
  284. const isStudent = ref(useUserStore?.baseInfo?.type && Boolean(Number(useUserStore.baseInfo.type) === 1))
  285. onMounted(() => {
  286. setTimeout(() => {
  287. scrollAnimation.value = true
  288. }, 1500)
  289. })
  290. const {
  291. conversationList,
  292. // updateConversation,
  293. updateUnreadCount,
  294. // deleteConversations,
  295. resetUnread
  296. } = initConnect(async (successful) => {
  297. if (!successful) {
  298. uni.showToast({
  299. title: '发送失败',
  300. icon: 'none',
  301. mask: true,
  302. })
  303. return
  304. }
  305. inputValue.value = ''
  306. // chatRef.value.reset()
  307. // // 发送成功
  308. const { list } = await getMoreMessages(1, channelItem.value)
  309. // updateConversation()
  310. items.value = list.value
  311. // chatRef.value.scrollBottom()
  312. })
  313. watch(
  314. () => conversationList.value,
  315. async (val) => {
  316. if (!channelItem.value) {
  317. return
  318. }
  319. const { list } = await getMoreMessages(1, channelItem.value)
  320. if (list.value.length) {
  321. const item = list.value[list.value.length - 1]
  322. const arr = [101, 103, 104]
  323. if (arr.includes(item.payload?.type)) {
  324. getInterviewInviteList()
  325. }
  326. }
  327. items.value = list.value
  328. setScrollBottom()
  329. // 清除未读消息
  330. resetUnread(channelItem.value)
  331. },
  332. {
  333. deep: true,
  334. immediate: true
  335. }
  336. )
  337. async function init(userId, enterpriseId) {
  338. const { channel, list, more } = await initChart(userId, enterpriseId)
  339. hasMore.value = more
  340. channelItem.value = channel.value
  341. items.value = list.value
  342. setScrollBottom()
  343. }
  344. const setScrollBottom = () => {
  345. if (items.value?.length) {
  346. const lastOne = items.value[items.value.length-1]
  347. const index = items.value.length-1
  348. newsId.value = 's' + lastOne.id + index // newsId 需要和聊天列表里面的id对应 永远取最后列表中的最后一个就可以做到发送消息即时滚动到底部
  349. }
  350. }
  351. const hasWaitingProcessingInterview = ref(false) // 是否有待接受的面试邀请
  352. async function getInterviewInviteList () {
  353. if (!info.value.id) return
  354. const { data } = await getInterviewInviteListByInviteUserId(info.value.id)
  355. interview.value = data ? data.slice(0, 1).map(e => {
  356. const statusItem = statusList.value.find(_e => _e.value === e.status)
  357. const statusText = statusItem?.label || ''
  358. const statusColor = ['5', '98', '99'].includes(e.status)
  359. return {
  360. ...e,
  361. statusColor: statusColor ? '#FE574A' : '#0E8E80',
  362. statusText
  363. }
  364. }) : []
  365. hasWaitingProcessingInterview.value = interview.value.some(e => e.status === '0')
  366. }
  367. const getStatusList = async () => {
  368. try {
  369. const { data } = await getDict('menduner_interview_invite_status')
  370. if (data.data.length) {
  371. statusList.value = data.data
  372. }
  373. } catch (error) {
  374. }
  375. }
  376. function handleSend () {
  377. if (!inputValue.value) {
  378. uni.showToast({ title: '不能发送空白信息', icon: 'none' })
  379. return
  380. }
  381. send(inputValue.value, channelItem.value)
  382. }
  383. function handleToCenter () {
  384. uni.navigateTo({
  385. url: '/pagesA/interview/index?index=1'
  386. })
  387. }
  388. // 预览简历
  389. function handlePreview (payload) {
  390. if (!payload?.content?.query?.src) {
  391. uni.showToast({ title: '简历地址不存在', icon: 'none' })
  392. return
  393. }
  394. preview(payload.content.query.src)
  395. }
  396. // 关闭职位列表窗口
  397. function positionPopupClose () {
  398. positionPopup.value.close()
  399. }
  400. // 打开职位列表窗口
  401. function positionPopupOpen () {
  402. positionPopup.value.open('center')
  403. }
  404. // 选中职位并投递
  405. const selectJobId = ref('')
  406. const positionPopup = ref()
  407. const selectPositionSubmit = async () => {
  408. if (!selectJobId.value) return uni.showToast({ title: '请选择要投递的职位', icon: 'none', duration: 3000 })
  409. positionPopupClose()
  410. handleFindResume() // 打开简历列表选择
  411. }
  412. const pageLoading = ref(false)
  413. const entPositionTotal = ref(0)
  414. const entPositionList = ref([])
  415. const entPositionListParams = ref({ pageNo: 1, pageSize: 5 })
  416. const entPositionListLastData = computed(() => entPositionListParams.value.pageNo * entPositionListParams.value.pageSize >= entPositionTotal.value)
  417. // 职位列表
  418. const getRecruitPositionList = async () => {
  419. const enterpriseId = info.value?.enterpriseId || null
  420. if (!enterpriseId) return uni.showToast({ title: '访问企业错误!', icon: 'none', duration: 3000 })
  421. pageLoading.value = true
  422. const res = await getJobAdvertisedSearch({ ...entPositionListParams.value, enterpriseId })
  423. const { list = [], total: number = 0 } = res?.data || {}
  424. if (!list?.length) return uni.showToast({ title: '企业暂无招聘中的职位,无法进行投递!', icon: 'none', duration: 3000 })
  425. entPositionTotal.value = number
  426. entPositionList.value = list.map(j => {
  427. const e = j?.job || null
  428. if (!e) return e
  429. const salary = e.payFrom && e.payTo ? `${e.payFrom ? e.payFrom + '-' : ''}${e.payTo}${e.payName ? '/' + e.payName : ''}` : '面议'
  430. return {
  431. label: `${formatName(e.name)}_${e.areaName ? e.area?.str : '全国'} ${salary}`,
  432. value: e.id,
  433. data: e
  434. }
  435. }).filter(Boolean)
  436. setTimeout(() => { pageLoading.value = false }, 300)
  437. }
  438. const changePositionData = () => {
  439. entPositionListParams.value.pageNo = entPositionListLastData.value ? 1 : entPositionListParams.value.pageNo + 1
  440. selectJobId.value = ''
  441. getRecruitPositionList()
  442. }
  443. // 获取简历
  444. async function handleFindResume () {
  445. if (isSendResume.value) {
  446. return
  447. }
  448. // 没有基于职位接收到的沟通,弹出职位列表让求职者选择。否则无法投递简历。
  449. if (!positionInfo.value.id && !selectJobId.value) {
  450. await getRecruitPositionList()
  451. if (entPositionTotal.value) positionPopupOpen()
  452. return
  453. }
  454. try {
  455. // 获取简历列表
  456. const { data } = await getPersonResumeCv()
  457. if (data.length === 0) {
  458. uni.showToast({
  459. title: '您还未上传过简历,请先上传简历后再投递',
  460. icon: 'none',
  461. mask: true,
  462. duration: 3000
  463. })
  464. }
  465. resumeList.value = data || []
  466. resumeCheck.value = data && data.length ? data[0] : ''
  467. popup.value.open('center')
  468. } finally {
  469. uni.hideLoading()
  470. }
  471. }
  472. // 关闭简历窗口
  473. function handleClose () {
  474. popup.value.close()
  475. }
  476. const studentDeliveryFormRef = ref()
  477. // 发送简历
  478. async function handleSendResume () {
  479. if (!Object.keys(resumeCheck.value).length) {
  480. uni.showToast({ title: '请选择要投递的简历', icon: 'none' })
  481. return
  482. }
  483. let practice = null
  484. if (isStudent.value) {
  485. practice = await studentDeliveryFormRef.value.getQueryParams()
  486. if (!practice) return
  487. }
  488. const text = {
  489. remark: '发送简历',
  490. query: {
  491. src: resumeCheck.value.url,
  492. title: resumeCheck.value.title,
  493. id: resumeCheck.value.id,
  494. },
  495. type: 1
  496. }
  497. try {
  498. if (isEmployment.value !== '-1') {
  499. await jobCvRelHireSend({
  500. jobId: positionInfo.value.id || selectJobId.value,
  501. // ...(jobFairId && { jobFairId }),
  502. url: resumeCheck.value.url,
  503. recommendUserId: isEmployment.value,
  504. ...(practice && { practice }),
  505. })
  506. } else {
  507. await jobCvRelSend({
  508. jobId: positionInfo.value.id || selectJobId.value,
  509. // ...(jobFairId && { jobFairId }),
  510. title: resumeCheck.value.title,
  511. url: resumeCheck.value.url,
  512. type: positionInfo.value.hire ? 1 : 0,
  513. ...(practice && { practice }),
  514. })
  515. }
  516. isSendResume.value = true
  517. send (JSON.stringify(text), channelItem.value, 105)
  518. popup.value.close()
  519. } catch (error) {
  520. if (error?.msg === '该职位已投递') {
  521. isSendResume.value = true
  522. }
  523. popup.value.close()
  524. }
  525. }
  526. // 拒绝邀请
  527. // function handleRefuse (val) {
  528. // isAgree.value = false
  529. // chooseInvite.value = val
  530. // confirm.value.open()
  531. // }
  532. // 接受邀请
  533. // function handleAgree (val) {
  534. // isAgree.value = true
  535. // chooseInvite.value = val
  536. // confirm.value.open()
  537. // }
  538. // 确认
  539. // async function handleConfirm () {
  540. // // 拒绝
  541. // if (!isAgree.value) {
  542. // await userInterviewInviteReject(chooseInvite.value.id)
  543. // } else {
  544. // await userInterviewInviteReject(chooseInvite.value.id)
  545. // }
  546. // uni.showToast({ title: '操作成功', icon: 'none' })
  547. // send(JSON.stringify({ id: chooseInvite.value.id }), channelItem.value, isAgree.value ? 104 : 103)
  548. // }
  549. // 关闭
  550. // function handleCloseConfirm () {
  551. // confirm.value.close()
  552. // }
  553. // 查看更多
  554. async function handleMore () {
  555. try {
  556. uni.showLoading({
  557. title: '加载中...'
  558. })
  559. pageSize.value++
  560. const { list, more } = await getMoreMessages(pageSize.value, channelItem.value)
  561. items.value.unshift(...list.value)
  562. hasMore.value = more
  563. } finally {
  564. uni.hideLoading()
  565. }
  566. }
  567. // 上传简历
  568. function handleUploadResume () {
  569. wx.chooseMessageFile({
  570. count: 1,
  571. type: 'file',
  572. success (res) {
  573. // 限制文件上传大小
  574. const size = res.tempFiles[0].size
  575. if (size / (1024*1024) > 20) {
  576. uni.showToast({ icon: 'none', title: '文件大小不能超过20M' })
  577. return
  578. }
  579. const title = res.tempFiles[0].name
  580. const path = res.tempFiles[0].path
  581. const test = /\.(pdf|docx|doc)$/.test(title)
  582. if (!test) {
  583. uni.showToast({
  584. icon: 'none',
  585. title: '请上传pdf、doc、docx类型的文件',
  586. duration: 2000
  587. })
  588. return
  589. }
  590. //效验是否为支持的文件格式
  591. uploadFile(path, 'attachment').then(async (res) => {
  592. if (!res.data) {
  593. uni.showToast({
  594. title: '上传失败',
  595. icon: 'none'
  596. })
  597. return
  598. }
  599. await saveResume({ title, url: res.data })
  600. uni.showToast({
  601. title: '上传成功',
  602. icon: 'success'
  603. })
  604. handleFindResume()
  605. })
  606. }
  607. })
  608. }
  609. // 获取职位信息
  610. async function getMessageTypeSync () {
  611. try {
  612. const { data } = await getMessageType({
  613. fromUid: IM.uid,
  614. channelId: channelItem.value.channelID,
  615. type: 102,
  616. page: {
  617. current: 1,
  618. size: 1,
  619. orders: [
  620. { column: 'message_seq', asc: false }
  621. ]
  622. }
  623. })
  624. if (!data.records || !data.records.length) {
  625. return
  626. }
  627. const _item = data.records.pop()
  628. const _itemJSON = JSON.parse(_item.payload)
  629. const _content = JSON.parse(_itemJSON.content)
  630. positionInfo.value = _content.positionInfo
  631. const { data: check } = await jobCvRelCheckSend({ jobId: _content.positionInfo.id })
  632. isSendResume.value = check
  633. } catch (error) {
  634. console.log(345, error)
  635. }
  636. }
  637. // let jobFairId = ''
  638. onLoad(async (options) => {
  639. info.value = Object.keys(options).reduce((r, k) => {
  640. r[k] = decodeURIComponent(options[k])
  641. return r
  642. }, {})
  643. // jobFairId = info.value.jobFairId
  644. isEmployment.value = info.value.isEmployment
  645. channelItem.value = toChannel(info.value.channelID, info.value.channelType)
  646. if (channelItem.value.channelID === 'system') {
  647. const { list, more } = await getMoreMessages(1, channelItem.value)
  648. hasMore.value = more
  649. items.value = list.value
  650. setScrollBottom()
  651. // 清除未读消息
  652. resetUnread(channelItem.value)
  653. // 更新未读消息
  654. updateUnreadCount()
  655. return
  656. }
  657. await init(info.value.id, info.value.enterpriseId)
  658. // 获取最新的职位信息
  659. await getMessageTypeSync(info.value.id)
  660. await getStatusList()
  661. getInterviewInviteList()
  662. // 清除未读消息
  663. resetUnread(channelItem.value)
  664. // 更新未读消息
  665. updateUnreadCount()
  666. })
  667. </script>
  668. <style lang="scss" scoped>
  669. .white {
  670. color: #FFF !important;
  671. }
  672. .text-left {
  673. text-align: left !important;
  674. }
  675. .text-right {
  676. text-align: right !important;
  677. }
  678. .box {
  679. width: 100%;
  680. height: 100vh;
  681. display: flex;
  682. flex-direction: column;
  683. &-top {
  684. &-title {
  685. padding: 0 60rpx;
  686. box-sizing: border-box;
  687. width: 100%;
  688. height: 80rpx;
  689. line-height: 80rpx;
  690. // text-align: center;
  691. border-bottom: 2rpx solid #EEE;
  692. overflow: hidden;
  693. white-space: nowrap;
  694. text-overflow: ellipsis;
  695. .subText {
  696. font-size: .85em;
  697. color: #999;
  698. .gun {
  699. padding: 0 10rpx;
  700. }
  701. }
  702. }
  703. &-content {
  704. padding: 20rpx 50rpx;
  705. padding-bottom: 20rpx;
  706. border-bottom: 2rpx solid #eee;
  707. .color-666 {
  708. color: #666;
  709. }
  710. .font-weight-bold {
  711. font-weight: bold;
  712. }
  713. .color-primary {
  714. color: #009688;
  715. }
  716. .ml-3 {
  717. margin-left: 40rpx;
  718. }
  719. .mt-1 {
  720. margin-top: 12rpx;
  721. }
  722. .font-size-14 {
  723. font-size: 24rpx;
  724. }
  725. .py-1 {
  726. padding: 4rpx 0;
  727. }
  728. .tipsText {
  729. font-size: .75em;
  730. color: #999;
  731. }
  732. &-t {
  733. display: flex;
  734. justify-content: space-between;
  735. }
  736. .btnBox {
  737. display: flex;
  738. padding: 20rpx 60rpx;
  739. justify-content: space-around;
  740. }
  741. }
  742. }
  743. &-main {
  744. flex: 1;
  745. height: 0;
  746. padding: 40rpx;
  747. // overflow-y: auto;
  748. box-sizing: border-box;
  749. &-more {
  750. display: flex;
  751. justify-content: center;
  752. align-items: center;
  753. color: #24bc3e;
  754. font-size: .9em;
  755. padding: 20rpx 0;
  756. }
  757. &-time {
  758. user-select: none;
  759. position: relative;
  760. top: 16rpx;
  761. margin: 40rpx 0;
  762. text-align: center;
  763. max-height: 40rpx;
  764. text-align: center;
  765. font-weight: 400;
  766. font-size: .85em;
  767. color: #999;
  768. }
  769. .jobCard {
  770. padding: 30rpx;
  771. background: #E2F2F0;
  772. color: #009688 ;
  773. margin-top: 20rpx;
  774. max-width: unset;
  775. margin-right: 0;
  776. &-title {
  777. font-size: 1.2em;
  778. }
  779. &-subtitle {
  780. padding: 10rpx 0;
  781. // font-size: .5em;
  782. }
  783. &-divider {
  784. width: 100%;
  785. height: 2rpx;
  786. margin: 20rpx 0;
  787. background: #ddd;
  788. }
  789. &-tag {
  790. display: flex;
  791. flex-wrap: wrap;
  792. }
  793. }
  794. .message-view_item {
  795. display: flex;
  796. flex-direction: row;
  797. align-items: flex-start;
  798. margin: 16rpx 0;
  799. position: relative;
  800. .image {
  801. width: 60rpx;
  802. height: 60rpx;
  803. border-radius: 180rpx;
  804. // flex-grow: 1;
  805. // flex-shrink: 0;
  806. overflow: hidden;
  807. .header {
  808. width: 60rpx;
  809. height: 60rpx;
  810. }
  811. }
  812. .text-end {
  813. text-align: right !important;
  814. width: 400rpx;
  815. margin-right: 20rpx;
  816. }
  817. .message-text {
  818. overflow-wrap: break-word;
  819. background-color: #f0f2f5;
  820. border-radius: 12rpx;
  821. max-width: 75%;
  822. padding: 20rpx;
  823. &.active {
  824. background: #d5e6e8;
  825. }
  826. &.card {
  827. background: #E2F2F0;
  828. color: #009688 ;
  829. margin-top: 20rpx;
  830. max-width: unset;
  831. margin-right: 0;
  832. .btn-actions {
  833. margin: 40rpx auto 20rpx auto ;
  834. text-align: center;
  835. .btn {
  836. padding: 10rpx 30rpx;
  837. background: #C8E7D8;
  838. color: #43AC57;
  839. font-size: .75em;
  840. border-radius: 10rpx;
  841. }
  842. }
  843. }
  844. &.none {
  845. padding: 10rpx 0;
  846. background-color: unset;
  847. }
  848. &.active {
  849. background: #d5e6e8;
  850. }
  851. }
  852. }
  853. .is-self {
  854. flex-direction: row-reverse;
  855. display: flex;
  856. .message-text {
  857. margin-right: 20rpx;
  858. }
  859. }
  860. .is-other {
  861. .message-text {
  862. margin-left: 20rpx;
  863. }
  864. }
  865. }
  866. &-bottom {
  867. max-height: 300rpx;
  868. border-top: 2rpx solid #EEE;
  869. background: rgba(230, 230, 230, 0.5);
  870. padding: 20rpx 40rpx;
  871. box-sizing: border-box;
  872. &-tool {
  873. margin-bottom: 30rpx;
  874. .toolBtn {
  875. padding: 12rpx 20rpx;
  876. font-size: 24rpx;
  877. background: #18bc37;
  878. color: #FFF;
  879. border-radius: 10rpx;
  880. }
  881. }
  882. .textBox {
  883. align-items: flex-end;
  884. }
  885. textarea {
  886. border-radius: 10rpx;
  887. width: 100%;
  888. min-height: 80rpx;
  889. max-height: 180rpx;
  890. padding: 20rpx;
  891. box-sizing: border-box;
  892. background: #FFF;
  893. }
  894. .submitBtn {
  895. width: 140rpx;
  896. line-height: 80rpx;
  897. height: 80rpx;
  898. font-size: 28rpx;
  899. background: #18bc37;
  900. color: #FFF;
  901. margin-left: 20rpx;
  902. text-align: center;
  903. border-radius: 10rpx;
  904. }
  905. }
  906. .popup-title {
  907. padding: 30rpx 20rpx;
  908. display: flex;
  909. justify-content: space-between;
  910. border-bottom: 2rpx solid #DDD;
  911. }
  912. .popup-content {
  913. padding: 20rpx 40rpx;
  914. color: #999;
  915. display: flex;
  916. align-content: center;
  917. justify-items: center;
  918. .iconBox {
  919. width: 40rpx;
  920. }
  921. .text {
  922. margin-left: 20rpx;
  923. &.active {
  924. color: #00B760;
  925. }
  926. }
  927. }
  928. .popup-upload {
  929. // display: flex;
  930. // align-items: center;
  931. // justify-content: center;
  932. // flex-direction: column;
  933. // width: 70%;
  934. width: 80vw;
  935. font-size: .75em;
  936. color: #999;
  937. padding: 40rpx;
  938. &-box {
  939. width: 200rpx;
  940. height: 200rpx;
  941. text-align: center;
  942. line-height: 200rpx;
  943. border: 4rpx solid #ddd;
  944. border-radius: 8rpx;
  945. margin: 0 auto;
  946. }
  947. }
  948. .popup-actions {
  949. padding: 60rpx;
  950. .default {
  951. background: #00B760;
  952. color: #DDD;
  953. font-size: .9em;
  954. }
  955. }
  956. }
  957. </style>