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

175 lines
5.7 KiB

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