111
This commit is contained in:
@@ -5,7 +5,6 @@ import '../../../core/theme/app_spacing.dart';
|
|||||||
import '../../../core/theme/app_theme.dart';
|
import '../../../core/theme/app_theme.dart';
|
||||||
import '../../../core/event/app_event_bus.dart';
|
import '../../../core/event/app_event_bus.dart';
|
||||||
import '../../../providers/asset_provider.dart';
|
import '../../../providers/asset_provider.dart';
|
||||||
import 'components/account_tab_switcher.dart';
|
|
||||||
import 'components/action_buttons_row.dart';
|
import 'components/action_buttons_row.dart';
|
||||||
import 'components/asset_dialogs.dart';
|
import 'components/asset_dialogs.dart';
|
||||||
import 'components/balance_card.dart';
|
import 'components/balance_card.dart';
|
||||||
@@ -23,7 +22,6 @@ class AssetPage extends StatefulWidget {
|
|||||||
}
|
}
|
||||||
|
|
||||||
class _AssetPageState extends State<AssetPage> with AutomaticKeepAliveClientMixin {
|
class _AssetPageState extends State<AssetPage> with AutomaticKeepAliveClientMixin {
|
||||||
int _activeTab = 0;
|
|
||||||
StreamSubscription<AppEvent>? _eventSub;
|
StreamSubscription<AppEvent>? _eventSub;
|
||||||
|
|
||||||
@override
|
@override
|
||||||
@@ -76,7 +74,7 @@ class _AssetPageState extends State<AssetPage> with AutomaticKeepAliveClientMixi
|
|||||||
child: Column(
|
child: Column(
|
||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
children: [
|
children: [
|
||||||
// Page title: "资产" 22px bold — matching .pen titleFrame padding [16,0,8,0]
|
// Page title
|
||||||
Padding(
|
Padding(
|
||||||
padding: const EdgeInsets.only(top: 16, bottom: 8),
|
padding: const EdgeInsets.only(top: 16, bottom: 8),
|
||||||
child: Text(
|
child: Text(
|
||||||
@@ -85,16 +83,25 @@ class _AssetPageState extends State<AssetPage> with AutomaticKeepAliveClientMixi
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
const SizedBox(height: AppSpacing.sm),
|
const SizedBox(height: AppSpacing.sm),
|
||||||
// Account tab switcher — pill-style matching .pen UE6xC
|
// 资金账户 + 交易账户 左右并排
|
||||||
AccountTabSwitcher(
|
Row(
|
||||||
selectedIndex: _activeTab,
|
children: [
|
||||||
onChanged: (index) => setState(() => _activeTab = index),
|
Expanded(
|
||||||
),
|
child: BalanceCard(
|
||||||
const SizedBox(height: AppSpacing.md),
|
provider: provider,
|
||||||
// Balance card — matching .pen 59637 (cornerRadius lg, stroke, padding 20, gap 12)
|
label: '资金账户',
|
||||||
BalanceCard(
|
balance: provider.fundAccount?.balance ?? provider.overview?.fundBalance ?? '0.00',
|
||||||
provider: provider,
|
),
|
||||||
activeTab: _activeTab,
|
),
|
||||||
|
const SizedBox(width: AppSpacing.sm),
|
||||||
|
Expanded(
|
||||||
|
child: BalanceCard(
|
||||||
|
provider: provider,
|
||||||
|
label: '交易账户',
|
||||||
|
balance: _calculateTradeTotal(provider),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
),
|
),
|
||||||
const SizedBox(height: AppSpacing.md),
|
const SizedBox(height: AppSpacing.md),
|
||||||
// Action buttons row — matching .pen pIpHe (gap 12)
|
// Action buttons row — matching .pen pIpHe (gap 12)
|
||||||
@@ -112,8 +119,8 @@ class _AssetPageState extends State<AssetPage> with AutomaticKeepAliveClientMixi
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
const SizedBox(height: AppSpacing.md),
|
const SizedBox(height: AppSpacing.md),
|
||||||
// Holdings section — matching .pen th9BG + 6X6tC
|
// Holdings section
|
||||||
HoldingsSection(holdings: _activeTab == 1 ? provider.holdings : []),
|
HoldingsSection(holdings: provider.holdings),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
@@ -123,6 +130,14 @@ class _AssetPageState extends State<AssetPage> with AutomaticKeepAliveClientMixi
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
String _calculateTradeTotal(AssetProvider provider) {
|
||||||
|
double total = 0;
|
||||||
|
for (var h in provider.holdings) {
|
||||||
|
total += double.tryParse(h.currentValue?.toString() ?? '0') ?? 0;
|
||||||
|
}
|
||||||
|
return total.toStringAsFixed(2);
|
||||||
|
}
|
||||||
|
|
||||||
void _navigateToTransfer(BuildContext context) async {
|
void _navigateToTransfer(BuildContext context) async {
|
||||||
final result = await Navigator.push<bool>(
|
final result = await Navigator.push<bool>(
|
||||||
context,
|
context,
|
||||||
|
|||||||
@@ -360,177 +360,268 @@ void showWithdrawDialog(BuildContext context, String? balance) {
|
|||||||
final addressController = TextEditingController();
|
final addressController = TextEditingController();
|
||||||
final contactController = TextEditingController();
|
final contactController = TextEditingController();
|
||||||
final formKey = GlobalKey<ShadFormState>();
|
final formKey = GlobalKey<ShadFormState>();
|
||||||
|
final feeNotifier = ValueNotifier<String>('提现将扣除10%手续费');
|
||||||
|
final networksNotifier = ValueNotifier<List<String>>([]);
|
||||||
|
final selectedNetworkNotifier = ValueNotifier<String?>(null);
|
||||||
final colorScheme = Theme.of(context).colorScheme;
|
final colorScheme = Theme.of(context).colorScheme;
|
||||||
final isDark = Theme.of(context).brightness == Brightness.dark;
|
final isDark = Theme.of(context).brightness == Brightness.dark;
|
||||||
|
|
||||||
|
amountController.addListener(() {
|
||||||
|
final amount = double.tryParse(amountController.text) ?? 0;
|
||||||
|
if (amount > 0) {
|
||||||
|
final fee = amount * 0.1;
|
||||||
|
final receivable = amount - fee;
|
||||||
|
feeNotifier.value = '手续费(10%): -${fee.toStringAsFixed(2)} USDT | 应收款: ${receivable.toStringAsFixed(2)} USDT';
|
||||||
|
} else {
|
||||||
|
feeNotifier.value = '提现将扣除10%手续费';
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
// 获取网络列表
|
||||||
|
context.read<AssetProvider>().getWalletNetworks().then((list) {
|
||||||
|
networksNotifier.value = list;
|
||||||
|
if (list.isNotEmpty) {
|
||||||
|
selectedNetworkNotifier.value = list.first;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
showShadDialog(
|
showShadDialog(
|
||||||
context: context,
|
context: context,
|
||||||
builder: (ctx) => Dialog(
|
builder: (ctx) => StatefulBuilder(
|
||||||
backgroundColor: const Color(0x00000000),
|
builder: (ctx, setState) => Dialog(
|
||||||
child: GlassPanel(
|
backgroundColor: const Color(0x00000000),
|
||||||
borderRadius: BorderRadius.circular(AppRadius.lg),
|
child: GlassPanel(
|
||||||
padding: const EdgeInsets.all(AppSpacing.lg),
|
borderRadius: BorderRadius.circular(AppRadius.lg),
|
||||||
child: SingleChildScrollView(
|
padding: const EdgeInsets.all(AppSpacing.lg),
|
||||||
child: Column(
|
child: SingleChildScrollView(
|
||||||
mainAxisSize: MainAxisSize.min,
|
child: Column(
|
||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
mainAxisSize: MainAxisSize.min,
|
||||||
children: [
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
Row(
|
children: [
|
||||||
children: [
|
Row(
|
||||||
Container(
|
children: [
|
||||||
padding: const EdgeInsets.all(AppSpacing.sm),
|
Container(
|
||||||
decoration: BoxDecoration(
|
padding: const EdgeInsets.all(AppSpacing.sm),
|
||||||
color: colorScheme.primary.withValues(alpha: 0.1),
|
decoration: BoxDecoration(
|
||||||
borderRadius: BorderRadius.circular(AppRadius.md),
|
color: colorScheme.primary.withValues(alpha: 0.1),
|
||||||
|
borderRadius: BorderRadius.circular(AppRadius.md),
|
||||||
|
),
|
||||||
|
child: Icon(
|
||||||
|
LucideIcons.wallet,
|
||||||
|
color: colorScheme.primary,
|
||||||
|
),
|
||||||
),
|
),
|
||||||
child: Icon(
|
const SizedBox(width: AppSpacing.sm),
|
||||||
LucideIcons.wallet,
|
Text(
|
||||||
color: colorScheme.primary,
|
'提现',
|
||||||
|
style: AppTextStyles.headlineLarge(context).copyWith(
|
||||||
|
fontWeight: FontWeight.w700,
|
||||||
|
),
|
||||||
),
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
const SizedBox(height: AppSpacing.xs),
|
||||||
|
Text(
|
||||||
|
'安全地将您的资产转移到外部钱包地址',
|
||||||
|
style: AppTextStyles.bodyMedium(context).copyWith(
|
||||||
|
color: colorScheme.onSurfaceVariant,
|
||||||
),
|
),
|
||||||
const SizedBox(width: AppSpacing.sm),
|
),
|
||||||
Text(
|
if (balance != null) ...[
|
||||||
'提现',
|
const SizedBox(height: AppSpacing.md),
|
||||||
style: AppTextStyles.headlineLarge(context).copyWith(
|
Container(
|
||||||
fontWeight: FontWeight.w700,
|
padding: const EdgeInsets.symmetric(
|
||||||
|
horizontal: AppSpacing.md,
|
||||||
|
vertical: AppSpacing.sm,
|
||||||
|
),
|
||||||
|
decoration: BoxDecoration(
|
||||||
|
color: AppColorScheme.getUpBackgroundColor(isDark),
|
||||||
|
borderRadius: BorderRadius.circular(AppRadius.full),
|
||||||
|
border: Border.all(
|
||||||
|
color: AppColorScheme.getUpColor(isDark).withValues(alpha: 0.2),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
child: Row(
|
||||||
|
mainAxisSize: MainAxisSize.min,
|
||||||
|
children: [
|
||||||
|
Text(
|
||||||
|
'可用余额: ',
|
||||||
|
style: AppTextStyles.bodySmall(context).copyWith(
|
||||||
|
color: colorScheme.onSurfaceVariant,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
Text(
|
||||||
|
'$balance USDT',
|
||||||
|
style: AppTextStyles.labelLarge(context).copyWith(
|
||||||
|
fontWeight: FontWeight.bold,
|
||||||
|
color: AppColorScheme.getUpColor(isDark),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
),
|
const SizedBox(height: AppSpacing.lg),
|
||||||
const SizedBox(height: AppSpacing.xs),
|
ShadForm(
|
||||||
Text(
|
key: formKey,
|
||||||
'安全地将您的资产转移到外部钱包地址',
|
child: Column(
|
||||||
style: AppTextStyles.bodyMedium(context).copyWith(
|
|
||||||
color: colorScheme.onSurfaceVariant,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
if (balance != null) ...[
|
|
||||||
const SizedBox(height: AppSpacing.md),
|
|
||||||
Container(
|
|
||||||
padding: const EdgeInsets.symmetric(
|
|
||||||
horizontal: AppSpacing.md,
|
|
||||||
vertical: AppSpacing.sm,
|
|
||||||
),
|
|
||||||
decoration: BoxDecoration(
|
|
||||||
color: AppColorScheme.getUpBackgroundColor(isDark),
|
|
||||||
borderRadius: BorderRadius.circular(AppRadius.full),
|
|
||||||
border: Border.all(
|
|
||||||
color: AppColorScheme.getUpColor(isDark).withValues(alpha: 0.2),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
child: Row(
|
|
||||||
mainAxisSize: MainAxisSize.min,
|
|
||||||
children: [
|
children: [
|
||||||
Text(
|
ShadInputFormField(
|
||||||
'可用余额: ',
|
id: 'amount',
|
||||||
style: AppTextStyles.bodySmall(context).copyWith(
|
controller: amountController,
|
||||||
color: colorScheme.onSurfaceVariant,
|
label: const Text('提现金额'),
|
||||||
|
placeholder: const Text('请输入提现金额(USDT)'),
|
||||||
|
keyboardType: const TextInputType.numberWithOptions(decimal: true),
|
||||||
|
validator: Validators.amount,
|
||||||
|
),
|
||||||
|
const SizedBox(height: AppSpacing.xs),
|
||||||
|
// 手续费提示
|
||||||
|
Container(
|
||||||
|
padding: const EdgeInsets.symmetric(
|
||||||
|
horizontal: AppSpacing.md,
|
||||||
|
vertical: AppSpacing.sm,
|
||||||
|
),
|
||||||
|
decoration: BoxDecoration(
|
||||||
|
color: Colors.orange.withValues(alpha: 0.1),
|
||||||
|
borderRadius: BorderRadius.circular(AppRadius.md),
|
||||||
|
border: Border.all(color: Colors.orange.withValues(alpha: 0.3)),
|
||||||
|
),
|
||||||
|
child: Row(
|
||||||
|
children: [
|
||||||
|
Icon(Icons.info_outline, size: 14, color: Colors.orange),
|
||||||
|
const SizedBox(width: AppSpacing.xs),
|
||||||
|
Expanded(
|
||||||
|
child: ValueListenableBuilder<String>(
|
||||||
|
valueListenable: feeNotifier,
|
||||||
|
builder: (_, text, __) => Text(
|
||||||
|
text,
|
||||||
|
style: TextStyle(fontSize: 11, color: Colors.orange.shade800),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
Text(
|
const SizedBox(height: AppSpacing.md),
|
||||||
'$balance USDT',
|
// 提现网络选择
|
||||||
style: AppTextStyles.labelLarge(context).copyWith(
|
ValueListenableBuilder<List<String>>(
|
||||||
fontWeight: FontWeight.bold,
|
valueListenable: networksNotifier,
|
||||||
color: AppColorScheme.getUpColor(isDark),
|
builder: (_, networks, __) {
|
||||||
),
|
if (networks.isEmpty) return const SizedBox.shrink();
|
||||||
|
return Column(
|
||||||
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
|
children: [
|
||||||
|
Text(
|
||||||
|
'提现网络',
|
||||||
|
style: AppTextStyles.bodySmall(context).copyWith(
|
||||||
|
color: colorScheme.onSurfaceVariant,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
const SizedBox(height: 4),
|
||||||
|
SizedBox(
|
||||||
|
width: double.infinity,
|
||||||
|
child: ValueListenableBuilder<String?>(
|
||||||
|
valueListenable: selectedNetworkNotifier,
|
||||||
|
builder: (_, selected, __) => ShadSelect<String>(
|
||||||
|
initialValue: selected ?? networks.first,
|
||||||
|
placeholder: const Text('选择提现网络'),
|
||||||
|
onChanged: (value) {
|
||||||
|
selectedNetworkNotifier.value = value;
|
||||||
|
},
|
||||||
|
selectedOptionBuilder: (context, value) => Text(value),
|
||||||
|
options: networks.map((network) => ShadOption<String>(
|
||||||
|
value: network,
|
||||||
|
child: Text(network),
|
||||||
|
)),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
);
|
||||||
|
},
|
||||||
|
),
|
||||||
|
const SizedBox(height: AppSpacing.md),
|
||||||
|
ShadInputFormField(
|
||||||
|
id: 'address',
|
||||||
|
controller: addressController,
|
||||||
|
label: const Text('目标地址'),
|
||||||
|
placeholder: const Text('请输入提现地址'),
|
||||||
|
validator: (v) => Validators.required(v, '提现地址'),
|
||||||
|
),
|
||||||
|
const SizedBox(height: AppSpacing.md),
|
||||||
|
ShadInputFormField(
|
||||||
|
id: 'contact',
|
||||||
|
controller: contactController,
|
||||||
|
label: const Text('联系方式(可选)'),
|
||||||
|
placeholder: const Text('联系方式'),
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
],
|
const SizedBox(height: AppSpacing.lg),
|
||||||
const SizedBox(height: AppSpacing.lg),
|
Row(
|
||||||
ShadForm(
|
|
||||||
key: formKey,
|
|
||||||
child: Column(
|
|
||||||
children: [
|
children: [
|
||||||
ShadInputFormField(
|
Expanded(
|
||||||
id: 'amount',
|
child: NeonButton(
|
||||||
controller: amountController,
|
text: '取消',
|
||||||
label: const Text('提现金额'),
|
type: NeonButtonType.outline,
|
||||||
placeholder: const Text('请输入提现金额(USDT)'),
|
onPressed: () => Navigator.of(ctx).pop(),
|
||||||
keyboardType: const TextInputType.numberWithOptions(decimal: true),
|
height: 44,
|
||||||
validator: Validators.amount,
|
showGlow: false,
|
||||||
|
),
|
||||||
),
|
),
|
||||||
const SizedBox(height: AppSpacing.md),
|
const SizedBox(width: AppSpacing.sm),
|
||||||
ShadInputFormField(
|
Expanded(
|
||||||
id: 'address',
|
child: NeonButton(
|
||||||
controller: addressController,
|
text: '提交',
|
||||||
label: const Text('目标地址'),
|
type: NeonButtonType.primary,
|
||||||
placeholder: const Text('请输入提现地址'),
|
onPressed: () async {
|
||||||
validator: (v) => Validators.required(v, '提现地址'),
|
if (formKey.currentState!.saveAndValidate()) {
|
||||||
),
|
Navigator.of(ctx).pop();
|
||||||
const SizedBox(height: AppSpacing.md),
|
final response = await context.read<AssetProvider>().withdraw(
|
||||||
ShadInputFormField(
|
amount: amountController.text,
|
||||||
id: 'contact',
|
withdrawAddress: addressController.text,
|
||||||
controller: contactController,
|
network: selectedNetworkNotifier.value,
|
||||||
label: const Text('联系方式(可选)'),
|
withdrawContact: contactController.text.isNotEmpty
|
||||||
placeholder: const Text('联系方式'),
|
? contactController.text
|
||||||
|
: null,
|
||||||
|
);
|
||||||
|
if (context.mounted) {
|
||||||
|
showResultDialog(
|
||||||
|
context,
|
||||||
|
response.success ? '申请成功' : '申请失败',
|
||||||
|
response.success ? '请等待管理员审批' : response.message,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
height: 44,
|
||||||
|
showGlow: true,
|
||||||
|
),
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
const SizedBox(height: AppSpacing.md),
|
||||||
const SizedBox(height: AppSpacing.lg),
|
Row(
|
||||||
Row(
|
mainAxisAlignment: MainAxisAlignment.center,
|
||||||
children: [
|
children: [
|
||||||
Expanded(
|
Icon(
|
||||||
child: NeonButton(
|
Icons.verified_user,
|
||||||
text: '取消',
|
size: 12,
|
||||||
type: NeonButtonType.outline,
|
|
||||||
onPressed: () => Navigator.of(ctx).pop(),
|
|
||||||
height: 44,
|
|
||||||
showGlow: false,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
const SizedBox(width: AppSpacing.sm),
|
|
||||||
Expanded(
|
|
||||||
child: NeonButton(
|
|
||||||
text: '提交',
|
|
||||||
type: NeonButtonType.primary,
|
|
||||||
onPressed: () async {
|
|
||||||
if (formKey.currentState!.saveAndValidate()) {
|
|
||||||
Navigator.of(ctx).pop();
|
|
||||||
final response = await context.read<AssetProvider>().withdraw(
|
|
||||||
amount: amountController.text,
|
|
||||||
withdrawAddress: addressController.text,
|
|
||||||
withdrawContact: contactController.text.isNotEmpty
|
|
||||||
? contactController.text
|
|
||||||
: null,
|
|
||||||
);
|
|
||||||
if (context.mounted) {
|
|
||||||
showResultDialog(
|
|
||||||
context,
|
|
||||||
response.success ? '申请成功' : '申请失败',
|
|
||||||
response.success ? '请等待管理员审批' : response.message,
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
height: 44,
|
|
||||||
showGlow: true,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
const SizedBox(height: AppSpacing.md),
|
|
||||||
Row(
|
|
||||||
mainAxisAlignment: MainAxisAlignment.center,
|
|
||||||
children: [
|
|
||||||
Icon(
|
|
||||||
Icons.verified_user,
|
|
||||||
size: 12,
|
|
||||||
color: colorScheme.onSurfaceVariant.withValues(alpha: 0.5),
|
|
||||||
),
|
|
||||||
const SizedBox(width: AppSpacing.xs),
|
|
||||||
Text(
|
|
||||||
'End-to-End Encrypted Transaction',
|
|
||||||
style: AppTextStyles.bodySmall(context).copyWith(
|
|
||||||
fontSize: 10,
|
|
||||||
color: colorScheme.onSurfaceVariant.withValues(alpha: 0.5),
|
color: colorScheme.onSurfaceVariant.withValues(alpha: 0.5),
|
||||||
),
|
),
|
||||||
),
|
const SizedBox(width: AppSpacing.xs),
|
||||||
],
|
Text(
|
||||||
),
|
'End-to-End Encrypted Transaction',
|
||||||
],
|
style: AppTextStyles.bodySmall(context).copyWith(
|
||||||
|
fontSize: 10,
|
||||||
|
color: colorScheme.onSurfaceVariant.withValues(alpha: 0.5),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
|||||||
@@ -5,19 +5,17 @@ import '../../../../core/theme/app_spacing.dart';
|
|||||||
import '../../../../providers/asset_provider.dart';
|
import '../../../../providers/asset_provider.dart';
|
||||||
import '../../../components/glass_panel.dart';
|
import '../../../components/glass_panel.dart';
|
||||||
|
|
||||||
/// 余额卡片 — .pen node 59637
|
/// 余额卡片 — 显示单个账户的 USDT 余额
|
||||||
/// cornerRadius: lg, fill: $surface-card, padding: 20, stroke: $border-default 1px, gap: 12
|
|
||||||
/// balLabel: "USDT 余额" 12px normal $text-secondary
|
|
||||||
/// balAmount: "25,680.50" 28px w700 $text-primary
|
|
||||||
/// balSubRow: "≈ $25,680.50 USD" 12px normal $text-muted
|
|
||||||
class BalanceCard extends StatelessWidget {
|
class BalanceCard extends StatelessWidget {
|
||||||
final AssetProvider provider;
|
final AssetProvider provider;
|
||||||
final int activeTab;
|
final String label;
|
||||||
|
final String balance;
|
||||||
|
|
||||||
const BalanceCard({
|
const BalanceCard({
|
||||||
super.key,
|
super.key,
|
||||||
required this.provider,
|
required this.provider,
|
||||||
required this.activeTab,
|
required this.label,
|
||||||
|
required this.balance,
|
||||||
});
|
});
|
||||||
|
|
||||||
@override
|
@override
|
||||||
@@ -25,9 +23,7 @@ class BalanceCard extends StatelessWidget {
|
|||||||
final colorScheme = Theme.of(context).colorScheme;
|
final colorScheme = Theme.of(context).colorScheme;
|
||||||
final isDark = Theme.of(context).brightness == Brightness.dark;
|
final isDark = Theme.of(context).brightness == Brightness.dark;
|
||||||
|
|
||||||
final displayBalance = activeTab == 0
|
final displayBalance = balance;
|
||||||
? (provider.fundAccount?.balance ?? provider.overview?.fundBalance ?? '0.00')
|
|
||||||
: _calculateTradeTotal();
|
|
||||||
|
|
||||||
return GlassPanel(
|
return GlassPanel(
|
||||||
padding: const EdgeInsets.all(20),
|
padding: const EdgeInsets.all(20),
|
||||||
@@ -36,7 +32,7 @@ class BalanceCard extends StatelessWidget {
|
|||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
children: [
|
children: [
|
||||||
Text(
|
Text(
|
||||||
'USDT 余额',
|
label,
|
||||||
style: AppTextStyles.bodyMedium(context).copyWith(
|
style: AppTextStyles.bodyMedium(context).copyWith(
|
||||||
color: colorScheme.onSurfaceVariant,
|
color: colorScheme.onSurfaceVariant,
|
||||||
fontWeight: FontWeight.w400,
|
fontWeight: FontWeight.w400,
|
||||||
@@ -60,14 +56,6 @@ class BalanceCard extends StatelessWidget {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
String _calculateTradeTotal() {
|
|
||||||
double total = 0;
|
|
||||||
for (var h in provider.holdings) {
|
|
||||||
total += double.tryParse(h.currentValue?.toString() ?? '0') ?? 0;
|
|
||||||
}
|
|
||||||
return total.toStringAsFixed(2);
|
|
||||||
}
|
|
||||||
|
|
||||||
String _formatBalance(String balance) {
|
String _formatBalance(String balance) {
|
||||||
final d = double.tryParse(balance) ?? 0;
|
final d = double.tryParse(balance) ?? 0;
|
||||||
return d.toStringAsFixed(2).replaceAllMapped(
|
return d.toStringAsFixed(2).replaceAllMapped(
|
||||||
|
|||||||
@@ -5,8 +5,8 @@ import '../../../../core/theme/app_spacing.dart';
|
|||||||
import '../../../../data/models/account_models.dart';
|
import '../../../../data/models/account_models.dart';
|
||||||
import '../../../components/glass_panel.dart';
|
import '../../../components/glass_panel.dart';
|
||||||
|
|
||||||
/// 持仓区域 — .pen nodes th9BG (header) + 6X6tC (card)
|
/// 持仓区域
|
||||||
/// Holdings Header: "交易账户持仓" 16px w600 $text-primary | "查看全部 >" 12px normal $text-secondary
|
/// Header: "我的资产" + "查看全部 >"
|
||||||
/// Holdings Card: cornerRadius lg, fill $surface-card, stroke $border-default 1px
|
/// Holdings Card: cornerRadius lg, fill $surface-card, stroke $border-default 1px
|
||||||
class HoldingsSection extends StatelessWidget {
|
class HoldingsSection extends StatelessWidget {
|
||||||
final List holdings;
|
final List holdings;
|
||||||
@@ -19,14 +19,14 @@ class HoldingsSection extends StatelessWidget {
|
|||||||
|
|
||||||
return Column(
|
return Column(
|
||||||
children: [
|
children: [
|
||||||
// Header row: "交易账户持仓" + "查看全部 >"
|
// Header row: "我的资产" + "查看全部 >"
|
||||||
Padding(
|
Padding(
|
||||||
padding: const EdgeInsets.only(bottom: AppSpacing.sm),
|
padding: const EdgeInsets.only(bottom: AppSpacing.sm),
|
||||||
child: Row(
|
child: Row(
|
||||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||||
children: [
|
children: [
|
||||||
Text(
|
Text(
|
||||||
'交易账户持仓',
|
'我的资产',
|
||||||
style: AppTextStyles.headlineLarge(context),
|
style: AppTextStyles.headlineLarge(context),
|
||||||
),
|
),
|
||||||
Text(
|
Text(
|
||||||
|
|||||||
@@ -5,10 +5,8 @@ import '../../../../core/theme/app_color_scheme.dart';
|
|||||||
import '../../../../core/theme/app_spacing.dart';
|
import '../../../../core/theme/app_spacing.dart';
|
||||||
import '../../../components/glass_panel.dart';
|
import '../../../components/glass_panel.dart';
|
||||||
|
|
||||||
/// 充提记录链接行 — .pen node fLHtq
|
/// 订单记录链接行
|
||||||
/// cornerRadius: lg, fill: $surface-card, padding: [14, 16], stroke: $border-default 1px
|
/// cornerRadius: lg, fill: $surface-card, padding: [14, 16], stroke: $border-default 1px
|
||||||
/// recordsText: "充提记录" 14px w500 $text-primary
|
|
||||||
/// recordsChevron: lucide chevron-right 16px $text-muted
|
|
||||||
class RecordsLinkRow extends StatelessWidget {
|
class RecordsLinkRow extends StatelessWidget {
|
||||||
final VoidCallback onTap;
|
final VoidCallback onTap;
|
||||||
|
|
||||||
@@ -29,7 +27,7 @@ class RecordsLinkRow extends StatelessWidget {
|
|||||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||||
children: [
|
children: [
|
||||||
Text(
|
Text(
|
||||||
'充提记录',
|
'订单记录',
|
||||||
style: AppTextStyles.headlineMedium(context).copyWith(
|
style: AppTextStyles.headlineMedium(context).copyWith(
|
||||||
fontWeight: FontWeight.w500,
|
fontWeight: FontWeight.w500,
|
||||||
),
|
),
|
||||||
|
|||||||
@@ -17,8 +17,13 @@ import '../../../providers/auth_provider.dart';
|
|||||||
import '../../components/glass_panel.dart';
|
import '../../components/glass_panel.dart';
|
||||||
import '../../components/neon_glow.dart';
|
import '../../components/neon_glow.dart';
|
||||||
import '../main/main_page.dart';
|
import '../main/main_page.dart';
|
||||||
|
import '../asset/transfer_page.dart';
|
||||||
|
import '../asset/components/asset_dialogs.dart';
|
||||||
|
import '../asset/transfer_page.dart';
|
||||||
import '../mine/welfare_center_page.dart';
|
import '../mine/welfare_center_page.dart';
|
||||||
import 'header_bar.dart';
|
import 'header_bar.dart';
|
||||||
|
import 'profit_analysis_page.dart';
|
||||||
|
import 'bills_page.dart';
|
||||||
import 'quick_actions_row.dart';
|
import 'quick_actions_row.dart';
|
||||||
import 'hot_coins_section.dart';
|
import 'hot_coins_section.dart';
|
||||||
|
|
||||||
@@ -111,16 +116,16 @@ class _HomePageState extends State<HomePage>
|
|||||||
// 资产卡片(含总盈利 + 可折叠盈亏日历)
|
// 资产卡片(含总盈利 + 可折叠盈亏日历)
|
||||||
_AssetCard(
|
_AssetCard(
|
||||||
overview: provider.overview,
|
overview: provider.overview,
|
||||||
onDeposit: _showDeposit,
|
onDeposit: () => showDepositDialog(context),
|
||||||
),
|
),
|
||||||
SizedBox(height: AppSpacing.md),
|
SizedBox(height: AppSpacing.md),
|
||||||
// 快捷操作栏
|
// 快捷操作栏
|
||||||
QuickActionsRow(
|
QuickActionsRow(
|
||||||
onDeposit: _showDeposit,
|
onDeposit: () => showDepositDialog(context),
|
||||||
onWithdraw: () => _navigateToAssetPage(),
|
onWithdraw: () => showWithdrawDialog(context, provider.fundAccount?.balance),
|
||||||
onTransfer: () => _navigateToAssetPage(),
|
onTransfer: () => _navigateToTransfer(context),
|
||||||
onProfit: () {},
|
onProfit: () => Navigator.push(context, MaterialPageRoute(builder: (_) => const ProfitAnalysisPage())),
|
||||||
onBills: () => _navigateToAssetPage(),
|
onBills: () => Navigator.push(context, MaterialPageRoute(builder: (_) => const BillsPage())),
|
||||||
),
|
),
|
||||||
SizedBox(height: AppSpacing.md),
|
SizedBox(height: AppSpacing.md),
|
||||||
// 福利中心入口卡片
|
// 福利中心入口卡片
|
||||||
@@ -146,285 +151,19 @@ class _HomePageState extends State<HomePage>
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
void _showDeposit() {
|
/// 跳转到划转页面
|
||||||
final amountController = TextEditingController();
|
void _navigateToTransfer(BuildContext context) async {
|
||||||
final formKey = GlobalKey<ShadFormState>();
|
final result = await Navigator.push<bool>(
|
||||||
final colorScheme = Theme.of(context).colorScheme;
|
|
||||||
|
|
||||||
showShadDialog(
|
|
||||||
context: context,
|
|
||||||
builder: (ctx) => Dialog(
|
|
||||||
backgroundColor: Colors.transparent,
|
|
||||||
child: GlassPanel(
|
|
||||||
borderRadius: BorderRadius.circular(AppRadius.xxl),
|
|
||||||
padding: EdgeInsets.all(AppSpacing.lg),
|
|
||||||
child: Column(
|
|
||||||
mainAxisSize: MainAxisSize.min,
|
|
||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
|
||||||
children: [
|
|
||||||
Row(
|
|
||||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
||||||
children: [
|
|
||||||
Column(
|
|
||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
|
||||||
children: [
|
|
||||||
Text(
|
|
||||||
'充值',
|
|
||||||
style: AppTextStyles.headlineLarge(context).copyWith(
|
|
||||||
fontWeight: FontWeight.bold,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
SizedBox(height: AppSpacing.xs),
|
|
||||||
Text(
|
|
||||||
'资产: USDT',
|
|
||||||
style: AppTextStyles.bodyMedium(context),
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
Container(
|
|
||||||
padding: EdgeInsets.all(AppSpacing.sm),
|
|
||||||
decoration: BoxDecoration(
|
|
||||||
color: colorScheme.surfaceContainerHigh,
|
|
||||||
borderRadius: BorderRadius.circular(AppRadius.md),
|
|
||||||
),
|
|
||||||
child: Icon(LucideIcons.wallet, color: colorScheme.secondary),
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
SizedBox(height: AppSpacing.lg),
|
|
||||||
ShadForm(
|
|
||||||
key: formKey,
|
|
||||||
child: ShadInputFormField(
|
|
||||||
id: 'amount',
|
|
||||||
controller: amountController,
|
|
||||||
label: const Text('充值金额'),
|
|
||||||
placeholder: const Text('0.00'),
|
|
||||||
keyboardType: const TextInputType.numberWithOptions(decimal: true),
|
|
||||||
validator: (v) {
|
|
||||||
if (v == null || v.isEmpty) return '请输入金额';
|
|
||||||
final n = double.tryParse(v);
|
|
||||||
if (n == null || n <= 0) return '请输入有效金额';
|
|
||||||
return null;
|
|
||||||
},
|
|
||||||
),
|
|
||||||
),
|
|
||||||
SizedBox(height: AppSpacing.lg),
|
|
||||||
Row(
|
|
||||||
children: [
|
|
||||||
Expanded(
|
|
||||||
child: NeonButton(
|
|
||||||
text: '取消',
|
|
||||||
type: NeonButtonType.outline,
|
|
||||||
onPressed: () => Navigator.of(ctx).pop(),
|
|
||||||
height: 48,
|
|
||||||
showGlow: false,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
SizedBox(width: AppSpacing.sm),
|
|
||||||
Expanded(
|
|
||||||
child: NeonButton(
|
|
||||||
text: '下一步',
|
|
||||||
type: NeonButtonType.primary,
|
|
||||||
onPressed: () async {
|
|
||||||
if (formKey.currentState!.saveAndValidate()) {
|
|
||||||
Navigator.of(ctx).pop();
|
|
||||||
final response = await context
|
|
||||||
.read<AssetProvider>()
|
|
||||||
.deposit(amount: amountController.text);
|
|
||||||
if (mounted) {
|
|
||||||
if (response.success && response.data != null) {
|
|
||||||
_showDepositResultDialog(context, response.data!);
|
|
||||||
} else {
|
|
||||||
_showResultDialog(
|
|
||||||
'申请失败',
|
|
||||||
response.message ?? '请稍后重试',
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
height: 48,
|
|
||||||
showGlow: true,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
void _showDepositResultDialog(BuildContext context, Map<String, dynamic> data) {
|
|
||||||
final orderNo = data['orderNo'] as String? ?? '';
|
|
||||||
final amount = data['amount']?.toString() ?? '0.00';
|
|
||||||
final walletAddress = data['walletAddress'] as String? ?? '';
|
|
||||||
final walletNetwork = data['walletNetwork'] as String? ?? 'TRC20';
|
|
||||||
final colorScheme = Theme.of(context).colorScheme;
|
|
||||||
|
|
||||||
showShadDialog(
|
|
||||||
context: context,
|
|
||||||
builder: (ctx) => Dialog(
|
|
||||||
backgroundColor: Colors.transparent,
|
|
||||||
child: GlassPanel(
|
|
||||||
borderRadius: BorderRadius.circular(AppRadius.xxl),
|
|
||||||
padding: EdgeInsets.all(AppSpacing.lg),
|
|
||||||
child: Column(
|
|
||||||
mainAxisSize: MainAxisSize.min,
|
|
||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
|
||||||
children: [
|
|
||||||
Row(
|
|
||||||
children: [
|
|
||||||
NeonIcon(
|
|
||||||
icon: Icons.check_circle,
|
|
||||||
color: AppColorScheme.up,
|
|
||||||
size: 24,
|
|
||||||
),
|
|
||||||
SizedBox(width: AppSpacing.sm),
|
|
||||||
Text(
|
|
||||||
'充值申请成功',
|
|
||||||
style: AppTextStyles.headlineLarge(context).copyWith(
|
|
||||||
fontWeight: FontWeight.bold,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
SizedBox(height: AppSpacing.lg),
|
|
||||||
_InfoRow(label: '订单号', value: orderNo),
|
|
||||||
SizedBox(height: AppSpacing.sm),
|
|
||||||
_InfoRow(label: '充值金额', value: '$amount USDT', isBold: true),
|
|
||||||
SizedBox(height: AppSpacing.lg),
|
|
||||||
Text(
|
|
||||||
'请向以下地址转账:',
|
|
||||||
style: AppTextStyles.bodyMedium(context),
|
|
||||||
),
|
|
||||||
SizedBox(height: AppSpacing.sm),
|
|
||||||
_WalletAddressCard(address: walletAddress, network: walletNetwork),
|
|
||||||
SizedBox(height: AppSpacing.md),
|
|
||||||
Container(
|
|
||||||
padding: EdgeInsets.all(AppSpacing.sm),
|
|
||||||
decoration: BoxDecoration(
|
|
||||||
color: AppColorScheme.warning.withOpacity(0.1),
|
|
||||||
borderRadius: BorderRadius.circular(AppRadius.md),
|
|
||||||
border: Border.all(color: AppColorScheme.warning.withOpacity(0.2)),
|
|
||||||
),
|
|
||||||
child: Row(
|
|
||||||
children: [
|
|
||||||
Icon(Icons.info_outline, size: 16, color: AppColorScheme.warning),
|
|
||||||
SizedBox(width: AppSpacing.sm),
|
|
||||||
Expanded(
|
|
||||||
child: Text(
|
|
||||||
'转账完成后请点击"已打款"按钮确认',
|
|
||||||
style: AppTextStyles.bodyMedium(context).copyWith(
|
|
||||||
color: AppColorScheme.warning,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
),
|
|
||||||
SizedBox(height: AppSpacing.lg),
|
|
||||||
Row(
|
|
||||||
children: [
|
|
||||||
Expanded(
|
|
||||||
child: NeonButton(
|
|
||||||
text: '稍后确认',
|
|
||||||
type: NeonButtonType.outline,
|
|
||||||
onPressed: () {
|
|
||||||
Navigator.of(ctx).pop();
|
|
||||||
_navigateToAssetPage();
|
|
||||||
},
|
|
||||||
height: 44,
|
|
||||||
showGlow: false,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
SizedBox(width: AppSpacing.sm),
|
|
||||||
Expanded(
|
|
||||||
child: NeonButton(
|
|
||||||
text: '已打款',
|
|
||||||
type: NeonButtonType.primary,
|
|
||||||
onPressed: () async {
|
|
||||||
Navigator.of(ctx).pop();
|
|
||||||
final response = await context
|
|
||||||
.read<AssetProvider>()
|
|
||||||
.confirmPay(orderNo);
|
|
||||||
if (context.mounted) {
|
|
||||||
_showResultDialog(
|
|
||||||
response.success ? '确认成功' : '确认失败',
|
|
||||||
response.success ? '请等待管理员审核' : response.message,
|
|
||||||
);
|
|
||||||
_navigateToAssetPage();
|
|
||||||
}
|
|
||||||
},
|
|
||||||
height: 44,
|
|
||||||
showGlow: true,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
void _showResultDialog(String title, String? message) {
|
|
||||||
final colorScheme = Theme.of(context).colorScheme;
|
|
||||||
showShadDialog(
|
|
||||||
context: context,
|
|
||||||
builder: (ctx) => Dialog(
|
|
||||||
backgroundColor: Colors.transparent,
|
|
||||||
child: GlassPanel(
|
|
||||||
borderRadius: BorderRadius.circular(AppRadius.xxl),
|
|
||||||
padding: EdgeInsets.all(AppSpacing.lg),
|
|
||||||
child: Column(
|
|
||||||
mainAxisSize: MainAxisSize.min,
|
|
||||||
children: [
|
|
||||||
Text(title,
|
|
||||||
style: AppTextStyles.headlineLarge(context).copyWith(
|
|
||||||
fontWeight: FontWeight.bold,
|
|
||||||
)),
|
|
||||||
if (message != null) ...[
|
|
||||||
SizedBox(height: AppSpacing.sm),
|
|
||||||
Text(message,
|
|
||||||
style: AppTextStyles.bodyMedium(context),
|
|
||||||
textAlign: TextAlign.center),
|
|
||||||
],
|
|
||||||
SizedBox(height: AppSpacing.lg),
|
|
||||||
SizedBox(
|
|
||||||
width: double.infinity,
|
|
||||||
child: NeonButton(
|
|
||||||
text: '确定',
|
|
||||||
type: NeonButtonType.primary,
|
|
||||||
onPressed: () => Navigator.of(ctx).pop(),
|
|
||||||
height: 44,
|
|
||||||
showGlow: false,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
/// 跳转到资产页面
|
|
||||||
void _navigateToAssetPage() {
|
|
||||||
final mainState = context.findAncestorStateOfType<MainPageState>();
|
|
||||||
mainState?.switchToTab(3);
|
|
||||||
}
|
|
||||||
|
|
||||||
void _navigateToWelfareCenter() {
|
|
||||||
Navigator.push(
|
|
||||||
context,
|
context,
|
||||||
MaterialPageRoute(builder: (_) => const WelfareCenterPage()),
|
MaterialPageRoute(builder: (_) => const TransferPage()),
|
||||||
);
|
);
|
||||||
|
if (result == true && context.mounted) {
|
||||||
|
context.read<AssetProvider>().refreshAll(force: true);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Header 栏:品牌名 + 搜索/通知/头像
|
/// 资产卡片(含总盈利 + 可折叠盈亏日历)
|
||||||
/// 资产卡片(含总盈利 + 可折叠盈亏日历)
|
/// 资产卡片(含总盈利 + 可折叠盈亏日历)
|
||||||
class _AssetCard extends StatefulWidget {
|
class _AssetCard extends StatefulWidget {
|
||||||
final AssetOverview? overview;
|
final AssetOverview? overview;
|
||||||
@@ -596,7 +335,7 @@ class _AssetCardState extends State<_AssetCard> {
|
|||||||
// 今日盈亏卡片
|
// 今日盈亏卡片
|
||||||
Expanded(
|
Expanded(
|
||||||
child: _ProfitStatCard(
|
child: _ProfitStatCard(
|
||||||
label: '今日盈亏',
|
label: '预估今日盈亏',
|
||||||
value: _todayProfit,
|
value: _todayProfit,
|
||||||
upColor: upColor,
|
upColor: upColor,
|
||||||
downColor: downColor,
|
downColor: downColor,
|
||||||
@@ -606,7 +345,7 @@ class _AssetCardState extends State<_AssetCard> {
|
|||||||
// 总盈亏卡片
|
// 总盈亏卡片
|
||||||
Expanded(
|
Expanded(
|
||||||
child: _ProfitStatCard(
|
child: _ProfitStatCard(
|
||||||
label: '总盈亏',
|
label: '预估总盈亏',
|
||||||
value: _totalProfit,
|
value: _totalProfit,
|
||||||
upColor: upColor,
|
upColor: upColor,
|
||||||
downColor: downColor,
|
downColor: downColor,
|
||||||
@@ -1196,92 +935,6 @@ class _HoldingItem extends StatelessWidget {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// 信息行组件
|
|
||||||
class _InfoRow extends StatelessWidget {
|
|
||||||
final String label;
|
|
||||||
final String value;
|
|
||||||
final bool isBold;
|
|
||||||
|
|
||||||
const _InfoRow({required this.label, required this.value, this.isBold = false});
|
|
||||||
|
|
||||||
@override
|
|
||||||
Widget build(BuildContext context) {
|
|
||||||
final colorScheme = Theme.of(context).colorScheme;
|
|
||||||
|
|
||||||
return Row(
|
|
||||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
||||||
children: [
|
|
||||||
Text(label,
|
|
||||||
style: AppTextStyles.bodyMedium(context)),
|
|
||||||
Text(value,
|
|
||||||
style: AppTextStyles.bodyMedium(context).copyWith(
|
|
||||||
fontWeight: isBold ? FontWeight.bold : FontWeight.normal,
|
|
||||||
fontFeatures: isBold ? const [FontFeature.tabularFigures()] : null,
|
|
||||||
)),
|
|
||||||
],
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/// 钱包地址卡片
|
|
||||||
class _WalletAddressCard extends StatelessWidget {
|
|
||||||
final String address;
|
|
||||||
final String network;
|
|
||||||
|
|
||||||
const _WalletAddressCard({required this.address, required this.network});
|
|
||||||
|
|
||||||
@override
|
|
||||||
Widget build(BuildContext context) {
|
|
||||||
final colorScheme = Theme.of(context).colorScheme;
|
|
||||||
|
|
||||||
return Container(
|
|
||||||
padding: EdgeInsets.all(AppSpacing.md),
|
|
||||||
decoration: BoxDecoration(
|
|
||||||
color: colorScheme.surfaceContainerHigh,
|
|
||||||
borderRadius: BorderRadius.circular(AppRadius.md),
|
|
||||||
border: Border.all(color: colorScheme.outlineVariant.withOpacity(0.3)),
|
|
||||||
),
|
|
||||||
child: Column(
|
|
||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
|
||||||
children: [
|
|
||||||
Row(
|
|
||||||
children: [
|
|
||||||
Expanded(
|
|
||||||
child: Text(
|
|
||||||
address,
|
|
||||||
style: AppTextStyles.bodyMedium(context).copyWith(
|
|
||||||
fontFamily: 'monospace',
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
GestureDetector(
|
|
||||||
onTap: () {
|
|
||||||
Clipboard.setData(ClipboardData(text: address));
|
|
||||||
ToastUtils.show('地址已复制到剪贴板');
|
|
||||||
},
|
|
||||||
child: Container(
|
|
||||||
padding: EdgeInsets.all(AppSpacing.xs),
|
|
||||||
decoration: BoxDecoration(
|
|
||||||
color: colorScheme.primary.withOpacity(0.1),
|
|
||||||
borderRadius: BorderRadius.circular(AppRadius.sm),
|
|
||||||
),
|
|
||||||
child: Icon(LucideIcons.copy,
|
|
||||||
size: 16, color: colorScheme.primary),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
SizedBox(height: AppSpacing.sm),
|
|
||||||
Text(
|
|
||||||
'网络: $network',
|
|
||||||
style: AppTextStyles.bodySmall(context),
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/// 盈亏统计小卡片
|
/// 盈亏统计小卡片
|
||||||
class _ProfitStatCard extends StatelessWidget {
|
class _ProfitStatCard extends StatelessWidget {
|
||||||
final String label;
|
final String label;
|
||||||
|
|||||||
@@ -127,7 +127,7 @@ class _FundOrderCard extends StatelessWidget {
|
|||||||
SizedBox(height: AppSpacing.xs),
|
SizedBox(height: AppSpacing.xs),
|
||||||
Row(
|
Row(
|
||||||
children: [
|
children: [
|
||||||
Text('应付款: ', style: AppTextStyles.bodyMedium(context).copyWith(color: theme.colorScheme.mutedForeground)),
|
Text('应收款: ', style: AppTextStyles.bodyMedium(context).copyWith(color: theme.colorScheme.mutedForeground)),
|
||||||
Text('${order.receivableAmount ?? "0"} USDT', style: AppTextStyles.bodyMedium(context).copyWith(fontWeight: FontWeight.w700)),
|
Text('${order.receivableAmount ?? "0"} USDT', style: AppTextStyles.bodyMedium(context).copyWith(fontWeight: FontWeight.w700)),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
|
|||||||
@@ -104,7 +104,7 @@ function copyToClipboard(text: string) {
|
|||||||
手续费
|
手续费
|
||||||
</UiTableHead>
|
</UiTableHead>
|
||||||
<UiTableHead class="text-right">
|
<UiTableHead class="text-right">
|
||||||
到账金额
|
应出款
|
||||||
</UiTableHead>
|
</UiTableHead>
|
||||||
<UiTableHead>审批人</UiTableHead>
|
<UiTableHead>审批人</UiTableHead>
|
||||||
<UiTableHead class="hidden xl:table-cell">
|
<UiTableHead class="hidden xl:table-cell">
|
||||||
@@ -282,7 +282,7 @@ function copyToClipboard(text: string) {
|
|||||||
<div class="text-muted-foreground">手续费(10%)</div>
|
<div class="text-muted-foreground">手续费(10%)</div>
|
||||||
<div class="col-span-2 font-mono">-{{ formatAmount(currentOrder.fee || 0) }}</div>
|
<div class="col-span-2 font-mono">-{{ formatAmount(currentOrder.fee || 0) }}</div>
|
||||||
|
|
||||||
<div class="text-muted-foreground">到账金额</div>
|
<div class="text-muted-foreground">应出款</div>
|
||||||
<div class="col-span-2 font-mono font-bold text-green-600">{{ formatAmount(currentOrder.receivableAmount || 0) }}</div>
|
<div class="col-span-2 font-mono font-bold text-green-600">{{ formatAmount(currentOrder.receivableAmount || 0) }}</div>
|
||||||
|
|
||||||
<div class="text-muted-foreground">提现地址</div>
|
<div class="text-muted-foreground">提现地址</div>
|
||||||
@@ -348,7 +348,7 @@ function copyToClipboard(text: string) {
|
|||||||
<div class="font-mono font-bold text-lg">{{ formatAmount(currentOrder.amount) }}</div>
|
<div class="font-mono font-bold text-lg">{{ formatAmount(currentOrder.amount) }}</div>
|
||||||
</div>
|
</div>
|
||||||
<div>
|
<div>
|
||||||
<div class="text-muted-foreground">到账金额</div>
|
<div class="text-muted-foreground">应出款</div>
|
||||||
<div class="font-mono text-green-600">{{ formatAmount(currentOrder.receivableAmount || 0) }}</div>
|
<div class="font-mono text-green-600">{{ formatAmount(currentOrder.receivableAmount || 0) }}</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -711,7 +711,7 @@ function copyToClipboard(text: string) {
|
|||||||
</template>
|
</template>
|
||||||
<template v-if="currentOrder.type === 2 && currentOrder.receivableAmount">
|
<template v-if="currentOrder.type === 2 && currentOrder.receivableAmount">
|
||||||
<div class="text-muted-foreground">
|
<div class="text-muted-foreground">
|
||||||
到账金额
|
应出款
|
||||||
</div>
|
</div>
|
||||||
<div class="col-span-2 font-mono font-bold text-green-600">
|
<div class="col-span-2 font-mono font-bold text-green-600">
|
||||||
{{ currentOrder.receivableAmount }}
|
{{ currentOrder.receivableAmount }}
|
||||||
|
|||||||
Reference in New Issue
Block a user