Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
saas
/
scrm-micro-marketing
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 199af93c
authored
Jul 10, 2022
by
chenwq
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
音乐上传
1 parent
f634a69e
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
53 additions
and
12 deletions
src/api/modules/common.js
src/views/seckillActivity/editCrowdFund.vue
src/api/modules/common.js
View file @
199af93
...
@@ -33,6 +33,17 @@ const uploadImgApi = params => {
...
@@ -33,6 +33,17 @@ const uploadImgApi = params => {
})
})
}
}
const
uploadMusicApi
=
params
=>
{
params
.
method
=
'scrm.api.carlife.common.uploadMusic'
return
http
({
url
:
'rop-scrm-carlife/router'
,
method
:
'POST'
,
data
:
params
,
sign
:
true
,
noSignAttr
:
[
'file'
]
})
}
const
uploadVideoApi
=
params
=>
{
const
uploadVideoApi
=
params
=>
{
params
.
method
=
`
${
defaultPath
}
common.uploadVideo`
params
.
method
=
`
${
defaultPath
}
common.uploadVideo`
return
http
({
return
http
({
...
@@ -128,4 +139,4 @@ const getStaffFollowerListApi = params => {
...
@@ -128,4 +139,4 @@ const getStaffFollowerListApi = params => {
})
})
}
}
export
default
{
getMerchantGoodsListApi
,
getGoodsListApi
,
uploadImgApi
,
uploadVideoApi
,
getMerchantList
,
getSimpleMerchantList
,
getZoneListApi
,
getClassifyListApi
,
pictureUpload
,
querylabeltree
,
getCrowdTreeListApi
,
getStaffFollowerListApi
}
export
default
{
getMerchantGoodsListApi
,
getGoodsListApi
,
uploadImgApi
,
upload
MusicApi
,
upload
VideoApi
,
getMerchantList
,
getSimpleMerchantList
,
getZoneListApi
,
getClassifyListApi
,
pictureUpload
,
querylabeltree
,
getCrowdTreeListApi
,
getStaffFollowerListApi
}
src/views/seckillActivity/editCrowdFund.vue
View file @
199af93
...
@@ -78,10 +78,16 @@
...
@@ -78,10 +78,16 @@
<glsx-combi-form
class=
"edit-form-container"
ref=
"serviceEditFormRef"
:isEdit=
"true"
:isBlock=
"false"
:formRef=
"editChildRef"
:formObj=
"editForm"
:formData=
"serviceEditFormData"
:formRules=
"editRule"
></glsx-combi-form>
<glsx-combi-form
class=
"edit-form-container"
ref=
"serviceEditFormRef"
:isEdit=
"true"
:isBlock=
"false"
:formRef=
"editChildRef"
:formObj=
"editForm"
:formData=
"serviceEditFormData"
:formRules=
"editRule"
></glsx-combi-form>
</div>
</div>
</
template
>
</
template
>
<
template
slot=
"activityMusic"
>
<
template
slot=
"activityMusic"
slot-scope=
"scope"
>
<el-upload
class=
"upload-demo"
action=
""
accept=
"audio/mp3, audio/m4a"
:http-request=
"handleMusicUpload"
:on-change=
"handleMusicChange"
:on-remove=
"handleRemove"
:before-remove=
"beforeRemove"
:limit=
"1"
:on-exceed=
"handleExceed"
:file-list=
"fileList
"
>
<el-upload
v-show=
"!editForm[scope.scope.name]"
class=
"upload-demo"
action=
""
accept=
"audio/mp3, audio/m4a"
:show-file-list=
"false"
:http-request=
"handleMusicUpload"
:on-change=
"e => handleMusicChange(e, scope.scope)"
:limit=
"1"
:on-exceed=
"handleExceed
"
>
<el-button
class=
"el-icon-plus"
size=
"small"
type=
"default"
>
背景音乐
</el-button>
<el-button
class=
"el-icon-plus"
size=
"small"
type=
"default"
>
背景音乐
</el-button>
</el-upload>
</el-upload>
<div
v-if=
"editForm[scope.scope.name]"
class=
"flex"
>
<audio
controls
>
<source
:src=
"editForm[scope.scope.name]"
type=
"audio/mpeg"
/>
</audio>
<el-button
class=
"describe-delete"
icon=
"el-icon-delete"
type=
"text"
@
click=
"handleMusicDelete(scope.scope)"
></el-button>
</div>
</
template
>
</
template
>
<
template
slot=
"fictitious"
>
<
template
slot=
"fictitious"
>
<div
class=
"fictitious"
id=
"fictitious"
>
<div
class=
"fictitious"
id=
"fictitious"
>
...
@@ -469,7 +475,8 @@ export default {
...
@@ -469,7 +475,8 @@ export default {
label
:
'音乐文件'
,
label
:
'音乐文件'
,
name
:
'activityMusic'
,
name
:
'activityMusic'
,
tips
:
'活动页背景音乐'
,
tips
:
'活动页背景音乐'
,
// addHtml: 'activityMusic'
limitSize
:
2
,
addHtml
:
'activityMusic'
},
},
{
{
label
:
'预估销量'
,
label
:
'预估销量'
,
...
@@ -729,12 +736,39 @@ export default {
...
@@ -729,12 +736,39 @@ export default {
},
},
// 音乐
// 音乐
handleMusicUpload
()
{
handleMusicUpload
()
{
},
console
.
log
(
'???'
)
musicUpload
(
e
,
targetItem
)
{
var
reader
=
new
FileReader
()
var
file
=
e
.
raw
// 默认1MB
const
limitSize
=
targetItem
.
limitSize
const
isLt
=
file
.
size
/
1024
/
1024
<
limitSize
const
isType
=
[
'audio/mp3'
,
'audio/m4a'
]
if
(
!
isType
)
{
this
.
$message
.
error
(
'上传文件不是jpg、jpeg或png的格式!'
)
return
true
}
if
(
!
isLt
)
{
this
.
$message
.
error
(
'上传的文件大小不能超过'
+
limitSize
+
'MB!'
)
return
true
}
reader
.
readAsDataURL
(
file
)
reader
.
onload
=
e
=>
{
const
imgFile
=
e
.
target
.
result
const
base64
=
file
.
name
.
split
(
'.'
)[
file
.
name
.
split
(
'.'
).
length
-
1
]
+
'@'
+
imgFile
.
split
(
','
)[
1
]
this
.
$apis
.
common
.
uploadMusicApi
({
file
:
base64
}).
then
(
res
=>
{
this
.
$set
(
this
.
editForm
,
targetItem
.
name
,
res
)
})
}
},
handleMusicChange
(
file
,
targetItem
)
{
this
.
musicUpload
(
file
,
targetItem
)
},
},
handleMusic
Change
(
file
)
{
handleMusic
Delete
(
targetItem
)
{
console
.
log
(
file
)
this
.
$set
(
this
.
editForm
,
targetItem
.
name
,
''
)
},
},
// 表单设置
// 表单设置
...
@@ -758,7 +792,6 @@ export default {
...
@@ -758,7 +792,6 @@ export default {
getInfo
()
{
getInfo
()
{
this
.
$apis
.
seckillActivity
.
getActivityDetailApi
({
id
:
this
.
routeInfo
.
id
}).
then
(
res
=>
{
this
.
$apis
.
seckillActivity
.
getActivityDetailApi
({
id
:
this
.
routeInfo
.
id
}).
then
(
res
=>
{
var
info
=
res
var
info
=
res
console
.
log
(
res
)
this
.
editForm
=
this
.
$common
.
utils
.
deepClone
(
res
)
this
.
editForm
=
this
.
$common
.
utils
.
deepClone
(
res
)
this
.
activityInfo
=
info
this
.
activityInfo
=
info
this
.
editForm
.
activityTime
=
[
info
.
startTime
,
info
.
endTime
]
this
.
editForm
.
activityTime
=
[
info
.
startTime
,
info
.
endTime
]
...
@@ -790,7 +823,6 @@ export default {
...
@@ -790,7 +823,6 @@ export default {
if
(
!
this
.
formDescribeList
.
length
)
{
if
(
!
this
.
formDescribeList
.
length
)
{
this
.
formDescribeList
=
[{
value
:
''
}]
this
.
formDescribeList
=
[{
value
:
''
}]
}
}
console
.
log
(
this
.
editForm
)
this
.
$nextTick
(()
=>
{
this
.
$nextTick
(()
=>
{
this
.
editStatus
=
false
this
.
editStatus
=
false
})
})
...
@@ -868,7 +900,6 @@ export default {
...
@@ -868,7 +900,6 @@ export default {
addOrUpdate
()
{
addOrUpdate
()
{
var
params
=
this
.
getCouponInfoParams
()
var
params
=
this
.
getCouponInfoParams
()
// console.log(params)
this
.
$apis
.
seckillActivity
.
addOrUpdateActivityApi
(
params
).
then
(
res
=>
{
this
.
$apis
.
seckillActivity
.
addOrUpdateActivityApi
(
params
).
then
(
res
=>
{
this
.
$message
({
this
.
$message
({
...
@@ -882,7 +913,6 @@ export default {
...
@@ -882,7 +913,6 @@ export default {
},
},
handleConfirm
()
{
handleConfirm
()
{
// console.log(this.editForm)
this
.
validateRules
()
this
.
validateRules
()
var
flag
=
true
var
flag
=
true
if
(
this
.
nameToValSpecsList
&&
this
.
nameToValSpecsList
.
length
>
0
)
{
if
(
this
.
nameToValSpecsList
&&
this
.
nameToValSpecsList
.
length
>
0
)
{
...
...
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