import { ROUTES } from '@/constants/Routes'; import { STORAGE_KEYS } from '@/services/api'; import AsyncStorage from '@/utils/kvStore'; import { Ionicons } from '@expo/vector-icons'; import { useRouter } from 'expo-router'; import React from 'react'; import { Alert, ScrollView, StyleSheet, Text, TouchableOpacity, View } from 'react-native'; import { useSafeAreaInsets } from 'react-native-safe-area-context'; export default function DeveloperScreen() { const router = useRouter(); const insets = useSafeAreaInsets(); const resetOnboardingStatus = async () => { try { await AsyncStorage.removeItem(STORAGE_KEYS.onboardingCompleted); Alert.alert('成功', '引导状态已重置,下次启动应用将重新显示引导页面'); } catch (error) { console.error('重置引导状态失败:', error); Alert.alert('错误', '重置引导状态失败,请重试'); } }; const developerItems = [ { title: '日志', subtitle: '查看应用运行日志', icon: 'document-text-outline', onPress: () => router.push(ROUTES.DEVELOPER_LOGS), }, { title: '重置引导状态', subtitle: '清除 onboarding 缓存,下次启动将重新显示引导页面', icon: 'refresh-outline', onPress: resetOnboardingStatus, }, ]; return ( {/* Header */} router.back()} style={styles.backButton}> 开发者 {developerItems.map((item, index) => ( {item.title} {item.subtitle} ))} ); } const styles = StyleSheet.create({ container: { flex: 1, backgroundColor: '#F8F9FA', }, header: { flexDirection: 'row', alignItems: 'center', justifyContent: 'space-between', paddingHorizontal: 16, paddingVertical: 12, backgroundColor: '#FFFFFF', borderBottomWidth: 1, borderBottomColor: '#E5E7EB', }, backButton: { width: 40, height: 40, justifyContent: 'center', alignItems: 'center', }, title: { fontSize: 18, fontWeight: 'bold', color: '#2C3E50', }, placeholder: { width: 40, }, scrollView: { flex: 1, }, content: { padding: 16, }, cardContainer: { backgroundColor: '#FFFFFF', borderRadius: 12, shadowColor: '#000', shadowOffset: { width: 0, height: 1 }, shadowOpacity: 0.05, shadowRadius: 4, elevation: 2, overflow: 'hidden', }, menuItem: { flexDirection: 'row', alignItems: 'center', justifyContent: 'space-between', paddingVertical: 16, paddingHorizontal: 16, borderBottomWidth: 1, borderBottomColor: '#F1F3F4', }, menuItemLeft: { flexDirection: 'row', alignItems: 'center', flex: 1, }, iconContainer: { width: 40, height: 40, borderRadius: 8, backgroundColor: 'rgba(147, 112, 219, 0.1)', alignItems: 'center', justifyContent: 'center', marginRight: 12, }, textContainer: { flex: 1, }, menuItemTitle: { fontSize: 16, color: '#2C3E50', fontWeight: '600', marginBottom: 2, }, menuItemSubtitle: { fontSize: 13, color: '#6B7280', }, });