hotPromoted.vue 5.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202
  1. <template>
  2. <div class="hot-box">
  3. <div class="sub-li" v-for="(item, index) in list" :key="index">
  4. <div v-if="item">
  5. <!-- 公司信息 -->
  6. <div class="company-info-top align-center" @click="handleClickEnterprise(item)">
  7. <div class="float-left">
  8. <v-img :src="item?.enterprise.logoUrl || 'https://minio.citupro.com/dev/menduner/company-avatar.png'" alt="" width="77" height="77" style="border-radius: 4px;"/>
  9. </div>
  10. <div class="company-info cursor-pointer">
  11. <h3>{{ item.enterprise.anotherName }}</h3>
  12. <p>
  13. {{ item?.enterprise.scaleName }}
  14. <span class="septal-line" v-if="item.enterprise.industryName"></span>
  15. {{ item?.enterprise.industryName }}
  16. </p>
  17. </div>
  18. </div>
  19. <div class="px-5 py-1 ellipsis" :style="{'height': '33px', 'border-bottom': item.enterprise.welfareList && item.enterprise.welfareList.length ? '1px solid #EBEBEB' : 'none'}">
  20. <span class="welfareTag mr-5" v-for="(k, i) in item.enterprise.welfareList" :key="i">{{ k }}</span>
  21. </div>
  22. <!-- 职位列表 -->
  23. <ul class="company-job-list">
  24. <li class="company-job-item" v-for="(k, i) in item.jobList" :key="i" :class="{'company-job-item-hover': k.active}" @mouseenter="k.active = true" @mouseleave="k.active = false" @click="handleClickPosition(k)">
  25. <div class="job-info" @mouseenter="k.active = true" @mouseleave="k.active = false" @click="handleClickPosition(k)">
  26. <div class="mb-2 d-flex">
  27. <p :class="['name', 'cursor-pointer', {'default-active': k.active }]">{{ k.name }}</p>
  28. <span v-if="!k.payFrom && !k.payTo" class="salary">面议</span>
  29. <span v-else class="salary">{{ k.payFrom ? k.payFrom + '-' : '' }}{{ k.payTo }}{{ k.payName ? '/' + k.payName : '' }}</span>
  30. </div>
  31. <div style="height: 24px; overflow: hidden; color: #808080;">
  32. <span v-for="(j, index) in desc" :key="index">
  33. <span v-if="k[j.value]" class="mr-1 font-size-13">{{ k[j.value] }}</span>
  34. <span v-if="k[j.value] && index !== desc.length - 1 && k[desc[index + 1].value]" class="septal-line ml-1"></span>
  35. </span>
  36. <span class="font-size-13 float-right">{{ timesTampChange(k.updateTime, 'Y-M-D') }}</span>
  37. </div>
  38. </div>
  39. </li>
  40. </ul>
  41. <div class="moreBtn d-flex align-center justify-center" @click="handleMoreEnterprise(item)" @mouseenter="item.active = true" @mouseleave="item.active = false">
  42. <span :style="{'text-decoration': item.active ? 'underline' : 'none'}">{{ $t('position.moreBtn') }}</span>
  43. <v-icon>mdi-menu-right</v-icon>
  44. </div>
  45. </div>
  46. </div>
  47. </div>
  48. </template>
  49. <script setup name="hotPromoted">
  50. import { ref, watch } from 'vue'
  51. import { timesTampChange } from '@/utils/date'
  52. const props = defineProps({
  53. items: {
  54. type: Array,
  55. default: () => []
  56. }
  57. })
  58. const list = ref([])
  59. watch(
  60. () => props.items,
  61. (newVal) => {
  62. list.value = newVal
  63. },
  64. { immediate: true },
  65. { deep: true }
  66. )
  67. const desc = [
  68. { value: 'areaName' },
  69. { value: 'eduName' },
  70. { value: 'expName' }
  71. ]
  72. // 职位详情
  73. const handleClickPosition = (k) => {
  74. window.open(`/recruit/personal/position/details/${k.id}`)
  75. }
  76. // 企业详情
  77. const handleClickEnterprise = (item) => {
  78. window.open(`/recruit/personal/company/details/${item.enterprise.id}?key=briefIntroduction`)
  79. }
  80. // 查看更多职位
  81. const handleMoreEnterprise = (item) => {
  82. if (!item.enterprise.id) return
  83. window.open(`/recruit/personal/company/details/${item.enterprise.id}?key=recruitmentPositions`)
  84. }
  85. </script>
  86. <style lang="scss" scoped>
  87. .hot-box {
  88. display: flex;
  89. flex-wrap: wrap;
  90. }
  91. .sub-li {
  92. position: relative;
  93. width: calc((100% - 24px) / 3);
  94. min-width: calc((100% - 24px) / 3);
  95. max-width: calc((100% - 24px) / 3);
  96. margin: 0 12px 12px 0;
  97. height: 360px;
  98. border-radius: 12px;
  99. padding: 0;
  100. overflow: hidden;
  101. transition: all .2s linear;
  102. background-color: #fff;
  103. box-shadow: 0 2px 20px 0 rgba(37, 39, 48, .2);
  104. &:nth-child(3n) {
  105. margin-right: 0;
  106. }
  107. }
  108. .company-info {
  109. float: left;
  110. margin-left: 16px;
  111. width: 262px;
  112. }
  113. .company-info-top {
  114. display: flex;
  115. height: 110px;
  116. padding: 16px 20px;
  117. overflow: hidden;
  118. border-bottom: 1px solid #EBEBEB;
  119. &:hover {
  120. background-color: #f2f4f7;
  121. }
  122. }
  123. .welfareTag {
  124. color: #CEC149;
  125. font-size: 13px;
  126. }
  127. .company-info h3 {
  128. height: 22px;
  129. font-size: 18px;
  130. font-weight: 700;
  131. color: #404040;
  132. line-height: 22px;
  133. margin: 0 0 4px 0;
  134. padding: 0;
  135. max-width: 100%;
  136. overflow: hidden;
  137. white-space: nowrap;
  138. text-overflow: ellipsis;
  139. &:hover {
  140. color: var(--v-primary-base);
  141. }
  142. }
  143. .company-info p {
  144. height: 18px;
  145. font-size: 13px;
  146. font-weight: 400;
  147. color: var(--color-999);
  148. line-height: 18px;
  149. }
  150. .company-job-list {
  151. padding: 4px 20px 12px;
  152. }
  153. ul li {
  154. list-style: none
  155. }
  156. .company-job-item {
  157. display: block;
  158. height: auto;
  159. padding: 12px 0;
  160. margin: 0;
  161. &-hover {
  162. background-color: #f2f4f7;
  163. }
  164. }
  165. .salary {
  166. font-size: 16px;
  167. float: right;
  168. font-weight: 700;
  169. color: #CEC149;
  170. line-height: 22px;
  171. max-width: none;
  172. text-align: right;
  173. flex: 1;
  174. }
  175. .name {
  176. position: relative;
  177. max-width: 200px;
  178. line-height: 22px;
  179. font-weight: 700;
  180. color: #404040;
  181. margin-right: 8px;
  182. overflow: hidden;
  183. text-overflow: ellipsis;
  184. white-space: nowrap;
  185. transition: all linear .2s;
  186. }
  187. .moreBtn {
  188. position: absolute;
  189. width: 100%;
  190. bottom: 0;
  191. height: 47px;
  192. color: #fff;
  193. cursor: pointer;
  194. font-size: 14px;
  195. background: linear-gradient(to right, #12ebb0, #427daa);
  196. }
  197. </style>