jobItem.vue 4.4 KB

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