index.vue 9.4 KB

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