import 'package:fis_i18n/i18n.dart'; import 'package:fis_jsonrpc/rpc.dart'; import 'package:get/get.dart'; import 'package:vitalapp/architecture/utils/prompt_box.dart'; import 'package:vitalapp/managers/interfaces/share.dart'; import 'package:vitalapp/rpc.dart'; import 'interfaces/base_manager.dart'; class ShareManager extends BaseManager implements IShareManager { /// 邮箱分享报告 /// /// 若实时诊断的报告code为null就拿远程诊断的报告code Future submitShareEmail( String reportCode, List selectedEmails) async { final result = await rpc.report.shareReportByEmailAsync( ShareReportByEmailRequest( emailList: selectedEmails, token: token, reportCode: reportCode, languageCode: i18nBook.locale.toCodeString('-'), ), ); if (result) { PromptBox.toast(i18nBook.user.operationSuccess.t); Get.back(); } else { PromptBox.toast(i18nBook.user.operationFailed.t); } } /// 短信分享报告 /// /// 若实时诊断的报告code为null就拿远程诊断的报告code Future submitShareSMS( String reportCode, List selectedPhoneNumbers) async { final result = await rpc.report.shareReportBySmsAsync( ShareReportBySmsRequest( mobileList: selectedPhoneNumbers, token: token, reportCode: reportCode, languageCode: i18nBook.locale.toCodeString('-'), ), ); if (result) { PromptBox.toast(i18nBook.user.operationSuccess.t); Get.back(); } else { PromptBox.toast(i18nBook.user.operationFailed.t); } } }