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

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