index.vue 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149
  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 list-item-bgc 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.menduner.com/dev/cd7f5e26a239fb0ab335585e04c709b065f52832fc31539b3a5423224fc6d16c.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' : '46vw'}">{{ 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.menduner.com/dev/bb43df1dc91945e05ee93da76e49b34f87b0d10203eb76c20e2d4999a13b9a0a.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 total = ref(0)
  61. const query = ref({
  62. pageNo: 1,
  63. pageSize: 10
  64. })
  65. // 精选企业列表
  66. const getPopularEnterprise = async () => {
  67. const { data } = await getHotEnterprise(query.value)
  68. const list = data?.list || []
  69. if (!list.length && query.value.pageNo === 1) {
  70. items.value = []
  71. return
  72. }
  73. if (list?.length) {
  74. list.forEach(e => {
  75. e.enterprise = dealDictObjData({}, e.enterprise)
  76. if (e.jobList && e.jobList.length) e.jobList = dealDictArrayData([], e.jobList).slice(0, 2)
  77. })
  78. items.value = items.value.concat(list)
  79. }
  80. total.value = data?.total || 0
  81. more.value = items.value.length === total.value ? 'noMore' : 'more'
  82. }
  83. getPopularEnterprise()
  84. // 加载更多
  85. const loadingMore = () => {
  86. if (total.value <= 0) return
  87. more.value = 'loading'
  88. query.value.pageNo++
  89. getPopularEnterprise()
  90. }
  91. // 职位详情
  92. const handleToPosition = (k) => {
  93. const url = `/pagesB/positionDetail/index?id=${k.id}&area=${k.area?.str ?? '全国'}`
  94. uni.navigateTo({ url })
  95. }
  96. </script>
  97. <style scoped lang="scss">
  98. .list-item {
  99. margin: 30rpx;
  100. border-radius: 20rpx;
  101. padding: 30rpx;
  102. box-shadow: 1px 2px 12px rgba(0, 0, 0, 0.17);
  103. &:last-child {
  104. margin-bottom: 0;
  105. }
  106. &:first-child {
  107. margin-top: 0;
  108. }
  109. }
  110. .enterpriseName {
  111. font-size: 30rpx;
  112. font-weight: 600;
  113. font-size: 30rpx;
  114. font-style: normal;
  115. text-transform: none;
  116. }
  117. .enterAvatar {
  118. width: 60px;
  119. height: 60px;
  120. margin: auto;
  121. }
  122. .list-shape {
  123. border-radius: 12px 12px 0 0;
  124. .titleBox {
  125. display: flex;
  126. align-items: center;
  127. justify-content: space-between;
  128. }
  129. }
  130. .salary-text {
  131. float: right;
  132. font-size: 15px;
  133. color: #00B760;
  134. font-weight: 500;
  135. }
  136. .job-name {
  137. font-size: 30rpx;
  138. overflow: hidden;
  139. white-space: nowrap;
  140. text-overflow: ellipsis;
  141. }
  142. </style>