deliver.vue 1.11 KB
<template>
  <div>
    <Row>
      <Steps :current="current">
        <Step title="确认订单信息"></Step>
        <Step title="确认发货/退货地址信息"></Step>
        <Step title="选择物流服务"></Step>
      </Steps>
    </Row>
    <Row class="deliver-step">
      <router-view :current="current" :order-code="orderCode" :order-info="orderInfo" @nextStep="nextStep">
      </router-view>
    </Row>
  </div>
</template>
<script>
import OrderService from 'services/order/order-service';
import _ from 'lodash';
export default {
  data() {
    return {
      orderCode: this.$route.query.orderCode,
      current: 0,
      orderInfo: [],
    };
  },
  created() {
    this.orderService = new OrderService();
    this.getOrderInfo();
  },
  methods: {
    nextStep(step) {
      this.current = step;
    },
    //获取订单详情
    getOrderInfo() {
      this.orderService.orderDetail({ orderCode: +this.orderCode }).then(ret => {
        this.orderInfo = _.get(ret, 'data', []);
      });
    },
  },
};
</script>
<style lang="scss">
.deliver-step {
  padding: 20px;
  button {
    margin-top: 20px;
  }
}
</style>