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
1af94dfd
authored
Dec 01, 2021
by
杨铁龙
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
专项订单提取
parent
d64555ed
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
61 additions
and
21 deletions
model/order.ts
service/order.ts
model/order.ts
View file @
1af94dfd
...
@@ -50,6 +50,18 @@ export interface OrderTableListItem {
...
@@ -50,6 +50,18 @@ export interface OrderTableListItem {
RefundedAmount
:
number
;
RefundedAmount
:
number
;
}
}
export
const
orderTableListItemPredict
=
{
id
:
'ID'
,
title
:
'ProductId#product.OuterName'
,
status
:
'Status'
,
time
:
'CreatedDate'
,
PayAmount
:
'PayAmount'
,
PaidAmount
:
'PaidAmount'
,
RefundAmount
:
'RefundAmount'
,
RefundedAmount
:
'RefundedAmount'
,
chat
:
'UniplatImChatId'
}
export
const
enum
PayStatus
{
export
const
enum
PayStatus
{
UnPay
=
1
,
UnPay
=
1
,
Paied
,
Paied
,
...
...
service/order.ts
View file @
1af94dfd
import
Chat
from
"@/customer-service/xim"
;
import
Chat
from
"@/customer-service/xim"
;
import
store
from
"@/store"
;
import
store
from
"@/store"
;
import
{
OperationType
,
SrcPlatform
}
from
"../model"
;
import
{
metaRow
,
UniplatSdkExtender
}
from
"uniplat-sdk"
;
import
{
OperationType
,
OrderRowItem
,
OrderStatus
,
OrderTableListItem
,
orderTableListItemPredict
,
SrcPlatform
}
from
"../model"
;
import
{
ChatStore
}
from
"../store/model"
;
import
{
ChatStore
}
from
"../store/model"
;
class
OrderService
{
export
const
generalOrder
=
'general_order_info'
;
public
generalOrder
=
'general_order_info'
;
export
const
generalOrderPaymentModel
=
'general_order_payment_info'
;
public
generalOrderPaymentModel
=
'general_order_payment_info'
;
export
function
openOrder
(
params
:
{
productId
:
number
;
private
handler
=
new
UniplatSdkExtender
();
srcPlatform
:
SrcPlatform
;
createdType
:
OperationType
;
public
openOrder
(
params
:
{
title
?:
string
;
productId
:
number
;
})
{
srcPlatform
:
SrcPlatform
;
const
sdk
=
Chat
.
getSdk
();
createdType
:
OperationType
;
return
sdk
.
model
(
generalOrder
).
action
(
'addOrder'
).
addInputs_parameter
({
title
?:
string
;
ProductId
:
params
.
productId
,
})
{
SrcPlatform
:
params
.
srcPlatform
,
const
sdk
=
Chat
.
getSdk
();
CreatedType
:
params
.
createdType
return
sdk
.
model
(
this
.
generalOrder
).
action
(
'addOrder'
).
addInputs_parameter
({
}).
execute
().
then
(
r
=>
{
ProductId
:
params
.
productId
,
return
store
.
dispatch
(
`
${
ChatStore
.
ns
}
/
${
ChatStore
.
ACTION_CREATE_NEW_CHAT_BY_CLIENT
}
`
,
{
SrcPlatform
:
params
.
srcPlatform
,
modelName
:
generalOrder
,
CreatedType
:
params
.
createdType
selectedListId
:
r
.
id
,
}).
execute
().
then
(
r
=>
{
title
:
params
.
title
return
store
.
dispatch
(
`
${
ChatStore
.
ns
}
/
${
ChatStore
.
ACTION_CREATE_NEW_CHAT_BY_CLIENT
}
`
,
{
modelName
:
this
.
generalOrder
,
selectedListId
:
r
.
id
,
title
:
params
.
title
});
});
});
});
}
public
updateOrderStatus
(
id
:
number
|
string
,
v
:
number
,
status
:
OrderStatus
)
{
return
Chat
.
getSdk
().
model
(
this
.
generalOrder
).
action
(
'editStatus'
)
.
addInputs_parameter
({
Status
:
status
,
userType
:
OperationType
.
User
})
.
updateInitialParams
({
selected_list
:
[{
v
,
id
:
+
id
}]
})
.
execute
()
}
public
getOrders
(
index
:
number
)
{
return
Chat
.
getSdk
().
model
(
this
.
generalOrder
)
.
list
(
'userOrderList'
)
.
query
({
item_size
:
100
,
pageIndex
:
index
})
.
then
(
r
=>
this
.
handler
.
buildRows
<
OrderTableListItem
>
(
r
.
pageData
.
rows
,
orderTableListItemPredict
));
}
}
}
export
const
orderService
=
new
OrderService
();
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