Commit 9746ca16 by 杨铁龙

格式化

parent 1d0f22a4
Showing with 51 additions and 36 deletions
...@@ -12,7 +12,7 @@ export const enum OrderStatus { ...@@ -12,7 +12,7 @@ export const enum OrderStatus {
Failed, Failed,
UserCancelled, UserCancelled,
AdminCancelled, AdminCancelled,
Deleted Deleted,
} }
export const statusMapping = new Map<OrderStatus, string>([ export const statusMapping = new Map<OrderStatus, string>([
...@@ -51,16 +51,16 @@ export interface OrderTableListItem { ...@@ -51,16 +51,16 @@ export interface OrderTableListItem {
} }
export const orderTableListItemPredict = { export const orderTableListItemPredict = {
id: 'ID', id: "ID",
title: 'ProductId#product.OuterName', title: "ProductId#product.OuterName",
status: 'Status', status: "Status",
time: 'CreatedDate', time: "CreatedDate",
PayAmount: 'PayAmount', PayAmount: "PayAmount",
PaidAmount: 'PaidAmount', PaidAmount: "PaidAmount",
RefundAmount: 'RefundAmount', RefundAmount: "RefundAmount",
RefundedAmount: 'RefundedAmount', RefundedAmount: "RefundedAmount",
chat: 'UniplatImChatId' chat: "UniplatImChatId",
} };
export const enum PayStatus { export const enum PayStatus {
UnPay = 1, UnPay = 1,
...@@ -68,7 +68,7 @@ export const enum PayStatus { ...@@ -68,7 +68,7 @@ export const enum PayStatus {
Cancel, Cancel,
Deleted, Deleted,
WaitRefund, WaitRefund,
Refund Refund,
} }
export const payStatusMapping = new Map<PayStatus, string>([ export const payStatusMapping = new Map<PayStatus, string>([
...@@ -84,8 +84,8 @@ export const enum PayMethod { ...@@ -84,8 +84,8 @@ export const enum PayMethod {
CardTransfer = 1, CardTransfer = 1,
Balance, Balance,
Refund2Card, Refund2Card,
Refund2Balance Refund2Balance,
}; }
export const payMethodMapping = new Map<PayMethod, string>([ export const payMethodMapping = new Map<PayMethod, string>([
[PayMethod.CardTransfer, "银行卡转账"], [PayMethod.CardTransfer, "银行卡转账"],
...@@ -103,7 +103,6 @@ export interface OrderPayItem { ...@@ -103,7 +103,6 @@ export interface OrderPayItem {
status: PayStatus; status: PayStatus;
} }
export const enum ChatOpenDirection { export const enum ChatOpenDirection {
/** /**
* 通知外壳,打开一个新的Webview容器打开会话 * 通知外壳,打开一个新的Webview容器打开会话
...@@ -112,7 +111,7 @@ export const enum ChatOpenDirection { ...@@ -112,7 +111,7 @@ export const enum ChatOpenDirection {
/** /**
* 直接会用当前Webview,跳转到聊天页面 * 直接会用当前Webview,跳转到聊天页面
*/ */
Current Current,
} }
export const enum SrcPlatform { export const enum SrcPlatform {
...@@ -120,12 +119,12 @@ export const enum SrcPlatform { ...@@ -120,12 +119,12 @@ export const enum SrcPlatform {
Website, Website,
H5, H5,
OtherApp, OtherApp,
QqxbApp QqxbApp,
} }
export const enum OperationType { export const enum OperationType {
User = 1, User = 1,
Backend Backend,
} }
export interface OrderRowItem { export interface OrderRowItem {
......
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 {
OperationType,
OrderStatus,
OrderTableListItem,
orderTableListItemPredict,
SrcPlatform,
} from "../model";
class OrderService { class OrderService {
public generalOrder = "general_order_info";
public generalOrder = 'general_order_info'; public generalOrderPaymentModel = "general_order_payment_info";
public generalOrderPaymentModel = 'general_order_payment_info';
private handler = new UniplatSdkExtender(); private handler = new UniplatSdkExtender();
...@@ -15,33 +19,45 @@ class OrderService { ...@@ -15,33 +19,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