index.vue 4.8 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. <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="handleToEnterprise(val)">
  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">{{ 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.areaName }}</span>
  39. <span class="ss-m-x-10" v-if="k.areaName && 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 } 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 handleToEnterprise = (val) => {
  93. uni.navigateTo({
  94. url: `/pagesB/companyDetail/index?id=${val.enterprise?.id}`
  95. })
  96. }
  97. // 职位详情
  98. const handleToPosition = (k) => {
  99. const url = `/pagesB/positionDetail/index?id=${k.id}&area=${k.areaName}`
  100. uni.navigateTo({ url })
  101. }
  102. </script>
  103. <style scoped lang="scss">
  104. .enterpriseName {
  105. color: #404040;
  106. font-weight: 700;
  107. }
  108. .enterAvatar {
  109. width: 60px;
  110. height: 60px;
  111. // border-radius: 50%;
  112. margin: auto;
  113. }
  114. .line {
  115. border-top: 1px solid #ccc;
  116. }
  117. .list-shape {
  118. background-color: #fff;
  119. border-radius: 12px 12px 0 0;
  120. .titleBox {
  121. display: flex;
  122. align-items: center;
  123. justify-content: space-between;
  124. }
  125. }
  126. .salary-text {
  127. float: right;
  128. font-size: 15px;
  129. color: #CEC149;
  130. font-weight: 700;
  131. }
  132. .job-name {
  133. font-size: 16px;
  134. font-weight: 700;
  135. color: #345768;
  136. max-width: 50vw;
  137. overflow: hidden;
  138. white-space: nowrap;
  139. text-overflow: ellipsis;
  140. }
  141. </style>