Commit 12cfe2d1 by Sixong.Zhu

u

parent a2dcf20b
Showing with 18 additions and 9 deletions
import Chat from "@/customer-service/xim";
import { metaRow, UniplatSdkExtender } from "uniplat-sdk";
import { metaRow, UniplatSdkExtender, UniplatSdk } from "uniplat-sdk";
import {
OperationType,
OrderStatus,
......@@ -17,14 +17,23 @@ class OrderService {
public readonly generalOrderPaymentModel = "general_order_payment_info";
private readonly handler = new UniplatSdkExtender();
private innerSdk: UniplatSdk | null = null;
public injectSdk(sdk: UniplatSdk) {
this.innerSdk = sdk;
return this;
}
private getSdk() {
return this.innerSdk || Chat.getSdk();
}
public openOrder(params: {
productId: string | number;
srcPlatform: SrcPlatform;
createdType: OperationType;
}) {
const sdk = Chat.getSdk();
return sdk
return this.getSdk()
.model(this.generalOrder)
.action("addOrder")
.addInputs_parameter({
......@@ -40,7 +49,7 @@ class OrderService {
v: number,
status: OrderStatus
) {
return Chat.getSdk()
return this.getSdk()
.model(this.generalOrder)
.action("editStatus")
.addInputs_parameter({
......@@ -52,7 +61,7 @@ class OrderService {
}
public getOrders(index: number) {
return Chat.getSdk()
return this.getSdk()
.model(this.generalOrder)
.list("userOrderList")
.query({ item_size: 100, pageIndex: index })
......@@ -65,7 +74,7 @@ class OrderService {
}
public getPayments(id: number) {
return Chat.getSdk()
return this.getSdk()
.model(orderService.generalOrderPaymentModel)
.list()
.addPrefilter({ OrderId: id })
......@@ -90,7 +99,7 @@ class OrderService {
}
public getPayment(id: string | number) {
return Chat.getSdk()
return this.getSdk()
.model(orderService.generalOrderPaymentModel)
.detail(id as string, "userOrderPaymentDetail")
.query()
......@@ -110,7 +119,7 @@ class OrderService {
}
public addImage4Payment(payment: number | string, v: number, path: string) {
return Chat.getSdk()
return this.getSdk()
.model(orderService.generalOrderPaymentModel)
.action("addImages")
.updateInitialParams({ selected_list: [{ v, id: payment as number }] })
......@@ -119,7 +128,7 @@ class OrderService {
}
public getImages4Payment(payment: number) {
return Chat.getSdk()
return this.getSdk()
.model("general_order_payment_file_info")
.list()
.addPrefilter({ PaymentId: payment })
......
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