community-list.vue 6.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178
  1. <template>
  2. <view class="">
  3. <!-- 普通瀑布流 -->
  4. <view class="community-list" v-if="type == 'waterfall'">
  5. <router-link v-for="(item, index) in list" :key="index" class=""
  6. :to="'/bundle_b/pages/community_detail/community_detail?id=' + item.id">
  7. <view class="community-list--item bg-white m-t-20">
  8. <view class="community-img">
  9. <u-lazy-load threshold="0" border-radius="10" :image="item.image" :index="index"></u-lazy-load>
  10. </view>
  11. <view class="community-info">
  12. <view class="community-title line-2">{{item.content}}</view>
  13. <view class="m-t-10 flex">
  14. <u-image width="50" height="50" border-radius="50%" :src="item.avatar"></u-image>
  15. <view class="user-name flex-1 line-2">{{ item.nickname }}</view>
  16. <view class="likes">
  17. <image
  18. :src="item.is_like?'/static/images/icon_collection_s.png':'/static/images/icon_likes.png'">
  19. </image>
  20. <text class="xs muted m-l-6">{{ item.like }}</text>
  21. </view>
  22. </view>
  23. </view>
  24. </view>
  25. </router-link>
  26. </view>
  27. <!-- 用户作品瀑布流 -->
  28. <view class="community-list" v-if="type == 'works'">
  29. <router-link v-for="(item, index) in list" :key="index" class=""
  30. :to="'/bundle_b/pages/community_detail/community_detail?id=' + item.id">
  31. <view class="community-list--item bg-white m-t-20">
  32. <view class="community-img">
  33. <!-- 审核 Start -->
  34. <view class="works flex row-center " v-if="item.status === 0 || item.status === 2">
  35. <view class="text-center nr white">
  36. <view>{{ item.status_desc }}</view>
  37. <view class="m-t-10">{{ item.audit_remark_desc }}</view>
  38. </view>
  39. </view>
  40. <!-- 审核 End -->
  41. <u-lazy-load threshold="0" border-radius="10" :image="item.image" :index="index"></u-lazy-load>
  42. </view>
  43. <view class="community-info">
  44. <view class="community-title line-2">{{item.content}}</view>
  45. <view class="m-t-20 flex">
  46. <view class="user-name flex-1 line-2">{{ item.create_time }}</view>
  47. <view class="likes">
  48. <image
  49. :src="item.is_like?'/static/images/icon_collection_s.png':'/static/images/icon_likes.png'">
  50. </image>
  51. <text class="xs muted m-l-6">{{ item.like }}</text>
  52. </view>
  53. </view>
  54. </view>
  55. </view>
  56. </router-link>
  57. </view>
  58. <!-- 首页list -->
  59. <view class="community-list flex" v-if="type == 'index'">
  60. <router-link v-for="(item, index) in list" :key="index" class="community-list--item bg-white m-r-20"
  61. :to="'/bundle_b/pages/community_detail/community_detail?id=' + item.id">
  62. <view class="community-index">
  63. <view class="wrap white sm p-l-10">
  64. <view class="index-title line-1">{{ item.content }}</view>
  65. <view class="flex m-t-10">
  66. <u-lazy-load threshold="0" border-radius="10" :image="item.image" :index="index"></u-lazy-load>
  67. <view class="index-name line-1 m-l-6">
  68. {{ item.nickname }}
  69. </view>
  70. </view>
  71. </view>
  72. <u-image width="240" height="240" :src="item.image" borderRadius="14"></u-image>
  73. </view>
  74. </router-link>
  75. </view>
  76. </view>
  77. </template>
  78. <script>
  79. export default {
  80. props: {
  81. list: {
  82. type: Array,
  83. default: () => []
  84. },
  85. // 两行时有效
  86. width: {
  87. type: String,
  88. default: '347rpx'
  89. },
  90. type: {
  91. type: String
  92. }
  93. },
  94. data() {
  95. return {
  96. };
  97. }
  98. }
  99. </script>
  100. <style lang="scss" scoped>
  101. .community-list {
  102. &--item {
  103. border-radius: 14rpx;
  104. // 个人中心审核作品
  105. .community-img {
  106. width: 336rpx;
  107. position: relative;
  108. .works {
  109. width: 100%;
  110. height: 100%;
  111. z-index: 10;
  112. border-radius: 14rpx;
  113. background-color: rgba(0, 0, 0, 0.4);
  114. position: absolute;
  115. }
  116. }
  117. .community-index {
  118. width: 240rpx;
  119. position: relative;
  120. .wrap {
  121. width: 100%;
  122. height: 100%;
  123. z-index: 10;
  124. border-radius: 14rpx;
  125. background-color: rgba(0, 0, 0, 0.4);
  126. position: absolute;
  127. padding-top: 140rpx;
  128. .index-title {
  129. width: 210rpx;
  130. }
  131. .index-name {
  132. width: 160rpx;
  133. }
  134. }
  135. }
  136. .community-info {
  137. padding: 10rpx;
  138. .community-title {
  139. font-size: 28rpx;
  140. line-height: 40rpx;
  141. color: $-color-normal;
  142. }
  143. .user-name {
  144. color: $-color-muted;
  145. font-size: 24rpx;
  146. margin: 0 10rpx;
  147. }
  148. .likes {
  149. image {
  150. width: 32rpx;
  151. height: 32rpx;
  152. vertical-align: middle;
  153. }
  154. }
  155. }
  156. }
  157. }
  158. </style>