index.vue 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118
  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">{{ 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. const status = ref('more')
  61. const queryParams = ref({
  62. pageNo: 1,
  63. pageSize: 10
  64. })
  65. const list = ref([])
  66. const getList = async () => {
  67. const res = await getInterestedMePage(queryParams.value)
  68. const arr = res?.data?.list || []
  69. if (arr?.length) {
  70. arr.forEach(e => {
  71. e.enterprise = dealDictObjData({}, e.enterprise)
  72. })
  73. list.value = list.value.concat(arr)
  74. }
  75. status.value = list.value?.length === +res.data.total ? 'noMore' : 'more'
  76. }
  77. getList()
  78. // 加载跟多
  79. const loadingMore = () => {
  80. status.value = 'loading'
  81. queryParams.value.pageNo++
  82. getList()
  83. }
  84. // 企业详情
  85. const toDetail = (item) => {
  86. uni.navigateTo({
  87. url: `/pagesB/companyDetail/index?id=${item.enterprise.id}`
  88. })
  89. }
  90. </script>
  91. <style scoped lang="scss">
  92. .sub-li-bottom {
  93. display: flex;
  94. align-items: center;
  95. background: linear-gradient(90deg, #f5fcfc 0, #fcfbfa 100%);
  96. font-size: 13px;
  97. padding: 5px 30rpx;
  98. border-radius: 12px 12px 0 0;
  99. .avatarBox {
  100. max-width: 40px;
  101. max-height: 40px;
  102. }
  103. }
  104. .enterprise-name {
  105. color: #333;
  106. font-weight: bold;
  107. font-size: 16px;
  108. width: 70vw;
  109. max-width: 70vw;
  110. }
  111. </style>