order-user-info.vue 1.67 KB
<template>
  <div class="ivu-card">
    <div class="ivu-card-head">
      <p slot="title">物流信息</p>
    </div>
    <div class="ivu-card-body">
      <Row>
        <i-col span="24">收货人:{{ orderInfo.consigneeName }} &nbsp;&nbsp;&nbsp;手机号:{{ orderInfo.mobile }} </i-col>
      </Row>
      <Row>
        <i-col span="24">
          送货地址:{{ orderInfo.province }} {{ orderInfo.city }} {{ orderInfo.district }}
          {{ orderInfo.street }}
        </i-col>
      </Row>
      <Row>
        <i-col span="24">详细地址:{{ orderInfo.address }}</i-col>
      </Row>
      <Row>
        <i-col span="24">邮政编码:{{ orderInfo.zipCode > 0 ? orderInfo.zipCode : '' }}</i-col>
      </Row>
      <Row>
        <i-col span="24">
          物流公司:
          <template v-for="(item, index) in logisticsList">
            <span v-if="item.id == orderInfo.expressId" :key="index">{{ item.companyName }}</span>
          </template>
        </i-col>
      </Row>
      <Row>
        <i-col span="24">运单号:{{ orderInfo.expressNumber > 0 ? orderInfo.expressNumber : '' }} </i-col>
      </Row>
    </div>
  </div>
</template>
<script>
import _ from 'lodash';
import LogisticsService from 'services/logistics/logistics-service';
export default {
  name: 'OrderUserInfo',
  props: ['orderInfo'],
  data() {
    return {
      logisticsList: [],
    };
  },
  created() {
    this.LogisticsService = new LogisticsService();
    this.getLogisticsList();
  },
  methods: {
    //获取物流公司列表
    getLogisticsList() {
      this.LogisticsService.logisticsList().then(ret => {
        this.logisticsList = _.get(ret, 'data', []);
      });
    },
  },
};
</script>