index.vue 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187
  1. <template>
  2. <view
  3. style="height: 100vh; position: relative;"
  4. :class="{
  5. 'disable1': userInfo?.vipExpireDate > Date.now() && !userInfo?.entitlement?.viewersList,
  6. 'disable2': !userInfo?.vipExpireDate || (userInfo?.vipExpireDate && userInfo?.vipExpireDate < Date.now())
  7. }"
  8. >
  9. <scroll-view v-if="showList" class="scrollBox" scroll-y="true" @scrolltolower="loadingMore">
  10. <view v-if="list.length > 0">
  11. <view v-for="(item, index) in list" :key="index" class="list-item default-border defaultBgc" @click="jumpToEnterpriseDetail(item.enterprise.id)">
  12. <view class="sub-li-bottom">
  13. <view class="avatarBox">
  14. <image class="r-avatar" :src="getUserAvatar(item.contact.avatar, item.contact.sex)"></image>
  15. </view>
  16. <view class="ss-m-l-30" style="font-size: 28rpx;">
  17. <span class="MiSans-Normal ss-m-r-10">{{ item.contact?.name }}</span>
  18. <span class="MiSans-Normal">{{ item.post?.nameCn }}</span>
  19. </view>
  20. </view>
  21. <view class="ss-m-y-30" style="border-top: 1rpx solid #E1E4E9"></view>
  22. <view>
  23. <view class="d-flex align-center">
  24. <view class="">
  25. <image class="default-radius default-border" :src="item.enterprise.logoUrl" style="width: 50px; height: 50px; object-fit: contain;"></image>
  26. </view>
  27. <view style="flex: 1;" class="ss-m-l-30">
  28. <view class="enterprise-name ellipsis default-text-color MiSans-Semibold">{{ formatName(item.enterprise.anotherName || item.enterprise.name) }}</view>
  29. <!-- 行业规模 -->
  30. <view>
  31. <span class="tag-gap color-666" style="font-size: 24rpx;">
  32. <span class="MiSans-Normal ss-m-r-10">{{item.enterprise.industryName }}</span>
  33. <span class="MiSans-Normal">{{item.enterprise.scaleName }}</span>
  34. </span>
  35. </view>
  36. <view class="color-666 ss-m-t-10 MiSans-Normal" style="font-size: 22rpx;">查看时间:{{ timesTampChange(item.updateTime) }}</view>
  37. </view>
  38. </view>
  39. </view>
  40. </view>
  41. <uni-load-more :status="status" />
  42. </view>
  43. <view v-else class="nodata-img-parent">
  44. <image src="https://minio.citupro.com/dev/static/nodata.png" mode="widthFix" style="width: 100vw;height: 100vh;"></image>
  45. </view>
  46. </scroll-view>
  47. </view>
  48. </template>
  49. <script setup>
  50. import { ref, computed } from 'vue'
  51. import { getInterestedMePage } from '@/api/user'
  52. import { dealDictObjData, jumpToEnterpriseDetail } from '@/utils/position'
  53. import { getUserAvatar } from '@/utils/avatar'
  54. import { timesTampChange } from '@/utils/date'
  55. import { formatName } from '@/utils/getText'
  56. import { userStore } from '@/store/user'
  57. import { onShow } from '@dcloudio/uni-app'
  58. const status = ref('more')
  59. const queryParams = ref({
  60. pageNo: 1,
  61. pageSize: 10
  62. })
  63. const useUserStore = userStore()
  64. const userInfo = computed(() => useUserStore?.userInfo)
  65. // 当前会员套餐是否可查看此模块
  66. const showList = computed(() => (new Date().getTime() < useUserStore?.userInfo?.vipExpireDate) && useUserStore?.userInfo?.entitlement?.viewersList)
  67. const list = ref([])
  68. const getList = async () => {
  69. const res = await getInterestedMePage(queryParams.value)
  70. const arr = res?.data?.list || []
  71. if (arr?.length) {
  72. arr.forEach(e => {
  73. e.enterprise = dealDictObjData({}, e.enterprise)
  74. })
  75. list.value = list.value.concat(arr)
  76. }
  77. status.value = list.value?.length === +res.data.total ? 'noMore' : 'more'
  78. }
  79. onShow(() => {
  80. // 有会员权益能查看才请求接口
  81. if (showList.value) getList()
  82. })
  83. // 加载更多
  84. const loadingMore = () => {
  85. status.value = 'loading'
  86. queryParams.value.pageNo++
  87. getList()
  88. }
  89. // 跳转会员套餐
  90. // const handleToBuyVip = () => {
  91. // uni.navigateTo({
  92. // url: '/pagesA/vipPackage/index'
  93. // })
  94. // }
  95. </script>
  96. <style scoped lang="scss">
  97. .list-item {
  98. margin: 30rpx;
  99. border-radius: 20rpx;
  100. padding: 30rpx;
  101. box-shadow: 1px 2px 12px rgba(0, 0, 0, 0.17);
  102. &:last-child {
  103. margin-bottom: 0;
  104. }
  105. &:first-child {
  106. margin-top: 0;
  107. }
  108. }
  109. .sub-li-bottom {
  110. display: flex;
  111. align-items: center;
  112. .avatarBox {
  113. max-width: 40px;
  114. max-height: 40px;
  115. }
  116. }
  117. .enterprise-name {
  118. font-weight: bold;
  119. font-size: 16px;
  120. width: 70vw;
  121. max-width: 70vw;
  122. }
  123. .noviewlist {
  124. position: absolute;
  125. top: 50%;
  126. left: 50%;
  127. width: 98%;
  128. text-align: center;
  129. transform: translate(-50%, -50%);
  130. color: #666;
  131. }
  132. .text-line {
  133. color: #00B760;
  134. font-weight: bold;
  135. padding-bottom: 2px;
  136. border-bottom: 1px solid #00B760;
  137. }
  138. .disable1 {
  139. position: relative;
  140. overflow: hidden;
  141. padding: 0 30rpx;
  142. &::after {
  143. content: '当前会员套餐的福利不包含谁关注我';
  144. position: absolute;
  145. display: flex;
  146. align-items: center;
  147. justify-content: center;
  148. font-size: 16px;
  149. font-family: 'MiSans-Semibold';
  150. color: #fff;
  151. top: 0;
  152. // border-radius: 12px;
  153. left: 0;
  154. width: 100%;
  155. height: 100%;
  156. background-color: rgba(0, 0, 0, 0.35);
  157. }
  158. }
  159. .disable2 {
  160. position: relative;
  161. overflow: hidden;
  162. padding: 0 30rpx;
  163. &::after {
  164. content: '谁关注我为会员福利内容';
  165. position: absolute;
  166. display: flex;
  167. align-items: center;
  168. justify-content: center;
  169. font-size: 16px;
  170. font-family: 'MiSans-Semibold';
  171. color: #fff;
  172. top: 0;
  173. // border-radius: 12px;
  174. left: 0;
  175. width: 100%;
  176. height: 100%;
  177. background-color: rgba(0, 0, 0, 0.35);
  178. }
  179. }
  180. </style>