feat: 添加日历功能和进度条组件
- 在项目中引入 dayjs 库以处理日期 - 新增 PlanCard 和 ProgressBar 组件,分别用于展示训练计划和进度条 - 更新首页以显示推荐的训练计划 - 优化个人中心页面的底部留白处理 - 本地化界面文本为中文
This commit is contained in:
@@ -4,8 +4,8 @@ import { ImageBackground, StyleSheet, Text, TouchableOpacity, View } from 'react
|
||||
|
||||
interface WorkoutCardProps {
|
||||
title: string;
|
||||
calories: number;
|
||||
duration: number;
|
||||
calories?: number;
|
||||
duration?: number;
|
||||
imageSource: any;
|
||||
onPress?: () => void;
|
||||
}
|
||||
@@ -14,7 +14,7 @@ export function WorkoutCard({ title, calories, duration, imageSource, onPress }:
|
||||
return (
|
||||
<TouchableOpacity style={styles.container} onPress={onPress}>
|
||||
<ImageBackground
|
||||
source={imageSource}
|
||||
source={{ uri: imageSource }}
|
||||
style={styles.backgroundImage}
|
||||
imageStyle={styles.imageStyle}
|
||||
>
|
||||
@@ -31,10 +31,12 @@ export function WorkoutCard({ title, calories, duration, imageSource, onPress }:
|
||||
</View>
|
||||
)}
|
||||
|
||||
<View style={styles.statItem}>
|
||||
<Ionicons name="time-outline" size={16} color="#fff" />
|
||||
<Text style={styles.statText}>{duration} Min</Text>
|
||||
</View>
|
||||
{duration !== undefined && (
|
||||
<View style={styles.statItem}>
|
||||
<Ionicons name="time-outline" size={16} color="#fff" />
|
||||
<Text style={styles.statText}>{duration} Min</Text>
|
||||
</View>
|
||||
)}
|
||||
</View>
|
||||
</View>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user