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
7e8a37ba
authored
Nov 12, 2021
by
zhousil
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
客服默认头像
parent
69456916
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
15 additions
and
2 deletions
components/message.vue
imgs/default-host-avatar.svg → imgs/benefits-default-avatar.svg
model/index.ts
xim/index.ts
components/message.vue
View file @
7e8a37ba
...
...
@@ -35,11 +35,11 @@
/>
<avatar
v-if=
"
avatar &&
!isQuestionAnswerMessage && !isWithdrawMessage
!isQuestionAnswerMessage && !isWithdrawMessage
"
:src=
"
chatRole === 'admin' || chatRole === 'customer-service'
?
require('../imgs/default-host-avatar.svg')
?
defaultAvatar
: avatar
"
shape=
"circle"
...
...
@@ -302,6 +302,10 @@
return
""
;
}
private
get
defaultAvatar
()
{
return
xim
.
getAvatar
();
}
private
get
chatRole
()
{
if
(
this
.
chatMembers
)
{
const
t
=
this
.
chatMembers
.
find
((
i
)
=>
i
.
eid
===
this
.
data
.
eid
);
...
...
imgs/
default-hos
t-avatar.svg
→
imgs/
benefits-defaul
t-avatar.svg
View file @
7e8a37ba
File moved
model/index.ts
View file @
7e8a37ba
...
...
@@ -66,6 +66,8 @@ export interface ChatOption {
eventHub
?:
Vue
;
message
?:
ChatMessageController
;
avatar
?:
string
;
}
export
interface
ChatMessageController
{
...
...
xim/index.ts
View file @
7e8a37ba
...
...
@@ -26,6 +26,7 @@ class Chat implements ChatMessageController {
private
connectedActions
:
(()
=>
void
)[]
=
[];
private
connected
=
false
;
private
messageController
:
ChatMessageController
|
null
=
null
;
private
defaultAvatar
=
""
;
public
onReady
(
action
:
()
=>
void
)
{
if
(
this
.
connected
)
{
...
...
@@ -53,6 +54,8 @@ class Chat implements ChatMessageController {
this
.
eventHub
=
option
.
eventHub
||
null
;
option
.
message
&&
(
this
.
messageController
=
option
.
message
);
option
.
avatar
!==
undefined
&&
(
this
.
defaultAvatar
=
option
.
avatar
);
await
this
.
setupIndexDb
();
this
.
token
=
async
()
=>
option
.
sdk
().
global
.
jwtToken
;
...
...
@@ -189,6 +192,10 @@ class Chat implements ChatMessageController {
public
info
(
msg
:
string
)
{
this
.
messageController
&&
this
.
messageController
.
info
(
msg
);
}
public
getAvatar
(){
return
this
.
defaultAvatar
;
}
}
export
default
new
Chat
();
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