jobItem.vue 4.4 KB

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