hotPromoted.vue 4.3 KB

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