feat(fasting): 新增轻断食功能模块

新增完整的轻断食功能,包括:
- 断食计划列表和详情页面,支持12-12、14-10、16-8、18-6四种计划
- 断食状态实时追踪和倒计时显示
- 自定义开始时间选择器
- 断食通知提醒功能
- Redux状态管理和数据持久化
- 新增tab导航入口和路由配置
This commit is contained in:
richarjiang
2025-10-13 19:21:29 +08:00
parent 971aebd560
commit e03b2b3032
17 changed files with 2390 additions and 7 deletions

View File

@@ -1,5 +1,6 @@
import { Ionicons } from '@expo/vector-icons';
import { BlurView } from 'expo-blur';
import { GlassView, isLiquidGlassAvailable } from 'expo-glass-effect';
import React from 'react';
import {
Modal,
@@ -22,6 +23,21 @@ export function FloatingSelectionCard({
title,
children
}: FloatingSelectionCardProps) {
const glassAvailable = isLiquidGlassAvailable();
const CloseWrapper = glassAvailable ? GlassView : View;
const closeInnerStyle = [
styles.closeButtonInnerBase,
glassAvailable ? styles.closeButtonInnerGlass : styles.closeButtonInnerFallback,
];
const closeWrapperProps = glassAvailable
? {
glassEffectStyle: 'regular' as const,
tintColor: 'rgba(255,255,255,0.45)',
isInteractive: true,
}
: {};
return (
<Modal
visible={visible}
@@ -52,9 +68,9 @@ export function FloatingSelectionCard({
onPress={onClose}
activeOpacity={0.7}
>
<View style={styles.closeButtonInner}>
<CloseWrapper style={closeInnerStyle} {...closeWrapperProps}>
<Ionicons name="close" size={24} color="#666" />
</View>
</CloseWrapper>
</TouchableOpacity>
</View>
</BlurView>
@@ -67,6 +83,7 @@ const styles = StyleSheet.create({
flex: 1,
justifyContent: 'flex-end',
alignItems: 'center',
paddingHorizontal: 20,
},
backdrop: {
position: 'absolute',
@@ -103,11 +120,10 @@ const styles = StyleSheet.create({
closeButton: {
marginTop: 20,
},
closeButtonInner: {
closeButtonInnerBase: {
width: 44,
height: 44,
borderRadius: 22,
backgroundColor: 'rgba(255, 255, 255, 0.9)',
alignItems: 'center',
justifyContent: 'center',
shadowColor: '#000',
@@ -119,4 +135,12 @@ const styles = StyleSheet.create({
shadowRadius: 4,
elevation: 3,
},
});
closeButtonInnerGlass: {
borderWidth: StyleSheet.hairlineWidth,
borderColor: 'rgba(255,255,255,0.45)',
backgroundColor: 'rgba(255,255,255,0.35)',
},
closeButtonInnerFallback: {
backgroundColor: 'rgba(255, 255, 255, 0.9)',
},
});