feat(app): add version check system and enhance internationalization support

Add comprehensive app update checking functionality with:
- New VersionCheckContext for managing update detection and notifications
- VersionUpdateModal UI component for presenting update information
- Version service API integration with platform-specific update URLs
- Version check menu item in personal settings with manual/automatic checking

Enhance internationalization across workout features:
- Complete workout type translations for English and Chinese
- Localized workout detail modal with proper date/time formatting
- Locale-aware date formatting in fitness rings detail
- Workout notification improvements with deep linking to specific workout details

Improve UI/UX with better chart rendering, sizing fixes, and enhanced navigation flow. Update app version to 1.1.3 and include app version in API headers for better tracking.
This commit is contained in:
2025-11-29 20:47:16 +08:00
parent 83b77615cf
commit a309123b35
19 changed files with 1132 additions and 159 deletions

View File

@@ -1,4 +1,5 @@
import { ROUTES } from '@/constants/Routes';
import { logger } from '@/utils/logger';
import { getNotificationEnabled } from '@/utils/userPreferences';
import * as Notifications from 'expo-notifications';
import { router } from 'expo-router';
@@ -231,9 +232,23 @@ export class NotificationService {
router.push(ROUTES.TAB_FASTING as any);
} else if (data?.type === NotificationTypes.WORKOUT_COMPLETION) {
// 处理锻炼完成通知
console.log('用户点击了锻炼完成通知', data);
// 跳转到锻炼历史页面
router.push('/workout/history' as any);
logger.info('用户点击了锻炼完成通知', data);
const workoutId =
typeof data?.workoutId === 'string'
? data.workoutId
: data?.workoutId != null
? String(data.workoutId)
: null;
// 跳转到锻炼历史页面并在有锻炼ID时自动打开详情
if (workoutId) {
router.push({
pathname: '/workout/history',
params: { workoutId },
} as any);
} else {
router.push('/workout/history' as any);
}
} else if (data?.type === NotificationTypes.HRV_STRESS_ALERT) {
console.log('用户点击了 HRV 压力通知', data);
const targetUrl = (data?.url as string) || '/(tabs)/statistics';
@@ -616,4 +631,3 @@ export const sendMoodCheckinReminder = (title: string, body: string, date?: Date
return notificationService.sendImmediateNotification(notification);
}
};