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
1f50b2f8
Commit
1f50b2f8
authored
Oct 23, 2018
by
王
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
小程序图片回复
parent
a565d029
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
140 additions
and
19 deletions
+140
-19
index.js
config/index.js
+2
-2
dialog.vue
src/components/single/dialog.vue
+0
-2
autoReplyDialog.vue
src/components/weChat/autoReplyDialog.vue
+70
-7
focusReplyDialog.vue
src/components/weChat/focusReplyDialog.vue
+68
-8
No files found.
config/index.js
View file @
1f50b2f8
...
@@ -12,8 +12,8 @@ module.exports = {
...
@@ -12,8 +12,8 @@ module.exports = {
//本地代理设置
//本地代理设置
proxyTable
:
{
proxyTable
:
{
'/api'
:
{
'/api'
:
{
target
:
'http://local.base-api.sing.com'
,
// 接口的域名
//
target: 'http://local.base-api.sing.com', // 接口的域名
//
target: 'https://wechat-test.changchangenglish.com/',
target
:
'https://wechat-test.changchangenglish.com/'
,
changeOrigin
:
true
,
// 如果接口跨域,需要进行这个参数配置
changeOrigin
:
true
,
// 如果接口跨域,需要进行这个参数配置
}
}
},
},
...
...
src/components/single/dialog.vue
View file @
1f50b2f8
...
@@ -131,7 +131,6 @@
...
@@ -131,7 +131,6 @@
this
.
$refs
[
'form'
].
validate
((
valid
)
=>
{
this
.
$refs
[
'form'
].
validate
((
valid
)
=>
{
if
(
valid
){
if
(
valid
){
if
(
this
.
imageList
.
length
>
0
){
if
(
this
.
imageList
.
length
>
0
){
console
.
log
(
'this.imageList'
,
this
.
imageList
)
this
.
form
.
cover
=
this
.
imageList
[
0
].
name
;
this
.
form
.
cover
=
this
.
imageList
[
0
].
name
;
}
}
let
json
=
this
.
form
;
let
json
=
this
.
form
;
...
@@ -150,7 +149,6 @@
...
@@ -150,7 +149,6 @@
case
1
:
case
1
:
this
.
$refs
[
'form'
].
validate
((
valid
)
=>
{
this
.
$refs
[
'form'
].
validate
((
valid
)
=>
{
if
(
valid
){
if
(
valid
){
console
.
log
(
'this.imageList'
,
this
.
imageList
)
if
(
this
.
imageList
.
length
>
0
){
if
(
this
.
imageList
.
length
>
0
){
this
.
form
.
cover
=
this
.
imageList
[
0
].
name
;
this
.
form
.
cover
=
this
.
imageList
[
0
].
name
;
}
}
...
...
src/components/weChat/autoReplyDialog.vue
View file @
1f50b2f8
...
@@ -72,7 +72,7 @@
...
@@ -72,7 +72,7 @@
<el-tabs
v-if=
"showType"
v-model=
"type"
type=
"card"
>
<el-tabs
v-if=
"showType"
v-model=
"type"
type=
"card"
>
<el-tab-pane
v-if=
"form.key !== 'mini_keywords_reply'"
label=
"图文消息"
name=
"news"
></el-tab-pane>
<el-tab-pane
v-if=
"form.key !== 'mini_keywords_reply'"
label=
"图文消息"
name=
"news"
></el-tab-pane>
<el-tab-pane
label=
"文字"
name=
"text"
></el-tab-pane>
<el-tab-pane
label=
"文字"
name=
"text"
></el-tab-pane>
<el-tab-pane
v-if=
"form.key !== 'mini_keywords_reply'"
label=
"图片"
name=
"image"
></el-tab-pane>
<el-tab-pane
label=
"图片"
name=
"image"
></el-tab-pane>
<el-tab-pane
v-if=
"form.key !== 'mini_keywords_reply'"
label=
"语音"
name=
"voice"
></el-tab-pane>
<el-tab-pane
v-if=
"form.key !== 'mini_keywords_reply'"
label=
"语音"
name=
"voice"
></el-tab-pane>
<el-tab-pane
v-if=
"form.key !== 'mini_keywords_reply'"
label=
"视频"
name=
"video"
></el-tab-pane>
<el-tab-pane
v-if=
"form.key !== 'mini_keywords_reply'"
label=
"视频"
name=
"video"
></el-tab-pane>
</el-tabs>
</el-tabs>
...
@@ -103,18 +103,31 @@
...
@@ -103,18 +103,31 @@
</div>
</div>
</
template
>
</
template
>
<
template
v-if=
"type==='image'"
>
<
template
v-if=
"type==='image'"
>
<div
v-if=
"imageContent.url"
class=
"img"
>
<div
v-if=
"imageContent.url
&& form.key !== 'mini_keywords_reply'
"
class=
"img"
>
<img
:src=
"imageContent.url"
/>
<img
:src=
"imageContent.url"
/>
<i
class=
"el-icon-delete"
@
click=
"imageContent=
{url:'',media_id:''}">
</i>
<i
class=
"el-icon-delete"
@
click=
"imageContent=
{url:'',media_id:''}">
</i>
</div>
</div>
<div
v-if=
"imageContent.variable"
class=
"img my-teacher"
>
<div
v-if=
"imageContent.variable
&& form.key !== 'mini_keywords_reply'
"
class=
"img my-teacher"
>
<div>
老师二维码
</div>
<div>
老师二维码
</div>
<i
class=
"el-icon-delete"
@
click=
"imageContent=
{url:'',media_id:'',variable:''}">
</i>
<i
class=
"el-icon-delete"
@
click=
"imageContent=
{url:'',media_id:'',variable:''}">
</i>
</div>
</div>
<div
class=
"display-b"
>
<div
class=
"display-b"
v-if=
"form.key !== 'mini_keywords_reply'"
>
<div
class=
"choose_item"
style=
"color: #888;"
@
click=
"getMediaList('image')"
>
+从素材库中选择
</div>
<div
class=
"choose_item"
style=
"color: #888;"
@
click=
"getMediaList('image')"
>
+从素材库中选择
</div>
<div
class=
"choose_item"
style=
"color: #888;"
@
click=
"addTeacherQrcode"
>
+添加老师二维码
</div>
<div
class=
"choose_item"
style=
"color: #888;"
@
click=
"addTeacherQrcode"
>
+添加老师二维码
</div>
</div>
</div>
<el-upload
v-if=
"form.key === 'mini_keywords_reply'"
action=
"/api/public/upload/zone"
:http-request=
"uploadFile"
:class=
"
{disabled:!uploadShow}"
:before-upload="beforeAvatarUpload"
list-type="picture-card"
:file-list="imageList"
:on-success="handleAvatarSuccess"
:on-remove="handleRemove"
:limit="1">
<i
class=
"el-icon-plus"
></i>
</el-upload>
<div
v-if=
"showMedia && mediaList.length > 0"
>
<div
v-if=
"showMedia && mediaList.length > 0"
>
<el-table
<el-table
:data=
"mediaList"
:data=
"mediaList"
...
@@ -306,7 +319,7 @@
...
@@ -306,7 +319,7 @@
</template>
</template>
<
script
>
<
script
>
import
{
updateConfigApi
,
saveConfigApi
,
getMediaListApi
,
getTeacherListApi
}
from
"../../service/api"
;
import
{
updateConfigApi
,
saveConfigApi
,
getMediaListApi
,
getTeacherListApi
,
uploadFileApi
}
from
"../../service/api"
;
import
page
from
'../framework/page'
import
page
from
'../framework/page'
import
emotion
from
'../framework/Emotion/index'
import
emotion
from
'../framework/Emotion/index'
export
default
{
export
default
{
...
@@ -362,7 +375,9 @@
...
@@ -362,7 +375,9 @@
qr
:[
qr
:[
{
required
:
true
,
message
:
'请输入二维码'
,
trigger
:
'change'
}
{
required
:
true
,
message
:
'请输入二维码'
,
trigger
:
'change'
}
]
]
}
},
imageList
:
[],
uploadShow
:
true
}
}
},
},
components
:{
components
:{
...
@@ -438,7 +453,6 @@
...
@@ -438,7 +453,6 @@
if
(
this
.
dialogObj
.
id
)
{
if
(
this
.
dialogObj
.
id
)
{
this
.
id
=
this
.
dialogObj
.
id
;
this
.
id
=
this
.
dialogObj
.
id
;
}
}
console
.
log
(
'this.dialogObj'
,
this
.
dialogObj
)
this
.
form
.
value
=
this
.
dialogObj
.
value
;
this
.
form
.
value
=
this
.
dialogObj
.
value
;
this
.
form
.
desc
=
this
.
dialogObj
.
desc
;
this
.
form
.
desc
=
this
.
dialogObj
.
desc
;
if
(
this
.
dialogObj
.
key
)
{
if
(
this
.
dialogObj
.
key
)
{
...
@@ -465,9 +479,11 @@
...
@@ -465,9 +479,11 @@
media_id
:
''
,
media_id
:
''
,
variable
:
''
variable
:
''
};
};
this
.
imageList
=
[];
this
.
teacher_id
=
''
;
this
.
teacher_id
=
''
;
this
.
start_at
=
''
;
this
.
start_at
=
''
;
this
.
showType
=
true
;
this
.
showType
=
true
;
this
.
uploadShow
=
true
;
},
},
onEditText
(
item
,
index
)
{
onEditText
(
item
,
index
)
{
this
.
title
=
'编辑回复'
;
this
.
title
=
'编辑回复'
;
...
@@ -487,6 +503,10 @@
...
@@ -487,6 +503,10 @@
variable
:
item
.
variable
variable
:
item
.
variable
};
};
}
}
if
(
this
.
type
===
'image'
&&
this
.
form
.
key
===
'mini_keywords_reply'
)
{
this
.
imageList
=
[{
name
:
'mini'
,
url
:
item
.
content
}]
this
.
uploadShow
=
false
;
}
}
}
this
.
showType
=
true
;
this
.
showType
=
true
;
},
},
...
@@ -626,6 +646,44 @@
...
@@ -626,6 +646,44 @@
addTeacherAlias
(){
addTeacherAlias
(){
this
.
content
+=
'{my_teacher_alias}'
this
.
content
+=
'{my_teacher_alias}'
},
},
handleAvatarSuccess
(
res
)
{
this
.
imageList
=
[{
name
:
res
.
data
.
url
,
url
:
process
.
env
.
IMAGE_URL_HEAD
+
res
.
data
.
url
}]
},
beforeAvatarUpload
(){
this
.
uploadShow
=
false
},
uploadFile
(
a
)
{
this
.
loading
=
true
;
this
.
$store
.
dispatch
(
'setProgress'
,{
type
:
'new'
,
id
:
a
.
file
.
uid
});
uploadFileApi
({
file
:
a
.
file
,
type
:
'mini'
}).
then
(
res
=>
{
this
.
uploadFileToQiniu
(
a
,
res
);
this
.
loading
=
false
;
}).
catch
(()
=>
{
this
.
loading
=
false
;
})
},
uploadFileToQiniu
(
a
,
data
)
{
this
.
loading
=
true
;
this
.
$store
.
dispatch
(
'setProgress'
,{
type
:
'new'
,
id
:
a
.
file
.
uid
});
uploadFileApi
({
file
:
a
.
file
,
type
:
'local'
}).
then
(
res
=>
{
this
.
imageList
=
[{
name
:
res
.
url
,
url
:
process
.
env
.
IMAGE_URL_HEAD
+
res
.
url
}]
this
.
loading
=
false
;
this
.
$message
({
type
:
'success'
,
message
:
'上传成功!'
});
this
.
imageContent
=
{
url
:
process
.
env
.
IMAGE_URL_HEAD
+
res
.
url
,
media_id
:
data
.
media_id
,
name
:
res
.
url
}
}).
catch
(()
=>
{
this
.
loading
=
false
;
})
},
handleRemove
(){
this
.
uploadShow
=
true
}
},
},
watch
:{
watch
:{
dialogObj
:{
dialogObj
:{
...
@@ -850,3 +908,8 @@
...
@@ -850,3 +908,8 @@
text-decoration: none;
text-decoration: none;
}
}
</
style
>
</
style
>
<
style
>
.disabled
.el-upload--picture-card
{
display
:
none
!important
;
}
</
style
>
src/components/weChat/focusReplyDialog.vue
View file @
1f50b2f8
...
@@ -10,23 +10,36 @@
...
@@ -10,23 +10,36 @@
<ul
class=
"weui-desktop-msg-sender__tabs"
>
<ul
class=
"weui-desktop-msg-sender__tabs"
>
<li
v-if=
"dialogObj && dialogObj.key !== 'mini_auto_reply'"
class=
"weui-desktop-msg-sender__tab weui-desktop-msg-sender__tab_appmsg"
:class=
"type === 'news' ? 'weui-desktop-msg-sender__tab_selected' : ''"
@
click=
"onChangeType('news')"
>
图文
</li>
<li
v-if=
"dialogObj && dialogObj.key !== 'mini_auto_reply'"
class=
"weui-desktop-msg-sender__tab weui-desktop-msg-sender__tab_appmsg"
:class=
"type === 'news' ? 'weui-desktop-msg-sender__tab_selected' : ''"
@
click=
"onChangeType('news')"
>
图文
</li>
<li
class=
"weui-desktop-msg-sender__tab weui-desktop-msg-sender__tab_text"
:class=
"type === 'text' ? 'weui-desktop-msg-sender__tab_selected' : ''"
@
click=
"onChangeType('text')"
>
文字
</li>
<li
class=
"weui-desktop-msg-sender__tab weui-desktop-msg-sender__tab_text"
:class=
"type === 'text' ? 'weui-desktop-msg-sender__tab_selected' : ''"
@
click=
"onChangeType('text')"
>
文字
</li>
<li
v-if=
"dialogObj && dialogObj.key !== 'mini_auto_reply'"
class=
"weui-desktop-msg-sender__tab weui-desktop-msg-sender__tab_img"
:class=
"type === 'image' ? 'weui-desktop-msg-sender__tab_selected' : ''"
@
click=
"onChangeType('image')"
>
图片
</li>
<li
class=
"weui-desktop-msg-sender__tab weui-desktop-msg-sender__tab_img"
:class=
"type === 'image' ? 'weui-desktop-msg-sender__tab_selected' : ''"
@
click=
"onChangeType('image')"
>
图片
</li>
<li
v-if=
"dialogObj && dialogObj.key !== 'mini_auto_reply'"
class=
"weui-desktop-msg-sender__tab weui-desktop-msg-sender__tab_audio"
:class=
"type === 'voice' ? 'weui-desktop-msg-sender__tab_selected' : ''"
@
click=
"onChangeType('voice')"
>
语音
</li>
<li
v-if=
"dialogObj && dialogObj.key !== 'mini_auto_reply'"
class=
"weui-desktop-msg-sender__tab weui-desktop-msg-sender__tab_audio"
:class=
"type === 'voice' ? 'weui-desktop-msg-sender__tab_selected' : ''"
@
click=
"onChangeType('voice')"
>
语音
</li>
<li
v-if=
"dialogObj && dialogObj.key !== 'mini_auto_reply'"
class=
"weui-desktop-msg-sender__tab weui-desktop-msg-sender__tab_video"
:class=
"type === 'video' ? 'weui-desktop-msg-sender__tab_selected' : ''"
@
click=
"onChangeType('video')"
>
视频
</li>
<li
v-if=
"dialogObj && dialogObj.key !== 'mini_auto_reply'"
class=
"weui-desktop-msg-sender__tab weui-desktop-msg-sender__tab_video"
:class=
"type === 'video' ? 'weui-desktop-msg-sender__tab_selected' : ''"
@
click=
"onChangeType('video')"
>
视频
</li>
</ul>
</ul>
<div
class=
"inner-bottom"
>
<div
class=
"inner-bottom"
>
<div
class=
"img-action"
v-if=
"type === 'image'"
>
<div
class=
"img-action"
v-if=
"type === 'image'"
>
<template
v-if=
"imageContent"
>
<template
v-if=
"imageContent
&& dialogObj.key !== 'mini_auto_reply'
"
>
<div
class=
"my-teacher"
v-if=
"imageContent.variable"
>
我的老师二维码
</div>
<div
class=
"my-teacher"
v-if=
"imageContent.variable"
>
我的老师二维码
</div>
<img
style=
"max-width: 80%;"
v-if=
"imageContent.content"
:src=
"imageContent.content"
/>
<img
style=
"max-width: 80%;"
v-if=
"imageContent.content"
:src=
"imageContent.content"
/>
</
template
>
</
template
>
<div
class=
"display-b"
>
<div
class=
"display-b"
>
<div
class=
"img-create-access"
v-if=
"!showMedia"
>
<div
class=
"img-create-access"
v-if=
"!showMedia
&& dialogObj && dialogObj.key !== 'mini_auto_reply'
"
>
<a
href=
"javascript:;"
class=
"img-create-access__link"
@
click=
"getMediaList('image')"
>
从素材库中选择
</a>
<a
href=
"javascript:;"
class=
"img-create-access__link"
@
click=
"getMediaList('image')"
>
从素材库中选择
</a>
</div>
</div>
<div
class=
"img-create-access"
v-if=
"!showMedia"
>
<div
class=
"img-create-access"
v-if=
"!showMedia
&& dialogObj && dialogObj.key !== 'mini_auto_reply'
"
>
<a
href=
"javascript:;"
class=
"img-create-access__link"
@
click=
"addTeacherQrcode"
>
添加老师二维码
</a>
<a
href=
"javascript:;"
class=
"img-create-access__link"
@
click=
"addTeacherQrcode"
>
添加老师二维码
</a>
</div>
</div>
<el-upload
v-if=
"dialogObj && dialogObj.key === 'mini_auto_reply'"
action=
"/api/public/upload/zone"
:http-request=
"uploadFile"
:class=
"{disabled:!uploadShow}"
:before-upload=
"beforeAvatarUpload"
list-type=
"picture-card"
:file-list=
"imageList"
:on-success=
"handleAvatarSuccess"
:on-remove=
"handleRemove"
:limit=
"1"
>
<i
class=
"el-icon-plus"
></i>
</el-upload>
</div>
</div>
<div
v-if=
"showMedia && mediaList.length > 0"
>
<div
v-if=
"showMedia && mediaList.length > 0"
>
<el-table
<el-table
...
@@ -238,7 +251,7 @@
...
@@ -238,7 +251,7 @@
</template>
</template>
<
script
>
<
script
>
import
{
updateConfigApi
,
saveConfigApi
,
getMediaListApi
,
getConfigListApi
,
getTeacherListApi
}
from
"../../service/api"
;
import
{
updateConfigApi
,
saveConfigApi
,
getMediaListApi
,
getConfigListApi
,
getTeacherListApi
,
uploadFileApi
}
from
"../../service/api"
;
import
page
from
'../framework/page'
import
page
from
'../framework/page'
import
page2
from
'../framework/page'
import
page2
from
'../framework/page'
import
page3
from
'../framework/page'
import
page3
from
'../framework/page'
...
@@ -289,7 +302,9 @@
...
@@ -289,7 +302,9 @@
qr
:[
qr
:[
{
required
:
true
,
message
:
'请输入二维码'
,
trigger
:
'change'
}
{
required
:
true
,
message
:
'请输入二维码'
,
trigger
:
'change'
}
]
]
}
},
imageList
:
[],
uploadShow
:
true
}
}
},
},
components
:{
components
:{
...
@@ -353,7 +368,11 @@
...
@@ -353,7 +368,11 @@
obj
.
variable
=
this
.
list
[
this
.
index
].
variable
obj
.
variable
=
this
.
list
[
this
.
index
].
variable
}
}
if
(
this
.
type
===
'image'
)
{
if
(
this
.
type
===
'image'
)
{
this
.
imageContent
=
obj
this
.
imageContent
=
obj
;
if
(
this
.
dialogObj
.
key
===
'mini_auto_reply'
)
{
this
.
imageList
=
[{
name
:
'mini-image'
,
url
:
obj
.
content
}];
this
.
uploadShow
=
false
;
}
}
else
if
(
this
.
type
===
'news'
)
{
}
else
if
(
this
.
type
===
'news'
)
{
this
.
newsContent
=
obj
this
.
newsContent
=
obj
}
else
if
(
this
.
type
===
'voice'
)
{
}
else
if
(
this
.
type
===
'voice'
)
{
...
@@ -514,7 +533,45 @@
...
@@ -514,7 +533,45 @@
}
else
{
}
else
{
this
.
imageContent
=
obj
this
.
imageContent
=
obj
}
}
},
handleAvatarSuccess
(
res
)
{
this
.
imageList
=
[{
name
:
res
.
data
.
url
,
url
:
process
.
env
.
IMAGE_URL_HEAD
+
res
.
data
.
url
}]
},
beforeAvatarUpload
(){
this
.
uploadShow
=
false
},
uploadFile
(
a
)
{
this
.
loading
=
true
;
this
.
$store
.
dispatch
(
'setProgress'
,{
type
:
'new'
,
id
:
a
.
file
.
uid
});
this
.
fileUid
=
a
.
file
.
uid
;
uploadFileApi
({
file
:
a
.
file
,
type
:
'mini'
}).
then
(
res
=>
{
this
.
uploadFileToQiniu
(
a
,
res
);
this
.
loading
=
false
;
}).
catch
(()
=>
{
this
.
loading
=
false
;
})
},
uploadFileToQiniu
(
a
,
data
)
{
this
.
loading
=
true
;
this
.
$store
.
dispatch
(
'setProgress'
,{
type
:
'new'
,
id
:
a
.
file
.
uid
});
uploadFileApi
({
file
:
a
.
file
,
type
:
'local'
}).
then
(
res
=>
{
this
.
imageList
=
[{
name
:
res
.
url
,
url
:
process
.
env
.
IMAGE_URL_HEAD
+
res
.
url
}]
this
.
loading
=
false
;
this
.
$message
({
type
:
'success'
,
message
:
'上传成功!'
});
this
.
imageContent
=
{
type
:
'image'
,
content
:
process
.
env
.
IMAGE_URL_HEAD
+
res
.
url
,
media_id
:
data
.
media_id
}
}).
catch
(()
=>
{
this
.
loading
=
false
;
})
},
handleRemove
(){
this
.
uploadShow
=
true
}
}
}
}
}
}
...
@@ -776,4 +833,7 @@
...
@@ -776,4 +833,7 @@
display
:
block
;
display
:
block
;
clear
:
both
;
clear
:
both
;
}
}
.disabled
.el-upload--picture-card
{
display
:
none
!important
;
}
</
style
>
</
style
>
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