111
This commit is contained in:
@@ -9,7 +9,7 @@ import '../../../data/models/account_models.dart';
|
||||
import '../../../data/services/bonus_service.dart';
|
||||
import '../../../providers/asset_provider.dart';
|
||||
|
||||
/// 账单页面 — 代币盈亏账单 + 新人福利账单 + 推广福利账单
|
||||
/// 賬單頁面 — 代幣盈虧賬單 + 新人福利賬單 + 推廣福利賬單
|
||||
class BillsPage extends StatefulWidget {
|
||||
const BillsPage({super.key});
|
||||
|
||||
@@ -42,7 +42,7 @@ class _BillsPageState extends State<BillsPage> with SingleTickerProviderStateMix
|
||||
final provider = context.read<AssetProvider>();
|
||||
final bonusService = context.read<BonusService>();
|
||||
|
||||
// 并行加载持仓和福利记录
|
||||
// 並行加載持倉和福利記錄
|
||||
await provider.loadTradeAccount(force: true);
|
||||
final welfareResponse = await bonusService.getWelfareStatus();
|
||||
|
||||
@@ -73,7 +73,7 @@ class _BillsPageState extends State<BillsPage> with SingleTickerProviderStateMix
|
||||
if (newUser != null) {
|
||||
final claimed = newUser['claimed'] as bool? ?? false;
|
||||
final eligible = newUser['eligible'] as bool? ?? false;
|
||||
// 状态: 1=已领取, 0=可领取(待领取), 2=不可用(未解锁)
|
||||
// 狀態: 1=已領取, 0=可領取(待領取), 2=不可用(未解鎖)
|
||||
final int status;
|
||||
if (claimed) {
|
||||
status = 1;
|
||||
@@ -91,15 +91,15 @@ class _BillsPageState extends State<BillsPage> with SingleTickerProviderStateMix
|
||||
});
|
||||
}
|
||||
|
||||
// 推广福利列表
|
||||
// 推廣福利列表
|
||||
final referralRewards = data['referralRewards'] as List<dynamic>? ?? [];
|
||||
for (var r in referralRewards) {
|
||||
final map = r as Map<String, dynamic>;
|
||||
final username = map['username'] as String? ?? '用户';
|
||||
final username = map['username'] as String? ?? '用戶';
|
||||
final milestones = map['milestones'] as List<dynamic>? ?? [];
|
||||
final claimableCount = map['claimableCount'] as int? ?? 0;
|
||||
|
||||
// 每个 milestone 生成一条记录
|
||||
// 每個 milestone 生成一條記錄
|
||||
for (var m in milestones) {
|
||||
final ms = m as Map<String, dynamic>;
|
||||
final earned = ms['earned'] as bool? ?? false;
|
||||
@@ -108,26 +108,26 @@ class _BillsPageState extends State<BillsPage> with SingleTickerProviderStateMix
|
||||
|
||||
final int status;
|
||||
if (earned) {
|
||||
status = 1; // 已领取
|
||||
status = 1; // 已領取
|
||||
} else if (claimable) {
|
||||
status = 0; // 可领取
|
||||
status = 0; // 可領取
|
||||
} else {
|
||||
status = 2; // 未达标
|
||||
status = 2; // 未達標
|
||||
}
|
||||
records.add({
|
||||
'type': 'referral',
|
||||
'title': '推广福利 - $username (${milestoneVal}000)',
|
||||
'title': '推廣福利 - $username (${milestoneVal}000)',
|
||||
'amount': '100.00',
|
||||
'status': status,
|
||||
'time': ms['claimTime'] ?? ms['createTime'],
|
||||
});
|
||||
}
|
||||
|
||||
// 如果没有 milestone 但有 claimableCount,也生成记录
|
||||
// 如果沒有 milestone 但有 claimableCount,也生成記錄
|
||||
if (milestones.isEmpty && claimableCount > 0) {
|
||||
records.add({
|
||||
'type': 'referral',
|
||||
'title': '推广福利 - $username',
|
||||
'title': '推廣福利 - $username',
|
||||
'amount': '${claimableCount * 100}',
|
||||
'status': 0,
|
||||
'time': null,
|
||||
@@ -150,7 +150,7 @@ class _BillsPageState extends State<BillsPage> with SingleTickerProviderStateMix
|
||||
icon: const Icon(LucideIcons.arrowLeft, size: 20),
|
||||
onPressed: () => Navigator.of(context).pop(),
|
||||
),
|
||||
title: Text('我的账单', style: AppTextStyles.headlineLarge(context)),
|
||||
title: Text('我的賬單', style: AppTextStyles.headlineLarge(context)),
|
||||
backgroundColor: _isDark ? AppColorScheme.darkBackground : AppColorScheme.lightBackground,
|
||||
elevation: 0,
|
||||
scrolledUnderElevation: 0,
|
||||
@@ -163,9 +163,9 @@ class _BillsPageState extends State<BillsPage> with SingleTickerProviderStateMix
|
||||
labelStyle: AppTextStyles.headlineMedium(context).copyWith(fontWeight: FontWeight.w600),
|
||||
unselectedLabelStyle: AppTextStyles.headlineMedium(context),
|
||||
tabs: const [
|
||||
Tab(text: '代币盈亏'),
|
||||
Tab(text: '代幣盈虧'),
|
||||
Tab(text: '新人福利'),
|
||||
Tab(text: '推广福利'),
|
||||
Tab(text: '推廣福利'),
|
||||
],
|
||||
),
|
||||
),
|
||||
@@ -183,16 +183,16 @@ class _BillsPageState extends State<BillsPage> with SingleTickerProviderStateMix
|
||||
}
|
||||
|
||||
// ============================================
|
||||
// 代币盈亏账单
|
||||
// 代幣盈虧賬單
|
||||
// ============================================
|
||||
Widget _buildCoinProfitTab() {
|
||||
final colorScheme = Theme.of(context).colorScheme;
|
||||
|
||||
if (_holdings.isEmpty) {
|
||||
return _buildEmptyState(LucideIcons.wallet, '暂无持仓记录');
|
||||
return _buildEmptyState(LucideIcons.wallet, '暫無持倉記錄');
|
||||
}
|
||||
|
||||
// 汇总统计
|
||||
// 彙總統計
|
||||
double totalCost = 0;
|
||||
double totalValue = 0;
|
||||
double totalProfit = 0;
|
||||
@@ -210,7 +210,7 @@ class _BillsPageState extends State<BillsPage> with SingleTickerProviderStateMix
|
||||
child: ListView(
|
||||
padding: const EdgeInsets.all(AppSpacing.md),
|
||||
children: [
|
||||
// 汇总卡片
|
||||
// 彙總卡片
|
||||
Container(
|
||||
padding: const EdgeInsets.all(AppSpacing.lg),
|
||||
decoration: BoxDecoration(
|
||||
@@ -224,7 +224,7 @@ class _BillsPageState extends State<BillsPage> with SingleTickerProviderStateMix
|
||||
),
|
||||
child: Column(
|
||||
children: [
|
||||
Text('总盈亏 (USDT)', style: AppTextStyles.bodyMedium(context).copyWith(
|
||||
Text('總盈虧 (USDT)', style: AppTextStyles.bodyMedium(context).copyWith(
|
||||
color: colorScheme.onSurfaceVariant,
|
||||
)),
|
||||
const SizedBox(height: AppSpacing.xs),
|
||||
@@ -239,9 +239,9 @@ class _BillsPageState extends State<BillsPage> with SingleTickerProviderStateMix
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
_buildSummaryItem('总成本', totalCost.toStringAsFixed(2)),
|
||||
_buildSummaryItem('總成本', totalCost.toStringAsFixed(2)),
|
||||
Container(width: 1, height: 16, color: colorScheme.outlineVariant.withValues(alpha: 0.3)),
|
||||
_buildSummaryItem('总市值', totalValue.toStringAsFixed(2)),
|
||||
_buildSummaryItem('總市值', totalValue.toStringAsFixed(2)),
|
||||
Container(width: 1, height: 16, color: colorScheme.outlineVariant.withValues(alpha: 0.3)),
|
||||
_buildSummaryItem('收益率', '${profitRate >= 0 ? '+' : ''}${profitRate.toStringAsFixed(2)}%'),
|
||||
],
|
||||
@@ -251,7 +251,7 @@ class _BillsPageState extends State<BillsPage> with SingleTickerProviderStateMix
|
||||
),
|
||||
const SizedBox(height: AppSpacing.md),
|
||||
|
||||
// 各币种盈亏明细
|
||||
// 各幣種盈虧明細
|
||||
..._holdings.map((h) => _buildCoinProfitCard(h)),
|
||||
],
|
||||
),
|
||||
@@ -296,7 +296,7 @@ class _BillsPageState extends State<BillsPage> with SingleTickerProviderStateMix
|
||||
),
|
||||
child: Column(
|
||||
children: [
|
||||
// 币名 + 盈亏金额
|
||||
// 幣名 + 盈虧金額
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
@@ -333,11 +333,11 @@ class _BillsPageState extends State<BillsPage> with SingleTickerProviderStateMix
|
||||
],
|
||||
),
|
||||
const SizedBox(height: AppSpacing.sm),
|
||||
// 明细行
|
||||
// 明細行
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Text('均价: ${h.avgPrice}', style: AppTextStyles.bodySmall(context).copyWith(
|
||||
Text('均價: ${h.avgPrice}', style: AppTextStyles.bodySmall(context).copyWith(
|
||||
color: colorScheme.onSurfaceVariant,
|
||||
)),
|
||||
Text('市值: ${h.currentValue} USDT', style: AppTextStyles.bodySmall(context).copyWith(
|
||||
@@ -355,7 +355,7 @@ class _BillsPageState extends State<BillsPage> with SingleTickerProviderStateMix
|
||||
}
|
||||
|
||||
// ============================================
|
||||
// 福利账单
|
||||
// 福利賬單
|
||||
// ============================================
|
||||
Widget _buildWelfareTab(String type) {
|
||||
final records = _welfareRecords.where((r) => r['type'] == type).toList();
|
||||
@@ -363,7 +363,7 @@ class _BillsPageState extends State<BillsPage> with SingleTickerProviderStateMix
|
||||
if (records.isEmpty) {
|
||||
return _buildEmptyState(
|
||||
LucideIcons.gift,
|
||||
type == 'new_user' ? '暂无新人福利记录' : '暂无推广福利记录',
|
||||
type == 'new_user' ? '暫無新人福利記錄' : '暫無推廣福利記錄',
|
||||
);
|
||||
}
|
||||
|
||||
@@ -382,20 +382,20 @@ class _BillsPageState extends State<BillsPage> with SingleTickerProviderStateMix
|
||||
final amount = double.tryParse(record['amount']?.toString() ?? '0') ?? 0;
|
||||
final status = record['status'] as int? ?? 0;
|
||||
|
||||
// status: 0=待领取, 1=已领取, 2=未达标
|
||||
// status: 0=待領取, 1=已領取, 2=未達標
|
||||
String statusText;
|
||||
Color statusColor;
|
||||
switch (status) {
|
||||
case 1:
|
||||
statusText = '已领取';
|
||||
statusText = '已領取';
|
||||
statusColor = context.appColors.up;
|
||||
break;
|
||||
case 2:
|
||||
statusText = '未达标';
|
||||
statusText = '未達標';
|
||||
statusColor = colorScheme.onSurfaceVariant;
|
||||
break;
|
||||
default:
|
||||
statusText = '待领取';
|
||||
statusText = '待領取';
|
||||
statusColor = AppColorScheme.warning;
|
||||
}
|
||||
|
||||
@@ -463,7 +463,7 @@ class _BillsPageState extends State<BillsPage> with SingleTickerProviderStateMix
|
||||
}
|
||||
|
||||
// ============================================
|
||||
// 通用组件
|
||||
// 通用組件
|
||||
// ============================================
|
||||
Widget _buildEmptyState(IconData icon, String text) {
|
||||
final colorScheme = Theme.of(context).colorScheme;
|
||||
|
||||
@@ -6,7 +6,7 @@ import '../../../core/theme/app_color_scheme.dart';
|
||||
import '../../../core/theme/app_spacing.dart';
|
||||
import '../../../providers/auth_provider.dart';
|
||||
|
||||
/// 首页顶栏 - Logo + 搜索/通知/头像
|
||||
/// 首頁頂欄 - Logo + 搜索/通知/頭像
|
||||
class HeaderBar extends StatelessWidget {
|
||||
const HeaderBar({super.key});
|
||||
|
||||
|
||||
@@ -20,7 +20,7 @@ import 'hot_coins_section.dart';
|
||||
import 'profit_analysis_page.dart';
|
||||
import 'bills_page.dart';
|
||||
|
||||
/// 首页
|
||||
/// 首頁
|
||||
class HomePage extends StatefulWidget {
|
||||
const HomePage({super.key});
|
||||
|
||||
@@ -105,13 +105,13 @@ class _HomePageState extends State<HomePage>
|
||||
// Header
|
||||
HeaderBar(),
|
||||
SizedBox(height: AppSpacing.md),
|
||||
// 资产卡片(含预估盈亏)
|
||||
// 資產卡片(含預估盈虧)
|
||||
_AssetCard(
|
||||
overview: provider.overview,
|
||||
onDeposit: _showDeposit,
|
||||
),
|
||||
SizedBox(height: AppSpacing.md),
|
||||
// 快捷操作栏
|
||||
// 快捷操作欄
|
||||
QuickActionsRow(
|
||||
onDeposit: _showDeposit,
|
||||
onWithdraw: _showWithdraw,
|
||||
@@ -129,10 +129,10 @@ class _HomePageState extends State<HomePage>
|
||||
),
|
||||
),
|
||||
SizedBox(height: AppSpacing.lg),
|
||||
// 热门币种
|
||||
// 熱門幣種
|
||||
HotCoinsSection(),
|
||||
SizedBox(height: AppSpacing.lg),
|
||||
// 持仓
|
||||
// 持倉
|
||||
_HoldingsSection(holdings: provider.holdings),
|
||||
],
|
||||
),
|
||||
@@ -174,7 +174,7 @@ class _HomePageState extends State<HomePage>
|
||||
}
|
||||
}
|
||||
|
||||
/// 资产卡片(含预估盈亏)
|
||||
/// 資產卡片(含預估盈虧)
|
||||
class _AssetCard extends StatefulWidget {
|
||||
final AssetOverview? overview;
|
||||
final VoidCallback onDeposit;
|
||||
@@ -197,7 +197,7 @@ class _AssetCardState extends State<_AssetCard> {
|
||||
@override
|
||||
void didUpdateWidget(covariant _AssetCard oldWidget) {
|
||||
super.didUpdateWidget(oldWidget);
|
||||
// overview 更新时重新加载盈亏数据
|
||||
// overview 更新時重新加載盈虧數據
|
||||
if (widget.overview != oldWidget.overview) {
|
||||
_loadProfit();
|
||||
}
|
||||
@@ -239,7 +239,7 @@ class _AssetCardState extends State<_AssetCard> {
|
||||
final upColor = context.appColors.up;
|
||||
final downColor = context.appColors.down;
|
||||
|
||||
// 总资产
|
||||
// 總資產
|
||||
final totalAsset = widget.overview?.totalAsset ?? '0.00';
|
||||
final displayAsset = _formatAsset(totalAsset);
|
||||
|
||||
@@ -249,12 +249,12 @@ class _AssetCardState extends State<_AssetCard> {
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
// 顶部行:总资产标签 + 充值按钮
|
||||
// 頂部行:總資產標籤 + 充值按鈕
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Text(
|
||||
'预估总资产(USDT)',
|
||||
'預估總資產(USDT)',
|
||||
style: AppTextStyles.bodyLarge(context),
|
||||
),
|
||||
GestureDetector(
|
||||
@@ -284,7 +284,7 @@ class _AssetCardState extends State<_AssetCard> {
|
||||
),
|
||||
SizedBox(height: AppSpacing.sm),
|
||||
|
||||
// 总资产金额
|
||||
// 總資產金額
|
||||
Text(
|
||||
displayAsset,
|
||||
style: AppTextStyles.displayLarge(context).copyWith(
|
||||
@@ -293,13 +293,13 @@ class _AssetCardState extends State<_AssetCard> {
|
||||
),
|
||||
SizedBox(height: AppSpacing.md),
|
||||
|
||||
// 盈亏统计区:预估今日盈亏 | 预估总盈亏
|
||||
// 盈虧統計區:預估今日盈虧 | 預估總盈虧
|
||||
Row(
|
||||
children: [
|
||||
// 预估今日盈亏
|
||||
// 預估今日盈虧
|
||||
Expanded(
|
||||
child: _ProfitStatCard(
|
||||
label: '预估今日盈亏',
|
||||
label: '預估今日盈虧',
|
||||
value: _todayProfit,
|
||||
upColor: upColor,
|
||||
downColor: downColor,
|
||||
@@ -310,10 +310,10 @@ class _AssetCardState extends State<_AssetCard> {
|
||||
),
|
||||
),
|
||||
SizedBox(width: AppSpacing.sm),
|
||||
// 预估总盈亏
|
||||
// 預估總盈虧
|
||||
Expanded(
|
||||
child: _ProfitStatCard(
|
||||
label: '预估总盈亏',
|
||||
label: '預估總盈虧',
|
||||
value: _totalProfit,
|
||||
upColor: upColor,
|
||||
downColor: downColor,
|
||||
@@ -357,7 +357,7 @@ class _WelfareCard extends StatelessWidget {
|
||||
),
|
||||
child: Row(
|
||||
children: [
|
||||
// 左侧图标
|
||||
// 左側圖標
|
||||
Container(
|
||||
width: 48,
|
||||
height: 48,
|
||||
@@ -372,7 +372,7 @@ class _WelfareCard extends StatelessWidget {
|
||||
),
|
||||
),
|
||||
SizedBox(width: AppSpacing.md),
|
||||
// 中间文字
|
||||
// 中間文字
|
||||
Expanded(
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
@@ -386,14 +386,14 @@ class _WelfareCard extends StatelessWidget {
|
||||
SizedBox(height: AppSpacing.xs),
|
||||
Text(
|
||||
totalClaimable > 0
|
||||
? '您有 $totalClaimable 个奖励待领取'
|
||||
: '首充奖励 + 推广奖励',
|
||||
? '您有 $totalClaimable 個獎勵待領取'
|
||||
: '首充獎勵 + 推廣獎勵',
|
||||
style: AppTextStyles.bodyMedium(context),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
// 右侧按钮
|
||||
// 右側按鈕
|
||||
Container(
|
||||
padding: EdgeInsets.symmetric(
|
||||
horizontal: AppSpacing.md,
|
||||
@@ -440,7 +440,7 @@ class _WelfareCard extends StatelessWidget {
|
||||
}
|
||||
}
|
||||
|
||||
/// 持仓部分
|
||||
/// 持倉部分
|
||||
class _HoldingsSection extends StatelessWidget {
|
||||
final List<AccountTrade> holdings;
|
||||
|
||||
@@ -454,7 +454,7 @@ class _HoldingsSection extends StatelessWidget {
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Text(
|
||||
'我的持仓',
|
||||
'我的持倉',
|
||||
style: AppTextStyles.headlineLarge(context).copyWith(
|
||||
fontWeight: FontWeight.bold,
|
||||
),
|
||||
@@ -467,7 +467,7 @@ class _HoldingsSection extends StatelessWidget {
|
||||
),
|
||||
child: Row(
|
||||
children: [
|
||||
Text('资产详情',
|
||||
Text('資產詳情',
|
||||
style: AppTextStyles.headlineSmall(context).copyWith(
|
||||
fontWeight: FontWeight.bold,
|
||||
)),
|
||||
@@ -486,7 +486,7 @@ class _HoldingsSection extends StatelessWidget {
|
||||
}
|
||||
}
|
||||
|
||||
/// 空持仓
|
||||
/// 空持倉
|
||||
class _EmptyHoldings extends StatelessWidget {
|
||||
const _EmptyHoldings();
|
||||
|
||||
@@ -505,7 +505,7 @@ class _EmptyHoldings extends StatelessWidget {
|
||||
Icon(LucideIcons.wallet, size: 48, color: context.colors.onSurfaceVariant),
|
||||
SizedBox(height: AppSpacing.md),
|
||||
Text(
|
||||
'暂无持仓',
|
||||
'暫無持倉',
|
||||
style: AppTextStyles.headlineMedium(context).copyWith(
|
||||
fontWeight: FontWeight.w600,
|
||||
),
|
||||
@@ -521,7 +521,7 @@ class _EmptyHoldings extends StatelessWidget {
|
||||
}
|
||||
}
|
||||
|
||||
/// 持仓列表
|
||||
/// 持倉列表
|
||||
class _HoldingsList extends StatelessWidget {
|
||||
final List<AccountTrade> holdings;
|
||||
|
||||
@@ -554,7 +554,7 @@ class _HoldingsList extends StatelessWidget {
|
||||
}
|
||||
}
|
||||
|
||||
/// 持仓项
|
||||
/// 持倉項
|
||||
class _HoldingItem extends StatelessWidget {
|
||||
final AccountTrade holding;
|
||||
|
||||
@@ -615,7 +615,7 @@ class _HoldingItem extends StatelessWidget {
|
||||
}
|
||||
}
|
||||
|
||||
/// 盈亏统计小卡片
|
||||
/// 盈虧統計小卡片
|
||||
class _ProfitStatCard extends StatelessWidget {
|
||||
final String label;
|
||||
final double value;
|
||||
|
||||
@@ -4,7 +4,7 @@ import '../../../core/theme/app_theme.dart';
|
||||
import '../../../core/theme/app_spacing.dart';
|
||||
import '../../../core/theme/app_theme_extension.dart';
|
||||
|
||||
/// 首页热门币种区块
|
||||
/// 首頁熱門幣種區塊
|
||||
class HotCoinsSection extends StatelessWidget {
|
||||
const HotCoinsSection({super.key});
|
||||
|
||||
@@ -19,7 +19,7 @@ class HotCoinsSection extends StatelessWidget {
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Text(
|
||||
'热门币种',
|
||||
'熱門幣種',
|
||||
style: AppTextStyles.headlineLarge(context),
|
||||
),
|
||||
Text(
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -3,7 +3,7 @@ import 'package:shadcn_ui/shadcn_ui.dart';
|
||||
import '../../../core/theme/app_theme.dart';
|
||||
import '../../../core/theme/app_spacing.dart';
|
||||
|
||||
/// 首页快捷操作栏 - 充值/提现/划转/盈亏/账单
|
||||
/// 首頁快捷操作欄 - 充值/提現/劃轉/盈虧/賬單
|
||||
class QuickActionsRow extends StatelessWidget {
|
||||
const QuickActionsRow({
|
||||
super.key,
|
||||
@@ -56,25 +56,25 @@ class QuickActionsRow extends StatelessWidget {
|
||||
),
|
||||
_ActionItem(
|
||||
icon: LucideIcons.arrowDownLeft,
|
||||
label: '提现',
|
||||
label: '提現',
|
||||
colorScheme: colorScheme,
|
||||
onTap: onWithdraw,
|
||||
),
|
||||
_ActionItem(
|
||||
icon: LucideIcons.repeat,
|
||||
label: '划转',
|
||||
label: '劃轉',
|
||||
colorScheme: colorScheme,
|
||||
onTap: onTransfer,
|
||||
),
|
||||
_ActionItem(
|
||||
icon: LucideIcons.chartPie,
|
||||
label: '盈亏',
|
||||
label: '盈虧',
|
||||
colorScheme: colorScheme,
|
||||
onTap: onProfit,
|
||||
),
|
||||
_ActionItem(
|
||||
icon: LucideIcons.fileText,
|
||||
label: '账单',
|
||||
label: '賬單',
|
||||
colorScheme: colorScheme,
|
||||
onTap: onBills,
|
||||
),
|
||||
@@ -105,7 +105,7 @@ class _ActionItem extends StatelessWidget {
|
||||
? const Color(0xFF1E293B)
|
||||
: const Color(0xFFF3F4F6);
|
||||
|
||||
// Light: #4B5563, Dark: 根据主题
|
||||
// Light: #4B5563, Dark: 根據主題
|
||||
final iconColor = isDark
|
||||
? colorScheme.onSurfaceVariant
|
||||
: const Color(0xFF4B5563);
|
||||
|
||||
Reference in New Issue
Block a user