Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
glsx-web
/
glsx-oss-ai-manager
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 1a012274
authored
Feb 25, 2019
by
liimin
Browse Files
Options
Browse Files
Tag
Download
Plain Diff
修改接口路径
2 parents
7b749ade
2192eff6
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
553 additions
and
298 deletions
src/api/brand.js
src/api/voice.js
src/views/customer/brand/Edit.vue
src/views/customer/brand/index.vue
src/views/customer/components/src/manufacturers.vue
src/views/customer/voice/Edit.vue
src/views/customer/voice/gift.vue
src/views/customer/voice/index.vue
src/api/brand.js
View file @
1a01227
...
...
@@ -12,7 +12,7 @@ const __mergeBg = `${path}/background/merge`
const
getExpList
=
{
p
:
[
__expressionList
],
req
:
params
=>
GlAxios
.
post
(
__expressionList
,
params
)
req
:
params
=>
GlAxios
.
post
(
__expressionList
,
params
,
{
headers
:
{
'Content-Type'
:
'application/json; charset=utf-8'
},
requestType
:
'jsonString'
}
)
}
const
grayscaleuser
=
{
...
...
src/api/voice.js
View file @
1a01227
import
{
GlAxios
}
from
'glsx-vue-common'
const
path
=
'
/
admin-ddh-aimanager'
const
path
=
'admin-ddh-aimanager'
const
__sVoiceList
=
`
${
path
}
/voice/activity/search`
const
__sGetManufacturer
=
`
${
path
}
/manufacturer/search`
const
__sGetMerchant
=
`
${
path
}
/merchant/search`
...
...
src/views/customer/brand/Edit.vue
View file @
1a01227
...
...
@@ -7,72 +7,118 @@
:visible
.
sync=
"updateVisible"
:before-close=
"handleClose"
>
<add-activity-background
:backgroundVisible=
"isShowBackground"
:idPassvalue=
"idPassvalue"
:expressionId=
"expressionId"
@
closeBackground=
"closeBack"
></add-activity-background>
<add-activity-background
:backgroundVisible=
"isShowBackground"
:idPassvalue=
"idPassvalue"
:expressionId=
"expressionId"
@
closeBackground=
"closeBack"
></add-activity-background>
<gl-scroll
:height=
"600"
>
<gl-form
:model=
"addParams"
label-width=
"120px"
>
<Manufacturers
width=
"100%"
:eventBus=
"idPassvalue"
v-validate=
"'required'"
:in_row=
'false'
:value
.
sync=
"manufacturer"
:uploadAction=
"uploadAction"
:default_value=
"selectDefaultValue"
/>
<gl-form-item
label=
"上传表情"
prop=
"uploadExpression"
>
<gl-upload
:action=
"uploadAction"
:before-upload=
"beforeUpload_expression"
:on-success=
"success_expression"
:on-remove=
"onRemove_expression"
:limit=
"1"
name=
"file"
<gl-form
:model=
"addParams"
label-width=
"120px"
>
<Manufacturers
width=
"100%"
:eventBus=
"idPassvalue"
v-validate=
"'required'"
data-vv-as=
"表情文件"
>
<gl-button
size=
"small"
type=
"primary"
>
选择表情包文件
</gl-button>
<div
slot=
"tip"
class=
"el-upload__tip"
>
支持格式:.zip
</div>
</gl-upload>
<span
class=
"error"
>
{{
expressionFileErr
}}
</span>
</gl-form-item>
<gl-form-item
label=
"表情背景"
>
<div
class=
"ipBackground_wrap"
>
:in_row=
'false'
:value
.
sync=
"manufacturer"
:uploadAction=
"uploadAction"
:default_value=
"selectDefaultValue"
ref=
"m"
/>
<gl-form-item
label=
"上传表情"
prop=
"uploadExpression"
>
<gl-upload
:action=
"uploadAction"
:before-upload=
"beforeUpload_expression"
:on-success=
"success_expression"
:on-remove=
"onRemove_expression"
:limit=
"1"
:file-list=
"addParams.packagePath?[
{name:addParams.packagePath, url:addParams.packagePath}] : []"
name="file"
v-validate="'required'"
data-vv-as="表情文件"
>
<gl-button
size=
"small"
type=
"primary"
>
选择表情包文件
</gl-button>
<div
slot=
"tip"
class=
"el-upload__tip"
>
支持格式:.zip
</div>
</gl-upload>
<span
class=
"error"
>
{{
expressionFileErr
}}
</span>
</gl-form-item>
<gl-form-item
label=
"表情背景"
>
<div
class=
"ipBackground_wrap"
>
<gl-row
:gutter=
"80"
>
<gl-col
:span=
"2"
v-for=
"item in ipBackgroundDefault"
:key=
"item.backgroundName"
>
<gl-col
:span=
"2"
v-for=
"item in ipBackgroundDefault"
:key=
"item.backgroundName"
>
<gl-upload
class=
"avatar-uploader"
:action=
"uploadAction"
name=
"file"
:show-file-list=
"false"
:on-success=
"item.fun"
:before-upload=
"beforeAvatarUpload"
>
<img
v-if=
"item.backgroundPath"
:src=
"item.backgroundPath"
class=
"avatar"
>
<i
v-else
class=
"el-icon-plus avatar-uploader-icon"
></i>
</gl-upload>
<span>
{{
item
.
backgroundName
}}
</span>
:before-upload=
"beforeAvatarUpload"
>
<img
v-if=
"item.backgroundPath"
:src=
"item.backgroundPath"
class=
"avatar"
>
<i
v-else
class=
"el-icon-plus avatar-uploader-icon"
></i>
</gl-upload>
<span>
{{
item
.
backgroundName
}}
</span>
</gl-col>
</gl-row>
<div
v-for=
"(item, index ) in bgList"
:key=
"'key'+index"
>
<div
v-for=
"(item, index ) in bgList"
:key=
"'key'+index"
>
<div
class=
"bgItem"
>
<img
:src=
"item.backgroundPath"
alt=
""
>
<img
:src=
"item.backgroundPath"
alt=
""
>
<div
class=
"bg-content"
>
<div
class=
"bg-title"
>
{{
item
.
backgroundName
}}
</div>
<div
class=
"bg-status"
></div>
<div>
<span
class=
"bg-time"
>
{{
item
.
beginTime
}}
-
{{
item
.
endTime
}}
</span>
<gl-button
class=
"bg-btn"
type=
"text"
@
click=
"deleteBg(item,index)"
>
删除
</gl-button>
<gl-button
class=
"bg-btn"
type=
"text"
@
click=
"addOrEditBgWindow(item,index)"
>
修改
</gl-button>
<gl-button
class=
"bg-btn"
type=
"text"
@
click=
"deleteBg(item,index)"
>
删除
</gl-button>
<gl-button
class=
"bg-btn"
type=
"text"
@
click=
"addOrEditBgWindow(item,index)"
>
修改
</gl-button>
</div>
</div>
</div>
</div>
<div
class=
"createBg"
@
click=
"addOrEditBgWindow(null)"
>
新增背景
</div>
</div>
<span
class=
"error"
>
{{
backgroundImgErr
}}
</span>
</gl-form-item>
</gl-form>
<div
class=
"createBg"
@
click=
"addOrEditBgWindow(null)"
>
新增背景
</div>
</div>
<span
class=
"error"
>
{{
backgroundImgErr
}}
</span>
</gl-form-item>
</gl-form>
</gl-scroll>
<div
slot=
"footer"
...
...
@@ -99,9 +145,9 @@ var addParams_original = {
id
:
null
,
influenceScope
:
''
,
ipBackgroundList
:
[],
manufacturer
:
1004
,
manufacturerId
:
1004
,
manufacturerName
:
'
1004
'
,
manufacturer
:
null
,
manufacturerId
:
null
,
manufacturerName
:
''
,
merchantId
:
null
,
merchantName
:
''
,
packagePath
:
''
,
...
...
@@ -127,10 +173,25 @@ export default {
if
(
val
)
{
this
.
idPassvalue
.
$on
(
'expressionId'
,
data
=>
{
if
(
data
)
{
this
.
expressionId
=
data
this
.
expressionId
=
data
.
id
this
.
tableValue
=
data
}
this
.
title
=
!
this
.
expressionId
?
'新增品牌IP表情'
:
'编辑品牌IP表情'
// console.log(this.selectDefaultValue)
if
(
this
.
expressionId
)
{
this
.
selectDefaultValue
.
merchantId
=
this
.
tableValue
.
merchantId
this
.
selectDefaultValue
.
manufacturerId
=
this
.
tableValue
.
manufacturerId
this
.
selectDefaultValue
.
manufacturerName
=
this
.
tableValue
.
manufacturerName
this
.
selectDefaultValue
.
influenceScope
=
this
.
tableValue
.
influenceScope
// console.log(this.tableValue)
this
.
addParams
=
this
.
tableValue
this
.
addParams
.
ipBackgroundList
=
[]
// console.log(this.addParams)
// this.addParams.merchantId = this.tableValue.merchantId
// this.addParams.manufacturerId = this.tableValue.manufacturerId
// this.addParams.influenceScope = this.tableValue.influenceScope
this
.
idPassvalue
.
$emit
(
'defalut_setting'
,
this
.
addParams
)
// console.log(this.selectDefaultValue)
this
.
getExpInfo
()
}
})
...
...
@@ -141,6 +202,7 @@ export default {
return
{
manufacturer
:
null
,
// 接收下拉框组件返回值
expressionId
:
null
,
tableValue
:
null
,
selectDefaultValue
:
{},
// 编辑时设置下拉框默认值
expressionFileErr
:
''
,
// 表情包验证错误信息
backgroundImgErr
:
''
,
// 固定表情背景验证错误信息
...
...
@@ -149,77 +211,150 @@ export default {
isShowBackground
:
false
,
// 控制添加背景弹出框显示
addParams
:
null
,
uploadAction
:
''
,
ipBackgroundReset
:
[
{
backgroundName
:
'默认'
,
backgroundPath
:
'http://img01.glsx.com.cn/blib/BIM-190221868c32efdbb82f1c.PNG'
,
id
:
''
,
backgroundType
:
'DEFAULT'
,
fun
:
(
response
,
file
,
fileLis
)
=>
{
if
(
this
.
expressionId
)
{
// 调用接口添加IP背景
this
.
mergeFixedBgInfo
(
this
.
ipBackgroundReset
[
0
],
response
.
data
.
fileUrl
)
}
else
{
this
.
$set
(
this
.
ipBackgroundReset
[
0
],
'backgroundPath'
,
response
.
data
.
fileUrl
)
}
}
},
{
backgroundName
:
'生日'
,
backgroundPath
:
'http://img02.glsx.com.cn/blib/BIM-190221adb64cd0885a7d48.PNG'
,
id
:
''
,
backgroundType
:
'BIRTHDAY'
,
fun
:
(
response
,
file
,
fileLis
)
=>
{
if
(
this
.
expressionId
)
{
// 调用接口添加IP背景
this
.
mergeFixedBgInfo
(
this
.
ipBackgroundReset
[
1
],
response
.
data
.
fileUrl
)
}
else
{
this
.
$set
(
this
.
ipBackgroundReset
[
1
],
'backgroundPath'
,
response
.
data
.
fileUrl
)
}
}
},
{
backgroundName
:
'晴天'
,
backgroundPath
:
'http://img02.glsx.com.cn/blib/BIM-1902218e9dccca1551bf51.PNG'
,
id
:
''
,
backgroundType
:
'WEATHER'
,
fun
:
(
response
,
file
,
fileLis
)
=>
{
if
(
this
.
expressionId
)
{
// 调用接口添加IP背景
this
.
mergeFixedBgInfo
(
this
.
ipBackgroundReset
[
2
],
response
.
data
.
fileUrl
)
}
else
{
this
.
$set
(
this
.
ipBackgroundReset
[
2
],
'backgroundPath'
,
response
.
data
.
fileUrl
)
}
}
},
{
backgroundName
:
'阴天'
,
backgroundPath
:
'http://img01.glsx.com.cn/blib/BIM-190221a63f5ddbd63f6abc.PNG'
,
id
:
''
,
backgroundType
:
'WEATHER'
,
fun
:
(
response
,
file
,
fileLis
)
=>
{
if
(
this
.
expressionId
)
{
// 调用接口添加IP背景
this
.
mergeFixedBgInfo
(
this
.
ipBackgroundReset
[
3
],
response
.
data
.
fileUrl
)
}
else
{
this
.
$set
(
this
.
ipBackgroundReset
[
3
],
'backgroundPath'
,
response
.
data
.
fileUrl
)
}
}
},
{
backgroundName
:
'下雨'
,
backgroundPath
:
'http://img01.glsx.com.cn/blib/BIM-190221b22eabee6878b987.PNG'
,
id
:
''
,
backgroundType
:
'WEATHER'
,
fun
:
(
response
,
file
,
fileLis
)
=>
{
if
(
this
.
expressionId
)
{
// 调用接口添加IP背景
this
.
mergeFixedBgInfo
(
this
.
ipBackgroundReset
[
4
],
response
.
data
.
fileUrl
)
}
else
{
this
.
$set
(
this
.
ipBackgroundReset
[
4
],
'backgroundPath'
,
response
.
data
.
fileUrl
)
}
}
},
{
backgroundName
:
'下雪'
,
backgroundPath
:
'http://img01.glsx.com.cn/blib/BIM-190221b2beea6b648c9906.PNG'
,
id
:
''
,
backgroundType
:
'WEATHER'
,
fun
:
(
response
,
file
,
fileLis
)
=>
{
if
(
this
.
expressionId
)
{
// 调用接口添加IP背景
this
.
mergeFixedBgInfo
(
this
.
ipBackgroundReset
[
5
],
response
.
data
.
fileUrl
)
}
else
{
this
.
$set
(
this
.
ipBackgroundReset
[
5
],
'backgroundPath'
,
response
.
data
.
fileUrl
)
}
}
},
{
backgroundName
:
'沙尘'
,
backgroundPath
:
'http://img01.glsx.com.cn/blib/BIM-190221b990f66e2663eafe.PNG'
,
id
:
''
,
backgroundType
:
'WEATHER'
,
fun
:
(
response
,
file
,
fileLis
)
=>
{
if
(
this
.
expressionId
)
{
// 调用接口添加IP背景
this
.
mergeFixedBgInfo
(
this
.
ipBackgroundReset
[
6
],
response
.
data
.
fileUrl
)
}
else
{
this
.
$set
(
this
.
ipBackgroundReset
[
6
],
'backgroundPath'
,
response
.
data
.
fileUrl
)
}
}
},
{
backgroundName
:
'雷雨'
,
backgroundPath
:
'http://img01.glsx.com.cn/blib/BIM-1902219661911c05f9ce89.PNG'
,
id
:
''
,
backgroundType
:
'WEATHER'
,
fun
:
(
response
,
file
,
fileLis
)
=>
{
if
(
this
.
expressionId
)
{
// 调用接口添加IP背景
this
.
mergeFixedBgInfo
(
this
.
ipBackgroundReset
[
7
],
response
.
data
.
fileUrl
)
}
else
{
this
.
$set
(
this
.
ipBackgroundReset
[
7
],
'backgroundPath'
,
response
.
data
.
fileUrl
)
}
}
},
{
backgroundName
:
'冰雹'
,
backgroundPath
:
'http://img01.glsx.com.cn/blib/BIM-190221a8e183414c51efa2.PNG'
,
id
:
''
,
backgroundType
:
'WEATHER'
,
fun
:
(
response
,
file
,
fileLis
)
=>
{
if
(
this
.
expressionId
)
{
// 调用接口添加IP背景
this
.
mergeFixedBgInfo
(
this
.
ipBackgroundReset
[
8
],
response
.
data
.
fileUrl
)
}
else
{
this
.
$set
(
this
.
ipBackgroundReset
[
8
],
'backgroundPath'
,
response
.
data
.
fileUrl
)
}
}
},
{
backgroundName
:
'雾天'
,
backgroundPath
:
'http://img01.glsx.com.cn/blib/BIM-190221a6b122473d3f63a5.PNG'
,
id
:
''
,
backgroundType
:
'WEATHER'
,
fun
:
(
response
,
file
,
fileLis
)
=>
{
if
(
this
.
expressionId
)
{
// 调用接口添加IP背景
this
.
mergeFixedBgInfo
(
this
.
ipBackgroundReset
[
9
],
response
.
data
.
fileUrl
)
}
else
{
this
.
$set
(
this
.
ipBackgroundReset
[
9
],
'backgroundPath'
,
response
.
data
.
fileUrl
)
}
}
}
],
ipBackgroundDefault
:
[
{
backgroundName
:
'默认'
,
backgroundPath
:
''
,
id
:
''
,
backgroundType
:
'DEFAULT'
,
fun
:
(
response
,
file
,
fileLis
)
=>
{
{
backgroundName
:
'默认'
,
backgroundPath
:
'
http://img01.glsx.com.cn/blib/BIM-190221868c32efdbb82f1c.PNG
'
,
id
:
''
,
backgroundType
:
'DEFAULT'
,
fun
:
(
response
,
file
,
fileLis
)
=>
{
if
(
this
.
expressionId
)
{
// 调用接口添加IP背景
this
.
mergeFixedBgInfo
(
this
.
ipBackgroundDefault
[
0
],
response
.
data
.
fileUrl
)
}
else
{
this
.
$set
(
this
.
ipBackgroundDefault
[
0
],
'backgroundPath'
,
response
.
data
.
fileUrl
)
}
}
},
{
backgroundName
:
'生日'
,
backgroundPath
:
''
,
id
:
''
,
backgroundType
:
'BIRTHDAY'
,
fun
:
(
response
,
file
,
fileLis
)
=>
{
{
backgroundName
:
'生日'
,
backgroundPath
:
'
http://img02.glsx.com.cn/blib/BIM-190221adb64cd0885a7d48.PNG
'
,
id
:
''
,
backgroundType
:
'BIRTHDAY'
,
fun
:
(
response
,
file
,
fileLis
)
=>
{
if
(
this
.
expressionId
)
{
// 调用接口添加IP背景
this
.
mergeFixedBgInfo
(
this
.
ipBackgroundDefault
[
1
],
response
.
data
.
fileUrl
)
}
else
{
this
.
$set
(
this
.
ipBackgroundDefault
[
1
],
'backgroundPath'
,
response
.
data
.
fileUrl
)
}
}
},
{
backgroundName
:
'晴天'
,
backgroundPath
:
''
,
id
:
''
,
backgroundType
:
'WEATHER'
,
fun
:
(
response
,
file
,
fileLis
)
=>
{
{
backgroundName
:
'晴天'
,
backgroundPath
:
'
http://img02.glsx.com.cn/blib/BIM-1902218e9dccca1551bf51.PNG
'
,
id
:
''
,
backgroundType
:
'WEATHER'
,
fun
:
(
response
,
file
,
fileLis
)
=>
{
if
(
this
.
expressionId
)
{
// 调用接口添加IP背景
this
.
mergeFixedBgInfo
(
this
.
ipBackgroundDefault
[
2
],
response
.
data
.
fileUrl
)
}
else
{
this
.
$set
(
this
.
ipBackgroundDefault
[
2
],
'backgroundPath'
,
response
.
data
.
fileUrl
)
}
}
},
{
backgroundName
:
'阴天'
,
backgroundPath
:
''
,
id
:
''
,
backgroundType
:
'WEATHER'
,
fun
:
(
response
,
file
,
fileLis
)
=>
{
{
backgroundName
:
'阴天'
,
backgroundPath
:
'
http://img01.glsx.com.cn/blib/BIM-190221a63f5ddbd63f6abc.PNG
'
,
id
:
''
,
backgroundType
:
'WEATHER'
,
fun
:
(
response
,
file
,
fileLis
)
=>
{
if
(
this
.
expressionId
)
{
// 调用接口添加IP背景
this
.
mergeFixedBgInfo
(
this
.
ipBackgroundDefault
[
3
],
response
.
data
.
fileUrl
)
}
else
{
this
.
$set
(
this
.
ipBackgroundDefault
[
3
],
'backgroundPath'
,
response
.
data
.
fileUrl
)
}
}
},
{
backgroundName
:
'下雨'
,
backgroundPath
:
''
,
id
:
''
,
backgroundType
:
'WEATHER'
,
fun
:
(
response
,
file
,
fileLis
)
=>
{
{
backgroundName
:
'下雨'
,
backgroundPath
:
'
http://img01.glsx.com.cn/blib/BIM-190221b22eabee6878b987.PNG
'
,
id
:
''
,
backgroundType
:
'WEATHER'
,
fun
:
(
response
,
file
,
fileLis
)
=>
{
if
(
this
.
expressionId
)
{
// 调用接口添加IP背景
this
.
mergeFixedBgInfo
(
this
.
ipBackgroundDefault
[
4
],
response
.
data
.
fileUrl
)
}
else
{
this
.
$set
(
this
.
ipBackgroundDefault
[
4
],
'backgroundPath'
,
response
.
data
.
fileUrl
)
}
}
},
{
backgroundName
:
'下雪'
,
backgroundPath
:
''
,
id
:
''
,
backgroundType
:
'WEATHER'
,
fun
:
(
response
,
file
,
fileLis
)
=>
{
{
backgroundName
:
'下雪'
,
backgroundPath
:
'
http://img01.glsx.com.cn/blib/BIM-190221b2beea6b648c9906.PNG
'
,
id
:
''
,
backgroundType
:
'WEATHER'
,
fun
:
(
response
,
file
,
fileLis
)
=>
{
if
(
this
.
expressionId
)
{
// 调用接口添加IP背景
this
.
mergeFixedBgInfo
(
this
.
ipBackgroundDefault
[
5
],
response
.
data
.
fileUrl
)
}
else
{
this
.
$set
(
this
.
ipBackgroundDefault
[
5
],
'backgroundPath'
,
response
.
data
.
fileUrl
)
}
}
},
{
backgroundName
:
'沙尘'
,
backgroundPath
:
''
,
id
:
''
,
backgroundType
:
'WEATHER'
,
fun
:
(
response
,
file
,
fileLis
)
=>
{
{
backgroundName
:
'沙尘'
,
backgroundPath
:
'
http://img01.glsx.com.cn/blib/BIM-190221b990f66e2663eafe.PNG
'
,
id
:
''
,
backgroundType
:
'WEATHER'
,
fun
:
(
response
,
file
,
fileLis
)
=>
{
if
(
this
.
expressionId
)
{
// 调用接口添加IP背景
this
.
mergeFixedBgInfo
(
this
.
ipBackgroundDefault
[
6
],
response
.
data
.
fileUrl
)
}
else
{
this
.
$set
(
this
.
ipBackgroundDefault
[
6
],
'backgroundPath'
,
response
.
data
.
fileUrl
)
}
}
},
{
backgroundName
:
'雷雨'
,
backgroundPath
:
''
,
id
:
''
,
backgroundType
:
'WEATHER'
,
fun
:
(
response
,
file
,
fileLis
)
=>
{
{
backgroundName
:
'雷雨'
,
backgroundPath
:
'
http://img01.glsx.com.cn/blib/BIM-1902219661911c05f9ce89.PNG
'
,
id
:
''
,
backgroundType
:
'WEATHER'
,
fun
:
(
response
,
file
,
fileLis
)
=>
{
if
(
this
.
expressionId
)
{
// 调用接口添加IP背景
this
.
mergeFixedBgInfo
(
this
.
ipBackgroundDefault
[
7
],
response
.
data
.
fileUrl
)
}
else
{
this
.
$set
(
this
.
ipBackgroundDefault
[
7
],
'backgroundPath'
,
response
.
data
.
fileUrl
)
}
}
},
{
backgroundName
:
'冰雹'
,
backgroundPath
:
''
,
id
:
''
,
backgroundType
:
'WEATHER'
,
fun
:
(
response
,
file
,
fileLis
)
=>
{
{
backgroundName
:
'冰雹'
,
backgroundPath
:
'
http://img01.glsx.com.cn/blib/BIM-190221a8e183414c51efa2.PNG
'
,
id
:
''
,
backgroundType
:
'WEATHER'
,
fun
:
(
response
,
file
,
fileLis
)
=>
{
if
(
this
.
expressionId
)
{
// 调用接口添加IP背景
this
.
mergeFixedBgInfo
(
this
.
ipBackgroundDefault
[
8
],
response
.
data
.
fileUrl
)
}
else
{
this
.
$set
(
this
.
ipBackgroundDefault
[
8
],
'backgroundPath'
,
response
.
data
.
fileUrl
)
}
}
},
{
backgroundName
:
'雾天'
,
backgroundPath
:
''
,
id
:
''
,
backgroundType
:
'WEATHER'
,
fun
:
(
response
,
file
,
fileLis
)
=>
{
{
backgroundName
:
'雾天'
,
backgroundPath
:
'
http://img01.glsx.com.cn/blib/BIM-190221a6b122473d3f63a5.PNG
'
,
id
:
''
,
backgroundType
:
'WEATHER'
,
fun
:
(
response
,
file
,
fileLis
)
=>
{
if
(
this
.
expressionId
)
{
// 调用接口添加IP背景
this
.
mergeFixedBgInfo
(
this
.
ipBackgroundDefault
[
9
],
response
.
data
.
fileUrl
)
}
else
{
this
.
$set
(
this
.
ipBackgroundDefault
[
9
],
'backgroundPath'
,
response
.
data
.
fileUrl
)
}
}
}
]
}
},
...
...
@@ -232,15 +367,21 @@ export default {
methods: {
// 获取表情信息
getExpInfo() {
// console.log(this.tableValue)
// this.manufacturer = Object.assign(this.manufacturer, this.tableValue)
getExp
.req({ expressionId: this.expressionId })
.then(res => {
console.log(res)
//
console.log(res)
this.addParams.id = res.id
// this.manufacturer = res
// 设置下拉框默认值
this.selectDefaultValue.merchantId = res.merchantId
this.selectDefaultValue.manufacturerId = res.manufacturerId
this.selectDefaultValue.influenceScope = res.influenceScope
// this.addParams.merchantId = res.merchantId
// this.addParams.manufacturerId = res.manufacturerId
// this.addParams.influenceScope = res.influenceScope
// this.selectDefaultValue.merchantId = res.merchantId
// this.selectDefaultValue.manufacturerId = res.manufacturerId
// this.selectDefaultValue.influenceScope = res.influenceScope
// 加载固定表情背景
const resGroundList = res.ipBackgroundList
this.ipBackgroundDefault.forEach((defaultItem, index) => {
...
...
@@ -257,8 +398,13 @@ export default {
this.bgList.push(item)
}
})
// console.log(this.selectDefaultValue)
// console.log(resGroundList)
this.addParams.ipBackgroundList = resGroundList
// console.log('addParams')
// console.log(this.addParams)
})
.catch(err =>
console.log
(err))
.catch(err =>
this.error
(err))
},
// // 限制用户上传的灰度用户文件格式和大小
// beforeUpload_grayscaleuser(file) {
...
...
@@ -283,13 +429,21 @@ export default {
// this.addParams.grayscaleUserList = ''
// },
// 限制用户上传的表情包文件格式和大小
// beforeUpload_expression(file) {
// console.log(file)
// // const fileType = ['zip']
// const isFileType = file.type.includes('zip')
// // const isSize = file.size / 1024 / 1024 < 1
// !isFileType && this.$message.error('上传表情包文件只能是 zip 格式!')
// // !isSize && this.$message.error('上传表情包文件大小不能超过1MB')
// return isFileType
// },
beforeUpload_expression(file) {
cons
t fileType = ['application/x-zip-compressed']
const
isFileType = fileType.includes(file.type
)
const is
Size = file.size / 1024 / 1024 < 1
cons
ole.log(file)
const
fileArr = file.name.split('.'
)
const is
FileType = fileArr[fileArr.length - 1].includes('zip')
!isFileType && this.$message.error('上传表情包文件只能是 zip 格式!')
!isSize && this.$message.error('上传表情包文件大小不能超过1MB')
return isFileType && isSize
return isFileType
},
// 表情包上传成功
success_expression(res) {
...
...
@@ -312,13 +466,14 @@ export default {
},
// 添加固定表情背景
addFixedBgInfo(params) {
console.log(params)
//
console.log(params)
addBg
.req(params)
.then(res => {
// this.success(res)
console.log(res)
})
.catch(err =>
console.log
(err))
.catch(err =>
this.error
(err))
},
// 修改固定表情背景
mergeFixedBgInfo(ipBackgroundDefault_item, fileUrl) {
...
...
@@ -328,7 +483,7 @@ export default {
.then(res => {
this.$set(ipBackgroundDefault_item, 'backgroundPath', fileUrl)
})
.catch(err =>
console.log
(err))
.catch(err =>
this.error
(err))
},
// 打开活动表情弹出框
addOrEditBgWindow(obj, idx) {
...
...
@@ -371,59 +526,67 @@ export default {
.then(res => {
this.bgList.splice(idx, 1)
})
.catch(err =>
console.log
(err))
.catch(err =>
this.error
(err))
} else {
this.bgList.splice(idx, 1)
}
},
// 关闭表情信息弹出框
handleClose() {
this.$emit('updateClose')
this.$emit('updateClose', true)
this.idPassvalue.$emit('reset')
clearTimeout(timer)
const timer = setTimeout(() => {
this.idPassvalue.$emit('clear_error')
}, 200)
this.InitializationPageValue()
},
validateImg() {
let result = true
// 验证表情包上传情况
if (!this.addParams.packagePath) {
this.expressionFileErr = '表情包是必须的'
result = false
}
// 验证固定表情上传情况
this.backgroundImgErr = ''
this.ipBackgroundDefault.forEach((item, index) => {
if (!item.backgroundPath) { // 如果固定表情有没上传文件的,跳出循环并且显示错误信息
this.backgroundImgErr = '请上传全部固定表情背景'
result = false
}
})
return result
},
// 新增或编辑表情信息表单验证
editExpValidate() {
this.idPassvalue.$emit('submit', function(result) {
console.log(result)
// if (this.manufacturer) {
// if (this.manufacturer.merchants) {
// this.addParams.merchantId = this.manufacturer.merchants.id
// this.addParams.merchantName = this.manufacturer.merchants.merchantName
// }
// if (this.manufacturer.manufacturers) {
// this.addParams.manufacturer = this.manufacturer.manufacturers.manufacturer
// this.addParams.manufacturerId = this.manufacturer.manufacturers.merchantId
// this.addParams.manufacturerName = this.manufacturer.manufacturers.merchantName
// }
// if (this.manufacturer.grayscaleUserList) {
// this.addParams.grayscaleUserList = this.manufacturer.grayscaleUserList
// }
// if (this.manufacturer.influenceScope) {
// this.addParams.influenceScope = this.manufacturer.influenceScope
// }
// }
// console.log('addParams')
// console.log(this.addParams)
if (this.manufacturer) {
if (this.manufacturer.merchants) {
this.addParams.merchantId = this.manufacturer.merchants.merchantId
this.addParams.merchantName = this.manufacturer.merchants.merchantName
}
if (this.manufacturer.manufacturers) {
this.addParams.manufacturer = this.manufacturer.manufacturers.manufacturer
this.addParams.manufacturerId = this.manufacturer.manufacturers.merchantId
this.addParams.manufacturerName = this.manufacturer.manufacturers.merchantName
}
if (this.manufacturer.grayscaleUserList) {
this.addParams.grayscaleUserList = this.manufacturer.grayscaleUserList
}
if (this.manufacturer.influenceScope) {
this.addParams.influenceScope = this.manufacturer.influenceScope
}
}
Promise.all([
this.validateImg(),
this.$refs['m'].$validator.validateAll()
]).then(result => {
if (result[0] && result[1]) {
this.editExpressionInfo()
}
})
// this.$validator.validateAll().then(result => {
// console.log('result:' + result)
// // 验证表情包上传情况
// if (!this.addParams.packagePath) {
// this.expressionFileErr = '表情包是必须的'
// result = false
// }
// // 验证固定表情上传情况
// this.backgroundImgErr = ''
// this.ipBackgroundDefault.forEach((item, index) => {
// if (!item.backgroundPath) { // 如果固定表情有没上传文件的,跳出循环并且显示错误信息
// this.backgroundImgErr = '请上传全部固定表情背景'
// result = false
// return result
// }
// })
// if (result) {
// this.editExpressionInfo()
// }
// })
},
// 新增或编辑表情接口所需参数
getParams() {
...
...
@@ -451,72 +614,92 @@ export default {
// 新增或编辑表情信息
editExpressionInfo() {
const params = this.getParams()
console.log('editExpressionInfo params:' + params)
// const params = this.manufacturer
// console.log(params)
// console.log('editExpressionInfo params:' + params)
if (!this.expressionId) { // 新增表情时,不调用新增或编辑表情背景接口,直接将全部数据打包带过去
delete params.id
console.log('新增ip')
console.log(params)
addExp
.req(params)
.then(res => {
// this.updateVisible = !this.updateVisible
this.success()
this.InitializationPageValue()
this.$emit('updateClose')
})
.catch(err =>
console.log
(err))
.catch(err =>
this.error
(err))
} else { // 编辑表情时,表情信息和表情背景信息分开保存,表情背景的添加和修改直接调用表情接口操作,表情信息里的表情背景数组项不用去管
params.ipBackgroundList = []// 编辑表情时不需要管背景信息,因此清空数组数据
// params.ipBackgroundList = []// 编辑表情时不需要管背景信息,因此清空数组数据
console.log('编辑ip')
console.log(params)
mergeExp
.req(params)
.then(res => {
// this.updateVisible = !this.updateVisible
this.success()
this.InitializationPageValue()
this.$emit('updateClose')
})
.catch(err =>
console.log
(err))
.catch(err =>
this.error
(err))
}
},
// 页面初始化,还原页面
InitializationPageValue() {
// 还原新增或编辑表情接口参数对象
this.addParams =
addParams_original
this.addParams =
this.$deep_clone(addParams_original)
// 还原固定表情背景数组
this.ipBackgroundDefault.forEach((item, index) => {
item.backgroundPath = ''
item.id = ''
// this.ipBackgroundDefault = this.$deep_clone(this.ipBackgroundReset)
this.ipBackgroundDefault.forEach((defaultItem, index) => {
this.ipBackgroundReset.forEach((fixedItem, index) => {
if (defaultItem.backgroundName === fixedItem.backgroundName) {
defaultItem.backgroundPath = fixedItem.backgroundPath
defaultItem.id = fixedItem.id
}
})
})
// this.ipBackgroundDefault.forEach((item, index) => {
// item.backgroundPath = ''
// item.id = ''
// })
// 还原default值
this.selectDefaultValue = {}
// 还原活动表情数组
this.bgList = []
// 还原表情ID
this.expressionId = null
// 还原上传表情和表情背景
this.expressionFileErr = ''
this.backgroundImgErr = ''
}
}
}
</
script
>
<
style
rel=
"stylesheet/scss"
lang=
"scss"
>
$
pic-width
:65px
;
$
pic-width
:
65px
;
.channelUpdateDialog
{
.dialog-footer
{
margin-top
:
-40px
;
}
.ipBackground_wrap
{
.ipBackground_wrap
{
height
:
100%
;
border
:
1px
solid
#dcdfe6
;
border-radius
:
4px
;
padding
:
12px
0
4px
2px
;
&
>.el-row
{
&
>
.el-row
{
text-align
:
center
;
margin-left
:
0
!important
;
margin-right
:
0
!important
;
.el-col{
margin-left
:
0
!important
;
margin-right
:
0
!important
;
.el-col
{
position
:
relative
;
padding-left
:
0
!important
;
padding-left
:
0
!important
;
padding-right
:
0
!important
;
width
:
9.99999999%
;
span{
span
{
margin-top
:
-18px
;
margin-left
:
-
$
pic-width
/
2
;
position
:
absolute
;
width
:
$
pic-width
;
text-align
:
center
text-align
:
center
;
}
}
}
...
...
@@ -527,27 +710,27 @@ $pic-width:65px;
//
line-height
:
90px
;
//
}
.avatar-uploader
.el-upload
{
border
:
1px
dashed
#d9d9d9
;
border-radius
:
6px
;
cursor
:
pointer
;
position
:
relative
;
overflow
:
hidden
;
border
:
1px
dashed
#d9d9d9
;
border-radius
:
6px
;
cursor
:
pointer
;
position
:
relative
;
overflow
:
hidden
;
}
.avatar-uploader
.el-upload
:hover
{
border-color
:
#409EFF
;
border-color
:
#409eff
;
}
.avatar-uploader-icon
{
font-size
:
28px
;
color
:
#8c939d
;
width
:
$
pic-width
;
height
:
$
pic-width
;
line-height
:
$
pic-width
;
text-align
:
center
;
font-size
:
28px
;
color
:
#8c939d
;
width
:
$
pic-width
;
height
:
$
pic-width
;
line-height
:
$
pic-width
;
text-align
:
center
;
}
.avatar
{
width
:
$
pic-width
;
height
:
$
pic-width
;
display
:
block
;
width
:
$
pic-width
;
height
:
$
pic-width
;
display
:
block
;
}
}
</
style
>
...
...
@@ -568,7 +751,7 @@ $pic-width:65px;
div
{
line-height
:
23px
;
width
:
100%
;
flex
:
1
;
flex
:
1
;
}
.bg-time
{
color
:
#ccc
;
...
...
src/views/customer/brand/index.vue
View file @
1a01227
...
...
@@ -13,12 +13,14 @@
clearable
/>
</gl-form-item>
<Manufacturers
width=
"200px"
:eventBus=
"idPassvalue"
:value
.
sync=
"manufacturer"
:manufactureOnly=
"true"
<gl-form-item>
<Manufacturers
width=
"200px"
:eventBus=
"idPassvalue"
:value
.
sync=
"manufacturer"
:manufactureOnly=
"true"
/>
</gl-form-item>
<gl-form-item>
<gl-button
type=
"primary"
...
...
@@ -44,16 +46,16 @@
:table=
"tableData"
v-loading=
"tableLoading"
>
<gl-table-column
align=
"center"
v-for=
"(i, index) in tableData.column"
:key=
"index"
:label=
'i.label'
:prop=
'i.prop'
:width=
'i.width'
>
<template
slot-scope=
"scope"
>
<template
v-if=
'i.prop === "ipBackgroundList"'
>
<img
class=
"tableImg"
:src=
"tableData.data[scope.scope.$index][i.prop]"
>
</
template
>
<
template
v-else
>
{{
tableData
.
data
[
scope
.
scope
.
$index
][
i
.
prop
]
}}
</
template
>
</template>
</gl-table-column
>
<
!--
<
gl-table-column
align=
"center"
v-for=
"(i, index) in tableData.column"
:key=
"index"
:label=
'i.label'
:prop=
'i.prop'
:width=
'i.width'
>
<template
slot-scope=
"scope"
>
<template
v-if=
'i.prop === "ipBackgroundList"'
>
<img
class=
"tableImg"
:src=
"tableData.data[scope.scope.$index][i.prop]"
>
</
template
>
<
template
v-else
>
{{
tableData
.
data
[
scope
.
scope
.
$index
][
i
.
prop
]
}}
</
template
>
</template>
</gl-table-column>
--
>
</gl-table>
<gl-pagination
background
...
...
@@ -101,6 +103,7 @@ export default {
tableData
:
{
border
:
true
,
align
:
'center'
,
height
:
400
,
// height: parseInt(this.$client_height() - 140),
data
:
[],
column
:
[
...
...
@@ -116,22 +119,22 @@ export default {
label
:
'默认IP表情'
,
prop
:
'packagePath'
},
{
label
:
'默认IP背景'
,
prop
:
'ipBackgroundList'
,
formatter
:
(
cellValue
)
=>
{
if
(
cellValue
.
ipBackgroundList
)
{
var
imgUrl
=
''
cellValue
.
ipBackgroundList
.
forEach
((
item
,
index
)
=>
{
if
(
item
.
backgroundType
===
'DEFAULT'
)
{
imgUrl
=
item
.
backgroundPath
return
false
}
})
return
imgUrl
}
}
},
//
{
//
label: '默认IP背景',
//
prop: 'ipBackgroundList',
//
formatter: (cellValue) => {
//
if (cellValue.ipBackgroundList) {
//
var imgUrl = ''
//
cellValue.ipBackgroundList.forEach((item, index) => {
//
if (item.backgroundType === 'DEFAULT') {
//
imgUrl = item.backgroundPath
//
return false
//
}
//
})
//
return imgUrl
//
}
//
}
//
},
{
label
:
'变更时间'
,
prop
:
'updatedDate'
,
...
...
@@ -162,7 +165,7 @@ export default {
{
type
:
'primary'
,
icon
:
'el-icon-edit'
,
callback
:
(
index
,
rows
)
=>
this
.
dialog
(
rows
[
index
]
.
id
)
callback
:
(
index
,
rows
)
=>
this
.
dialog
(
rows
[
index
])
},
{
type
:
'primary'
,
...
...
@@ -228,10 +231,10 @@ export default {
this
.
updateVisible
=
!
this
.
updateVisible
this
.
idPassvalue
.
$emit
(
'expressionId'
,
objId
)
},
updateDialogClose
()
{
console
.
log
(
'关闭'
)
updateDialogClose
(
isCancel
)
{
//
console.log('关闭')
this
.
updateVisible
=
!
this
.
updateVisible
this
.
loadingGetList
()
!
isCancel
&&
this
.
loadingGetList
()
},
deleteExp
(
objId
)
{
if
(
objId
)
{
...
...
src/views/customer/components/src/manufacturers.vue
View file @
1a01227
...
...
@@ -3,7 +3,9 @@
<gl-col
:span=
"(manufactureOnly||!in_row)?24:12"
>
<gl-form-item
label=
'品牌厂商:'
>
<gl-select
v-model=
"model.manufacturerId"
v-model=
"model.manufacturerName"
filterable
clearable
placeholder=
"请选择品牌厂商"
name=
"manufacturerId"
data-vv-as=
"品牌厂商"
...
...
@@ -13,9 +15,13 @@
<gl-option
v-for=
"item in manufacturer_list"
:key=
"item.manufacturerName"
:label=
"item.m
anufacturer
Name"
:label=
"item.m
erchant
Name"
:value=
"item.manufacturer"
/>
>
<span
style=
"float: left"
>
{{
item
.
merchantName
}}
</span>
<span
style=
"float: right; color: #8492a6; font-size: 13px"
>
{{
item
.
manufacturer
}}
</span>
<!--
<span>
{{
item
.
manufacturerName
}}
[
{{
item
.
manufacturer
}}
]
</span>
-->
</gl-option>
</gl-select>
<span
v-show=
"errorBags && errorBags.has('manufacturerId')"
...
...
@@ -34,23 +40,25 @@
v-model=
"model.merchantId"
placeholder=
"请选择渠道商"
style=
"width:100%"
name=
"merchantId"
data-vv-as=
"渠道商"
v-validate=
"'required'"
>
<!-- name="merchantId"
data-vv-as="渠道商" -->
<gl-option
v-for=
"item in merchant_list"
:key=
"item.merchantName"
:label=
"item.merchantName"
:value=
"item.merchantId"
/>
>
<span
style=
"float: left"
>
{{
item
.
merchantName
}}
</span>
<span
style=
"float: right; color: #8492a6; font-size: 13px"
>
{{
item
.
merchantId
}}
</span>
</gl-option>
</gl-select>
<span
<
!--
<
span
v-show=
"errorBags && errorBags.has('merchantId')"
class=
"error"
>
{{
errorBags
&&
errorBags
.
first
(
'merchantId'
)
}}
</span>
</span>
-->
</gl-form-item>
</gl-col>
<gl-col
...
...
@@ -93,7 +101,7 @@
:before-upload=
"beforeUpload_grayscaleuser"
:on-remove=
"onRemove_grayscaleuser"
v-model=
"result.grayscaleUserList"
name=
"
grayscaleUserList
"
name=
"
file
"
data-vv-as=
"灰度用户"
v-validate=
"'required'"
:file-list=
"model.file_list"
...
...
@@ -110,10 +118,10 @@
>
支持格式: .Excel表格,批量上传设备号
</div>
</gl-upload>
<span
v-show=
"errorBags && errorBags.has('
grayscaleUserList
')"
v-show=
"errorBags && errorBags.has('
file
')"
class=
"error"
>
{{
errorBags
&&
errorBags
.
first
(
'
grayscaleUserList
'
)
}}
{{
errorBags
&&
errorBags
.
first
(
'
file
'
)
}}
</span>
<a
:href=
"template_url"
...
...
@@ -128,20 +136,20 @@
import
{
manufacturers
,
merchants
,
grayscaleuser
}
from
'@/api'
import
{
NoticeMixin
}
from
'@/mixins'
const
manufacturer_list_back_up
=
[
{
manufacturer
:
null
,
manufacturerName
:
'请选择品牌厂商
'
,
merchantId
:
0
,
merchantName
:
''
}
//
{
//
manufacturer: null,
// manufacturerName: '
',
//
merchantId: 0,
//
merchantName: ''
//
}
]
const
merchant_list_back_up
=
[
{
merchantId
:
null
,
merchantName
:
'请选择渠道商
'
,
merchantStatus
:
0
,
merchantType
:
401
}
//
{
//
merchantId: null,
// merchantName: '
',
//
merchantStatus: 0,
//
merchantType: 401
//
}
]
export
default
{
name
:
'Manufacturers'
,
...
...
@@ -179,6 +187,11 @@ export default {
// }
// })
// }),
__eventBus
.
$on
(
'defalut_setting'
,
__value
=>
{
console
.
log
(
'setting default value'
)
// console.log(__value)
this
.
__setDefault
(
__value
)
})
__eventBus
.
$on
(
'clear_error'
,
()
=>
{
this
.
$validator
.
errors
.
clear
()
})
...
...
@@ -216,10 +229,10 @@ export default {
this
.
$emit
(
'update:value'
,
__back__data__
)
}
},
'model.manufacturer
Id
'
:
{
'model.manufacturer
Name
'
:
{
handler
(
__value
)
{
this
.
result
.
manufacturers
=
this
.
manufacturer_list
.
filter
(
obj
=>
this
.
model
.
manufacturer
Id
===
obj
.
manufacturer
obj
=>
this
.
model
.
manufacturer
Name
===
obj
.
manufacturer
)[
0
]
const
__back__data__
=
this
.
$deep_clone
(
this
.
result
)
this
.
$emit
(
'update:value'
,
__back__data__
)
...
...
@@ -246,6 +259,7 @@ export default {
{
label
:
'指定用户(灰度)'
,
value
:
'LIST'
}
],
model
:
{
manufacturerName
:
''
,
merchantId
:
''
,
manufacturerId
:
''
,
file_list
:
[]
// 文件列表
...
...
@@ -306,6 +320,7 @@ export default {
},
__reset
()
{
// 初始化
this
.
model
.
manufacturerName
=
null
this
.
model
.
manufacturerId
=
null
this
.
model
.
merchantId
=
null
this
.
result
=
{
...
...
@@ -319,6 +334,7 @@ export default {
__setDefault
(
__default
)
{
this
.
model
.
merchantId
=
__default
.
merchantId
this
.
model
.
manufacturerId
=
__default
.
manufacturerId
this
.
model
.
manufacturerName
=
__default
.
manufacturerName
this
.
result
.
influenceScope
=
__default
.
influenceScope
this
.
model
.
file_list
=
__default
.
file_list
this
.
result
.
grayscaleUserList
=
__default
.
grayscaleuser
...
...
src/views/customer/voice/Edit.vue
View file @
1a01227
...
...
@@ -5,6 +5,7 @@
:title=
"title"
:visible
.
sync=
"updateVisible"
:before-close=
"handleClose"
:close-on-click-modal=
"false"
width=
"900px"
>
<gl-form
...
...
@@ -145,9 +146,6 @@
v-model=
"editForm.activityForm"
placeholder=
"请选择活动"
style=
"width:100%"
name=
"activityForm"
v-validate=
"'required'"
data-vv-as=
"活动内容"
>
<gl-option
v-for=
"item in contents"
...
...
@@ -156,12 +154,12 @@
:value=
"item.value"
/>
</gl-select>
<span
<
!--
<
span
v-show=
"errorBags.has('activityForm')"
class=
"error"
>
{{
errorBags
.
first
(
'activityForm'
)
}}
</span>
</span>
-->
</gl-form-item>
</gl-col>
<gl-col
:span=
"14"
>
...
...
@@ -204,16 +202,13 @@
<gl-table
:table=
"coupons"
ref=
"multipleTable"
name=
"gift"
v-validate=
"'required'"
data-vv-as=
"优惠券"
v-model=
"activityConfig.giftId"
></gl-table>
<span
v-show=
"
errorBags.has('gift')
"
v-show=
"
hasGift
"
class=
"error"
>
{{
errorBags
.
first
(
'gift'
)
}}
优惠券不能为空
</span>
</gl-col>
</gl-row>
...
...
@@ -227,9 +222,7 @@
:on-remove=
"on_remove_gif"
:accept=
"gif.accept"
:on-preview=
"copy_path"
name=
"dynamicEffectIcon"
v-validate=
"'required'"
data-vv-as=
"动效图标"
name=
"file"
:limit=
"1"
v-model=
"activityConfig.dynamicEffectIcon"
:file-list=
"activityConfig.dynamicEffectIcon?[
{name:activityConfig.dynamicEffectIcon,url:activityConfig.dynamicEffectIcon}]:[]"
...
...
@@ -246,10 +239,10 @@
>
动效图标必填
</div>
</gl-upload>
<span
v-show=
"
errorBags.has('dynamicEffectIcon')
"
v-show=
"
hasDynamicEffect
"
class=
"error"
>
{{
errorBags
.
first
(
'dynamicEffectIcon'
)
}}
动效图标不能为空
</span>
</gl-col>
<gl-col
:span=
"12"
>
...
...
@@ -352,6 +345,8 @@ export default {
})
this
.
eventBus
.
$on
(
'edit_event_data'
,
data
=>
{
this
.
title
=
data
?
'编辑活动'
:
'新增活动'
this
.
hasGift
=
false
this
.
hasDynamicEffect
=
false
let
checked_gift
=
{}
this
.
eventBus
.
$emit
(
'reset'
)
// 广播 ---- 清空 组件 数据
if
(
!
data
)
{
...
...
@@ -363,6 +358,7 @@ export default {
const
__clone
=
this
.
$deep_clone
(
data
)
// 拷贝列表传入数据
this
.
editForm
=
__clone
const
{
manufacturerName
,
manufacturerId
,
merchantId
,
influenceScope
,
...
...
@@ -373,6 +369,7 @@ export default {
}
=
__clone
this
.
default_value
=
{
// 设置组件默认值
manufacturerName
,
manufacturerId
,
merchantId
,
influenceScope
,
...
...
@@ -479,7 +476,9 @@ export default {
prop
:
'giftName'
}
]
}
},
hasGift
:
false
,
hasDynamicEffect
:
false
}
},
mounted
()
{
...
...
@@ -489,13 +488,53 @@ export default {
// this.manufacturer_component = this.$refs['m']
},
methods: {
// 活动内容验证
giftValidate() {
if (this.editForm.activityForm === 'GIFT') {
if (this.activityConfig.giftId) {
this.hasGift = false
} else {
this.hasGift = true
}
return !this.hasGift
} else if (this.editForm.activityForm === 'DYNAMIC_EFFECT') {
if (this.activityConfig.dynamicEffectIcon) {
this.hasDynamicEffect = false
} else {
this.hasDynamicEffect = true
}
return !this.hasDynamicEffect
} else {
if (this.activityConfig.giftId && !this.activityConfig.dynamicEffectIcon) {
this.hasGift = false
this.hasDynamicEffect = true
} else if (this.activityConfig.dynamicEffectIcon && !this.activityConfig.giftId) {
this.hasDynamicEffect = false
this.hasGift = true
} else if (this.activityConfig.giftId && this.activityConfig.dynamicEffectIcon) {
this.hasGift = false
this.hasDynamicEffect = false
} else {
this.hasGift = true
this.hasDynamicEffect = true
}
return !this.hasGift && !this.hasDynamicEffect
}
// if (this.editForm.activityForm === 'GIFT' && this.activityConfig.giftId) {
// this.hasGift = false
// } else {
// this.hasGift = true
// }
// return !this.hasGift
},
// 提交数据
handleSubmit() {
Promise.all([
this.$validator.validateAll(),
this.$refs['m'].$validator.validateAll()
this.$refs['m'].$validator.validateAll(),
this.giftValidate()
]).then(result => {
if (result[0] && result[1]) {
if (result[0] && result[1]
&& result[2]
) {
this.fix_params().then(params => {
this.updateLoading = true
;(this.editForm.id ? mergeActivity : addActivity)
...
...
@@ -537,45 +576,50 @@ export default {
delete form.createdBy
delete form.count
delete form.status
if (!form.manufacturer) {
let beginTime = this.time[0]
let endTime = this.time[1]
if (typeof beginTime === 'number') {
beginTime = new Date(beginTime).format(this.time_format)
endTime = new Date(endTime).format(this.time_format)
} else if (typeof beginTime === 'object') {
beginTime = beginTime.format(this.time_format)
endTime = endTime.format(this.time_format)
}
form.beginTime = beginTime
form.endTime = endTime
const {
manufacturers,
merchants,
influenceScope,
grayscaleUserList
} = this.com_value
let beginTime = this.time[0]
let endTime = this.time[1]
if (typeof beginTime === 'number') {
beginTime = new Date(beginTime).format(this.time_format)
endTime = new Date(endTime).format(this.time_format)
} else if (typeof beginTime === 'object') {
beginTime = beginTime.format(this.time_format)
endTime = endTime.format(this.time_format)
}
form.beginTime = beginTime
form.endTime = endTime
const {
manufacturers,
merchants,
influenceScope,
grayscaleUserList
} = this.com_value
// manufacturer
const { manufacturer } = manufacturers
form.manufacturer = manufacturer
form.manufacturerName = manufacturers.merchantName
form.manufacturerId = manufacturers.merchantId
// manufacturer
const { manufacturer } = manufacturers
form.manufacturer = manufacturer
form.manufacturerName = manufacturers.merchantName
form.manufacturerId = manufacturers.merchantId
// merchants
const {
merchantId,
merchantName
// merchants
const {
merchantId,
merchantName
// merchantStatus,
// merchantType
} = merchants
form.merchantId = merchantId
form.merchantName = merchantName
// influenceScope,,,grayscaleUserList
form.influenceScope = influenceScope
form.grayscaleUserList = grayscaleUserList
form.activityConfig = JSON.stringify(this.activityConfig)
resolve(form)
} = merchants
form.merchantId = merchantId
form.merchantName = merchantName
// influenceScope,,,grayscaleUserList
form.influenceScope = influenceScope
form.grayscaleUserList = grayscaleUserList
form.activityConfig = JSON.stringify(this.activityConfig)
resolve(form)
} else {
form.activityConfig = JSON.stringify(this.activityConfig)
resolve(form)
}
} catch (error) {
console.log(error)
this.error(error)
...
...
@@ -596,6 +640,7 @@ export default {
// )
this.activityConfig = this.$merge(this.activityConfig, data)
this.coupons.data = [this.activityConfig]
// this.giftValidate()
this.eventBus.$emit('checked_gift', data)
},
...
...
@@ -607,9 +652,10 @@ export default {
// }
// __cfg.dynamicEffectIcon=res.fileUrl
// this.editForm.activityConfig = JSON.stringify(__cfg)
this.activityConfig.dynamicEffectIcon = res.fileUrl
this.activityConfig.dynamicEffectIcon = res.
data.
fileUrl
},
before_upload_gif(file) {
// console.log(file)
const { size } = this.gif
const isSize = file.size / 1024 / 1024 < size
!isSize && this.$message.error(`
上传图标文件大小不能超过
$
{
size
}
MB
`)
...
...
src/views/customer/voice/gift.vue
View file @
1a01227
...
...
@@ -5,6 +5,7 @@
title=
"选择活动礼品"
:visible
.
sync=
"giftVisible"
:before-close=
"handleClose"
:close-on-click-modal=
"false"
width=
'800px '
>
<gl-row>
...
...
src/views/customer/voice/index.vue
View file @
1a01227
...
...
@@ -112,6 +112,11 @@ export default {
data
:
[],
column
:
[
{
label
:
'主题ID'
,
prop
:
'id'
,
width
:
90
},
{
label
:
'品牌厂商'
,
prop
:
'manufacturerName'
},
...
...
@@ -158,42 +163,43 @@ export default {
prop
:
'updatedBy'
}
],
number
:
{
label
:
'序号'
,
width
:
'5
0px'
,
index
:
index
=>
{
++
index
return
index
<
10
&&
index
>
0
?
'0'
+
index
:
index
}
},
//
number: {
//
label: '序号',
// width: '6
0px',
//
index: index => {
//
++index
//
return index < 10 && index > 0 ? '0' + index : index
//
}
//
},
console
:
{
show
:
true
,
label
:
'操作'
,
prop
:
'options'
,
width
:
'200px'
,
button
:
[
{
label
:
'上架'
,
type
:
'text'
,
formatter
:
rows
=>
rows
.
status
===
{
ON
:
'上架'
,
OF
:
'下架'
}[
rows
.
status
],
callback
:
(
index
,
rows
)
=>
{
const
{
id
,
status
}
=
rows
[
index
]
this
.
$confirm
(
`确定
${{
ON
:
'下架'
,
OF
:
'上架'
}
[status]}该活动?`
,
''
,
{
type
:
'warning'
}
)
.
then
(()
=>
{
this
.
updateActivity
({
id
,
status
:
{
ON
:
'OF'
,
OF
:
'ON'
}[
status
]
})
})
.
catch
(
err
=>
console
.
log
(
err
))
}
},
//
{
//
label: '上架',
//
type: 'text',
//
formatter: rows =>
//
rows.status === { ON: '上架', OF: '下架' }[rows.status],
//
callback: (index, rows) => {
//
const { id, status } = rows[index]
//
this.$confirm(
//
`确定${{ ON: '下架', OF: '上架' }[status]}该活动?`,
//
'',
//
{
//
type: 'warning'
//
}
//
)
//
.then(() => {
//
this.updateActivity({
//
id,
//
status: { ON: 'OF', OF: 'ON' }[status]
//
})
//
})
//
.catch(err => console.log(err))
//
}
//
},
{
type
:
''
,
icon
:
'el-icon-edit'
,
...
...
@@ -209,7 +215,7 @@ export default {
.
then
(()
=>
{
this
.
updateActivity
({
id
:
rows
[
index
].
id
,
deletedFlag
:
'
true
'
deletedFlag
:
'
D
'
})
})
.
catch
(
err
=>
this
.
error
(
err
))
...
...
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