fix:修复 人脸修改姓名后回退到问题

This commit is contained in:
anfe 2024-06-24 18:02:56 +08:00
parent 3de600acda
commit e56685be9c
6 changed files with 63 additions and 40 deletions

View File

@ -924,5 +924,6 @@
"导出成功":"Export success", "导出成功":"Export success",
"发送钥匙": "Send key", "发送钥匙": "Send key",
"进度": "Progress", "进度": "Progress",
"失败": "Failure" "失败": "Failure",
"人脸详情": "Face details"
} }

View File

@ -956,5 +956,6 @@
"导出成功":"导出成功", "导出成功":"导出成功",
"发送钥匙": "发送钥匙", "发送钥匙": "发送钥匙",
"进度": "进度", "进度": "进度",
"失败": "失败" "失败": "失败",
"人脸详情": "人脸详情"
} }

View File

@ -921,6 +921,7 @@
"导出成功":"导出成功", "导出成功":"导出成功",
"发送钥匙": "发送钥匙", "发送钥匙": "发送钥匙",
"进度": "进度", "进度": "进度",
"失败": "失败" "失败": "失败",
"人脸详情": "人脸详情"
} }

View File

@ -174,6 +174,8 @@ class FaceDetailLogic extends BaseGetXController {
showToast('修改成功', something: () { showToast('修改成功', something: () {
Get.back(result: 'addScuess'); Get.back(result: 'addScuess');
}); });
}else{
Get.back();
} }
} }

View File

