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
19c37adb
authored
Nov 05, 2021
by
Sixong.Zhu
Browse files
Options
_('Browse Files')
Download
Plain Diff
Merge branch 'master' of
http://gitlab.corp.qinqinxiaobao.com:9880/uniplat/customer-service
parents
3ddf7c87
5a016285
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
52 additions
and
2 deletions
components/message-item/action-message.vue
components/message.vue
components/message-item/action-message.vue
0 → 100644
View file @
19c37adb
<
template
>
<div
class=
"msg-detail inline-text"
v-html=
"format2Link(messageBody.msg.text || emptyText)"
></div>
</
template
>
<
script
lang=
"ts"
>
import
{
replaceText2Link
}
from
"@/customer-service/utils"
;
import
xim
from
"@/customer-service/xim"
;
import
{
Component
}
from
"vue-property-decorator"
;
import
BaseMessage
from
"./index"
;
@
Component
({
components
:
{}
})
export
default
class
Index
extends
BaseMessage
{
protected
readonly
emptyText
=
" "
;
protected
format2Link
(
text
:
string
)
{
let
t
=
replaceText2Link
(
text
);
const
keywords
=
xim
.
getMatchedTextKeywords
();
for
(
const
item
of
keywords
)
{
const
r
=
new
RegExp
(
item
,
"g"
);
t
=
t
.
replace
(
r
,
`<span class="highlight">
${
item
}
</span>`
);
}
return
t
;
}
}
</
script
>
<
style
lang=
"less"
scoped
>
.inline-text
{
display
:
inline-block
;
white-space
:
pre-wrap
;
text-align
:
left
;
padding
:
20px
30px
;
color
:
#409eff
;
/deep/
.highlight
{
color
:
#e87005
;
}
}
</
style
>
\ No newline at end of file
components/message.vue
View file @
19c37adb
...
...
@@ -2,7 +2,8 @@
<div
class=
"message-con d-flex align-items-center"
:class=
"
{
'my-message flex-row-reverse': isMyMessage
&&
!isQuestionAnswerMessage,
'my-message flex-row-reverse':
isMyMessage
&&
!isQuestionAnswerMessage,
'justify-content-center': isWithdrawMessage,
'offset-bottom': matchKeywords,
}"
...
...
@@ -33,7 +34,11 @@
@open="openFile"
/>
<avatar
v-if=
"(avatar || showHostAvatar) && !isQuestionAnswerMessage && !isWithdrawMessage"
v-if=
"
(avatar || showHostAvatar) &&
!isQuestionAnswerMessage &&
!isWithdrawMessage
"
:src=
"
chatRole === 'default'
? avatar
...
...
@@ -133,6 +138,7 @@
import
AudioMessage
from
"./message-item/audio-message.vue"
;
import
VideoMessage
from
"./message-item/video-message.vue"
;
import
TextMessage
from
"./message-item/text-message.vue"
;
import
ActionMessage
from
"./message-item/action-message.vue"
;
import
WithdrawMessage
from
"./message-item/withdraw-message.vue"
;
import
PurchasePlanMessage
from
"./message-item/purchase-plan-message.vue"
;
import
MyWelfareMessage
from
"./message-item/my-welfare-message.vue"
;
...
...
@@ -153,6 +159,7 @@
[
dto
.
MessageType
.
MyPurchasePlan
,
"purchase-plan-message"
],
[
dto
.
MessageType
.
MyWelfare
,
"my-welfare-message"
],
[
dto
.
MessageType
.
QuestionAnswer
,
"question-answer-message"
],
[
dto
.
MessageType
.
Action
,
"action-message"
],
]);
@
Component
({
...
...
@@ -168,6 +175,7 @@
PurchasePlanMessage
,
MyWelfareMessage
,
QuestionAnswerMessage
,
ActionMessage
,
},
})
export
default
class
Message
extends
Vue
{
...
...
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