crowdsourcing.vue 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252
  1. <template>
  2. <layout-page>
  3. <scroll-view class="scrollBox" scroll-y="true" @scrolltolower="loadingMore" style="position:relative;">
  4. <view class="content defaultBgc">
  5. <view class="content-top">
  6. <view class="content-top-title">
  7. <view class="content-top-title-label">
  8. <text class="content-top-title-label-l">全员猎聘</text>
  9. <text class="content-top-title-label-s">海量岗位 | 推荐有赏</text>
  10. </view>
  11. </view>
  12. <view class="content-top-carousel">
  13. <view class="content-top-carousel-box">
  14. <SwiperAd :list="swiperAdList"></SwiperAd>
  15. </view>
  16. </view>
  17. <view class="content-top-recommend">
  18. <view class="content-top-recommend-box">
  19. <resume-status>
  20. <template #header>
  21. <view class="content-top-recommend-box-title">
  22. <text class="title">我的推荐</text>
  23. </view>
  24. </template>
  25. </resume-status>
  26. </view>
  27. </view>
  28. </view>
  29. <view class="content-main">
  30. <view class="content-main-list">
  31. <PositionList class="pb-10" :list="items" :noMore="items.length === total"></PositionList>
  32. </view>
  33. </view>
  34. </view>
  35. </scroll-view>
  36. </layout-page>
  37. </template>
  38. <script setup>
  39. import { ref, reactive, watch } from 'vue'
  40. import SwiperAd from '@/components/SwiperAd'
  41. import { showAuthModal } from '@/hooks/useModal'
  42. import { swiperAdListTest } from '@/utils/testData'
  43. // import { userStore } from '@/store/user'
  44. import layoutPage from '@/layout'
  45. import ResumeStatus from '@/components/ResumeStatus'
  46. import { getJobAdvertisedHire } from '@/api/position.js'
  47. import { getDict } from '@/hooks/useDictionaries.js'
  48. import { dealDictArrayData } from '@/utils/position.js'
  49. import PositionList from '@/components/PositionList'
  50. const swiperAdList = ref(swiperAdListTest)
  51. const items = reactive([])
  52. const pageInfo = ref({
  53. pageNo: 1,
  54. pageSize: 10
  55. })
  56. const loading = ref(false)
  57. const total = ref(0)
  58. const loadingMore = (e) => {
  59. if (total.value === items.length) {
  60. return
  61. }
  62. if (loading.value) {
  63. return
  64. }
  65. pageInfo.value.pageNo++
  66. getList()
  67. }
  68. async function getList () {
  69. loading.value = true
  70. try {
  71. const { data } = await getJobAdvertisedHire({
  72. ...pageInfo.value
  73. })
  74. if (!data?.list) {
  75. pageInfo.pageNo--
  76. return
  77. }
  78. const _items = dealDictArrayData([], data.list)
  79. items.push(..._items.map(e => {
  80. return {
  81. job: e,
  82. enterprise: {
  83. welfareList: e.tagList,
  84. logoUrl: e.logoUrl,
  85. anotherName: e.anotherName,
  86. industryName: e.industryName,
  87. scaleName: e.scaleName
  88. }
  89. }
  90. }))
  91. total.value = +data.total
  92. } catch (error) {
  93. pageInfo.pageNo--
  94. } finally {
  95. loading.value = false
  96. }
  97. }
  98. getList()
  99. </script>
  100. <style scoped lang="scss">
  101. $defaultColor: #999;
  102. @mixin box {
  103. // border-radius: 24rpx;
  104. width: 100%;
  105. height: 100%;
  106. background: #FFF;
  107. overflow: hidden;
  108. }
  109. .content {
  110. &-top {
  111. &-title {
  112. padding: 24rpx;
  113. box-sizing: border-box;
  114. width: 100%;
  115. display: flex;
  116. justify-content: space-between;
  117. align-items: flex-end;
  118. background-color: #FFF;
  119. &-label {
  120. display: flex;
  121. align-items: flex-end;
  122. &-l {
  123. font-size: 46rpx;
  124. margin-right: 16rpx;
  125. }
  126. &-s {
  127. font-size: 24rpx;
  128. color: $defaultColor;
  129. }
  130. }
  131. &-local {
  132. color: $defaultColor;
  133. display: flex;
  134. align-items: flex-end;
  135. }
  136. }
  137. &-carousel {
  138. padding: 24rpx;
  139. }
  140. &-recommend {
  141. padding: 0 24rpx;
  142. &-box {
  143. @include box;
  144. &-title {
  145. display: flex;
  146. justify-content: space-between;
  147. align-items: flex-end;
  148. padding: 20rpx;
  149. font-size: 30rpx;
  150. .route {
  151. color: $defaultColor;
  152. font-size: .75em;
  153. }
  154. }
  155. }
  156. }
  157. }
  158. &-main {
  159. &-filter {
  160. padding: 24rpx;
  161. font-size: 30rpx;
  162. color: $defaultColor;
  163. display: flex;
  164. justify-content: space-between;
  165. &-type{
  166. &-item {
  167. padding: 20rpx;
  168. &.active {
  169. color: #000;
  170. }
  171. }
  172. }
  173. }
  174. &-list {
  175. width: 100%;
  176. padding: 0 24rpx 24rpx 24rpx;
  177. box-sizing: border-box;
  178. &-box {
  179. padding: 24rpx;
  180. margin-bottom: 24rpx;
  181. box-sizing: border-box;
  182. @include box;
  183. .top {
  184. width: 100%;
  185. display: flex;
  186. justify-content: space-between;
  187. .title {
  188. flex: 1;
  189. overflow: hidden; /* 隐藏超出部分 */
  190. white-space: nowrap; /* 不换行 */
  191. text-overflow: ellipsis; /* 超出部分显示省略号 */
  192. }
  193. .remuneration {
  194. color: aquamarine;
  195. }
  196. }
  197. .main {
  198. display: flex;
  199. font-size: 24rpx;
  200. margin: 28rpx 0;
  201. .tag {
  202. &.blue {
  203. background: aliceblue;
  204. color: royalblue;
  205. }
  206. font-size: 20rpx;
  207. border-radius: 8rpx;
  208. color: #666;
  209. background: #eee;
  210. padding: 6rpx 10rpx;
  211. margin-right: 20rpx;
  212. }
  213. }
  214. .bottom {
  215. color: #666;
  216. display: flex;
  217. justify-content: space-between;
  218. .origin {
  219. font-size: 0.8em;
  220. .interval {
  221. padding: 0 16rpx;
  222. }
  223. }
  224. .local {
  225. color: #aaa;
  226. font-size: 0.6em;
  227. }
  228. }
  229. }
  230. .noMore {
  231. font-size: 24rpx;
  232. color: $defaultColor;
  233. text-align: center;
  234. }
  235. }
  236. }
  237. }
  238. .scrollBox {
  239. height: 100vh;
  240. }
  241. </style>