index.vue 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146
  1. <template>
  2. <view style="padding-bottom: 30px;">
  3. <scroll-view scroll-y="true" @scrolltolower="loadingMore" style="height: 100vh;">
  4. <view v-if="items.length">
  5. <view v-for="(val, index) in items" :key="index" class="list-item defaultBgc default-border">
  6. <view class="d-flex align-center" @click="jumpToEnterpriseDetail(val.enterprise.id)">
  7. <image class="enterAvatar default-border default-radius" :src="val.enterprise.logoUrl ? val.enterprise.logoUrl : 'https://minio.citupro.com/dev/menduner/company-avatar.png'"></image>
  8. <view class="ss-m-l-20" style="flex: 1;">
  9. <view class="enterpriseName default-text-color MiSans-Semibold">{{ formatName(val.enterprise.anotherName || val.enterprise.name) }}</view>
  10. <view class="ss-m-t-5" style="font-size: 24rpx;">
  11. <span class="color-666 MiSans-Normal ss-m-r-10">{{ val.enterprise?.industryName || '' }}</span>
  12. <span class="color-666 MiSans-Normal">{{ val.enterprise?.scaleName || '' }}</span>
  13. </view>
  14. <view class="ss-m-t-10">
  15. <uni-tag
  16. v-for="(tag,i) in val.enterprise?.welfareList || []"
  17. :key="i"
  18. class="tag-gap ss-m-r-5"
  19. :text="tag"
  20. inverted="false"
  21. size="mini"
  22. custom-style="background-color: #ececec; color: #666; border-color: #ececec; display: inline-block; font-family: MiSans-Normal;"
  23. />
  24. </view>
  25. </view>
  26. </view>
  27. <view class="default-border ss-m-y-20"></view>
  28. <view>
  29. <view class="list-shape" v-for="(k, i) in val.jobList" :key="k.id" @click="handleToPosition(k)" :style="{'padding-bottom': i !== val.jobList.length - 1 ? '10px' : ''}">
  30. <view class="titleBox my-5">
  31. <view class="job-name MiSans-Semibold default-text-color" :style="{'max-width': !k.payFrom && !k.payTo ? '65vw' : '50vw'}">{{ formatName(k.name) }}</view>
  32. <span v-if="!k.payFrom && !k.payTo" class="salary-text MiSans-Bold">面议</span>
  33. <span v-else class="salary-text MiSans-Bold">{{ k.payFrom }}-{{ k.payTo }}{{ k.payName ? '/' + k.payName : '' }}</span>
  34. </view>
  35. <view class="ss-m-t-5" style="font-size: 24rpx;">
  36. <span class="color-666">
  37. <span class="MiSans-Normal ss-m-r-10">{{ k.area?.str ?? '全国' }}</span>
  38. <span class="MiSans-Normal ss-m-r-10">{{ k.eduName }}</span>
  39. <span class="MiSans-Normal">{{ k.expName }}</span>
  40. </span>
  41. </view>
  42. </view>
  43. </view>
  44. </view>
  45. <uni-load-more :status="more" />
  46. </view>
  47. <view v-else class="nodata-img-parent">
  48. <image src="https://minio.citupro.com/dev/static/nodata.png" mode="widthFix" style="width: 100vw;height: 100vh;"></image>
  49. </view>
  50. </scroll-view>
  51. </view>
  52. </template>
  53. <script setup>
  54. import { ref } from 'vue'
  55. import { getHotEnterprise } from '@/api/enterprise'
  56. import { dealDictObjData, dealDictArrayData, jumpToEnterpriseDetail } from '@/utils/position'
  57. import { formatName } from '@/utils/getText'
  58. const more = ref('more')
  59. const items = ref([])
  60. const query = ref({
  61. pageNo: 1,
  62. pageSize: 10
  63. })
  64. // 精选企业列表
  65. const getPopularEnterprise = async () => {
  66. const { data } = await getHotEnterprise(query.value)
  67. const list = data?.list || []
  68. if (!list.length && query.value.pageNo === 1) {
  69. items.value = []
  70. return
  71. }
  72. if (list?.length) {
  73. list.forEach(e => {
  74. e.enterprise = dealDictObjData({}, e.enterprise)
  75. if (e.jobList && e.jobList.length) e.jobList = dealDictArrayData([], e.jobList).slice(0, 2)
  76. })
  77. items.value = items.value.concat(list)
  78. }
  79. more.value = items.value.length === +data.total ? 'noMore' : 'more'
  80. }
  81. getPopularEnterprise()
  82. // 加载更多
  83. const loadingMore = () => {
  84. more.value = 'loading'
  85. query.value.pageNo++
  86. getPopularEnterprise()
  87. }
  88. // 职位详情
  89. const handleToPosition = (k) => {
  90. const url = `/pagesB/positionDetail/index?id=${k.id}&area=${k.area?.str ?? '全国'}`
  91. uni.navigateTo({ url })
  92. }
  93. </script>
  94. <style scoped lang="scss">
  95. .list-item {
  96. margin: 30rpx;
  97. border-radius: 20rpx;
  98. padding: 30rpx;
  99. box-shadow: 1px 2px 12px rgba(0, 0, 0, 0.17);
  100. &:last-child {
  101. margin-bottom: 0;
  102. }
  103. &:first-child {
  104. margin-top: 0;
  105. }
  106. }
  107. .enterpriseName {
  108. font-size: 30rpx;
  109. font-weight: 600;
  110. font-size: 30rpx;
  111. font-style: normal;
  112. text-transform: none;
  113. }
  114. .enterAvatar {
  115. width: 60px;
  116. height: 60px;
  117. margin: auto;
  118. }
  119. .list-shape {
  120. border-radius: 12px 12px 0 0;
  121. .titleBox {
  122. display: flex;
  123. align-items: center;
  124. justify-content: space-between;
  125. }
  126. }
  127. .salary-text {
  128. float: right;
  129. font-size: 15px;
  130. color: #00B760;
  131. font-weight: 500;
  132. }
  133. .job-name {
  134. font-size: 30rpx;
  135. overflow: hidden;
  136. white-space: nowrap;
  137. text-overflow: ellipsis;
  138. }
  139. </style>