positions.vue 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210
  1. <!-- 招聘会/企业详情 -->
  2. <template>
  3. <view>
  4. <view class="box">
  5. <scroll-view class="scrollBox" :scroll-y="true" :scroll-top="scrollTop" @scrolltolower="loadingMore" @scroll="onScroll" style="position:relative;">
  6. <view>
  7. <!-- 顶部 -->
  8. <view class="white-bgc stick ss-p-t-10">
  9. <view class="titleBox">
  10. <view class="title">招聘职位</view>
  11. <view class="entName">{{ entName }}</view>
  12. </view>
  13. </view>
  14. <view v-if="listData?.length" class="listDataBox defaultBgc">
  15. <PositionList class="pb-10" :list="listData" :noMore="false" :showEntInfo="false" updateTimeAlign="left"></PositionList>
  16. <uni-load-more :status="more" />
  17. </view>
  18. <view v-else class="nodata-img-parent">
  19. <image src="https://minio.citupro.com/dev/static/nodata.png" mode="widthFix" style="width: 100vw;height: 100vh;"></image>
  20. </view>
  21. </view>
  22. </scroll-view>
  23. </view>
  24. </view>
  25. </template>
  26. <script setup>
  27. import { onLoad } from '@dcloudio/uni-app'
  28. import { ref, reactive } from 'vue'
  29. import { dealDictObjData } from '@/utils/position'
  30. import { getJobFairEntJobPage } from '@/api/jobFair'
  31. import PositionList from '@/components/PositionList'
  32. const more = ref('more')
  33. const listData = ref([])
  34. const query = reactive({
  35. pageSize: 20,
  36. pageNo: 1,
  37. jobFairId: undefined,
  38. enterpriseId: undefined,
  39. })
  40. const entName = ref('')
  41. onLoad(async (options) => {
  42. entName.value = options.entName
  43. if (options?.jobFairId) {
  44. query.jobFairId = options.jobFairId
  45. query.enterpriseId = options.enterpriseId
  46. getData()
  47. }
  48. })
  49. const getData = async () => {
  50. if (!query.jobFairId) {
  51. uni.showToast({ title: '获取企业岗位失败,请重试!', icon: 'none', duration: 2000 })
  52. return
  53. }
  54. try {
  55. const res = await getJobFairEntJobPage(query)
  56. const list = res?.data?.list || []
  57. list.forEach(e => {
  58. e.job = dealDictObjData({}, e)
  59. })
  60. listData.value = listData.value.concat(list)
  61. if (listData.value?.length === +res?.data?.total) {
  62. more.value = 'noMore'
  63. return
  64. }
  65. } catch (error) {
  66. query.pageNo--
  67. more.value = 'more'
  68. }
  69. }
  70. const scrollTop = ref(0)
  71. const old = ref({
  72. scrollTop: 0
  73. })
  74. const onScroll = (e) =>{
  75. old.value.scrollTop = e.detail.scrollTop
  76. }
  77. // 加载更多
  78. const loadingMore = () => {
  79. more.value = 'loading'
  80. query.pageNo++
  81. getData()
  82. }
  83. // const goBack = () => {
  84. // uni.navigateTo({
  85. // url: '/pagesB/jobFair/index'
  86. // })
  87. // }
  88. </script>
  89. <style scoped lang="scss">
  90. .stick {
  91. z-index: 1;
  92. position: sticky;
  93. top: 0;
  94. }
  95. .stickFilter {
  96. z-index: 1;
  97. position: sticky;
  98. box-shadow: 0px 10rpx 12rpx 0px rgba(195, 195, 195, .25);
  99. top: 120rpx;
  100. }
  101. .px-0 { padding-left: 0 !important; padding-right: 0 !important; }
  102. .pb-10 {
  103. padding-bottom: 10px;
  104. }
  105. .pb-20 { padding-bottom: 20px; }
  106. .px-5 { padding-left: 5px; padding-right: 5px; }
  107. .px-10 { padding-left: 10px; padding-right: 10px; }
  108. .mx-10 { margin-left: 10px; margin-right: 10px }
  109. .mx-20 { margin-left: 20px; margin-right: 20px; }
  110. .mb-10 { margin-bottom: 10px; }
  111. .box {
  112. height: 100vh;
  113. overflow: hidden;
  114. // padding-bottom: 120rpx;
  115. box-sizing: border-box;
  116. display: flex;
  117. flex-direction: column;
  118. }
  119. .listDataBox {
  120. padding: 1px 0 120rpx;
  121. // padding-bottom: 120rpx;
  122. margin: 0 30rpx;
  123. }
  124. .scrollBox{
  125. flex: 1;
  126. height: 0 !important;
  127. padding-bottom: 24rpx;
  128. box-sizing: border-box;
  129. }
  130. :deep(.uni-searchbar__box) {
  131. width: calc(100% - 105px);
  132. height: 40px !important;
  133. border: 1px solid #00897B;
  134. padding-right: 20px;
  135. flex: none;
  136. }
  137. .search-btn {
  138. position: absolute;
  139. right: 11px;
  140. top: 10px;
  141. width: 110px;
  142. height: 40px;
  143. font-size: 16px;
  144. background-color: #00897B;
  145. color: #fff;
  146. border-radius: 0 5px 5px 0;
  147. z-index: 9;
  148. }
  149. .goBack {
  150. width: 110px;
  151. height: 32px;
  152. font-size: 13px;
  153. background-color: #00897B;
  154. color: #fff;
  155. // border-radius: 0 5px 5px 0;
  156. z-index: 9;
  157. }
  158. :deep(.picker-view) {
  159. padding-bottom: 80px !important;
  160. }
  161. .jobCount {
  162. height: 40px;
  163. line-height: 40px;
  164. color: #fff;
  165. text-align: center;
  166. font-size: 15px;
  167. background: linear-gradient(to right, #12ebb0, #427daa);
  168. }
  169. :deep(.uni-card) {
  170. padding: 0 !important;
  171. .uni-card__content {
  172. padding: 0 !important;
  173. }
  174. }
  175. .enterpriseName {
  176. color: #404040;
  177. font-weight: 700;
  178. }
  179. .enterAvatar {
  180. width: 60px;
  181. height: 60px;
  182. // border-radius: 50%;
  183. margin: auto;
  184. }
  185. .titleBox {
  186. text-align: center;
  187. padding: 0 20rpx 15px;
  188. .title {
  189. font-size: 20px;
  190. font-weight: 600;
  191. margin-bottom: 12px;
  192. }
  193. .entName {
  194. color: var( --v-primary-base);
  195. }
  196. }
  197. </style>