|
@@ -12,6 +12,7 @@ import 'package:vitalapp/managers/interfaces/device.dart';
|
|
|
import 'package:vitalapp/managers/interfaces/models/device.dart';
|
|
|
import 'package:vitalapp/managers/interfaces/patient.dart';
|
|
|
import 'package:vitalapp/managers/interfaces/permission.dart';
|
|
|
+import 'package:vitalapp/pages/controllers/blue_location_mixin.dart';
|
|
|
import 'package:vitalapp/pages/controllers/crowd_labels.dart';
|
|
|
import 'package:vitalapp/pages/controllers/home_nav_mixin.dart';
|
|
|
import 'package:vitalapp/pages/patient/bluetooth_card_reader/view.dart';
|
|
@@ -26,7 +27,8 @@ import 'package:fis_common/logger/logger.dart';
|
|
|
import '../../facial_recognition/index.dart';
|
|
|
import '../../id_card_scan/index.dart';
|
|
|
|
|
|
-class CreatePatientController extends FControllerBase with HomeNavMixin {
|
|
|
+class CreatePatientController extends FControllerBase
|
|
|
+ with HomeNavMixin, BluetoothAndLocationMixin {
|
|
|
final _patientManager = Get.find<IPatientManager>();
|
|
|
final crowdLabelsController = Get.find<CrowdLabelsController>();
|
|
|
final _patientListController = Get.find<PatientListController>();
|
|
@@ -234,13 +236,15 @@ class CreatePatientController extends FControllerBase with HomeNavMixin {
|
|
|
/// 点击读卡事件
|
|
|
void onReadCardClicked() async {
|
|
|
final DeviceModel? device = await getDevice(DeviceTypes.IC_READER);
|
|
|
- final CardReaderResult? result;
|
|
|
+ CardReaderResult? result;
|
|
|
if (device != null) {
|
|
|
- // return;
|
|
|
- result = await Get.dialog<CardReaderResult>(
|
|
|
- const BluetoothCardReaderDialog(),
|
|
|
- barrierDismissible: false,
|
|
|
- );
|
|
|
+ final envPassed = await checkDeviceConnectEnv();
|
|
|
+ if (envPassed) {
|
|
|
+ result = await Get.dialog<CardReaderResult>(
|
|
|
+ const BluetoothCardReaderDialog(),
|
|
|
+ barrierDismissible: false,
|
|
|
+ );
|
|
|
+ }
|
|
|
} else {
|
|
|
result = await Get.dialog<CardReaderResult>(
|
|
|
const CardReaderDialog(),
|
|
@@ -267,13 +271,15 @@ class CreatePatientController extends FControllerBase with HomeNavMixin {
|
|
|
/// 点击读卡事件 (若已建档跳详情页面 若未建档跳创建页面)
|
|
|
void onReadCardClickedToDetail() async {
|
|
|
final DeviceModel? device = await getDevice(DeviceTypes.IC_READER);
|
|
|
- final CardReaderResult? result;
|
|
|
+ CardReaderResult? result;
|
|
|
if (device != null) {
|
|
|
- // return;
|
|
|
- result = await Get.dialog<CardReaderResult>(
|
|
|
- const BluetoothCardReaderDialog(),
|
|
|
- barrierDismissible: false,
|
|
|
- );
|
|
|
+ final envPassed = await checkDeviceConnectEnv();
|
|
|
+ if (envPassed) {
|
|
|
+ result = await Get.dialog<CardReaderResult>(
|
|
|
+ const BluetoothCardReaderDialog(),
|
|
|
+ barrierDismissible: false,
|
|
|
+ );
|
|
|
+ }
|
|
|
} else {
|
|
|
result = await Get.dialog<CardReaderResult>(
|
|
|
const CardReaderDialog(),
|