推广小程序前端代码
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

178 lines
3.2 KiB

2 months ago
  1. <template>
  2. <view class="cardList">
  3. <view class="container" v-for="(item, index) in cardListData" :key="index">
  4. <view class="content" :class="['U','S'].includes(item.state) ? 'content_border' : ''">
  5. <view class="left">
  6. <img :src="item.imgUrl" alt="">
  7. </view>
  8. <view class="right">
  9. <view class="detailed">
  10. <view class="title">{{item.title}}</view>
  11. <view class="date">{{item.time}}</view>
  12. <view class="address">{{item.address}}</view>
  13. </view>
  14. <view class="price">
  15. <view class="num-box">20/40</view>
  16. <view class="btn-box">立即报名</view>
  17. </view>
  18. </view>
  19. </view>
  20. </view>
  21. </view>
  22. </template>
  23. <script>
  24. export default {
  25. props: {
  26. cardListData: {
  27. type: Array,
  28. default: []
  29. },
  30. },
  31. data() {
  32. return {
  33. };
  34. },
  35. components: {
  36. },
  37. computed: {},
  38. watch: {
  39. },
  40. created() {
  41. },
  42. mounted() {},
  43. methods: {
  44. skip(val) {
  45. uni.navigateTo({
  46. url: '/pages_order/orderDetails'
  47. })
  48. }
  49. }
  50. };
  51. </script>
  52. <style scoped lang="scss">
  53. .cardList {
  54. .container {
  55. margin-top: 31rpx;
  56. padding: 25rpx 0;
  57. border-radius: 20rpx;
  58. background: #1B1713;
  59. .content_border {
  60. border-bottom: 1px solid #2A2A2A;
  61. }
  62. .content {
  63. display: flex;
  64. padding: 24rpx 35rpx;
  65. .left {
  66. width: 228rpx;
  67. height: 228rpx;
  68. border-radius: 20rpx;
  69. overflow: hidden;
  70. img {
  71. width: 100%;
  72. height: 100%;
  73. }
  74. }
  75. .right {
  76. display: flex;
  77. flex-direction: column;
  78. justify-content: space-between;
  79. flex: 1;
  80. margin-left: 26rpx;
  81. color: $uni-text-color-grey;
  82. font-size: 24rpx;
  83. .detailed {
  84. .title {
  85. font-size: 32rpx;
  86. color: #fff;
  87. padding-top: 11rpx;
  88. }
  89. .date {
  90. padding: 25rpx 0 19rpx;
  91. display: flex;
  92. align-items: center;
  93. &::before {
  94. content: '';
  95. display: block;
  96. background: url('@/static/image/cart/timeIcon.png') no-repeat;
  97. background-size: 100% 100%;
  98. width: 24rpx;
  99. height: 24rpx;
  100. margin-right: 10rpx;
  101. }
  102. }
  103. .address {
  104. display: flex;
  105. align-items: center;
  106. &::before {
  107. content: '';
  108. display: block;
  109. background: url('@/static/image/cart/addressIcon.png') no-repeat;
  110. background-size: 100% 100%;
  111. width: 22rpx;
  112. height: 26rpx;
  113. margin-right: 10rpx;
  114. }
  115. }
  116. }
  117. .price {
  118. display: flex;
  119. align-items: center;
  120. justify-content: space-between;
  121. .num-box {
  122. font-size: 27rpx;
  123. color: #fff;
  124. }
  125. .btn-box {
  126. width: 180rpx;
  127. height: 54rpx;
  128. background: url('@/static/image/member/btn-2.png') no-repeat;
  129. background-size: 100% 100%;
  130. font-weight: 500;
  131. font-size: 23rpx;
  132. color: #FFFFFF;
  133. text-align: center;
  134. line-height: 54rpx;
  135. }
  136. }
  137. }
  138. }
  139. .button-sp-area {
  140. text-align: right;
  141. padding-top: 20rpx;
  142. .mini-btn {
  143. width: 166rpx;
  144. height: 53rpx;
  145. line-height: 53rpx;
  146. font-size: 24rpx;
  147. border-radius: 50rpx;
  148. margin-left: 20rpx;
  149. background-color: #34312E;
  150. color: #AFAFAF;
  151. }
  152. }
  153. }
  154. }
  155. .active {
  156. color: $uni-color-primary !important;
  157. }
  158. </style>