company.vue 2.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192
  1. <template>
  2. <view>
  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="list-item default-border list-item-bgc" @click="jumpToEnterpriseDetail(item.id)">
  6. <view class="d-flex align-center">
  7. <view class="enterAvatar default-radius default-border">
  8. <image class="enterAvatar default-radius" :src="item.logoUrl || 'https://minio.citupro.com/dev/menduner/company-avatar.png'"></image>
  9. </view>
  10. <view style="flex: 1;" class="ss-m-l-30">
  11. <view class="enterprise-name ellipsis MiSans-Semibold default-text-color">{{ formatName(item.anotherName || item.name) }}</view>
  12. <view class="ss-m-y-15 font-size-12">
  13. <span class="tag-gap color-666">
  14. <span class="MiSans-Normal ss-m-r-10">{{item.industryName }}</span>
  15. <span class="MiSans-Normal">{{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; font-family: MiSans-Normal;"
  27. />
  28. </view>
  29. </view>
  30. </view>
  31. </view>
  32. <uni-load-more :status="status" />
  33. </view>
  34. <view v-else class="nodata-img-parent">
  35. <image src="https://minio.citupro.com/dev/static/nodata.png" mode="widthFix" style="width: 100vw;height: 100vh;"></image>
  36. </view>
  37. </scroll-view>
  38. </view>
  39. </template>
  40. <script setup>
  41. import { ref } from 'vue'
  42. import { getSubscribeEnterprise } from '@/api/user'
  43. import { dealDictArrayData, jumpToEnterpriseDetail } from '@/utils/position'
  44. import { formatName } from '@/utils/getText'
  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. </script>
  68. <style scoped lang="scss">
  69. .enterprise-name {
  70. font-weight: bold;
  71. font-size: 30rpx;
  72. width: 62vw;
  73. }
  74. .list-item {
  75. margin: 30rpx;
  76. border-radius: 20rpx;
  77. padding: 30rpx;
  78. box-shadow: 1px 2px 12px rgba(0, 0, 0, 0.17);
  79. &:last-child {
  80. margin-bottom: 0;
  81. }
  82. }
  83. .enterAvatar {
  84. width: 60px;
  85. height: 60px;
  86. }
  87. </style>