positions.vue 4.6 KB

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