topic-card-list.vue 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149
  1. <template>
  2. <view>
  3. <block v-for="(item,index) in list_data" :key="index">
  4. <view class="bg-white margin-top radius zaiui-topic-card-list-box">
  5. <!--标题-->
  6. <view class="head-img-box" @tap="viewBtnTap(item,index)">
  7. <view class="cu-avatar" :style="[{backgroundImage:'url('+ item.bg_img +')'}]"/>
  8. <view class="bg-shade"></view>
  9. <view class="zaiui-text">
  10. <view class="text-xl">
  11. <text class="text-bold margin-right-xs">{{item.type}}</text>
  12. <text class="cuIcon-roundright"></text>
  13. </view>
  14. <view class="text-cut text">{{item.type_text}}</view>
  15. </view>
  16. </view>
  17. <!--列表-->
  18. <view class="cu-list menu-avatar margin-tb-sm">
  19. <block v-for="(items,indexs) in item.list" :key="indexs" v-if="indexs < 5">
  20. <view class="cu-item" @tap="listTap(items,indexs)">
  21. <view class="cu-avatar lg" :style="[{backgroundImage:'url('+ items.img +')'}]"/>
  22. <view class="corner-mark text-sm text-bold one" v-if="indexs == 0">{{indexs + 1}}</view>
  23. <view class="corner-mark text-sm text-bold two" v-if="indexs == 1">{{indexs + 1}}</view>
  24. <view class="corner-mark text-sm text-bold three" v-if="indexs == 2">{{indexs + 1}}</view>
  25. <view class="corner-mark text-sm text-bold" v-if="indexs >= 3">{{indexs + 1}}</view>
  26. <view class="content">
  27. <view class="text-black">
  28. <view class="text-cut">{{items.title}}</view>
  29. </view>
  30. <view class="text-gray text-sm flex">
  31. <view class="text-cut">{{items.text}}</view>
  32. </view>
  33. </view>
  34. </view>
  35. </block>
  36. </view>
  37. <view class="text-blue text-center" @tap="viewBtnTap(item,index)">
  38. <text>查看更多</text>
  39. <text class="cuIcon-right"></text>
  40. </view>
  41. </view>
  42. </block>
  43. </view>
  44. </template>
  45. <script>
  46. import _tool from '@/static/zaiui/util/tools.js';
  47. export default {
  48. name: 'topic-card-list',
  49. props: {
  50. list_data: {
  51. type: Array,
  52. default: () => {
  53. return []
  54. }
  55. }
  56. },
  57. methods: {
  58. listTap(data,index) {
  59. this.$emit('listTap', {
  60. data,
  61. index
  62. });
  63. },
  64. viewBtnTap(data,index) {
  65. this.$emit('viewTap', {
  66. data,
  67. index
  68. });
  69. }
  70. }
  71. }
  72. </script>
  73. <style lang="scss" scoped>
  74. .zaiui-topic-card-list-box {
  75. position: relative;
  76. border-radius: 18.18upx;
  77. padding-bottom: 27.27upx;
  78. width: 100%;
  79. .head-img-box {
  80. position: relative;
  81. width: 100%;
  82. .cu-avatar {
  83. width: 100%;
  84. height: 181.81upx;
  85. border-radius: 9.09upx 9.09upx 0 0;
  86. }
  87. .bg-shade {
  88. position: absolute;
  89. bottom: 0;
  90. top: 0;
  91. left: 0;
  92. right: 0;
  93. background-color: rgba(0, 0, 0, 0.4);
  94. border-radius: 9.09upx 9.09upx 0 0;
  95. }
  96. .zaiui-text {
  97. position: absolute;
  98. bottom: 0;
  99. color: #fff;
  100. padding: 18.18upx 23.63upx;
  101. width: 100%;
  102. .text {
  103. margin-top: 5.45upx;
  104. }
  105. }
  106. }
  107. .cu-list.menu-avatar>.cu-item>.cu-avatar {
  108. left: 27.27upx;
  109. width: 81.81upx;
  110. height: 81.81upx;
  111. border-radius: 9.09upx;
  112. }
  113. .cu-list.menu-avatar>.cu-item {
  114. height: 109.09upx;
  115. &:after {
  116. width: 0;
  117. height: 0;
  118. border-bottom: 0;
  119. }
  120. .corner-mark {
  121. position: absolute;
  122. width: 29.09upx;
  123. height: 29.09upx;
  124. text-align: center;
  125. line-height: 29.09upx;
  126. top: 14.54upx;
  127. left: 27.27upx;
  128. border-radius: 7.27upx 0 9.09upx;
  129. color: #fff;
  130. background-image: linear-gradient(130deg, #F2F2F2, #B4B4B5);
  131. }
  132. .corner-mark.one {
  133. background-image: linear-gradient(130deg, #FF8388, #FF5861);
  134. }
  135. .corner-mark.two {
  136. background-image: linear-gradient(130deg, #FF9D5C, #FF6E30);
  137. }
  138. .corner-mark.three {
  139. background-image: linear-gradient(130deg, #FFCF86, #FFA93B);
  140. }
  141. .content {
  142. left: 136.36upx;
  143. width: calc(100% - 136.36upx - 27.27upx);
  144. }
  145. }
  146. }
  147. </style>