prefer-list.vue
2.3 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
<template>
<div>
<div class='title-wrap'>{{title}}</div>
<div class="list-wrap">
<div class="product-item" v-for="item in list" :key="item.url">
<a :href="item.url">
<a v-good-href="item">
<img v-img-src="{src: item.default_images, width: 250, height: 335}">
<p class="product-name">{{item.product_name}}</p>
</a>
</a>
<div class="price">
<span class="discount" v-if="item.sales_price">¥{{item.sales_price}}</span>
<span class="market" :class="{'line-through': item.sales_price}">¥{{item.market_price}}</span>
</div>
</div>
</div>
</div>
</template>
<script>
export default {
props: ['list', 'title']
};
</script>
<style>
.title-wrap {
height: 80px;
font-size: 32px;
color: #000;
text-align: left;
line-height: 80px;
}
.list-wrap {
width: 690px;
max-width: 690px;
overflow-y: hidden;
overflow-x: auto;
white-space: nowrap;
.product-item {
display: inline-block;
width: 250px;
padding: 0;
margin-right: 20px;
text-align: left;
img {
width: 100%;
display: block;
}
.product-name {
margin-top: 20px;
max-width: 200px;
font-size: 22px;
color: #000;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
.price .discount {
margin-top: 10px;
color: #f00;
font-size: 22px;
display: inline-block;
margin-left: 7px;
vertical-align: bottom;
}
.price .market {
margin-left: 5px;
font-size: 18px;
margin-top: 10px;
color: #b0b0b0;
}
.line-through {
text-decoration: line-through;
}
}
.item-list:nth-child(odd) {
padding-right: 1px;
}
}
</style>