|
@@ -376,6 +376,7 @@ class FacialRecognitionController extends GetxController
|
|
|
return;
|
|
|
}
|
|
|
final XFile? file = await takePicture();
|
|
|
+ state.processingImageLocalPath = '';
|
|
|
if (file != null) {
|
|
|
faceDetector = FaceDetector(options: FaceDetectorOptions());
|
|
|
// faceDetector =
|
|
@@ -395,6 +396,7 @@ class FacialRecognitionController extends GetxController
|
|
|
PromptBox.toast('上传的图像类型错误');
|
|
|
return;
|
|
|
}
|
|
|
+ state.processingImageLocalPath = file.path;
|
|
|
final url = await rpc.storage.upload(
|
|
|
file,
|
|
|
fileType: fileType,
|
|
@@ -412,6 +414,7 @@ class FacialRecognitionController extends GetxController
|
|
|
image: url,
|
|
|
),
|
|
|
);
|
|
|
+ state.processingImageLocalPath = '';
|
|
|
if (result.faceScanErrorType == FaceScanErrorTypeEnum.Success) {
|
|
|
finishFaceDetection(result);
|
|
|
} else if (result.faceScanErrorType ==
|
|
@@ -431,7 +434,9 @@ class FacialRecognitionController extends GetxController
|
|
|
}
|
|
|
} catch (e) {
|
|
|
logger.e("getPatientBaseByFaceImageAsync failed: $e", e);
|
|
|
+ state.processingImageLocalPath = '';
|
|
|
}
|
|
|
+ state.processingImageLocalPath = '';
|
|
|
}
|
|
|
}
|
|
|
doFacialRecognition();
|
|
@@ -446,6 +451,7 @@ class FacialRecognitionController extends GetxController
|
|
|
idCardInfo.idCardNumber = patientInfo!.cardNo!;
|
|
|
}
|
|
|
final XFile? file = await takePicture();
|
|
|
+ state.processingImageLocalPath = '';
|
|
|
if (file != null) {
|
|
|
faceDetector = FaceDetector(options: FaceDetectorOptions());
|
|
|
// faceDetector =
|
|
@@ -466,6 +472,7 @@ class FacialRecognitionController extends GetxController
|
|
|
PromptBox.toast('上传的图像类型错误');
|
|
|
return;
|
|
|
}
|
|
|
+ state.processingImageLocalPath = file.path;
|
|
|
final url = await rpc.storage.upload(
|
|
|
file,
|
|
|
fileType: fileType,
|
|
@@ -484,6 +491,7 @@ class FacialRecognitionController extends GetxController
|
|
|
image: url,
|
|
|
),
|
|
|
);
|
|
|
+ state.processingImageLocalPath = '';
|
|
|
if (result.success) {
|
|
|
Get.back(result: true);
|
|
|
} else {
|
|
@@ -536,8 +544,10 @@ class FacialRecognitionController extends GetxController
|
|
|
}
|
|
|
}
|
|
|
} catch (e) {
|
|
|
+ state.processingImageLocalPath = '';
|
|
|
logger.e("savePatientBaseByFaceImageAsync failed: $e", e);
|
|
|
}
|
|
|
+ state.processingImageLocalPath = '';
|
|
|
}
|
|
|
}
|
|
|
|