crowdsourcing.vue 7.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350
  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. console.log(items)
  182. total.value = +data.total
  183. }
  184. getDictionaries()
  185. </script>
  186. <style scoped lang="scss">
  187. $defaultColor: #999;
  188. @mixin box {
  189. border-radius: 24rpx;
  190. width: 100%;
  191. height: 100%;
  192. background: #FFF;
  193. overflow: hidden;
  194. }
  195. .content {
  196. &-top {
  197. &-title {
  198. padding: 24rpx;
  199. box-sizing: border-box;
  200. width: 100%;
  201. display: flex;
  202. justify-content: space-between;
  203. align-items: flex-end;
  204. background-color: #FFF;
  205. &-label {
  206. display: flex;
  207. align-items: flex-end;
  208. &-l {
  209. font-size: 46rpx;
  210. margin-right: 16rpx;
  211. }
  212. &-s {
  213. font-size: 24rpx;
  214. color: $defaultColor;
  215. }
  216. }
  217. &-local {
  218. color: $defaultColor;
  219. display: flex;
  220. align-items: flex-end;
  221. }
  222. }
  223. &-carousel {
  224. padding: 24rpx;
  225. height: 300rpx;
  226. &-box {
  227. @include box;
  228. }
  229. }
  230. &-recommend {
  231. padding: 24rpx;
  232. &-box {
  233. @include box;
  234. &-title {
  235. display: flex;
  236. justify-content: space-between;
  237. align-items: flex-end;
  238. padding: 20rpx;
  239. font-size: 30rpx;
  240. .route {
  241. color: $defaultColor;
  242. font-size: .75em;
  243. }
  244. }
  245. }
  246. }
  247. }
  248. &-main {
  249. &-filter {
  250. padding: 24rpx;
  251. font-size: 30rpx;
  252. color: $defaultColor;
  253. display: flex;
  254. justify-content: space-between;
  255. &-type{
  256. &-item {
  257. padding: 20rpx;
  258. &.active {
  259. color: #000;
  260. }
  261. }
  262. }
  263. }
  264. &-list {
  265. width: 100%;
  266. padding: 0 24rpx 24rpx 24rpx;
  267. box-sizing: border-box;
  268. &-box {
  269. padding: 24rpx;
  270. margin-bottom: 24rpx;
  271. box-sizing: border-box;
  272. @include box;
  273. .top {
  274. width: 100%;
  275. display: flex;
  276. justify-content: space-between;
  277. .title {
  278. flex: 1;
  279. overflow: hidden; /* 隐藏超出部分 */
  280. white-space: nowrap; /* 不换行 */
  281. text-overflow: ellipsis; /* 超出部分显示省略号 */
  282. }
  283. .remuneration {
  284. color: aquamarine;
  285. }
  286. }
  287. .main {
  288. display: flex;
  289. font-size: 24rpx;
  290. margin: 28rpx 0;
  291. .tag {
  292. &.blue {
  293. background: aliceblue;
  294. color: royalblue;
  295. }
  296. font-size: 20rpx;
  297. border-radius: 8rpx;
  298. color: #666;
  299. background: #eee;
  300. padding: 6rpx 10rpx;
  301. margin-right: 20rpx;
  302. }
  303. }
  304. .bottom {
  305. color: #666;
  306. display: flex;
  307. justify-content: space-between;
  308. .origin {
  309. font-size: 0.8em;
  310. .interval {
  311. padding: 0 16rpx;
  312. }
  313. }
  314. .local {
  315. color: #aaa;
  316. font-size: 0.6em;
  317. }
  318. }
  319. }
  320. .noMore {
  321. font-size: 24rpx;
  322. color: $defaultColor;
  323. text-align: center;
  324. }
  325. }
  326. }
  327. }
  328. .scrollBox {
  329. height: 100vh;
  330. }
  331. </style>