item.vue
5.8 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
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
<template>
<div>
<!-- item -->
<div class="item_box">
<!-- 用户信息 -->
<div class="user_info">
<img class="pic" src="http://wjjtest.ys2.cnliveimg.com/802/shop/img/2020/05/18/158978851853674726863.jpg" alt=""/>
<div class="name">陕西省-张三-20100759</div>
</div>
<!-- 描述 -->
<div class="desc">
纯天然无污染无添加,一年取一次原生态放养土蜂蜜百花蜜纯天然无污染无添加
</div>
<!-- 图片库 -->
<div class="img-box" >
<div :class="['item',grids.list.length==1?'one':(grids.list.length==2 || grids.list.length==4? 'two':'three')]" v-for="(item, index) in grids.list" :key="index" @click="jump(item)">
<!--<div @click.stop="imagePreview(index)" :class="['item',grids.list.length==1?'one':(grids.list.length==2 || grids.list.length==4? 'two':'three')]" v-for="(item, index) in grids.list" :key="index" @click="jump(item)">-->
<van-image
v-if="index < 9"
class="img"
fit="cover"
lazy-load
:src="(item.img || item) + (item.v === true ? '' : SIGN.BIG)"
>
<template v-slot:error>
<img class="img" src="static/img/x.jpg" alt=""/>
</template>
</van-image>
<div v-if="index < 8 && item.v === true" class="play_box">
<img src="static/img/play.png" />
</div>
<div v-if="grids.list.length>9 && index == 8" class="title">共{{grids.list.length}}张</div>
</div>
</div>
<!-- 地址信息 -->
<div class="address_info">
<div class="left">
<img src="http://wjjtest.ys2.cnliveimg.com/802/shop/img/2020/05/18/158978851853674726863.jpg" alt=""/>
陕西省 西安市 西安区
</div>
<div class="right">
2020-09-23
</div>
</div>
</div>
</div>
</template>
<script>
export default {
data(){
return{
grids:{
list:[
{img:"http://wjjtest.ys2.cnliveimg.com/802/shop/img/2020/05/18/158978851853674726863.jpg"},
{img:"http://wjjtest.ys2.cnliveimg.com/802/shop/img/2020/05/18/158978851853674726863.jpg"},
{img:"http://wjjtest.ys2.cnliveimg.com/802/shop/img/2020/05/18/158978851853674726863.jpg"}
]
}
}
},
//部件
components: {
},
//静态
props: [
],
//对象内部的属性监听,也叫深度监听
watch: {
},
//属性的结果会被缓存,除非依赖的响应式属性变化才会重新计算。主要当作属性来使用;
computed: {
},
//方法表示一个具体的操作,主要书写业务逻辑;
methods: {
},
//请求数据
created() {
},
mounted() {
}
}
</script>
<style scoped lang="less" rel="stylesheet/less">
// 页面信息
.item_box{
margin: 20px;
padding: 30px 20px 20px 20px;
background-color: #fff;
border-radius: 16px;
.user_info{
display:flex;
.pic{
display:block;
width:80px;
height:80px;
border-radius: 50%;
margin-right: 90px;
}
.name{
flex: 1;
height: 80px;
font-size: 30px;
font-family: PingFangSC-Regular, PingFang SC;
font-weight: 400;
color: #333333;
line-height: 80px;
overflow: hidden;
text-overflow:ellipsis;
white-space: nowrap;
}
}
.desc{
height: 74px;
font-size: 26px;
font-weight: 400;
color: #666660;
line-height: 37px;
margin-top: 30px;
display: -webkit-box;
-webkit-box-orient: vertical;
-webkit-line-clamp: 2;
overflow: hidden;
}
.img-box {
width: 100%;
display: flex;
flex-wrap: wrap;
//justify-content: space-around;
list-style: none;
.item{
display: flex;
align-items: center;
justify-content: center;
padding:0 5px;
box-sizing: border-box;
position: relative;
.title{
position: absolute;
flex: 1;
font-size:28px;
color: #fff;
}
.img {
display: block;
width: 100%;
height: 340px;
}
.play_box{
width: 100%;
height: 100%;
position: absolute;
left: 0;
top:0;
//background-color: #000;
z-index: 1;
display: flex;
justify-content: center;
align-items: center;
img{
width: 86px;
height: 86px;
}
}
}
.two{
width: calc(calc(100% / 2));
margin-top: 10px;
.img {
height: 340px;
}
}
.three{
width: calc(calc(100% / 3));
margin-top: 10px;
.img {
height: 222px;
}
}
}
.address_info{
margin-top:30px;
font-size:24px;
font-weight: 300;
color: #9A9A9A;
line-height: 33px;
overflow: hidden;
.left{
display:flex;
align-items: center;
float:left;
img{
display:block;
width:22px;
height:22px;
margin-right: 10px;
}
}
.right{
float:right;
}
}
}
</style>