index.vue 4.8 KB

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