@ -33,7 +33,7 @@ class _FaceDetailPageState extends State<FaceDetailPage> with RouteAware {
return Scaffold( return Scaffold(
backgroundColor: AppColors.mainBackgroundColor, backgroundColor: AppColors.mainBackgroundColor,
appBar: TitleAppBar( appBar: TitleAppBar(
barTitle: '人脸详情', barTitle: '人脸详情'.tr,
haveBack: true, haveBack: true,
backgroundColor: AppColors.mainColor, backgroundColor: AppColors.mainColor,
), ),
@ -44,7 +44,9 @@ class _FaceDetailPageState extends State<FaceDetailPage> with RouteAware {
rightTitle: state.typeNumber.value, rightTitle: state.typeNumber.value,
isHaveDirection: false, isHaveDirection: false,
isHaveLine: true)), isHaveLine: true)),
Obx(() => lockDataListItem(TranslationLoader.lanKeys!.name!.tr, state.typeName.value, () { Obx(() => lockDataListItem(
TranslationLoader.lanKeys!.name!.tr, state.typeName.value,
() {
// showCupertinoAlertDialog(context); // showCupertinoAlertDialog(context);
ShowTipView().showTFViewAlertDialog( ShowTipView().showTFViewAlertDialog(
state.changeNameController, state.changeNameController,
@ -54,7 +56,6 @@ class _FaceDetailPageState extends State<FaceDetailPage> with RouteAware {
logic.showToast('请输入姓名'.tr); logic.showToast('请输入姓名'.tr);
return; return;
} }
Get.back();
state.typeName.value = state.changeNameController.text; state.typeName.value = state.changeNameController.text;
logic.updateFaceNameData(); logic.updateFaceNameData();
}, inputFormatters: <TextInputFormatter>[ }, inputFormatters: <TextInputFormatter>[
@ -64,8 +65,8 @@ class _FaceDetailPageState extends State<FaceDetailPage> with RouteAware {
})), })),
Obx(() => Visibility( Obx(() => Visibility(
visible: state.keyType.value == 4 || visible: state.keyType.value == 4 ||
state.keyType.value == 2 || state.keyType.value == 2 ||
state.keyType.value == 1, state.keyType.value == 1,
child: CommonItem( child: CommonItem(
leftTitel: TranslationLoader.lanKeys!.periodValidity!.tr, leftTitel: TranslationLoader.lanKeys!.periodValidity!.tr,
allHeight: 70.h, allHeight: 70.h,
@ -187,11 +188,12 @@ class _FaceDetailPageState extends State<FaceDetailPage> with RouteAware {
rightTitle: '', rightTitle: '',
isHaveDirection: true, isHaveDirection: true,
action: () { action: () {
Get.toNamed(Routers.lockOperatingRecordPage, arguments: <String, Object?>{ Get.toNamed(Routers.lockOperatingRecordPage,
'type': 4, arguments: <String, Object?>{
'id': state.faceItemData.value.faceId.toString(), 'type': 4,
'recordName': state.faceItemData.value.faceName 'id': state.faceItemData.value.faceId.toString(),
}); 'recordName': state.faceItemData.value.faceName
});
}), }),
// SizedBox(height: 40.h), // SizedBox(height: 40.h),
// addControlsBtn(type), // addControlsBtn(type),
@ -215,12 +217,14 @@ class _FaceDetailPageState extends State<FaceDetailPage> with RouteAware {
); );
} }
Widget lockDataListItem(String leftTitle, String conentStr, Function()? action){ Widget lockDataListItem(
String leftTitle, String conentStr, Function()? action) {
return GestureDetector( return GestureDetector(
onTap: action, onTap: action,
child: Container( child: Container(
// height: 70.h, // height: 70.h,
padding: EdgeInsets.only(left: 20.w, right: 10.w, top: 15.h, bottom: 15.h), padding:
EdgeInsets.only(left: 20.w, right: 10.w, top: 15.h, bottom: 15.h),
decoration: BoxDecoration( decoration: BoxDecoration(
color: Colors.white, color: Colors.white,
border: Border( border: Border(
@ -228,15 +232,17 @@ class _FaceDetailPageState extends State<FaceDetailPage> with RouteAware {
color: AppColors.greyLineColor, // color: AppColors.greyLineColor, //
width: 2.0.h, // width: 2.0.h, //
), ),
) )),
),
child: Row( child: Row(
children: <Widget>[ children: <Widget>[
Text(leftTitle, style: TextStyle(fontSize: 22.sp)), Text(leftTitle, style: TextStyle(fontSize: 22.sp)),
SizedBox(width: 10.w), SizedBox(width: 10.w),
Expanded( Expanded(
child: Text(conentStr, textAlign:TextAlign.end, style: TextStyle(fontSize: 22.sp, )) child: Text(conentStr,
), textAlign: TextAlign.end,
style: TextStyle(
fontSize: 22.sp,
))),
SizedBox(width: 10.w), SizedBox(width: 10.w),
Image.asset( Image.asset(
'images/icon_right_grey.png', 'images/icon_right_grey.png',

View File

@ -1,4 +1,3 @@
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart';
@ -8,34 +7,47 @@ class ShowDeleteAdministratorIsHaveAllDataWidget extends StatefulWidget {
BlockIsHaveAllDataCallback? blockIsHaveAllDataCallback; BlockIsHaveAllDataCallback? blockIsHaveAllDataCallback;
String? contentStr; String? contentStr;
ShowDeleteAdministratorIsHaveAllDataWidget({Key? key, this.contentStr, this.blockIsHaveAllDataCallback}) : super(key: key); ShowDeleteAdministratorIsHaveAllDataWidget(
{Key? key, this.contentStr, this.blockIsHaveAllDataCallback})
: super(key: key);
@override @override
State<ShowDeleteAdministratorIsHaveAllDataWidget> createState() => _ShowDeleteAdministratorIsHaveAllDataWidgetState(); State<ShowDeleteAdministratorIsHaveAllDataWidget> createState() =>
_ShowDeleteAdministratorIsHaveAllDataWidgetState();
} }
class _ShowDeleteAdministratorIsHaveAllDataWidgetState extends State<ShowDeleteAdministratorIsHaveAllDataWidget> { class _ShowDeleteAdministratorIsHaveAllDataWidgetState
extends State<ShowDeleteAdministratorIsHaveAllDataWidget> {
bool selet = false; bool selet = false;
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Row( return GestureDetector(
children: [ onTap: () {
GestureDetector( setState(() {
onTap: () { selet = !selet;
setState(() { widget.blockIsHaveAllDataCallback!(selet);
selet = !selet; });
widget.blockIsHaveAllDataCallback!(selet); },
}); child: Row(
}, children: <Widget>[
child: Image.asset( Image.asset(
selet ? 'images/icon_round_select.png' : 'images/icon_round_unSelect.png', selet
width: 30.w, ? 'images/icon_round_select.png'
height: 30.w, : 'images/icon_round_unSelect.png',
)), width: 30.w,
SizedBox(width: 15.w,), height: 30.w,
Expanded(child: Text(widget.contentStr!, maxLines: 2, textAlign: TextAlign.start, style: TextStyle(fontSize: 24.sp))), ),
], SizedBox(
width: 15.w,
),
Expanded(
child: Text(widget.contentStr!,
maxLines: 2,
textAlign: TextAlign.start,
style: TextStyle(fontSize: 24.sp))),
],
),
); );
} }
} }