This commit is contained in:
sion
2026-04-07 01:05:05 +08:00
parent edad10ff06
commit 5ca1274607
83 changed files with 1561 additions and 1241 deletions

View File

@@ -6,7 +6,7 @@ import '../../../core/theme/app_spacing.dart';
import '../../../core/theme/app_theme_extension.dart';
import '../../../data/services/asset_service.dart';
/// 盈分析面 - 月度盈亏日历
/// 盈分析面 - 月度盈虧日曆
class ProfitAnalysisPage extends StatefulWidget {
const ProfitAnalysisPage({super.key});
@@ -27,7 +27,7 @@ class _ProfitAnalysisPageState extends State<ProfitAnalysisPage> {
}
// ============================================
// 数据加载
// 數據加載
// ============================================
Future<void> _loadProfit() async {
@@ -64,7 +64,7 @@ class _ProfitAnalysisPageState extends State<ProfitAnalysisPage> {
}
// ============================================
// 盈亏数据解析
// 盈虧數據解析
// ============================================
double? _getDayProfit(int day) {
@@ -86,7 +86,7 @@ class _ProfitAnalysisPageState extends State<ProfitAnalysisPage> {
}
// ============================================
// 建 UI
// 建 UI
// ============================================
@override
@@ -98,7 +98,7 @@ class _ProfitAnalysisPageState extends State<ProfitAnalysisPage> {
return Scaffold(
backgroundColor: context.colors.surface,
appBar: AppBar(
title: const Text('分析'),
title: const Text('分析'),
backgroundColor: context.colors.surface,
elevation: 0,
scrolledUnderElevation: 0,
@@ -116,19 +116,19 @@ class _ProfitAnalysisPageState extends State<ProfitAnalysisPage> {
child: Column(
mainAxisSize: MainAxisSize.min,
children: [
// 月度盈摘要
// 月度盈摘要
_buildSummarySection(),
SizedBox(height: AppSpacing.md),
// 月份
// 月份
_buildMonthNavigation(isCurrentMonth),
SizedBox(height: AppSpacing.sm),
// 星期标题
// 星期標題
_buildWeekdayHeaders(),
SizedBox(height: AppSpacing.xs),
// 日历网
// 日曆網
if (_isLoading)
_buildLoadingIndicator()
else
@@ -143,7 +143,7 @@ class _ProfitAnalysisPageState extends State<ProfitAnalysisPage> {
);
}
/// 月度盈摘要
/// 月度盈摘要
Widget _buildSummarySection() {
final upColor = context.appColors.up;
final downColor = context.appColors.down;
@@ -153,7 +153,7 @@ class _ProfitAnalysisPageState extends State<ProfitAnalysisPage> {
return Column(
children: [
Text(
'月度盈',
'月度盈',
style: AppTextStyles.bodyMedium(context).copyWith(
color: context.colors.onSurfaceVariant,
),
@@ -172,7 +172,7 @@ class _ProfitAnalysisPageState extends State<ProfitAnalysisPage> {
);
}
/// 月份航行
/// 月份航行
Widget _buildMonthNavigation(bool isCurrentMonth) {
return Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
@@ -193,14 +193,14 @@ class _ProfitAnalysisPageState extends State<ProfitAnalysisPage> {
),
),
),
// 前年月
// 前年月
Text(
'${_currentMonth.year}${_currentMonth.month}',
style: AppTextStyles.headlineMedium(context).copyWith(
fontWeight: FontWeight.bold,
),
),
// 下一月(前月禁用)
// 下一月(前月禁用)
GestureDetector(
onTap: isCurrentMonth ? null : _nextMonth,
child: Container(
@@ -224,7 +224,7 @@ class _ProfitAnalysisPageState extends State<ProfitAnalysisPage> {
);
}
/// 星期标题
/// 星期標題
Widget _buildWeekdayHeaders() {
return Row(
children: ['', '', '', '', '', '', ''].map((d) {
@@ -243,7 +243,7 @@ class _ProfitAnalysisPageState extends State<ProfitAnalysisPage> {
);
}
/// 加指示器
/// 加指示器
Widget _buildLoadingIndicator() {
return Padding(
padding: EdgeInsets.symmetric(vertical: AppSpacing.xxl),
@@ -260,7 +260,7 @@ class _ProfitAnalysisPageState extends State<ProfitAnalysisPage> {
);
}
/// 日历网
/// 日曆網
List<Widget> _buildCalendarGrid(
DateTime now,
bool isCurrentMonth,