hot.vue
1.99 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
<template>
<div class="hot" v-if="list.length > 0">
<ul>
<li v-for="(item, index) in list" :key="index">
<LayoutLink :href="item.url" class="img-link" :report="{PAGE_URL, ...item.reportParams}" reportEvent="XY_UFO_MAIN_EVENT">
<div class="hot-image">
<ImageFormat :lazy="false" class="item-imge" :src="item.src" :alt="item.alt" :width="100" :height="100"></ImageFormat>
</div>
<div class="hot-name">{{item.title}}</div>
</LayoutLink>
</li>
<li @click="goMore" class="goMore">
<div class="hot-image">更多</div>
<div class="hot-name">MORE</div>
</li>
</ul>
</div>
</template>
<script>
import ImgSize from '../../../../components/img-size';
export default {
name: 'hot',
props: {
list: {
type: Array,
default: true,
},
PAGE_URL: {
type: String,
}
},
components: {
ImgSize,
},
methods: {
// goProduct(item) {
// console.log(item);
// return false;
// this.$router.push({
// name: 'List',
// query: {series: item.series_id }
// });
// },
goMore() {
this.$router.push({ path: 'category' });
}
}
};
</script>
<style lang="scss" scoped>
.hot {
margin: 40px 0;
ul {
overflow: hidden;
li {
width: 25%;
float: left;
text-align: center;
margin-top: 20px;
.hot-image {
width: 100px;
height: 100px;
overflow: hidden;
margin: 0 auto;
img {
width: 100%;
display: block;
}
}
.hot-name {
// margin-top: 20px;
font-size: 24px;
color: #555;
}
&.goMore {
.hot-image {
width: 88px;
height: 56px;
line-height: 56px;
border: 1px solid #eee;
border-radius: 8px;
font-size: 22px;
margin-top: 25px;
}
.hot-name {
margin-top: 20px;
}
}
}
}
}
</style>