index.vue 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141
  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. <uni-card v-for="(val, index) in items" :key="index" :is-shadow="true" :border='false' shadow="0px 0px 3px 1px rgba(0,0,0,0.1)">
  6. <view class="d-flex align-center" @click="jumpToEnterpriseDetail(val.enterprise.id)">
  7. <image class="enterAvatar" :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="font-size-16 enterpriseName">{{ formatName(val.enterprise.anotherName || val.enterprise.name) }}</view>
  10. <view class="ss-m-t-5">
  11. <span class="color-999">{{ val.enterprise?.industryName || '' }}</span>
  12. <span class="divider tag-gap1" v-if="val.enterprise?.industryName && val.enterprise?.scaleName"> | </span>
  13. <span class="color-999">{{ val.enterprise?.scaleName || '' }}</span>
  14. </view>
  15. <view class="ss-m-t-10">
  16. <uni-tag
  17. v-for="(tag,i) in val.enterprise?.welfareList || []"
  18. :key="i"
  19. class="tag-gap ss-m-r-5"
  20. :text="tag"
  21. inverted="false"
  22. size="mini"
  23. custom-style="background-color: #ececec; color: #666; border-color: #ececec; display: inline-block;"
  24. />
  25. </view>
  26. </view>
  27. </view>
  28. <view class="line ss-m-y-20"></view>
  29. <view>
  30. <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' : ''}">
  31. <view class="titleBox my-5">
  32. <view class="job-name" :style="{'max-width': !k.payFrom && !k.payTo ? '65vw' : '50vw'}">{{ formatName(k.name) }}</view>
  33. <span v-if="!k.payFrom && !k.payTo" class="salary-text">面议</span>
  34. <span v-else class="salary-text">{{ k.payFrom }}-{{ k.payTo }}{{ k.payName ? '/' + k.payName : '' }}</span>
  35. </view>
  36. <view style="font-size: 13px;" class="ss-m-t-5">
  37. <span class="tag-gap" style="color: #808080;">
  38. <span>{{ k.area?.str ?? '全国' }}</span>
  39. <span class="ss-m-x-10" v-if="k.eduName">|</span>
  40. <span>{{ k.eduName }}</span>
  41. <span class="ss-m-x-10" v-if="k.expName">|</span>
  42. <span>{{ k.expName }}</span>
  43. </span>
  44. </view>
  45. </view>
  46. </view>
  47. </uni-card>
  48. <uni-load-more :status="more" />
  49. </view>
  50. <view v-else class="nodata-img-parent">
  51. <image src="https://minio.citupro.com/dev/static/nodata.png" mode="widthFix" style="width: 100vw;height: 100vh;"></image>
  52. </view>
  53. </scroll-view>
  54. </view>
  55. </template>
  56. <script setup>
  57. import { ref } from 'vue'
  58. import { getHotEnterprise } from '@/api/enterprise'
  59. import { dealDictObjData, dealDictArrayData, jumpToEnterpriseDetail } from '@/utils/position'
  60. import { formatName } from '@/utils/getText'
  61. const more = ref('more')
  62. const items = ref([])
  63. const query = ref({
  64. pageNo: 1,
  65. pageSize: 10
  66. })
  67. // 精选企业列表
  68. const getPopularEnterprise = async () => {
  69. const { data } = await getHotEnterprise(query.value)
  70. const list = data?.list || []
  71. if (!list.length && query.value.pageNo === 1) {
  72. items.value = []
  73. return
  74. }
  75. if (list?.length) {
  76. list.forEach(e => {
  77. e.enterprise = dealDictObjData({}, e.enterprise)
  78. if (e.jobList && e.jobList.length) e.jobList = dealDictArrayData([], e.jobList).slice(0, 2)
  79. })
  80. items.value = items.value.concat(list)
  81. }
  82. more.value = items.value.length === +data.total ? 'noMore' : 'more'
  83. }
  84. getPopularEnterprise()
  85. // 加载更多
  86. const loadingMore = () => {
  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. .enterpriseName {
  99. color: #0E100F;
  100. font-weight: 700;
  101. }
  102. .enterAvatar {
  103. width: 60px;
  104. height: 60px;
  105. // border-radius: 50%;
  106. margin: auto;
  107. }
  108. .line {
  109. border-top: 1px solid #ccc;
  110. }
  111. .list-shape {
  112. background-color: #fff;
  113. border-radius: 12px 12px 0 0;
  114. .titleBox {
  115. display: flex;
  116. align-items: center;
  117. justify-content: space-between;
  118. }
  119. }
  120. .salary-text {
  121. float: right;
  122. font-size: 15px;
  123. color: #00B760;
  124. font-weight: 700;
  125. }
  126. .job-name {
  127. font-size: 30rpx;
  128. font-weight: 700;
  129. color: #0E100F;
  130. overflow: hidden;
  131. white-space: nowrap;
  132. text-overflow: ellipsis;
  133. }
  134. </style>