crowdsourcing.vue 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261
  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 } 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. import { onShow } from '@dcloudio/uni-app'
  51. // 设置自定义tabbar选中值
  52. onShow(() => {
  53. const currentPage = getCurrentPages()[0]; // 获取当前页面实例
  54. const currentTabBar = currentPage?.getTabBar?.();
  55. // 设置当前tab页的下标index
  56. currentTabBar?.setData({ selected: 3 });
  57. getList()
  58. })
  59. const swiperAdList = ref(swiperAdListTest)
  60. const items = reactive([])
  61. const pageInfo = ref({
  62. pageNo: 1,
  63. pageSize: 10
  64. })
  65. const loading = ref(false)
  66. const total = ref(0)
  67. const loadingMore = (e) => {
  68. if (total.value === items.length) {
  69. return
  70. }
  71. if (loading.value) {
  72. return
  73. }
  74. pageInfo.value.pageNo++
  75. getList()
  76. }
  77. async function getList () {
  78. loading.value = true
  79. try {
  80. const { data } = await getJobAdvertisedHire({
  81. ...pageInfo.value
  82. })
  83. if (!data?.list) {
  84. pageInfo.pageNo--
  85. return
  86. }
  87. const _items = dealDictArrayData([], data.list)
  88. items.push(..._items.map(e => {
  89. return {
  90. job: e,
  91. enterprise: {
  92. welfareList: e.tagList,
  93. logoUrl: e.logoUrl,
  94. anotherName: e.anotherName,
  95. industryName: e.industryName,
  96. scaleName: e.scaleName
  97. }
  98. }
  99. }))
  100. total.value = +data.total
  101. } catch (error) {
  102. pageInfo.pageNo--
  103. } finally {
  104. loading.value = false
  105. }
  106. }
  107. </script>
  108. <style scoped lang="scss">
  109. $defaultColor: #999;
  110. @mixin box {
  111. // border-radius: 24rpx;
  112. width: 100%;
  113. height: 100%;
  114. background: #FFF;
  115. overflow: hidden;
  116. }
  117. .content {
  118. &-top {
  119. &-title {
  120. padding: 24rpx;
  121. box-sizing: border-box;
  122. width: 100%;
  123. display: flex;
  124. justify-content: space-between;
  125. align-items: flex-end;
  126. background-color: #FFF;
  127. &-label {
  128. display: flex;
  129. align-items: flex-end;
  130. &-l {
  131. font-size: 46rpx;
  132. margin-right: 16rpx;
  133. }
  134. &-s {
  135. font-size: 24rpx;
  136. color: $defaultColor;
  137. }
  138. }
  139. &-local {
  140. color: $defaultColor;
  141. display: flex;
  142. align-items: flex-end;
  143. }
  144. }
  145. &-carousel {
  146. padding: 24rpx;
  147. }
  148. &-recommend {
  149. padding: 0 24rpx;
  150. &-box {
  151. @include box;
  152. &-title {
  153. display: flex;
  154. justify-content: space-between;
  155. align-items: flex-end;
  156. padding: 20rpx;
  157. font-size: 30rpx;
  158. .route {
  159. color: $defaultColor;
  160. font-size: .75em;
  161. }
  162. }
  163. }
  164. }
  165. }
  166. &-main {
  167. &-filter {
  168. padding: 24rpx;
  169. font-size: 30rpx;
  170. color: $defaultColor;
  171. display: flex;
  172. justify-content: space-between;
  173. &-type{
  174. &-item {
  175. padding: 20rpx;
  176. &.active {
  177. color: #000;
  178. }
  179. }
  180. }
  181. }
  182. &-list {
  183. width: 100%;
  184. padding: 0 24rpx 24rpx 24rpx;
  185. box-sizing: border-box;
  186. &-box {
  187. padding: 24rpx;
  188. margin-bottom: 24rpx;
  189. box-sizing: border-box;
  190. @include box;
  191. .top {
  192. width: 100%;
  193. display: flex;
  194. justify-content: space-between;
  195. .title {
  196. flex: 1;
  197. overflow: hidden; /* 隐藏超出部分 */
  198. white-space: nowrap; /* 不换行 */
  199. text-overflow: ellipsis; /* 超出部分显示省略号 */
  200. }
  201. .remuneration {
  202. color: aquamarine;
  203. }
  204. }
  205. .main {
  206. display: flex;
  207. font-size: 24rpx;
  208. margin: 28rpx 0;
  209. .tag {
  210. &.blue {
  211. background: aliceblue;
  212. color: royalblue;
  213. }
  214. font-size: 20rpx;
  215. border-radius: 8rpx;
  216. color: #666;
  217. background: #eee;
  218. padding: 6rpx 10rpx;
  219. margin-right: 20rpx;
  220. }
  221. }
  222. .bottom {
  223. color: #666;
  224. display: flex;
  225. justify-content: space-between;
  226. .origin {
  227. font-size: 0.8em;
  228. .interval {
  229. padding: 0 16rpx;
  230. }
  231. }
  232. .local {
  233. color: #aaa;
  234. font-size: 0.6em;
  235. }
  236. }
  237. }
  238. .noMore {
  239. font-size: 24rpx;
  240. color: $defaultColor;
  241. text-align: center;
  242. }
  243. }
  244. }
  245. }
  246. .scrollBox {
  247. height: 100vh;
  248. }
  249. </style>