crowdsourcing.vue 6.6 KB

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