Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
N
national_museum_vod-H5
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
fubaole
national_museum_vod-H5
Commits
a23fa209
Commit
a23fa209
authored
Apr 12, 2021
by
乐宝呗666
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改视频上传限制
parent
53886abc
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
23 deletions
+15
-23
commitTab.vue
src/views/user/components/commitTab.vue
+12
-23
historyTab.vue
src/views/user/components/historyTab.vue
+3
-0
No files found.
src/views/user/components/commitTab.vue
View file @
a23fa209
...
...
@@ -55,7 +55,7 @@
v-model=
"form.num"
placeholder=
"请输入观影人数"
input-align=
"right"
:rules=
"[
{ pattern: /^[1-9]\d
*$/, message: '请输入正确内容
' }]"
:rules=
"[
{ pattern: /^[1-9]\d
{1,9}$/, message: '请输入正确内容,最多10位数
' }]"
/>
<van-field
label=
"管理员账号"
...
...
@@ -97,7 +97,7 @@
<img
src=
"@/assets/images/applets/tip.png"
alt
/>
<span>
最多支持上传
<b>
3
</b>
段视频,每段
时长
<b>
30s
</b>
。
<b>
3
</b>
段视频,每段
大小不能超过
<b>
5MB
</b>
。
</span>
</div>
</div>
...
...
@@ -200,30 +200,18 @@ export default {
this
.
showBoard
=
false
;
},
beforeVideo
(
file
)
{
this
.
timeOutVideo
=
fals
e
let
isOver
=
tru
e
if
(
Array
.
isArray
(
file
)){
file
.
forEach
(
item
=>
{
this
.
createVideo
(
item
)
})
isOver
=
file
.
every
(
item
=>
item
<=
5
*
1024
*
1024
)
}
else
{
this
.
createVideo
(
file
)
isOver
=
file
.
size
<=
5
*
1024
*
1024
}
if
(
!
isOver
){
this
.
$toast
.
fail
(
"上传文件大小不能超过 5MB"
);
return
false
}
else
{
return
true
}
return
true
},
createVideo
(
file
){
let
_URL
=
window
.
URL
||
window
.
webkitURL
;
let
videoUrl
=
_URL
.
createObjectURL
(
file
);
let
audioElement
=
new
Audio
(
videoUrl
);
audioElement
.
addEventListener
(
"loadedmetadata"
,
()
=>
{
let
duration
=
audioElement
.
duration
;
//时长为秒,小数,182.36
console
.
log
(
duration
)
if
(
duration
>
31
)
{
this
.
timeOutVideo
=
true
this
.
fileList
=
[]
this
.
$toast
.
fail
(
"上传视频时长不能超过30秒"
);
return
false
;
}
});
},
// 打开日历
onDisplay
()
{
...
...
@@ -515,6 +503,7 @@ export default {
::v-deep
.field-textarea
{
min-height
:
80px
;
padding
:
0
;
margin-bottom
:
150px
;
.van-field__value
{
background-color
:
#f5f5f5
;
}
...
...
src/views/user/components/historyTab.vue
View file @
a23fa209
...
...
@@ -166,6 +166,9 @@ export default {
padding
:
24px
0px
;
height
:
calc
(
100%
-
200px
);
overflow-y
:
auto
;
.van-pull-refresh
{
margin-bottom
:
50px
;
}
.van-cell
{
padding-left
:
0
;
padding-right
:
0
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment