order-detail.vue 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211
  1. <template>
  2. <view class="order-detail">
  3. <custom-nav noback="noback" transparent="transparent" ref="ltm" title=" " />
  4. <view class="content">
  5. <view class="address">
  6. <view class="name-tel">
  7. <text class="name">收货人:{{ address.con_name || '' }}</text>
  8. <text class="tel">{{ address.con_mobile }}</text>
  9. </view>
  10. <view class="address-text">{{ address | getAddressString }}</view>
  11. </view>
  12. <view class="order">
  13. <view class="order-num">
  14. <text>订单编号:{{ order_num }}</text>
  15. <text>订单状态:{{ order_status | getOrderStatus }}</text>
  16. </view>
  17. <view class="order-time">
  18. <text>下单时间:{{ order_time | formatTime }}</text>
  19. <view class="to-order-detail"></view>
  20. </view>
  21. <view class="goog-item" v-for="(goodItem, goodIndex) in list" :key="goodIndex">
  22. <view class="goodinfo">
  23. <image :src="goodItem.img"></image>
  24. <view class="info">
  25. <text class="name">{{ goodItem.name }}</text>
  26. <text class="price">进货价:¥{{ goodItem.price + '' }}</text>
  27. <text class="storage">我的库存:{{ goodItem.storage }}</text>
  28. </view>
  29. </view>
  30. <view class="type-item" v-for="(typeItem, typeIndex) in goodItem.typeList" :key="typeIndex">
  31. <view class="size-item" v-for="(size, sizeIndex) in typeItem.size" :key="sizeIndex">
  32. <view class="type-size-price">
  33. <text>款式:{{ typeItem.name }} <text style="margin-left: 20px;">尺寸:{{ size }}</text></text>
  34. <text class="basecolor">¥{{ goodItem.price * typeItem.num[sizeIndex] }}</text>
  35. </view>
  36. <view class="num">×{{ ' ' + typeItem.num[sizeIndex] }}</view>
  37. </view>
  38. </view>
  39. </view>
  40. </view>
  41. <view class="remark">备注:{{ remark }}</view>
  42. <view class="totalPrice">
  43. <text>总计金额</text>
  44. <text class="basecolor">{{ '¥ ' + totalPrice + '' }}</text>
  45. </view>
  46. </view>
  47. </view>
  48. </template>
  49. <script>
  50. import { _API_OrderDetail } from '@/apis/order.js'
  51. export default {
  52. data() {
  53. return {
  54. title: '订单详情',
  55. list: [], // 商品列表
  56. remark: '', // 订单备注
  57. address: {}, // 订单地址
  58. order_num: '', // 订单号
  59. order_time: '', // 订单时间
  60. order_status: '', // 订单状态
  61. }
  62. },
  63. computed: {
  64. totalPrice() {
  65. return this.list.reduce((t, e) => {
  66. return e.typeList.reduce((tt, ee) => {
  67. return ee.num.reduce((ttt, eee) => {
  68. return ttt + eee * e.price
  69. }, tt)
  70. }, t)
  71. }, 0)
  72. }
  73. },
  74. onLoad(opt) {
  75. if (opt.forward) { // 如果是查看转单部分
  76. this.title = '转单详情'
  77. }
  78. _API_OrderDetail({ order_num: opt.order_num, type: opt.forward ? 'turn' : 'normal' }).then(res => {
  79. console.log(res.data)
  80. this.list = res.data.goodList // 商品列表
  81. this.remark = res.data.remark // 订单备注
  82. this.address = res.data.address // 订单地址
  83. this.order_num = res.data.order_num // 订单号
  84. this.order_time = res.data.time // 订单时间
  85. this.order_status = res.data.status // 订单状态
  86. })
  87. }
  88. }
  89. </script>
  90. <style lang="scss">
  91. .order-detail {
  92. @include page();
  93. .content {
  94. .address {
  95. font-size: 26rpx;
  96. background: #FFFFFF;
  97. padding: 20rpx 30rpx;
  98. margin-bottom: 10rpx;
  99. box-sizing: border-box;
  100. .name-tel {
  101. @include flex();
  102. margin-bottom: 20rpx;
  103. justify-content: space-between;
  104. .name {
  105. font-size: 32rpx;
  106. }
  107. }
  108. }
  109. .order {
  110. border-bottom: 10rpx solid $app-base-bg;
  111. .order-num, .order-time {
  112. @include flex();
  113. height: 60rpx;
  114. padding: 0 30rpx;
  115. font-size: 26rpx;
  116. margin-bottom: 1rpx;
  117. background: #FFFFFF;
  118. box-sizing: border-box;
  119. justify-content: space-between;
  120. &.order-time {
  121. margin-bottom: 10rpx;
  122. .to-order-detail {
  123. @include flex();
  124. }
  125. }
  126. }
  127. .goog-item {
  128. .goodinfo {
  129. @include flex();
  130. height: 180rpx;
  131. padding: 0 30rpx;
  132. margin-bottom: 1rpx;
  133. background: #FFFFFF;
  134. box-sizing: border-box;
  135. justify-content: space-between;
  136. image {
  137. width: 140rpx;
  138. height: 140rpx;
  139. }
  140. .info {
  141. @include flex(column);
  142. flex: 1;
  143. height: 100%;
  144. margin: 0 30rpx;
  145. align-items: flex-start;
  146. justify-content: flex-start;
  147. .name {
  148. font-size: 32rpx;
  149. margin-top: 20rpx;
  150. }
  151. .price {
  152. font-size: 26rpx;
  153. margin-top: 10rpx;
  154. color: $app-base-color;
  155. }
  156. .storage {
  157. font-size: 26rpx;
  158. margin-top: 10rpx;
  159. color: $app-sec-text-color;
  160. }
  161. }
  162. }
  163. .size-item {
  164. @include flex();
  165. height: 100rpx;
  166. font-size: 32rpx;
  167. padding: 0 30rpx;
  168. margin-bottom: 1rpx;
  169. background: #FFFFFF;
  170. box-sizing: border-box;
  171. justify-content: space-between;
  172. .type-size-price {
  173. @include flex(column);
  174. flex: 1;
  175. height: 100%;
  176. font-size: 26rpx;
  177. align-items: flex-start;
  178. > text {
  179. @include flex();
  180. flex: 1;
  181. width: 100%;
  182. justify-content: flex-start;
  183. }
  184. }
  185. }
  186. }
  187. }
  188. .remark {
  189. min-height: 90rpx;
  190. background: #FFFFFF;
  191. margin-bottom: 10rpx;
  192. padding: 20rpx 30rpx;
  193. border-bottom: 10rpx solid $app-base-bg;
  194. }
  195. .totalPrice {
  196. @include flex();
  197. height: 91rpx;
  198. padding: 0 30rpx;
  199. background: #FFFFFF;
  200. box-sizing: border-box;
  201. justify-content: space-between;
  202. border-bottom: 1rpx solid $app-base-bg;
  203. &.other {
  204. color: $app-sec-text-color;
  205. }
  206. }
  207. }
  208. }
  209. </style>