feat: 优化提交
This commit is contained in:
parent
7fcb0c3034
commit
abaf21b6fc
@ -23,20 +23,6 @@ class _LockResetConfirmPageState extends State<LockResetConfirmPage>
|
|||||||
return GetBuilder<LockResetConfirmLogic>(
|
return GetBuilder<LockResetConfirmLogic>(
|
||||||
init: LockResetConfirmLogic(),
|
init: LockResetConfirmLogic(),
|
||||||
builder: (LockResetConfirmLogic logic) {
|
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(
|
return Scaffold(
|
||||||
backgroundColor: Colors.white,
|
backgroundColor: Colors.white,
|
||||||
appBar: F.sw(
|
appBar: F.sw(
|
||||||
@ -80,10 +66,10 @@ class _LockResetConfirmPageState extends State<LockResetConfirmPage>
|
|||||||
width: 1.sw,
|
width: 1.sw,
|
||||||
padding: EdgeInsets.symmetric(horizontal: 40.w),
|
padding: EdgeInsets.symmetric(horizontal: 40.w),
|
||||||
child: Text(
|
child: Text(
|
||||||
title.tr,
|
'请确认设备已重置'.tr,
|
||||||
textAlign: TextAlign.center,
|
textAlign: TextAlign.center,
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
fontSize: 24.sp, // 保持与项目一致
|
fontSize: 24.sp,
|
||||||
fontWeight: FontWeight.w600,
|
fontWeight: FontWeight.w600,
|
||||||
color: Colors.black87,
|
color: Colors.black87,
|
||||||
),
|
),
|
||||||
@ -97,10 +83,10 @@ class _LockResetConfirmPageState extends State<LockResetConfirmPage>
|
|||||||
width: 1.sw,
|
width: 1.sw,
|
||||||
padding: EdgeInsets.symmetric(horizontal: 40.w),
|
padding: EdgeInsets.symmetric(horizontal: 40.w),
|
||||||
child: Text(
|
child: Text(
|
||||||
description.tr,
|
'添加设备前,请确保设备已重置为出厂状态。重置后的设备将清除所有用户数据,包括指纹、密码、卡片等信息。'.tr,
|
||||||
textAlign: TextAlign.center,
|
textAlign: TextAlign.center,
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
fontSize: 20.sp, // 调整为项目标准
|
fontSize: 20.sp,
|
||||||
color: Colors.black54,
|
color: Colors.black54,
|
||||||
height: 1.5,
|
height: 1.5,
|
||||||
),
|
),
|
||||||
@ -133,7 +119,7 @@ class _LockResetConfirmPageState extends State<LockResetConfirmPage>
|
|||||||
child: Text(
|
child: Text(
|
||||||
'重置方法请查阅设备说明书'.tr,
|
'重置方法请查阅设备说明书'.tr,
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
fontSize: 20.sp, // 调整为项目标准
|
fontSize: 20.sp,
|
||||||
color: Colors.blue[700],
|
color: Colors.blue[700],
|
||||||
fontWeight: FontWeight.w500,
|
fontWeight: FontWeight.w500,
|
||||||
),
|
),
|
||||||
@ -149,7 +135,7 @@ class _LockResetConfirmPageState extends State<LockResetConfirmPage>
|
|||||||
Container(
|
Container(
|
||||||
margin: EdgeInsets.symmetric(horizontal: 40.w),
|
margin: EdgeInsets.symmetric(horizontal: 40.w),
|
||||||
child: SubmitBtn(
|
child: SubmitBtn(
|
||||||
btnName: confirmButtonText.tr,
|
btnName: '我已重置设备,继续添加'.tr,
|
||||||
borderRadius: 25.w,
|
borderRadius: 25.w,
|
||||||
onClick: () {
|
onClick: () {
|
||||||
logic.confirmLockReset();
|
logic.confirmLockReset();
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user