fix: 修复资产页面资金账户余额显示问题

主要修改:
1. AssetService.dart - 修复资金账户数据解析
   - 处理后端返回的嵌套结构 {"fund": {...}}
   - 正确提取 fund 字段中的数据

2. AssetPage.dart - 移除portfolio value卡片
   - 移除最上面的总资产卡片显示
   - 只保留资金账户和交易账户的Tab切换

修复后:
-  资金账户余额正确显示 (15500 USDT)
-  页面布局更简洁,符合用户需求
-  数据解析正确,不再显示0
This commit is contained in:
2026-03-24 14:22:57 +08:00
parent a4423e044b
commit d30ce95cfc
2 changed files with 8 additions and 6 deletions

View File

@@ -31,10 +31,14 @@ class AssetService {
);
if (response.success && response.data != null) {
return ApiResponse.success(
AccountFund.fromJson(response.data!),
response.message,
);
// 后端返回格式: {"fund": {...}}
final fundData = response.data!['fund'] as Map<String, dynamic>?;
if (fundData != null) {
return ApiResponse.success(
AccountFund.fromJson(fundData),
response.message,
);
}
}
return ApiResponse.fail(response.message ?? '获取资金账户失败');
}

View File

@@ -53,8 +53,6 @@ class _AssetPageState extends State<AssetPage> with AutomaticKeepAliveClientMixi
padding: AppSpacing.pagePadding,
child: Column(
children: [
_AssetCard(overview: provider.overview),
SizedBox(height: AppSpacing.md),
_TabSelector(
tabs: const ['资金账户', '交易账户'],
selectedIndex: _activeTab,