product-list.vue
1.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
<template>
<div class="product-list-wrap">
<div class="product-list">
<div class="product-item" v-for="(item, index) in list" :key="index">
<div class="thumb">
<ImageFormat :src="item.default_images" :width="235" :height="314"></ImageFormat>
</div>
<div class="name">{{item.product_name}}</div>
<div class="price">
<span class="sale-price">¥{{item.sales_price}}</span>
<span class="market-price">¥{{item.market_price}}</span>
</div>
</div>
</div>
</div>
</template>
<script>
export default {
name: 'ProductList',
props: {
list: Array
}
};
</script>
<style type="css">
.product-list-wrap {
display: flex;
justify-content: center;
}
.product-list {
max-width: 714px;
display: flex;
flex-wrap: wrap;
}
.product-item {
width: 50%;
padding: 18px 18px 48px;
.thumb {
height: 428px;
img {
width: 100%;
height: 100%;
display: block;
}
}
.name {
height: 68px;
margin-top: 24px;
font-size: 24px;
line-height: 1.4;
overflow: hidden;
}
.sale-price {
color: #d0021b;
font-size: 26px;
font-weight: 500;
}
.market-price {
color: #b0b0b0;
font-size: 25px;
margin-right: 4px;
text-decoration: line-through;
}
}
</style>