order-detail-item.vue
2.25 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
<template>
<router-link :to="toLinkParam" class="detial-item-wrapper">
<div class="order-item-wrapper">
<div class="item-img">
<image-format
alt=""
:src="goodsInfo.goodImg"
:width="180"
:height="180"
/>
</div>
<div class="item-info">
<div>
<div class="price-status">
<span class="price">¥{{ goodsInfo.goodPrice }}</span>
</div>
<p class="item-name">
{{ goodsInfo.productName }}
</p>
</div>
<p class="item-spec">
<span>{{ goodsInfo.colorName }},</span>
<span>{{ goodsInfo.sizeName }}码</span>
</p>
</div>
</div>
</router-link>
</template>
<script>
import { createNamespacedHelpers } from "vuex";
const { mapGetters } = createNamespacedHelpers("order/orderDetail");
export default {
computed: {
...mapGetters(["goodsInfo"]),
toLinkParam() {
const { productId, storageId } = this.goodsInfo;
return {
name: "ProductDetail",
params: { productId }
};
}
}
};
</script>
<style lang="scss" scoped>
.detial-item-wrapper {
display: block;
}
.order-item-wrapper {
display: flex;
.item-img {
width: 180px;
height: 180px;
justify-content: center;
display: flex;
align-items: center;
& > img {
max-height: 100%;
max-width: 100%;
}
}
.item-name {
display: -webkit-box;
-webkit-line-clamp: 2;
-webkit-box-orient: vertical;
overflow: hidden;
text-overflow: ellipsis;
}
.item-info {
display: flex;
flex: 1;
flex-direction: column;
margin-left: 20px;
font-size: 24px;
justify-content: space-between;
.price-status {
display: flex;
justify-content: space-between;
margin-bottom: 12px;
.price {
font-size: 28px;
color: #d0021b;
letter-spacing: 0;
font-weight: bold;
}
.status {
color: #000;
letter-spacing: 0;
font-weight: bold;
}
}
.item-name {
color: #999;
letter-spacing: 0;
line-height: 36px;
}
.item-spec {
font-weight: bold;
& > :last-child {
padding-left: 10px;
}
}
}
}
</style>