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
960a9dc8
authored
Nov 05, 2021
by
zhousil
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
福利宝客服
parent
a33fdcc0
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
60 additions
and
38 deletions
components/message-item/my-welfare-message.vue
components/message-item/purchase-plan-message.vue
components/message.vue
model/index.ts
components/message-item/my-welfare-message.vue
View file @
960a9dc8
<
template
>
<div
class=
"msg-detail inline-text"
v-html=
"messageBody.msg.text || emptyText"
></div>
</
template
>
<
script
lang=
"ts"
>
<
script
lang=
"ts"
>
import
{
Component
}
from
"vue-property-decorator"
;
import
{
Component
}
from
"vue-property-decorator"
;
import
BaseMessage
from
"./index
"
;
import
PurchasePlanMessage
from
"@/customer-service/components/message-item/purchase-plan-message.vue
"
;
import
Chat
from
"@/customer-service/xim/index"
;
@
Component
({
components
:
{}
})
@
Component
({
components
:
{}
})
export
default
class
Index
extends
BaseMessage
{
export
default
class
Index
extends
PurchasePlanMessage
{
protected
readonly
emptyText
=
" "
;
protected
openPlanUrl
(
e
:
any
)
{
if
(
Chat
.
isBackend
())
{
return
;
}
this
.
planTargetUrl
=
"/my-benefit-detail/"
;
window
.
open
(
`
${
this
.
planTargetUrl
}${
e
.
target
.
attributes
[
"plan-id"
].
value
}
`
,
"_blank"
);
}
}
}
</
script
>
</
script
>
...
...
components/message-item/purchase-plan-message.vue
View file @
960a9dc8
<
template
>
<div
class=
"msg-detail inline-text"
v-html=
"messageBody.msg.text || emptyText"
></div>
</
template
>
<
script
lang=
"ts"
>
<
script
lang=
"ts"
>
import
{
Component
}
from
"vue-property-decorator"
;
import
{
Component
}
from
"vue-property-decorator"
;
import
MyWelfareMessage
from
"@/customer-service/components/message-item/my-welfare-message.vue
"
;
import
BaseMessage
from
"./index
"
;
import
Chat
from
"@/customer-service/xim/index"
;
import
Chat
from
"@/customer-service/xim/index"
;
@
Component
({
components
:
{}
})
@
Component
({
components
:
{}
})
export
default
class
Index
extends
MyWelfareMessage
{
export
default
class
Index
extends
BaseMessage
{
mounted
()
{
protected
readonly
emptyText
=
" "
;
if
(
Chat
.
isBackend
())
{
protected
planDom
:
HTMLElement
|
null
=
null
;
this
.
backEndPlan
();
protected
planTargetUrl
=
""
;
public
mounted
()
{
this
.
planDom
=
this
.
$el
?.
querySelector
(
".plan-welfare-title"
);
this
.
listenPlan
();
}
public
beforeDestroy
()
{
this
.
planDom
?.
removeEventListener
(
"click"
,
this
.
openPlanUrl
);
}
}
protected
listenPlan
()
{
this
.
planDom
?.
addEventListener
(
"click"
,
this
.
openPlanUrl
);
}
protected
openPlanUrl
(
e
:
any
)
{
if
(
Chat
.
isBackend
())
{
this
.
planTargetUrl
=
"/福利宝.福利宝管理端.采购管理/detail/w_plan/key/"
;
}
else
{
this
.
planTargetUrl
=
"/my-plan-walfare-detail/"
;
}
}
private
backEndPlan
()
{
const
productTitleDom
=
document
.
getElementsByClassName
(
"plan-welfare-title"
)
as
any
;
if
(
productTitleDom
)
{
// 遍历注册点击事件
productTitleDom
.
forEach
((
item
:
HTMLElement
)
=>
{
item
.
onclick
=
(
e
:
any
)
=>
{
// 我的福利在后台没找到位置
if
(
e
.
target
.
attributes
[
"data-type"
].
value
===
"plan"
)
{
window
.
open
(
window
.
open
(
`/福利宝.福利宝管理端.采购管理/detail/w_plan/key/
${
e
.
target
.
attributes
[
"data
-id"
].
value
}
`
,
`
${
this
.
planTargetUrl
}${
e
.
target
.
attributes
[
"plan
-id"
].
value
}
`
,
"_blank"
"_blank"
);
);
}
}
};
});
}
}
}
}
</
script
>
</
script
>
...
...
components/message.vue
View file @
960a9dc8
...
@@ -2,7 +2,8 @@
...
@@ -2,7 +2,8 @@
<div
<div
class=
"message-con d-flex align-items-center"
class=
"message-con d-flex align-items-center"
:class=
"
{
:class=
"
{
'my-message flex-row-reverse': isMyMessage
&&
!isQuestionAnswerMessage,
'my-message flex-row-reverse':
isMyMessage
&&
!isQuestionAnswerMessage,
'justify-content-center': isWithdrawMessage,
'justify-content-center': isWithdrawMessage,
'offset-bottom': matchKeywords,
'offset-bottom': matchKeywords,
}"
}"
...
@@ -19,7 +20,7 @@
...
@@ -19,7 +20,7 @@
class=
"content-avatar d-flex align-items-start"
class=
"content-avatar d-flex align-items-start"
:class=
"
{
:class=
"
{
'justify-content-end': isMyMessage,
'justify-content-end': isMyMessage,
'cs-flex-direction':
chatRole !== 'default'
,
'cs-flex-direction':
!isMyMessage
,
}"
}"
>
>
<component
<component
...
@@ -33,11 +34,15 @@
...
@@ -33,11 +34,15 @@
@open="openFile"
@open="openFile"
/>
/>
<avatar
<avatar
v-if=
"(avatar || showHostAvatar) && !isQuestionAnswerMessage && !isWithdrawMessage"
v-if=
"
(avatar || showHostAvatar) &&
!isQuestionAnswerMessage &&
!isWithdrawMessage
"
:src=
"
:src=
"
chatRole === '
default
'
chatRole === '
admin' || chatRole === 'customer-service
'
?
avatar
?
require('../imgs/default-host-avatar.svg')
:
require('../imgs/default-host-avatar.svg')
:
avatar
"
"
shape=
"circle"
shape=
"circle"
/>
/>
...
@@ -314,6 +319,10 @@
...
@@ -314,6 +319,10 @@
const
t
=
this
.
chatMembers
.
find
((
i
)
=>
i
.
eid
===
this
.
data
.
eid
);
const
t
=
this
.
chatMembers
.
find
((
i
)
=>
i
.
eid
===
this
.
data
.
eid
);
if
(
t
?.
type
===
ChatRole
.
Default
)
{
if
(
t
?.
type
===
ChatRole
.
Default
)
{
return
"default"
;
return
"default"
;
}
else
if
(
t
?.
type
===
ChatRole
.
Admin
)
{
return
"admin"
;
}
else
if
(
t
?.
type
===
ChatRole
.
CustomerService
)
{
return
"customer-service"
;
}
}
}
}
return
""
;
return
""
;
...
...
model/index.ts
View file @
960a9dc8
...
@@ -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"
,
QuestionAnswer
=
"question_answer"
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