|
@@ -1,14 +1,18 @@
|
|
|
import 'dart:typed_data';
|
|
|
|
|
|
import 'package:fis_common/index.dart';
|
|
|
+import 'package:fis_i18n/i18n.dart';
|
|
|
import 'package:fis_jsonrpc/rpc.dart';
|
|
|
import 'package:flutter_sound/flutter_sound.dart';
|
|
|
import 'package:flyinsonolite/consultation/liveconsultation/views/consultationrequestdialog.dart';
|
|
|
import 'package:flyinsonolite/consultation/liveconsultation/models/popuptimer.dart';
|
|
|
+import 'package:flyinsonolite/consultation/records/models/consultationmember.dart';
|
|
|
+import 'package:flyinsonolite/controls/prompt.dart';
|
|
|
import 'package:flyinsonolite/jsonrpc/fisLib/services/log.m.dart';
|
|
|
import 'package:flyinsonolite/infrastructure/global.dart';
|
|
|
import 'package:flyinsonolite/jsonrpc/jsonrpcclientforFISLib.dart';
|
|
|
import 'package:flyinsonolite/infrastructure/logger.dart';
|
|
|
+import 'package:flyinsonolite/localization/fis_i18n.dart';
|
|
|
import 'package:flyinsonolite/managers/interfaces/iappointmentmanager.dart';
|
|
|
import 'package:flyinsonolite/managers/interfaces/iliveconsultationmanager.dart';
|
|
|
import 'package:flyinsonolite/consultation/records/models/liveconsultation.dart';
|
|
@@ -69,12 +73,7 @@ class ConsultationPopup {
|
|
|
static Future<void> onInviteLiveConsultation(
|
|
|
Object sender, LiveConsultation e) async {
|
|
|
///Felix临时屏蔽非本机会诊
|
|
|
- final IAppointmentManager appointmentManager =
|
|
|
- Get.find<IAppointmentManager>();
|
|
|
- var consultationDetaioDto = await appointmentManager
|
|
|
- .findConsultationDetailAsync(e.consultationCode!);
|
|
|
- if (Storage.usDeviceCode != consultationDetaioDto?.deviceCode &&
|
|
|
- Storage.platform == Platform.Windows) {
|
|
|
+ if (!(await isSupportThisConsultation(e))) {
|
|
|
return;
|
|
|
}
|
|
|
//if (_isPlaying) {
|
|
@@ -90,14 +89,10 @@ class ConsultationPopup {
|
|
|
|
|
|
///加入会诊弹窗
|
|
|
static void onJoinLiveConsultation(Object sender, LiveConsultation e) async {
|
|
|
- final IAppointmentManager appointmentManager =
|
|
|
- Get.find<IAppointmentManager>();
|
|
|
- var consultationDetaioDto = await appointmentManager
|
|
|
- .findConsultationDetailAsync(e.consultationCode!);
|
|
|
- if (Storage.usDeviceCode != consultationDetaioDto?.deviceCode &&
|
|
|
- Storage.platform == Platform.Windows) {
|
|
|
+ if (!(await isSupportThisConsultation(e))) {
|
|
|
return;
|
|
|
}
|
|
|
+
|
|
|
if (_isPlaying) {
|
|
|
_stopTimer = true;
|
|
|
_isPlaying = false;
|
|
@@ -176,4 +171,30 @@ class ConsultationPopup {
|
|
|
"_informUSToFlyinsonoPageAsync error:$ex");
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+ static Future<bool> isSupportThisConsultation(LiveConsultation e) async {
|
|
|
+ try {
|
|
|
+ final IAppointmentManager appointmentManager =
|
|
|
+ Get.find<IAppointmentManager>();
|
|
|
+ var consultationDetaioDto = await appointmentManager
|
|
|
+ .findConsultationDetailAsync(e.consultationCode!);
|
|
|
+ if (Storage.usDeviceCode != consultationDetaioDto?.deviceCode &&
|
|
|
+ Storage.platform == Platform.Windows) {
|
|
|
+ var initiaor = e.memberLiveDatas[0];
|
|
|
+ if (e.operator != null) {
|
|
|
+ initiaor = ConsultationMember.fromDto(e.operator!)
|
|
|
+ .fixMergedVideoOutputSize()
|
|
|
+ .fixOnlyCamera();
|
|
|
+ }
|
|
|
+ PromptBox.toast(fisI18nBook.common.currentConsultationNotSupport
|
|
|
+ .translate([initiaor.name]));
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ return true;
|
|
|
+ } catch (ex) {
|
|
|
+ await loggerAsyn(
|
|
|
+ FISDeviceLogCategory.Error, "isSupportThisConsultation error:$ex");
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|