feat(workout): 重构锻炼模块并新增详细数据展示
- 移除旧的锻炼会话页面和布局文件 - 新增锻炼详情模态框组件,支持心率区间、运动强度等详细数据展示 - 优化锻炼历史页面,增加月度统计卡片和交互式详情查看 - 新增锻炼详情服务,提供心率分析、METs计算等功能 - 更新应用版本至1.0.17并调整iOS后台任务配置 - 添加项目规则文档,明确React Native开发规范
This commit is contained in:
@@ -330,9 +330,11 @@ export default function FitnessRingsDetailScreen() {
|
||||
style={[
|
||||
styles.chartBar,
|
||||
{
|
||||
flex: 1,
|
||||
height: value > 0 ? height : 2, // 没有数据时显示最小高度的灰色条
|
||||
backgroundColor: value > 0 ? color : '#E5E5EA',
|
||||
opacity: value > 0 ? 1 : 0.5
|
||||
opacity: value > 0 ? 1 : 0.5,
|
||||
marginHorizontal: 0.5
|
||||
}
|
||||
]}
|
||||
/>
|
||||
@@ -340,10 +342,19 @@ export default function FitnessRingsDetailScreen() {
|
||||
})}
|
||||
</View>
|
||||
<View style={styles.chartLabels}>
|
||||
<Text style={styles.chartLabel}>00:00</Text>
|
||||
<Text style={styles.chartLabel}>06:00</Text>
|
||||
<Text style={styles.chartLabel}>12:00</Text>
|
||||
<Text style={styles.chartLabel}>18:00</Text>
|
||||
{chartData.map((_, index) => {
|
||||
// 只在关键时间点显示标签:0点、6点、12点、18点
|
||||
if (index === 0 || index === 6 || index === 12 || index === 18) {
|
||||
const hour = index;
|
||||
return (
|
||||
<Text key={index} style={styles.chartLabel}>
|
||||
{hour.toString().padStart(2, '0')}:00
|
||||
</Text>
|
||||
);
|
||||
}
|
||||
// 对于不显示标签的小时,返回一个占位的View
|
||||
return <View key={index} style={styles.chartLabelSpacer} />;
|
||||
})}
|
||||
</View>
|
||||
</View>
|
||||
);
|
||||
@@ -731,23 +742,25 @@ const styles = StyleSheet.create({
|
||||
alignItems: 'flex-end',
|
||||
height: 60,
|
||||
marginBottom: 8,
|
||||
paddingHorizontal: 4,
|
||||
justifyContent: 'space-between',
|
||||
paddingHorizontal: 2,
|
||||
},
|
||||
chartBar: {
|
||||
width: 3,
|
||||
borderRadius: 1.5,
|
||||
marginHorizontal: 0.5,
|
||||
},
|
||||
chartLabels: {
|
||||
flexDirection: 'row',
|
||||
paddingHorizontal: 2,
|
||||
justifyContent: 'space-between',
|
||||
paddingHorizontal: 4,
|
||||
},
|
||||
chartLabel: {
|
||||
fontSize: 12,
|
||||
fontSize: 10,
|
||||
color: '#8E8E93',
|
||||
fontWeight: '500',
|
||||
textAlign: 'center',
|
||||
flex: 6, // 给显示标签的元素更多空间
|
||||
},
|
||||
chartLabelSpacer: {
|
||||
flex: 1, // 占位元素使用较少空间
|
||||
},
|
||||
// 锻炼信息样式
|
||||
exerciseInfo: {
|
||||
|
||||
Reference in New Issue
Block a user