Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
W
weixin-vue
Project overview
Project overview
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
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
Administrator
weixin-vue
Commits
f5524bed
Commit
f5524bed
authored
Aug 02, 2017
by
fangzhipeng
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
增加阅读图片和语音的功能
parent
005e1410
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
18 additions
and
2 deletions
+18
-2
src/components/ChatItemR.vue
src/components/ChatItemR.vue
+1
-1
src/components/Ele.vue
src/components/Ele.vue
+17
-1
No files found.
src/components/ChatItemR.vue
View file @
f5524bed
<
template
>
<div
:class=
"message.type == 0 ? 'chatitem-r-wrap chatitem-wrap': 'chatitem-l-wrap chatitem-wrap'"
>
<div
class=
"content"
style=
""
>
{{
message
.
content
}}
</div>
<div
class=
"content"
style=
""
v-html=
"message.content"
>
</div>
</div>
</
template
>
...
...
src/components/Ele.vue
View file @
f5524bed
...
...
@@ -168,9 +168,16 @@
notifyMsg
(
target
,
msg
)
{
const
h
=
this
.
$createElement
;
var
that
=
this
var
content
=
""
if
(
msg
.
msgType
==
3
)
content
=
"
图片消息
"
else
if
(
msg
.
msgType
==
34
)
content
=
"
语音消息
"
else
content
=
msg
.
content
this
.
$notify
({
title
:
target
.
remarkName
==
""
?
target
.
nickName
:
target
.
remarkName
,
message
:
h
(
'
i
'
,
{
style
:
'
color: teal
'
},
msg
.
content
),
message
:
h
(
'
i
'
,
{
style
:
'
color: teal
'
},
content
),
onClick
:
function
()
{
that
.
readAndShowMsg
(
msg
.
fromUserName
)
that
.
filterContacts
=
""
...
...
@@ -252,6 +259,15 @@
response
.
data
.
forEach
((
value
)
=>
{
if
(
!
(
value
.
msgType
==
1
||
value
.
msgType
==
3
||
value
.
msgType
==
34
))
return
if
(
value
.
msgType
==
3
)
{
value
.
content
=
'
<img src="/back/getMediaFile?msgId=
'
+
value
.
msgId
+
'
&type=0"/>
'
}
if
(
value
.
msgType
==
34
)
{
value
.
content
=
'
<audio src="/back/getMediaFile?msgId=
'
+
value
.
msgId
+
'
&type=1" controls="controls" >
'
}
var
target
=
this
.
contactsMap
[
value
.
fromUserName
]
if
(
target
)
{
value
.
type
=
0
...
...
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