prefer-list.vue
2.76 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
<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-lazy :src="{src: item.default_images, width: 250, height: 335}" :lazy="lazy"></img-lazy>
<p class="product-name">{{item.product_name}}</p>
</a>
</a>
<div class="price">
<span class="sale" :class="{'discount': item.sales_price !== item.market_price}" v-if="item.sales_price">¥{{item
.sales_price}}</span>
<span class="market" :class="{'line-through': item.sales_price}" v-if="item.sales_price !== item.market_price">¥{{item.market_price}}</span>
</div>
</div>
</div>
</div>
</template>
<script>
import ImgLazy from 'component/tool/img-lazy.vue';
export default {
props: {
list: {},
title: {},
lazy: {
type: Boolean,
default: false
}
},
components: {ImgLazy}
};
</script>
<style>
.title-wrap {
height: 80px;
font-size: 32px;
color: #000;
text-align: left;
line-height: 80px;
font-family: "BrownStd", "PingFang SC", Helvetica, Roboto, "Heiti SC", "\9ED1\4F53", Arial;
}
.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;
font-size: 22px;
color: #000;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
.price .sale {
margin-top: 10px;
color: #b0b0b0;
font-size: 22px;
display: inline-block;
margin-left: 7px;
vertical-align: bottom;
&.discount {
color: #000;
}
}
.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>