index.vue 9.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251
  1. <template>
  2. <view class="ss-m-x-20">
  3. <!-- 岗位列表 -->
  4. <view v-if="list.length > 0" class="ss-p-b-30 ss-p-t-20">
  5. <view v-for="(item, index) in list" :key="index" class="mList default-border list-item-bgc" @click="toDetail(item)">
  6. <view :class="{ 'disable': !jobFairId && item.job?.status === '1'}">
  7. <!-- 职位信息 -->
  8. <view class="list-shape" :style="`border-radius: ${props.showEntInfo ? '12px 12px 0 0' : '12px'};`">
  9. <!-- 职位 -->
  10. <view class="titleBox ss-m-y-10">
  11. <view style="display: flex;align-items: center;">
  12. <view v-if="item.job?.hire" class="iconfont icon-a-1_zhaopin ss-m-r-10" style="color: #e03506; font-size: 25px;"></view>
  13. <image v-if="props.jobFairId || item.job?.bizId" src="/static/svg/jobFair.svg" class=" ss-m-r-10" style="width: 20px; height: 20px;"></image>
  14. <rich-text v-if="item.job?.name?.indexOf('style') !== -1" class="job-name MiSans-Semibold default-text-color" :nodes="item.job.name"></rich-text>
  15. <view v-else class="job-name MiSans-Semibold default-text-color">{{ formatName(item.job?.name) }}</view>
  16. </view>
  17. </view>
  18. <!-- 薪酬、工作地、学历、工作经验 -->
  19. <view class="ellipsis" style="max-width: 100%; align-items: baseline;">
  20. <span class="ss-m-r-20">
  21. <span v-if="!item.job?.payFrom && !item.job?.payTo" class="salary-text MiSans-Bold">面议</span>
  22. <span v-else class="salary-text MiSans-Bold">{{ item.job?.payFrom }}-{{ item.job?.payTo }}{{ item.job?.payName ? '/' + item.job?.payName : '' }}</span>
  23. </span>
  24. <span class="desc-tag font-size-13">
  25. <span class="MiSans-Normal">{{item.job?.area?.str ?? '全国' }}</span>
  26. <span class="divider-mx" v-if="item.job?.eduName">|</span>
  27. <span class="MiSans-Normal">{{item.job?.eduName }}</span>
  28. <span class="divider-mx" v-if="item.job?.expName">|</span>
  29. <span class="MiSans-Normal">{{item.job?.expName }}</span>
  30. </span>
  31. </view>
  32. <!-- 岗位tag -->
  33. <view class="ss-m-t-15" v-if="showWelfareTag">
  34. <uni-tag
  35. v-for="(tag,i) in item.job?.tagList || []"
  36. :key="i"
  37. class="tag-gap MiSans-Normal"
  38. :text="tag"
  39. inverted="false"
  40. size="mini"
  41. custom-style="background-color: #ececec;color:#666;border-color:#ececec;display: inline-block;"
  42. />
  43. </view>
  44. <view style="text-align: end;" v-if="item.job?.hire">
  45. <uni-tag
  46. class="ss-m-l-10"
  47. v-if="item?.job?.hirePrice && item?.job?.hirePrice > 0"
  48. :text="`赏金:${commissionCalculation(item.job.hirePrice / 100, 1)}元`"
  49. inverted="false"
  50. size="default"
  51. custom-style="background-color: #e2f0ef; color:#666; border-color:#e2f0ef;"
  52. />
  53. </view>
  54. <view
  55. v-if="props.showUpdateTime"
  56. class="font-size-13 color-666 ss-m-t-20 MiSans-Normal d-flex align-center"
  57. >
  58. <image src="https://minio.menduner.com/dev/2b50f8ccb13045a58c69e96ae1f986234452825b8ae01aba8fa08cabbcf86cd8.png" class="ss-m-r-20" style="width: 15px; height: 15px;"></image>
  59. 更新时间:{{ timesTampChange(item?.job?.refreshTime || item.job?.updateTime, 'Y-M-D h:m') }}
  60. </view>
  61. </view>
  62. <!-- 企业信息 -->
  63. <view v-if="props.showEntInfo" class="sub-li-bottom" @tap="handleClickEnt(item)">
  64. <view class="avatarBox">
  65. <image class="enterAvatar ss-m-l-20 default-border default-radius" :src="item.enterprise?.logoUrl || 'https://minio.citupro.com/dev/menduner/company-avatar.png'"></image>
  66. </view>
  67. <view class="ss-m-l-35 MiSans-Normal" style="flex: 1; max-width: calc(100% - 40px);">
  68. <view class="default-text-color ellipsis" style="width: 98%;">{{ formatName(item.enterprise?.anotherName || item.enterprise.name) }}</view>
  69. <span class="color-666 ss-m-r-10 font-size-12">{{ item.enterprise?.industryName || '' }}</span>
  70. <span class="color-666 font-size-12">{{ item.enterprise?.scaleName || '' }}</span>
  71. </view>
  72. </view>
  73. </view>
  74. <view v-if="showReportBtn && isStudent && item.job?.bizId && !item.internshipEnterprise" class="ss-m-y-30">
  75. <view class="ss-m-y-30" style="border-top: 1rpx solid #E1E4E9;"></view>
  76. <view style="text-align: right;" class="ss-m-x-30">
  77. <button @tap.stop="handleReport(item)" class="ss-m-l-10" type="warning" size="mini" style="color:#fff; backgroundColor:#00897b;borderColor:#00897b">上报为实习企业</button>
  78. </view>
  79. </view>
  80. </view>
  81. <view v-if="props.noMore" class="noMore">暂无更多数据</view>
  82. </view>
  83. <view v-else>
  84. <image src="https://minio.citupro.com/dev/static/nodata.png" mode="widthFix" style="width: 100vw;height: 100vh;"></image>
  85. <view style="color: gray; text-align: center;">暂无数据</view>
  86. </view>
  87. <!-- 确认框 -->
  88. <uni-popup ref="confirmRef" type="dialog">
  89. <uni-popup-dialog
  90. type="warn"
  91. cancelText="取消"
  92. confirmText="确认"
  93. title="系统提示"
  94. content="是否确定上报为实习企业?"
  95. @confirm="handleConfirm"
  96. ></uni-popup-dialog>
  97. </uni-popup>
  98. </view>
  99. </template>
  100. <script setup>
  101. import { commissionCalculation } from '@/utils/position'
  102. import { timesTampChange } from '@/utils/date'
  103. import { formatName } from '@/utils/getText'
  104. import { ref, computed } from 'vue'
  105. import { userStore } from '@/store/user'
  106. import { reportStudentPracticeEnterprise } from '@/api/student'
  107. const emit = defineEmits(['entClick', 'refresh'])
  108. const props = defineProps({
  109. list: { type: Array, default: () => [] },
  110. jobFairId: { type: [String, Number], default: '' }, // 招聘会id
  111. showEntInfo: { type: Boolean, default: true },
  112. showReportBtn: { type: Boolean, default: false },
  113. showUpdateTime: { type: Boolean, default: true },
  114. noMore: { type: Boolean, default: false },
  115. showWelfareTag: { type: Boolean, default: true }
  116. })
  117. const useUserStore = userStore()
  118. const isStudent = computed(() => useUserStore?.baseInfo?.type && Boolean(Number(useUserStore.baseInfo.type) === 1))
  119. //岗位详情
  120. const toDetail = (item) =>{
  121. if (!item?.job?.id) return
  122. let url = `/pagesB/positionDetail/index?id=${item.job.id}&area=${item.job.areaName}`
  123. if (props.jobFairId) url += `&jobFairId=${props.jobFairId}`
  124. uni.navigateTo({ url })
  125. }
  126. const handleClickEnt = (item) => {
  127. const info = {
  128. enterpriseId: item?.enterprise?.id || null,
  129. anotherName: item?.enterprise?.anotherName || null
  130. }
  131. emit('entClick', info)
  132. }
  133. const handleConfirm = async() => {
  134. try {
  135. const enterpriseId = handleVal.value?.enterprise?.id
  136. const jobId = handleVal.value?.job?.id
  137. await reportStudentPracticeEnterprise(enterpriseId, jobId)
  138. uni.showToast({ title: '上报成功', icon: 'success' })
  139. } catch (error) {
  140. uni.showToast({ title: error?.msg || error, icon: 'none' })
  141. } finally {
  142. confirmRef.value.close()
  143. emit('refresh')
  144. }
  145. }
  146. const confirmRef = ref()
  147. const handleVal = ref('')
  148. // 上报为实习企业
  149. const handleReport = (val) => {
  150. if (!val?.job?.bizId) return uni.showToast({ title: '不是招聘会职位不能上报为实习企业', icon: 'none' })
  151. if (!val?.enterprise?.id || !val?.job?.id) uni.showToast({ title: '企业或职位信息错误', icon: 'none' })
  152. handleVal.value = val
  153. confirmRef.value.open()
  154. }
  155. </script>
  156. <style scoped lang="scss">
  157. .enterAvatar{
  158. width: 60rpx;
  159. height: 60rpx;
  160. margin: auto;
  161. }
  162. .job-name {
  163. max-width: 80vw;
  164. overflow: hidden;
  165. white-space: nowrap;
  166. text-overflow: ellipsis;
  167. font-weight: 600;
  168. font-size: 30rpx;
  169. }
  170. .sub-li-bottom {
  171. display: flex;
  172. align-items: center;
  173. font-size: 13px;
  174. padding: 10rpx 30rpx 0 30rpx;
  175. border-radius: 0 0 12px 12px;
  176. margin-bottom: 20rpx;
  177. .avatarBox {
  178. max-width: 40px;
  179. max-height: 40px;
  180. }
  181. }
  182. .salary-text {
  183. font-size: 24rpx;
  184. color: #00B760;
  185. font-style: normal;
  186. text-transform: none;
  187. }
  188. .list-shape {
  189. padding: 10px 30rpx 10px;
  190. border-radius: 12px 12px 0 0;
  191. .titleBox {
  192. display: flex;
  193. align-items: center;
  194. justify-content: space-between;
  195. }
  196. }
  197. .desc-tag {
  198. font-size: 24rpx;
  199. color: #666666;
  200. font-style: normal;
  201. text-transform: none;
  202. }
  203. .tag-gap{
  204. margin: 10rpx 10rpx 10rpx 0;
  205. }
  206. .divider-mx{
  207. margin: 0 10rpx;
  208. }
  209. .mList {
  210. margin-bottom: 20rpx;
  211. border-radius: 20rpx;
  212. box-shadow: 1px 2px 12px rgba(0, 0, 0, 0.17);
  213. }
  214. /* 列表触底暂无更多 */
  215. .noMore{ text-align:center; color:grey;margin: 20px 0; }
  216. .disable {
  217. position: relative;
  218. overflow: hidden;
  219. &::after {
  220. content: '已失效';
  221. position: absolute;
  222. display: flex;
  223. align-items: center;
  224. justify-content: center;
  225. font-size: 1.2em;
  226. font-weight: bold;
  227. color: #fc796f;
  228. top: 0;
  229. border-radius: 12px;
  230. left: 0;
  231. width: 100%;
  232. height: 100%;
  233. background-color: rgba(255, 255, 255, 0.75);
  234. }
  235. }
  236. </style>