crowdsourcing.vue 7.3 KB

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