crowdsourcing.vue 6.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302
  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, onShareTimeline } 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. { src: 'https://minio.menduner.com/dev/5eb89c28816dbc7613986ac994d2d760cc9fada84e17a78970c424904c26667c.jpg', id: '735167920258289664' }
  63. ]
  64. const items = reactive([])
  65. const pageInfo = ref({
  66. pageNo: 1,
  67. pageSize: 20
  68. })
  69. const loading = ref(false)
  70. const total = ref(0)
  71. const more = ref('more')
  72. // 跳转企业详情
  73. const handleToDetails = ({ id }) => {
  74. if (!id) return
  75. uni.navigateTo({
  76. url: `/pagesB/companyDetail/index?id=${id}`
  77. })
  78. }
  79. onLoad(() => {
  80. getList()
  81. wx.showShareMenu({
  82. withShareTicket: true,
  83. menus: ['shareAppMessage', 'shareTimeline']
  84. })
  85. onShareAppMessage(() => {
  86. return {
  87. title: '门墩儿 专注顶尖招聘',
  88. path: '/pages/index/position',
  89. imageUrl: 'https://minio.menduner.com/dev/menduner/miniProgram/share-poster.jpg'
  90. }
  91. })
  92. onShareTimeline(() => {
  93. return {
  94. title: '门墩儿 专注顶尖招聘',
  95. path: '/pages/index/position',
  96. imageUrl: 'https://minio.menduner.com/dev/menduner/miniProgram/share-poster.jpg'
  97. }
  98. })
  99. })
  100. const loadingMore = (e) => {
  101. if (total.value === items.length) {
  102. return
  103. }
  104. if (loading.value) {
  105. return
  106. }
  107. more.value = 'loading'
  108. pageInfo.value.pageNo++
  109. getList()
  110. }
  111. async function getList () {
  112. loading.value = true
  113. try {
  114. const { data } = await getJobAdvertisedHire({
  115. ...pageInfo.value
  116. })
  117. if (!data?.list) {
  118. pageInfo.pageNo--
  119. return
  120. }
  121. const _items = dealDictArrayData([], data.list)
  122. items.push(..._items.map(e => {
  123. return {
  124. job: e,
  125. enterprise: {
  126. welfareList: e.tagList,
  127. logoUrl: e.logoUrl,
  128. anotherName: e.anotherName,
  129. industryName: e.industryName,
  130. scaleName: e.scaleName
  131. }
  132. }
  133. }))
  134. total.value = +data.total
  135. more.value = items.length === total.value ? 'noMore' : 'more'
  136. } catch (error) {
  137. more.value = more
  138. pageInfo.pageNo--
  139. } finally {
  140. loading.value = false
  141. }
  142. }
  143. </script>
  144. <style scoped lang="scss">
  145. $defaultColor: #999;
  146. @mixin box {
  147. // border-radius: 24rpx;
  148. width: 100%;
  149. height: 100%;
  150. background: #FFF;
  151. overflow: hidden;
  152. }
  153. .content {
  154. height: 100vh;
  155. display: flex;
  156. flex-direction: column;
  157. &-top {
  158. &-title {
  159. padding: 24rpx;
  160. box-sizing: border-box;
  161. width: 100%;
  162. display: flex;
  163. justify-content: space-between;
  164. align-items: flex-end;
  165. background-color: #FFF;
  166. &-label {
  167. display: flex;
  168. align-items: flex-end;
  169. &-l {
  170. font-size: 46rpx;
  171. margin-right: 16rpx;
  172. }
  173. &-s {
  174. font-size: 24rpx;
  175. color: $defaultColor;
  176. }
  177. }
  178. &-local {
  179. color: $defaultColor;
  180. display: flex;
  181. align-items: flex-end;
  182. }
  183. }
  184. // &-carousel {
  185. // padding: 24rpx;
  186. // }
  187. &-recommend {
  188. padding: 0 24rpx;
  189. &-box {
  190. @include box;
  191. &-title {
  192. display: flex;
  193. justify-content: space-between;
  194. align-items: flex-end;
  195. padding: 20rpx;
  196. font-size: 30rpx;
  197. .route {
  198. color: $defaultColor;
  199. font-size: .75em;
  200. }
  201. }
  202. }
  203. }
  204. }
  205. &-main {
  206. &-filter {
  207. padding: 24rpx;
  208. font-size: 30rpx;
  209. color: $defaultColor;
  210. display: flex;
  211. justify-content: space-between;
  212. &-type{
  213. &-item {
  214. padding: 20rpx;
  215. &.active {
  216. color: #000;
  217. }
  218. }
  219. }
  220. }
  221. &-list {
  222. width: 100%;
  223. // padding: 0 24rpx 24rpx 24rpx;
  224. box-sizing: border-box;
  225. &-box {
  226. padding: 24rpx;
  227. margin-bottom: 24rpx;
  228. box-sizing: border-box;
  229. @include box;
  230. .top {
  231. width: 100%;
  232. display: flex;
  233. justify-content: space-between;
  234. .title {
  235. flex: 1;
  236. overflow: hidden; /* 隐藏超出部分 */
  237. white-space: nowrap; /* 不换行 */
  238. text-overflow: ellipsis; /* 超出部分显示省略号 */
  239. }
  240. .remuneration {
  241. color: aquamarine;
  242. }
  243. }
  244. .main {
  245. display: flex;
  246. font-size: 24rpx;
  247. margin: 28rpx 0;
  248. .tag {
  249. &.blue {
  250. background: aliceblue;
  251. color: royalblue;
  252. }
  253. font-size: 20rpx;
  254. border-radius: 8rpx;
  255. color: #666;
  256. background: #eee;
  257. padding: 6rpx 10rpx;
  258. margin-right: 20rpx;
  259. }
  260. }
  261. .bottom {
  262. color: #666;
  263. display: flex;
  264. justify-content: space-between;
  265. .origin {
  266. font-size: 0.8em;
  267. .interval {
  268. padding: 0 16rpx;
  269. }
  270. }
  271. .local {
  272. color: #aaa;
  273. font-size: 0.6em;
  274. }
  275. }
  276. }
  277. .noMore {
  278. font-size: 24rpx;
  279. color: $defaultColor;
  280. text-align: center;
  281. }
  282. }
  283. }
  284. }
  285. .scrollBox {
  286. height: 0;
  287. flex: 1;
  288. padding-bottom: 120rpx;
  289. }
  290. </style>