|
@@ -365,7 +365,7 @@ class FacialRecognitionController extends GetxController
|
|
|
/// 人脸识别逻辑
|
|
|
void doFacialRecognition() async {
|
|
|
doFacialRecognitionTimes++;
|
|
|
- if (doFacialRecognitionTimes == 10) {
|
|
|
+ if (doFacialRecognitionTimes >= 10) {
|
|
|
// 尝试十次后宣告失败
|
|
|
state.isRunningFaceRecognition = false;
|
|
|
PromptBox.toast('人脸识别失败,请先录入人脸信息或更新人脸信息');
|
|
@@ -487,33 +487,38 @@ class FacialRecognitionController extends GetxController
|
|
|
/// 询问是否需要解绑原身份证并绑定当前身份证
|
|
|
/// 原身份证:result.bindCardNo
|
|
|
/// 当前身份证:idCardInfo.idCardNumber
|
|
|
- await Get.dialog(VAlertDialog(
|
|
|
- title: '提示',
|
|
|
- content: Container(
|
|
|
- margin: const EdgeInsets.only(bottom: 20),
|
|
|
- child: const Text(
|
|
|
- '该人脸已绑定其他身份证,是否解绑并绑定当前身份证?',
|
|
|
- style: TextStyle(fontSize: 20),
|
|
|
- textAlign: TextAlign.center,
|
|
|
+ await Get.dialog(
|
|
|
+ VAlertDialog(
|
|
|
+ title: '提示',
|
|
|
+ width: 600,
|
|
|
+ content: Container(
|
|
|
+ margin:
|
|
|
+ const EdgeInsets.only(bottom: 20, left: 20, right: 20),
|
|
|
+ child: Text(
|
|
|
+ '该人脸已绑定身份证(${result.bindCardNo})\n是否解绑并绑定当前身份证(${idCardInfo.idCardNumber})?',
|
|
|
+ style: const TextStyle(fontSize: 20),
|
|
|
+ textAlign: TextAlign.left,
|
|
|
+ ),
|
|
|
),
|
|
|
+ showCancel: true,
|
|
|
+ onConfirm: () async {
|
|
|
+ bool success = await unbindAndCreateByFaceImageAsync(
|
|
|
+ result.bindCardNo!,
|
|
|
+ idCardInfo.idCardNumber,
|
|
|
+ url,
|
|
|
+ );
|
|
|
+ if (success) {
|
|
|
+ Get.back(result: true);
|
|
|
+ } else {
|
|
|
+ PromptBox.toast('人脸数据存入失败');
|
|
|
+ }
|
|
|
+ },
|
|
|
),
|
|
|
- showCancel: true,
|
|
|
- onConfirm: () async {
|
|
|
- bool success = await unbindAndCreateByFaceImageAsync(
|
|
|
- result.bindCardNo!,
|
|
|
- idCardInfo.idCardNumber,
|
|
|
- url,
|
|
|
- );
|
|
|
- if (success) {
|
|
|
- Get.back(result: true);
|
|
|
- } else {
|
|
|
- PromptBox.toast('人脸数据存入失败');
|
|
|
- }
|
|
|
- },
|
|
|
- ));
|
|
|
+ );
|
|
|
}
|
|
|
+ } else {
|
|
|
+ PromptBox.toast('人脸数据存入失败: ${result.errMessage}');
|
|
|
}
|
|
|
- PromptBox.toast('人脸数据存入失败: ${result.errMessage}');
|
|
|
}
|
|
|
} catch (e) {
|
|
|
logger.e("savePatientBaseByFaceImageAsync failed: $e", e);
|