company.vue 2.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  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'" class="avatar" 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">{{ 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. const items = ref([])
  46. const status = ref('more')
  47. const queryParams = ref({
  48. pageSize: 10,
  49. pageNo: 1
  50. })
  51. const getList = async () => {
  52. const { data } = await getSubscribeEnterprise(queryParams.value)
  53. let list = data?.list || []
  54. if (list?.length) {
  55. list = dealDictArrayData([], list)
  56. items.value = items.value.concat(list)
  57. }
  58. status.value = items.value?.length === +data.total ? 'noMore' : 'more'
  59. }
  60. getList()
  61. // 加载更多
  62. const loadingMore = () => {
  63. status.value = 'loading'
  64. queryParams.value.pageNo++
  65. getList()
  66. }
  67. // 企业详情
  68. const toDetail = (item) => {
  69. uni.navigateTo({
  70. url: `/pagesB/companyDetail/index?id=${item.id}`
  71. })
  72. }
  73. </script>
  74. <style scoped lang="scss">
  75. .enterprise-name {
  76. color: #333;
  77. font-weight: bold;
  78. font-size: 16px;
  79. width: 70vw;
  80. max-width: 70vw;
  81. }
  82. </style>