Browse Source

fix(meeting): 修复录音计时器重置和防止重复导入录音的问题

重置计时器时同时重置毫秒显示
添加_isImportingLocalRecordings标志防止重复导入录音
移除导航栏底部弹窗中不必要的录音导入检查
weicu
lxm 9 months ago
parent
commit
8558ab1ab4
  1. 5
      lib/modules/meeting/controllers/meeting_home_controller.dart
  2. 1
      lib/modules/meeting/controllers/meeting_record_controller.dart
  3. 15
      lib/modules/meeting/views/bottomSheet/navigation_bar_bottom_sheet.dart

5
lib/modules/meeting/controllers/meeting_home_controller.dart

@ -33,6 +33,8 @@ class MeetingHomeController extends GetxController {
final AudioPlayer _audioPlayer = AudioPlayer(); final AudioPlayer _audioPlayer = AudioPlayer();
bool _isImportingLocalRecordings = false;
List<String> selected = []; List<String> selected = [];
final appDocDir = getApplicationDocumentsDirectory(); final appDocDir = getApplicationDocumentsDirectory();
@ -196,6 +198,8 @@ class MeetingHomeController extends GetxController {
// 核心方法:导入本地录音文件到统一目录 // 核心方法:导入本地录音文件到统一目录
void addMeetingAudio() async { void addMeetingAudio() async {
if (_isImportingLocalRecordings) return;
_isImportingLocalRecordings = true;
EasyLoading.show(status: 'importingLocalRecordings'.tr); // 对应中文:正在导入本地录音... EasyLoading.show(status: 'importingLocalRecordings'.tr); // 对应中文:正在导入本地录音...
try { try {
int addUp = 0; // 新增计数 int addUp = 0; // 新增计数
@ -325,6 +329,7 @@ class MeetingHomeController extends GetxController {
.tr .tr
.replaceAll('{error}', e.toString())); // 对应中文:导入失败: {error} .replaceAll('{error}', e.toString())); // 对应中文:导入失败: {error}
} finally { } finally {
_isImportingLocalRecordings = false;
EasyLoading.dismiss(); EasyLoading.dismiss();
} }
} }

1
lib/modules/meeting/controllers/meeting_record_controller.dart

@ -836,6 +836,7 @@ class MeetingRecordController extends GetxController
_elapsedMilliseconds = 0; _elapsedMilliseconds = 0;
_lastStartTime = null; _lastStartTime = null;
seconds.value = 0; seconds.value = 0;
milliseconds.value = 0;
timerStatus.value = TimerStatus.stopped; timerStatus.value = TimerStatus.stopped;
} }

15
lib/modules/meeting/views/bottomSheet/navigation_bar_bottom_sheet.dart

@ -30,12 +30,9 @@ class NavigationBarBottomSheet extends GetView<MeetingHomeController> {
Colors.red, Colors.red,
onTap: () async { onTap: () async {
Get.back(); Get.back();
final result = await Get.toNamed(Routes.meetingRecord, arguments: { await Get.toNamed(Routes.meetingRecord, arguments: {
'audioTypes': 0, 'audioTypes': 0,
}); });
if (result != 'meeting_record_background') {
controller.addMeetingAudio();
}
}, },
), ),
if (controller.meetingController.type == 1) if (controller.meetingController.type == 1)
@ -47,12 +44,9 @@ class NavigationBarBottomSheet extends GetView<MeetingHomeController> {
onTap: controller.bleManager.isConnected onTap: controller.bleManager.isConnected
? () async { ? () async {
Get.back(); Get.back();
final result = await Get.toNamed(Routes.meetingRecord, arguments: { await Get.toNamed(Routes.meetingRecord, arguments: {
'audioTypes': 1, 'audioTypes': 1,
}); });
if (result != 'meeting_record_background') {
controller.addMeetingAudio();
}
} }
: null, : null,
), ),
@ -65,12 +59,9 @@ class NavigationBarBottomSheet extends GetView<MeetingHomeController> {
onTap: controller.bleManager.isConnected onTap: controller.bleManager.isConnected
? () async { ? () async {
Get.back(); Get.back();
final result = await Get.toNamed(Routes.meetingRecord, arguments: { await Get.toNamed(Routes.meetingRecord, arguments: {
'audioTypes': 2, 'audioTypes': 2,
}); });
if (result != 'meeting_record_background') {
controller.addMeetingAudio();
}
} }
: null, : null,
), ),

Loading…
Cancel
Save