fix[订单服务]:退款逻辑优化,素材逻辑优化,后台页面管理优化
This commit is contained in:
@@ -9,38 +9,38 @@
|
||||
export default {
|
||||
dev: {
|
||||
'/api-uaa/': {
|
||||
target: 'http://119.45.169.13:9900',
|
||||
// target: 'http://127.0.0.1:9900',
|
||||
// target: 'http://119.45.169.13:9900',
|
||||
target: 'http://127.0.0.1:9900',
|
||||
changeOrigin: true,
|
||||
},
|
||||
'/api-user/': {
|
||||
// target: 'http://127.0.0.1:9900',
|
||||
target: 'http://119.45.169.13:9900',
|
||||
target: 'http://127.0.0.1:9900',
|
||||
// target: 'http://119.45.169.13:9900',
|
||||
changeOrigin: true,
|
||||
},
|
||||
'/api-log/': {
|
||||
// target: 'http://127.0.0.1:9900',
|
||||
target: 'http://119.45.169.13:9900',
|
||||
target: 'http://127.0.0.1:9900',
|
||||
// target: 'http://119.45.169.13:9900',
|
||||
changeOrigin: true,
|
||||
},
|
||||
'/api-search/': {
|
||||
// target: 'http://127.0.0.1:9900',
|
||||
target: 'http://119.45.169.13:9900',
|
||||
target: 'http://127.0.0.1:9900',
|
||||
// target: 'http://119.45.169.13:9900',
|
||||
changeOrigin: true,
|
||||
},
|
||||
'/api-generator/': {
|
||||
// target: 'http://127.0.0.1:9900',
|
||||
target: 'http://119.45.169.13:9900',
|
||||
target: 'http://127.0.0.1:9900',
|
||||
// target: 'http://119.45.169.13:9900',
|
||||
changeOrigin: true,
|
||||
},
|
||||
'/api-file/': {
|
||||
// target: 'http://127.0.0.1:9900',
|
||||
target: 'http://119.45.169.13:9900',
|
||||
target: 'http://127.0.0.1:9900',
|
||||
// target: 'http://119.45.169.13:9900',
|
||||
changeOrigin: true,
|
||||
},
|
||||
'/api-order/': {
|
||||
// target: 'http://127.0.0.1:9900',
|
||||
target: 'http://119.45.169.13:9900',
|
||||
target: 'http://127.0.0.1:9900',
|
||||
// target: 'http://119.45.169.13:9900',
|
||||
changeOrigin: true,
|
||||
},
|
||||
},
|
||||
|
||||
@@ -73,6 +73,10 @@
|
||||
{
|
||||
path: '/orders/homeCarousel.html',
|
||||
component: './orders/HomeCarousel',
|
||||
},
|
||||
{
|
||||
path: '/orders/refund.html',
|
||||
component: './orders/Refund',
|
||||
}
|
||||
],
|
||||
},
|
||||
|
||||
@@ -10,7 +10,7 @@ import {
|
||||
ProTable,
|
||||
QueryFilter,
|
||||
} from '@ant-design/pro-components';
|
||||
import { Typography, Popconfirm, Space, message, Image, Button } from 'antd';
|
||||
import { Typography, Popconfirm, Space, message, Image, Button, Tag } from 'antd';
|
||||
import React, { useRef, useState } from 'react';
|
||||
import UpdateForm from './components/UpdateForm';
|
||||
|
||||
@@ -73,6 +73,20 @@ const handleDelete = async (qrcode: ORDERS.Qrcode) => {
|
||||
}
|
||||
};
|
||||
|
||||
// 状态颜色映射
|
||||
const statusColorMap = {
|
||||
0: { color: 'green', text: '启用' },
|
||||
1: { color: 'red', text: '未启用' },
|
||||
|
||||
|
||||
};
|
||||
|
||||
// 渲染状态标签
|
||||
const renderStatus = (status: {} | null | undefined) => {
|
||||
const statusInfo = statusColorMap[status] || { color: 'gray', text: '未知状态' };
|
||||
return <Tag color={statusInfo.color}>{statusInfo.text}</Tag>;
|
||||
};
|
||||
|
||||
const TableList: React.FC = () => {
|
||||
const actionRef = useRef<ActionType>();
|
||||
const [params, setParams] = useState<Record<string, string | number>>({ });
|
||||
@@ -112,6 +126,7 @@ const TableList: React.FC = () => {
|
||||
{
|
||||
title: '状态',
|
||||
dataIndex: 'status',
|
||||
render: (status) => renderStatus(status),
|
||||
},
|
||||
{
|
||||
title: '创建时间',
|
||||
|
||||
@@ -0,0 +1,69 @@
|
||||
import {
|
||||
ModalForm,
|
||||
ProForm,
|
||||
ProFormText,
|
||||
} from '@ant-design/pro-components';
|
||||
import { Form } from 'antd';
|
||||
|
||||
export type FormValueType = Partial<ORDERS.Tourism>;
|
||||
|
||||
export type UpdateFormProps = {
|
||||
onVisibleChange: (flag: boolean) => void;
|
||||
onSubmit: (values: FormValueType) => Promise<void>;
|
||||
updateModalVisible: boolean;
|
||||
values?: ORDERS.Tourism;
|
||||
};
|
||||
|
||||
const UpdateForm: React.FC<UpdateFormProps> = (props) => {
|
||||
const [form] = Form.useForm();
|
||||
return (
|
||||
<ModalForm
|
||||
title="修改景区"
|
||||
form={form}
|
||||
visible={props.updateModalVisible}
|
||||
onFinish={props.onSubmit}
|
||||
onVisibleChange={props.onVisibleChange}
|
||||
>
|
||||
<ProForm.Group>
|
||||
<ProFormText
|
||||
rules={[
|
||||
{
|
||||
required: true,
|
||||
message: '名称不为空',
|
||||
},
|
||||
]}
|
||||
width="md"
|
||||
name="tourismName"
|
||||
label="名称"
|
||||
placeholder="输入名称"
|
||||
/>
|
||||
<ProFormText
|
||||
rules={[
|
||||
{
|
||||
required: true,
|
||||
message: '地址不为空',
|
||||
},
|
||||
]}
|
||||
width="md"
|
||||
name="tourismAddress"
|
||||
label="地址"
|
||||
placeholder="输入地址"
|
||||
/>
|
||||
<ProFormText
|
||||
rules={[
|
||||
{
|
||||
required: true,
|
||||
message: '手机号不为空',
|
||||
},
|
||||
]}
|
||||
width="md"
|
||||
name="tourismPhone"
|
||||
label="手机号"
|
||||
placeholder="输入手机号"
|
||||
/>
|
||||
</ProForm.Group>
|
||||
</ModalForm>
|
||||
);
|
||||
};
|
||||
|
||||
export default UpdateForm;
|
||||
@@ -1,4 +1,4 @@
|
||||
import { order } from '@/services/orders/api';
|
||||
import { refund } from '@/services/orders/api';
|
||||
import type { ActionType, ProColumns } from '@ant-design/pro-components';
|
||||
import {
|
||||
PageContainer,
|
||||
@@ -32,10 +32,18 @@ const { Link } = Typography;
|
||||
|
||||
// 状态颜色映射
|
||||
const statusColorMap = {
|
||||
0: { color: 'yellow', text: '待处理' },
|
||||
1: { color: 'orange', text: '待处理' },
|
||||
3: { color: 'green', text: '已完成' },
|
||||
2: { color: 'red', text: '已取消' },
|
||||
7: { color: 'yellow', text: '退款申请中' },
|
||||
8: { color: 'green', text: '已退款' },
|
||||
9: { color: 'red', text: '退款失败' },
|
||||
|
||||
};
|
||||
|
||||
// 状态颜色映射
|
||||
const stateColorMap = {
|
||||
0: { color: 'yellow', text: '待审核' },
|
||||
1: { color: 'green', text: '已通过' },
|
||||
2: { color: 'red', text: '已拒绝' },
|
||||
|
||||
};
|
||||
|
||||
// 渲染状态标签
|
||||
@@ -44,10 +52,16 @@ const renderStatus = (status: {} | null | undefined) => {
|
||||
return <Tag color={statusInfo.color}>{statusInfo.text}</Tag>;
|
||||
};
|
||||
|
||||
// 渲染状态标签
|
||||
const renderState = (state: {} | null | undefined) => {
|
||||
const stateInfo = stateColorMap[state] || { color: 'gray', text: '未知状态' };
|
||||
return <Tag color={stateInfo.color}>{stateInfo.text}</Tag>;
|
||||
};
|
||||
|
||||
const TableList: React.FC = () => {
|
||||
const actionRef = useRef<ActionType>();
|
||||
const [params, setParams] = useState<Record<string, string | number>>({ });
|
||||
const columns: ProColumns<ORDERS.Order>[] = [
|
||||
const columns: ProColumns<ORDERS.Refund>[] = [
|
||||
{
|
||||
dataIndex: 'index',
|
||||
valueType: 'indexBorder',
|
||||
@@ -61,10 +75,23 @@ const TableList: React.FC = () => {
|
||||
dataIndex: 'refundNo',
|
||||
},
|
||||
{
|
||||
title: '状态',
|
||||
title: '订单金额',
|
||||
dataIndex: 'orderAmount',
|
||||
},
|
||||
{
|
||||
title: '退款金额',
|
||||
dataIndex: 'refundAmount',
|
||||
},
|
||||
{
|
||||
title: '订单状态',
|
||||
dataIndex: 'status',
|
||||
render: (status) => renderStatus(status),
|
||||
},
|
||||
{
|
||||
title: '退款状态',
|
||||
dataIndex: 'state',
|
||||
render: (state) => renderState(state),
|
||||
},
|
||||
{
|
||||
title: '创建时间',
|
||||
dataIndex: 'createTime',
|
||||
@@ -84,7 +111,7 @@ const TableList: React.FC = () => {
|
||||
// }
|
||||
}}
|
||||
>
|
||||
<Link>删除</Link>
|
||||
<Link>审核</Link>
|
||||
</Popconfirm>,
|
||||
},
|
||||
];
|
||||
@@ -100,10 +127,10 @@ const TableList: React.FC = () => {
|
||||
>
|
||||
<ProFormText name="name" label="搜索" placeholder="输入关键字" />
|
||||
</QueryFilter>
|
||||
<ProTable<ORDERS.Order>
|
||||
<ProTable<ORDERS.Refund>
|
||||
rowKey="id"
|
||||
headerTitle="任务列表"
|
||||
request={order}
|
||||
request={refund}
|
||||
actionRef={actionRef}
|
||||
columns={columns}
|
||||
search={false}
|
||||
|
||||
@@ -11,7 +11,7 @@ import {
|
||||
ProTable,
|
||||
QueryFilter,
|
||||
} from '@ant-design/pro-components';
|
||||
import { Typography, Popconfirm, Space, message, Image, Button } from 'antd';
|
||||
import { Typography, Popconfirm, Space, message, Image, Button, Tag } from 'antd';
|
||||
import React, { useRef, useState } from 'react';
|
||||
import UpdateForm from './components/UpdateForm';
|
||||
import Upload, { RcFile } from 'antd/lib/upload';
|
||||
@@ -92,6 +92,36 @@ const handleImport = async (file: RcFile) => {
|
||||
}
|
||||
};
|
||||
|
||||
// 状态颜色映射
|
||||
const statusColorMap = {
|
||||
0: { color: 'green', text: '启用' },
|
||||
1: { color: 'red', text: '未启用' },
|
||||
|
||||
|
||||
};
|
||||
|
||||
// 渲染状态标签
|
||||
const renderStatus = (status: {} | null | undefined) => {
|
||||
const statusInfo = statusColorMap[status] || { color: 'gray', text: '未知状态' };
|
||||
return <Tag color={statusInfo.color}>{statusInfo.text}</Tag>;
|
||||
};
|
||||
|
||||
// 状态颜色映射
|
||||
const typeColorMap = {
|
||||
0: { color: 'yellow', text: '待审核' },
|
||||
1: { color: 'green', text: '活动' },
|
||||
2: { color: 'green', text: '拍照角度' },
|
||||
3: { color: 'green', text: '引导' },
|
||||
4: { color: 'green', text: '大图' },
|
||||
};
|
||||
|
||||
// 渲染状态标签
|
||||
const renderType = (type: {} | null | undefined) => {
|
||||
const typeInfo = typeColorMap[type] || { color: 'gray', text: '未知状态' };
|
||||
return <Tag color={typeInfo.color}>{typeInfo.text}</Tag>;
|
||||
};
|
||||
|
||||
|
||||
const TableList: React.FC = () => {
|
||||
const actionRef = useRef<ActionType>();
|
||||
const [params, setParams] = useState<Record<string, string | number>>({ });
|
||||
@@ -127,6 +157,12 @@ const TableList: React.FC = () => {
|
||||
{
|
||||
title: '状态',
|
||||
dataIndex: 'status',
|
||||
render: (status) => renderStatus(status),
|
||||
},
|
||||
{
|
||||
title: "类型",
|
||||
dataIndex: 'type',
|
||||
render: (type) => renderType(type)
|
||||
},
|
||||
{
|
||||
title: '创建时间',
|
||||
|
||||
@@ -84,6 +84,8 @@ declare namespace ORDERS {
|
||||
id: number;
|
||||
orderNo: string;
|
||||
refundNo: string;
|
||||
orderAmount: string;
|
||||
refundAmount: string;
|
||||
status: number;
|
||||
state: number;
|
||||
approveReason: string;
|
||||
|
||||
Reference in New Issue
Block a user