Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
saas
/
scrm-micro-content
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit 98fa2fc9
authored
Jun 02, 2023
by
zhangquan
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
设置首帧图
1 parent
82047178
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
25 additions
and
7 deletions
src/components/Upload/index.vue
src/views/discoverManager/components/AddVideo/index.vue
src/components/Upload/index.vue
View file @
98fa2fc
...
@@ -36,8 +36,10 @@
...
@@ -36,8 +36,10 @@
import
upload
from
'@/api/uploadApi'
import
upload
from
'@/api/uploadApi'
import
util
from
'@/utils/util'
import
util
from
'@/utils/util'
import
bigView
from
'@/components/big-view'
import
bigView
from
'@/components/big-view'
import
uploadMixin
from
'@/mixins/upload'
export
default
{
export
default
{
name
:
'Upload'
,
name
:
'Upload'
,
mixins
:
[
uploadMixin
],
components
:
{
components
:
{
bigView
bigView
},
},
...
@@ -66,6 +68,10 @@ export default {
...
@@ -66,6 +68,10 @@ export default {
type
:
String
,
type
:
String
,
default
:
''
default
:
''
},
},
coverAttr
:
{
type
:
String
,
default
:
''
},
name
:
{
name
:
{
type
:
String
,
type
:
String
,
default
:
''
default
:
''
...
@@ -140,12 +146,12 @@ export default {
...
@@ -140,12 +146,12 @@ export default {
return
this
.
$message
.
error
(
'请上传格式为jpg、jpeg、png、webp、gif的图片'
)
return
this
.
$message
.
error
(
'请上传格式为jpg、jpeg、png、webp、gif的图片'
)
}
}
if
(
file
.
type
?.
indexOf
(
'image'
)
>-
1
){
if
(
file
.
type
?.
indexOf
(
'image'
)
>-
1
){
this
.
uploadImg
(
e
)
this
.
uploadImg
Fn
(
e
)
}
else
{
}
else
{
this
.
uploadVideo
(
e
)
this
.
uploadVideo
(
e
)
}
}
},
},
uploadImg
(
e
)
{
uploadImg
Fn
(
e
)
{
const
loading
=
this
.
$loading
({
const
loading
=
this
.
$loading
({
lock
:
true
,
lock
:
true
,
text
:
'Loading'
,
text
:
'Loading'
,
...
@@ -193,12 +199,24 @@ export default {
...
@@ -193,12 +199,24 @@ export default {
if
(
url
&&
url
.
indexOf
(
'https'
)
<
0
){
if
(
url
&&
url
.
indexOf
(
'https'
)
<
0
){
url
=
url
.
replace
(
'http'
,
'https'
)
url
=
url
.
replace
(
'http'
,
'https'
)
}
}
self
.
formObj
[
this
.
attr
]
=
url
self
.
formObj
[
self
.
attr
]
=
url
self
.
$emit
(
'uploadSuccess'
,
{
attr
:
this
.
attr
,
url
})
if
(
this
.
coverAttr
)
{
self
.
$nextTick
(()
=>
[
self
.
getImgUrl
(
url
).
then
(
resp
=>
{
self
.
$set
(
self
.
formObj
,
self
.
coverAttr
,
resp
)
loading
.
close
()
}).
catch
(
err
=>
{
loading
.
close
()
})
})
.
finally
(
end
=>
{
])
}
else
{
loading
.
close
()
}
self
.
$refs
.
fileRef
&&
(
self
.
$refs
.
fileRef
.
value
=
''
)
self
.
$emit
(
'uploadSuccess'
,
{
attr
:
self
.
attr
,
url
})
}).
catch
(
end
=>
{
loading
.
close
()
loading
.
close
()
self
.
$refs
.
fileRef
.
value
=
''
self
.
$refs
.
fileRef
&&
(
self
.
$refs
.
fileRef
.
value
=
''
)
})
})
upload
.
uploadEvent
(
''
,
res
=>
{
upload
.
uploadEvent
(
''
,
res
=>
{
console
.
log
(
res
,
'视频上传完成'
)
console
.
log
(
res
,
'视频上传完成'
)
...
...
src/views/discoverManager/components/AddVideo/index.vue
View file @
98fa2fc
...
@@ -24,7 +24,7 @@
...
@@ -24,7 +24,7 @@
<span
class=
"module active"
>
{{
contentType
[
contentObj
.
type
]
}}
</span>
<span
class=
"module active"
>
{{
contentType
[
contentObj
.
type
]
}}
</span>
</div>
</div>
<div
slot=
"mainVideoSlot"
class=
"main-video-slot"
>
<div
slot=
"mainVideoSlot"
class=
"main-video-slot"
>
<Upload
fileType=
"video"
:formObj=
"formObj"
btnName=
"上传视频"
attr=
"vedioUrl"
></Upload>
<Upload
fileType=
"video"
:formObj=
"formObj"
btnName=
"上传视频"
attr=
"vedioUrl"
coverAttr=
"prodImg"
></Upload>
<Upload
tip=
"建议尺寸:最大5M,138*84px"
:formObj=
"formObj"
btnName=
"上传视频封面"
attr=
"prodImg"
></Upload>
<Upload
tip=
"建议尺寸:最大5M,138*84px"
:formObj=
"formObj"
btnName=
"上传视频封面"
attr=
"prodImg"
></Upload>
</div>
</div>
<div
slot=
"viewSlot"
class=
"view-slot"
>
<div
slot=
"viewSlot"
class=
"view-slot"
>
...
...
Write
Preview
Markdown
is supported
Attach a file
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 post a comment