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
<template>
<div>
<el-row :gutter="40">
<el-col :span="12">
<div style="max-height: 800px;overflow: auto;max-width: 800px">
<video-upload :formData="formData.fun"/>
</div>
</el-col>
<el-col :span="12">
<div :style="{backgroundImage:`url(${background})`}" class="view">
<!--视频显示-->
<div class="view-content" v-if="!formData.fun.type && !type">
<img :src="luolaUrl" class="luola"/>
<img :src="luolaComing" class="luolacoming"/>
<div v-for="data in formData.fun.video" class="video-block">
<video :src="data.url" controls></video>
</div>
<div class="tips-block" v-if="formData.fun.change">
<div class="active">视频教学</div>
<div @click="type=true">音频教学</div>
</div>
</div>
<!--音频显示-->
<div class="view-content" v-if="formData.fun.type || type">
<div v-if="formData.fun.audio[0]">
<img :src="formData.fun.audio[0].image" class="audio-img">
<audio :src="formData.fun.audio[0].url"></audio>
<div class="title-block">
<div class="title">
{{formData.fun.audio[0].title}}
</div>
<div class="tips">
{{formData.fun.audio[0].tips}}
</div>
</div>
<div class="range-block">
<input type="range" v-model="range" :style="{backgroundSize:`${range}% 100%`}"/>
<div>
<img :src="playAudio" class="play-btn"/>
</div>
</div>
</div>
<div class="tips-block" v-if="formData.play.change">
<div @click="type = false">视频教学</div>
<div class="active">音频教学</div>
</div>
</div>
</div>
</el-col>
</el-row>
</div>
</template>
<script>
import background from '../../assets/mould/funBlock.png'
import videoUpload from '../textarea/videoUpload'
import luolaUrl from '../../assets/mould/playLuola.png'
import luolaComing from '../../assets/mould/luoLacoming.png'
import playAudio from '../../assets/mould/playAudio.png'
export default {
name: "funBlock",
props:[
'formData'
],
data(){
return{
background:background,
luolaUrl:luolaUrl,
luolaComing:luolaComing,
playAudio:playAudio,
type:false,
range:0
}
},
components:{
videoUpload
}
}
</script>
<style scoped lang="less">
@import "../../util/public";
.view{
width: 335px;
height: 469px;
background-size: 100% 100%;
padding: 140px 20px 77px 20px;
margin: auto;
.view-content{
background: white;
padding: 10px;
width: 315px;
height: 459px;
overflow: auto;
border-radius: 8px;
.audio-img{
width: 188px;
height: 188px;
border-radius: 8px;
display: block;
margin: 40px auto 0 auto;
}
.range-block{
text-align: center;
width: 237px;
margin: auto;
margin-top: 11px;
.play-btn{
margin-top: 28px;
width: 40px;
}
input[type=range] {
-webkit-transform: translateZ(0);
transform: translateZ(0);
-webkit-appearance: none;
background: -webkit-linear-gradient(#49E2A5, #49E2A5) no-repeat,#D8D8D8;
background-size: 75% 100%;/*设置左右宽度比例*/
display: flex;
width: 100%;
border-radius: 10px; /*这个属性设置使填充进度条时的图形为圆角*/
}
input[type=range]::-webkit-slider-thumb {
-webkit-appearance: none;
}
input[type=range]::-webkit-slider-runnable-track {
height: 4px;
border-radius: 2px ;
}
input[type=range]:focus {
outline: none;
}
input[type=range]::-webkit-slider-thumb {
-webkit-appearance: none;
border-radius: 50%; /*外观设置为圆形*/
height: 12px;
width: 12px;
margin-top: -4px; /*使滑块超出轨道部分的偏移量相等*/
background: #49E2A5;
}
}
.title-block{
text-align: center;
margin-top: 24px;
.title{
font-size:16px;
font-family:PingFang-SC-Medium;
font-weight:500;
color:rgba(102,102,102,1);
line-height:22px;
}
.tips{
font-size:14px;
font-family:PingFang-SC-Medium;
font-weight:500;
color:rgba(153,153,153,1);
line-height:20px;
}
}
.luola{
width: 70px;
margin: 10px 0 0 20px;
}
.luolacoming{
width: 135px;
margin-left:42px ;
}
.video-block{
width: 303px;
padding: 8px;
margin: auto;
border: 1px solid #666666;
border-radius: 12px;
height: 171px;
video{
border-radius: 12px;
width: 100%;
}
}
.tips-block{
border-radius: 1000px;
width: 144px;
margin: 16px auto auto;
border: 1px solid #40A9FF;
height: 28px;
line-height: 28px;
&:after{
content: '';
display: block;
clear: both;
}
div{
float: left;
font-size:12px;
width: 50%;
text-align: center;
color: #cccccc;
&.active{
border-radius: 1000px;
background: #40A9FF;
color: #FFFFFF;
}
}
}
}
}
</style>