OrderDetail.vue 6.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243
  1. <template>
  2. <div class="order-detail" v-if="order.order">
  3. <card _Title="订单详情" :_Size="16"></card>
  4. <div class="order-card">
  5. <p class="global_color fontsize_18">{{ order.orderStatusValue }}</p>
  6. <p class="global_color fontsize_16" v-if="order.orderStatusValue === '待核验'">核验码:{{order.orderCode || 'AHDN4123'}}</p>
  7. <p class="global_color">订单号:{{ order.order.sn }}</p>
  8. <div style="color:#999;" class="operation-time">操作时间:{{order.order.updateTime}}</div>
  9. <Steps class="progress" :current="progressList.length" direction="vertical">
  10. <Step
  11. :title="progress.message"
  12. :content="progress.createTime"
  13. v-for="(progress, index) in progressList"
  14. :key="index"
  15. ></Step>
  16. </Steps>
  17. </div>
  18. <div class="order-card">
  19. <h3>收货人信息</h3>
  20. <p>收货人:{{order.order.consigneeName}}</p>
  21. <p>手机号码:{{order.order.consigneeMobile | secrecyMobile}}</p>
  22. <p>收货地址:{{order.order.consigneeAddressPath | unitAddress}} {{order.order.consigneeDetail}}</p>
  23. </div>
  24. <div class="order-card">
  25. <h3>付款信息</h3>
  26. <p>支付方式:{{order.paymentMethodValue}}</p>
  27. <p>付款状态:{{order.payStatusValue}}</p>
  28. </div>
  29. <div class="order-card">
  30. <h3>配送信息</h3>
  31. <p>配送方式:{{order.deliveryMethodValue}}</p>
  32. <p>配送状态:{{order.deliverStatusValue}}</p>
  33. </div>
  34. <div class="order-card" v-if="order.order.receipt">
  35. <h3>发票信息</h3>
  36. <p>发票抬头:{{order.order.receiptVO.receiptTitle}}</p>
  37. <p>发票内容:{{order.order.receiptVO.receiptContent}}</p>
  38. <p v-if="order.order.receiptVO.taxpayerId">纳税人识别号:{{order.order.receiptVO.taxpayerId}}</p>
  39. </div>
  40. <!-- 订单商品 -->
  41. <div class="goods">
  42. <div class="shop-name">
  43. <span @click="shopPage(order.order.storeId)">{{ order.order.storeName }}</span>
  44. </div>
  45. <table>
  46. <thead>
  47. <tr>
  48. <th width="50%">商品</th>
  49. <!-- <th width="20%">属性</th> -->
  50. <th width="20%">货号</th>
  51. <!-- <th width="10%">发货仓库</th> -->
  52. <th width="10%">单价</th>
  53. <th width="10%">数量</th>
  54. <th width="10%">小计</th>
  55. </tr>
  56. </thead>
  57. <tbody>
  58. <tr v-for="(goods, goodsIndex) in order.orderItems" :key="goodsIndex">
  59. <td>
  60. <img @click="goodsDetail(goods.id, goods.goodsId)" :src="goods.image" alt="" />
  61. <div>
  62. <p @click="goodsDetail(goods.id, goods.goodsId)" class="hover-color">
  63. {{ goods.goodsName }}
  64. </p>
  65. </div>
  66. </td>
  67. <td>{{ goods.id }}</td>
  68. <td>{{ goods.goodsPrice | unitPrice('¥') }}</td>
  69. <td>{{ goods.num }}</td>
  70. <td>{{ (goods.goodsPrice * goods.num) | unitPrice('¥') }}</td>
  71. </tr>
  72. </tbody>
  73. </table>
  74. <!-- 订单价格 -->
  75. <div class="order-price">
  76. <div>
  77. <span>商品件数:</span><span>{{ order.order.goodsNum }}件</span>
  78. </div>
  79. <div>
  80. <span>商品总价:</span><span>{{ order.order.goodsPrice | unitPrice("¥") }}</span><br>
  81. </div>
  82. <div>
  83. <span>运费:</span><span>+{{ order.order.freightPrice | unitPrice("¥") }}</span><br>
  84. </div>
  85. <div><span>优惠金额:</span><span>-{{ order.order.discountPrice | unitPrice("¥") }}</span></div>
  86. <div>
  87. <span>应付金额:</span
  88. ><span class="actrual-price">{{ order.order.flowPrice | unitPrice("¥") }}</span>
  89. </div>
  90. </div>
  91. </div>
  92. </div>
  93. </template>
  94. <script>
  95. import card from '@/components/card';
  96. import { orderDetail, getTraces } from '@/api/order.js';
  97. export default {
  98. components: { card },
  99. name: 'order-detail',
  100. data () {
  101. return {
  102. order: {}, // 订单详情数据
  103. progressList: [], // 订单流程
  104. logistics: [] // 物流数据
  105. };
  106. },
  107. methods: {
  108. goodsDetail (skuId, goodsId) {
  109. // 跳转商品详情
  110. let routeUrl = this.$router.resolve({
  111. path: '/goodsDetail',
  112. query: { skuId, goodsId }
  113. });
  114. window.open(routeUrl.href, '_blank');
  115. },
  116. // 跳转店铺首页
  117. shopPage (id) {
  118. let routeUrl = this.$router.resolve({
  119. path: '/Merchant',
  120. query: { id: id }
  121. });
  122. window.open(routeUrl.href, '_blank');
  123. },
  124. getDetail () { // 订单详情
  125. orderDetail(this.$route.query.sn).then(res => {
  126. if (res.success) {
  127. this.order = res.result;
  128. this.progressList = res.result.orderLogs
  129. }
  130. })
  131. },
  132. traces () { // 物流信息
  133. getTraces(this.$route.query.sn).then(res => {
  134. if (res.success) {
  135. this.logistics = res.result
  136. }
  137. })
  138. }
  139. },
  140. mounted () {
  141. this.getDetail()
  142. this.traces()
  143. }
  144. };
  145. </script>
  146. <style lang="scss" scoped>
  147. .order-card {
  148. padding: 10px;
  149. padding-bottom: 10px;
  150. margin-bottom: 10px;
  151. border-bottom: 1px solid #e8eaec;
  152. position: relative;
  153. .global_color {
  154. color: $theme_color;
  155. }
  156. p {
  157. color: #999;
  158. margin: 3px;
  159. }
  160. h3 {
  161. font-weight: normal;
  162. font-size: 16px;
  163. }
  164. .operation-time {
  165. position: absolute;
  166. right: 20px;
  167. top: 10px;
  168. }
  169. }
  170. /** 店铺名称 */
  171. .shop-name {
  172. margin: 15px 0;
  173. span {
  174. color: #438cde;
  175. cursor: pointer;
  176. &:hover {
  177. color: $theme_color;
  178. }
  179. }
  180. .ivu-icon {
  181. color: #ff8f23;
  182. cursor: pointer;
  183. &:hover {
  184. color: $theme_color;
  185. }
  186. }
  187. }
  188. /** 商品列表 */
  189. table {
  190. border: 1px solid #ddd;
  191. color: #999;
  192. border-collapse: collapse;
  193. width: 100%;
  194. tr {
  195. border-top: 1px solid #ddd;
  196. }
  197. thead > tr {
  198. height: 40px;
  199. background: #eee;
  200. }
  201. td {
  202. padding: 5px;
  203. text-align: center;
  204. &:first-child {
  205. text-align: left;
  206. display: flex;
  207. img {
  208. width: 70px;
  209. height: 70px;
  210. margin-right: 10px;
  211. margin-left: 10px;
  212. cursor: pointer;
  213. }
  214. }
  215. &:last-child {
  216. color: $theme_color;
  217. }
  218. }
  219. }
  220. /** 订单价格 */
  221. .order-price {
  222. text-align: right;
  223. margin-top: 30px;
  224. font-size: 16px;
  225. color: #999;
  226. > div > span:nth-child(2) {
  227. width: 130px;
  228. text-align: right;
  229. display: inline-block;
  230. margin-top: 10px;
  231. }
  232. .actrual-price {
  233. color: $theme_color;
  234. font-weight: bold;
  235. font-size: 20px;
  236. }
  237. }
  238. /** 订单进度条 */
  239. .progress {
  240. margin: 15px 0;
  241. }
  242. </style>