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 f0334db1
authored
Jan 27, 2019
by
wangql
Browse Files
Options
Browse Files
Tag
Download
Plain Diff
Merge branch 'master' of
http://192.168.3.233:8090/glsx-web/glsx-oss-ai-manager
2 parents
aaa38028
d768ed1c
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
149 additions
and
126 deletions
src/views/customer/components/src/manufacturers.vue
src/views/customer/voice/Edit.vue
src/views/customer/components/src/manufacturers.vue
View file @
f0334db
...
...
@@ -59,10 +59,10 @@
>
<gl-form-item
label=
'选择用户:'
>
<gl-select
v-model=
"
model.user
"
v-model=
"
result.influenceScope
"
placeholder=
"请选择用户"
style=
"width:100%"
name=
"
user
"
name=
"
influenceScope
"
data-vv-as=
"用户"
v-validate=
"'required'"
>
...
...
@@ -74,16 +74,16 @@
/>
</gl-select>
<span
v-show=
"errorBags && errorBags.has('
user
')"
v-show=
"errorBags && errorBags.has('
influenceScope
')"
class=
"error"
>
{{
errorBags
&&
errorBags
.
first
(
'
user
'
)
}}
{{
errorBags
&&
errorBags
.
first
(
'
influenceScope
'
)
}}
</span>
</gl-form-item>
</gl-col>
<gl-col
:span=
"24"
v-if=
"!manufactureOnly &&
model.user
==='LIST'"
v-if=
"!manufactureOnly &&
result.influenceScope
==='LIST'"
>
<gl-form-item
label=
'灰度用户:'
>
<gl-upload
...
...
@@ -96,6 +96,7 @@
name=
"grayscaleUserList"
data-vv-as=
"灰度用户"
v-validate=
"'required'"
:file-list=
"model.file_list"
multiple
>
<gl-button
...
...
@@ -136,7 +137,8 @@ export default {
width
:
String
,
manufactureOnly
:
Boolean
,
in_row
:
Boolean
,
uploadAction
:
String
uploadAction
:
String
,
default_value
:
Object
// errorBags: Object
},
watch
:
{
...
...
@@ -152,7 +154,7 @@ export default {
this
.
result
.
merchants
=
this
.
merchant_list
.
filter
(
obj
=>
this
.
model
.
merchantId
===
obj
.
merchantId
)[
0
]
this
.
model
.
manufacturers
=
this
.
$emit
(
'update:value'
,
this
.
result
)
this
.
$emit
(
'update:value'
,
this
.
result
)
})
})
},
...
...
@@ -179,37 +181,50 @@ export default {
{
label
:
'指定用户(灰度)'
,
value
:
'LIST'
}
],
model
:
{
user
:
''
,
merchantId
:
''
,
manufacturerId
:
''
manufacturerId
:
''
,
file_list
:
[]
//文件列表
},
result
:
{
manufacturers
:
null
,
merchants
:
null
,
grayscaleUserList
:
null
manufacturers
:
null
,
//生产厂商
merchants
:
null
,
//商户渠道
grayscaleUserList
:
null
,
//灰度用户列表
influenceScope
:
''
//用户类型
}
}
},
methods
:
{
get_manufacturer_list
()
{
if
(
manufacturer_list_back_up
.
length
)
{
this
.
manufacturer_list
=
manufacturer_list_back_up
return
}
manufacturers
.
req
({})
.
then
(
res
=>
(
manufacturer_list_back_up
=
this
.
manufacturer_list
=
res
))
.
catch
(
err
=>
this
.
error
(
err
))
return
new
Promise
((
resolve
,
reject
)
=>
{
if
(
manufacturer_list_back_up
.
length
)
{
// this.manufacturer_list = manufacturer_list_back_up
resolve
(
manufacturer_list_back_up
)
}
manufacturers
.
req
({})
.
then
(
res
=>
// manufacturer_list_back_up = this.manufacturer_list = res
// this.model.manufacturerId = this.default_value.manufacturerId
resolve
(
res
)
)
.
catch
(
err
=>
reject
(
err
))
})
},
get_merchant_list
()
{
if
(
merchant_list_back_up
.
length
)
{
this
.
merchant_list
=
merchant_list_back_up
return
}
merchants
.
req
({
merchantType
:
401
,
merchantStatus
:
0
})
.
then
(
res
=>
(
merchant_list_back_up
=
this
.
merchant_list
=
res
))
.
catch
(
err
=>
this
.
error
(
err
))
return
new
Promise
((
resolve
,
reject
)
=>
{
if
(
merchant_list_back_up
.
length
)
{
// this.merchant_list = merchant_list_back_up
resolve
(
merchant_list_back_up
)
}
merchants
.
req
({
merchantType
:
401
,
merchantStatus
:
0
})
.
then
(
res
=>
resolve
(
res
)
// merchant_list_back_up = this.merchant_list = res
// this.model.merchantId = this.default_value.merchantId
)
.
catch
(
err
=>
reject
(
err
))
})
},
// 上传灰度用户成功后调接口解析Excel
success_grayscaleuser
(
res
)
{
...
...
@@ -237,9 +252,28 @@ export default {
this
.
model
.
grayscaleUserList
=
''
}
},
mounted
()
{
this
.
get_manufacturer_list
()
this
.
get_merchant_list
()
created
()
{
if
(
this
.
default_value
)
{
this
.
model
.
merchantId
=
this
.
default_value
.
merchantId
this
.
model
.
manufacturerId
=
this
.
default_value
.
manufacturerId
this
.
result
.
influenceScope
=
this
.
default_value
.
influenceScope
this
.
model
.
file_list
=
this
.
default_value
.
file_list
this
.
result
.
grayscaleUserList
=
this
.
default_value
.
grayscaleuser
/**
* file_list
* [{name: 'food.jpg', url: 'https://xxx.cdn.com/xxx.jpg'}]
*/
}
Promise
.
all
([
this
.
get_manufacturer_list
(),
this
.
get_merchant_list
()]).
then
(
result
=>
{
manufacturer_list_back_up
=
this
.
manufacturer_list
=
result
[
0
]
merchant_list_back_up
=
this
.
merchant_list
=
result
[
1
]
if
(
this
.
default_value
)
{
this
.
model
.
merchantId
=
this
.
default_value
.
merchantId
this
.
model
.
manufacturerId
=
this
.
default_value
.
manufacturerId
}
}
)
}
}
</
script
>
...
...
src/views/customer/voice/Edit.vue
View file @
f0334db
...
...
@@ -14,24 +14,23 @@
>
<gl-form-item
label=
"活动标题:"
prop=
"
t
itle"
prop=
"
activityT
itle"
>
<gl-input
name=
"
t
itle"
name=
"
activityT
itle"
v-validate=
"'required'"
data-vv-as=
"活动标题"
v-model=
"editForm.
t
itle"
v-model=
"editForm.
activityT
itle"
></gl-input>
<span
v-show=
"errorBags.has('
t
itle')"
v-show=
"errorBags.has('
activityT
itle')"
class=
"error"
>
{{
errorBags
.
first
(
'
t
itle'
)
}}
{{
errorBags
.
first
(
'
activityT
itle'
)
}}
</span>
</gl-form-item>
<gl-row>
<gl-col
:span=
"24"
>
<!--
<gl-form-item
label=
'品牌厂商:'
>
-->
<Manufacturers
width=
"100%"
:eventBus=
"eventBus"
...
...
@@ -41,91 +40,67 @@
:in_row=
'true'
:value
.
sync=
"editForm.manufacturer"
:uploadAction=
"uploadAction"
:default_value=
"default_value"
/>
<!--
</gl-form-item>
-->
</gl-col>
<!--
<gl-col
:span=
"12"
>
<gl-form-item
label=
'选择用户:'
>
<gl-select
v-model=
"editForm.user"
placeholder=
"请选择用户"
style=
"width:100%"
name=
"user"
data-vv-as=
"用户"
v-validate=
"'required'"
>
<gl-option
v-for=
"item in users"
:key=
"item.value"
:label=
"item.label"
:value=
"item.value"
/>
</gl-select>
<span
v-show=
"errorBags.has('user')"
class=
"error"
>
{{
errorBags
.
first
(
'user'
)
}}
</span>
</gl-form-item>
</gl-col>
-->
</gl-row>
<gl-form-item
label=
"活动提示语:"
prop=
"
merchantId
"
prop=
"
activityTip
"
>
<gl-input
name=
"
tips
"
name=
"
activityTip
"
v-validate=
"'required'"
data-vv-as=
"活动提示语"
v-model=
"editForm.
tips
"
v-model=
"editForm.
activityTip
"
></gl-input>
<span
v-show=
"errorBags.has('
tips
')"
v-show=
"errorBags.has('
activityTip
')"
class=
"error"
>
{{
errorBags
.
first
(
'
tips
'
)
}}
{{
errorBags
.
first
(
'
activityTip
'
)
}}
</span>
</gl-form-item>
<gl-form-item
label=
"声控命令词:"
prop=
"
cmdWords
"
prop=
"
voiceCommand
"
>
<gl-input
name=
"
cmdWords
"
name=
"
voiceCommand
"
v-validate=
"'required'"
data-vv-as=
"声控命令词"
v-model=
"editForm.
cmdWords
"
v-model=
"editForm.
voiceCommand
"
></gl-input>
<span
v-show=
"errorBags.has('
cmdWords
')"
v-show=
"errorBags.has('
voiceCommand
')"
class=
"error"
>
{{
errorBags
.
first
(
'
cmdWords
'
)
}}
{{
errorBags
.
first
(
'
voiceCommand
'
)
}}
</span>
</gl-form-item>
<gl-form-item
label=
"活动回复语:"
prop=
"
feedback
"
prop=
"
activityReply
"
>
<gl-input
name=
"
feedback
"
name=
"
activityReply
"
v-validate=
"'required'"
data-vv-as=
"活动回复语"
v-model=
"editForm.
feedback
"
v-model=
"editForm.
activityReply
"
></gl-input>
<span
v-show=
"errorBags.has('
feedback
')"
v-show=
"errorBags.has('
activityReply
')"
class=
"error"
>
{{
errorBags
.
first
(
'
feedback
'
)
}}
{{
errorBags
.
first
(
'
activityReply
'
)
}}
</span>
</gl-form-item>
<gl-row>
<gl-col
:span=
"12"
>
<gl-form-item
label=
'触发方式:'
>
<gl-checkbox
v-model=
"triModel.pop"
>
IP冒泡提示
</gl-checkbox>
<gl-checkbox
v-model=
"triModel.dialog"
>
对话中提示
</gl-checkbox>
<gl-checkbox
v-model=
"tipType.BUBBLING"
>
冒泡
</gl-checkbox>
<gl-checkbox
v-model=
"tipType.DIALOGUE"
>
对话
</gl-checkbox>
<gl-checkbox
v-model=
"tipType.BOTH"
>
冒泡和对话
</gl-checkbox>
</gl-form-item>
</gl-col>
<gl-col
:span=
"12"
>
...
...
@@ -142,7 +117,7 @@
<gl-col
:span=
"12"
>
<gl-form-item
label=
'活动内容:'
>
<gl-select
v-model=
"editForm.
content
"
v-model=
"editForm.
activityForm
"
placeholder=
"请选择活动"
style=
"width:100%"
>
...
...
@@ -158,7 +133,7 @@
<gl-col
:span=
"12"
>
<gl-form-item
label=
'活动有效期:'
>
<gl-date-picker
v-model=
"time"
v-model=
"
editForm.
time"
type=
"datetimerange"
:picker-options=
"pickerOptions"
start-placeholder=
"开始日期"
...
...
@@ -174,7 +149,7 @@
prop=
"moduleList"
>
<div
class=
"content-wrap"
>
<gl-row
v-if=
"editForm.
content===0||editForm.content===2
"
>
<gl-row
v-if=
"editForm.
activityForm==='GIFT'||editForm.activityForm==='GIFT_DYNAMIC'
"
>
<gl-col
:span=
"24"
>
<gl-button
type=
"primary"
...
...
@@ -189,7 +164,7 @@
></gl-table>
</gl-col>
</gl-row>
<gl-row
v-if=
"editForm.
content===1||editForm.content===2
"
>
<gl-row
v-if=
"editForm.
activityForm==='DYNAMIC_EFFECT'||editForm.activityForm==='GIFT_DYNAMIC'
"
>
<gl-col
:span=
"12"
>
<gl-upload
class=
"upload-demo"
...
...
@@ -251,6 +226,33 @@
import
{
Manufacturers
}
from
'../components'
import
Vue
from
'vue'
import
Gift
from
'./gift'
const
form_init
=
{
activityTitle
:
''
,
// 活动标题
manufacturer
:
''
,
// 品牌厂商
grayscaleUserList
:
''
,
// 用户
activityTip
:
''
,
// 活动提示语
voiceCommand
:
''
,
// 声控命令词
activityReply
:
''
,
// 活动回复语
tipType
:
''
,
// 触发方式
count
:
1
,
// 触发次数
activityForm
:
'GIFT'
,
// 活动内容
coupons
:
[],
// 优惠券
pic
:
''
,
// 动效图标
voice
:
''
,
// 动效音频
time
:
''
,
// 活动结束时间
activityConfig
:
{
audioFilePath
:
''
,
dynamicEffectIcon
:
''
,
giftId
:
0
,
giftName
:
''
,
giftType
:
''
},
beginTime
:
''
,
endTime
:
''
,
triCount
:
1
,
time
:
''
}
export
default
{
name
:
'Edit'
,
components
:
{
...
...
@@ -264,9 +266,6 @@ export default {
eventBus
:
Object
},
watch
:
{
updateVisible
(
val
)
{
this
.
$validator
.
errors
.
clear
()
},
eventBus
(
val
)
{
if
(
val
)
{
this
.
eventBus
.
$on
(
'giftDialogClose'
,
()
=>
(
this
.
giftVisible
=
false
))
...
...
@@ -280,6 +279,15 @@ export default {
})
this
.
eventBus
.
$on
(
'edit_event_data'
,
data
=>
{
this
.
title
=
data
?
'编辑活动'
:
'新增活动'
if
(
!
data
)
{
this
.
editForm
=
this
.
$deep_clone
(
form_init
)
this
.
$validator
.
errors
.
clear
()
return
}
const
__clone
=
this
.
$deep_clone
(
data
)
this
.
editForm
=
__clone
this
.
editForm
.
time
=
[
__clone
.
beginTime
,
__clone
.
endTime
]
this
.
$validator
.
errors
.
clear
()
})
// this.eventBus.$on(
// 'manufacturers',
...
...
@@ -291,47 +299,34 @@ export default {
data
()
{
return
{
title
:
''
,
props
:
{
children
:
'children'
,
label
:
'label'
manufacturerShow
:
false
,
default_value
:
{
// // merchantId: 19180001,
// manufacturerId: 10012,
// file_list: [{ name: 'food.jpg', url: 'https://xxx.cdn.com/xxx.jpg' }],
// influenceScope: 'LIST',
// grayscaleuser: ['11']
},
triModel
:
{
pop
:
false
,
dialog
:
true
tipType
:
{
BUBBLING
:
true
,
DIALOGUE
:
false
,
BOTH
:
false
},
pickerOptions
:
{},
// 日期设置对象
// 提交参数
editForm
:
{
title
:
''
,
// 活动标题
manufacturer
:
''
,
// 品牌厂商
user
:
''
,
// 用户
tips
:
''
,
// 活动提示语
cmdWords
:
''
,
// 声控命令词
feedback
:
''
,
// 活动回复语
trigger
:
''
,
// 触发方式
count
:
''
,
// 触发次数
content
:
0
,
// 活动内容
coupons
:
[],
// 优惠券
pic
:
''
,
// 动效图标
voice
:
''
,
// 动效音频
time
:
''
// 活动结束时间
editForm
:
{},
updateRules
:
{
channelName
:
[{
required
:
true
}],
merchantId
:
[{
required
:
true
}],
channelUrl
:
[{
required
:
true
}],
moduleList
:
[{
required
:
true
}]
},
aaa
:
{},
triCount
:
1
,
time
:
''
,
uploadAction
:
''
,
giftVisible
:
false
,
contents
:
[
{
label
:
'关联礼品'
,
value
:
0
},
{
label
:
'关联瀑布特效'
,
value
:
1
},
{
label
:
'关联礼品+瀑布特效'
,
value
:
2
}
],
users
:
[
{
label
:
'已关联嘀嘀虎帐号用户'
,
value
:
0
},
{
label
:
'未关联嘀嘀虎帐号用户'
,
value
:
1
},
{
label
:
'广东用户'
,
value
:
2
},
{
label
:
'深圳用户'
,
value
:
3
},
{
label
:
'广西用户'
,
value
:
4
}
{
label
:
'关联礼品'
,
value
:
'GIFT'
},
{
label
:
'关联瀑布特效'
,
value
:
'DYNAMIC_EFFECT'
},
{
label
:
'关联礼品+瀑布特效'
,
value
:
'GIFT_DYNAMIC'
}
],
coupons
:
{
height
:
122
,
...
...
@@ -367,12 +362,6 @@ export default {
],
selection
:
{},
multipleSelection
:
[]
},
updateRules
:
{
channelName
:
[{
required
:
true
}],
merchantId
:
[{
required
:
true
}],
channelUrl
:
[{
required
:
true
}],
moduleList
:
[{
required
:
true
}]
}
}
},
...
...
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