index.vue 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128
  1. <template>
  2. <view style="padding-bottom: 30px;">
  3. <uni-card v-for="(val, index) in list" :key="index" :is-shadow="true" :border='false' shadow="0px 0px 3px 1px rgba(0,0,0,0.1)">
  4. <view class="d-flex align-center" @click="handleToEnterprise(val)">
  5. <image class="enterAvatar" :src="val.enterprise.logoUrl ? val.enterprise.logoUrl : 'https://minio.citupro.com/dev/menduner/company-avatar.png'"></image>
  6. <view class="ss-m-l-20" style="flex: 1;">
  7. <view class="font-size-16 enterpriseName">{{ val.enterprise.anotherName || val.enterprise.name }}</view>
  8. <view class="ss-m-t-5">
  9. <span class="color-999">{{ val.enterprise?.industryName || '' }}</span>
  10. <span class="divider tag-gap1" v-if="val.enterprise?.industryName && val.enterprise?.scaleName"> | </span>
  11. <span class="color-999">{{ val.enterprise?.scaleName || '' }}</span>
  12. </view>
  13. <view class="ss-m-t-10">
  14. <uni-tag
  15. v-for="(tag,i) in val.enterprise?.welfareList || []"
  16. :key="i"
  17. class="tag-gap ss-m-r-5"
  18. :text="tag"
  19. inverted="false"
  20. size="mini"
  21. custom-style="background-color: #ececec; color: #666; border-color: #ececec; display: inline-block;"
  22. />
  23. </view>
  24. </view>
  25. </view>
  26. <view class="line ss-m-y-20"></view>
  27. <view>
  28. <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' : ''}">
  29. <view class="titleBox my-5">
  30. <view class="job-name">{{ k.name }}</view>
  31. <span v-if="!k.payFrom && !k.payTo" class="salary-text">面议</span>
  32. <span v-else class="salary-text">{{ k.payFrom }}-{{ k.payTo }}{{ k.payName ? '/' + k.payName : '' }}</span>
  33. </view>
  34. <view style="font-size: 13px;" class="ss-m-t-5">
  35. <span class="tag-gap" style="color: #808080;">
  36. <span>{{ k.areaName }}</span>
  37. <span class="ss-m-x-10" v-if="k.areaName && k.eduName">|</span>
  38. <span>{{ k.eduName }}</span>
  39. <span class="ss-m-x-10" v-if="k.expName">|</span>
  40. <span>{{ k.expName }}</span>
  41. </span>
  42. </view>
  43. </view>
  44. </view>
  45. </uni-card>
  46. </view>
  47. </template>
  48. <script setup>
  49. import { ref } from 'vue'
  50. import { getHotEnterprise } from '@/api/enterprise'
  51. import { dealDictObjData, dealDictArrayData } from '@/utils/position'
  52. const list = ref([])
  53. const query = ref({
  54. pageNo: 1,
  55. pageSize: 10
  56. })
  57. // 精选企业列表
  58. const getPopularEnterprise = async () => {
  59. try {
  60. const { data } = await getHotEnterprise(query.value)
  61. list.value = data.list.map(e => {
  62. e.enterprise = dealDictObjData({}, e.enterprise)
  63. if (e.jobList && e.jobList.length) e.jobList = dealDictArrayData([], e.jobList).slice(0, 2)
  64. return e
  65. })
  66. } catch (err) {
  67. uni.showToast({ icon: 'none', title: err.msg })
  68. }
  69. }
  70. getPopularEnterprise()
  71. // 企业详情
  72. const handleToEnterprise = (val) => {
  73. uni.navigateTo({
  74. url: `/pagesB/companyDetail/index?id=${val.enterprise?.id}`
  75. })
  76. }
  77. // 职位详情
  78. const handleToPosition = (k) => {
  79. const url = `/pagesB/positionDetail/index?id=${k.id}`
  80. uni.navigateTo({ url })
  81. }
  82. </script>
  83. <style scoped lang="scss">
  84. .enterpriseName {
  85. color: #404040;
  86. font-weight: 700;
  87. }
  88. .enterAvatar {
  89. width: 60px;
  90. height: 60px;
  91. border-radius: 50%;
  92. margin: auto;
  93. }
  94. .line {
  95. border-top: 1px solid #ccc;
  96. }
  97. .list-shape {
  98. background-color: #fff;
  99. border-radius: 12px 12px 0 0;
  100. .titleBox {
  101. display: flex;
  102. align-items: center;
  103. justify-content: space-between;
  104. }
  105. }
  106. .salary-text {
  107. float: right;
  108. font-size: 15px;
  109. color: #CEC149;
  110. font-weight: 700;
  111. }
  112. .job-name {
  113. font-size: 16px;
  114. font-weight: 700;
  115. color: #345768;
  116. max-width: 50vw;
  117. overflow: hidden;
  118. white-space: nowrap;
  119. text-overflow: ellipsis;
  120. }
  121. </style>