index.vue 5.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151
  1. <template>
  2. <view class="defaultBgc ss-p-x-20" style="height: 100vh; position: relative;">
  3. <scroll-view v-if="showList" 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="jumpToEnterpriseDetail(item.enterprise.id)">
  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">{{ formatName(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 v-else class="noviewlist">
  53. <view v-if="userInfo?.vipExpireDate > Date.now() && !userInfo?.entitlement?.viewersList">
  54. 当前会员套餐的权益不包含谁关注我,<span class="text-line" @tap.stop="handleToBuyVip">点击去升级</span>
  55. </view>
  56. <view v-if="!userInfo?.vipExpireDate || (userInfo?.vipExpireDate && userInfo?.vipExpireDate < Date.now())">
  57. 谁关注我为会员权益内容,<span class="text-line" @tap.stop="handleToBuyVip">点击去开通</span>
  58. </view>
  59. </view>
  60. </view>
  61. </template>
  62. <script setup>
  63. import { ref, computed } from 'vue'
  64. import { getInterestedMePage } from '@/api/user'
  65. import { dealDictObjData, jumpToEnterpriseDetail } from '@/utils/position'
  66. import { getUserAvatar } from '@/utils/avatar'
  67. import { timesTampChange } from '@/utils/date'
  68. import { formatName } from '@/utils/getText'
  69. import { userStore } from '@/store/user'
  70. import { onShow } from '@dcloudio/uni-app'
  71. const status = ref('more')
  72. const queryParams = ref({
  73. pageNo: 1,
  74. pageSize: 10
  75. })
  76. const useUserStore = userStore()
  77. const userInfo = computed(() => useUserStore?.userInfo)
  78. // 当前会员套餐是否可查看此模块
  79. const showList = computed(() => (new Date().getTime() < useUserStore?.userInfo?.vipExpireDate) && useUserStore?.userInfo?.entitlement?.viewersList)
  80. const list = ref([])
  81. const getList = async () => {
  82. const res = await getInterestedMePage(queryParams.value)
  83. const arr = res?.data?.list || []
  84. if (arr?.length) {
  85. arr.forEach(e => {
  86. e.enterprise = dealDictObjData({}, e.enterprise)
  87. })
  88. list.value = list.value.concat(arr)
  89. }
  90. status.value = list.value?.length === +res.data.total ? 'noMore' : 'more'
  91. }
  92. onShow(() => {
  93. // 有会员权益能查看才请求接口
  94. if (showList.value) getList()
  95. })
  96. // 加载更多
  97. const loadingMore = () => {
  98. status.value = 'loading'
  99. queryParams.value.pageNo++
  100. getList()
  101. }
  102. // 跳转会员套餐
  103. const handleToBuyVip = () => {
  104. uni.navigateTo({
  105. url: '/pagesA/vipPackage/index'
  106. })
  107. }
  108. </script>
  109. <style scoped lang="scss">
  110. .sub-li-bottom {
  111. display: flex;
  112. align-items: center;
  113. background: linear-gradient(90deg, #f5fcfc 0, #fcfbfa 100%);
  114. font-size: 13px;
  115. padding: 5px 30rpx;
  116. border-radius: 12px 12px 0 0;
  117. .avatarBox {
  118. max-width: 40px;
  119. max-height: 40px;
  120. }
  121. }
  122. .enterprise-name {
  123. color: #333;
  124. font-weight: bold;
  125. font-size: 16px;
  126. width: 70vw;
  127. max-width: 70vw;
  128. }
  129. .noviewlist {
  130. position: absolute;
  131. top: 50%;
  132. left: 50%;
  133. width: 98%;
  134. text-align: center;
  135. transform: translate(-50%, -50%);
  136. color: #666;
  137. }
  138. .text-line {
  139. color: #00897b;
  140. font-weight: bold;
  141. padding-bottom: 2px;
  142. border-bottom: 1px solid #00897b;
  143. }
  144. </style>