feat: 移除目标管理演示页面并优化相关组件

- 删除目标管理演示页面的代码,简化项目结构
- 更新底部导航,移除目标管理演示页面的路由
- 调整相关组件的样式和逻辑,确保界面一致性
- 优化颜色常量的使用,提升视觉效果
This commit is contained in:
2025-08-22 21:24:31 +08:00
parent 9e719a9eda
commit c12329bc96
16 changed files with 1130 additions and 759 deletions

View File

@@ -1,29 +1,19 @@
import { Ionicons } from '@expo/vector-icons';
import React, { useEffect, useState } from 'react';
import React from 'react';
import { StyleSheet } from 'react-native';
import HealthDataService from '../../services/healthData';
import HealthDataCard from './HealthDataCard';
interface OxygenSaturationCardProps {
resetToken: number;
style?: object;
oxygenSaturation?: number | null;
}
const OxygenSaturationCard: React.FC<OxygenSaturationCardProps> = ({
resetToken,
style
style,
oxygenSaturation
}) => {
const [oxygenSaturation, setOxygenSaturation] = useState<number | null>(null);
useEffect(() => {
const fetchOxygenSaturation = async () => {
const data = await HealthDataService.getOxygenSaturation();
setOxygenSaturation(data);
};
fetchOxygenSaturation();
}, [resetToken]);
const oxygenIcon = (
<Ionicons name="water" size={24} color="#3B82F6" />
);
@@ -31,7 +21,7 @@ const OxygenSaturationCard: React.FC<OxygenSaturationCardProps> = ({
return (
<HealthDataCard
title="血氧饱和度"
value={oxygenSaturation !== null ? oxygenSaturation.toString() : '--'}
value={oxygenSaturation !== null && oxygenSaturation !== undefined ? oxygenSaturation.toFixed(1) : '--'}
unit="%"
icon={oxygenIcon}
style={style}