case.vue
5.68 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
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
<template>
<view class="container">
<view class="bg"></view>
<view class="box">
<view class="input-box">
<input
type="text"
class="input"
:value="name"
maxlength="50"
@blur="input($event)"
@focus="focus"
/>
<view class="input-tips" v-if="!isSearch"
>搜索图片/视频名称<uni-icons
type="search"
class="icon"
color="#999"
size="20"
></uni-icons
></view>
</view>
<scroll-view
class="record-box"
scroll-y
@scrolltolower="pageonReachBottom"
@scroll="scroll"
>
<view class="list">
<template v-if="list.length">
<template v-for="item in list">
<view class="item" :key="item.id">
<view class="item-autio" @click="playVideo(item)">
<image :src="item.coverUrl" class="cover-box"></image>
<image
v-if="item.sourceType == 2"
src="../../assets/images/boutique/play.png"
class="play-box"
></image>
</view>
<view class="item-desc">{{ item.tabName }}</view>
</view>
</template>
</template>
<template v-else>
<view class="nothing flex">
<image class="icon" src="../../assets/images/home/nothing.webp" />
暂无数据
</view>
</template>
</view>
</scroll-view>
</view>
<view class="popup-box" v-if="popupShow">
<view class="nav-bar">
<view class="back" @click="back">
<uni-icons type="left" :size="24" color="#fff"></uni-icons>
</view>
<view class="title">{{ title }}</view>
</view>
<view class="popup-body">
<video ref="videoPlayer" :src="videoSrc" controls></video>
</view>
</view>
</view>
</template>
<script type="text/ecmascript-6">
import utils from "@/utils/utils";
export default {
name: '',
data () {
return {
name:'',
list: [],
popupShow:false,
isSearch:false,
videoSrc: 'https://qiniu-web-assets.dcloud.net.cn/unidoc/zh/2minute-demo.mp4',
}
},
props: {
views: {
type: Array,
default: () => []
}
},
beforeDestroy() {
this.popupShow = false
},
mounted() {
// this.list = utils.deepClone(this.views)
console.log(this.views)
this.list = this.views
},
methods: {
playVideo(item) {
const {tabName,sourceType,detailUrl} = item
uni.navigateTo({
url: `/pages/boutique/preview?tabName=${tabName}&sourceType=${sourceType}&detailUrl=${detailUrl}`
})
},
focus() {
this.isSearch = true
},
input(e) {
this.name = e.detail.value
if(this.name == '')
this.isSearch = false
this.list = this.views.filter(i=>i.tabName.includes(this.name))
},
},
}
</script>
<style scoped lang="scss">
.container {
position: absolute;
left: 0;
top: 0;
width: 100vw;
height: 100vh;
background-image: linear-gradient(180deg, #f2f6ff 0%, #f7f9ff 100%);
overflow: hidden;
.bg {
width: 100%;
height: 800rpx;
position: absolute;
left: 0;
background-image: url("../../assets/images/boutique/record-bg.png");
background-size: 100% 100%;
top: 0;
}
.box {
padding: 64rpx;
margin-top: 120rpx;
.input-box {
position: relative;
.input {
padding-left: 30rpx;
text-align: center;
height: 80rpx;
background: #ffffff;
border: 3rpx solid #a8c1ff;
border-radius: 16rpx;
width: 100%;
line-height: 80rpx;
z-index: 1;
}
.input-tips {
color: #999999;
position: absolute;
left: 0;
top: 0;
height: 80rpx;
width: 100%;
text-align: center;
display: flex;
align-items: center;
justify-content: center;
pointer-events: none;
.icon {
margin-left: 12rpx;
}
}
}
.list {
display: flex;
flex-wrap: wrap;
gap: 48rpx 60rpx;
padding-top: 48rpx;
.item {
width: 404rpx;
height: 544rpx;
background: #ffffff;
box-shadow: 0 8rpx 24rpx 0 #4673ff1a;
border-radius: 48rpx;
.item-autio {
height: 404rpx;
position: relative;
.cover-box {
width: 100%;
height: 100%;
}
.play-box {
width: 48rpx;
height: 48rpx;
position: absolute;
left: 32rpx;
bottom: 32rpx;
}
}
.item-desc {
height: 140rpx;
padding: 28rpx 32rpx;
font-size: 32rpx;
color: #333333;
}
}
}
}
}
.popup-box {
position: fixed;
top: 0;
left: 0;
width: 100vw;
height: 100vh;
background: #000;
padding: 100rpx 0rpx;
z-index: 100;
.nav-bar {
width: 100%;
height: 96rpx;
.back {
height: 100%;
aspect-ratio: 1/1;
display: flex;
align-items: center;
justify-content: center;
}
.title {
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
font-weight: 500;
font-size: 32rpx;
color: #ffffff;
}
}
.popup-body {
width: 100%;
height: 100%;
video {
width: 100%;
height: 100%;
}
}
}
.nothing {
width: 100vw;
flex-direction: column;
margin-top: 112rpx;
font-size: 28rpx;
color: #999999;
.icon {
width: 676rpx;
height: 284rpx;
margin-bottom: 24rpx;
}
}
</style>