feat: 暗黑模式 + 节流模式

- settingsStore: 移除 coverQuality,新增 darkMode / trafficSaving 布尔字段(AsyncStorage 持久化)
- utils/theme.ts: 新建 useTheme() hook,返回浅色/深色颜色表
- settings.tsx: 新增外观(浅色/深色)和流量(标准/节流)选项,移除封面图清晰度
- BigVideoCard: 节流模式跳过预加载、禁止自动播放;封面低画质;支持暗黑配色
- useVideoDetail: 节流模式下默认 qn=16(360p)
- VideoCard / LiveCard: 移除 coverQuality 依赖,改用 trafficSaving;支持暗黑配色
- index.tsx: 导航栏/搜索栏/列表背景跟随主题
- search.tsx: 页面背景/输入框/文字跟随主题
- downloads.tsx: 顶栏/背景/文字跟随主题
- _layout.tsx: StatusBar 随暗黑模式切换 light/dark
This commit is contained in:
Developer
2026-03-24 21:04:10 +08:00
parent aeaaa0af01
commit f2fc4693a6
12 changed files with 164 additions and 79 deletions

33
utils/theme.ts Normal file
View File

@@ -0,0 +1,33 @@
import { useSettingsStore } from '../store/settingsStore';
export type ThemeColors = {
bg: string; // 页面/列表背景
card: string; // 卡片/section 背景
text: string; // 主文字
textSub: string; // 次要文字
border: string; // 分割线
inputBg: string; // 输入框背景
};
const light: ThemeColors = {
bg: '#f4f4f4',
card: '#fff',
text: '#212121',
textSub: '#999',
border: '#eee',
inputBg: '#f0f0f0',
};
const dark: ThemeColors = {
bg: '#0f0f0f',
card: '#1a1a1a',
text: '#e0e0e0',
textSub: '#666',
border: '#2a2a2a',
inputBg: '#2a2a2a',
};
export function useTheme(): ThemeColors {
const darkMode = useSettingsStore(s => s.darkMode);
return darkMode ? dark : light;
}