shop-top.vue
2.9 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
<template>
<div v-if="shopInfo.isBlkShop" class="brand-top-box" :style="{ 'background-image': 'url(' + shopInfo.shopBg + ')' }">
<div class="brand-bottom">
<img v-if="shopInfo.shopLogo"
v-img-src="{src: shopInfo.shopLogo.split('?')[0] + '?imageMogr2/thumbnail/{width}x{height}', width: 120, height: 80}" :alt="shopInfo.shopName">
<div v-else class="brand-title">{{ shopInfo.shopName }}</div>
<hr>
<div class="brand-intro" :class="{ 'brand-short': !showMore }">{{ shopInfo.shopIntro }}</div>
</div>
<div v-if="!showMore" class="showmore expand" @click="introTrans()"><span class="icon"></span></div>
<div v-else class="showmore collapse" @click="introTrans()"><span class="icon"></span></div>
</div>
</template>
<style>
.brand-top-box {
width: 100%;
height: 468px;
color: #fff;
background-color: #ccc;
position: relative;
background-size: cover;
.brand-bottom {
width: 100%;
position: absolute;
bottom: 28px;
padding: 0 30px;
.brand-title {
font-weight: 700;
font-size: 32px;
margin: 5px 0;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
width: 100%;
}
img {
width: 120px;
height: 80px;
}
hr {
width: 100%;
border: #fff solid 1px;
border-top: none;
margin: 5px 0;
margin-bottom: 28px;
}
.brand-intro {
transition: height 0.6s;
font-size: 20px;
line-height: 32px;
width: 90%;
height: 220px;
overflow-y: auto;
display: flex;
text-shadow: 2px 2px 4px #666;
}
.brand-short {
height: 60px;
font-size: 20px;
line-height: 32px;
width: 90%;
text-overflow: ellipsis;
overflow-y: hidden;
-webkit-line-clamp: 2;
-webkit-box-orient: vertical;
}
}
.showmore {
width: 60px;
height: 60px;
position: absolute;
bottom: 10px;
right: 30px;
font-size: 32px;
}
}
</style>
<script>
export default {
props: {
shopInfo: {
type: Object
}
},
data() {
return {
showMore: false
};
},
methods: {
introTrans() {
this.showMore = this.showMore !== true;
}
}
};
</script>