crowdsourcing.vue 7.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345
  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 total = ref(0)
  129. // 选择地区
  130. // const handleMap = () => {
  131. // // 检测是否登录
  132. // // 未登录
  133. // if (!useUserStore.isLogin) {
  134. // console.log(111)
  135. // showAuthModal()
  136. // return
  137. // }
  138. // // 已登录
  139. // }
  140. // 切换同城、最新
  141. // const handleChoose = (item) => {
  142. // chooseItem.value = item
  143. // }
  144. const loadingMore = (e) => {
  145. console.log(total.value, items.length)
  146. if (total.value === items.length) {
  147. return
  148. }
  149. pageInfo.value.pageNo++
  150. getList()
  151. }
  152. // async function getRatio () {}
  153. // async function getDictionaries () {
  154. // const { data } = await getDict('menduner_pay_unit')
  155. // unitDict.value = data.data
  156. // const { data: _data } = await getDict('menduner_area_type')
  157. // areaDict.value = _data.data
  158. // getList()
  159. // }
  160. async function getList () {
  161. const { data } = await getJobAdvertisedHire({
  162. ...pageInfo.value
  163. })
  164. if (!data.list) {
  165. pageInfo.pageNo--
  166. return
  167. }
  168. const _items = dealDictArrayData([], data.list)
  169. items.push(..._items.map(e => {
  170. return {
  171. job: e,
  172. enterprise: {
  173. welfareList: e.tagList,
  174. logoUrl: e.logoUrl,
  175. anotherName: e.anotherName,
  176. industryName: e.industryName,
  177. scaleName: e.scaleName
  178. }
  179. }
  180. }))
  181. total.value = +data.total
  182. }
  183. getList()
  184. </script>
  185. <style scoped lang="scss">
  186. $defaultColor: #999;
  187. @mixin box {
  188. border-radius: 24rpx;
  189. width: 100%;
  190. height: 100%;
  191. background: #FFF;
  192. overflow: hidden;
  193. }
  194. .content {
  195. &-top {
  196. &-title {
  197. padding: 24rpx;
  198. box-sizing: border-box;
  199. width: 100%;
  200. display: flex;
  201. justify-content: space-between;
  202. align-items: flex-end;
  203. background-color: #FFF;
  204. &-label {
  205. display: flex;
  206. align-items: flex-end;
  207. &-l {
  208. font-size: 46rpx;
  209. margin-right: 16rpx;
  210. }
  211. &-s {
  212. font-size: 24rpx;
  213. color: $defaultColor;
  214. }
  215. }
  216. &-local {
  217. color: $defaultColor;
  218. display: flex;
  219. align-items: flex-end;
  220. }
  221. }
  222. &-carousel {
  223. padding: 24rpx;
  224. }
  225. &-recommend {
  226. padding: 24rpx;
  227. &-box {
  228. @include box;
  229. &-title {
  230. display: flex;
  231. justify-content: space-between;
  232. align-items: flex-end;
  233. padding: 20rpx;
  234. font-size: 30rpx;
  235. .route {
  236. color: $defaultColor;
  237. font-size: .75em;
  238. }
  239. }
  240. }
  241. }
  242. }
  243. &-main {
  244. &-filter {
  245. padding: 24rpx;
  246. font-size: 30rpx;
  247. color: $defaultColor;
  248. display: flex;
  249. justify-content: space-between;
  250. &-type{
  251. &-item {
  252. padding: 20rpx;
  253. &.active {
  254. color: #000;
  255. }
  256. }
  257. }
  258. }
  259. &-list {
  260. width: 100%;
  261. padding: 0 24rpx 24rpx 24rpx;
  262. box-sizing: border-box;
  263. &-box {
  264. padding: 24rpx;
  265. margin-bottom: 24rpx;
  266. box-sizing: border-box;
  267. @include box;
  268. .top {
  269. width: 100%;
  270. display: flex;
  271. justify-content: space-between;
  272. .title {
  273. flex: 1;
  274. overflow: hidden; /* 隐藏超出部分 */
  275. white-space: nowrap; /* 不换行 */
  276. text-overflow: ellipsis; /* 超出部分显示省略号 */
  277. }
  278. .remuneration {
  279. color: aquamarine;
  280. }
  281. }
  282. .main {
  283. display: flex;
  284. font-size: 24rpx;
  285. margin: 28rpx 0;
  286. .tag {
  287. &.blue {
  288. background: aliceblue;
  289. color: royalblue;
  290. }
  291. font-size: 20rpx;
  292. border-radius: 8rpx;
  293. color: #666;
  294. background: #eee;
  295. padding: 6rpx 10rpx;
  296. margin-right: 20rpx;
  297. }
  298. }
  299. .bottom {
  300. color: #666;
  301. display: flex;
  302. justify-content: space-between;
  303. .origin {
  304. font-size: 0.8em;
  305. .interval {
  306. padding: 0 16rpx;
  307. }
  308. }
  309. .local {
  310. color: #aaa;
  311. font-size: 0.6em;
  312. }
  313. }
  314. }
  315. .noMore {
  316. font-size: 24rpx;
  317. color: $defaultColor;
  318. text-align: center;
  319. }
  320. }
  321. }
  322. }
  323. .scrollBox {
  324. height: 100vh;
  325. }
  326. </style>