Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
M
mallapp
Project
Project
Details
Activity
Releases
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
viitto
mallapp
Commits
5ab4055d
Commit
5ab4055d
authored
Sep 02, 2021
by
Mac
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
图片视频的判断
parent
7c320df1
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
26 additions
and
7 deletions
+26
-7
pictureUpload.vue
pages/kotra/billboard/plugin/pictureUpload.vue
+2
-2
videoUpload.vue
pages/kotra/billboard/plugin/videoUpload.vue
+24
-5
No files found.
pages/kotra/billboard/plugin/pictureUpload.vue
View file @
5ab4055d
...
...
@@ -6,8 +6,8 @@
<u-upload
ref=
"uUpload"
:action=
"action"
:show-tips=
"false"
@
on-remove=
"onRemove"
@
on-oversize=
"onversize"
@
on-exceed=
"onexceed"
:max-size=
"CompData.FileSizeLimit * 1024 * 1024"
:max-count=
"CompData.FileCount"
:max-size=
"CompData.FileSizeLimit
==0?99999* 1024 * 1024:CompData.FileSizeLimit
* 1024 * 1024"
:max-count=
"CompData.FileCount
==0?'999999':CompData.FileCount
"
:file-list=
"fileList"
@
on-success=
"uploadSuccessHandler"
></u-upload>
...
...
pages/kotra/billboard/plugin/videoUpload.vue
View file @
5ab4055d
...
...
@@ -24,8 +24,16 @@
<u-icon
class=
"u-icon"
name=
"cross"
size=
"30"
color=
"#ffffff"
></u-icon>
</view>
</view>
<view
style=
"border-bottom: 1px solid #e2e2e2;padding-bottom: 10px;"
>
<view
slot=
"addBtn"
class=
"slot-btn"
@
click=
"upvideo()"
v-if=
"FileList.length
<CompData
.
FileCount
"
>
<view
style=
"border-bottom: 1px solid #e2e2e2;padding-bottom: 10px;"
v-if=
"CompData.FileCount>0"
>
<view
slot=
"addBtn"
class=
"slot-btn"
@
click=
"upvideo()"
v-if=
" FileList.length
<CompData
.
FileCount
"
>
<image
class=
"image"
src=
"https://viitto-1301420277.cos.ap-chengdu.myqcloud.com/Upload/Goods/1616573063000_398.png"
mode=
"widthFix"
></image>
</view>
</view>
<view
style=
"border-bottom: 1px solid #e2e2e2;padding-bottom: 10px;"
v-if=
"CompData.FileCount==0"
>
<view
slot=
"addBtn"
class=
"slot-btn"
@
click=
"upvideo()"
>
1
<image
class=
"image"
src=
"https://viitto-1301420277.cos.ap-chengdu.myqcloud.com/Upload/Goods/1616573063000_398.png"
mode=
"widthFix"
></image>
...
...
@@ -77,6 +85,17 @@
sourceType
:
[
'camera'
,
'album'
],
success
:
function
(
res
)
{
console
.
log
(
res
)
if
(
that
.
CompData
.
FileSizeLimit
>
0
){
//大于0 进入判断
let
size
=
res
.
size
if
(
res
.
size
>
(
that
.
CompData
.
FileSizeLimit
*
1024
*
1024
)){
uni
.
showToast
({
title
:
'视频超出设定的大小请重新上传'
,
icon
:
'none'
})
return
}
}
that
.
upFile
(
res
.
tempFilePath
,
1
)
uni
.
showLoading
({
title
:
'上传中...'
...
...
@@ -92,9 +111,9 @@
let
MallBaseId
=
uni
.
getStorageSync
(
"mall_UserInfo"
).
MallBaseId
?
uni
.
getStorageSync
(
"mall_UserInfo"
)
.
MallBaseId
:
1
;
//
let action = this.host2 + '/api/File/UploadTencent?MallBaseId=' + MallBaseId
let
action
=
this
.
host2
+
'/api/File/UploadTencent?MallBaseId='
+
MallBaseId
var
newPath
=
"/EduSystem/Test/Upload/"
;
let
action
=
"http://192.168.20.214:8120/Upload/UploadBase64?filePath="
+
newPath
//
let action = "http://192.168.20.214:8120/Upload/UploadBase64?filePath="+newPath
let
that
=
this
uni
.
uploadFile
({
...
...
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