index.vue 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. <template>
  2. <view class="defaultBgc" style="height: 100vh;">
  3. <scroll-view class="scrollBox" scroll-y="true" @scrolltolower="loadingMore">
  4. <view v-if="list.length > 0">
  5. <uni-card v-for="(item,index) in list" :key="index" :is-shadow="true" :border='false' shadow="0px 0px 3px 1px rgba(0,0,0,0.1)" >
  6. <view class="f-horizon">
  7. <image class="avatar" :src="item.enterprise.logoUrl || 'https://minio.citupro.com/dev/menduner/company-avatar.png'"></image>
  8. <view class="f-straight" style="width:60vw;">
  9. <view class="title-des">{{ item.enterprise.name }}</view>
  10. <view class="s-word">
  11. <span class="dis">
  12. <view class="show-more" :style="{'width': item.enterprise.industryName == '' ? '15vw' : '30vw'}">
  13. {{ item.enterprise.industryName ? item.enterprise.industryName : '行业未知' }}
  14. </view>
  15. <span class="divider ss-m-10"> | </span>
  16. <span>{{ item.enterprise.scaleName || '规模未知' }}</span>
  17. </span>
  18. </view>
  19. </view>
  20. </view>
  21. <view style="border-bottom: 1px dashed #ccc;"></view>
  22. <view class="ss-m-t-20 d-flex align-center justify-end">
  23. <image class="r-avatar" :src="getUserAvatar(item.contact.avatar, item.contact.sex)"></image>
  24. <text class="ss-m-l-20">
  25. {{ item.contact.name }} | {{ item.post.nameCn }}
  26. </text>
  27. </view>
  28. </uni-card>
  29. <uni-load-more :status="status" />
  30. </view>
  31. <view v-else class="nodata-img-parent">
  32. <image src="https://minio.citupro.com/dev/static/nodata.png" mode="widthFix" style="width: 100vw;height: 100vh;"></image>
  33. </view>
  34. </scroll-view>
  35. </view>
  36. </template>
  37. <script setup>
  38. import { ref } from 'vue'
  39. import { getInterestedMePage } from '@/api/user'
  40. import { dealDictObjData } from '@/utils/position'
  41. import { getUserAvatar } from '@/utils/avatar'
  42. const status = ref('more')
  43. const queryParams = ref({
  44. pageNo: 1,
  45. pageSize: 10
  46. })
  47. const list = ref([])
  48. const getList = async () => {
  49. const res = await getInterestedMePage(queryParams.value)
  50. const arr = res?.data?.list || []
  51. if (arr?.length) {
  52. arr.forEach(e => {
  53. e.enterprise = dealDictObjData({}, e.enterprise)
  54. })
  55. list.value = list.value.concat(arr)
  56. }
  57. status.value = arr?.length < queryParams.value.pageSize ? 'noMore' : 'more'
  58. }
  59. getList()
  60. // 加载跟多
  61. const loadingMore = () => {
  62. status.value = 'loading'
  63. queryParams.value.pageNo++
  64. getList()
  65. }
  66. </script>
  67. <style scoped lang="scss">
  68. </style>