This commit is contained in:
chenshuainan
2026-09-28 20:12:34 +08:00
parent 847986f861
commit 5f53bd8f94
60 changed files with 14624 additions and 398 deletions
@@ -6,6 +6,7 @@ import 'package:new_learn/core/api/conquerPackage/captureList/api.dart';
import 'package:new_learn/core/api/conquerPackage/captureList/model.dart';
import 'package:new_learn/core/components/common_paged_list.dart';
import 'package:new_learn/core/utils/img_url.dart';
import 'package:new_learn/features/conquerPackage/classExercises/controllers/exercise_timing.dart';
/// ============================================================
/// 【CaptureListPage】攻克列表页 —— 对标 Vue pages/conquerPackage/captureList/index.vue
@@ -234,8 +235,8 @@ class _CaptureListPageState extends State<CaptureListPage> {
if (res.hasQuestion) {
// 有题目 → 过渡页 或 习题页
final pagePath = res.nowStudyObjectType == 0
? '/conquer/transitionPage'
: '/conquer/classExercises';
? '/conquerPackage/transitionPage'
: '/conquerPackage/classExercises';
_navigateTo(pagePath, {
'status': '3',
'courseId': widget.courseId,
@@ -272,12 +273,15 @@ class _CaptureListPageState extends State<CaptureListPage> {
context.push(path, extra: params);
}
/// 点击报告(跳转报告页)
/// 点击报告(跳转报告页,对标 Vue getReport)
/// recordId=攻克记录 id,packId=攻克包 id;判题中(status==3)不可点
void _getReport(CourseRecord record, _CapturePackViewModel pack) {
if (CaptureRecordStatus.fromInt(record.status) ==
CaptureRecordStatus.processing) return;
// TODO(路由): 跳转报告页
debugPrint('跳转报告页 recordId=${record.id}, packId=${pack.id}');
_navigateTo('/conquerPackage/report', {
'recordId': '${record.id}',
'packId': pack.id,
});
}
// ========== 工具方法 ==========
@@ -287,16 +291,6 @@ class _CaptureListPageState extends State<CaptureListPage> {
return chineseNum[num.clamp(0, 9)];
}
String _formatDuration(int seconds) {
if (seconds <= 0) return '0秒';
final h = seconds ~/ 3600;
final m = (seconds % 3600) ~/ 60;
final s = seconds % 60;
if (h > 0) return '${h}时${m}分';
if (m > 0) return '${m}分${s}秒';
return '${s}秒';
}
// ========== 构建 ==========
@override
@@ -888,7 +882,7 @@ class _CaptureListPageState extends State<CaptureListPage> {
),
SizedBox(width: 13.w),
Text(
_formatDuration(0), // TODO: 后端 record 没有用时字段,需确认
formatDuration(record.overcomeTimeSecond),
style: TextStyle(fontSize: 12.sp, color: _subtitleColor),
),
],