feat(distribution): 重构分销后台为SaaS商户工作台并全面商业化优化
- 商品货架 (Accounts.tsx): 支持期望售价/固定金额/百分比多模式实时联动加价与批量调价,高亮100%独享溢价 - 订单中心 (Orders.tsx): 透传账号游戏租客信息,新增收益对账抽屉透明拆解底价、手续费、分成与自主溢价 - 结算与规则 (Settlements.tsx & Rules.tsx): 纠正角色倒错,商户视角展现周期对账单与分成合作政策 - 店铺装修 (SiteSettings.tsx): 废除手写JSON,提供横幅/公告/页脚可视化列表编辑器与前台实时模拟器 - 数据大盘 (Dashboard.tsx): 对齐最新订单字段,大字展示分销商净收益 - 后端数据层 (dto.go, repository.go, handler.go): 聚合计算分销商订单收益,支持商品与租客搜索
This commit is contained in:
@@ -30,24 +30,34 @@ import Login from './pages/Login'
|
||||
import Storefront from './pages/Storefront'
|
||||
import './style.css'
|
||||
|
||||
type MenuItem = Required<MenuProps>['items'][number] & { superadminOnly?: boolean }
|
||||
|
||||
const ALL_MENU_ITEMS: MenuItem[] = [
|
||||
{ key: '/', icon: <DashboardOutlined />, label: <Link to="/">仪表盘</Link> },
|
||||
{ key: '/sites', icon: <ShopOutlined />, label: <Link to="/sites">分销网站</Link>, superadminOnly: true },
|
||||
{ key: '/receive', icon: <AccountBookOutlined />, label: <Link to="/receive">分销收号</Link> },
|
||||
{ key: '/sold', icon: <FileSearchOutlined />, label: <Link to="/sold">售出账号</Link> },
|
||||
{ key: '/accounts', icon: <ShopOutlined />, label: <Link to="/accounts">商品展示与加价</Link> },
|
||||
{ key: '/wallet', icon: <WalletOutlined />, label: <Link to="/wallet">资金与提现</Link> },
|
||||
{ key: '/settlements', icon: <DollarCircleOutlined />, label: <Link to="/settlements">结算管理</Link> },
|
||||
{ key: '/settings', icon: <SkinOutlined />, label: <Link to="/settings">品牌装修</Link> },
|
||||
{ key: '/payments', icon: <ApiOutlined />, label: <Link to="/payments">支付通道</Link> },
|
||||
{ key: '/rules', icon: <SettingOutlined />, label: <Link to="/rules">比例与税费</Link> },
|
||||
]
|
||||
type MenuItem = Required<MenuProps>['items'][number]
|
||||
|
||||
function MainLayout({ member, onLogout }: { member: CurrentMember; onLogout: () => void }) {
|
||||
const location = useLocation()
|
||||
const menuItems = ALL_MENU_ITEMS.filter((item) => !item.superadminOnly || member.is_superadmin)
|
||||
const menuItems: MenuItem[] = [
|
||||
{ key: '/', icon: <DashboardOutlined />, label: <Link to="/">仪表盘</Link> },
|
||||
...(member.is_superadmin
|
||||
? [{ key: '/sites', icon: <ShopOutlined />, label: <Link to="/sites">分销站点管理</Link> }]
|
||||
: []),
|
||||
{ key: '/receive', icon: <AccountBookOutlined />, label: <Link to="/receive">分销收号</Link> },
|
||||
{ key: '/sold', icon: <FileSearchOutlined />, label: <Link to="/sold">售出账号订单</Link> },
|
||||
{ key: '/accounts', icon: <ShopOutlined />, label: <Link to="/accounts">商品货架与加价</Link> },
|
||||
{ key: '/wallet', icon: <WalletOutlined />, label: <Link to="/wallet">资金与提现</Link> },
|
||||
{
|
||||
key: '/settlements',
|
||||
icon: <DollarCircleOutlined />,
|
||||
label: <Link to="/settlements">{member.is_superadmin ? '结算批次管理' : '周期对账单'}</Link>,
|
||||
},
|
||||
{ key: '/settings', icon: <SkinOutlined />, label: <Link to="/settings">品牌装修</Link> },
|
||||
...(member.is_superadmin
|
||||
? [{ key: '/payments', icon: <ApiOutlined />, label: <Link to="/payments">支付通道配置</Link> }]
|
||||
: []),
|
||||
{
|
||||
key: '/rules',
|
||||
icon: <SettingOutlined />,
|
||||
label: <Link to="/rules">{member.is_superadmin ? '比例与税费规则' : '合作政策与权益'}</Link>,
|
||||
},
|
||||
]
|
||||
|
||||
const selectedKey = menuItems.some((item) => item.key === location.pathname)
|
||||
? location.pathname
|
||||
|
||||
Reference in New Issue
Block a user