poster.vue 6.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187
  1. <!-- 分享职位 -->
  2. <template>
  3. <div style="background-color: #03877a;">
  4. <v-card class="pa-5" style="box-sizing: border-box; margin: 0 auto;width: 740px;background-color: #03877a;">
  5. <div v-if="!Object.keys(info).length">加载失败</div>
  6. <div v-else>
  7. <!-- 职位名称+薪资 -->
  8. <div class="d-flex justify-space-between mx-5">
  9. <h2 class="JobName ellipsis">{{ formatName(info.name) }}</h2>
  10. </div>
  11. <!-- 地区、工作经验、学历 -->
  12. <div class="d-flex justify-space-between mx-5 mt-2">
  13. <div class="banner-tags">
  14. <div v-for="(k, i) in desc" :key="k.mdi">
  15. <span>
  16. {{ k.value === 'areaName' ? !positionInfo.areaId ? '全国' : positionInfo.area?.str : positionInfo[k.value]}}
  17. </span>
  18. <span v-if="i !== desc.length - 1 && (positionInfo[k.value] || k.value === 'areaName')" class="septal-line"></span>
  19. </div>
  20. </div>
  21. <div>
  22. <span v-if="!info.payFrom && !info.payTo" class="salary">面议</span>
  23. <span v-else class="salary">{{ info.payFrom ? info.payFrom + '-' : '' }}{{ info.payTo }}{{ positionInfo.payName ? '/' + positionInfo.payName : '' }}</span>
  24. </div>
  25. </div>
  26. <!-- 企业信息 -->
  27. <div class="radius pa-3 mx-5 mt-5 d-flex align-center" style="background-color: #5baea6;">
  28. <v-avatar style="border: 2px solid #fff;" size="68">
  29. <img crossOrigin="anonymous" :src="info.enterprise.logoUrl" alt="" style="width: 68px; height: 68px;">
  30. </v-avatar>
  31. <div class="enterprise-name ml-5">{{ formatName(info.enterprise?.anotherName || info.enterprise?.name) }}</div>
  32. <!-- <div style="flex: 1;" class="text-right enterprise-name">
  33. {{ timesTampChange(positionInfo.refreshTime || positionInfo.updateTime, 'Y-M-D h:m') }}刷新
  34. </div> -->
  35. </div>
  36. <div class="mx-5 mt-3">
  37. <span :class="['tag', 'mb-1', { 'mr-5': i !== info.enterprise.welfareList.length - 1}]" v-for="(k, i) in info.enterprise.welfareList" :key="i">{{ k }}</span>
  38. </div>
  39. <!-- 岗位职责、岗位要求、二维码 -->
  40. <div class="white-bgc pa-5 mt-5 radius" style="position: relative;">
  41. <div v-if="info.content" class="resume-box pa-0 mb-5">
  42. <div class="resume-header">
  43. <div class="introduce-title">{{ $t('position.jobResponsibilities') }}</div>
  44. </div>
  45. <div class="requirement" v-html="cleanedHtml(info.content)"></div>
  46. </div>
  47. <div v-if="info.requirement" class="resume-box pa-0">
  48. <div class="resume-header">
  49. <div class="introduce-title">{{ $t('position.jobRequirements') }}</div>
  50. </div>
  51. <div class="requirement" v-html="cleanedHtml(info.requirement)"></div>
  52. </div>
  53. <div class="px-5 py-3 d-flex justify-space-evenly align-center mt-10 radius" style="background-color: #e3f2f0">
  54. <div>
  55. <img :src="url" width="150" height="150">
  56. </div>
  57. <div style="color: #333;" class="text-center">
  58. 长 按 识 别 二 维 码
  59. <div style="color: #6A6A6A">了 解 更 多 职 位 信 息</div>
  60. </div>
  61. </div>
  62. </div>
  63. <!-- logo -->
  64. <div class="mt-5 text-center">
  65. <img crossOrigin="anonymous" src="https://minio.citupro.com/dev/menduner/poster.png" alt="" style="width: 130px; height: 50px;">
  66. </div>
  67. </div>
  68. </v-card>
  69. </div>
  70. </template>
  71. <script setup>
  72. defineOptions({name: 'recruit-personal-shareJob-index'})
  73. import { ref } from 'vue'
  74. import { getJobAdvertisedShareQrcode } from '@/api/position'
  75. import { saveShareQuery } from '@/api/recruit/personal/jobFair'
  76. import { formatName } from '@/utils/getText'
  77. // 职位详情
  78. const props = defineProps({
  79. info: Object,
  80. positionInfo: Object,
  81. id: String,
  82. jobFairId: [String, Number] // 招聘会id
  83. })
  84. // 富文本内容处理,去除多余的换行空格等
  85. const cleanedHtml = (text) => {
  86. let cleaned = text.replace(/\n/g, '</br>')
  87. cleaned = cleaned.replace(/\s+/g, ' ').trim()
  88. cleaned = cleaned.replace(/(^|\s+)<\/p>(\s*<p>|$)/g, '</p><p>').trim()
  89. cleaned = cleaned.replace(/<p>\s*(<br>)\s*<\/p>/g, '')
  90. cleaned = cleaned.replace(/<p>\s*(<\/br>)\s*<\/p>/g, '')
  91. return cleaned
  92. }
  93. const userInfo = localStorage.getItem('userInfo') ? JSON.parse(localStorage.getItem('userInfo')) : {}
  94. const url = ref('')
  95. // 获取二维码
  96. const getQrCode = async () => {
  97. // 先将需要的参数传递给后端,后端返回一个id,再根据id获取二维码,小程序端根据scene中的id获取分享的职位id与推荐人id
  98. const params = {
  99. jobId: props.id,
  100. sharedById: userInfo?.id
  101. }
  102. // 参与招聘会的职位则需要传递招聘会id
  103. if (props.jobFairId) params.jobFairId = props.jobFairId
  104. const result = await saveShareQuery(params)
  105. const query = {
  106. scene: 'id=' + result,
  107. path: 'pagesB/positionDetail/index',
  108. width: 200,
  109. autoColor: false,
  110. checkPath: true,
  111. hyaline: true
  112. }
  113. const data = await getJobAdvertisedShareQrcode(query)
  114. url.value = 'data:image/png;base64,' + data
  115. }
  116. // getQrCode()
  117. const desc = [
  118. { value: 'areaName' },
  119. { value: 'expName' },
  120. { value: 'eduName' }
  121. ]
  122. defineExpose({
  123. getQrCode
  124. })
  125. </script>
  126. <style lang="scss" scoped>
  127. .radius { border-radius: 8px; }
  128. .salary {
  129. color: #E2D665;
  130. line-height: 41px;
  131. font-weight: 600;
  132. font-size: 20px;
  133. height: auto;
  134. display: inline-block;
  135. vertical-align: sub;
  136. }
  137. .JobName {
  138. color: #fff;
  139. font-size: 28px;
  140. margin-right: 30px;
  141. margin-top: 1px;
  142. vertical-align: middle;
  143. flex: 1;
  144. }
  145. .banner-tags { display: flex; flex-wrap: wrap; color: #fff; }
  146. .requirement {
  147. white-space: pre-wrap;
  148. word-break: break-all;
  149. line-height: 28px;
  150. color: #5C5C5C;
  151. font-size: 15px;
  152. text-align: justify;
  153. letter-spacing: 0;
  154. margin-top: 15px;
  155. }
  156. .enterprise-name {
  157. font-size: 20px;
  158. color: #fff;
  159. line-height: 28px;
  160. }
  161. .introduce-title {
  162. font-weight: 600;
  163. font-size: 24px;
  164. border-left: 5px solid #00B760;
  165. padding-left: 12px;
  166. line-height: 24px;
  167. color: var(--v-primary-base);
  168. }
  169. :deep(.v-img__img--cover) {
  170. object-fit: contain !important;
  171. }
  172. .tag {
  173. display: inline-block;
  174. color: #fff;
  175. }
  176. </style>