resource-tfgoods-list.vue
1.89 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
<template>
<resource class="no-padding-right">
<ul class="resource-tf-goods">
<li class="product-item" v-for="(item, pi) in value.data.list" :key="pi">
<product-link :value="item" class="link" :yas="value" :yas-f="index" :yas-i="pi"></product-link>
<img-format :lazy="lazy" :src="item.default_images" :w="188" :h="250"></img-format>
<div class="ellipsis">
<p class="title" v-if="item.product_name">{{item.product_name}}</p>
<p class="price" v-if="item.sales_price">¥{{item.sales_price}}</p>
</div>
</li>
</ul>
</resource>
</template>
<script>
import Resource from './resource';
export default {
name: 'ResourceTfGoodsList',
props: {
value: Object,
lazy: Boolean,
index: Number
},
computed: {
},
components: {Resource}
};
</script>
<style lang="scss">
.resource-tf-goods {
width: 100%;
overflow-x: scroll;
-webkit-overflow-scrolling: touch;
white-space: nowrap;
overflow-y: hidden;
li.product-item {
position: relative;
display: inline-block;
padding-right: 20px;
text-align: center;
line-height: 40px;
.link {
position: absolute;
top: 0;
right: 0;
bottom: 0;
left: 0;
}
img {
width: 188px;
height: 250px;
}
.ellipsis > p {
text-overflow: ellipsis;
white-space: nowrap;
overflow: hidden;
font-size: 24px;
max-width: 188px;
line-height: 1;
margin-top: 24px;
font-family: HelveticaNeue , Tahoma, Arial, HiraginoSansGB-W3, "PingFang SC", "Heiti SC";
&.price {
font-size: 28px;
}
}
}
}
</style>