feat: 完成锁重置及常见问题相关需求

This commit is contained in:
wuyaxi 2025-07-15 15:24:59 +08:00
parent abaf21b6fc
commit 0f88339c5c
3 changed files with 61 additions and 148 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

View File

@ -58,16 +58,6 @@ class _LockAddFaqPageState extends State<LockAddFaqPage> {
SizedBox(height: 20.h),
// 4
_buildFaqItem(
icon: Icons.signal_wifi_off,
title: '距离过远'.tr,
description: '请确保手机与锁的距离在有效范围内。'.tr,
solution: '将手机靠近锁距离保持在1米以内。'.tr,
),
SizedBox(height: 20.h),
// 5
_buildFaqItem(
icon: Icons.person_off,
@ -91,10 +81,8 @@ class _LockAddFaqPageState extends State<LockAddFaqPage> {
width: double.infinity,
padding: EdgeInsets.symmetric(horizontal: 20.w),
child: ElevatedButton.icon(
onPressed: () {
logic.startOtaUpgrade();
},
icon: Icon(Icons.system_update_alt, color: Colors.white),
onPressed: logic.startOtaUpgrade,
icon: const Icon(Icons.system_update_alt, color: Colors.white),
label: Text(
'尝试升级固件'.tr,
style: TextStyle(

View File

@ -21,149 +21,74 @@ class _LockResetConfirmPageState extends State<LockResetConfirmPage>
@override
Widget build(BuildContext context) {
return GetBuilder<LockResetConfirmLogic>(
init: LockResetConfirmLogic(),
builder: (LockResetConfirmLogic logic) {
return Scaffold(
backgroundColor: Colors.white,
appBar: F.sw(
skyCall: () => TitleAppBar(
barTitle: '重置确认'.tr,
haveBack: true,
backgroundColor: AppColors.mainColor,
),
xhjCall: () => TitleAppBar(
barTitle: '重置确认'.tr,
haveBack: true,
backgroundColor: Colors.white,
iconColor: AppColors.blackColor,
titleColor: AppColors.blackColor,
),
init: LockResetConfirmLogic(),
builder: (LockResetConfirmLogic logic) {
return Scaffold(
backgroundColor: Colors.white,
appBar: F.sw(
skyCall: () => TitleAppBar(
barTitle: '设备重置'.tr,
haveBack: true,
backgroundColor: AppColors.mainColor,
),
body: ListView(
children: [
SizedBox(height: 60.h),
//
Container(
width: 120.w,
height: 120.w,
margin: EdgeInsets.symmetric(horizontal: 1.sw / 2 - 60.w),
decoration: BoxDecoration(
color: AppColors.mainColor.withOpacity(0.1),
borderRadius: BorderRadius.circular(60.w),
),
child: Icon(
Icons.refresh,
size: 60.w,
color: AppColors.mainColor,
),
),
SizedBox(height: 40.h),
//
Container(
width: 1.sw,
padding: EdgeInsets.symmetric(horizontal: 40.w),
child: Text(
xhjCall: () => TitleAppBar(
barTitle: '设备重置'.tr,
haveBack: true,
backgroundColor: Colors.white,
iconColor: AppColors.blackColor,
titleColor: AppColors.blackColor,
),
),
body: ListView(
children: [
SizedBox(height: 100.h),
Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Text(
'请确认设备已重置'.tr,
textAlign: TextAlign.center,
style: TextStyle(
fontSize: 24.sp,
fontWeight: FontWeight.w600,
color: Colors.black87,
),
),
),
SizedBox(height: 30.h),
//
Container(
width: 1.sw,
padding: EdgeInsets.symmetric(horizontal: 40.w),
child: Text(
'添加设备前,请确保设备已重置为出厂状态。重置后的设备将清除所有用户数据,包括指纹、密码、卡片等信息。'.tr,
textAlign: TextAlign.center,
style: TextStyle(
fontSize: 20.sp,
color: Colors.black54,
height: 1.5,
],
),
SizedBox(height: 120.h),
Image.asset(
'images/lockType/addLock_lockReset.png',
width: 278.w,
height: 278.w,
),
SizedBox(height: 120.h),
Container(
width: 1.sw,
padding: EdgeInsets.only(left: 20.w, right: 20.w),
child: Wrap(
alignment: WrapAlignment.center,
children: [
Text(
'添加设备前,请确保设备已重置为出厂状态。'.tr,
textAlign: TextAlign.center,
style: TextStyle(
fontSize: 20.sp, fontWeight: FontWeight.w500),
),
),
],
),
SizedBox(height: 50.h),
//
Container(
margin: EdgeInsets.symmetric(horizontal: 30.w),
padding: EdgeInsets.all(20.w),
decoration: BoxDecoration(
color: Colors.blue[50],
borderRadius: BorderRadius.circular(12.w),
border: Border.all(
color: Colors.blue[200]!,
width: 1,
),
),
child: Row(
children: [
Icon(
Icons.info_outline,
color: Colors.blue[700],
size: 24.w,
),
SizedBox(width: 12.w),
Expanded(
child: Text(
'重置方法请查阅设备说明书'.tr,
style: TextStyle(
fontSize: 20.sp,
color: Colors.blue[700],
fontWeight: FontWeight.w500,
),
),
),
],
),
),
SizedBox(height: 60.h),
//
Container(
margin: EdgeInsets.symmetric(horizontal: 40.w),
child: SubmitBtn(
btnName: '我已重置设备,继续添加'.tr,
borderRadius: 25.w,
),
SizedBox(height: 120.h),
Container(
margin: EdgeInsets.only(left: 20.w, right: 20.w),
child: SubmitBtn(
btnName: '设备已重置'.tr,
borderRadius: 20.w,
onClick: () {
logic.confirmLockReset();
},
),
),
SizedBox(height: 20.h),
//
Container(
margin: EdgeInsets.symmetric(horizontal: 40.w),
child: TextButton(
onPressed: Get.back,
child: Text(
'取消'.tr,
style: TextStyle(
fontSize: 22.sp,
color: Colors.grey[600],
),
),
),
),
SizedBox(height: 40.h),
],
),
);
});
}),
),
],
),
);
},
);
}
}