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

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