主要更新: 1. 按H5网页端完全重构匹配功能(match页面) - 4种匹配类型: 创业合伙/资源对接/导师顾问/团队招募 - 资源对接等类型弹出手机号/微信号输入框 - 去掉重新匹配按钮,改为返回按钮 2. 修复所有卡片对齐和宽度问题 - 目录页附录卡片居中 - 首页阅读进度卡片满宽度 - 我的页面菜单卡片对齐 - 推广中心分享卡片统一宽度 3. 修复目录页图标和文字对齐 - section-icon固定40rpx宽高 - section-title与图标垂直居中 4. 更新真实完整文章标题(62篇) - 从book目录读取真实markdown文件名 - 替换之前的简化标题 5. 新增文章数据API - /api/db/chapters - 获取完整书籍结构 - 支持按ID获取单篇文章内容
81 lines
2.8 KiB
TypeScript
81 lines
2.8 KiB
TypeScript
"use client"
|
|
|
|
import Link from "next/link"
|
|
import { usePathname } from "next/navigation"
|
|
import { Home, List, User, Users } from "lucide-react"
|
|
|
|
export function BottomNav() {
|
|
const pathname = usePathname()
|
|
|
|
// 在文档页面、管理后台、阅读页面和关于页面不显示底部导航
|
|
if (
|
|
pathname.startsWith("/documentation") ||
|
|
pathname.startsWith("/admin") ||
|
|
pathname.startsWith("/read") ||
|
|
pathname.startsWith("/about")
|
|
) {
|
|
return null
|
|
}
|
|
|
|
const navItems = [
|
|
{ href: "/", icon: Home, label: "首页" },
|
|
{ href: "/chapters", icon: List, label: "目录" },
|
|
{ href: "/match", icon: Users, label: "找伙伴", isCenter: true },
|
|
{ href: "/my", icon: User, label: "我的" },
|
|
]
|
|
|
|
return (
|
|
<>
|
|
<nav className="fixed bottom-0 left-0 right-0 z-40 bg-[#1c1c1e]/95 backdrop-blur-xl border-t border-white/5 safe-bottom">
|
|
<div className="flex items-center justify-around py-2 max-w-lg mx-auto">
|
|
{navItems.map((item, index) => {
|
|
const isActive = pathname === item.href
|
|
const Icon = item.icon
|
|
|
|
// 中间的找伙伴按钮特殊处理
|
|
if (item.isCenter) {
|
|
return (
|
|
<Link key={index} href={item.href} className="flex flex-col items-center py-2 px-6 -mt-4">
|
|
<div
|
|
className={`w-14 h-14 rounded-full flex items-center justify-center shadow-lg transition-all ${
|
|
isActive
|
|
? "bg-gradient-to-br from-[#00CED1] to-[#20B2AA] shadow-[#00CED1]/30"
|
|
: "bg-gradient-to-br from-[#00CED1] to-[#20B2AA] shadow-[#00CED1]/30"
|
|
}`}
|
|
>
|
|
<Icon className="w-7 h-7 text-white" />
|
|
</div>
|
|
<span className={`text-xs mt-1 ${isActive ? "text-[#00CED1] font-medium" : "text-gray-500"}`}>
|
|
{item.label}
|
|
</span>
|
|
</Link>
|
|
)
|
|
}
|
|
|
|
return (
|
|
<Link
|
|
key={index}
|
|
href={item.href}
|
|
className="flex flex-col items-center py-2 px-4 touch-feedback transition-all duration-200"
|
|
>
|
|
<div
|
|
className={`w-6 h-6 flex items-center justify-center mb-1 transition-colors ${
|
|
isActive ? "text-[#00CED1]" : "text-gray-500"
|
|
}`}
|
|
>
|
|
<Icon className="w-5 h-5" strokeWidth={isActive ? 2 : 1.5} />
|
|
</div>
|
|
<span
|
|
className={`text-xs transition-colors ${isActive ? "text-[#00CED1] font-medium" : "text-gray-500"}`}
|
|
>
|
|
{item.label}
|
|
</span>
|
|
</Link>
|
|
)
|
|
})}
|
|
</div>
|
|
</nav>
|
|
</>
|
|
)
|
|
}
|