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
26880254
authored
Nov 04, 2021
by
zhousil
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
福利宝客服
parent
d5023b9a
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
31 additions
and
34 deletions
components/controller/index.ts
components/css/benefits-plan.less
components/message-item/purchase-plan-message.vue
components/message-item/system-message.vue → components/message-item/question-answer-message.vue
components/message.vue
model/index.ts
components/controller/index.ts
View file @
26880254
...
...
@@ -22,5 +22,8 @@ export function parserMessage(type: string, rawMsg: string) {
if
(
type
===
MessageType
.
MyWelfare
)
{
return
`[我的福利]`
;
}
if
(
type
===
MessageType
.
QuestionAnswer
)
{
return
`[问答]`
;
}
return
`[系统自动回复]`
;
}
components/css/benefits-plan.less
View file @
26880254
...
...
@@ -32,7 +32,7 @@
}
}
.prod
o
ct-item {
.prod
u
ct-item {
display: flex;
padding: 16px 0;
&:not(:last-child) {
...
...
components/message-item/purchase-plan-message.vue
View file @
26880254
...
...
@@ -22,13 +22,16 @@
"plan-welfare-title"
)
as
any
;
if
(
productTitleDom
)
{
// 遍历注册点击事件
productTitleDom
.
forEach
((
item
:
HTMLElement
)
=>
{
item
.
onclick
=
(
e
:
any
)
=>
{
window
.
open
(
window
.
location
.
host
+
`/统一业务平台.福利宝管理.采购管理/detail/w_plan/key/
${
e
.
target
.
id
}
`
,
"_blank"
);
// 我的福利在后台没找到位置
if
(
e
.
target
.
attributes
[
"data-type"
].
value
===
"plan"
)
{
window
.
open
(
`/福利宝.福利宝管理端.采购管理/detail/w_plan/key/
${
e
.
target
.
attributes
[
"data-id"
].
value
}
`
,
"_blank"
);
}
};
});
}
...
...
components/message-item/
system
-message.vue
→
components/message-item/
question-answer
-message.vue
View file @
26880254
File moved
components/message.vue
View file @
26880254
...
...
@@ -5,7 +5,7 @@
'my-message flex-row-reverse': isMyMessage,
'justify-content-center': isWithdrawMessage,
'offset-bottom': matchKeywords,
'
system-message': isSystem
Message,
'
question-answer-message': isQuestionAnswer
Message,
}"
>
<div
class=
"msg-content"
:class=
"
{ 'algin-left': !isMyMessage }">
...
...
@@ -14,23 +14,15 @@
:class=
"
{ 'algin-left': !isMyMessage }"
v-if="!isWithdrawMessage"
>
{{
is
SystemMessage
?
"系统消息
"
:
userName
}}
{{
is
QuestionAnswerMessage
?
"
"
:
userName
}}
</div>
<div
class=
"content-avatar d-flex align-items-start"
:class=
"
{ 'justify-content-end': isMyMessage,'cs-flex-direction': chatRole!=='default' }"
:class=
"
{
'justify-content-end': isMyMessage,
'cs-flex-direction': chatRole !== 'default',
}"
>
<!--
<img
src=
"../imgs/default-host-avatar.svg"
style=
"width: 42px"
v-if=
"
messageComponent &&
!chatRole &&
!isWithdrawMessage &&
!isSystemMessage
"
class=
"host-avatar"
/>
-->
<component
:is=
"messageComponent"
:user-name=
"userName"
...
...
@@ -42,7 +34,7 @@
@open="openFile"
/>
<avatar
v-if=
"
avatar && !isSystem
Message"
v-if=
"
(avatar || showHostAvatar) && !isQuestionAnswerMessage && !isWithdraw
Message"
:src=
"
chatRole === 'default'
? avatar
...
...
@@ -145,7 +137,7 @@
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"
;
import
SystemMessage
from
"./message-item/system
-message.vue"
;
import
QuestionAnswerMessage
from
"./message-item/question-answer
-message.vue"
;
import
xim
from
"./../xim"
;
import
{
ChatRole
}
from
"@/customer-service/model"
;
...
...
@@ -161,7 +153,7 @@
[
dto
.
MessageType
.
GeneralOrderMsg
,
"text-message"
],
[
dto
.
MessageType
.
MyPurchasePlan
,
"purchase-plan-message"
],
[
dto
.
MessageType
.
MyWelfare
,
"my-welfare-message"
],
[
dto
.
MessageType
.
System
,
"system
-message"
],
[
dto
.
MessageType
.
QuestionAnswer
,
"question-answer
-message"
],
]);
@
Component
({
...
...
@@ -176,7 +168,7 @@
WithdrawMessage
,
PurchasePlanMessage
,
MyWelfareMessage
,
System
Message
,
QuestionAnswer
Message
,
},
})
export
default
class
Message
extends
Vue
{
...
...
@@ -235,8 +227,8 @@
return
this
.
data
.
type
===
dto
.
MessageType
.
Withdraw
;
}
private
get
is
System
Message
()
{
return
this
.
data
.
type
===
dto
.
MessageType
.
System
;
private
get
is
QuestionAnswer
Message
()
{
return
this
.
data
.
type
===
dto
.
MessageType
.
QuestionAnswer
;
}
private
get
isAllRead
()
{
...
...
@@ -294,13 +286,12 @@
private
get
avatar
()
{
const
avatar
=
chat
.
getUserMapping
();
if
(
Object
.
getOwnPropertyNames
(
avatar
).
length
>
0
)
{
this
.
showHostAvatar
=
true
;
}
else
{
this
.
showHostAvatar
=
false
;
}
if
(
Object
.
getOwnPropertyNames
(
avatar
).
length
>
0
)
{
this
.
showHostAvatar
=
true
;
}
else
{
this
.
showHostAvatar
=
false
;
}
if
(
this
.
isSendingMessage
)
{
if
(
avatar
&&
this
.
chatMyId
)
{
const
user
=
avatar
[
this
.
chatMyId
];
if
(
user
&&
user
.
avatar
)
{
...
...
@@ -475,7 +466,7 @@
word-break
:
break-all
;
}
}
&
.
system
-message
{
&
.
question-answer
-message
{
flex-direction
:
row
;
.msg-content
{
text-align
:
left
;
...
...
model/index.ts
View file @
26880254
...
...
@@ -100,7 +100,7 @@ export const enum MessageType {
Withdraw
=
"withdraw"
,
MyPurchasePlan
=
"my_purchase_plan"
,
MyWelfare
=
"my_welfare"
,
System
=
"system
"
QuestionAnswer
=
"question_answer
"
}
export
const
enum
MessageHandled
{
...
...
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