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