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
da86f14d
authored
Dec 30, 2021
by
zhousil
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
withdraw
parent
06f2486e
Show 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 @
da86f14d
...
@@ -50,6 +50,7 @@
...
@@ -50,6 +50,7 @@
import
{
dbController
}
from
"../database"
;
import
{
dbController
}
from
"../database"
;
import
{
getLastMessageId
}
from
"../store"
;
import
{
getLastMessageId
}
from
"../store"
;
import
{
CustomerServiceEvent
}
from
"../event"
;
import
{
CustomerServiceEvent
}
from
"../event"
;
import
xim
from
"../xim/xim"
;
@
Component
({
components
:
{
message
,
ImagePreview
,
VideoPreview
}
})
@
Component
({
components
:
{
message
,
ImagePreview
,
VideoPreview
}
})
export
default
class
MessageList
extends
Vue
{
export
default
class
MessageList
extends
Vue
{
...
@@ -192,7 +193,7 @@
...
@@ -192,7 +193,7 @@
this
.
handleScrollWrapper
();
this
.
handleScrollWrapper
();
this
.
onNewMessage
((
e
)
=>
{
this
.
onNewMessage
((
e
)
=>
{
if
(
e
.
type
===
MessageType
.
Withdraw
)
{
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
);
this
.
executeWithDraw
(
ids
);
dbController
dbController
.
removeMessage
(
e
.
chat_id
,
ids
)
.
removeMessage
(
e
.
chat_id
,
ids
)
...
...
service/order.ts
View file @
da86f14d
...
@@ -10,6 +10,7 @@ import {
...
@@ -10,6 +10,7 @@ import {
UploadImageItem
,
UploadImageItem
,
orderPayItemPredict
,
orderPayItemPredict
,
OrderComment
,
OrderComment
,
PayStatus
}
from
"../model"
;
}
from
"../model"
;
import
{
GeneralOrderDirection
}
from
"../model/order-product"
;
import
{
GeneralOrderDirection
}
from
"../model/order-product"
;
...
@@ -133,11 +134,12 @@ class OrderService {
...
@@ -133,11 +134,12 @@ class OrderService {
.
query
({
pageIndex
:
1
,
item_size
:
100
})
.
query
({
pageIndex
:
1
,
item_size
:
100
})
.
then
((
r
)
=>
{
.
then
((
r
)
=>
{
if
(
r
&&
r
.
pageData
&&
r
.
pageData
.
rows
)
{
if
(
r
&&
r
.
pageData
&&
r
.
pageData
.
rows
)
{
cons
t
items
=
this
.
handler
.
buildRows
<
OrderPayItem
>
(
le
t
items
=
this
.
handler
.
buildRows
<
OrderPayItem
>
(
r
.
pageData
.
rows
,
r
.
pageData
.
rows
,
orderPayItemPredict
orderPayItemPredict
);
);
items
=
items
.
filter
(
i
=>
i
.
status
!==
PayStatus
.
Deleted
&&
i
.
status
!==
PayStatus
.
Cancel
)
if
(
withActions
)
{
if
(
withActions
)
{
for
(
let
i
=
0
;
i
<
r
.
pageData
.
rows
.
length
;
i
++
)
{
for
(
let
i
=
0
;
i
<
r
.
pageData
.
rows
.
length
;
i
++
)
{
items
[
i
].
actions
=
r
.
pageData
.
rows
[
i
].
actions
;
items
[
i
].
actions
=
r
.
pageData
.
rows
[
i
].
actions
;
...
...
store/index.ts
View file @
da86f14d
...
@@ -765,7 +765,7 @@ export default {
...
@@ -765,7 +765,7 @@ export default {
if
(
e
.
type
===
MessageType
.
Withdraw
)
{
if
(
e
.
type
===
MessageType
.
Withdraw
)
{
commit
(
commit
(
ChatStore
.
MUTATION_WITHDRAW
,
ChatStore
.
MUTATION_WITHDRAW
,
e
.
msg
.
startsWith
(
"["
)
?
JSON
.
parse
(
e
.
msg
)
:
[
+
e
.
msg
]
xim
.
withDrawMsgHandle
(
e
)
);
);
}
}
const
scroll
=
()
=>
const
scroll
=
()
=>
...
@@ -782,7 +782,7 @@ export default {
...
@@ -782,7 +782,7 @@ export default {
dbController
dbController
.
removeMessage
(
.
removeMessage
(
e
.
chat_id
,
e
.
chat_id
,
e
.
msg
.
startsWith
(
"["
)
?
JSON
.
parse
(
e
.
msg
)
:
[
+
e
.
msg
]
xim
.
withDrawMsgHandle
(
e
)
)
)
.
finally
(()
=>
thenAction
());
.
finally
(()
=>
thenAction
());
}
else
{
}
else
{
...
...
xim/xim.ts
View file @
da86f14d
...
@@ -430,6 +430,11 @@ export class Xim {
...
@@ -430,6 +430,11 @@ export class Xim {
this
.
on
(
"msg"
,
action
);
this
.
on
(
"msg"
,
action
);
vue
.
$once
(
"hook:beforeDestroy"
,
()
=>
this
.
off
(
"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
();
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