join.vue 5.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235
  1. <template>
  2. <view class="box defaultBgc">
  3. <view style="background-color: #fff;">
  4. <uni-search-bar
  5. v-model="query.name"
  6. radius="5"
  7. placeholder="输入关键字"
  8. cancelButton="none"
  9. :focus="false"
  10. @clear="handleSearch"
  11. @confirm="handleSearch"
  12. ></uni-search-bar>
  13. </view>
  14. <scroll-view class="scrollBox" :scroll-y="true" @scrolltolower="loadingMore" style="position:relative;">
  15. <view v-for="(item, index) in items" :key="index" class="mList">
  16. <view v-if="item?.hrName" class="d-flex align-center item-top">
  17. <view class="avatarBox">
  18. <image class="enterAvatar" :src="getUserAvatar(item.hrHeadImg)"></image>
  19. </view>
  20. <view class="ss-m-l-20 label-text">{{ item?.hrName }}</view>
  21. </view>
  22. <view class="list-shape" :style="{'border-radius': item?.hrName ? '0 0 12px 12px' : '12px'}">
  23. <view>
  24. <view class="titleBox">
  25. <view style="display: flex; align-items: center;">
  26. <image v-if="item.jobFairId" src="/static/svg/jobFair.svg" class=" ss-m-r-10" style="width: 20px; height: 20px;"></image>
  27. <rich-text v-if="item.name?.indexOf('style') !== -1" class="job-name" :nodes="item.name"></rich-text>
  28. <view v-else class="job-name">{{ formatName(item.name) }}</view>
  29. <span v-if="item.status === '1'" class="color-error">(已关闭)</span>
  30. </view>
  31. </view>
  32. <view class="d-flex align-center justify-space-between ss-m-t-20">
  33. <view class="font-size-13 ellipsis" style="flex: 1;">
  34. <span class="tag-gap" style="color: #808080;">
  35. <span>{{item.area?.str ?? '全国' }}</span>
  36. <span class="divider-mx" v-if="item.eduName">|</span>
  37. <span>{{item.eduName }}</span>
  38. <span class="divider-mx" v-if="item.expName">|</span>
  39. <span>{{item.expName }}</span>
  40. <span class="divider-mx">|</span>
  41. <span>{{!item.payFrom && !item.payTo ? '面议' : `${item.payFrom}-${item.payTo}${item.payName ? '/' + item.payName : ''}` }}</span>
  42. </span>
  43. </view>
  44. </view>
  45. <view v-if="item.jobFairName" class="color-primary font-size-13 ss-m-t-10">
  46. 招聘会:{{ item.jobFairName }}
  47. </view>
  48. </view>
  49. <view class="sub-li-bottom">
  50. <view class="sub-li-bottom-item" @tap.stop="handleJoin(item)">克隆加入</view>
  51. </view>
  52. </view>
  53. </view>
  54. <uni-load-more :status="more" />
  55. </scroll-view>
  56. </view>
  57. </template>
  58. <script setup>
  59. import { ref } from 'vue'
  60. import { onLoad } from '@dcloudio/uni-app'
  61. import { formatName } from '@/utils/getText.js'
  62. import { getJobAdvertisedList } from '@/api/new/position'
  63. import { dealDictArrayData } from '@/utils/position'
  64. import { getUserAvatar } from '@/utils/avatar'
  65. const query = ref({
  66. pageSize: 10,
  67. pageNo: 1,
  68. name: null
  69. })
  70. const items = ref([])
  71. const more = ref('more')
  72. const total = ref(0)
  73. const getData = async () => {
  74. try {
  75. more.value = 'loading'
  76. const { data } = await getJobAdvertisedList(query.value)
  77. if (!data.list.length) {
  78. more.value = 'noMore'
  79. items.value = []
  80. total.value = 0
  81. return
  82. }
  83. const list = dealDictArrayData([], data.list)
  84. items.value = items.value.concat(list)
  85. total.value = data.total
  86. if (items.value.length === +data.total) {
  87. more.value = 'noMore'
  88. return
  89. }
  90. } catch {
  91. query.value.pageNo--
  92. more.value = 'more'
  93. }
  94. }
  95. // 关键字搜索
  96. const handleSearch = () => {
  97. total.value = 0
  98. items.value = []
  99. query.value.pageNo = 1
  100. getData()
  101. }
  102. // 加载更多
  103. const loadingMore = () => {
  104. if (more.value === 'noMore') return
  105. more.value = 'loading'
  106. query.value.pageNo++
  107. getData()
  108. }
  109. const jobFairId = ref('')
  110. onLoad(async (options) => {
  111. jobFairId.value = options.jobFairId
  112. query.value.pageNo = 1
  113. await getData()
  114. })
  115. // 克隆职位-跳转招聘会职位编辑
  116. const handleJoin = async (item) => {
  117. if (!item.id) return uni.showToast({ title: '缺少职位ID', icon: 'none' })
  118. uni.navigateTo({
  119. url: `/pagesB/jobFair/editJob?jobId=${item.id}&jobFairId=${jobFairId.value}&isClone=1`
  120. })
  121. }
  122. </script>
  123. <style scoped lang="scss">
  124. .enterAvatar{
  125. width: 60rpx;
  126. height: 60rpx;
  127. margin: auto;
  128. border-radius: 50%;
  129. }
  130. .avatarBox {
  131. max-width: 60rpx;
  132. max-height: 60rpx;
  133. }
  134. .item-top {
  135. padding: 20rpx 30rpx;
  136. background: linear-gradient(90deg,#f5fcfc,#fcfbfa);
  137. border-radius: 12px 12px 0 0;
  138. font-size: 28rpx;
  139. color: #0E100F;
  140. .label-text {
  141. max-width: 100%;
  142. text-overflow: ellipsis;
  143. white-space: nowrap;
  144. overflow: hidden;
  145. }
  146. }
  147. .box {
  148. height: 100vh;
  149. overflow: hidden;
  150. box-sizing: border-box;
  151. display: flex;
  152. flex-direction: column;
  153. }
  154. .scrollBox{
  155. flex: 1;
  156. padding-bottom: 24rpx;
  157. box-sizing: border-box;
  158. height: 0 !important;
  159. }
  160. .stickFilter {
  161. z-index: 1;
  162. position: sticky;
  163. box-shadow: 0px 10rpx 12rpx 0px rgba(195, 195, 195, .25);
  164. top: 110rpx;
  165. background-color: #fff;
  166. }
  167. .job-name {
  168. font-size: 16px;
  169. font-weight: 700;
  170. color: #0E100F;
  171. max-width: 80vw;
  172. overflow: hidden;
  173. white-space: nowrap;
  174. text-overflow: ellipsis;
  175. }
  176. .sub-li-bottom {
  177. display: flex;
  178. justify-content: space-between;
  179. margin-top: 10px;
  180. padding-top: 10px;
  181. font-size: 13px;
  182. color: #00B760;
  183. &-item {
  184. width: 100%;
  185. height: 35px;
  186. line-height: 35px;
  187. text-align: center;
  188. background-color: #f7f8fa;
  189. border-radius: 4px;
  190. }
  191. }
  192. .list-shape {
  193. background-color: #fff;
  194. padding: 30rpx;
  195. .titleBox {
  196. display: flex;
  197. align-items: center;
  198. justify-content: space-between;
  199. }
  200. }
  201. .tag-gap{
  202. margin: 10rpx 10rpx 10rpx 0;
  203. }
  204. .divider-mx{
  205. margin: 0 10rpx;
  206. }
  207. .divider {
  208. color:#e4d4d2;
  209. }
  210. .mList {
  211. border-radius: 12px;
  212. margin: 0 30rpx 20rpx 30rpx;
  213. box-shadow: 1px 2px 12px rgba(0, 0, 0, 0.17);
  214. &:first-child {
  215. margin-top: 20rpx;
  216. }
  217. }
  218. </style>