From 462a0905998313eb1131755268983c3d269e6f17 Mon Sep 17 00:00:00 2001 From: Developer Date: Thu, 19 Mar 2026 16:34:56 +0800 Subject: [PATCH] =?UTF-8?q?=E8=AE=BE=E7=BD=AE=E9=A1=B5=E9=9D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CLAUDE.md | 183 ++++++++++++++++---- app/_layout.tsx | 11 ++ app/index.tsx | 4 +- app/live/[roomId].tsx | 1 + app/settings.tsx | 115 +++++++++++++ app/video/[bvid].tsx | 335 +++++++++++++++++++++++++----------- components/BigVideoCard.tsx | 6 +- components/DanmakuList.tsx | 22 +-- components/VideoCard.tsx | 6 +- hooks/useRelatedVideos.ts | 29 ++++ store/settingsStore.ts | 22 +++ utils/imageUrl.ts | 8 + 12 files changed, 586 insertions(+), 156 deletions(-) create mode 100644 app/settings.tsx create mode 100644 hooks/useRelatedVideos.ts create mode 100644 store/settingsStore.ts diff --git a/CLAUDE.md b/CLAUDE.md index 6c733cf..6b59bc9 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -1,50 +1,106 @@ # reactBilibiliApp — 项目架构与技术要点 ## 项目概述 -仿 B 站 React Native 客户端,使用 Expo SDK 55 + expo-router,调用 Bilibili 官方 Web API 获取热门视频、视频详情、评论及扫码登录。 +仿 B 站 React Native 客户端,使用 Expo SDK 55 + expo-router,调用 Bilibili 官方 Web API 获取热门视频、直播、视频详情、弹幕、评论、搜索及扫码登录。 ## 技术栈 | 层 | 技术 | |---|---| | 框架 | React Native 0.83 + Expo SDK 55 | -| 路由 | expo-router v4(文件系统路由) | +| 路由 | expo-router v4(文件系统路由,Stack 导航) | | 状态管理 | Zustand | | 网络请求 | Axios | | 本地存储 | @react-native-async-storage/async-storage | -| 视频播放 | react-native-webview(内嵌 HTML5 video) | +| 视频播放(详情页/直播) | react-native-video(DASH/HLS/MP4)| +| 视频播放(首页 BigCard) | react-native-video(DASH MPD,内联自动播放) | +| 视频播放(WebView 降级) | react-native-webview(NativeVideoPlayer) | +| 页面滑动 | react-native-pager-view(首页热门/直播 Tab) | | 图标 | @expo/vector-icons(Ionicons) | ## 目录结构 ``` app/ - _layout.tsx # 根布局:Tab 导航 + 启动时恢复登录态 - index.tsx # 首页:热门视频瀑布流(双列 FlatList) + _layout.tsx # 根布局:Stack 导航 + 启动时恢复登录态/下载列表/设置 + # 全局挂载 + index.tsx # 首页:PagerView 切换热门/直播;绝对定位悬浮导航栏 video/ _layout.tsx # Stack 导航(无头部) - [bvid].tsx # 视频详情页(播放 + 简介 + 评论) + [bvid].tsx # 视频详情页(播放 + 简介/评论/弹幕 三 Tab + 推荐视频 + 下载) + live/ + _layout.tsx # Stack 导航(无头部) + [roomId].tsx # 直播详情页(HLS/FLV 播放 + 简介/弹幕 Tab) + search.tsx # 搜索页(关键词搜索视频) + downloads.tsx # 下载管理页(已下载视频列表) + settings.tsx # 设置页(封面图清晰度 + 退出登录) + components/ - VideoCard.tsx # 视频卡片(封面、标题、UP主、播放量) - VideoPlayer.tsx # 视频播放器入口:web 用