fix(web): disable admin and billing mock surfaces
This commit is contained in:
@@ -10,9 +10,6 @@ import {
|
||||
CrownOutlined,
|
||||
UserOutlined,
|
||||
DashboardOutlined,
|
||||
BarChartOutlined,
|
||||
MonitorOutlined,
|
||||
FileTextOutlined,
|
||||
} from '@ant-design/icons';
|
||||
import { useNavigate, useLocation } from 'react-router-dom';
|
||||
import type { MenuProps } from 'antd';
|
||||
@@ -55,39 +52,8 @@ const Sidebar: React.FC<SidebarProps> = ({ collapsed }) => {
|
||||
{
|
||||
key: '/admin',
|
||||
icon: <DashboardOutlined />,
|
||||
label: 'Admin',
|
||||
children: [
|
||||
{
|
||||
key: '/admin',
|
||||
icon: <DashboardOutlined />,
|
||||
label: 'Dashboard',
|
||||
onClick: () => navigate('/admin'),
|
||||
},
|
||||
{
|
||||
key: '/admin/users',
|
||||
icon: <TeamOutlined />,
|
||||
label: '用户管理',
|
||||
onClick: () => navigate('/admin/users'),
|
||||
},
|
||||
{
|
||||
key: '/admin/analytics',
|
||||
icon: <BarChartOutlined />,
|
||||
label: '数据分析',
|
||||
onClick: () => navigate('/admin/analytics'),
|
||||
},
|
||||
{
|
||||
key: '/admin/monitor',
|
||||
icon: <MonitorOutlined />,
|
||||
label: '系统监控',
|
||||
onClick: () => navigate('/admin/monitor'),
|
||||
},
|
||||
{
|
||||
key: '/admin/logs',
|
||||
icon: <FileTextOutlined />,
|
||||
label: '日志查看',
|
||||
onClick: () => navigate('/admin/logs'),
|
||||
},
|
||||
],
|
||||
label: 'Admin(暂未开放)',
|
||||
disabled: true,
|
||||
},
|
||||
{
|
||||
key: '/profile',
|
||||
|
||||
@@ -1,100 +1,22 @@
|
||||
/**
|
||||
* 账单管理页面
|
||||
*/
|
||||
import React from 'react';
|
||||
import { Card, Table, Button, Tag, Space } from 'antd';
|
||||
import { DownloadOutlined, FileTextOutlined } from '@ant-design/icons';
|
||||
|
||||
interface Invoice {
|
||||
id: string;
|
||||
date: string;
|
||||
amount: number;
|
||||
status: 'paid' | 'pending' | 'overdue';
|
||||
plan: string;
|
||||
}
|
||||
import { Button, Card, Result } from 'antd';
|
||||
import { useNavigate } from 'react-router-dom';
|
||||
|
||||
const Billing: React.FC = () => {
|
||||
// 模拟数据
|
||||
const invoices: Invoice[] = [
|
||||
{
|
||||
id: 'INV-2024-001',
|
||||
date: '2024-06-01',
|
||||
amount: 99,
|
||||
status: 'paid',
|
||||
plan: 'Pro',
|
||||
},
|
||||
{
|
||||
id: 'INV-2024-002',
|
||||
date: '2024-05-01',
|
||||
amount: 99,
|
||||
status: 'paid',
|
||||
plan: 'Pro',
|
||||
},
|
||||
];
|
||||
|
||||
const getStatusTag = (status: string) => {
|
||||
const config: Record<string, { color: string; text: string }> = {
|
||||
paid: { color: 'success', text: '已支付' },
|
||||
pending: { color: 'processing', text: '待支付' },
|
||||
overdue: { color: 'error', text: '逾期' },
|
||||
};
|
||||
const item = config[status] || config.pending;
|
||||
return <Tag color={item.color}>{item.text}</Tag>;
|
||||
};
|
||||
|
||||
const columns = [
|
||||
{
|
||||
title: '账单编号',
|
||||
dataIndex: 'id',
|
||||
key: 'id',
|
||||
},
|
||||
{
|
||||
title: '日期',
|
||||
dataIndex: 'date',
|
||||
key: 'date',
|
||||
},
|
||||
{
|
||||
title: '套餐',
|
||||
dataIndex: 'plan',
|
||||
key: 'plan',
|
||||
},
|
||||
{
|
||||
title: '金额',
|
||||
dataIndex: 'amount',
|
||||
key: 'amount',
|
||||
render: (amount: number) => `¥${amount}`,
|
||||
},
|
||||
{
|
||||
title: '状态',
|
||||
dataIndex: 'status',
|
||||
key: 'status',
|
||||
render: (status: string) => getStatusTag(status),
|
||||
},
|
||||
{
|
||||
title: '操作',
|
||||
key: 'action',
|
||||
render: (_: any) => (
|
||||
<Space>
|
||||
<Button type="link" icon={<DownloadOutlined />} disabled>
|
||||
下载暂未开放
|
||||
</Button>
|
||||
<Button type="link" icon={<FileTextOutlined />} disabled>
|
||||
发票暂未开放
|
||||
</Button>
|
||||
</Space>
|
||||
),
|
||||
},
|
||||
];
|
||||
const navigate = useNavigate();
|
||||
|
||||
return (
|
||||
<div style={{ padding: '24px' }}>
|
||||
<h1>账单管理</h1>
|
||||
<Card>
|
||||
<Table
|
||||
columns={columns}
|
||||
dataSource={invoices}
|
||||
rowKey="id"
|
||||
pagination={{ pageSize: 10 }}
|
||||
<Result
|
||||
status="info"
|
||||
title="账单管理暂未开放"
|
||||
subTitle="当前版本未接入账单、支付、发票和下载后端服务,因此不展示模拟账单,也不会伪造下载成功。"
|
||||
extra={[
|
||||
<Button key="plans" type="primary" onClick={() => navigate('/subscription')}>
|
||||
返回订阅说明
|
||||
</Button>,
|
||||
]}
|
||||
/>
|
||||
</Card>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user