price-title.vue
2.55 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
<template>
<div class="price-title">
<i v-if="entity.sales_price > 0"
:class="{price: true, highlight: entity.market_price > entity.sales_price}">
{{entity.format_sales_price !== '0' ? entity.format_sales_price : entity.format_market_price}}
</i>
<i class="price" v-if="entity.market_price > entity.sales_price"
:class="{'line-through': entity.sales_price > 0}">{{entity.format_market_price}}</i>
<p class="product-name">{{entity.product_name}}</p>
<ul class="vip-level" v-if="entity.vipPrice">
<li class="icons-item" v-for="(vip, index) in entity.vipPrice" :key="index">
<span :class="`vip-img vip-${vip.level}`"></span>
<span :class="`vip-price ${vip.currentVip}`">{{vip.price}}</span>
</li>
</ul>
</div>
</template>
<script>
export default {
name: 'PriceTitle',
props: {
entity: {
type: Object,
return() {
return {};
}
}
}
};
</script>
<style lang="scss">
.price-title {
text-align: left;
padding-top: 35px;
padding-bottom: 30px;
.price {
color: #b0b0b0;
font-size: 32px;
font-style: normal;
line-height: 1;
font-family: "BrownStd-Regular";
&.line-through {
margin-left: 8px;
font-size: 22px;
text-decoration: line-through;
}
&.highlight {
line-height: 1;
color: #b0021b;
}
}
.product-name {
margin-top: 15px;
color: #000;
font-size: 24px;
line-height: 1.2;
}
.vip-level {
min-height: 2.2rem;
background-color: #fff;
display: flex;
justify-content: space-between;
.icons-item {
margin: 0;
height: 90px;
font-size: 22px;
line-height: 95px;
span {
display: inline-block;
padding-left: 8px;
vertical-align: middle;
}
.active {
color: #000;
}
}
.vip-img {
width: 90px;
height: 33px;
}
.vip-3 {
background: resolve("me/vip-3.png");
}
.vip-2 {
background: resolve("me/vip-2.png");
}
.vip-1 {
background: resolve("me/vip-1.png");
}
.vip-3,
.vip-2,
.vip-1 {
background-size: 100%;
}
}
}
</style>