crowdsourcing.vue 6.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294
  1. <template>
  2. <layout-page>
  3. <view class="content defaultBgc">
  4. <view class="content-top">
  5. <view class="content-top-title">
  6. <view class="content-top-title-label">
  7. <text class="content-top-title-label-l">全员猎聘</text>
  8. <text class="content-top-title-label-s">海量岗位 | 推荐有赏</text>
  9. </view>
  10. </view>
  11. </view>
  12. <scroll-view class="scrollBox" scroll-y="true" @scrolltolower="loadingMore" style="position:relative;">
  13. <view class="content-top">
  14. <view class="content-top-carousel">
  15. <view class="content-top-carousel-box">
  16. <SwiperAd :list="swiperAdList" :strType="false" @click="handleToDetails"></SwiperAd>
  17. </view>
  18. </view>
  19. <view class="content-top-recommend">
  20. <view class="content-top-recommend-box">
  21. <resume-status>
  22. <template #header>
  23. <view class="content-top-recommend-box-title">
  24. <text class="title">我的推荐</text>
  25. </view>
  26. </template>
  27. </resume-status>
  28. </view>
  29. </view>
  30. </view>
  31. <view class="content-main">
  32. <view class="content-main-list">
  33. <PositionList :list="items" :noMore="false"></PositionList>
  34. <uni-load-more :status="more" />
  35. </view>
  36. </view>
  37. </scroll-view>
  38. </view>
  39. </layout-page>
  40. </template>
  41. <script setup>
  42. import { ref, reactive } from 'vue'
  43. import SwiperAd from '@/components/SwiperAd'
  44. import layoutPage from '@/layout'
  45. import ResumeStatus from '@/components/ResumeStatus'
  46. import { getJobAdvertisedHire } from '@/api/position.js'
  47. import { dealDictArrayData } from '@/utils/position.js'
  48. import PositionList from '@/components/PositionList'
  49. import { onShow, onLoad, onShareAppMessage } from '@dcloudio/uni-app'
  50. // 设置自定义tabbar选中值
  51. onShow(() => {
  52. const currentPage = getCurrentPages()[0]; // 获取当前页面实例
  53. const currentTabBar = currentPage?.getTabBar?.();
  54. // 设置当前tab页的下标index
  55. currentTabBar?.setData({ selected: 3 });
  56. })
  57. const swiperAdList = [
  58. { src: 'https://minio.menduner.com/dev/menduner/banner/IHG.gif', id: '577540545828753408' },
  59. { src: 'https://minio.menduner.com/dev/menduner/banner/Marriott.jpg', id: '734173233779183616' },
  60. { src: 'https://minio.menduner.com/dev/menduner/banner/UrCove.jpg', id: '277182701256183808' },
  61. { src: 'https://minio.menduner.com/dev/menduner/miniProgram/Grand-Mercure.jpg', id: '120281807903133696' }
  62. ]
  63. const items = reactive([])
  64. const pageInfo = ref({
  65. pageNo: 1,
  66. pageSize: 20
  67. })
  68. const loading = ref(false)
  69. const total = ref(0)
  70. const more = ref('more')
  71. // 跳转企业详情
  72. const handleToDetails = ({ id }) => {
  73. if (!id) return
  74. uni.navigateTo({
  75. url: `/pagesB/companyDetail/index?id=${id}`
  76. })
  77. }
  78. onLoad(() => {
  79. getList()
  80. wx.showShareMenu({
  81. withShareTicket: true,
  82. menus: ['shareAppMessage']
  83. })
  84. onShareAppMessage(() => {
  85. return {
  86. title: '门墩儿 专注顶尖招聘',
  87. path: '/pages/index/position',
  88. // imageUrl: 'https://minio.menduner.com/dev/menduner/miniProgram/share-cover.jpg'
  89. }
  90. })
  91. })
  92. const loadingMore = (e) => {
  93. if (total.value === items.length) {
  94. return
  95. }
  96. if (loading.value) {
  97. return
  98. }
  99. more.value = 'loading'
  100. pageInfo.value.pageNo++
  101. getList()
  102. }
  103. async function getList () {
  104. loading.value = true
  105. try {
  106. const { data } = await getJobAdvertisedHire({
  107. ...pageInfo.value
  108. })
  109. if (!data?.list) {
  110. pageInfo.pageNo--
  111. return
  112. }
  113. const _items = dealDictArrayData([], data.list)
  114. items.push(..._items.map(e => {
  115. return {
  116. job: e,
  117. enterprise: {
  118. welfareList: e.tagList,
  119. logoUrl: e.logoUrl,
  120. anotherName: e.anotherName,
  121. industryName: e.industryName,
  122. scaleName: e.scaleName
  123. }
  124. }
  125. }))
  126. total.value = +data.total
  127. more.value = items.length === total.value ? 'noMore' : 'more'
  128. } catch (error) {
  129. more.value = more
  130. pageInfo.pageNo--
  131. } finally {
  132. loading.value = false
  133. }
  134. }
  135. </script>
  136. <style scoped lang="scss">
  137. $defaultColor: #999;
  138. @mixin box {
  139. // border-radius: 24rpx;
  140. width: 100%;
  141. height: 100%;
  142. background: #FFF;
  143. overflow: hidden;
  144. }
  145. .content {
  146. height: 100vh;
  147. display: flex;
  148. flex-direction: column;
  149. &-top {
  150. &-title {
  151. padding: 24rpx;
  152. box-sizing: border-box;
  153. width: 100%;
  154. display: flex;
  155. justify-content: space-between;
  156. align-items: flex-end;
  157. background-color: #FFF;
  158. &-label {
  159. display: flex;
  160. align-items: flex-end;
  161. &-l {
  162. font-size: 46rpx;
  163. margin-right: 16rpx;
  164. }
  165. &-s {
  166. font-size: 24rpx;
  167. color: $defaultColor;
  168. }
  169. }
  170. &-local {
  171. color: $defaultColor;
  172. display: flex;
  173. align-items: flex-end;
  174. }
  175. }
  176. // &-carousel {
  177. // padding: 24rpx;
  178. // }
  179. &-recommend {
  180. padding: 0 24rpx;
  181. &-box {
  182. @include box;
  183. &-title {
  184. display: flex;
  185. justify-content: space-between;
  186. align-items: flex-end;
  187. padding: 20rpx;
  188. font-size: 30rpx;
  189. .route {
  190. color: $defaultColor;
  191. font-size: .75em;
  192. }
  193. }
  194. }
  195. }
  196. }
  197. &-main {
  198. &-filter {
  199. padding: 24rpx;
  200. font-size: 30rpx;
  201. color: $defaultColor;
  202. display: flex;
  203. justify-content: space-between;
  204. &-type{
  205. &-item {
  206. padding: 20rpx;
  207. &.active {
  208. color: #000;
  209. }
  210. }
  211. }
  212. }
  213. &-list {
  214. width: 100%;
  215. // padding: 0 24rpx 24rpx 24rpx;
  216. box-sizing: border-box;
  217. &-box {
  218. padding: 24rpx;
  219. margin-bottom: 24rpx;
  220. box-sizing: border-box;
  221. @include box;
  222. .top {
  223. width: 100%;
  224. display: flex;
  225. justify-content: space-between;
  226. .title {
  227. flex: 1;
  228. overflow: hidden; /* 隐藏超出部分 */
  229. white-space: nowrap; /* 不换行 */
  230. text-overflow: ellipsis; /* 超出部分显示省略号 */
  231. }
  232. .remuneration {
  233. color: aquamarine;
  234. }
  235. }
  236. .main {
  237. display: flex;
  238. font-size: 24rpx;
  239. margin: 28rpx 0;
  240. .tag {
  241. &.blue {
  242. background: aliceblue;
  243. color: royalblue;
  244. }
  245. font-size: 20rpx;
  246. border-radius: 8rpx;
  247. color: #666;
  248. background: #eee;
  249. padding: 6rpx 10rpx;
  250. margin-right: 20rpx;
  251. }
  252. }
  253. .bottom {
  254. color: #666;
  255. display: flex;
  256. justify-content: space-between;
  257. .origin {
  258. font-size: 0.8em;
  259. .interval {
  260. padding: 0 16rpx;
  261. }
  262. }
  263. .local {
  264. color: #aaa;
  265. font-size: 0.6em;
  266. }
  267. }
  268. }
  269. .noMore {
  270. font-size: 24rpx;
  271. color: $defaultColor;
  272. text-align: center;
  273. }
  274. }
  275. }
  276. }
  277. .scrollBox {
  278. height: 0;
  279. flex: 1;
  280. padding-bottom: 120rpx;
  281. }
  282. </style>