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
7853466f
authored
Dec 23, 2021
by
Sixong.Zhu
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
update
parent
1ee879ff
Show whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
184 additions
and
13 deletions
components/chat-room.vue
components/message-item/pay-message.vue
components/message-item/position-message.vue
components/message-list.vue
components/message.vue
event/index.ts
model/index.ts
xim/models/chat.ts
components/chat-room.vue
View file @
7853466f
...
@@ -13,10 +13,7 @@
...
@@ -13,10 +13,7 @@
>
>
{{
getCurrentInputingPeople
}}
正在输入
{{
getCurrentInputingPeople
}}
正在输入
</div>
</div>
<messages
<messages
class=
"flex-fill"
@
open-message=
"openMessage"
/>
class=
"flex-fill"
@
open-pay-message=
"openPayMessage"
/>
<slot
name=
"chat-right-panel"
></slot>
<slot
name=
"chat-right-panel"
></slot>
</div>
</div>
<div
<div
...
@@ -44,6 +41,7 @@
...
@@ -44,6 +41,7 @@
import
messages
from
"@/customer-service/components/message-list.vue"
;
import
messages
from
"@/customer-service/components/message-list.vue"
;
import
{
ChatStore
,
chatStore
}
from
"@/customer-service/store/model"
;
import
{
ChatStore
,
chatStore
}
from
"@/customer-service/store/model"
;
import
Chat
from
"@/customer-service/xim"
;
import
Chat
from
"@/customer-service/xim"
;
import
{
CustomerServiceEvent
}
from
"../event"
;
@
Component
({
components
:
{
MessageInput
,
messages
}
})
@
Component
({
components
:
{
MessageInput
,
messages
}
})
export
default
class
ChatRoom
extends
Vue
{
export
default
class
ChatRoom
extends
Vue
{
...
@@ -133,8 +131,8 @@
...
@@ -133,8 +131,8 @@
this
.
chatBox
.
clientHeight
-
this
.
refTop
.
clientHeight
+
"px"
);
this
.
chatBox
.
clientHeight
-
this
.
refTop
.
clientHeight
+
"px"
);
}
}
private
open
PayMessage
(
id
:
number
)
{
private
open
Message
(
o
:
any
)
{
this
.
$emit
(
"open-pay-message"
,
id
);
CustomerServiceEvent
.
emit
(
this
,
o
);
}
}
private
onMessageSent
()
{
private
onMessageSent
()
{
...
...
components/message-item/pay-message.vue
View file @
7853466f
...
@@ -34,6 +34,7 @@
...
@@ -34,6 +34,7 @@
import
BaseMessage
from
"./index"
;
import
BaseMessage
from
"./index"
;
import
Chat
from
"@/customer-service/xim"
;
import
Chat
from
"@/customer-service/xim"
;
import
{
ChatStore
,
chatStore
}
from
"@/customer-service/store/model"
;
import
{
ChatStore
,
chatStore
}
from
"@/customer-service/store/model"
;
import
{
CustomerServiceEvent
,
MessageEvent
}
from
"@/customer-service/event"
;
@
Component
({
components
:
{}
})
@
Component
({
components
:
{}
})
export
default
class
Index
extends
BaseMessage
{
export
default
class
Index
extends
BaseMessage
{
...
@@ -112,7 +113,11 @@
...
@@ -112,7 +113,11 @@
private
view
()
{
private
view
()
{
this
.
isChatMember
&&
this
.
isChatMember
&&
this
.
$emit
(
"open-pay-message"
,
this
.
payData
.
paymentId
);
CustomerServiceEvent
.
open
(
this
,
MessageEvent
.
PayMessage
,
+
this
.
payData
.
paymentId
);
}
}
}
}
</
script
>
</
script
>
...
...
components/message-item/position-message.vue
0 → 100644
View file @
7853466f
<
template
>
<div
class=
"position-message"
@
click=
"openPosition"
>
<div
class=
"d-flex justify-content-between align-items-center"
>
<span
class=
"d-flex align-items-center"
>
<span
class=
"title"
>
{{
title
}}
</span>
<span
v-for=
"item in tags"
:key=
"item.title"
:style=
"
{ 'background-color': item.color }"
class="tag"
>
{{
item
.
title
}}
</span
>
</span>
<span
class=
"salary"
>
{{
salary
}}
</span>
</div>
<div
class=
"summary"
>
<span
v-for=
"item in summary"
:key=
"item"
>
{{
item
}}
</span>
</div>
<div
class=
"msg-content"
v-html=
"positionBody"
></div>
<div
class=
"msg-tail d-flex justify-content-between"
>
<span
v-for=
"item in tail"
:key=
"item"
class=
"text-truncate"
>
{{
item
}}
</span>
</div>
</div>
</
template
>
<
script
lang=
"ts"
>
import
{
CustomerServiceEvent
,
MessageEvent
}
from
"@/customer-service/event"
;
import
{
PositionMessage
}
from
"@/customer-service/xim/models/chat"
;
import
{
Component
}
from
"vue-property-decorator"
;
import
BaseMessage
from
"./index"
;
@
Component
({
components
:
{}
})
export
default
class
Index
extends
BaseMessage
{
private
get
positionData
()
{
return
this
.
messageBody
.
msg
as
PositionMessage
;
}
private
get
title
()
{
return
this
.
positionData
.
title
;
}
private
get
tags
()
{
return
this
.
positionData
.
tags
;
}
private
get
salary
()
{
return
this
.
positionData
.
salary
;
}
private
get
positionBody
()
{
return
this
.
positionData
.
post_require
;
}
private
get
summary
()
{
return
[
this
.
positionData
.
address
,
this
.
positionData
.
education_require
,
this
.
positionData
.
recruit_count
,
];
}
private
get
tail
()
{
return
[
this
.
positionData
.
company_name
,
this
.
positionData
.
business_scope
,
];
}
private
openPosition
()
{
CustomerServiceEvent
.
open
(
this
,
MessageEvent
.
PositionMessage
,
this
.
positionData
.
post_id
);
}
}
</
script
>
<
style
lang=
"less"
scoped
>
.position-message
{
border
:
1px
solid
#ccc
;
border-radius
:
10px
;
padding
:
10px
;
max-width
:
300px
;
cursor
:
pointer
;
}
.title
{
font-size
:
16px
;
font-weight
:
500
;
}
.tag
{
border-radius
:
4px
;
padding
:
0
2px
;
margin-left
:
10px
;
color
:
#fff
;
font-size
:
12px
;
}
.salary
{
color
:
#e87005
;
margin-left
:
50px
;
}
.summary
{
border-bottom
:
1px
solid
#f0f0f0
;
margin
:
6px
-10px
10px
-10px
;
font-size
:
12px
;
color
:
#999
;
padding
:
0
10px
8px
10px
;
span
+
span
{
margin-left
:
20px
;
}
}
.msg-content
{
line-height
:
1.4
;
}
.msg-tail
{
margin
:
15px
-10px
0
-10px
;
padding
:
10px
10px
0
10px
;
border-top
:
1px
solid
#f0f0f0
;
span
{
max-width
:
200px
;
}
}
</
style
>
\ No newline at end of file
components/message-list.vue
View file @
7853466f
...
@@ -24,7 +24,7 @@
...
@@ -24,7 +24,7 @@
:shape=
"shape"
:shape=
"shape"
@
open=
"open"
@
open=
"open"
@
withdraw=
"refresh"
@
withdraw=
"refresh"
@
open-
pay-message=
"openPay
Message"
@
open-
message=
"open
Message"
/>
/>
</div>
</div>
</
template
>
</
template
>
...
@@ -49,6 +49,7 @@
...
@@ -49,6 +49,7 @@
import
{
ChatStore
,
chatStore
}
from
"@/customer-service/store/model"
;
import
{
ChatStore
,
chatStore
}
from
"@/customer-service/store/model"
;
import
{
dbController
}
from
"../database"
;
import
{
dbController
}
from
"../database"
;
import
{
getLastMessageId
}
from
"../store"
;
import
{
getLastMessageId
}
from
"../store"
;
import
{
CustomerServiceEvent
}
from
"../event"
;
@
Component
({
components
:
{
message
,
ImagePreview
,
VideoPreview
}
})
@
Component
({
components
:
{
message
,
ImagePreview
,
VideoPreview
}
})
export
default
class
MessageList
extends
Vue
{
export
default
class
MessageList
extends
Vue
{
...
@@ -415,8 +416,8 @@
...
@@ -415,8 +416,8 @@
this
.
fetchNewMsg
();
this
.
fetchNewMsg
();
}
}
private
open
PayMessage
(
id
:
number
)
{
private
open
Message
(
o
:
any
)
{
this
.
$emit
(
"open-pay-message"
,
id
);
CustomerServiceEvent
.
emit
(
this
,
o
);
}
}
}
}
</
script
>
</
script
>
...
...
components/message.vue
View file @
7853466f
...
@@ -69,7 +69,7 @@
...
@@ -69,7 +69,7 @@
v-if=
"messageComponent"
v-if=
"messageComponent"
v-model=
"data"
v-model=
"data"
@
open=
"openFile"
@
open=
"openFile"
@
open-
pay-message=
"openPay
Message"
@
open-
message=
"open
Message"
/>
/>
<avatar
<avatar
v-if=
"!isQuestionAnswerMessage && !isWithdrawMessage"
v-if=
"!isQuestionAnswerMessage && !isWithdrawMessage"
...
@@ -164,11 +164,13 @@
...
@@ -164,11 +164,13 @@
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
QuestionAnswerMessage
from
"./message-item/question-answer-message.vue"
;
import
QuestionAnswerMessage
from
"./message-item/question-answer-message.vue"
;
import
PositionMessage
from
"./message-item/position-message.vue"
;
import
PayMessage
from
"./message-item/pay-message.vue"
;
import
PayMessage
from
"./message-item/pay-message.vue"
;
import
NotifyMessage
from
"./message-item/notify-message.vue"
;
import
NotifyMessage
from
"./message-item/notify-message.vue"
;
import
{
ChatRole
}
from
"@/customer-service/model"
;
import
{
ChatRole
}
from
"@/customer-service/model"
;
import
{
getUserMapping
}
from
"../utils/user-info"
;
import
{
getUserMapping
}
from
"../utils/user-info"
;
import
Xim
from
"@/customer-service/xim"
;
import
Xim
from
"@/customer-service/xim"
;
import
{
CustomerServiceEvent
}
from
"../event"
;
const
twoMinutes
=
2
*
60
*
1000
;
const
twoMinutes
=
2
*
60
*
1000
;
const
twoHours
=
2
*
60
*
60
*
1000
;
const
twoHours
=
2
*
60
*
60
*
1000
;
...
@@ -191,6 +193,7 @@
...
@@ -191,6 +193,7 @@
[
dto
.
MessageType
.
RefundV1
,
"pay-message"
],
[
dto
.
MessageType
.
RefundV1
,
"pay-message"
],
[
dto
.
MessageType
.
PayResult
,
"notify-message"
],
[
dto
.
MessageType
.
PayResult
,
"notify-message"
],
[
dto
.
MessageType
.
Notify
,
"notify-message"
],
[
dto
.
MessageType
.
Notify
,
"notify-message"
],
[
dto
.
MessageType
.
Position
,
"position-message"
],
]);
]);
@
Component
({
@
Component
({
...
@@ -209,6 +212,7 @@
...
@@ -209,6 +212,7 @@
ActionMessage
,
ActionMessage
,
PayMessage
,
PayMessage
,
NotifyMessage
,
NotifyMessage
,
PositionMessage
,
},
},
})
})
export
default
class
Message
extends
Vue
{
export
default
class
Message
extends
Vue
{
...
@@ -535,8 +539,8 @@
...
@@ -535,8 +539,8 @@
document
.
body
.
click
();
document
.
body
.
click
();
}
}
private
open
PayMessage
(
id
:
number
)
{
private
open
Message
(
o
:
any
)
{
this
.
$emit
(
"open-pay-message"
,
id
);
CustomerServiceEvent
.
emit
(
this
,
o
);
}
}
}
}
</
script
>
</
script
>
...
...
event/index.ts
0 → 100644
View file @
7853466f
export
const
enum
MessageEvent
{
Default
=
"open-message"
,
PayMessage
=
"pay-message"
,
PositionMessage
=
"position-message"
,
}
export
class
CustomerServiceEvent
{
public
static
open
(
vue
:
Vue
,
type
:
MessageEvent
,
model
:
any
)
{
return
this
.
emit
(
vue
,
{
type
,
model
});
}
public
static
emit
(
vue
:
Vue
,
o
:
{
type
:
MessageEvent
;
model
:
any
})
{
return
vue
.
$emit
(
MessageEvent
.
Default
,
o
);
}
}
model/index.ts
View file @
7853466f
...
@@ -121,6 +121,7 @@ export const enum MessageType {
...
@@ -121,6 +121,7 @@ export const enum MessageType {
RefundV1
=
"grefund"
,
RefundV1
=
"grefund"
,
Refund
=
"grefund2"
,
Refund
=
"grefund2"
,
Card
=
"card"
,
Card
=
"card"
,
Position
=
"position"
,
}
}
export
const
enum
MessageHandled
{
export
const
enum
MessageHandled
{
...
...
xim/models/chat.ts
View file @
7853466f
...
@@ -219,6 +219,19 @@ export interface PayMessageBody {
...
@@ -219,6 +219,19 @@ export interface PayMessageBody {
totalMoney
?:
string
;
totalMoney
?:
string
;
}
}
export
interface
PositionMessage
{
title
:
string
;
tags
:
{
title
:
string
;
color
:
string
}[];
salary
:
string
;
address
:
string
;
education_require
:
string
;
recruit_count
:
string
;
post_require
:
string
;
company_name
:
string
;
business_scope
:
string
;
post_id
:
number
;
}
export
interface
CsUser
{
export
interface
CsUser
{
id
:
number
;
id
:
number
;
oid
:
string
;
oid
:
string
;
...
...
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