feat: order success bak
parent
ec25294f27
commit
8e0790a219
|
@ -1,6 +1,7 @@
|
|||
import { getUserByIdAPI } from '@/services/system/user';
|
||||
import { UxOrderStatus, UxOrderStatusTag } from '@/utils/const';
|
||||
import { OrderPayType, OrderPayTypeStr, UxOrderStatus, UxOrderStatusTag } from '@/utils/const';
|
||||
import { formatDateTime } from '@/utils/format';
|
||||
import { AlipayCircleOutlined, WechatOutlined } from '@ant-design/icons';
|
||||
import { ActionType } from '@ant-design/pro-components';
|
||||
import { Descriptions, Empty, Form, Modal, Spin, Table, Tabs } from 'antd';
|
||||
import { useEffect, useState } from 'react';
|
||||
|
@ -141,12 +142,20 @@ const UserDetailsModal = (props: PropTypes) => {
|
|||
align: 'center',
|
||||
render: (_, record: Order.OrderItem) => {
|
||||
// 支付类型 1. 微信 2. 支付宝 3. paypal -1: 后台创建
|
||||
if (record.payType === 1) {
|
||||
return '微信';
|
||||
} else if (record.payType === 2) {
|
||||
return '支付宝';
|
||||
} else if (record.payType === 3) {
|
||||
return 'paypal';
|
||||
if ([OrderPayType.WX, OrderPayType.ZFB].includes(record.payType)) {
|
||||
return (
|
||||
<div className="flex justify-center items-center">
|
||||
{record.payType === OrderPayType.WX ? (
|
||||
<WechatOutlined color="green" style={{ fontSize: '18px' }} />
|
||||
) : (
|
||||
<AlipayCircleOutlined color="blue" style={{ fontSize: '18px' }} />
|
||||
)}
|
||||
<span className="ml-1">{Reflect.get(OrderPayTypeStr, record.payType)}</span>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
if (record.payType === OrderPayType.PAYPAL) {
|
||||
return Reflect.get(OrderPayTypeStr, OrderPayType.PAYPAL);
|
||||
}
|
||||
return '后台创建';
|
||||
},
|
||||
|
|
|
@ -14,3 +14,24 @@ export const UxOrderStatusTag: Record<number, string> = {
|
|||
4: '#e74c3c', // 红色
|
||||
5: '订单超时支付(二维码过期)', //
|
||||
};
|
||||
|
||||
// 1: 待支付 2. 已支付 3. 订单取消 4. 支付失败 5. 订单超时支付(二维码过期)
|
||||
export enum OrderStatus {
|
||||
NO_PAY = 1,
|
||||
HAVE_PAY = 2,
|
||||
ORDER_CANCEL = 3,
|
||||
PAY_ERROR = 4,
|
||||
PAY_TIMEOUT = 5,
|
||||
}
|
||||
|
||||
export enum OrderPayType {
|
||||
WX = 1,
|
||||
ZFB = 2,
|
||||
PAYPAL = 3,
|
||||
}
|
||||
|
||||
export const OrderPayTypeStr = {
|
||||
1: '微信',
|
||||
2: '支付宝',
|
||||
3: 'PayPal',
|
||||
};
|
||||
|
|
Loading…
Reference in New Issue