feat: 自行开发设计 ui样式优化 超管端-控制台 相关的页面
This commit is contained in:
@@ -17,19 +17,11 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
For commercial licensing, please contact support@quantumnous.com
|
||||
*/
|
||||
import React, { useCallback, useContext, useEffect, useState } from 'react';
|
||||
import {
|
||||
Banner,
|
||||
Button,
|
||||
Card,
|
||||
Form,
|
||||
Spin,
|
||||
Typography,
|
||||
} from '@/components/ui';
|
||||
import { Banner, Button, Card, Form, Spin, Typography } from '@/components/ui';
|
||||
import {
|
||||
AlertTriangle,
|
||||
BadgePercent,
|
||||
Clock,
|
||||
Handshake,
|
||||
ShieldCheck,
|
||||
Users,
|
||||
XCircle,
|
||||
@@ -118,21 +110,7 @@ export default function PartnerConsole() {
|
||||
|
||||
return (
|
||||
// mt-[60px]:顶栏 fixed 定位需自行让位(跑马灯由 PageLayout 占位补偿)
|
||||
<div className='mt-[60px] px-2 pb-6'>
|
||||
<div className='flex items-center gap-3 mb-4'>
|
||||
<div className='p-2.5 bg-gradient-to-br from-brand-from to-brand-to rounded-xl shadow-lg text-white flex-shrink-0'>
|
||||
<Handshake size={22} />
|
||||
</div>
|
||||
<div>
|
||||
<Title heading={4} style={{ margin: 0 }}>
|
||||
{t('合作伙伴')}
|
||||
</Title>
|
||||
<Text type='tertiary' size='small'>
|
||||
{t('直接推广分佣 · 间接推广分佣 · 客户报备')}
|
||||
</Text>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div className='console-content'>
|
||||
{portalClosed && (
|
||||
<Card className='!rounded-2xl shadow-sm' bodyStyle={{ padding: 40 }}>
|
||||
<div className='flex flex-col items-center text-center gap-3 max-w-md mx-auto'>
|
||||
|
||||
@@ -161,6 +161,7 @@ const PartnerCodeChip = ({ code, t }) => (
|
||||
type='button'
|
||||
onClick={async () => {
|
||||
if (await copy(code)) showSuccess(t('伙伴编号已复制'));
|
||||
else showError(t('复制失败,请手动复制'));
|
||||
}}
|
||||
className='flex items-center gap-1.5 px-2.5 py-1 rounded-md bg-brand/10 text-brand-deep hover:bg-brand/20 transition-colors text-xs font-mono font-semibold cursor-pointer border-none'
|
||||
title={t('点击复制')}
|
||||
@@ -361,6 +362,7 @@ function Overview({ dashboard, t, onGoto }) {
|
||||
|
||||
function Leads({ t, readOnly, canSubmit }) {
|
||||
const [rows, setRows] = useState([]);
|
||||
const [loading, setLoading] = useState(false);
|
||||
const [total, setTotal] = useState(0);
|
||||
const [page, setPage] = useState(1);
|
||||
const [showSubmit, setShowSubmit] = useState(false);
|
||||
@@ -368,11 +370,20 @@ function Leads({ t, readOnly, canSubmit }) {
|
||||
const [extendTarget, setExtendTarget] = useState(null);
|
||||
|
||||
const load = useCallback(async (p = 1) => {
|
||||
const res = await API.get(`/api/partner/leads?p=${p - 1}`);
|
||||
if (res.data.success) {
|
||||
setRows(res.data.data.items || []);
|
||||
setTotal(res.data.data.total || 0);
|
||||
setPage(p);
|
||||
setLoading(true);
|
||||
try {
|
||||
const res = await API.get(`/api/partner/leads?p=${p - 1}`);
|
||||
if (res.data.success) {
|
||||
setRows(res.data.data.items || []);
|
||||
setTotal(res.data.data.total || 0);
|
||||
setPage(p);
|
||||
} else {
|
||||
showError(res.data.message);
|
||||
}
|
||||
} catch (err) {
|
||||
showError(err.message);
|
||||
} finally {
|
||||
setLoading(false);
|
||||
}
|
||||
}, []);
|
||||
|
||||
@@ -476,6 +487,7 @@ function Leads({ t, readOnly, canSubmit }) {
|
||||
<Table
|
||||
columns={columns}
|
||||
dataSource={rows}
|
||||
loading={loading}
|
||||
rowKey='id'
|
||||
scroll={{ x: 'max-content' }}
|
||||
empty={
|
||||
@@ -608,16 +620,26 @@ function Leads({ t, readOnly, canSubmit }) {
|
||||
|
||||
function Customers({ t, readOnly }) {
|
||||
const [rows, setRows] = useState([]);
|
||||
const [loading, setLoading] = useState(false);
|
||||
const [total, setTotal] = useState(0);
|
||||
const [page, setPage] = useState(1);
|
||||
const [serviceTarget, setServiceTarget] = useState(null);
|
||||
|
||||
const load = useCallback(async (p = 1) => {
|
||||
const res = await API.get(`/api/partner/customers?p=${p - 1}`);
|
||||
if (res.data.success) {
|
||||
setRows(res.data.data.items || []);
|
||||
setTotal(res.data.data.total || 0);
|
||||
setPage(p);
|
||||
setLoading(true);
|
||||
try {
|
||||
const res = await API.get(`/api/partner/customers?p=${p - 1}`);
|
||||
if (res.data.success) {
|
||||
setRows(res.data.data.items || []);
|
||||
setTotal(res.data.data.total || 0);
|
||||
setPage(p);
|
||||
} else {
|
||||
showError(res.data.message);
|
||||
}
|
||||
} catch (err) {
|
||||
showError(err.message);
|
||||
} finally {
|
||||
setLoading(false);
|
||||
}
|
||||
}, []);
|
||||
|
||||
@@ -700,6 +722,7 @@ function Customers({ t, readOnly }) {
|
||||
<Table
|
||||
columns={columns}
|
||||
dataSource={rows}
|
||||
loading={loading}
|
||||
rowKey='id'
|
||||
scroll={{ x: 'max-content' }}
|
||||
empty={<Empty description={t('暂无归属客户')} />}
|
||||
|
||||
Reference in New Issue
Block a user