feat(profile): add chat settings and language options to profile settings
All checks were successful
Frontend CI / ota-android (push) Successful in 13m7s
Frontend CI / build-and-push-web (push) Successful in 16m58s
Frontend CI / build-android-apk (push) Successful in 1h4m18s

- Introduced hrefProfileChatSettings() for navigation to chat settings.
- Updated SettingsScreen to include new settings items for chat settings, language selection, data storage, terms, and privacy policy.
- Enhanced user experience by providing alerts for language and data storage options.

This update improves the profile settings interface by adding more customization options for users.
This commit is contained in:
lafay
2026-04-01 02:17:36 +08:00
parent 20e9d69540
commit 5614b4078a
25 changed files with 2622 additions and 801 deletions

View File

@@ -23,19 +23,17 @@ import {
borderRadius,
useThemePreference,
useSetThemePreference,
useThemeStore,
type AppColors,
} from '../../theme';
import { useAuthStore } from '../../stores';
import { Text } from '../../components/common';
import { useResponsive, useResponsiveSpacing } from '../../hooks';
import { useSafeAreaInsets } from 'react-native-safe-area-context';
import * as hrefs from '../../navigation/hrefs';
// 设置卡片最大宽度
const SETTINGS_CARD_MAX_WIDTH = 720;
import * as hrefs from '../../navigation/hrefs';
interface SettingsItem {
key: string;
title: string;
@@ -64,6 +62,8 @@ const SETTINGS_GROUPS_BASE = [
icon: 'bell-outline',
items: [
{ key: 'notification_settings', title: '通知设置', icon: 'bell-cog-outline', showArrow: true, subtitle: '推送、震动、提示音' },
{ key: 'language', title: '语言设置', icon: 'translate', showArrow: true, subtitle: '简体中文' },
{ key: 'data_storage', title: '数据与存储', icon: 'database-outline', showArrow: true },
],
},
{
@@ -72,6 +72,8 @@ const SETTINGS_GROUPS_BASE = [
items: [
{ key: 'about', title: '关于我们', icon: 'information-outline', showArrow: true, subtitle: `版本 ${APP_VERSION}` },
{ key: 'help', title: '帮助与反馈', icon: 'help-circle-outline', showArrow: true },
{ key: 'terms', title: '用户协议', icon: 'file-document-outline', showArrow: true },
{ key: 'privacy_policy', title: '隐私政策', icon: 'shield-outline', showArrow: true },
],
},
];
@@ -196,9 +198,16 @@ export const SettingsScreen: React.FC = () => {
themePreference === 'system' ? '跟随系统' : themePreference === 'dark' ? '深色' : '浅色';
return [
{
title: '显示与外观',
title: '个性化',
icon: 'palette-outline',
items: [
{
key: 'chat_settings',
title: '聊天设置',
icon: 'message-text-outline',
showArrow: true,
subtitle: '字号、主题、壁纸',
},
{
key: 'theme',
title: '主题模式',
@@ -214,17 +223,13 @@ export const SettingsScreen: React.FC = () => {
const handleItemPress = (key: string) => {
switch (key) {
case 'chat_settings':
router.push(hrefs.hrefProfileChatSettings());
break;
case 'theme': {
// 获取调试信息
const { Appearance } = require('react-native');
const systemScheme = Appearance?.getColorScheme?.() || 'undefined';
const resolvedScheme = useThemeStore.getState().resolvedScheme;
const storedPref = useThemeStore.getState().preference;
const storedSystem = useThemeStore.getState().systemScheme;
Alert.alert(
'主题模式',
`选择应用界面明暗\n\n[调试信息]\n系统主题: ${systemScheme}\n存储偏好: ${storedPref}\n存储系统: ${storedSystem}\n实际应用: ${resolvedScheme}`,
'选择应用界面明暗',
[
{ text: '取消', style: 'cancel' },
{
@@ -249,6 +254,31 @@ export const SettingsScreen: React.FC = () => {
);
break;
}
case 'language': {
Alert.alert(
'语言设置',
'选择应用显示语言',
[
{ text: '取消', style: 'cancel' },
{ text: '简体中文', onPress: () => {} },
{ text: '繁體中文', onPress: () => {} },
{ text: 'English', onPress: () => {} },
]
);
break;
}
case 'data_storage': {
Alert.alert('数据与存储', '缓存清理功能即将上线!');
break;
}
case 'terms': {
Alert.alert('用户协议', '用户协议页面即将上线!');
break;
}
case 'privacy_policy': {
Alert.alert('隐私政策', '隐私政策页面即将上线!');
break;
}
case 'edit_profile':
router.push(hrefs.hrefProfileEdit());
break;
@@ -348,7 +378,9 @@ export const SettingsScreen: React.FC = () => {
const renderContent = () => (
<>
{/* 设置分组 */}
{settingsGroups.map((group) => renderGroup(group))}
{renderLogoutButton()}
<View style={styles.footer}>