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
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
47 additions
and
7 deletions
model/order.ts
service/order.ts
model/order.ts
View file @
1af94dfd
...
...
@@ -50,6 +50,18 @@ export interface OrderTableListItem {
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
{
UnPay
=
1
,
Paied
,
...
...
service/order.ts
View file @
1af94dfd
import
Chat
from
"@/customer-service/xim"
;
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"
;
class
OrderService
{
export
const
generalOrder
=
'general_order_info'
;
export
const
generalOrderPaymentModel
=
'general_order_payment_info'
;
public
generalOrder
=
'general_order_info'
;
public
generalOrderPaymentModel
=
'general_order_payment_info'
;
export
function
openOrder
(
params
:
{
private
handler
=
new
UniplatSdkExtender
();
public
openOrder
(
params
:
{
productId
:
number
;
srcPlatform
:
SrcPlatform
;
createdType
:
OperationType
;
title
?:
string
;
})
{
})
{
const
sdk
=
Chat
.
getSdk
();
return
sdk
.
model
(
generalOrder
).
action
(
'addOrder'
).
addInputs_parameter
({
return
sdk
.
model
(
this
.
generalOrder
).
action
(
'addOrder'
).
addInputs_parameter
({
ProductId
:
params
.
productId
,
SrcPlatform
:
params
.
srcPlatform
,
CreatedType
:
params
.
createdType
}).
execute
().
then
(
r
=>
{
return
store
.
dispatch
(
`
${
ChatStore
.
ns
}
/
${
ChatStore
.
ACTION_CREATE_NEW_CHAT_BY_CLIENT
}
`
,
{
modelName
:
generalOrder
,
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