推广小程序前端代码
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.

184 lines
3.5 KiB

10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 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.image.split(',')[0]" alt="">
  7. </view>
  8. <view class="right">
  9. <view class="detailed">
  10. <view class="title">{{item.title}}</view>
  11. <view class="date">{{item.startTime}}</view>
  12. <view class="address">{{item.address}}</view>
  13. </view>
  14. <view class="price">
  15. <view class="num-box">{{item.num}}/{{item.sum}}</view>
  16. <view class="btn-box" @click="toDetail(item)">立即报名</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. toDetail({ id }) {
  50. uni.navigateTo({
  51. url:`/pages_order/huodong-detail?activityId=${id}`
  52. })
  53. }
  54. }
  55. };
  56. </script>
  57. <style scoped lang="scss">
  58. .cardList {
  59. .container {
  60. margin-top: 31rpx;
  61. padding: 25rpx 0;
  62. border-radius: 20rpx;
  63. background: #1B1713;
  64. .content_border {
  65. border-bottom: 1px solid #2A2A2A;
  66. }
  67. .content {
  68. display: flex;
  69. padding: 24rpx 35rpx;
  70. .left {
  71. width: 228rpx;
  72. height: 228rpx;
  73. border-radius: 20rpx;
  74. overflow: hidden;
  75. img {
  76. width: 100%;
  77. height: 100%;
  78. }
  79. }
  80. .right {
  81. display: flex;
  82. flex-direction: column;
  83. justify-content: space-between;
  84. flex: 1;
  85. margin-left: 26rpx;
  86. color: $uni-text-color-grey;
  87. font-size: 24rpx;
  88. .detailed {
  89. .title {
  90. font-size: 32rpx;
  91. color: #fff;
  92. padding-top: 11rpx;
  93. }
  94. .date {
  95. padding: 25rpx 0 19rpx;
  96. display: flex;
  97. align-items: center;
  98. &::before {
  99. content: '';
  100. display: block;
  101. background: url('@/static/image/cart/timeIcon.png') no-repeat;
  102. background-size: 100% 100%;
  103. width: 24rpx;
  104. height: 24rpx;
  105. margin-right: 10rpx;
  106. }
  107. }
  108. .address {
  109. display: flex;
  110. align-items: center;
  111. &::before {
  112. content: '';
  113. display: block;
  114. background: url('@/static/image/cart/addressIcon.png') no-repeat;
  115. background-size: 100% 100%;
  116. width: 22rpx;
  117. height: 26rpx;
  118. margin-right: 10rpx;
  119. flex-shrink: 0;
  120. }
  121. }
  122. }
  123. .price {
  124. display: flex;
  125. align-items: center;
  126. justify-content: space-between;
  127. padding-top: 25rpx;
  128. .num-box {
  129. font-size: 27rpx;
  130. color: #fff;
  131. }
  132. .btn-box {
  133. width: 180rpx;
  134. height: 54rpx;
  135. background: url('@/static/image/member/btn-2.png') no-repeat;
  136. background-size: 100% 100%;
  137. font-weight: 500;
  138. font-size: 23rpx;
  139. color: #FFFFFF;
  140. text-align: center;
  141. line-height: 54rpx;
  142. }
  143. }
  144. }
  145. }
  146. .button-sp-area {
  147. text-align: right;
  148. padding-top: 20rpx;
  149. .mini-btn {
  150. width: 166rpx;
  151. height: 53rpx;
  152. line-height: 53rpx;
  153. font-size: 24rpx;
  154. border-radius: 50rpx;
  155. margin-left: 20rpx;
  156. background-color: #34312E;
  157. color: #AFAFAF;
  158. }
  159. }
  160. }
  161. }
  162. .active {
  163. color: $uni-color-primary !important;
  164. }
  165. </style>