Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in
Toggle navigation
A
admin-base
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
new-sing
admin-base
Commits
a5defc82
Commit
a5defc82
authored
Sep 25, 2018
by
王
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
关键词回复添加图文音视频
parent
e9d495ab
Changes
2
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
408 additions
and
13 deletions
+408
-13
autoReply.vue
src/components/weChat/autoReply.vue
+121
-2
autoReplyDialog.vue
src/components/weChat/autoReplyDialog.vue
+287
-11
No files found.
src/components/weChat/autoReply.vue
View file @
a5defc82
...
...
@@ -13,12 +13,40 @@
<el-form
label-position=
"top"
class=
"demo-table-expand"
>
<el-form-item
label=
"回复内容"
>
<div
v-for=
"(item, index) in JSON.parse(props.row.desc)"
>
回复
{{
index
+
1
}}
(
{{
item
.
type
|
type
}}
):
<span
v-if=
"item.content && item.type==='text'"
>
回复
{{
index
+
1
}}
:
<span
v-html=
"item.content.replace(/\/[\u4E00-\u9FA5]
{1,3}/gi, emotion)">
</span>
</span>
<span
v-if=
"item.content && item.type==='image'"
>
回复
{{
index
+
1
}}
:
<img
class=
"img"
:src=
"item.content"
/></span>
<span
v-if=
"item.variable"
>
回复
{{
index
+
1
}}
:老师二维码
</span>
<span
v-if=
"item.type==='image' && item.variable"
>
回复
{{
index
+
1
}}
:老师二维码
</span>
<a
v-if=
"item.type === 'video'"
:href=
"item.content.down_url"
target=
"_blank"
>
{{
item
.
content
.
title
}}
</a>
<div
v-if=
"item.type==='news' && item.content && item.content.news_item"
class=
"news-media"
style=
"display: inline-block;width: 150px;"
>
<el-card
:body-style=
"
{ padding: '0px' }">
<div
v-for=
"(child, childIndex) in item.content.news_item"
style=
"position: relative"
>
<div
v-if=
"item.content.news_item.length === 1"
class=
"single-cover"
>
<div
class=
"title"
>
{{
child
.
title
}}
</div>
<img
:src=
"child.thumb_url"
style=
"width: 100%;margin-top: 20px;"
/>
<div
class=
"digest"
>
{{
child
.
digest
}}
</div>
<a
class=
"preview"
:href=
"child.url"
target=
"_blank"
>
预览文章
</a>
</div>
<div
v-else-if=
"item.content.news_item.length > 1"
class=
"clear-both bottomCover"
style=
"position: relative"
>
<div
v-if=
"childIndex === 0"
class=
"muti-cover"
>
<img
style=
"width: 100%;margin-top: 20px;"
:src=
"child.thumb_url"
/>
<div
class=
"bottom-title"
>
{{
child
.
title
}}
</div>
</div>
<div
class=
"next-cover clear-both"
v-else
>
<span
class=
"next-title"
>
{{
child
.
title
}}
</span>
<img
class=
"next-img"
:src=
"child.thumb_url"
/>
</div>
<a
class=
"preview"
:href=
"child.url"
target=
"_blank"
>
预览文章
</a>
</div>
</div>
</el-card>
</div>
</div>
</el-form-item>
</el-form>
...
...
@@ -82,6 +110,23 @@
mounted
(){
this
.
getList
()
},
filters
:
{
type
(
value
){
if
(
value
===
'text'
)
{
return
'文本'
}
else
if
(
value
===
'voice'
)
{
return
'语音'
}
else
if
(
value
===
'video'
)
{
return
'视频'
}
else
if
(
value
===
'image'
)
{
return
'图片'
}
else
if
(
value
===
'news'
)
{
return
'图文'
}
else
{
return
val
}
}
},
methods
:
{
// 将匹配结果替换表情图片
emotion
(
res
)
{
...
...
@@ -139,4 +184,78 @@
.img {
width: 10%;
}
.news-media {
padding: 10px;
width: 25%;
}
.news-media img{
width: 100%;
}
.s-news img {
width: 50px;
float: right;
}
.title {
font-size: 16px;
font-weight: 400;
display: block;
line-height: 1.2;
color: #353535;
}
.digest {
padding-top: 12px;
color: #9A9A9A;
font-size: 14px;
}
.single-cover {
/*padding: 20px 15px 15px;*/
}
.muti-cover {
position: relative;
padding: 20px 15px 0 15px;
}
.bottom-title {
color: #FFFFFF;
background-color: rgba(0, 0, 0, 0.55);
position: absolute;
left: 15px;
right: 15px;
bottom: 0;
padding: 8px 12px;
}
.next-cover {
padding: 12px 15px;
position: relative;
}
.next-img {
float: right;
margin-left: 12px;
width: 60px !important;
height: 60px !important;
}
.next-title {
overflow: hidden;
font-weight: 400;
word-wrap: break-word;
-webkit-hyphens: auto;
-ms-hyphens: auto;
hyphens: auto;
color: #353535;
}
.single-cover:hover .preview,.bottomCover:hover .preview{
display: flex;
justify-content: center;
align-items: center;
color: #fff;
}
.preview {
display: none;
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
background-color: rgba(0,0,0,0.5);
text-decoration: none;
}
</
style
>
src/components/weChat/autoReplyDialog.vue
View file @
a5defc82
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
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 comment