feat(ui): 更新应用品牌名称为 Out Live 并优化睡眠详情页默认数据展示
- 将 Sealife 更名为 Out Live(登录页、隐私弹窗) - 睡眠详情页无数据时显示 "--" 替代固定默认值 - 移除睡眠阶段卡片中的质量标签与总览徽章 - 修复体重历史卡片依赖监听字段与跳转路由 - 调整喝水提醒后台任务时间范围为 8-21 点 - 标签栏按钮新增 activeOpacity=1 禁用点击透明度变化
This commit is contained in:
@@ -61,6 +61,7 @@ export default function TabLayout() {
|
||||
<TouchableOpacity
|
||||
onPress={handlePress}
|
||||
accessibilityRole="button"
|
||||
activeOpacity={1}
|
||||
style={{
|
||||
flex: 1,
|
||||
alignItems: 'center',
|
||||
|
||||
@@ -223,8 +223,8 @@ export default function LoginScreen() {
|
||||
|
||||
<ScrollView contentContainerStyle={styles.content} showsVerticalScrollIndicator={false}>
|
||||
<View style={styles.headerWrap}>
|
||||
<ThemedText style={[styles.title, { color: color.text }]}>Sealife</ThemedText>
|
||||
<ThemedText style={[styles.subtitle, { color: color.textMuted }]}>欢迎登录Sealife</ThemedText>
|
||||
<ThemedText style={[styles.title, { color: color.text }]}>Out Live</ThemedText>
|
||||
<ThemedText style={[styles.subtitle, { color: color.textMuted }]}>欢迎登录Out Live</ThemedText>
|
||||
</View>
|
||||
|
||||
{/* Apple 登录 */}
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
import { ThemedView } from '@/components/ThemedView';
|
||||
import {
|
||||
fetchCompleteSleepData,
|
||||
formatSleepTime,
|
||||
@@ -18,7 +19,6 @@ import {
|
||||
TouchableOpacity,
|
||||
View
|
||||
} from 'react-native';
|
||||
import { ThemedView } from '@/components/ThemedView';
|
||||
|
||||
import { InfoModal, type SleepDetailData } from '@/components/sleep/InfoModal';
|
||||
import { SleepStagesInfoModal } from '@/components/sleep/SleepStagesInfoModal';
|
||||
@@ -38,7 +38,7 @@ export default function SleepDetailScreen() {
|
||||
const colorTokens = Colors[theme];
|
||||
const [sleepData, setSleepData] = useState<CompleteSleepData | null>(null);
|
||||
const [loading, setLoading] = useState(true);
|
||||
|
||||
|
||||
// 从导航参数获取日期,如果没有则使用今天
|
||||
const { date: dateParam } = useLocalSearchParams<{ date?: string }>();
|
||||
const [selectedDate] = useState(() => {
|
||||
@@ -162,11 +162,9 @@ export default function SleepDetailScreen() {
|
||||
</TouchableOpacity>
|
||||
</View>
|
||||
<Text style={[styles.newStatValue, { color: colorTokens.text }]}>
|
||||
{displayData.totalSleepTime > 0 ? formatSleepTime(displayData.totalSleepTime) : '7h 23m'}
|
||||
{displayData.totalSleepTime > 0 ? formatSleepTime(displayData.totalSleepTime) : '--'}
|
||||
</Text>
|
||||
<View style={[styles.qualityBadge, styles.goodQualityBadge]}>
|
||||
<Text style={[styles.qualityBadgeText, styles.goodQualityText]}>✓ 良好</Text>
|
||||
</View>
|
||||
|
||||
</View>
|
||||
|
||||
<View style={[styles.newStatCard, { backgroundColor: colorTokens.background }]}>
|
||||
@@ -189,11 +187,8 @@ export default function SleepDetailScreen() {
|
||||
</TouchableOpacity>
|
||||
</View>
|
||||
<Text style={[styles.newStatValue, { color: colorTokens.text }]}>
|
||||
{displayData.sleepQualityPercentage > 0 ? `${displayData.sleepQualityPercentage}%` : '94%'}
|
||||
{displayData.sleepQualityPercentage > 0 ? `${displayData.sleepQualityPercentage}%` : '--%'}
|
||||
</Text>
|
||||
<View style={[styles.qualityBadge, styles.excellentQualityBadge]}>
|
||||
<Text style={[styles.qualityBadgeText, styles.excellentQualityText]}>★ 优秀</Text>
|
||||
</View>
|
||||
</View>
|
||||
</View>
|
||||
|
||||
@@ -228,10 +223,10 @@ export default function SleepDetailScreen() {
|
||||
} else {
|
||||
// 使用默认数据
|
||||
stagesToDisplay = [
|
||||
{ stage: SleepStage.Awake, duration: 3, percentage: 1, quality: 'good' as any },
|
||||
{ stage: SleepStage.REM, duration: 89, percentage: 20, quality: 'good' as any },
|
||||
{ stage: SleepStage.Core, duration: 295, percentage: 67, quality: 'good' as any },
|
||||
{ stage: SleepStage.Deep, duration: 51, percentage: 12, quality: 'poor' as any }
|
||||
{ stage: SleepStage.Awake, duration: 0, percentage: 0, quality: 'good' as any },
|
||||
{ stage: SleepStage.REM, duration: 0, percentage: 0, quality: 'good' as any },
|
||||
{ stage: SleepStage.Core, duration: 0, percentage: 0, quality: 'good' as any },
|
||||
{ stage: SleepStage.Deep, duration: 0, percentage: 0, quality: 'poor' as any }
|
||||
];
|
||||
}
|
||||
return stagesToDisplay;
|
||||
@@ -269,11 +264,6 @@ export default function SleepDetailScreen() {
|
||||
<Text style={[styles.stageCardPercentage, { color: colorTokens.textSecondary }]}>
|
||||
占总体睡眠的 {stageData.percentage}%
|
||||
</Text>
|
||||
<View style={[styles.stageCardQuality, { backgroundColor: qualityInfo.bgColor }]}>
|
||||
<Text style={[styles.stageCardQualityText, { color: qualityInfo.color }]}>
|
||||
{qualityInfo.text}
|
||||
</Text>
|
||||
</View>
|
||||
</View>
|
||||
);
|
||||
})}
|
||||
|
||||
Reference in New Issue
Block a user