company.vue 2.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  1. <template>
  2. <view class="ss-m-x-20">
  3. <scroll-view class="scrollBox" scroll-y="true" @scrolltolower="loadingMore" style="height: 100vh;">
  4. <view v-if="items.length">
  5. <view v-for="(item, index) in items" :key="index" class="ss-m-t-20" @click="toDetail(item)">
  6. <view style="background-color: #fff; border-radius: 12px;" class="ss-p-30">
  7. <view class="d-flex align-center">
  8. <image :src="item.logoUrl || 'https://minio.citupro.com/dev/menduner/company-avatar.png'" style="width: 50px; height: 50px; object-fit: contain"></image>
  9. <view style="flex: 1;" class="ss-m-l-30">
  10. <view class="enterprise-name ellipsis">{{ formatName(item.anotherName || item.name) }}</view>
  11. <view class="ss-m-y-15 font-size-12">
  12. <span class="tag-gap color-666">
  13. <span>{{item.industryName }}</span>
  14. <span class="ss-m-x-10" v-if="item.scaleName">|</span>
  15. <span>{{item.scaleName }}</span>
  16. </span>
  17. </view>
  18. <view>
  19. <uni-tag
  20. v-for="(tag, i) in item.tagList || []"
  21. :key="i"
  22. class="ss-m-r-10"
  23. :text="tag"
  24. inverted="false"
  25. size="mini"
  26. custom-style="background-color: #eef1f7;color:#7f828b;border-color:#eef1f7;"
  27. />
  28. </view>
  29. </view>
  30. </view>
  31. </view>
  32. </view>
  33. <uni-load-more :status="status" />
  34. </view>
  35. <view v-else class="nodata-img-parent">
  36. <image src="https://minio.citupro.com/dev/static/nodata.png" mode="widthFix" style="width: 100vw;height: 100vh;"></image>
  37. </view>
  38. </scroll-view>
  39. </view>
  40. </template>
  41. <script setup>
  42. import { ref } from 'vue'
  43. import { getSubscribeEnterprise } from '@/api/user'
  44. import { dealDictArrayData } from '@/utils/position'
  45. import { formatName } from '@/utils/getText'
  46. const items = ref([])
  47. const status = ref('more')
  48. const queryParams = ref({
  49. pageSize: 10,
  50. pageNo: 1
  51. })
  52. const getList = async () => {
  53. const { data } = await getSubscribeEnterprise(queryParams.value)
  54. let list = data?.list || []
  55. if (list?.length) {
  56. list = dealDictArrayData([], list)
  57. items.value = items.value.concat(list)
  58. }
  59. status.value = items.value?.length === +data.total ? 'noMore' : 'more'
  60. }
  61. getList()
  62. // 加载更多
  63. const loadingMore = () => {
  64. status.value = 'loading'
  65. queryParams.value.pageNo++
  66. getList()
  67. }
  68. // 企业详情
  69. const toDetail = (item) => {
  70. uni.navigateTo({
  71. url: `/pagesB/companyDetail/index?id=${item.id}`
  72. })
  73. }
  74. </script>
  75. <style scoped lang="scss">
  76. .enterprise-name {
  77. color: #333;
  78. font-weight: bold;
  79. font-size: 16px;
  80. width: 70vw;
  81. max-width: 70vw;
  82. }
  83. </style>