step2.vue 2.04 KB
<template>
  <div>
    <Row :gutter="16">
      <i-col span="8">
        <order-user-info :order-info="orderInfo"></order-user-info>
      </i-col>
      <i-col span="8">
        <div class="ivu-card">
          <div class="ivu-card-head">
            <p slot="title">退货地址信息</p>
          </div>
          <div class="ivu-card-body">
            <Row>
              <i-col span="24">
                {{ shopsAddressInfo.province }}
                {{ shopsAddressInfo.city }}
                {{ shopsAddressInfo.county }}
                {{ shopsAddressInfo.street }}
              </i-col>
            </Row>
            <Row>
              <i-col span="24">{{ shopsAddressInfo.detailAdd }}</i-col>
            </Row>
            <Row>
              <i-col span="24">{{ customerTel }}</i-col>
            </Row>
          </div>
        </div>
      </i-col>
    </Row>
    <Button type="primary" @click="prevStep(orderCode)">上一步</Button>
    <Button type="primary" @click="nextStep(orderCode)">下一步</Button>
  </div>
</template>
<script>
import { orderUserInfo } from '../../components';
import ShopService from 'services/shop/shop-service';
export default {
  components: { orderUserInfo },
  props: ['current', 'orderCode', 'orderInfo'],
  data() {
    return {
      shopsAddressInfo: [],
      customerTel: '',
    };
  },
  created() {
    this.shopService = new ShopService();
    this.getShopInfo();
    this.$emit('nextStep', 1);
  },
  methods: {
    getShopInfo() {
      this.shopService.getShop().then(res => {
        const { shopsAddressInfo, customerTel } = res.data;
        this.shopsAddressInfo = shopsAddressInfo;
        this.customerTel = customerTel;
      });
    },
    nextStep(code) {
      this.$router.push({
        name: 'order.deliver.step3',
        params: {},
        query: {
          orderCode: code,
        },
      });
    },
    prevStep(code) {
      this.$router.push({
        name: 'order.deliver.step1',
        params: {},
        query: {
          orderCode: code,
        },
      });
    },
  },
};
</script>