back-order.vue 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194
  1. <template>
  2. <view class="order">
  3. <view class="order-list">
  4. <view class="order-item" v-for="order in orders">
  5. <view class="order-head">
  6. <view class="factory-name">{{order.factory}}</view>
  7. <view v-if="order.status === 0" class="order-status">待付款</view>
  8. <view v-if="order.status === 2" class="order-status">待收货</view>
  9. </view>
  10. <view class="order-info" @tap="openDetails()">
  11. <view class="product-item" v-for="product in order.products">
  12. <view class="product-image">
  13. <image class="image" :src="product.image" mode="scaleToFill"></image>
  14. </view>
  15. <view class="product-info">
  16. <view class="row">
  17. <view class="name">{{product.name}}</view>
  18. <view class="price">¥{{product.price}}</view>
  19. </view>
  20. <view class="row">
  21. <view class="spec">{{product.specs_name}}</view>
  22. <view class="num">×{{product.specs_num}}</view>
  23. </view>
  24. </view>
  25. </view>
  26. </view>
  27. <view class="total-price">
  28. 总价 <text class="warning">¥{{order.total}}</text>
  29. </view>
  30. <view class="option">
  31. <button v-if="order.status === 0" class="pay-btn" type="default">立即支付</button>
  32. <button v-if="order.status === 2" class="confirm-btn" type="default">确认收货</button>
  33. </view>
  34. </view>
  35. </view>
  36. </view>
  37. </template>
  38. <script>
  39. export default {
  40. data() {
  41. return {
  42. orders: [{
  43. factory: '省心一号工厂',
  44. products: [{
  45. name: '泰国Mistine小黄帽防晒霜',
  46. image: 'https://img.alicdn.com/i4/2929053804/O1CN01RSromv1dyHBcuS4I6_!!2929053804.jpg',
  47. price: 9.52,
  48. specs_name: "白色",
  49. specs_num: 5
  50. }],
  51. status: 2,
  52. total: '99.51'
  53. }, {
  54. factory: '省心二号工厂',
  55. products: [{
  56. name: '【三只松鼠】元宵送礼坚果礼盒1498g',
  57. image: 'https://img.alicdn.com/i4/880734502/O1CN01tA7hal1j7xjnwHQZC_!!880734502.jpg',
  58. price: 9.52,
  59. specs_name: "白色",
  60. specs_num: 5
  61. },
  62. {
  63. name: '泰国Mistine小黄帽防晒霜',
  64. image: 'https://img.alicdn.com/i4/2929053804/O1CN01RSromv1dyHBcuS4I6_!!2929053804.jpg',
  65. price: 9.52,
  66. specs_name: "白色",
  67. specs_num: 5
  68. }
  69. ],
  70. status: 0,
  71. total: '58.51'
  72. }]
  73. }
  74. },
  75. methods: {
  76. openDetails() {
  77. uni.navigateTo({
  78. url:"order-details"
  79. })
  80. }
  81. }
  82. }
  83. </script>
  84. <style lang="scss">
  85. .message {
  86. overflow: hidden;
  87. }
  88. .order-list {
  89. .order-item {
  90. background: white;
  91. margin: 20upx;
  92. padding: 20upx;
  93. border-radius: 20upx;
  94. .order-head {
  95. display: flex;
  96. justify-content: space-between;
  97. margin-bottom: 20upx;
  98. .order-status {
  99. color: $primary-color;
  100. font-size: 24upx;
  101. }
  102. }
  103. .factory-name {
  104. font-size: 28upx;
  105. font-weight: bold;
  106. }
  107. .product-item {
  108. display: flex;
  109. .product-image {
  110. width: 120upx;
  111. height: 120upx;
  112. margin-right: 20upx;
  113. margin-top: 10upx;
  114. .image {
  115. width: 120upx;
  116. height: 120upx;
  117. }
  118. }
  119. .product-info {
  120. flex-grow: 1;
  121. font-size: 28upx;
  122. .name {
  123. font-size: 28upx;
  124. white-space: normal;
  125. display: -webkit-box;
  126. -webkit-box-orient: vertical;
  127. -webkit-line-clamp: 2;
  128. overflow: hidden;
  129. }
  130. .num {
  131. color: #999999;
  132. }
  133. .spec {
  134. font-size: 26upx;
  135. background: #CCCCCC;
  136. color: white;
  137. padding: 0 10upx;
  138. border-radius: 10upx;
  139. }
  140. }
  141. .row {
  142. display: flex;
  143. justify-content: space-between;
  144. margin-bottom: 10upx;
  145. }
  146. }
  147. .total-price {
  148. text-align: right;
  149. font-size: 28upx;
  150. padding: 10upx 0;
  151. .warning {
  152. color: $primary-color;
  153. font-weight: bold;
  154. }
  155. }
  156. .option {
  157. text-align: right;
  158. .pay-btn,
  159. .confirm-btn {
  160. background: white;
  161. border: 2upx solid $primary-color;
  162. display: inline-block;
  163. line-height: normal;
  164. font-size: 28upx;
  165. color: $primary-color;
  166. border-radius: 40upx;
  167. padding: 5upx 10upx;
  168. }
  169. }
  170. }
  171. }
  172. </style>