index.vue 9.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263
  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.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
  84. @tap.stop="handleReport(item)"
  85. class="ss-m-l-10"
  86. type="warning"
  87. size="mini"
  88. style="color:#fff; backgroundColor:#00B760;borderColor:#00B760"
  89. >上报为实习企业</button>
  90. </view>
  91. </view>
  92. </view>
  93. <view v-if="props.noMore" class="noMore">暂无更多数据</view>
  94. </view>
  95. <view v-else>
  96. <image src="https://minio.citupro.com/dev/static/nodata.png" mode="widthFix" style="width: 100vw;height: 100vh;"></image>
  97. <view style="color: gray; text-align: center;">暂无数据</view>
  98. </view>
  99. <!-- 确认框 -->
  100. <uni-popup ref="confirmRef" type="dialog">
  101. <uni-popup-dialog
  102. type="warn"
  103. cancelText="取消"
  104. confirmText="确认"
  105. title="系统提示"
  106. content="是否确定上报为实习企业?"
  107. @confirm="handleConfirm"
  108. ></uni-popup-dialog>
  109. </uni-popup>
  110. </view>
  111. </template>
  112. <script setup>
  113. import { commissionCalculation } from '@/utils/position'
  114. import { timesTampChange } from '@/utils/date'
  115. import { formatName } from '@/utils/getText'
  116. import { ref, computed } from 'vue'
  117. import { userStore } from '@/store/user'
  118. import { reportStudentPracticeEnterprise } from '@/api/student'
  119. const emit = defineEmits(['entClick', 'refresh'])
  120. const props = defineProps({
  121. list: { type: Array, default: () => [] },
  122. jobFairId: { type: [String, Number], default: '' }, // 招聘会id
  123. showEntInfo: { type: Boolean, default: true },
  124. showReportBtn: { type: Boolean, default: false },
  125. showUpdateTime: { type: Boolean, default: true },
  126. noMore: { type: Boolean, default: false },
  127. showWelfareTag: { type: Boolean, default: true },
  128. showJobFairSign: { type: Boolean, default: false } // 是否展示招聘会标识
  129. })
  130. const useUserStore = userStore()
  131. const isStudent = computed(() => useUserStore?.baseInfo?.type && Boolean(Number(useUserStore.baseInfo.type) === 1))
  132. //岗位详情
  133. const toDetail = (item) =>{
  134. if (!item?.job?.id) return
  135. let url = `/pagesB/positionDetail/index?id=${item.job.id}&area=${item.job.areaName}`
  136. if (props.jobFairId) url += `&jobFairId=${props.jobFairId}`
  137. uni.navigateTo({ url })
  138. }
  139. const handleClickEnt = (item) => {
  140. const info = {
  141. enterpriseId: item?.enterprise?.id || null,
  142. anotherName: item?.enterprise?.anotherName || null
  143. }
  144. emit('entClick', info)
  145. }
  146. const handleConfirm = async() => {
  147. try {
  148. const enterpriseId = handleVal.value?.enterprise?.id
  149. const jobId = handleVal.value?.job?.id
  150. await reportStudentPracticeEnterprise(enterpriseId, jobId)
  151. uni.showToast({ title: '上报成功', icon: 'success' })
  152. } catch (error) {
  153. uni.showToast({ title: error?.msg || error, icon: 'none' })
  154. } finally {
  155. confirmRef.value.close()
  156. emit('refresh')
  157. }
  158. }
  159. const confirmRef = ref()
  160. const handleVal = ref('')
  161. // 上报为实习企业
  162. const handleReport = (val) => {
  163. if (!val?.enterprise?.id || !val?.job?.id) uni.showToast({ title: '企业或职位信息错误', icon: 'none' })
  164. handleVal.value = val
  165. confirmRef.value.open()
  166. }
  167. </script>
  168. <style scoped lang="scss">
  169. .enterAvatar{
  170. width: 60rpx;
  171. height: 60rpx;
  172. margin: auto;
  173. }
  174. .job-name {
  175. max-width: 80vw;
  176. overflow: hidden;
  177. white-space: nowrap;
  178. text-overflow: ellipsis;
  179. font-weight: 600;
  180. font-size: 30rpx;
  181. }
  182. .sub-li-bottom {
  183. display: flex;
  184. align-items: center;
  185. font-size: 13px;
  186. padding: 10rpx 30rpx 0 30rpx;
  187. border-radius: 0 0 12px 12px;
  188. margin-bottom: 20rpx;
  189. .avatarBox {
  190. max-width: 40px;
  191. max-height: 40px;
  192. }
  193. }
  194. .salary-text {
  195. font-size: 24rpx;
  196. color: #00B760;
  197. font-style: normal;
  198. text-transform: none;
  199. }
  200. .list-shape {
  201. padding: 10px 30rpx 10px;
  202. border-radius: 12px 12px 0 0;
  203. .titleBox {
  204. display: flex;
  205. align-items: center;
  206. justify-content: space-between;
  207. }
  208. }
  209. .desc-tag {
  210. font-size: 24rpx;
  211. color: #666666;
  212. font-style: normal;
  213. text-transform: none;
  214. }
  215. .tag-gap{
  216. margin: 10rpx 10rpx 10rpx 0;
  217. }
  218. .divider-mx{
  219. margin: 0 10rpx;
  220. }
  221. .mList {
  222. margin-bottom: 20rpx;
  223. border-radius: 20rpx;
  224. box-shadow: 1px 2px 12px rgba(0, 0, 0, 0.17);
  225. }
  226. /* 列表触底暂无更多 */
  227. .noMore{ text-align:center; color:grey;margin: 20px 0; }
  228. .disable {
  229. position: relative;
  230. overflow: hidden;
  231. &::after {
  232. content: '职位已关闭';
  233. position: absolute;
  234. display: flex;
  235. align-items: center;
  236. justify-content: center;
  237. font-size: 1.2em;
  238. font-weight: bold;
  239. color: #ff5252;
  240. top: 0;
  241. border-radius: 12px;
  242. left: 0;
  243. width: 100%;
  244. height: 100%;
  245. background-color: rgba(255, 255, 255, 0.75);
  246. }
  247. }
  248. </style>