positions.vue 4.6 KB

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