Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
saas
/
scrm-micro-pay
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 6444893d
authored
Dec 22, 2021
by
胡悦
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
修改群发
1 parent
7d72605e
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
256 additions
and
19 deletions
src/api/modules/customerTransform.js
src/views/customerTransform/addCustomer.vue
src/views/customerTransform/components/preview.vue
src/views/customerTransform/components/tag-textarea.vue
src/views/customerTransform/components/welcomeWords.vue
src/api/modules/customerTransform.js
View file @
6444893
...
@@ -29,7 +29,8 @@ const insert = params => {
...
@@ -29,7 +29,8 @@ const insert = params => {
url
:
URL
,
url
:
URL
,
method
:
'POST'
,
method
:
'POST'
,
data
:
params
,
data
:
params
,
sign
:
true
sign
:
true
,
returnAll
:
true
})
})
}
}
...
...
src/views/customerTransform/addCustomer.vue
View file @
6444893
...
@@ -356,13 +356,6 @@ export default {
...
@@ -356,13 +356,6 @@ export default {
if
(
valid
)
{
if
(
valid
)
{
this
.
$refs
.
groupForm
.
validate
(
v
=>
{
this
.
$refs
.
groupForm
.
validate
(
v
=>
{
if
(
v
)
{
if
(
v
)
{
if
(
this
.
groupNumber
==
0
)
{
this
.
$message
({
type
:
'error'
,
message
:
'选择客户数量为0,不可创建'
})
return
}
const
params
=
this
.
getSiftMembers
()
const
params
=
this
.
getSiftMembers
()
params
.
type
=
1
params
.
type
=
1
// params.attachmentList = this.basicForm.attachmentList
// params.attachmentList = this.basicForm.attachmentList
...
@@ -370,6 +363,120 @@ export default {
...
@@ -370,6 +363,120 @@ export default {
const
previewList
=
this
.
$common
?
this
.
$common
.
utils
.
deepClone
(
this
.
$refs
.
welcome
.
previewList
)
:
this
.
$refs
.
welcome
.
previewList
const
previewList
=
this
.
$common
?
this
.
$common
.
utils
.
deepClone
(
this
.
$refs
.
welcome
.
previewList
)
:
this
.
$refs
.
welcome
.
previewList
const
attachmentList
=
previewList
.
map
(
item
=>
{
const
attachmentList
=
previewList
.
map
(
item
=>
{
if
(
item
.
attType
==
1
)
{
if
(
item
.
attType
==
1
)
{
const
list
=
[
'微笑'
,
'撇嘴'
,
'色'
,
'发呆'
,
'得意'
,
'流泪'
,
'害羞'
,
'闭嘴'
,
'睡'
,
'大哭'
,
'尴尬'
,
'发怒'
,
'调皮'
,
'呲牙'
,
'惊讶'
,
'难过'
,
'酷'
,
'冷汗'
,
'抓狂'
,
'吐'
,
'偷笑'
,
'可爱'
,
'白眼'
,
'傲慢'
,
'饥饿'
,
'困'
,
'惊恐'
,
'流汗'
,
'憨笑'
,
'大兵'
,
'奋斗'
,
'咒骂'
,
'疑问'
,
'嘘'
,
'晕'
,
'折磨'
,
'衰'
,
'骷髅'
,
'敲打'
,
'再见'
,
'擦汗'
,
'抠鼻'
,
'鼓掌'
,
'糗大了'
,
'坏笑'
,
'左哼哼'
,
'右哼哼'
,
'哈欠'
,
'鄙视'
,
'委屈'
,
'快哭了'
,
'阴险'
,
'亲亲'
,
'吓'
,
'可怜'
,
'菜刀'
,
'西瓜'
,
'啤酒'
,
'篮球'
,
'乒乓'
,
'咖啡'
,
'饭'
,
'猪头'
,
'玫瑰'
,
'凋谢'
,
'示爱'
,
'爱心'
,
'心碎'
,
'蛋糕'
,
'闪电'
,
'炸弹'
,
'刀'
,
'足球'
,
'瓢虫'
,
'便便'
,
'月亮'
,
'太阳'
,
'礼物'
,
'拥抱'
,
'强'
,
'弱'
,
'握手'
,
'胜利'
,
'抱拳'
,
'勾引'
,
'拳头'
,
'差劲'
,
'爱你'
,
'NO'
,
'OK'
,
'爱情'
,
'飞吻'
,
'跳跳'
,
'发抖'
,
'怄火'
,
'转圈'
,
'磕头'
,
'回头'
,
'跳绳'
,
'挥手'
,
'激动'
,
'街舞'
,
'献吻'
,
'左太极'
,
'右太极'
]
const
cutImg
=
item
.
attContent
.
replaceAll
(
'<img src="https://res.wx.qq.com/mpres/htmledition/images/icon/emotion/'
,
''
)
console
.
log
(
cutImg
)
const
replaceImg
=
cutImg
.
replace
(
/
(\d){1,2}
.gif">/g
,
function
(
str
)
{
let
s
=
list
[
str
.
split
(
'.'
)[
0
]]
return
`[
${
s
}
]`
})
item
.
attContent
=
replaceImg
item
.
attContent
=
item
.
attContent
.
replace
(
'@昵称'
,
'[@昵称]'
)
item
.
attContent
=
item
.
attContent
.
replace
(
'@昵称'
,
'[@昵称]'
)
}
else
if
(
item
.
attType
==
7
)
{
}
else
if
(
item
.
attType
==
7
)
{
item
.
attContent
=
JSON
.
stringify
(
item
.
attContent
)
item
.
attContent
=
JSON
.
stringify
(
item
.
attContent
)
...
@@ -392,29 +499,34 @@ export default {
...
@@ -392,29 +499,34 @@ export default {
if
(
params
.
sendType
==
2
)
{
if
(
params
.
sendType
==
2
)
{
params
.
sendTimeStr
=
this
.
basicForm
.
sendTime
+
' '
+
this
.
basicForm
.
sendDate
params
.
sendTimeStr
=
this
.
basicForm
.
sendTime
+
' '
+
this
.
basicForm
.
sendDate
}
}
console
.
log
(
params
)
this
.
addLoading
=
true
this
.
addLoading
=
true
this
.
$apis
.
customerTransform
this
.
$apis
.
customerTransform
.
insert
(
params
)
.
insert
(
params
)
.
then
(
res
=>
{
.
then
(
res
=>
{
if
(
res
)
{
console
.
log
(
res
)
if
(
res
.
code
==
'-1'
)
{
this
.
$message
({
type
:
'error'
,
message
:
res
.
message
})
this
.
handleCancel
()
}
else
if
(
res
.
code
==
0
)
{
this
.
$message
({
this
.
$message
({
type
:
'success'
,
type
:
'success'
,
message
:
'操作成功!'
message
:
'操作成功!'
})
})
this
.
handleCancel
()
this
.
handleCancel
()
}
else
{
this
.
$message
({
type
:
'error'
,
message
:
res
.
message
})
}
}
this
.
addLoading
=
false
this
.
addLoading
=
false
})
})
.
catch
(
err
=>
{
.
catch
(
err
=>
{
console
.
log
(
err
)
console
.
log
(
err
)
this
.
$message
({
type
:
'error'
,
message
:
err
.
message
})
this
.
addLoading
=
false
if
(
err
.
code
==
'-1'
)
{
this
.
handleCancel
()
}
})
})
}
}
})
})
...
...
src/views/customerTransform/components/preview.vue
View file @
6444893
...
@@ -5,7 +5,7 @@
...
@@ -5,7 +5,7 @@
<div
class=
"preview-info"
v-for=
"item in previewList"
:key=
"item.id"
>
<div
class=
"preview-info"
v-for=
"item in previewList"
:key=
"item.id"
>
<img
class=
"avatar"
src=
"@/assets/guestCustom/default-customer.png"
alt
/>
<img
class=
"avatar"
src=
"@/assets/guestCustom/default-customer.png"
alt
/>
<template
v-if=
"item.attType == 1"
>
<template
v-if=
"item.attType == 1"
>
<div
class=
"preview-text text"
>
{{
item
.
attContent
}}
</div>
<div
class=
"preview-text text"
v-html=
"item.attContent"
>
</div>
</
template
>
</
template
>
<
template
v-else-if=
"item.attType == 7"
>
<
template
v-else-if=
"item.attType == 7"
>
<div
class=
"preview-activity"
>
<div
class=
"preview-activity"
>
...
@@ -45,13 +45,135 @@
...
@@ -45,13 +45,135 @@
<
script
>
<
script
>
export
default
{
export
default
{
name
:
'Preview'
,
name
:
'Preview'
,
props
:
{
eventBus
:
Object
,
list
:
Array
},
props
:
{
eventBus
:
Object
},
data
()
{
data
()
{
return
{
return
{
previewList
:
[],
previewList
:
[],
currentTime
:
''
currentTime
:
''
}
}
},
},
watch
:
{
previewList
(
val
)
{
console
.
log
(
val
)
if
(
val
[
0
].
attType
==
1
)
{
const
attContent
=
val
[
0
].
attContent
const
htm
=
attContent
.
replace
(
/
\[[\u
4E00-
\u
9FA5
]{1,3}
]/gi
,
function
(
res
)
{
let
word
=
res
.
replace
(
/
\[
|
\]
/gi
,
''
)
const
list
=
[
'微笑'
,
'撇嘴'
,
'色'
,
'发呆'
,
'得意'
,
'流泪'
,
'害羞'
,
'闭嘴'
,
'睡'
,
'大哭'
,
'尴尬'
,
'发怒'
,
'调皮'
,
'呲牙'
,
'惊讶'
,
'难过'
,
'酷'
,
'冷汗'
,
'抓狂'
,
'吐'
,
'偷笑'
,
'可爱'
,
'白眼'
,
'傲慢'
,
'饥饿'
,
'困'
,
'惊恐'
,
'流汗'
,
'憨笑'
,
'大兵'
,
'奋斗'
,
'咒骂'
,
'疑问'
,
'嘘'
,
'晕'
,
'折磨'
,
'衰'
,
'骷髅'
,
'敲打'
,
'再见'
,
'擦汗'
,
'抠鼻'
,
'鼓掌'
,
'糗大了'
,
'坏笑'
,
'左哼哼'
,
'右哼哼'
,
'哈欠'
,
'鄙视'
,
'委屈'
,
'快哭了'
,
'阴险'
,
'亲亲'
,
'吓'
,
'可怜'
,
'菜刀'
,
'西瓜'
,
'啤酒'
,
'篮球'
,
'乒乓'
,
'咖啡'
,
'饭'
,
'猪头'
,
'玫瑰'
,
'凋谢'
,
'示爱'
,
'爱心'
,
'心碎'
,
'蛋糕'
,
'闪电'
,
'炸弹'
,
'刀'
,
'足球'
,
'瓢虫'
,
'便便'
,
'月亮'
,
'太阳'
,
'礼物'
,
'拥抱'
,
'强'
,
'弱'
,
'握手'
,
'胜利'
,
'抱拳'
,
'勾引'
,
'拳头'
,
'差劲'
,
'爱你'
,
'NO'
,
'OK'
,
'爱情'
,
'飞吻'
,
'跳跳'
,
'发抖'
,
'怄火'
,
'转圈'
,
'磕头'
,
'回头'
,
'跳绳'
,
'挥手'
,
'激动'
,
'街舞'
,
'献吻'
,
'左太极'
,
'右太极'
]
let
index
=
list
.
indexOf
(
word
)
return
`<img src="https://res.wx.qq.com/mpres/htmledition/images/icon/emotion/
${
index
}
.gif">`
})
console
.
log
(
htm
)
val
[
0
].
attContent
=
htm
}
}
},
created
()
{
created
()
{
this
.
eventBus
.
$on
(
'update'
,
val
=>
{
this
.
eventBus
.
$on
(
'update'
,
val
=>
{
this
.
previewList
=
val
this
.
previewList
=
val
...
...
src/views/customerTransform/components/tag-textarea.vue
View file @
6444893
...
@@ -458,6 +458,7 @@ export default {
...
@@ -458,6 +458,7 @@ export default {
let
Textnode
=
document
.
createElement
(
'div'
)
let
Textnode
=
document
.
createElement
(
'div'
)
Textnode
.
innerHTML
=
replaceImg
Textnode
.
innerHTML
=
replaceImg
this
.
currentText
=
Textnode
.
innerText
this
.
currentText
=
Textnode
.
innerText
console
.
log
(
this
.
currentText
,
11111111
)
this
.
$emit
(
'updateText'
,
this
.
currentText
)
this
.
$emit
(
'updateText'
,
this
.
currentText
)
},
},
handleDelete
(
e
)
{
handleDelete
(
e
)
{
...
...
src/views/customerTransform/components/welcomeWords.vue
View file @
6444893
...
@@ -292,6 +292,7 @@ export default {
...
@@ -292,6 +292,7 @@ export default {
this
.
$refs
.
textContent
.
addImg
(
`https://res.wx.qq.com/mpres/htmledition/images/icon/emotion/
${
index
}
.gif`
)
this
.
$refs
.
textContent
.
addImg
(
`https://res.wx.qq.com/mpres/htmledition/images/icon/emotion/
${
index
}
.gif`
)
},
},
updateText
(
val
)
{
updateText
(
val
)
{
console
.
log
(
val
)
this
.
textInput
(
val
)
this
.
textInput
(
val
)
},
},
// 上传图片
// 上传图片
...
...
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