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
a33fdcc0
authored
Nov 04, 2021
by
zhousil
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
福利宝客服
parent
5552f710
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
11 additions
and
53 deletions
components/message-item/my-welfare-message.vue
components/message-item/purchase-plan-message.vue
components/message-item/question-answer-message.vue
components/message.vue
components/message-item/my-welfare-message.vue
View file @
a33fdcc0
...
...
@@ -11,7 +11,7 @@
@
Component
({
components
:
{}
})
export
default
class
Index
extends
BaseMessage
{
pr
ivate
readonly
emptyText
=
" "
;
pr
otected
readonly
emptyText
=
" "
;
}
</
script
>
...
...
components/message-item/purchase-plan-message.vue
View file @
a33fdcc0
<
template
>
<div
class=
"msg-detail inline-text"
v-html=
"messageBody.msg.text || emptyText"
></div>
</
template
>
<
script
lang=
"ts"
>
import
{
Component
}
from
"vue-property-decorator"
;
import
BaseMessage
from
"./index
"
;
import
MyWelfareMessage
from
"@/customer-service/components/message-item/my-welfare-message.vue
"
;
import
Chat
from
"@/customer-service/xim/index"
;
@
Component
({
components
:
{}
})
export
default
class
Index
extends
BaseMessage
{
private
readonly
emptyText
=
" "
;
export
default
class
Index
extends
MyWelfareMessage
{
mounted
()
{
if
(
Chat
.
isBackend
())
{
this
.
backEndPlan
();
...
...
components/message-item/question-answer-message.vue
View file @
a33fdcc0
<
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
"
;
import
TextMessage
from
"@/customer-service/components/message-item/text-message.vue
"
;
@
Component
({
components
:
{}
})
export
default
class
Index
extends
BaseMessage
{
private
readonly
emptyText
=
" "
;
private
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
;
}
}
export
default
class
Index
extends
TextMessage
{}
</
script
>
<
style
lang=
"less"
scoped
>
.content-chat
.chat-room-con
.message-template
.my-message.msg-detail
{
background
:
#f5f5f5
!important
;
&::after{
border
:
0
;
.chat-room-con
.message-template
.my-message.msg-detail
{
background-color
:
#f5f5f5
!important
;
&::after
{
border
:
0
;
}
}
}
.inline-text
{
display
:
inline-block
;
white-space
:
pre-wrap
;
...
...
components/message.vue
View file @
a33fdcc0
...
...
@@ -2,10 +2,9 @@
<div
class=
"message-con d-flex align-items-center"
:class=
"
{
'my-message flex-row-reverse': isMyMessage,
'my-message flex-row-reverse': isMyMessage
&&
!isQuestionAnswerMessage
,
'justify-content-center': isWithdrawMessage,
'offset-bottom': matchKeywords,
'question-answer-message': isQuestionAnswerMessage,
}"
>
<div
class=
"msg-content"
:class=
"
{ 'algin-left': !isMyMessage }">
...
...
@@ -466,19 +465,6 @@
word-break
:
break-all
;
}
}
&
.question-answer-message
{
flex-direction
:
row
;
.msg-content
{
text-align
:
left
;
}
.msg-name
{
margin-left
:
0
!important
;
text-align
:
left
;
}
.content-avatar
{
justify-content
:
flex-start
!important
;
}
}
&
.offset-bottom
{
margin-bottom
:
30px
;
}
...
...
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