111
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user