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

@@ -11,7 +11,7 @@ import '../../../providers/auth_provider.dart';
import '../../components/glass_panel.dart';
import '../../components/neon_glow.dart';
/// KYC 实名认证页
/// KYC 實名認證頁
class KycPage extends StatefulWidget {
final bool returnToWithdraw;
@@ -64,7 +64,7 @@ class _KycPageState extends State<KycPage> {
backgroundColor: colorScheme.surface.withOpacity(0.0),
elevation: 0,
title: Text(
'实名认证',
'實名認證',
style: AppTextStyles.headlineLarge(context),
),
leading: IconButton(
@@ -77,17 +77,17 @@ class _KycPageState extends State<KycPage> {
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
// 步指示器
// 步指示器
_buildStepIndicator(colorScheme),
SizedBox(height: AppSpacing.xl),
// 主表单区
// 主表單區
GlassPanel(
padding: EdgeInsets.all(AppSpacing.lg),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
// 标题区
// 標題區
Row(
children: [
Container(
@@ -107,12 +107,12 @@ class _KycPageState extends State<KycPage> {
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
'身份验证',
'身份驗證',
style: AppTextStyles.headlineLarge(context),
),
SizedBox(height: 2),
Text(
'身份正反面完成实名认证',
'身份正反面完成實名認證',
style: AppTextStyles.bodyMedium(context),
),
],
@@ -121,9 +121,9 @@ class _KycPageState extends State<KycPage> {
),
SizedBox(height: AppSpacing.xl),
// 身份正面上传区
// 身份正面上傳區
Text(
'身份正面(人像面)',
'身份正面(人像面)',
style: AppTextStyles.headlineSmall(context),
),
SizedBox(height: AppSpacing.sm),
@@ -136,26 +136,26 @@ class _KycPageState extends State<KycPage> {
),
SizedBox(height: AppSpacing.lg),
// 身份反面上传区
// 身份反面上傳區
Text(
'身份反面(徽面)',
'身份反面(徽面)',
style: AppTextStyles.headlineSmall(context),
),
SizedBox(height: AppSpacing.sm),
_buildUploadZone(
imageFile: _backFile,
imageBytes: _backBytes,
label: '徽面',
label: '徽面',
onTap: () => _pickImage(false),
colorScheme: colorScheme,
),
SizedBox(height: AppSpacing.xl),
// 提交按
// 提交按
SizedBox(
width: double.infinity,
child: NeonButton(
text: _isSubmitting ? '提交中...' : '提交认证',
text: _isSubmitting ? '提交中...' : '提交認證',
type: NeonButtonType.primary,
onPressed: _canSubmit ? _submitKyc : null,
height: 48,
@@ -187,7 +187,7 @@ class _KycPageState extends State<KycPage> {
SizedBox(width: AppSpacing.sm),
Expanded(
child: Text(
'您的身份信息被加密存储,仅用于身份验证',
'您的身份信息被加密存儲,僅用於身份驗證',
style: AppTextStyles.bodySmall(context).copyWith(
color: AppColorScheme.up.withOpacity(0.8),
),
@@ -209,7 +209,7 @@ class _KycPageState extends State<KycPage> {
children: [
_buildStepCircle(
number: '1',
label: '传证',
label: '傳證',
isActive: true,
isComplete: isComplete,
colorScheme: colorScheme,
@@ -224,7 +224,7 @@ class _KycPageState extends State<KycPage> {
),
_buildStepCircle(
number: '2',
label: '认证完成',
label: '認證完成',
isActive: false,
isComplete: false,
colorScheme: colorScheme,
@@ -317,12 +317,12 @@ class _KycPageState extends State<KycPage> {
child: Stack(
fit: StackFit.expand,
children: [
// 图片预览 - 使用 memory 以兼容 Web
// 圖片預覽 - 使用 memory 以兼容 Web
Image.memory(
imageBytes!,
fit: BoxFit.cover,
),
// 底部渐变遮罩 + 文字
// 底部漸變遮罩 + 文字
Positioned(
left: 0,
right: 0,
@@ -348,7 +348,7 @@ class _KycPageState extends State<KycPage> {
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Text(
'$label已选择',
'$label已選擇',
style: AppTextStyles.labelLarge(context).copyWith(
color: colorScheme.onPrimary,
),
@@ -400,7 +400,7 @@ class _KycPageState extends State<KycPage> {
),
SizedBox(height: AppSpacing.sm),
Text(
'点击上传$label',
'點擊上傳$label',
style: AppTextStyles.bodyLarge(context).copyWith(
color: colorScheme.onSurfaceVariant.withOpacity(0.6),
),
@@ -442,13 +442,13 @@ class _KycPageState extends State<KycPage> {
size: 20,
),
SizedBox(width: AppSpacing.sm),
const Text('认证成功'),
const Text('認證成功'),
],
),
description: const Text('您的实名认证已通过,现在可以行提操作'),
description: const Text('您的實名認證已通過,現在可以行提操作'),
actions: [
ShadButton(
child: const Text(''),
child: const Text(''),
onPressed: () {
Navigator.of(ctx).pop();
Navigator.of(context).pop();
@@ -461,11 +461,11 @@ class _KycPageState extends State<KycPage> {
showShadDialog(
context: context,
builder: (ctx) => ShadDialog.alert(
title: const Text('认证失败'),
description: Text(response.message ?? '请稍后重试'),
title: const Text('認證失敗'),
description: Text(response.message ?? '請稍後重試'),
actions: [
ShadButton(
child: const Text(''),
child: const Text(''),
onPressed: () => Navigator.of(ctx).pop(),
),
],
@@ -477,11 +477,11 @@ class _KycPageState extends State<KycPage> {
showShadDialog(
context: context,
builder: (ctx) => ShadDialog.alert(
title: const Text('认证失败'),
title: const Text('認證失敗'),
description: Text(e.toString()),
actions: [
ShadButton(
child: const Text(''),
child: const Text(''),
onPressed: () => Navigator.of(ctx).pop(),
),
],
@@ -494,7 +494,7 @@ class _KycPageState extends State<KycPage> {
}
}
/// 虚线边框画笔
/// 虛線邊框畫筆
class _DashedBorderPainter extends CustomPainter {
final Color color;
final double borderRadius;