index.vue 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119
  1. <template>
  2. <view class="defaultBgc ss-p-x-20" style="height: 100vh;">
  3. <scroll-view class="scrollBox" scroll-y="true" @scrolltolower="loadingMore">
  4. <view v-if="list.length > 0">
  5. <view v-for="(item, index) in list" :key="index" class="ss-m-t-20" @click="toDetail(item)">
  6. <view class="sub-li-bottom">
  7. <view class="avatarBox">
  8. <image class="r-avatar" :src="getUserAvatar(item.contact.avatar, item.contact.sex)"></image>
  9. </view>
  10. <view class="ss-m-l-30">
  11. <span>{{ item.contact?.name }}</span>
  12. <span class="ss-m-x-10" v-if="item.contact?.name && item.contact?.nameCn"> | </span>
  13. <span>{{ item.post?.nameCn }}</span>
  14. </view>
  15. </view>
  16. <view style="background-color: #fff; border-radius: 0 0 12px 12px;" class="ss-p-30">
  17. <view class="d-flex align-center">
  18. <image :src="item.enterprise.logoUrl" style="width: 50px; height: 50px;"></image>
  19. <view style="flex: 1;" class="ss-m-l-30">
  20. <view class="enterprise-name ellipsis">{{ dealEnterpriseName(item.enterprise.anotherName || item.enterprise.name) }}</view>
  21. <!-- 行业规模 -->
  22. <view class="ss-m-y-15 font-size-12">
  23. <span class="tag-gap color-666">
  24. <span>{{item.enterprise.industryName }}</span>
  25. <span class="ss-m-x-10" v-if="item.enterprise.industryName && item.enterprise.scaleName">|</span>
  26. <span>{{item.enterprise.scaleName }}</span>
  27. </span>
  28. </view>
  29. <!-- 标签 -->
  30. <view>
  31. <uni-tag
  32. v-for="(tag, i) in item.enterprise.tagList || []"
  33. :key="i"
  34. class="ss-m-r-10"
  35. :text="tag"
  36. inverted="false"
  37. size="mini"
  38. custom-style="background-color: #eef1f7;color:#7f828b;border-color:#eef1f7;"
  39. />
  40. </view>
  41. <view class="color-666 font-size-13 ss-m-t-20">查看时间:{{ timesTampChange(item.updateTime) }}</view>
  42. </view>
  43. </view>
  44. </view>
  45. </view>
  46. <uni-load-more :status="status" />
  47. </view>
  48. <view v-else class="nodata-img-parent">
  49. <image src="https://minio.citupro.com/dev/static/nodata.png" mode="widthFix" style="width: 100vw;height: 100vh;"></image>
  50. </view>
  51. </scroll-view>
  52. </view>
  53. </template>
  54. <script setup>
  55. import { ref } from 'vue'
  56. import { getInterestedMePage } from '@/api/user'
  57. import { dealDictObjData } from '@/utils/position'
  58. import { getUserAvatar } from '@/utils/avatar'
  59. import { timesTampChange } from '@/utils/date'
  60. import { dealEnterpriseName } from '@/utils/getText'
  61. const status = ref('more')
  62. const queryParams = ref({
  63. pageNo: 1,
  64. pageSize: 10
  65. })
  66. const list = ref([])
  67. const getList = async () => {
  68. const res = await getInterestedMePage(queryParams.value)
  69. const arr = res?.data?.list || []
  70. if (arr?.length) {
  71. arr.forEach(e => {
  72. e.enterprise = dealDictObjData({}, e.enterprise)
  73. })
  74. list.value = list.value.concat(arr)
  75. }
  76. status.value = list.value?.length === +res.data.total ? 'noMore' : 'more'
  77. }
  78. getList()
  79. // 加载跟多
  80. const loadingMore = () => {
  81. status.value = 'loading'
  82. queryParams.value.pageNo++
  83. getList()
  84. }
  85. // 企业详情
  86. const toDetail = (item) => {
  87. uni.navigateTo({
  88. url: `/pagesB/companyDetail/index?id=${item.enterprise.id}`
  89. })
  90. }
  91. </script>
  92. <style scoped lang="scss">
  93. .sub-li-bottom {
  94. display: flex;
  95. align-items: center;
  96. background: linear-gradient(90deg, #f5fcfc 0, #fcfbfa 100%);
  97. font-size: 13px;
  98. padding: 5px 30rpx;
  99. border-radius: 12px 12px 0 0;
  100. .avatarBox {
  101. max-width: 40px;
  102. max-height: 40px;
  103. }
  104. }
  105. .enterprise-name {
  106. color: #333;
  107. font-weight: bold;
  108. font-size: 16px;
  109. width: 70vw;
  110. max-width: 70vw;
  111. }
  112. </style>