index.vue 5.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190
  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.menduner.com/dev/bb43df1dc91945e05ee93da76e49b34f87b0d10203eb76c20e2d4999a13b9a0a.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 total = ref(0)
  64. const useUserStore = userStore()
  65. const userInfo = computed(() => useUserStore?.userInfo)
  66. // 当前会员套餐是否可查看此模块
  67. const showList = computed(() => (new Date().getTime() < useUserStore?.userInfo?.vipExpireDate) && useUserStore?.userInfo?.entitlement?.viewersList)
  68. const list = ref([])
  69. const getList = async () => {
  70. const res = await getInterestedMePage(queryParams.value)
  71. const arr = res?.data?.list || []
  72. if (arr?.length) {
  73. arr.forEach(e => {
  74. e.enterprise = dealDictObjData({}, e.enterprise)
  75. })
  76. list.value = list.value.concat(arr)
  77. }
  78. total.value = res?.data?.total || 0
  79. status.value = list.value?.length === total.value ? 'noMore' : 'more'
  80. }
  81. onShow(() => {
  82. // 有会员权益能查看才请求接口
  83. if (showList.value) getList()
  84. })
  85. // 加载更多
  86. const loadingMore = () => {
  87. if (total.value <= 0) return
  88. status.value = 'loading'
  89. queryParams.value.pageNo++
  90. getList()
  91. }
  92. // 跳转会员套餐
  93. // const handleToBuyVip = () => {
  94. // uni.navigateTo({
  95. // url: '/pagesA/vipPackage/index'
  96. // })
  97. // }
  98. </script>
  99. <style scoped lang="scss">
  100. .list-item {
  101. margin: 30rpx;
  102. border-radius: 20rpx;
  103. padding: 30rpx;
  104. box-shadow: 1px 2px 12px rgba(0, 0, 0, 0.17);
  105. &:last-child {
  106. margin-bottom: 0;
  107. }
  108. &:first-child {
  109. margin-top: 0;
  110. }
  111. }
  112. .sub-li-bottom {
  113. display: flex;
  114. align-items: center;
  115. .avatarBox {
  116. max-width: 40px;
  117. max-height: 40px;
  118. }
  119. }
  120. .enterprise-name {
  121. font-weight: bold;
  122. font-size: 16px;
  123. width: 70vw;
  124. max-width: 70vw;
  125. }
  126. .noviewlist {
  127. position: absolute;
  128. top: 50%;
  129. left: 50%;
  130. width: 98%;
  131. text-align: center;
  132. transform: translate(-50%, -50%);
  133. color: #666;
  134. }
  135. .text-line {
  136. color: #00B760;
  137. font-weight: bold;
  138. padding-bottom: 2px;
  139. border-bottom: 1px solid #00B760;
  140. }
  141. .disable1 {
  142. position: relative;
  143. overflow: hidden;
  144. padding: 0 30rpx;
  145. &::after {
  146. content: '当前会员套餐的福利不包含谁关注我';
  147. position: absolute;
  148. display: flex;
  149. align-items: center;
  150. justify-content: center;
  151. font-size: 16px;
  152. font-family: 'MiSans-Semibold';
  153. color: #fff;
  154. top: 0;
  155. // border-radius: 12px;
  156. left: 0;
  157. width: 100%;
  158. height: 100%;
  159. background-color: rgba(0, 0, 0, 0.35);
  160. }
  161. }
  162. .disable2 {
  163. position: relative;
  164. overflow: hidden;
  165. padding: 0 30rpx;
  166. &::after {
  167. content: '谁关注我为会员福利内容';
  168. position: absolute;
  169. display: flex;
  170. align-items: center;
  171. justify-content: center;
  172. font-size: 16px;
  173. font-family: 'MiSans-Semibold';
  174. color: #fff;
  175. top: 0;
  176. // border-radius: 12px;
  177. left: 0;
  178. width: 100%;
  179. height: 100%;
  180. background-color: rgba(0, 0, 0, 0.35);
  181. }
  182. }
  183. </style>