order-user-info.vue
2.47 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
<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 }} 手机号:{{ 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 v-if="isShowExpress">
<i-col span="24">
物流公司:
<template v-for="(item, index) in logisticsList">
<span v-if="item.id == orderInfo.expressId" :key="index">{{ item.companyName }}</span>
</template>
<template v-if="orderInfo.expressNumber > 0">
<a style="margin-left:20px;" @click="showExpressInfo()">查看物流信息</a>
</template>
</i-col>
</Row>
<Row v-if="isShowExpress">
<i-col span="24">运单号:{{ orderInfo.expressNumber > 0 ? orderInfo.expressNumber : '' }} </i-col>
</Row>
</div>
<order-express-info ref="showOrderExpressInfo" :show="showOrderExpressInfo"></order-express-info>
</div>
</template>
<script>
import _ from 'lodash';
import LogisticsService from 'services/logistics/logistics-service';
import { OrderService } from 'services/order';
import orderExpressInfo from './order-express-info.vue';
export default {
name: 'OrderUserInfo',
components: { orderExpressInfo },
props: ['orderInfo', 'isShowExpress'],
data() {
return {
logisticsList: [],
showOrderExpressInfo: false,
};
},
created() {
this.LogisticsService = new LogisticsService();
this.OrderService = new OrderService();
this.getLogisticsList();
},
methods: {
//获取物流公司列表
getLogisticsList() {
this.LogisticsService.logisticsList().then(ret => {
this.logisticsList = _.get(ret, 'data', []);
});
},
//获取订单物流轨迹
showExpressInfo() {
this.OrderService.queryOrderExpressInfo({ orderCode: this.orderInfo.orderCode }).then(ret => {
const info = _.get(ret, 'data', []);
this.$refs.showOrderExpressInfo.show(info);
});
},
},
};
</script>