Commit ffb56bb7 by 杨铁龙

专项订单迁移到customer-service

parent 9904992d
import type { UniplatSdk } from "uniplat-sdk";
export * from "./order"
export const enum ChatRole {
Default = 25,
......
import { Chat } from "../xim/models/chat";
export interface ChatGroup extends Chat {
children?: ChatGroup[];
}
export const enum OrderStatus {
None,
Waiting,
Progressing,
Finished,
Failed,
UserCancelled,
AdminCancelled,
Deleted
}
export const statusMapping = new Map<OrderStatus, string>([
[OrderStatus.None, ""],
[OrderStatus.Waiting, "等待处理"],
[OrderStatus.Progressing, "处理中"],
[OrderStatus.Finished, "已完成"],
[OrderStatus.Failed, "处理失败"],
[OrderStatus.UserCancelled, "已取消"],
[OrderStatus.AdminCancelled, "已取消"],
[OrderStatus.Deleted, "已删除"],
]);
export interface OrderTableListItem {
id: string;
title: string;
time: string;
chat: number;
status: OrderStatus;
/**
* 待支付金额
*/
PayAmount: number;
/**
* 已支付金额
*/
PaidAmount: number;
/**
* 待退款金额
*/
RefundAmount: number;
/**
* 已退款金额
*/
RefundedAmount: number;
}
export const enum PayStatus {
UnPay = 1,
Paied,
Cancel,
Deleted,
WaitRefund,
Refund
}
export const payStatusMapping = new Map<PayStatus, string>([
[PayStatus.UnPay, "待支付"],
[PayStatus.Paied, "已支付"],
[PayStatus.Cancel, "已取消"],
[PayStatus.Deleted, "已删除"],
[PayStatus.WaitRefund, "待退费"],
[PayStatus.Refund, "已退费"],
]);
export const enum PayMethod {
CardTransfer = 1,
Balance,
Refund2Card,
Refund2Balance
};
export const payMethodMapping = new Map<PayMethod, string>([
[PayMethod.CardTransfer, "银行卡转账"],
[PayMethod.Balance, "余额扣费"],
[PayMethod.Refund2Card, "退款至银行卡"],
[PayMethod.Refund2Balance, "退款至余额"],
]);
export interface OrderPayItem {
id: number;
title: string;
time?: string;
deadLine?: string;
value: number;
status: PayStatus;
}
export const enum ChatOpenDirection {
/**
* 通知外壳,打开一个新的Webview容器打开会话
*/
NewWebview,
/**
* 直接会用当前Webview,跳转到聊天页面
*/
Current
}
export const enum SrcPlatform {
Backend = 1,
Website,
H5,
OtherApp,
QqxbApp
}
export const enum OperationType {
User = 1,
Backend
}
export interface OrderRowItem {
status: OrderStatus;
no: string;
createTime: string;
v: string;
id: string;
}
\ No newline at end of file
import Chat from "@/customer-service/xim";
import store from "@/store";
import { OperationType, SrcPlatform } from "../model";
import { ChatStore } from "../store/model";
export const generalOrder = 'general_order_info';
export const generalOrderPaymentModel = 'general_order_payment_info';
export function openOrder(params: {
productId: number;
srcPlatform: SrcPlatform;
createdType: OperationType;
title?: string;
}) {
const sdk = Chat.getSdk();
return sdk.model(generalOrder).action('addOrder').addInputs_parameter({
ProductId: params.productId,
SrcPlatform: params.srcPlatform,
CreatedType: params.createdType
}).execute().then(r => {
return store.dispatch(`${ChatStore.ns}/${ChatStore.ACTION_CREATE_NEW_CHAT_BY_CLIENT}`, {
modelName: generalOrder,
selectedListId: r.id,
title: params.title
});
});
}
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