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

190 lines
3.7 KiB

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