longStrip.vue 5.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176
  1. <template>
  2. <div>
  3. <div class="position-item mb-3 job-closed elevation-2" style="position: relative;"
  4. :class="{'close-position': val.job.status === '1'}"
  5. v-for="(val, i) in props.items" :key="i" @mouseenter="val.active = true" @mouseleave="val.active = false"
  6. >
  7. <div class="info-header">
  8. <div v-if="val.active && val.job.status === '0'" class="header-btn">
  9. <v-btn v-if="props.showCancelBtn" class="half-button ml-3" color="primary" size="small" @click="handleCancel(val)">取消收藏</v-btn>
  10. <!-- <v-btn class="half-button ml-3" color="primary" size="small" @click="toDetails(val)">立即沟通</v-btn> -->
  11. </div>
  12. <div class="img-box">
  13. <v-avatar :image="getUserAvatar(val.contact.avatar, val.contact.sex)" size="x-small"></v-avatar>
  14. <span class="name">
  15. <span class="mx-3">{{ val.contact.name }}</span>
  16. <span class="gray">{{ val.contact.postNameCn }}</span>
  17. </span>
  18. </div>
  19. </div>
  20. <div class="info-content" >
  21. <div class="job-info">
  22. <div class="job-name cursor-pointer">
  23. <span class="mr-3 info-name" @click="handleToPositionDetails(val)">{{ val.job.name }}</span>
  24. <span v-if="val?.job?.areaName">[{{ val.job.areaName }}]</span>
  25. </div>
  26. <div class="job-other">
  27. <span v-if="!val.job.payFrom && !val.job.payTo" class="salary">面议</span>
  28. <span v-else class="salary">{{ val.job.payFrom ? val.job.payFrom + '-' : ''}}{{ val.job.payTo }}{{ val.job.payName ? '/' + val.job.payName : '' }}</span>
  29. <v-chip v-if="val.job?.expName" class="mx-3" color="primary" label size="small">{{ val.job.expName }}</v-chip>
  30. <v-chip v-if="val.job?.eduName" color="primary" label size="small">{{ val.job.eduName }}</v-chip>
  31. </div>
  32. </div>
  33. <div class="company-info ml-3" style="flex: 1;">
  34. <div style="height: 50px; width: 50px;">
  35. <v-img width="50" height="50" :src="val.enterprise.logoUrl || 'https://minio.citupro.com/dev/menduner/7.png'"></v-img>
  36. </div>
  37. <div class="ml-3">
  38. <div class="cursor-pointer info-name" @click="handleToEnterprise(val)">{{ val.enterprise.name }}</div>
  39. <div class="mt-3 ellipsis color-666 font-size-13" style="max-width: 260px;">
  40. <span v-for="(k, i) in desc" :key="k">
  41. {{ val.enterprise[k] }}
  42. <span v-if="i !== desc.length - 1 && val.enterprise[k] && val.enterprise[desc[i + 1]]" class="septal-line"></span>
  43. </span>
  44. </div>
  45. </div>
  46. </div>
  47. </div>
  48. </div>
  49. </div>
  50. </template>
  51. <script setup>
  52. defineOptions({ name: 'longStrip'})
  53. import { getPersonJobUnfavorite } from '@/api/position'
  54. import { useI18n } from '@/hooks/web/useI18n'
  55. import Snackbar from '@/plugins/snackbar'
  56. import { getUserAvatar } from '@/utils/avatar'
  57. import { useRouter } from 'vue-router'
  58. // import { prologue, defaultText } from '@/hooks/web/useIM'
  59. const emits = defineEmits(['refresh'])
  60. const { t } = useI18n()
  61. const props = defineProps({
  62. items: {
  63. type: Array,
  64. default: () => []
  65. },
  66. showCancelBtn: {
  67. type: Boolean,
  68. default: false
  69. }
  70. })
  71. const router = useRouter()
  72. const desc = ['industryName', 'financingName', 'scaleName']
  73. const handleCancel = async (item) => {
  74. if (!item.job.id) return Snackbar.warning(t('sys.api.operationFailed'))
  75. await getPersonJobUnfavorite(item.job.id)
  76. emits('refresh')
  77. Snackbar.success(t('common.operationSuccessful'))
  78. }
  79. // 职位详情
  80. const handleToPositionDetails = (item) => {
  81. router.push(`/recruit/personal/position/details/${item.job.id}`)
  82. }
  83. // 企业详情
  84. const handleToEnterprise = (item) => {
  85. router.push(`/recruit/personal/company/details/${item.enterprise.id}?key=briefIntroduction`)
  86. }
  87. // // 立即沟通
  88. // const toDetails = async (info) => {
  89. // const userId = info.contact.userId
  90. // const enterpriseId = info.contact.enterpriseId
  91. // await prologue({userId, enterpriseId, defaultText})
  92. // let url = `/recruit/personal/message?id=${info.job.id}`
  93. // if (info.contact.enterpriseId) {
  94. // url += `&enterprise=${info.contact.enterpriseId}`
  95. // }
  96. // router.push(url)
  97. // }
  98. </script>
  99. <style scoped lang="scss">
  100. .position-item {
  101. height: 144px;
  102. background-color: #fff;
  103. border-radius: 12px;
  104. &:hover {
  105. box-shadow: 0px 3px 5px -1px var(--v-shadow-key-umbra-opacity, rgba(0, 0, 0, 0.2)), 0px 5px 8px 0px var(--v-shadow-key-penumbra-opacity, rgba(0, 0, 0, 0.14)), 0px 1px 14px 0px var(--v-shadow-key-ambient-opacity, rgba(0, 0, 0, 0.12)) !important;
  106. }
  107. .info-header {
  108. height: 48px;
  109. background: linear-gradient(90deg,#f5fcfc,#fcfbfa);
  110. border-radius: 12px;
  111. .img-box {
  112. padding: 12px 24px;
  113. .name {
  114. color: var(--color-222);
  115. font-weight: 400;
  116. font-size: 13px;
  117. .gray {
  118. color: var(--color-666);
  119. }
  120. }
  121. }
  122. .header-btn {
  123. padding: 10px 10px 0 0;
  124. float: right;
  125. .v-btn {
  126. z-index: 1;
  127. }
  128. }
  129. }
  130. .info-content {
  131. display: flex;
  132. padding: 16px 24px;
  133. justify-content: space-between;
  134. .job-info {
  135. width: 430px;
  136. min-width: 430px;
  137. max-width: 430px;
  138. font-weight: 500;
  139. font-size: 16px;
  140. .job-name {
  141. height: 22px;
  142. line-height: 22px;
  143. color: var(--color-222);
  144. margin-bottom: 12px;
  145. }
  146. .job-other {
  147. color: var(--v-error-base);
  148. height: 22px;
  149. line-height: 22px;
  150. }
  151. }
  152. .company-info {
  153. display: flex;
  154. align-items: center
  155. }
  156. .interview-info {
  157. color: var(--color-333);
  158. font-size: 15px;
  159. }
  160. }
  161. }
  162. .info-name:hover {
  163. color: var(--v-primary-base);
  164. }
  165. </style>