feat: 优化提交

This commit is contained in:
wuyaxi 2025-07-15 10:49:30 +08:00
parent 7fcb0c3034
commit abaf21b6fc

View File

@ -23,20 +23,6 @@ class _LockResetConfirmPageState extends State<LockResetConfirmPage>
return GetBuilder<LockResetConfirmLogic>(
init: LockResetConfirmLogic(),
builder: (LockResetConfirmLogic logic) {
//
final bool isLockType = logic.state.getLockType.value >= 1 &&
logic.state.getLockType.value <= 6;
final bool isAllDevices = logic.state.getLockType.value == 0;
//
final String deviceType = isLockType ? '' : '设备';
final String title = isAllDevices ? '请确认设备已重置' : '请确认$deviceType已重置';
final String description = isAllDevices
? '添加设备前,请确保设备已重置为出厂状态。重置后的设备将清除所有用户数据。'
: '添加$deviceType前,请确保$deviceType已重置为出厂状态。重置后的$deviceType将清除所有用户数据,包括指纹、密码、卡片等信息。';
final String confirmButtonText =
isAllDevices ? '我已重置设备,继续添加' : '我已重置$deviceType,继续添加';
return Scaffold(
backgroundColor: Colors.white,
appBar: F.sw(
@ -80,10 +66,10 @@ class _LockResetConfirmPageState extends State<LockResetConfirmPage>
width: 1.sw,
padding: EdgeInsets.symmetric(horizontal: 40.w),
child: Text(
title.tr,
'请确认设备已重置'.tr,
textAlign: TextAlign.center,
style: TextStyle(
fontSize: 24.sp, //
fontSize: 24.sp,
fontWeight: FontWeight.w600,
color: Colors.black87,
),
@ -97,10 +83,10 @@ class _LockResetConfirmPageState extends State<LockResetConfirmPage>
width: 1.sw,
padding: EdgeInsets.symmetric(horizontal: 40.w),
child: Text(
description.tr,
'添加设备前,请确保设备已重置为出厂状态。重置后的设备将清除所有用户数据,包括指纹、密码、卡片等信息。'.tr,
textAlign: TextAlign.center,
style: TextStyle(
fontSize: 20.sp, //
fontSize: 20.sp,
color: Colors.black54,
height: 1.5,
),
@ -133,7 +119,7 @@ class _LockResetConfirmPageState extends State<LockResetConfirmPage>
child: Text(
'重置方法请查阅设备说明书'.tr,
style: TextStyle(
fontSize: 20.sp, //
fontSize: 20.sp,
color: Colors.blue[700],
fontWeight: FontWeight.w500,
),
@ -149,7 +135,7 @@ class _LockResetConfirmPageState extends State<LockResetConfirmPage>
Container(
margin: EdgeInsets.symmetric(horizontal: 40.w),
child: SubmitBtn(
btnName: confirmButtonText.tr,
btnName: '我已重置设备,继续添加'.tr,
borderRadius: 25.w,
onClick: () {
logic.confirmLockReset();