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
b50f79ae
authored
Dec 30, 2021
by
zhousil
Browse files
Options
_('Browse Files')
Download
Plain Diff
Merge branch 'master' into pre
parents
96f65282
38976aaa
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
13 additions
and
5 deletions
components/message-list.vue
service/order.ts
store/index.ts
xim/xim.ts
components/message-list.vue
View file @
b50f79ae
...
...
@@ -50,6 +50,7 @@
import
{
dbController
}
from
"../database"
;
import
{
getLastMessageId
}
from
"../store"
;
import
{
CustomerServiceEvent
}
from
"../event"
;
import
xim
from
"../xim/xim"
;
@
Component
({
components
:
{
message
,
ImagePreview
,
VideoPreview
}
})
export
default
class
MessageList
extends
Vue
{
...
...
@@ -192,7 +193,7 @@
this
.
handleScrollWrapper
();
this
.
onNewMessage
((
e
)
=>
{
if
(
e
.
type
===
MessageType
.
Withdraw
)
{
const
ids
=
e
.
ref_id
?
[
e
.
ref_id
]
:
JSON
.
parse
(
e
.
msg
);
const
ids
=
xim
.
withDrawMsgHandle
(
e
);
this
.
executeWithDraw
(
ids
);
dbController
.
removeMessage
(
e
.
chat_id
,
ids
)
...
...
service/order.ts
View file @
b50f79ae
...
...
@@ -10,6 +10,7 @@ import {
UploadImageItem
,
orderPayItemPredict
,
OrderComment
,
PayStatus
}
from
"../model"
;
import
{
GeneralOrderDirection
}
from
"../model/order-product"
;
...
...
@@ -133,11 +134,12 @@ class OrderService {
.
query
({
pageIndex
:
1
,
item_size
:
100
})
.
then
((
r
)
=>
{
if
(
r
&&
r
.
pageData
&&
r
.
pageData
.
rows
)
{
cons
t
items
=
this
.
handler
.
buildRows
<
OrderPayItem
>
(
le
t
items
=
this
.
handler
.
buildRows
<
OrderPayItem
>
(
r
.
pageData
.
rows
,
orderPayItemPredict
);
items
=
items
.
filter
(
i
=>
i
.
status
!==
PayStatus
.
Deleted
&&
i
.
status
!==
PayStatus
.
Cancel
)
if
(
withActions
)
{
for
(
let
i
=
0
;
i
<
r
.
pageData
.
rows
.
length
;
i
++
)
{
items
[
i
].
actions
=
r
.
pageData
.
rows
[
i
].
actions
;
...
...
store/index.ts
View file @
b50f79ae
...
...
@@ -765,7 +765,7 @@ export default {
if
(
e
.
type
===
MessageType
.
Withdraw
)
{
commit
(
ChatStore
.
MUTATION_WITHDRAW
,
e
.
msg
.
startsWith
(
"["
)
?
JSON
.
parse
(
e
.
msg
)
:
[
+
e
.
msg
]
xim
.
withDrawMsgHandle
(
e
)
);
}
const
scroll
=
()
=>
...
...
@@ -782,7 +782,7 @@ export default {
dbController
.
removeMessage
(
e
.
chat_id
,
e
.
msg
.
startsWith
(
"["
)
?
JSON
.
parse
(
e
.
msg
)
:
[
+
e
.
msg
]
xim
.
withDrawMsgHandle
(
e
)
)
.
finally
(()
=>
thenAction
());
}
else
{
...
...
xim/xim.ts
View file @
b50f79ae
...
...
@@ -430,6 +430,11 @@ export class Xim {
this
.
on
(
"msg"
,
action
);
vue
.
$once
(
"hook:beforeDestroy"
,
()
=>
this
.
off
(
"msg"
,
action
));
}
public
withDrawMsgHandle
(
e
:
Message
)
{
const
ids
=
e
.
ref_id
?
[
e
.
ref_id
]
:
e
.
msg
.
startsWith
(
"["
)
?
JSON
.
parse
(
e
.
msg
)
:
[
+
e
.
msg
];
return
ids
;
}
}
const
ximInstance
=
new
Xim
();
...
...
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