From 2d1aad35b2a8c1f0f369f8001437ed534add4249 Mon Sep 17 00:00:00 2001 From: wuyaxi <18682150237@163.com> Date: Tue, 15 Jul 2025 10:30:25 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E6=A0=B9=E6=8D=AE=E9=9C=80=E6=B1=82?= =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=96=B0=E5=A2=9E=E9=A1=B5=E9=9D=A2=E7=9A=84?= =?UTF-8?q?=E9=83=A8=E5=88=86=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../addLock/lockAddFaq/lockAddFaq_page.dart | 8 ++ .../lockResetConfirm_logic.dart | 28 ++++- .../lockResetConfirm_page.dart | 111 +++++++----------- .../addLock/nearbyLock/nearbyLock_page.dart | 4 +- .../selectLockType/selectLockType_page.dart | 10 +- 5 files changed, 82 insertions(+), 79 deletions(-) diff --git a/lib/mine/addLock/lockAddFaq/lockAddFaq_page.dart b/lib/mine/addLock/lockAddFaq/lockAddFaq_page.dart index 8146dae2..865d0981 100644 --- a/lib/mine/addLock/lockAddFaq/lockAddFaq_page.dart +++ b/lib/mine/addLock/lockAddFaq/lockAddFaq_page.dart @@ -78,6 +78,14 @@ class _LockAddFaqPageState extends State { SizedBox(height: 30.h), + // 问题6:使用小程序 + _buildFaqItem( + icon: Icons.phone_android, + title: '使用小程序'.tr, + description: '如果App无法正常添加锁,可以尝试使用小程序版本。'.tr, + solution: '打开微信,搜索“星星锁Lite”小程序,尝试通过小程序添加锁。'.tr, + ), + // 尝试升级按钮 Container( width: double.infinity, diff --git a/lib/mine/addLock/lockResetConfirm/lockResetConfirm_logic.dart b/lib/mine/addLock/lockResetConfirm/lockResetConfirm_logic.dart index 502935ba..6224c323 100644 --- a/lib/mine/addLock/lockResetConfirm/lockResetConfirm_logic.dart +++ b/lib/mine/addLock/lockResetConfirm/lockResetConfirm_logic.dart @@ -2,15 +2,35 @@ import 'package:get/get.dart'; import 'package:star_lock/appRouters.dart'; import 'package:star_lock/mine/addLock/lockResetConfirm/lockResetConfirm_state.dart'; import 'package:star_lock/tools/baseGetXController.dart'; +import 'package:star_lock/tools/commonDataManage.dart'; class LockResetConfirmLogic extends BaseGetXController { final LockResetConfirmState state = LockResetConfirmState(); // 确认锁已重置,继续添加流程 void confirmLockReset() { - // 跳转到添加锁页面,传递锁类型参数 - Get.toNamed(Routers.addLockPage, arguments: { - 'getLockType': state.getLockType.value, - }); + // 根据锁类型决定下一步流程 + switch (state.getLockType.value) { + case 7: // 网关 + CommonDataManage().seletLockType = 7; + Get.toNamed(Routers.selectGatewayTypeNextTipPage); + break; + case 8: // 网络摄像头 + CommonDataManage().seletLockType = 8; + // 直接跳转到附近的锁页面 + Get.toNamed(Routers.nearbyLockPage); + break; + case 0: // 所有锁 + CommonDataManage().seletLockType = 0; + // 直接跳转到附近的锁页面 + Get.toNamed(Routers.nearbyLockPage); + break; + default: // 其他锁类型(1-6) + // 跳转到添加锁页面,传递锁类型参数 + Get.toNamed(Routers.addLockPage, arguments: { + 'getLockType': state.getLockType.value, + }); + break; + } } } diff --git a/lib/mine/addLock/lockResetConfirm/lockResetConfirm_page.dart b/lib/mine/addLock/lockResetConfirm/lockResetConfirm_page.dart index 3e07f50a..c3b20ea3 100644 --- a/lib/mine/addLock/lockResetConfirm/lockResetConfirm_page.dart +++ b/lib/mine/addLock/lockResetConfirm/lockResetConfirm_page.dart @@ -23,16 +23,31 @@ class _LockResetConfirmPageState extends State return GetBuilder( 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( skyCall: () => TitleAppBar( - barTitle: '重置锁确认'.tr, + barTitle: '${deviceType}重置确认'.tr, haveBack: true, backgroundColor: AppColors.mainColor, ), xhjCall: () => TitleAppBar( - barTitle: '重置锁确认'.tr, + barTitle: '${deviceType}重置确认'.tr, haveBack: true, backgroundColor: Colors.white, iconColor: AppColors.blackColor, @@ -43,7 +58,7 @@ class _LockResetConfirmPageState extends State children: [ SizedBox(height: 60.h), - // 重置锁图标 + // 重置图标 Container( width: 120.w, height: 120.w, @@ -66,10 +81,10 @@ class _LockResetConfirmPageState extends State width: 1.sw, padding: EdgeInsets.symmetric(horizontal: 40.w), child: Text( - '请确认锁已重置'.tr, + title.tr, textAlign: TextAlign.center, style: TextStyle( - fontSize: 26.sp, + fontSize: 24.sp, fontWeight: FontWeight.w600, color: Colors.black87, ), @@ -83,10 +98,10 @@ class _LockResetConfirmPageState extends State width: 1.sw, padding: EdgeInsets.symmetric(horizontal: 40.w), child: Text( - '添加锁前,请确保锁已重置为出厂状态。重置后的锁将清除所有用户数据,包括指纹、密码、卡片等信息。'.tr, + description.tr, textAlign: TextAlign.center, style: TextStyle( - fontSize: 20.sp, + fontSize: 16.sp, color: Colors.black54, height: 1.5, ), @@ -95,34 +110,36 @@ class _LockResetConfirmPageState extends State SizedBox(height: 50.h), - // 重置步骤说明 + // 重置方法提示 Container( margin: EdgeInsets.symmetric(horizontal: 30.w), padding: EdgeInsets.all(20.w), decoration: BoxDecoration( - color: Colors.grey[50], + color: Colors.blue[50], borderRadius: BorderRadius.circular(12.w), border: Border.all( - color: Colors.grey[200]!, + color: Colors.blue[200]!, width: 1, ), ), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, + child: Row( children: [ - Text( - '重置锁步骤:'.tr, - style: TextStyle( - fontSize: 20.sp, - fontWeight: FontWeight.w600, - color: Colors.black87, + Icon( + Icons.info_outline, + color: Colors.blue[700], + size: 24.w, + ), + SizedBox(width: 12.w), + Expanded( + child: Text( + '重置方法请查阅设备说明书'.tr, + style: TextStyle( + fontSize: 16.sp, + color: Colors.blue[700], + fontWeight: FontWeight.w500, + ), ), ), - SizedBox(height: 15.h), - _buildStepItem('1', '找到锁上的重置按钮或重置孔'.tr), - _buildStepItem('2', '使用重置工具(如针或牙签)长按重置按钮'.tr), - _buildStepItem('3', '听到"滴"声或看到指示灯闪烁'.tr), - _buildStepItem('4', '等待锁完成重置,指示灯常亮或熄灭'.tr), ], ), ), @@ -133,7 +150,7 @@ class _LockResetConfirmPageState extends State Container( margin: EdgeInsets.symmetric(horizontal: 40.w), child: SubmitBtn( - btnName: '我已重置锁,继续添加'.tr, + btnName: confirmButtonText.tr, borderRadius: 25.w, onClick: () { logic.confirmLockReset(); @@ -147,11 +164,13 @@ class _LockResetConfirmPageState extends State Container( margin: EdgeInsets.symmetric(horizontal: 40.w), child: TextButton( - onPressed: Get.back, + onPressed: () { + Get.back(); + }, child: Text( '取消'.tr, style: TextStyle( - fontSize: 20.sp, + fontSize: 16.sp, color: Colors.grey[600], ), ), @@ -164,44 +183,4 @@ class _LockResetConfirmPageState extends State ); }); } - - Widget _buildStepItem(String number, String text) { - return Padding( - padding: EdgeInsets.only(bottom: 12.h), - child: Row( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Container( - width: 24.w, - height: 24.w, - decoration: BoxDecoration( - color: AppColors.mainColor, - borderRadius: BorderRadius.circular(12.w), - ), - child: Center( - child: Text( - number, - style: TextStyle( - color: Colors.white, - fontSize: 16.sp, - fontWeight: FontWeight.w600, - ), - ), - ), - ), - SizedBox(width: 12.w), - Expanded( - child: Text( - text, - style: TextStyle( - fontSize: 16.sp, - color: Colors.black87, - height: 1.4, - ), - ), - ), - ], - ), - ); - } } diff --git a/lib/mine/addLock/nearbyLock/nearbyLock_page.dart b/lib/mine/addLock/nearbyLock/nearbyLock_page.dart index a5e5e0c9..3d72ca3c 100755 --- a/lib/mine/addLock/nearbyLock/nearbyLock_page.dart +++ b/lib/mine/addLock/nearbyLock/nearbyLock_page.dart @@ -79,12 +79,12 @@ class _NearbyLockPageState extends State with RouteAware { child: Row( children: [ Icon(Icons.help_outline, - color: AppColors.mainColor, size: 20.w), + color: AppColors.touristColor, size: 22.w), SizedBox(width: 6.w), Text( '找不到锁?点此查看。'.tr, style: TextStyle( - color: AppColors.mainColor, + color: AppColors.touristColor, fontSize: 20.sp, fontWeight: FontWeight.w500, ), diff --git a/lib/mine/addLock/selectLockType/selectLockType_page.dart b/lib/mine/addLock/selectLockType/selectLockType_page.dart index 9c105353..ca9154fb 100755 --- a/lib/mine/addLock/selectLockType/selectLockType_page.dart +++ b/lib/mine/addLock/selectLockType/selectLockType_page.dart @@ -106,13 +106,11 @@ class _SelectLockTypePageState extends State // }), // if (!F.isLite) lockTypeItem('images/lockType/lockType_gatewayLock.png', '网关'.tr, () { - CommonDataManage().seletLockType = 7; - Get.toNamed(Routers.selectGatewayTypeNextTipPage); + logic.goToLockResetConfirm(7); }), // if (!F.isLite) lockTypeItem('images/lockType/lockType_camera.png', '网络摄像头'.tr, () { - CommonDataManage().seletLockType = 8; - logic.getNearByLimits(); + logic.goToLockResetConfirm(8); }), ]; } @@ -174,9 +172,7 @@ class _SelectLockTypePageState extends State return GestureDetector( onTap: () { - CommonDataManage().seletLockType = 0; - logic.getNearByLimits(); - // Get.toNamed(Routers.nearbyLockPage); + logic.goToLockResetConfirm(0); // 修改为经过重置确认页面 }, child: view, );