Commit bc2aa9eb by Sixong.Zhu

u

parent 1d0f22a4
Showing with 36 additions and 19 deletions
import Chat from "@/customer-service/xim"; import Chat from "@/customer-service/xim";
import { UniplatSdkExtender } from "uniplat-sdk"; import { UniplatSdkExtender } from "uniplat-sdk";
import { OperationType, OrderStatus, OrderTableListItem, orderTableListItemPredict, SrcPlatform } from "../model"; import {
class OrderService { OperationType,
OrderStatus,
public generalOrder = 'general_order_info'; OrderTableListItem,
public generalOrderPaymentModel = 'general_order_payment_info'; orderTableListItemPredict,
SrcPlatform,
} from "../model";
class OrderService {
public generalOrder = "general_order_info";
public generalOrderPaymentModel = "general_order_payment_info";
private handler = new UniplatSdkExtender(); private handler = new UniplatSdkExtender();
...@@ -15,33 +20,45 @@ class OrderService { ...@@ -15,33 +20,45 @@ class OrderService {
createdType: OperationType; createdType: OperationType;
}) { }) {
const sdk = Chat.getSdk(); 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, ProductId: params.productId,
SrcPlatform: params.srcPlatform, SrcPlatform: params.srcPlatform,
CreatedType: params.createdType CreatedType: params.createdType,
}).execute(); })
.execute();
} }
public updateOrderStatus(id: number | string, v: number, status: OrderStatus) { public updateOrderStatus(
return Chat.getSdk().model(this.generalOrder).action('editStatus') id: number | string,
v: number,
status: OrderStatus
) {
return Chat.getSdk()
.model(this.generalOrder)
.action("editStatus")
.addInputs_parameter({ .addInputs_parameter({
Status: status, Status: status,
userType: OperationType.User userType: OperationType.User,
}) })
.updateInitialParams({ selected_list: [{ v, id: +id }] }) .updateInitialParams({ selected_list: [{ v, id: +id }] })
.execute() .execute();
} }
public getOrders(index: number) { public getOrders(index: number) {
return Chat.getSdk().model(this.generalOrder) return Chat.getSdk()
.list('userOrderList') .model(this.generalOrder)
.list("userOrderList")
.query({ item_size: 100, pageIndex: index }) .query({ item_size: 100, pageIndex: index })
.then(r => .then((r) =>
this.handler.buildRows<OrderTableListItem>(r.pageData.rows, orderTableListItemPredict)); this.handler.buildRows<OrderTableListItem>(
r.pageData.rows,
orderTableListItemPredict
)
);
} }
} }
export const orderService = new OrderService(); 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