index.vue 8.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260
  1. <template>
  2. <view class="ss-m-x-20">
  3. <!-- 招聘会 -->
  4. <view v-if="props.showJobFairEntrance" class="ss-p-t-20" style="position: relative" @click="handleToJobFair">
  5. <image
  6. src="https://minio.menduner.com/dev/menduner/miniProgram/Grand-Mercure.jpg"
  7. style="width: 100%; height: 100px; border-radius: 8px"
  8. ></image>
  9. <view
  10. style="position: absolute; top: 20rpx; width: 100%; text-align: center; height: 100px; line-height: 100px; font-size: 46px; color: #fff; font-weight: bold;"
  11. >
  12. 招 聘 会
  13. </view>
  14. </view>
  15. <!-- 岗位列表 -->
  16. <view v-if="list.length > 0" class="ss-p-b-30 ss-p-t-20">
  17. <view v-for="(item, index) in list" :key="index" class="mList" :class="{ 'disable': !jobFairId && item.job?.status === '1'}" @click="toDetail(item)">
  18. <!-- 职位信息 -->
  19. <view class="list-shape" :style="`border-radius: ${props.showEntInfo ? '12px 12px 0 0' : '12px'};`">
  20. <!-- 职位 -->
  21. <view class="titleBox my-5">
  22. <view style="display: flex;align-items: center;">
  23. <view v-if="item.job?.hire" class="iconfont icon-a-1_zhaopin ss-m-r-10" style="color: #e03506; font-size: 25px;"></view>
  24. <image v-if="props.jobFairId" src="/static/svg/jobFair.svg" class=" ss-m-r-10" style="width: 20px; height: 20px;"></image>
  25. <rich-text v-if="item.job?.name?.indexOf('style') !== -1" class="job-name" :nodes="item.job.name"></rich-text>
  26. <view v-else class="job-name">{{ formatName(item.job?.name) }}</view>
  27. </view>
  28. </view>
  29. <!-- 薪酬、工作地、学历、工作经验 -->
  30. <view class="d-flex align-center justify-space-between">
  31. <view class="font-size-13 ellipsis" :style="{'max-width': !item.job?.payFrom && !item.job?.payTo ? '78%' : '56%'}">
  32. <span class="tag-gap" style="color: #808080;">
  33. <span>{{item.job?.area?.str ?? '全国' }}</span>
  34. <span class="divider-mx" v-if="item.job?.eduName">|</span>
  35. <span>{{item.job?.eduName }}</span>
  36. <span class="divider-mx" v-if="item.job?.expName">|</span>
  37. <span>{{item.job?.expName }}</span>
  38. </span>
  39. </view>
  40. <view>
  41. <span v-if="!item.job?.payFrom && !item.job?.payTo" class="salary-text">面议</span>
  42. <span v-else class="salary-text">{{ item.job?.payFrom }}-{{ item.job?.payTo }}{{ item.job?.payName ? '/' + item.job?.payName : '' }}</span>
  43. </view>
  44. </view>
  45. <!-- 岗位tag -->
  46. <view class="mt" v-if="showWelfareTag">
  47. <uni-tag
  48. v-for="(tag,i) in item.job?.tagList || []"
  49. :key="i"
  50. class="tag-gap"
  51. :text="tag"
  52. inverted="false"
  53. size="mini"
  54. custom-style="background-color: #ececec;color:#666;border-color:#ececec;display: inline-block;"
  55. />
  56. </view>
  57. <view style="text-align: end;" v-if="item.job?.hire">
  58. <uni-tag
  59. class="ss-m-l-10"
  60. v-if="item?.job?.hirePrice && item?.job?.hirePrice > 0"
  61. :text="`赏金:${commissionCalculation(item.job.hirePrice / 100, 1)}元`"
  62. inverted="false"
  63. size="default"
  64. custom-style="background-color: #e2f0ef; color:#00B760; border-color:#e2f0ef;"
  65. />
  66. </view>
  67. <view v-if="props.showUpdateTime" class="font-size-13 color-999 ss-m-t-10" :style="`text-align: ${props.updateTimeAlign};`">更新时间:{{ timesTampChange(item?.job?.refreshTime || item.job?.updateTime, 'Y-M-D h:m') }}</view>
  68. </view>
  69. <!-- 企业信息 -->
  70. <view v-if="props.showEntInfo" class="sub-li-bottom" @tap="handleClickEnt(item)">
  71. <view class="avatarBox">
  72. <image class="enterAvatar ml" :src="item.enterprise?.logoUrl || 'https://minio.citupro.com/dev/menduner/company-avatar.png'"></image>
  73. </view>
  74. <view class="ss-m-l-35">
  75. <view class="mr">{{ formatName(item.enterprise?.anotherName || item.enterprise.name) }}</view>
  76. <span class="color-999">{{ item.enterprise?.industryName || '' }}</span>
  77. <span class="divider tag-gap1" v-if="item.enterprise?.industryName && item.enterprise?.scaleName"> | </span>
  78. <span class="mr color-999">{{ item.enterprise?.scaleName || '' }}</span>
  79. </view>
  80. </view>
  81. </view>
  82. <view v-if="props.noMore" class="noMore">暂无更多数据</view>
  83. </view>
  84. <view v-else>
  85. <image src="https://minio.citupro.com/dev/static/nodata.png" mode="widthFix" style="width: 100vw;height: 100vh;"></image>
  86. <view style="color: gray; text-align: center;">暂无数据</view>
  87. </view>
  88. </view>
  89. </template>
  90. <script setup>
  91. import { commissionCalculation } from '@/utils/position'
  92. import { timesTampChange } from '@/utils/date'
  93. import { formatName } from '@/utils/getText'
  94. const emit = defineEmits(['entClick'])
  95. const props = defineProps({
  96. list: { type: Array, default: () => [] },
  97. jobFairId: { type: [String, Number], default: '' }, // 招聘会id
  98. showJobFairEntrance: { type: Boolean, default: false }, // 招聘会
  99. showEntInfo: { type: Boolean, default: true },
  100. updateTimeAlign: { type: String, default: 'end' },
  101. showUpdateTime: { type: Boolean, default: true },
  102. noMore: { type: Boolean, default: false },
  103. showWelfareTag: { type: Boolean, default: true }
  104. })
  105. //岗位详情
  106. const toDetail = (item) =>{
  107. if (!item?.job?.id) return
  108. let url = `/pagesB/positionDetail/index?id=${item.job.id}&area=${item.job.areaName}`
  109. if (props.jobFairId) url += `&jobFairId=${props.jobFairId}`
  110. uni.navigateTo({ url })
  111. }
  112. //招聘会
  113. const handleToJobFair = () => {
  114. uni.navigateTo({
  115. url: '/pages/index/jobFair'
  116. })
  117. }
  118. const handleClickEnt = (item) => {
  119. const info = {
  120. enterpriseId: item?.enterprise?.id || null,
  121. anotherName: item?.enterprise?.anotherName || null
  122. }
  123. emit('entClick', info)
  124. }
  125. </script>
  126. <style scoped lang="scss">
  127. .noMore{
  128. margin: 20px 0;
  129. }
  130. .date-time{
  131. color:#d9d0d2;
  132. float: right;
  133. }
  134. .divided-line {
  135. width: 100%;
  136. height: 1px;
  137. background-color: #f0f2f7;
  138. margin: 20px 0;
  139. }
  140. .enterAvatar{
  141. width: 40px;
  142. height: 40px;
  143. // border-radius: 50%;
  144. margin: auto;
  145. }
  146. .job-name {
  147. font-size: 16px;
  148. font-weight: 700;
  149. color: #0E100F;
  150. max-width: 80vw;
  151. overflow: hidden;
  152. white-space: nowrap;
  153. text-overflow: ellipsis;
  154. }
  155. .sub-li-bottom {
  156. display: flex;
  157. align-items: center;
  158. background-color: #fff;
  159. font-size: 13px;
  160. padding: 5px;
  161. border-radius: 0 0 12px 12px;
  162. .avatarBox {
  163. max-width: 40px;
  164. max-height: 40px;
  165. }
  166. }
  167. .salary-text {
  168. float: right;
  169. color: #00B760;
  170. font-weight: 700;
  171. }
  172. .list-shape {
  173. padding: 10px 30rpx 10px;
  174. background-color: #fff;
  175. border-radius: 12px 12px 0 0;
  176. .titleBox {
  177. display: flex;
  178. align-items: center;
  179. justify-content: space-between;
  180. }
  181. }
  182. .tag-gap{
  183. margin: 10rpx 10rpx 10rpx 0;
  184. }
  185. .tag-gap1{
  186. margin-bottom: 20px;
  187. }
  188. .divider-mx{
  189. margin: 0 10rpx;
  190. }
  191. .divider {
  192. color:#e4d4d2;
  193. }
  194. //公司名称
  195. .cer-end{
  196. position: absolute;
  197. top: 85%;
  198. right: 16%;
  199. }
  200. .cer-text{
  201. text-decoration: underline;
  202. margin: 0 5rpx;
  203. }
  204. //一行展示不全...
  205. .dis{
  206. display: flex;
  207. align-items: center;
  208. }
  209. .show-more{
  210. width: 26vw;
  211. white-space: nowrap;
  212. overflow: hidden;
  213. text-overflow: ellipsis;
  214. }
  215. .mList {
  216. margin-bottom: 20rpx;
  217. }
  218. /* 列表触底暂无更多 */
  219. .noMore{ text-align:center; color:grey; }
  220. .mt { margin-top: 15rpx; }
  221. .mb { margin-bottom: 10rpx; }
  222. .ml { margin-left: 20rpx; }
  223. .mr { margin-right: 20rpx; }
  224. .mr-10{ margin-right: 10rpx; }
  225. .my-5{ margin: 5px 0; }
  226. .disable {
  227. position: relative;
  228. overflow: hidden;
  229. &::after {
  230. content: '已失效';
  231. position: absolute;
  232. display: flex;
  233. align-items: center;
  234. justify-content: center;
  235. font-size: 1.2em;
  236. font-weight: bold;
  237. color: #fc796f;
  238. top: 0;
  239. border-radius: 12px;
  240. left: 0;
  241. width: 100%;
  242. height: 100%;
  243. background-color: rgba(255, 255, 255, 0.75);
  244. }
  245. }
  246. </style>