feat: 联动支付 CRM 后台(Next.js + TS + Prisma 重构)

从旧 Laravel 5.7 重构为现代技术栈,对接现有 MySQL。

- 技术栈: Next.js 15 App Router + TypeScript + Prisma + Auth.js + Tailwind v4
- 认证: 复用旧库 admins 的 bcrypt 密码,Auth.js Credentials
- 客户管理: 列表(搜索/报单区间/分页)、增改删、Excel 导入导出
- 生日提醒: 阴阳历(lunar-typescript),口径对齐旧 overtrue 库
- RBAC: 管理员/角色/权限(菜单树) 完整 CRUD + 分配
- 控制台: 统计卡 + 月度新增报单柱状图
- 个人中心: 改昵称/改密码
- 现代 CMS 界面 + 联动支付品牌(logo/登录/底部/icon)

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
2026-07-08 15:02:03 +08:00
co-authored by Claude Opus 4.8
commit 5d46afe439
68 changed files with 6998 additions and 0 deletions
+59
View File
@@ -0,0 +1,59 @@
"use client";
import Link from "next/link";
import { usePathname } from "next/navigation";
import { cn } from "@/lib/utils";
import { copyright } from "@/lib/brand";
import { BrandLogo } from "./brand-logo";
import { navSections, activeHref } from "./nav";
export function Sidebar() {
const pathname = usePathname();
const active = activeHref(pathname);
return (
<aside className="flex w-60 shrink-0 flex-col bg-[var(--color-sidebar)] text-[var(--color-sidebar-foreground)]">
{/* 品牌 */}
<div className="flex h-16 items-center px-5">
<Link href="/">
<BrandLogo size={36} invert />
</Link>
</div>
<nav className="flex-1 space-y-6 overflow-y-auto px-3 py-4">
{navSections.map((section) => (
<div key={section.title}>
<div className="px-3 pb-2 text-[11px] font-medium uppercase tracking-wider text-[var(--color-sidebar-muted)]">
{section.title}
</div>
<div className="space-y-1">
{section.items.map((item) => {
const Icon = item.icon;
const isActive = active === item.href;
return (
<Link
key={item.href}
href={item.href}
className={cn(
"flex items-center gap-3 rounded-lg px-3 py-2 text-sm transition-colors",
isActive
? "bg-[var(--color-primary)] text-white shadow-sm"
: "text-[var(--color-sidebar-muted)] hover:bg-[var(--color-sidebar-hover)] hover:text-white"
)}
>
<Icon className="h-[18px] w-[18px]" />
{item.label}
</Link>
);
})}
</div>
</div>
))}
</nav>
<div className="px-5 py-4 text-[11px] text-[var(--color-sidebar-muted)]">
{copyright()}
</div>
</aside>
);
}