order-logistics-info.vue
2.73 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
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
<template>
<div class="logistics-wrapper">
<div class="header">
<p class="title">{{ logisticInfo.expressSender }}</p>
<img class="step" alt="" :src="stageImgUrl" />
</div>
<!-- 物流信息 -->
<div v-if="logisticInfo.wayBillCode" class="platform-delivery-info">
<div class="icon-wrapper">
<i class="icon"></i>
</div>
<div>
<p>
<span>快递公司:</span>
<span>
{{ logisticInfo.expressCompanyName }}
</span>
<span class="platform-info">{{ platformName }}</span>
</p>
<p>
<span>快递单号:</span>
<span>
{{ logisticInfo.wayBillCode }}
</span>
</p>
</div>
</div>
<div class="delivery-detail" v-for="(detailInfo, i) in detailList" :key="i">
<p>{{ detailInfo.title }}</p>
<time-line :deliveryList="detailInfo.detailList" />
</div>
</div>
</template>
<script>
import { createNamespacedHelpers } from "vuex";
import TimeLine from "./components/time-line";
import { expressTypeEnum } from "../../../constants/logistics-constants";
const { mapActions, mapState, mapGetters } = createNamespacedHelpers(
"order/logisticsInfo"
);
export default {
components: {
TimeLine
},
computed: {
...mapState(["logisticInfo"]),
...mapGetters(["stageImgUrl"]),
platformName() {
const { expressType: type } = this.logisticInfo;
return expressTypeEnum[type];
},
detailList() {
const {
// 物流信息
expressInfoDetailTitle = "",
expressInfoDetailList = [],
// 鉴定信息
judgeExpressInfoDetailTitle = "",
judgeExpressInfoDetailList = [],
// 卖家物流信息
supplementExpressInfoDetailTitle = "",
supplementExpressInfoDetailList = []
} = this.logisticInfo;
return [
{ title: expressInfoDetailTitle, detailList: expressInfoDetailList },
{
title: judgeExpressInfoDetailTitle,
detailList: judgeExpressInfoDetailList
},
{
title: supplementExpressInfoDetailTitle,
detailList: supplementExpressInfoDetailList
}
].filter(item => !!item.title);
}
},
mounted() {
this.fetchLogisticInfo(this.$route.params);
},
methods: {
...mapActions(["fetchLogisticInfo"])
}
};
</script>
<style lang="scss" scoped>
.logistics-wrapper {
height: 100vh;
-webkit-box-orient: vertical;
.step {
display: block;
margin: 0 auto;
height: 100px;
}
.platform-delivery-info {
display: flex;
.icon-wrapper {
width: 48px;
background-color: red;
.icon {
display: block;
padding-bottom: 100%;
}
}
}
}
</style>