index.vue 2.5 KB

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