优化接单大厅数量和排行榜

This commit is contained in:
yml2213
2026-08-16 13:36:16 +08:00
parent 27bcb7dd68
commit 8a5ba4c2f3
3 changed files with 96 additions and 72 deletions
+1 -21
View File
@@ -4,7 +4,7 @@ import {
ShoppingOutlined,
UserOutlined,
} from '@ant-design/icons'
import { App, Button, Layout, Menu, Space, Tag, Typography } from 'antd'
import { App, Button, Layout, Menu, Typography } from 'antd'
import type { MenuProps } from 'antd'
import { Outlet, useLocation, useNavigate } from 'react-router'
@@ -67,12 +67,6 @@ export default function WorkerLayout() {
</div>
</div>
<div className="worker-mobile-user-area">
<Tag color={resolveStatusTagColor(status)} className="worker-mobile-status-tag">
{formatWorkerStatus(status)}
</Tag>
<span className="worker-mobile-username" title={username}>
{username}
</span>
<Button
type="text"
size="small"
@@ -141,12 +135,6 @@ export default function WorkerLayout() {
</div>
</Layout.Sider>
<Layout className="admin-main-shell">
<Layout.Header className="admin-topbar">
<Space className="admin-user" size={12}>
<Tag color={resolveStatusTagColor(status)}>{formatWorkerStatus(status)}</Tag>
<Typography.Text strong>{username}</Typography.Text>
</Space>
</Layout.Header>
<Layout.Content className="admin-content">
<Outlet />
</Layout.Content>
@@ -168,11 +156,3 @@ function formatWorkerStatus(status: string) {
if (status === 'disabled') return '已停用'
return '未登录'
}
function resolveStatusTagColor(status: string) {
if (status === 'active') return 'success'
if (status === 'pending_review') return 'warning'
if (status === 'rejected') return 'error'
if (status === 'disabled') return 'default'
return 'default'
}
@@ -462,14 +462,8 @@ export default function WorkerHallPage() {
<div className="worker-page-head">
<div className="worker-page-head-title-row">
<Typography.Title level={3}></Typography.Title>
<div className="worker-hall-page-actions">
<div className="worker-hall-head-controls">
<Tooltip title="接单排行榜">
<Button
aria-label="接单排行榜"
icon={<TrophyOutlined />}
onClick={() => setLeaderboardOpen(true)}
/>
</Tooltip>
<Tooltip
title={
autoRefresh
@@ -498,6 +492,18 @@ export default function WorkerHallPage() {
</Button>
</div>
<div className="worker-hall-leaderboard-trigger">
<Tooltip title="接单排行榜">
<Button
aria-label="接单排行榜"
icon={<TrophyOutlined />}
onClick={() => setLeaderboardOpen(true)}
>
</Button>
</Tooltip>
</div>
</div>
</div>
<div className="worker-hall-search-bar">
+55 -17
View File
@@ -13,20 +13,27 @@
}
.worker-page-head {
display: flex;
display: grid;
grid-template-areas:
'main'
'search';
grid-template-columns: minmax(0, 1fr);
align-items: center;
justify-content: space-between;
gap: 16px;
gap: 12px 16px;
}
.worker-page-head h3 {
margin: 0;
flex: 0 0 auto;
white-space: nowrap;
}
.worker-page-head-title-row {
grid-area: main;
display: flex;
align-items: center;
justify-content: space-between;
min-width: 0;
gap: 16px;
}
@@ -53,9 +60,21 @@
}
.worker-hall-search-bar {
grid-area: search;
width: 100%;
}
.worker-hall-leaderboard-trigger {
flex: 0 0 auto;
}
.worker-hall-page-actions {
display: flex;
align-items: center;
flex: 0 0 auto;
gap: 12px;
}
/* ===== 我的订单统计与 Tabs (PC端) ===== */
.worker-orders-toolbar {
@@ -405,29 +424,46 @@
.worker-hall-card-grid {
display: grid;
grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
gap: 16px;
grid-template-columns: repeat(auto-fill, minmax(225px, 1fr));
gap: 12px;
}
/* 1080P 标准桌面屏 (1440px - 1980px) 稳定呈现 6 列 */
@media (min-width: 1440px) and (max-width: 1980px) {
.worker-hall-card-grid {
grid-template-columns: repeat(6, minmax(0, 1fr));
gap: 12px;
}
}
/* 2K 及以上高分宽屏显示器稳定呈现 7 列 */
@media (min-width: 1981px) {
.worker-hall-card-grid {
grid-template-columns: repeat(7, minmax(0, 1fr));
gap: 14px;
}
}
.worker-hall-card {
min-width: 0;
padding: 16px;
border-radius: 14px;
padding: 12px 14px;
border-radius: 12px;
background: #ffffff;
border: 1px solid #e5e7eb;
box-shadow: 0 8px 20px rgba(15, 23, 42, 0.04);
box-shadow: 0 4px 14px rgba(15, 23, 42, 0.04);
display: grid;
gap: 12px;
gap: 10px;
}
.worker-hall-card-title {
display: grid;
gap: 4px;
gap: 3px;
min-width: 0;
}
.worker-hall-card-title .ant-typography {
margin: 0;
font-size: 12px;
}
.worker-hall-card-link,
@@ -436,7 +472,7 @@
max-width: 100%;
font-weight: 600;
color: #0f172a;
font-size: 15px;
font-size: 14px;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
@@ -444,12 +480,12 @@
.worker-hall-card-amount-row {
display: grid;
gap: 6px;
gap: 4px;
}
.worker-hall-card-amount {
color: #f97316;
font-size: 32px;
font-size: 28px;
line-height: 1;
font-weight: 700;
}
@@ -458,12 +494,12 @@
.worker-hall-card-hint {
margin: 0;
font-size: 12px;
line-height: 1.5;
line-height: 1.4;
}
.worker-hall-card-actions {
display: grid;
gap: 8px;
gap: 6px;
margin-top: auto;
}
@@ -471,7 +507,7 @@
display: flex;
align-items: center;
justify-content: space-between;
gap: 8px;
gap: 6px;
}
.worker-hall-card-actions-row .ant-btn {
@@ -480,12 +516,14 @@
.worker-hall-card-grab-row {
display: flex;
gap: 8px;
gap: 6px;
}
.worker-hall-card-grab-row .ant-btn {
flex: 1;
min-width: 0;
padding-inline: 6px;
font-size: 14px;
}
.worker-hall-sharing-button:not(:disabled) {