Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
foreign
/
customer-service
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
7530689c
authored
Jan 04, 2022
by
Sixong.Zhu
Browse files
Options
_('Browse Files')
Download
Plain Diff
Merge branch 'master' into pre
parents
cb1d43e3
466962ea
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
49 additions
and
30 deletions
components/message-item/audio-message.vue
components/message.vue
components/message-item/audio-message.vue
View file @
7530689c
<
template
>
<
template
>
<div
<div>
class=
"msg-detail voice-message d-flex align-items-center"
<div
:class=
"
{ playing: playing, 'can-play': messageRealUrl }"
class=
"msg-detail voice-message d-flex align-items-center"
@click.stop="play"
:class=
"
{ playing: playing, 'can-play': messageRealUrl }"
:style="{ width: getVoiceMessageWidth + 'px' }"
@click.stop="play"
>
:style="{ width: getVoiceMessageWidth + 'px' }"
<div
class=
"d-flex align-items-center"
v-if=
"messageRealUrl"
>
>
<voice-icon
:loading=
"playing"
></voice-icon>
<div
class=
"d-flex align-items-center"
v-if=
"messageRealUrl"
>
<audio
ref=
"audio"
@
play=
"onPlay"
@
pause=
"onPause"
>
<voice-icon
:loading=
"playing"
></voice-icon>
<source
type=
"audio/aac"
:src=
"messageRealUrl"
/>
<audio
ref=
"audio"
@
play=
"onPlay"
@
pause=
"onPause"
>
</audio>
<source
type=
"audio/aac"
:src=
"messageRealUrl"
/>
<span
v-if=
"duration"
class=
"duration text-nowrap text-hint"
</audio>
>
{{
durationInSecond
}}
s
</span
<span
v-if=
"duration"
class=
"duration text-nowrap text-hint"
>
>
{{
durationInSecond
}}
s
</span
>
</div>
<i
class=
"el-icon-warning-outline"
v-else-if=
"fileFailed2Load"
title=
"[语音加载失败]"
></i>
</div>
</div>
<i
class=
"el-icon-warning-outline"
v-else-if=
"fileFailed2Load"
title=
"[语音加载失败]"
></i>
<text-message
v-model=
"value"
v-if=
"backend"
/>
<text-message
v-model=
"value"
v-if=
"backend"
/>
</div>
</div>
</
template
>
</
template
>
...
@@ -92,6 +93,9 @@
...
@@ -92,6 +93,9 @@
<
style
lang=
"less"
scoped
>
<
style
lang=
"less"
scoped
>
.voice-message
{
.voice-message
{
width
:
200px
;
width
:
200px
;
background-color
:
#eee
;
border-radius
:
6px
;
padding
:
8px
10px
;
&.can-play
{
&.can-play
{
cursor
:
pointer
;
cursor
:
pointer
;
...
@@ -102,12 +106,6 @@
...
@@ -102,12 +106,6 @@
}
}
}
}
.inline-text
{
position
:
absolute
;
bottom
:
0
;
left
:
40px
;
}
.my-message
{
.my-message
{
.voice-message
{
.voice-message
{
>
div
{
>
div
{
...
...
components/message.vue
View file @
7530689c
...
@@ -168,7 +168,7 @@
...
@@ -168,7 +168,7 @@
import
PayMessage
from
"./message-item/pay-message.vue"
;
import
PayMessage
from
"./message-item/pay-message.vue"
;
import
NotifyMessage
from
"./message-item/notify-message.vue"
;
import
NotifyMessage
from
"./message-item/notify-message.vue"
;
import
{
ChatRole
}
from
"@/customer-service/model"
;
import
{
ChatRole
}
from
"@/customer-service/model"
;
import
{
getUserMapping
}
from
"../utils/user-info"
;
import
{
ChatUserInfoService
,
getUserMapping
}
from
"../utils/user-info"
;
import
Xim
from
"@/customer-service/xim"
;
import
Xim
from
"@/customer-service/xim"
;
import
{
CustomerServiceEvent
,
MessageEvent
}
from
"../event"
;
import
{
CustomerServiceEvent
,
MessageEvent
}
from
"../event"
;
import
{
PayMessageBody
}
from
"../xim/models/chat"
;
import
{
PayMessageBody
}
from
"../xim/models/chat"
;
...
@@ -266,6 +266,8 @@
...
@@ -266,6 +266,8 @@
private
org
=
""
;
private
org
=
""
;
private
manualAllRead
=
false
;
private
manualAllRead
=
false
;
private
manualReaded
=
0
;
private
manualReaded
=
0
;
private
refetchUsername
=
""
;
private
refetchUserIcon
=
""
;
private
readerListOffset
=
false
;
private
readerListOffset
=
false
;
private
defaultMessageHandledStatus
=
dto
.
MessageHandled
.
Default
;
private
defaultMessageHandledStatus
=
dto
.
MessageHandled
.
Default
;
...
@@ -344,6 +346,11 @@
...
@@ -344,6 +346,11 @@
return
true
;
return
true
;
}
}
// 系统推送的消息,默认为客服发送
if
(
this
.
messageBody
&&
+
this
.
messageBody
.
eid
===
0
)
{
return
true
;
}
if
(
if
(
this
.
backend
&&
this
.
backend
&&
this
.
messageBody
&&
this
.
messageBody
&&
...
@@ -376,7 +383,10 @@
...
@@ -376,7 +383,10 @@
return
this
.
getFilterUsername
(
t
.
alias_name
||
t
.
name
);
return
this
.
getFilterUsername
(
t
.
alias_name
||
t
.
name
);
}
}
}
}
return
""
;
if
(
!
this
.
refetchUsername
)
{
this
.
refetchUsername4Message
();
}
return
this
.
refetchUsername
;
}
}
private
getFilterUsername
(
name
:
string
)
{
private
getFilterUsername
(
name
:
string
)
{
...
@@ -400,7 +410,7 @@
...
@@ -400,7 +410,7 @@
}
}
}
}
return
""
;
return
this
.
refetchUserIcon
;
}
}
private
get
defaultAvatar
()
{
private
get
defaultAvatar
()
{
...
@@ -576,6 +586,17 @@
...
@@ -576,6 +586,17 @@
private
openMessage
(
o
:
any
)
{
private
openMessage
(
o
:
any
)
{
CustomerServiceEvent
.
emit
(
this
,
o
);
CustomerServiceEvent
.
emit
(
this
,
o
);
}
}
private
refetchUsername4Message
()
{
if
(
this
.
data
&&
this
.
data
.
eid
)
{
ChatUserInfoService
.
getUserInfo
(
this
.
data
.
eid
).
then
((
r
)
=>
{
if
(
r
)
{
this
.
refetchUsername
=
r
.
alias_name
||
r
.
name
||
r
.
phone
;
r
.
icon
&&
(
this
.
refetchUserIcon
=
r
.
icon
);
}
});
}
}
}
}
</
script
>
</
script
>
...
...
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