Commit 9746ca16 by 杨铁龙

格式化

parent 1d0f22a4
Showing with 51 additions and 36 deletions
......@@ -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 {
......
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();
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment