feat(ui): 新增精選卡片漸變色並優化市場頁面設計

This commit is contained in:
2026-04-08 01:58:53 +08:00
parent dc6a8afc9a
commit 9760f7a8a1
5 changed files with 289 additions and 177 deletions

View File

@@ -48,11 +48,11 @@ class _DepositPageState extends State<DepositPage> {
final text = _amountController.text;
final n = double.tryParse(text);
if (text.isEmpty || n == null || n <= 0) {
ToastUtils.showError('请输入有效金');
ToastUtils.showError('請輸入有效金');
return;
}
if (n < 1000) {
ToastUtils.showError('单笔最低充值 1000 USDT');
ToastUtils.showError('單筆最低充值 1000 USDT');
return;
}
if (_isSubmitting) return;
@@ -75,10 +75,10 @@ class _DepositPageState extends State<DepositPage> {
response.data!['walletNetwork'] as String? ?? 'TRC20';
});
} else {
ToastUtils.showError(response.message ?? '请失败');
ToastUtils.showError(response.message ?? '請失敗');
}
} catch (e) {
if (mounted) ToastUtils.showError('请失败: $e');
if (mounted) ToastUtils.showError('請失敗: $e');
} finally {
if (mounted) setState(() => _isSubmitting = false);
}
@@ -90,8 +90,8 @@ class _DepositPageState extends State<DepositPage> {
final confirmed = await showDialog<bool>(
context: context,
builder: (ctx) => AlertDialog(
title: const Text('确认已打款'),
content: const Text('确认您已完成向指定地址的转账'),
title: const Text('確認已打款'),
content: const Text('確認您已完成向指定地址的轉賬'),
actions: [
TextButton(
onPressed: () => Navigator.pop(ctx, false),
@@ -99,7 +99,7 @@ class _DepositPageState extends State<DepositPage> {
),
TextButton(
onPressed: () => Navigator.pop(ctx, true),
child: const Text('确认'),
child: const Text('確認'),
),
],
),
@@ -113,13 +113,13 @@ class _DepositPageState extends State<DepositPage> {
if (!mounted) return;
if (response.success) {
ToastUtils.showSuccess('确认成功,等待管理员审');
ToastUtils.showSuccess('確認成功,等待管理員審');
Navigator.of(context).pop(true);
} else {
ToastUtils.showError(response.message ?? '确认失败');
ToastUtils.showError(response.message ?? '確認失敗');
}
} catch (e) {
if (mounted) ToastUtils.showError('确认失败: $e');
if (mounted) ToastUtils.showError('確認失敗: $e');
}
}
@@ -230,7 +230,7 @@ class _DepositPageState extends State<DepositPage> {
Widget _buildAmountLabel(ColorScheme colorScheme) {
return Text(
'充值金',
'充值金',
style: AppTextStyles.bodyMedium(context).copyWith(
color: colorScheme.onSurfaceVariant,
fontWeight: FontWeight.w500,
@@ -316,10 +316,10 @@ class _DepositPageState extends State<DepositPage> {
Widget _buildSteps(ColorScheme colorScheme) {
final steps = [
'入充值金额并提交申',
'向指定包地址转账',
'点击「已打款」确认',
'等待管理员审核通',
'入充值金額並提交申',
'向指定包地址轉賬',
'點擊「已打款」確認',
'等待管理員審核通',
];
return Column(
@@ -383,14 +383,14 @@ class _DepositPageState extends State<DepositPage> {
),
const SizedBox(height: 12),
Text(
'充值申成功',
'充值申成功',
style: AppTextStyles.headlineSmall(context).copyWith(
fontWeight: FontWeight.w600,
),
),
const SizedBox(height: 4),
Text(
'向以下地址转账完成充值',
'向以下地址轉賬完成充值',
style: AppTextStyles.bodyMedium(context).copyWith(
color: colorScheme.onSurfaceVariant,
),
@@ -419,7 +419,7 @@ class _DepositPageState extends State<DepositPage> {
const SizedBox(width: 6),
Expanded(
child: Text(
'转账完成后请点击「已打款」确认,管理员审核通过后资金将到账',
'轉賬完成後請點擊「已打款」確認,管理員審核通過後資金將到賬',
style: AppTextStyles.bodySmall(context).copyWith(
color: colorScheme.onSurfaceVariant,
),
@@ -445,7 +445,7 @@ class _DepositPageState extends State<DepositPage> {
),
),
child: Text(
'后确认',
'後確認',
style: AppTextStyles.bodyMedium(context).copyWith(
fontWeight: FontWeight.w500,
),
@@ -502,7 +502,7 @@ class _DepositPageState extends State<DepositPage> {
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Text(
'订单号',
'訂單號',
style: AppTextStyles.bodySmall(context).copyWith(
color: colorScheme.onSurfaceVariant,
),
@@ -524,7 +524,7 @@ class _DepositPageState extends State<DepositPage> {
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Text(
'充值金',
'充值金',
style: AppTextStyles.bodySmall(context).copyWith(
color: colorScheme.onSurfaceVariant,
),
@@ -581,7 +581,7 @@ class _DepositPageState extends State<DepositPage> {
onTap: () {
Clipboard.setData(
ClipboardData(text: _walletAddress ?? ''));
ToastUtils.showSuccess('地址已复制');
ToastUtils.showSuccess('地址已複製');
},
child: Padding(
padding: const EdgeInsets.all(4),
@@ -661,7 +661,7 @@ class _DepositPageState extends State<DepositPage> {
size: 13, color: colorScheme.onSurfaceVariant),
const SizedBox(width: 4),
Text(
'金安全由平台全程保障',
'金安全由平台全程保障',
style: AppTextStyles.bodySmall(context).copyWith(
color: colorScheme.onSurfaceVariant,
),

View File

@@ -80,8 +80,8 @@ class _TransferPageState extends State<TransferPage> {
String get _availableBalance =>
_direction == 1 ? _fundBalance : _tradeUsdtBalance;
String get _fromLabel => _direction == 1 ? '资金账户' : '交易账户';
String get _toLabel => _direction == 1 ? '交易账户' : '资金账户';
String get _fromLabel => _direction == 1 ? '資金賬戶' : '交易賬戶';
String get _toLabel => _direction == 1 ? '交易賬戶' : '資金賬戶';
String get _fromBalance => _direction == 1 ? _fundBalance : _tradeUsdtBalance;
String get _toBalance => _direction == 1 ? _tradeUsdtBalance : _fundBalance;
@@ -95,12 +95,12 @@ class _TransferPageState extends State<TransferPage> {
final transferAmount = double.tryParse(amount) ?? 0;
if (transferAmount <= 0) {
_showSnackBar('请输入有效的划转金额');
_showSnackBar('請輸入有效的劃轉金額');
return;
}
if (transferAmount > available) {
_showSnackBar('余额不足');
_showSnackBar('餘額不足');
return;
}
@@ -115,11 +115,11 @@ class _TransferPageState extends State<TransferPage> {
if (mounted) {
if (response.success) {
_amountController.clear();
_showSnackBar('划转成功');
_showSnackBar('劃轉成功');
await Future.delayed(const Duration(milliseconds: 500));
if (mounted) Navigator.of(context).pop(true);
} else {
_showSnackBar(response.message ?? '划转失败');
_showSnackBar(response.message ?? '劃轉失敗');
}
}
} finally {
@@ -171,7 +171,7 @@ class _TransferPageState extends State<TransferPage> {
onPressed: () => Navigator.of(context).pop(),
),
title: Text(
'账户划转',
'賬戶劃轉',
style: AppTextStyles.headlineLarge(context).copyWith(
fontWeight: FontWeight.w600,
),
@@ -339,7 +339,7 @@ class _TransferPageState extends State<TransferPage> {
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Text(
'划转金额',
'劃轉金額',
style: AppTextStyles.bodyMedium(context).copyWith(
color: colorScheme.onSurfaceVariant,
fontWeight: FontWeight.w500,
@@ -422,7 +422,7 @@ class _TransferPageState extends State<TransferPage> {
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Text(
'可用余额',
'可用餘額',
style: AppTextStyles.bodySmall(context).copyWith(
color: colorScheme.onSurfaceVariant,
),
@@ -492,7 +492,7 @@ class _TransferPageState extends State<TransferPage> {
size: 13, color: colorScheme.onSurfaceVariant),
const SizedBox(width: 6),
Text(
'划转即时到账,无需手续费',
'劃轉即時到賬,無需手續費',
style: AppTextStyles.bodySmall(context).copyWith(
color: colorScheme.onSurfaceVariant,
),
@@ -542,7 +542,7 @@ class _TransferPageState extends State<TransferPage> {
),
)
: Text(
'确认划转',
'確認劃轉',
style: TextStyle(
fontSize: 15,
fontWeight: FontWeight.w600,

View File

@@ -63,20 +63,20 @@ class _WithdrawPageState extends State<WithdrawPage> {
if (amount > 0) {
final fee = amount * 0.1;
final receivable = amount - fee;
return '续费(10%): -${fee.toStringAsFixed(2)} USDT | 收款: ${receivable.toStringAsFixed(2)} USDT';
return '續費(10%): -${fee.toStringAsFixed(2)} USDT | 收款: ${receivable.toStringAsFixed(2)} USDT';
}
return '现将扣除 10% 手续费';
return '現將扣除 10% 手續費';
}
Future<void> _submitWithdraw() async {
final amount = double.tryParse(_amountController.text);
if (amount == null || amount <= 0) {
ToastUtils.showError('请输入有效金');
ToastUtils.showError('請輸入有效金');
return;
}
final address = _addressController.text.trim();
if (address.isEmpty) {
ToastUtils.showError('请输入提地址');
ToastUtils.showError('請輸入提地址');
return;
}
if (_isSubmitting) return;
@@ -94,13 +94,13 @@ class _WithdrawPageState extends State<WithdrawPage> {
if (!mounted) return;
if (response.success) {
ToastUtils.showSuccess('成功,等待管理员审');
ToastUtils.showSuccess('成功,等待管理員審');
Navigator.of(context).pop(true);
} else {
ToastUtils.showError(response.message ?? '请失败');
ToastUtils.showError(response.message ?? '請失敗');
}
} catch (e) {
if (mounted) ToastUtils.showError('请失败: $e');
if (mounted) ToastUtils.showError('請失敗: $e');
} finally {
if (mounted) setState(() => _isSubmitting = false);
}
@@ -123,7 +123,7 @@ class _WithdrawPageState extends State<WithdrawPage> {
onPressed: () => Navigator.of(context).pop(),
),
title: Text(
'',
'',
style: AppTextStyles.headlineLarge(context).copyWith(
fontWeight: FontWeight.w600,
),
@@ -146,7 +146,7 @@ class _WithdrawPageState extends State<WithdrawPage> {
],
// 提现金额
_buildSectionLabel(colorScheme, '现金额'),
_buildSectionLabel(colorScheme, '現金額'),
const SizedBox(height: AppSpacing.sm),
_buildAmountInput(colorScheme),
const SizedBox(height: AppSpacing.sm),
@@ -157,20 +157,20 @@ class _WithdrawPageState extends State<WithdrawPage> {
// 提现网络
if (_networks.isNotEmpty) ...[
_buildSectionLabel(colorScheme, '现网络'),
_buildSectionLabel(colorScheme, '現網絡'),
const SizedBox(height: AppSpacing.sm),
_buildNetworkSelector(colorScheme),
const SizedBox(height: AppSpacing.lg),
],
// 目标地址
_buildSectionLabel(colorScheme, '地址'),
_buildSectionLabel(colorScheme, '地址'),
const SizedBox(height: AppSpacing.sm),
_buildAddressInput(colorScheme),
const SizedBox(height: AppSpacing.lg),
// 联系方式
_buildSectionLabel(colorScheme, '联系方式(可'),
_buildSectionLabel(colorScheme, '聯繫方式(可'),
const SizedBox(height: AppSpacing.sm),
_buildContactInput(colorScheme),
const SizedBox(height: AppSpacing.xl),
@@ -210,7 +210,7 @@ class _WithdrawPageState extends State<WithdrawPage> {
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Text(
'可用余额',
'可用餘額',
style: AppTextStyles.bodyMedium(context).copyWith(
color: colorScheme.onSurfaceVariant,
),
@@ -332,7 +332,7 @@ class _WithdrawPageState extends State<WithdrawPage> {
value: _selectedNetwork,
isExpanded: true,
hint: Text(
'选择提现网络',
'選擇提現網絡',
style: AppTextStyles.bodyMedium(context).copyWith(
color: colorScheme.onSurfaceVariant,
),
@@ -369,7 +369,7 @@ class _WithdrawPageState extends State<WithdrawPage> {
controller: _addressController,
style: AppTextStyles.bodyMedium(context),
decoration: InputDecoration(
hintText: '请输入提地址',
hintText: '請輸入提地址',
hintStyle: AppTextStyles.bodyMedium(context).copyWith(
color: colorScheme.onSurfaceVariant.withValues(alpha: 0.5),
),
@@ -399,7 +399,7 @@ class _WithdrawPageState extends State<WithdrawPage> {
controller: _contactController,
style: AppTextStyles.bodyMedium(context),
decoration: InputDecoration(
hintText: '方便客服与您联系',
hintText: '方便客服與您聯繫',
hintStyle: AppTextStyles.bodyMedium(context).copyWith(
color: colorScheme.onSurfaceVariant.withValues(alpha: 0.5),
),
@@ -413,9 +413,9 @@ class _WithdrawPageState extends State<WithdrawPage> {
Widget _buildSecurityTips(ColorScheme colorScheme) {
final tips = [
'请仔细核对提现地址,地址错误将导致资产无法找回',
'现申请提交需等待管理员审',
'现将扣除 10% 手续费',
'請仔細核對提現地址,地址錯誤將導致資產無法找回',
'現申請提交需等待管理員審',
'現將扣除 10% 手續費',
];
return Column(
@@ -475,7 +475,7 @@ class _WithdrawPageState extends State<WithdrawPage> {
),
)
: Text(
'提交申',
'提交申',
style: TextStyle(
fontSize: 15,
fontWeight: FontWeight.w600,
@@ -494,7 +494,7 @@ class _WithdrawPageState extends State<WithdrawPage> {
size: 13, color: colorScheme.onSurfaceVariant),
const SizedBox(width: 4),
Text(
'金安全由平台全程保障',
'金安全由平台全程保障',
style: AppTextStyles.bodySmall(context).copyWith(
color: colorScheme.onSurfaceVariant,
),