Commit bc2aa9eb by Sixong.Zhu

u

parent 1d0f22a4
Showing with 38 additions and 21 deletions
import Chat from "@/customer-service/xim";
import { UniplatSdkExtender } from "uniplat-sdk";
import { OperationType, OrderStatus, OrderTableListItem, orderTableListItemPredict, SrcPlatform } from "../model";
class OrderService {
public generalOrder = 'general_order_info';
public generalOrderPaymentModel = 'general_order_payment_info';
import {
OperationType,
OrderStatus,
OrderTableListItem,
orderTableListItemPredict,
SrcPlatform,
} from "../model";
class OrderService {
public generalOrder = "general_order_info";
public generalOrderPaymentModel = "general_order_payment_info";
private handler = new UniplatSdkExtender();
......@@ -15,33 +20,45 @@ class OrderService {
createdType: OperationType;
}) {
const sdk = Chat.getSdk();
return sdk.model(this.generalOrder).action('addOrder').addInputs_parameter({
ProductId: params.productId,
SrcPlatform: params.srcPlatform,
CreatedType: params.createdType
}).execute();
return sdk
.model(this.generalOrder)
.action("addOrder")
.addInputs_parameter({
ProductId: params.productId,
SrcPlatform: params.srcPlatform,
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));
.then((r) =>
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