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

@@ -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;