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

176 lines
5.7 KiB

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