12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152 |
- 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<void> submitShareEmail(
- String reportCode, List<String> 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<void> submitShareSMS(
- String reportCode, List<String> 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);
- }
- }
- }
|