positions.vue 4.5 KB

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