order-logistics-info.vue
3.37 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
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
<template>
<layout-app>
<div class="logistics-wrapper">
<div class="header">
<!-- <p class="title">{{ logisticInfo.expressSender }}</p> -->
<img class="step" alt="" :src="stageImgUrl" />
</div>
<div class="content">
<!-- 物流信息 -->
<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"
>
<span class="title">{{ detailInfo.title }}</span>
<time-line
:isGoingOn="i === 0"
:deliveryList="detailInfo.detailList"
/>
</div>
</div>
</div>
</layout-app>
</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;
.content {
padding: 0 40px;
.delivery-detail {
.title {
font-size: 24px;
padding: 8px 18px 6px 18px;
background: #f0f0f0;
display: inline-block;
}
}
.platform-delivery-info {
display: flex;
.icon-wrapper {
width: 48px;
background-color: red;
.icon {
display: block;
padding-bottom: 100%;
}
}
}
}
.header {
padding-bottom: 60px;
border-bottom: 1px solid #eee;
margin-bottom: 38px;
.step {
display: block;
margin: 0 auto;
height: 100px;
}
}
}
</style>