jobItem.vue 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197
  1. <template>
  2. <view>
  3. <view v-if="list?.length" class="ss-p-b-30 ss-p-t-20 ss-p-x-30">
  4. <view v-for="(item, index) in list" :key="index" class="mList">
  5. <view v-if="item?.hrName" class="d-flex align-center item-top">
  6. <view class="avatarBox">
  7. <image class="enterAvatar" :src="getUserAvatar(item.hrHeadImg)"></image>
  8. </view>
  9. <view class="ss-m-l-20 label-text">{{ item?.hrName }}</view>
  10. </view>
  11. <view class="list-shape">
  12. <view @tap.stop="handleToDetail(item)">
  13. <view class="titleBox">
  14. <view style="display: flex;align-items: center;">
  15. <image src="/static/svg/jobFair.svg" class=" ss-m-r-10" style="width: 20px; height: 20px;"></image>
  16. <rich-text v-if="item.name?.indexOf('style') !== -1" class="job-name" :nodes="item.name"></rich-text>
  17. <view v-else class="job-name">{{ formatName(item.name) }}</view>
  18. </view>
  19. </view>
  20. <view class="d-flex align-center justify-space-between ss-m-t-20">
  21. <view class="font-size-13 ellipsis" style="flex: 1;">
  22. <span class="tag-gap" style="color: #808080;">
  23. <span>{{item.area?.str ?? '全国' }}</span>
  24. <span class="divider-mx" v-if="item.eduName">|</span>
  25. <span>{{item.eduName }}</span>
  26. <span class="divider-mx" v-if="item.expName">|</span>
  27. <span>{{item.expName }}</span>
  28. <span class="divider-mx">|</span>
  29. <span>{{!item.payFrom && !item.payTo ? '面议' : `${item.payFrom}-${item.payTo}${item.payName ? '/' + item.payName : ''}` }}</span>
  30. </span>
  31. </view>
  32. </view>
  33. </view>
  34. <view class="sub-li-bottom ss-m-t-20">
  35. <view class="sub-li-bottom-item color-primary" @tap.stop="handleToResume(item)">{{ item.count || 0 }} 已投递简历</view>
  36. <view class="sub-li-bottom-item color-error" @tap.stop="handleRemove(item)">移出招聘会</view>
  37. </view>
  38. </view>
  39. </view>
  40. </view>
  41. <uni-popup ref="removePopup" type="dialog">
  42. <uni-popup-dialog
  43. type="warn"
  44. cancelText="取消"
  45. confirmText="确定"
  46. title="系统提示"
  47. content="是否确认将此职位移出招聘会?"
  48. @confirm="handleRemoveConfirm"
  49. @close="handleRemoveClose"
  50. ></uni-popup-dialog>
  51. </uni-popup>
  52. </view>
  53. </template>
  54. <script setup>
  55. import { ref } from 'vue'
  56. import { formatName } from '@/utils/getText'
  57. import { quitJobFairPosition } from '@/api/jobFair'
  58. import { getUserAvatar } from '@/utils/avatar'
  59. const emit = defineEmits(['refresh'])
  60. const props = defineProps({
  61. list: Array,
  62. jobFairId: [String, Number],
  63. jobFairName: String
  64. })
  65. // 查看职位详情
  66. const handleToDetail = (val) => {
  67. uni.navigateTo({
  68. url: `/pagesB/positionDetail/index?jobId=${val.id}&jobFairId=${props.jobFairId}&isEdit=${val.edit}`
  69. })
  70. }
  71. // 查看职位投递简历
  72. const handleToResume = (val) => {
  73. uni.navigateTo({
  74. url: `/pagesA/resume/index?jobId=${val.id}&jobName=${formatName(val.name)}&jobFairId=${props.jobFairId}&jobFairName=${props.jobFairName}`
  75. })
  76. }
  77. // 移出招聘会
  78. const removePopup = ref()
  79. const removeParams = ref({})
  80. const handleRemove = (val) => {
  81. removeParams.value = val
  82. removePopup.value.open()
  83. }
  84. const handleRemoveClose = () => {
  85. removeParams.value = {}
  86. removePopup.value.close()
  87. }
  88. const handleRemoveConfirm = async () => {
  89. if (!removeParams.value.id || !props.jobFairId) {
  90. uni.showToast({ title: '正在维护中,请稍后再试', icon: 'none', duration: 2000 })
  91. return
  92. }
  93. uni.showLoading({ title: '加载中' })
  94. try {
  95. await quitJobFairPosition({ jobFairId: props.jobFairId, jobId: removeParams.value.id })
  96. uni.hideLoading()
  97. uni.showToast({ title: '移出成功', icon: 'none' })
  98. removeParams.value = {}
  99. emit('refresh')
  100. } catch {
  101. removeParams.value = {}
  102. uni.hideLoading()
  103. }
  104. }
  105. </script>
  106. <style scoped lang="scss">
  107. .enterAvatar{
  108. width: 60rpx;
  109. height: 60rpx;
  110. margin: auto;
  111. border-radius: 50%;
  112. }
  113. .avatarBox {
  114. max-width: 60rpx;
  115. max-height: 60rpx;
  116. }
  117. .item-top {
  118. padding: 20rpx 30rpx;
  119. background: linear-gradient(90deg,#f5fcfc,#fcfbfa);
  120. border-radius: 12px 12px 0 0;
  121. font-size: 28rpx;
  122. color: #0E100F;
  123. .label-text {
  124. max-width: 100%;
  125. text-overflow: ellipsis;
  126. white-space: nowrap;
  127. overflow: hidden;
  128. }
  129. }
  130. .job-name {
  131. font-size: 16px;
  132. font-weight: 700;
  133. color: #0E100F;
  134. max-width: 80vw;
  135. overflow: hidden;
  136. white-space: nowrap;
  137. text-overflow: ellipsis;
  138. }
  139. .sub-li-bottom {
  140. display: flex;
  141. justify-content: space-between;
  142. margin-top: 10px;
  143. font-size: 13px;
  144. color: #666;
  145. &-item {
  146. width: 50%;
  147. height: 35px;
  148. line-height: 35px;
  149. text-align: center;
  150. margin-right: 15px;
  151. background-color: #f7f8fa;
  152. border-radius: 4px;
  153. &:nth-child(2) {
  154. margin-right: 0;
  155. }
  156. }
  157. }
  158. .salary-text {
  159. float: right;
  160. color: #00B760;
  161. font-weight: 700;
  162. }
  163. .list-shape {
  164. background-color: #fff;
  165. border-radius: 0 0 12px 12px;
  166. padding: 30rpx;
  167. .titleBox {
  168. display: flex;
  169. align-items: center;
  170. justify-content: space-between;
  171. }
  172. }
  173. .tag-gap{
  174. margin: 10rpx 10rpx 10rpx 0;
  175. }
  176. .divider-mx{
  177. margin: 0 10rpx;
  178. }
  179. .divider {
  180. color:#e4d4d2;
  181. }
  182. .mList {
  183. margin-bottom: 20rpx;
  184. position: relative;
  185. box-shadow: 1px 2px 12px rgba(0, 0, 0, 0.17);
  186. }
  187. </style>