You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
200 lines
7.7 KiB
200 lines
7.7 KiB
import 'package:flutter/cupertino.dart';
|
|
import 'package:flutter/material.dart';
|
|
import 'package:flutter_smart_dialog/flutter_smart_dialog.dart';
|
|
import 'package:get/get.dart';
|
|
import 'package:tdesign_flutter/tdesign_flutter.dart';
|
|
|
|
import '../../components/page_appbar.dart';
|
|
import '../../controller/mine/auth_controller.dart';
|
|
|
|
class RealNamePage extends StatelessWidget {
|
|
final int type;
|
|
RealNamePage({super.key, required this.type});
|
|
final AuthController controller = Get.put(AuthController());
|
|
// 是否同意协议
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
return Scaffold(
|
|
backgroundColor: Color(0xffFFFFFF),
|
|
appBar: PageAppbar(title: "实名认证"),
|
|
body: Column(
|
|
children: [
|
|
Container(
|
|
height: 56,
|
|
decoration: BoxDecoration(color: Color(0xffFFFFFF)),
|
|
padding: const EdgeInsets.only(left: 16),
|
|
child: Center(
|
|
child: Text(
|
|
'*请填写本人实名信息',
|
|
style: TextStyle(
|
|
fontSize: 14,
|
|
color: Colors.black87,
|
|
),
|
|
),
|
|
),
|
|
),
|
|
// SizedBox(height: 12),
|
|
Container(
|
|
height: 52, // 固定高度确保垂直居中
|
|
width: MediaQuery.of(context).size.width - 40,
|
|
decoration: BoxDecoration(
|
|
border: Border.all(color: Colors.grey.shade300),
|
|
borderRadius: BorderRadius.circular(6),
|
|
// border: Border(
|
|
// bottom: BorderSide(
|
|
// color: Colors.grey[400]!,
|
|
// width: 0.5,
|
|
// ),
|
|
// ),
|
|
),
|
|
child: Row(
|
|
crossAxisAlignment: CrossAxisAlignment.center, // 垂直居中
|
|
children: [
|
|
// 左侧标签 - 固定宽度 + 垂直居中
|
|
Container(
|
|
width: 98,
|
|
alignment: Alignment.centerLeft,
|
|
padding: const EdgeInsets.only(left: 20),
|
|
child: Text(
|
|
'姓名:',
|
|
style: TextStyle(
|
|
fontSize: 15,
|
|
color: Colors.black87,
|
|
),
|
|
),
|
|
),
|
|
// SizedBox(width: 4),
|
|
|
|
// 输入框区域 - 使用Expanded填充剩余空间
|
|
Expanded(
|
|
child: Container(
|
|
alignment: Alignment.centerLeft, // 输入框内容垂直居中
|
|
child: TextField(
|
|
decoration: InputDecoration(
|
|
hintText: '请输入姓名',
|
|
hintStyle: TextStyle(color: Colors.grey[500]),
|
|
border: InputBorder.none, // 隐藏默认边框
|
|
contentPadding: EdgeInsets.zero, // 去除默认padding
|
|
isDense: true, // 紧凑模式
|
|
),
|
|
style: TextStyle(
|
|
fontSize: 15,
|
|
height: 1.2, // 控制文字垂直位置
|
|
),
|
|
onChanged: (value) {
|
|
controller.name.value = value;
|
|
},
|
|
),
|
|
),
|
|
),
|
|
],
|
|
),
|
|
),
|
|
SizedBox(height: 24),
|
|
Container(
|
|
height: 52, // 固定高度确保垂直居中
|
|
width: MediaQuery.of(context).size.width - 40,
|
|
decoration: BoxDecoration(
|
|
border: Border.all(color: Colors.grey.shade300),
|
|
borderRadius: BorderRadius.circular(6),
|
|
// border: Border(
|
|
// bottom: BorderSide(
|
|
// color: Colors.grey[400]!,
|
|
// width: 0.5,
|
|
// ),
|
|
// ),
|
|
),
|
|
child: Row(
|
|
crossAxisAlignment: CrossAxisAlignment.center, // 垂直居中
|
|
children: [
|
|
// 左侧标签 - 固定宽度 + 垂直居中
|
|
Container(
|
|
width: 98,
|
|
alignment: Alignment.centerLeft,
|
|
padding: const EdgeInsets.only(left: 20),
|
|
child: Text(
|
|
'身份证号:',
|
|
style: TextStyle(
|
|
fontSize: 15,
|
|
color: Colors.black87,
|
|
),
|
|
),
|
|
),
|
|
// SizedBox(width: 4),
|
|
|
|
// 输入框区域 - 使用Expanded填充剩余空间
|
|
Expanded(
|
|
child: Container(
|
|
alignment: Alignment.centerLeft, // 输入框内容垂直居中
|
|
child: TextField(
|
|
decoration: InputDecoration(
|
|
hintText: '请输入身份证号',
|
|
hintStyle: TextStyle(color: Colors.grey[500]),
|
|
border: InputBorder.none, // 隐藏默认边框
|
|
contentPadding: EdgeInsets.zero, // 去除默认padding
|
|
isDense: true, // 紧凑模式
|
|
),
|
|
style: TextStyle(
|
|
fontSize: 15,
|
|
height: 1.2, // 控制文字垂直位置
|
|
),
|
|
onChanged: (value) {
|
|
controller.idcard.value = value;
|
|
},
|
|
),
|
|
),
|
|
),
|
|
],
|
|
),
|
|
),
|
|
SizedBox(height: 24),
|
|
// 协议同意复选框
|
|
Row(
|
|
crossAxisAlignment: CrossAxisAlignment.start, // 垂直居中
|
|
children: [
|
|
SizedBox(width: 8),
|
|
Obx(() => Checkbox(
|
|
value: controller.agree.value,
|
|
onChanged: (value) {
|
|
controller.agree.value = value ?? false;
|
|
},
|
|
activeColor: Color(0xff7562F9),
|
|
side: const BorderSide(color: Colors.grey),
|
|
shape: const CircleBorder(),
|
|
materialTapTargetSize: MaterialTapTargetSize.shrinkWrap,
|
|
)),
|
|
ConstrainedBox(
|
|
constraints: BoxConstraints(maxWidth: 300), // 限制最大宽度
|
|
child: Text(
|
|
'依据法律法规的要求,我们将收集您的真实姓名,身份证号用于实名认证,认证信息将用于直播连麦、收益提现、依据证件信息更正性别等,与账号唯一绑定,我们会使用加密方式对您的认证信息进行严格保密。',
|
|
style: TextStyle( fontSize: 13, color: Colors.grey ),
|
|
),
|
|
)
|
|
],
|
|
),
|
|
SizedBox(height: 32),
|
|
|
|
TDButton(
|
|
text: '立即认证',
|
|
width: MediaQuery.of(context).size.width - 40,
|
|
size: TDButtonSize.large,
|
|
type: TDButtonType.fill,
|
|
shape: TDButtonShape.round,
|
|
style: TDButtonStyle(
|
|
textColor: Colors.white,
|
|
backgroundColor: Color(0xFF7562F9),
|
|
),
|
|
activeStyle: TDButtonStyle(
|
|
textColor: Colors.white,
|
|
backgroundColor: Color(0xC37562F9),
|
|
),
|
|
onTap: (){
|
|
controller.startAuthing(type);
|
|
},
|
|
),
|
|
],
|
|
),
|
|
);
|
|
}
|
|
|
|
}
|