feat: 完善后台管理+搜索功能+分销系统

主要更新:
- 后台菜单精简(9项→6项)
- 新增搜索功能(敏感信息过滤)
- 分销绑定和提现系统完善
- 数据库初始化API(自动修复表结构)
- 用户管理:显示绑定关系详情
- 小程序:上下章导航优化、匹配页面重构
- 修复hydration和数据类型问题
This commit is contained in:
卡若
2026-01-25 19:37:59 +08:00
parent 65d2831a45
commit 4dd2f9f4a7
49 changed files with 5921 additions and 636 deletions

View File

@@ -2,9 +2,10 @@
import { useState } from "react"
import { useRouter } from "next/navigation"
import { ChevronRight, Lock, Unlock, Book, BookOpen, Home, List, Sparkles, User, Users, Zap, Crown } from "lucide-react"
import { ChevronRight, Lock, Unlock, Book, BookOpen, Home, List, Sparkles, User, Users, Zap, Crown, Search } from "lucide-react"
import { useStore } from "@/lib/store"
import { bookData, getTotalSectionCount, specialSections, getPremiumBookPrice, getExtraSectionsCount, BASE_SECTIONS_COUNT } from "@/lib/book-data"
import { SearchModal } from "@/components/search-modal"
export default function ChaptersPage() {
const router = useRouter()
@@ -12,6 +13,7 @@ export default function ChaptersPage() {
const [expandedPart, setExpandedPart] = useState<string | null>("part-1")
const [bookVersion, setBookVersion] = useState<"basic" | "premium">("basic")
const [showPremiumTab, setShowPremiumTab] = useState(false) // 控制是否显示最新完整版标签
const [searchOpen, setSearchOpen] = useState(false)
const totalSections = getTotalSectionCount()
const hasFullBook = user?.hasFullBook || false
@@ -25,11 +27,21 @@ export default function ChaptersPage() {
return (
<div className="min-h-screen bg-black text-white pb-24">
<header className="sticky top-0 z-40 bg-black/90 backdrop-blur-xl border-b border-white/5">
<div className="px-4 py-3 flex items-center justify-center">
<div className="px-4 py-3 flex items-center justify-between">
<div className="w-8" /> {/* 占位 */}
<h1 className="text-lg font-semibold text-[#00CED1]"></h1>
<button
onClick={() => setSearchOpen(true)}
className="w-8 h-8 rounded-full bg-[#2c2c2e] flex items-center justify-center hover:bg-[#3c3c3e] transition-colors"
>
<Search className="w-4 h-4 text-gray-400" />
</button>
</div>
</header>
{/* 搜索弹窗 */}
<SearchModal open={searchOpen} onOpenChange={setSearchOpen} />
<div className="mx-4 mt-4 p-4 rounded-2xl bg-gradient-to-br from-[#1c1c1e] to-[#2c2c2e] border border-[#00CED1]/20">
<div className="flex items-center gap-3">
<div className="w-12 h-12 rounded-xl bg-gradient-to-br from-[#00CED1] to-[#20B2AA] flex items-center justify-center">