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
9746ca16
authored
Dec 01, 2021
by
杨铁龙
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
格式化
parent
1d0f22a4
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
51 additions
and
36 deletions
model/order.ts
service/order.ts
model/order.ts
View file @
9746ca16
...
...
@@ -12,7 +12,7 @@ export const enum OrderStatus {
Failed
,
UserCancelled
,
AdminCancelled
,
Deleted
Deleted
,
}
export
const
statusMapping
=
new
Map
<
OrderStatus
,
string
>
([
...
...
@@ -51,16 +51,16 @@ export interface OrderTableListItem {
}
export
const
orderTableListItemPredict
=
{
id
:
'ID'
,
title
:
'ProductId#product.OuterName'
,
status
:
'Status'
,
time
:
'CreatedDate'
,
PayAmount
:
'PayAmount'
,
PaidAmount
:
'PaidAmount'
,
RefundAmount
:
'RefundAmount'
,
RefundedAmount
:
'RefundedAmount'
,
chat
:
'UniplatImChatId'
}
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
,
...
...
@@ -68,7 +68,7 @@ export const enum PayStatus {
Cancel
,
Deleted
,
WaitRefund
,
Refund
Refund
,
}
export
const
payStatusMapping
=
new
Map
<
PayStatus
,
string
>
([
...
...
@@ -84,8 +84,8 @@ export const enum PayMethod {
CardTransfer
=
1
,
Balance
,
Refund2Card
,
Refund2Balance
}
;
Refund2Balance
,
}
export
const
payMethodMapping
=
new
Map
<
PayMethod
,
string
>
([
[
PayMethod
.
CardTransfer
,
"银行卡转账"
],
...
...
@@ -103,7 +103,6 @@ export interface OrderPayItem {
status
:
PayStatus
;
}
export
const
enum
ChatOpenDirection
{
/**
* 通知外壳,打开一个新的Webview容器打开会话
...
...
@@ -112,7 +111,7 @@ export const enum ChatOpenDirection {
/**
* 直接会用当前Webview,跳转到聊天页面
*/
Current
Current
,
}
export
const
enum
SrcPlatform
{
...
...
@@ -120,12 +119,12 @@ export const enum SrcPlatform {
Website
,
H5
,
OtherApp
,
QqxbApp
QqxbApp
,
}
export
const
enum
OperationType
{
User
=
1
,
Backend
Backend
,
}
export
interface
OrderRowItem
{
...
...
service/order.ts
View file @
9746ca16
import
Chat
from
"@/customer-service/xim"
;
import
{
UniplatSdkExtender
}
from
"uniplat-sdk"
;
import
{
OperationType
,
OrderStatus
,
OrderTableListItem
,
orderTableListItemPredict
,
SrcPlatform
}
from
"../model"
;
import
{
OperationType
,
OrderStatus
,
OrderTableListItem
,
orderTableListItemPredict
,
SrcPlatform
,
}
from
"../model"
;
class
OrderService
{
public
generalOrder
=
'general_order_info'
;
public
generalOrderPaymentModel
=
'general_order_payment_info'
;
public
generalOrder
=
"general_order_info"
;
public
generalOrderPaymentModel
=
"general_order_payment_info"
;
private
handler
=
new
UniplatSdkExtender
();
...
...
@@ -15,33 +19,45 @@ class OrderService {
createdType
:
OperationType
;
})
{
const
sdk
=
Chat
.
getSdk
();
return
sdk
.
model
(
this
.
generalOrder
).
action
(
'addOrder'
).
addInputs_parameter
({
return
sdk
.
model
(
this
.
generalOrder
)
.
action
(
"addOrder"
)
.
addInputs_parameter
({
ProductId
:
params
.
productId
,
SrcPlatform
:
params
.
srcPlatform
,
CreatedType
:
params
.
createdType
}).
execute
();
CreatedType
:
params
.
createdType
,
})
.
execute
();
}
public
updateOrderStatus
(
id
:
number
|
string
,
v
:
number
,
status
:
OrderStatus
)
{
return
Chat
.
getSdk
().
model
(
this
.
generalOrder
).
action
(
'editStatus'
)
public
updateOrderStatus
(
id
:
number
|
string
,
v
:
number
,
status
:
OrderStatus
)
{
return
Chat
.
getSdk
()
.
model
(
this
.
generalOrder
)
.
action
(
"editStatus"
)
.
addInputs_parameter
({
Status
:
status
,
userType
:
OperationType
.
User
userType
:
OperationType
.
User
,
})
.
updateInitialParams
({
selected_list
:
[{
v
,
id
:
+
id
}]
})
.
execute
()
.
execute
()
;
}
public
getOrders
(
index
:
number
)
{
return
Chat
.
getSdk
().
model
(
this
.
generalOrder
)
.
list
(
'userOrderList'
)
return
Chat
.
getSdk
()
.
model
(
this
.
generalOrder
)
.
list
(
"userOrderList"
)
.
query
({
item_size
:
100
,
pageIndex
:
index
})
.
then
(
r
=>
this
.
handler
.
buildRows
<
OrderTableListItem
>
(
r
.
pageData
.
rows
,
orderTableListItemPredict
));
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