fix: 根据需求修改新增页面的部分问题
This commit is contained in:
parent
a733840c5e
commit
2d1aad35b2
@ -78,6 +78,14 @@ class _LockAddFaqPageState extends State<LockAddFaqPage> {
|
||||
|
||||
SizedBox(height: 30.h),
|
||||
|
||||
// 问题6:使用小程序
|
||||
_buildFaqItem(
|
||||
icon: Icons.phone_android,
|
||||
title: '使用小程序'.tr,
|
||||
description: '如果App无法正常添加锁,可以尝试使用小程序版本。'.tr,
|
||||
solution: '打开微信,搜索“星星锁Lite”小程序,尝试通过小程序添加锁。'.tr,
|
||||
),
|
||||
|
||||
// 尝试升级按钮
|
||||
Container(
|
||||
width: double.infinity,
|
||||
|
||||
@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -23,16 +23,31 @@ 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(
|
||||
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<LockResetConfirmPage>
|
||||
children: [
|
||||
SizedBox(height: 60.h),
|
||||
|
||||
// 重置锁图标
|
||||
// 重置图标
|
||||
Container(
|
||||
width: 120.w,
|
||||
height: 120.w,
|
||||
@ -66,10 +81,10 @@ class _LockResetConfirmPageState extends State<LockResetConfirmPage>
|
||||
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<LockResetConfirmPage>
|
||||
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<LockResetConfirmPage>
|
||||
|
||||
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<LockResetConfirmPage>
|
||||
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<LockResetConfirmPage>
|
||||
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<LockResetConfirmPage>
|
||||
);
|
||||
});
|
||||
}
|
||||
|
||||
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,
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@ -79,12 +79,12 @@ class _NearbyLockPageState extends State<NearbyLockPage> 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,
|
||||
),
|
||||
|
||||
@ -106,13 +106,11 @@ class _SelectLockTypePageState extends State<SelectLockTypePage>
|
||||
// }),
|
||||
// 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<SelectLockTypePage>
|
||||
|
||||
return GestureDetector(
|
||||
onTap: () {
|
||||
CommonDataManage().seletLockType = 0;
|
||||
logic.getNearByLimits();
|
||||
// Get.toNamed(Routers.nearbyLockPage);
|
||||
logic.goToLockResetConfirm(0); // 修改为经过重置确认页面
|
||||
},
|
||||
child: view,
|
||||
);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user