crowdsourcing.vue 7.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331
  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 class="content-top-title-local" @tap="handleMap">
  12. <uni-icons type="icon-map" custom-prefix="iconfont" color="#999"/>
  13. {{ useUserStore.isLogin ? localtion : null }}
  14. </view> -->
  15. </view>
  16. <view class="content-top-carousel">
  17. <view class="content-top-carousel-box">
  18. <SwiperAd :list="swiperAdList"></SwiperAd>
  19. </view>
  20. </view>
  21. <view class="content-top-recommend">
  22. <view class="content-top-recommend-box">
  23. <resume-status>
  24. <template #header>
  25. <view class="content-top-recommend-box-title">
  26. <text class="title">我的推荐</text>
  27. <!-- <view class="route">
  28. <text>推荐好友入职得赏金</text>
  29. <uni-icons type="icon-right" custom-prefix="iconfont" color="#999"/>
  30. </view> -->
  31. </view>
  32. </template>
  33. </resume-status>
  34. </view>
  35. </view>
  36. </view>
  37. <view class="content-main">
  38. <!-- <view class="content-main-filter">
  39. <view class="content-main-filter-type">
  40. <text
  41. v-for="item in chooseItems"
  42. :key="item"
  43. class="content-main-filter-type-item"
  44. :class="{ active: item === chooseItem}"
  45. @tap="handleChoose(item)"
  46. >{{ item}}</text>
  47. </view>
  48. <view class="content-main-filter-filter">
  49. <text>筛选</text>
  50. <uni-icons type="icon-Filter" custom-prefix="iconfont" color="#999"/>
  51. </view>
  52. </view> -->
  53. <view class="content-main-list">
  54. <PositionList class="pb-10" :list="items" :noMore="items.length === total"></PositionList>
  55. <!-- template v-if="items.length === 0">
  56. <view class="nodata-img-parent">
  57. <image src="https://minio.citupro.com/dev/static/nodata.png" mode="widthFix" style="width: 100vw;height: 100vh;"></image>
  58. </view>
  59. </template>
  60. <view v-for="(item,index) in items" :key="item.id" class="content-main-list-box">
  61. <view class="top">
  62. <view class="title">{{ item.name }}</view>
  63. <text class="remuneration">
  64. {{ item.payFrom }}
  65. {{ item.payTo ? ' - ' : ''}}
  66. {{ item.payTo }}
  67. {{ item.payName }}
  68. </text>
  69. </view>
  70. <view class="main">
  71. <view class="tag blue">
  72. <uni-icons
  73. type="icon-renminbi1688"
  74. size="10"
  75. custom-prefix="iconfont"
  76. color="royalblue"
  77. />
  78. {{ item.hirePrice }}
  79. </view>
  80. <view v-for="tag in item.tagList" :key="tag + index" class="tag">
  81. {{ tag }}
  82. </view>
  83. </view>
  84. <view class="bottom">
  85. <view class="origin">
  86. <text>{{ item.anotherName }}</text>
  87. <text class="interval">·</text>
  88. <text>{{ item.areaName }}</text>
  89. </view>
  90. </view>
  91. </view>
  92. <template v-if="items.length === total">
  93. <view class="noMore">
  94. 没有更多了
  95. </view>
  96. </template> -->
  97. </view>
  98. </view>
  99. <!-- <image src="https://minio.citupro.com/dev/static/nodata.png" mode="widthFix" style="width: 100vw;height: 100vh;"></image> -->
  100. </view>
  101. </scroll-view>
  102. </layout-page>
  103. </template>
  104. <script setup>
  105. import { ref, reactive } from 'vue'
  106. import SwiperAd from '@/components/SwiperAd'
  107. import { showAuthModal } from '@/hooks/useModal'
  108. import { swiperAdListTest } from '@/utils/testData'
  109. // import { userStore } from '@/store/user'
  110. import layoutPage from '@/layout'
  111. import ResumeStatus from '@/components/ResumeStatus'
  112. import { getJobAdvertisedHire } from '@/api/position.js'
  113. import { getDict } from '@/hooks/useDictionaries.js'
  114. import { dealDictArrayData } from '@/utils/position.js'
  115. import PositionList from '@/components/PositionList'
  116. const swiperAdList = ref(swiperAdListTest)
  117. // const useUserStore = userStore()
  118. // const localtion = ref('全国')
  119. // const chooseItem = ref('同城')
  120. // const chooseItems = reactive(['同城','最新'])
  121. const items = reactive([])
  122. // const unitDict = ref([])
  123. // const areaDict = ref([])
  124. const pageInfo = ref({
  125. pageNo: 1,
  126. pageSize: 10
  127. })
  128. const loading = ref(false)
  129. const total = ref(0)
  130. const loadingMore = (e) => {
  131. // console.log(total.value, items.length)
  132. if (total.value === items.length) {
  133. return
  134. }
  135. if (loading.value) {
  136. return
  137. }
  138. pageInfo.value.pageNo++
  139. getList()
  140. }
  141. // function handleDetails (item) {
  142. // console.log(item)
  143. // }
  144. async function getList () {
  145. loading.value = true
  146. try {
  147. const { data } = await getJobAdvertisedHire({
  148. ...pageInfo.value
  149. })
  150. if (!data?.list) {
  151. pageInfo.pageNo--
  152. return
  153. }
  154. const _items = dealDictArrayData([], data.list)
  155. items.push(..._items.map(e => {
  156. return {
  157. job: e,
  158. enterprise: {
  159. welfareList: e.tagList,
  160. logoUrl: e.logoUrl,
  161. anotherName: e.anotherName,
  162. industryName: e.industryName,
  163. scaleName: e.scaleName
  164. }
  165. }
  166. }))
  167. total.value = +data.total
  168. } catch (error) {
  169. pageInfo.pageNo--
  170. } finally {
  171. loading.value = false
  172. }
  173. }
  174. getList()
  175. </script>
  176. <style scoped lang="scss">
  177. $defaultColor: #999;
  178. @mixin box {
  179. // border-radius: 24rpx;
  180. width: 100%;
  181. height: 100%;
  182. background: #FFF;
  183. overflow: hidden;
  184. }
  185. .content {
  186. &-top {
  187. &-title {
  188. padding: 24rpx;
  189. box-sizing: border-box;
  190. width: 100%;
  191. display: flex;
  192. justify-content: space-between;
  193. align-items: flex-end;
  194. background-color: #FFF;
  195. &-label {
  196. display: flex;
  197. align-items: flex-end;
  198. &-l {
  199. font-size: 46rpx;
  200. margin-right: 16rpx;
  201. }
  202. &-s {
  203. font-size: 24rpx;
  204. color: $defaultColor;
  205. }
  206. }
  207. &-local {
  208. color: $defaultColor;
  209. display: flex;
  210. align-items: flex-end;
  211. }
  212. }
  213. &-carousel {
  214. padding: 24rpx;
  215. }
  216. &-recommend {
  217. padding: 0 24rpx;
  218. &-box {
  219. @include box;
  220. &-title {
  221. display: flex;
  222. justify-content: space-between;
  223. align-items: flex-end;
  224. padding: 20rpx;
  225. font-size: 30rpx;
  226. .route {
  227. color: $defaultColor;
  228. font-size: .75em;
  229. }
  230. }
  231. }
  232. }
  233. }
  234. &-main {
  235. &-filter {
  236. padding: 24rpx;
  237. font-size: 30rpx;
  238. color: $defaultColor;
  239. display: flex;
  240. justify-content: space-between;
  241. &-type{
  242. &-item {
  243. padding: 20rpx;
  244. &.active {
  245. color: #000;
  246. }
  247. }
  248. }
  249. }
  250. &-list {
  251. width: 100%;
  252. padding: 0 24rpx 24rpx 24rpx;
  253. box-sizing: border-box;
  254. &-box {
  255. padding: 24rpx;
  256. margin-bottom: 24rpx;
  257. box-sizing: border-box;
  258. @include box;
  259. .top {
  260. width: 100%;
  261. display: flex;
  262. justify-content: space-between;
  263. .title {
  264. flex: 1;
  265. overflow: hidden; /* 隐藏超出部分 */
  266. white-space: nowrap; /* 不换行 */
  267. text-overflow: ellipsis; /* 超出部分显示省略号 */
  268. }
  269. .remuneration {
  270. color: aquamarine;
  271. }
  272. }
  273. .main {
  274. display: flex;
  275. font-size: 24rpx;
  276. margin: 28rpx 0;
  277. .tag {
  278. &.blue {
  279. background: aliceblue;
  280. color: royalblue;
  281. }
  282. font-size: 20rpx;
  283. border-radius: 8rpx;
  284. color: #666;
  285. background: #eee;
  286. padding: 6rpx 10rpx;
  287. margin-right: 20rpx;
  288. }
  289. }
  290. .bottom {
  291. color: #666;
  292. display: flex;
  293. justify-content: space-between;
  294. .origin {
  295. font-size: 0.8em;
  296. .interval {
  297. padding: 0 16rpx;
  298. }
  299. }
  300. .local {
  301. color: #aaa;
  302. font-size: 0.6em;
  303. }
  304. }
  305. }
  306. .noMore {
  307. font-size: 24rpx;
  308. color: $defaultColor;
  309. text-align: center;
  310. }
  311. }
  312. }
  313. }
  314. .scrollBox {
  315. height: 100vh;
  316. }
  317. </style>