From 2af06a09d8341a184ed1d1faac8d1c160548219e Mon Sep 17 00:00:00 2001 From: lxm <1274844347@qq.com> Date: Sat, 28 Feb 2026 19:52:47 +0800 Subject: [PATCH] =?UTF-8?q?feat(meeting):=20=E5=9C=A8=E5=88=86=E4=BA=AB?= =?UTF-8?q?=E5=BA=95=E9=83=A8=E5=BC=B9=E7=AA=97=E4=B8=AD=E6=B7=BB=E5=8A=A0?= =?UTF-8?q?=E4=BF=9D=E5=AD=98=E6=80=9D=E7=BB=B4=E5=AF=BC=E5=9B=BE=E5=8A=9F?= =?UTF-8?q?=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 为思维导图功能添加本地保存选项,新增对应的国际化文本键值。 在分享底部弹窗中增加“保存思维导图”按钮,与现有的“分享思维导图”功能并列。 移除未使用的版本更新服务导入以保持代码整洁。 --- lib/core/translations/language/en_us.dart | 1 + lib/core/translations/language/zh_cn.dart | 1 + lib/core/translations/language/zh_hk.dart | 1 + lib/core/translations/language/zh_tw.dart | 1 + .../views/bottomSheet/share_bottom_sheet.dart | 435 +++++++++--------- 5 files changed, 224 insertions(+), 215 deletions(-) diff --git a/lib/core/translations/language/en_us.dart b/lib/core/translations/language/en_us.dart index d39444e27..6d6688df4 100644 --- a/lib/core/translations/language/en_us.dart +++ b/lib/core/translations/language/en_us.dart @@ -657,6 +657,7 @@ const Map enUS = { 'Detected that you have permanently denied storage permission. To continue using this feature, please go to app settings to manually enable storage permission.', // Meeting模块 - 思维导图相关 + 'saveMindMap': 'Save Mind Map', 'shareMindMap': 'Share Mind Map', 'shareSuccess': 'Share Success', diff --git a/lib/core/translations/language/zh_cn.dart b/lib/core/translations/language/zh_cn.dart index 72c634ae7..0778aa675 100644 --- a/lib/core/translations/language/zh_cn.dart +++ b/lib/core/translations/language/zh_cn.dart @@ -608,6 +608,7 @@ const Map zhCN = { '检测到您已永久拒绝存储权限。如需继续使用此功能,请前往应用设置中手动开启存储权限。', // Meeting模块 - 思维导图相关 + 'saveMindMap': '保存思维导图', 'shareMindMap': '分享思维导图', 'shareSuccess': '分享成功', diff --git a/lib/core/translations/language/zh_hk.dart b/lib/core/translations/language/zh_hk.dart index dc672f675..8e1dd310f 100644 --- a/lib/core/translations/language/zh_hk.dart +++ b/lib/core/translations/language/zh_hk.dart @@ -609,6 +609,7 @@ const Map zhHK = { '檢測到您已永久拒絕儲存權限。如需繼續使用此功能,請前往應用設定中手動開啟儲存權限。', // Meeting模块 - 思维导图相关 + 'saveMindMap': '儲存思維導圖', 'shareMindMap': '分享思維導圖', 'shareSuccess': '分享成功', diff --git a/lib/core/translations/language/zh_tw.dart b/lib/core/translations/language/zh_tw.dart index cefe53f35..dd0aa2956 100644 --- a/lib/core/translations/language/zh_tw.dart +++ b/lib/core/translations/language/zh_tw.dart @@ -609,6 +609,7 @@ const Map zhTW = { '檢測到您已永久拒絕儲存權限。如需繼續使用此功能,請前往應用設定中手動開啟儲存權限。', // Meeting模块 - 思维导图相关 + 'saveMindMap': '儲存思維導圖', 'shareMindMap': '分享思維導圖', 'shareSuccess': '分享成功', diff --git a/lib/modules/meeting/views/bottomSheet/share_bottom_sheet.dart b/lib/modules/meeting/views/bottomSheet/share_bottom_sheet.dart index 4e7642a04..8727ab100 100644 --- a/lib/modules/meeting/views/bottomSheet/share_bottom_sheet.dart +++ b/lib/modules/meeting/views/bottomSheet/share_bottom_sheet.dart @@ -13,7 +13,6 @@ import 'package:share_plus/share_plus.dart'; import 'package:webview_flutter/webview_flutter.dart'; -import '../../../../data/services/version_update_service.dart'; import '../../../../data/services/network/dio_manager.dart'; import '../../controllers/meeting_details_controller.dart'; import '../../controllers/mind_map_controller.dart'; @@ -38,237 +37,243 @@ class _ShareBottomSheetState extends State { child: Column( mainAxisSize: MainAxisSize.min, children: [ - Container( - padding: EdgeInsets.symmetric(vertical: 10.w), - child: Row( - children: [ - Icon( - Icons.audio_file_outlined, - color: Colors.grey, - size: 32.w, - ), - 5.horizontalSpace, - Expanded( - child: Text( - _controller.meetingData.value.title, - style: TextStyle( - fontSize: 16.sp, - color: Colors.black87, - ), + Container( + padding: EdgeInsets.symmetric(vertical: 10.w), + child: Row( + children: [ + Icon( + Icons.audio_file_outlined, + color: Colors.grey, + size: 32.w, ), - ), - GestureDetector( - onTap: () => Get.back(), - child: Container( - width: 26.w, - height: 26.w, - decoration: BoxDecoration( - color: Colors.white, - borderRadius: BorderRadius.circular(26.r), - ), - child: Icon( - Icons.close, - size: 18.w, - color: Colors.grey[400], + 5.horizontalSpace, + Expanded( + child: Text( + _controller.meetingData.value.title, + style: TextStyle( + fontSize: 16.sp, + color: Colors.black87, + ), ), ), - ) - ], + GestureDetector( + onTap: () => Get.back(), + child: Container( + width: 26.w, + height: 26.w, + decoration: BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.circular(26.r), + ), + child: Icon( + Icons.close, + size: 18.w, + color: Colors.grey[400], + ), + ), + ) + ], + ), ), - ), - Padding( - padding: EdgeInsets.symmetric(vertical: 10.w), - child: Column( - children: [ - _box([ - _shareItem( - Icons.link, - 'shareLink'.tr, // 对应中文:分享链接 - isBorder: false, - onTap: () async { - Get.back(); - final GetStorage storage = GetStorage(); - String token = storage.read("logintoken") ?? ''; - int id = _controller.meetingData.value.id; - - // final thumbnail = await getAssetThumbnailFile( - // 'assets/images/mine-background.png', - // 'share_thumb.png', - // ); - - // 获取动态服务器地址 - final serverUrl = DioManager().baseUrl; - final serverHost = serverUrl - .replaceFirst('https://', '') - .replaceFirst('http://', ''); - - final result = await SharePlus.instance.share(ShareParams( - title: _controller.meetingData.value.title, - subject: - 'Voitrans WEB,由DeepSound.Ai提供支持-实时记录会议纪要,多语言翻译。', - uri: Uri.parse( - 'https://share.deepechomeet.com/share/$serverHost/voitrans.net/$id/$token', - ), - //previewThumbnail: thumbnail, - )); - if (result.status == ShareResultStatus.success) { - EasyLoading.showToast('shareSuccess'.tr); // 对应中文:分享完成 - } - }, - ), - ]), - _box([ - _shareItem(Icons.copy, 'copyTranscript'.tr, // 对应中文:复制转写 - onTap: _controller.meetingDetails.value.tasktype >= 3 && - _controller.meetingDetails.value.tasktype < 10002 - ? () { - Get.back(); - _copy(_getAllText()); - } - : null), - _shareItem(Icons.copy, 'copySummary'.tr, // 对应中文:复制总结 + Padding( + padding: EdgeInsets.symmetric(vertical: 10.w), + child: Column( + children: [ + _box([ + _shareItem( + Icons.link, + 'shareLink'.tr, // 对应中文:分享链接 isBorder: false, + onTap: () async { + Get.back(); + final GetStorage storage = GetStorage(); + String token = storage.read("logintoken") ?? ''; + int id = _controller.meetingData.value.id; + + // final thumbnail = await getAssetThumbnailFile( + // 'assets/images/mine-background.png', + // 'share_thumb.png', + // ); + + // 获取动态服务器地址 + final serverUrl = DioManager().baseUrl; + final serverHost = serverUrl + .replaceFirst('https://', '') + .replaceFirst('http://', ''); + + final result = + await SharePlus.instance.share(ShareParams( + title: _controller.meetingData.value.title, + subject: + 'Voitrans WEB,由DeepSound.Ai提供支持-实时记录会议纪要,多语言翻译。', + uri: Uri.parse( + 'https://share.deepechomeet.com/share/$serverHost/voitrans.net/$id/$token', + ), + //previewThumbnail: thumbnail, + )); + if (result.status == ShareResultStatus.success) { + EasyLoading.showToast('shareSuccess'.tr); // 对应中文:分享完成 + } + }, + ), + ]), + _box([ + _shareItem(Icons.copy, 'copyTranscript'.tr, // 对应中文:复制转写 + onTap: _controller.meetingDetails.value.tasktype >= 3 && + _controller.meetingDetails.value.tasktype < + 10002 + ? () { + Get.back(); + _copy(_getAllText()); + } + : null), + _shareItem(Icons.copy, 'copySummary'.tr, // 对应中文:复制总结 + isBorder: false, + onTap: _controller.meetingDetails.value.tasktype >= 5 && + _controller.meetingDetails.value.tasktype < + 10001 + ? () { + Get.back(); + _copy(_markdownToPlainText( + _controller.meetingDetails.value.summary)); + } + : null), + ]), + _box([ + _shareItem( + Icons.multitrack_audio, 'exportAudio'.tr, // 对应中文:导出音频 + onTap: () { + Get.back(); + _share(_controller.meetingData.value.filepath, + 'shareMeetingAudio'.tr); // 对应中文:分享会议音频 + }), + _shareItem( + Icons.message, 'exportTranscript'.tr, // 对应中文:导出转写 + onTap: _controller.meetingDetails.value.tasktype >= 3 && + _controller.meetingDetails.value.tasktype < + 10002 + ? () async { + Get.back(); + final tempDir = await getTemporaryDirectory(); + final file = File( + '${tempDir.path}/${_controller.meetingData.value.title}_speaker.txt'); + String allText = _getAllText(); + await file.writeAsString(allText); + _share(file.path, + 'exportTranscript'.tr); // 对应中文:分享会议转写 + } + : null), + _shareItem(Icons.article, 'exportSummary'.tr, // 对应中文:导出总结 + onTap: _controller.meetingDetails.value.tasktype >= 5 && + _controller.meetingDetails.value.tasktype < + 10001 + ? () async { + Get.back(); + Get.bottomSheet( + SecondLevelBottomSheet( + 'exportSummary'.tr, // 对应中文:导出总结 + 'exportAs'.tr, // 对应中文:导出为 + (int index) async { + if (index == 0) { + // 导出TXT + final tempDir = + await getTemporaryDirectory(); + final file = File( + '${tempDir.path}/${_controller.meetingData.value.title}_summary.txt'); + await file.writeAsString( + _markdownToPlainText(_controller + .meetingDetails.value.summary)); + _share(file.path, + 'exportSummary'.tr); // 对应中文:分享会议总结 + } else { + // 导出PDF + _exportMarkdownPdf(); + } + }, + const [ + { + 'icon': Icons.text_snippet, + 'title': 'TXT', + 'isBorder': true, + }, + { + 'icon': Icons.picture_as_pdf, + 'title': 'PDF', + 'isBorder': false, + }, + ], + ), + isScrollControlled: true, + backgroundColor: Colors.grey[100], + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.vertical( + top: Radius.circular(12.r), + ), + ), + ); + } + : null), + _shareItem( + Icons.save_alt, + 'saveMindMap'.tr, onTap: _controller.meetingDetails.value.tasktype >= 5 && _controller.meetingDetails.value.tasktype < 10001 ? () { Get.back(); - _copy(_markdownToPlainText( - _controller.meetingDetails.value.summary)); - } - : null), - ]), - _box([ - _shareItem( - Icons.multitrack_audio, 'exportAudio'.tr, // 对应中文:导出音频 - onTap: () { - Get.back(); - _share(_controller.meetingData.value.filepath, - 'shareMeetingAudio'.tr); // 对应中文:分享会议音频 - }), - _shareItem(Icons.message, 'exportTranscript'.tr, // 对应中文:导出转写 - onTap: _controller.meetingDetails.value.tasktype >= 3 && - _controller.meetingDetails.value.tasktype < 10002 - ? () async { - Get.back(); - final tempDir = await getTemporaryDirectory(); - final file = File( - '${tempDir.path}/${_controller.meetingData.value.title}_speaker.txt'); - String allText = _getAllText(); - await file.writeAsString(allText); - _share(file.path, - 'exportTranscript'.tr); // 对应中文:分享会议转写 + final mindMapController = + Get.find(); + mindMapController.imageType = 1; + if (mindMapController.isWebViewReady) { + mindMapController.webViewController + .runJavaScript('captureImage()'); + } else { + mindMapController.webViewController + .setNavigationDelegate( + NavigationDelegate( + onPageFinished: (String url) { + mindMapController.isWebViewReady = true; + mindMapController.webViewController + .runJavaScript('captureImage()'); + }, + ), + ); + } } - : null), - _shareItem(Icons.article, 'exportSummary'.tr, // 对应中文:导出总结 + : null, + ), + _shareItem( + Icons.lan, + 'shareMindMap'.tr, // 对应中文:分享思维导图 + isBorder: false, onTap: _controller.meetingDetails.value.tasktype >= 5 && _controller.meetingDetails.value.tasktype < 10001 - ? () async { + ? () { Get.back(); - Get.bottomSheet( - SecondLevelBottomSheet( - 'exportSummary'.tr, // 对应中文:导出总结 - 'exportAs'.tr, // 对应中文:导出为 - (int index) async { - if (index == 0) { - // 导出TXT - final tempDir = - await getTemporaryDirectory(); - final file = File( - '${tempDir.path}/${_controller.meetingData.value.title}_summary.txt'); - await file.writeAsString( - _markdownToPlainText(_controller - .meetingDetails.value.summary)); - _share(file.path, - 'exportSummary'.tr); // 对应中文:分享会议总结 - } else { - // 导出PDF - _exportMarkdownPdf(); - } - }, - const [ - { - 'icon': Icons.text_snippet, - 'title': 'TXT', - 'isBorder': true, + final mindMapController = + Get.find(); + mindMapController.imageType = 2; + if (mindMapController.isWebViewReady) { + mindMapController.webViewController + .runJavaScript('captureImage()'); + } else { + mindMapController.webViewController + .setNavigationDelegate( + NavigationDelegate( + onPageFinished: (String url) { + mindMapController.isWebViewReady = true; + mindMapController.webViewController + .runJavaScript('captureImage()'); }, - { - 'icon': Icons.picture_as_pdf, - 'title': 'PDF', - 'isBorder': false, - }, - ], - ), - isScrollControlled: true, - backgroundColor: Colors.grey[100], - shape: RoundedRectangleBorder( - borderRadius: BorderRadius.vertical( - top: Radius.circular(12.r), ), - ), - ); - } - : null), - _shareItem( - Icons.save_alt, - '保存思维导图', - onTap: _controller.meetingDetails.value.tasktype >= 5 && - _controller.meetingDetails.value.tasktype < 10001 - ? () { - Get.back(); - final mindMapController = - Get.find(); - mindMapController.imageType = 1; - if (mindMapController.isWebViewReady) { - mindMapController.webViewController - .runJavaScript('captureImage()'); - } else { - mindMapController.webViewController - .setNavigationDelegate( - NavigationDelegate( - onPageFinished: (String url) { - mindMapController.isWebViewReady = true; - mindMapController.webViewController - .runJavaScript('captureImage()'); - }, - ), - ); - } - } - : null, - ), - _shareItem( - Icons.lan, - 'shareMindMap'.tr, // 对应中文:分享思维导图 - isBorder: false, - onTap: _controller.meetingDetails.value.tasktype >= 5 && - _controller.meetingDetails.value.tasktype < 10001 - ? () { - Get.back(); - final mindMapController = - Get.find(); - mindMapController.imageType = 2; - if (mindMapController.isWebViewReady) { - mindMapController.webViewController - .runJavaScript('captureImage()'); - } else { - mindMapController.webViewController - .setNavigationDelegate( - NavigationDelegate( - onPageFinished: (String url) { - mindMapController.isWebViewReady = true; - mindMapController.webViewController - .runJavaScript('captureImage()'); - }, - ), - ); + ); + } } - } - : null, - ), - ]), - ], + : null, + ), + ]), + ], + ), ), - ), ], ), ),