Files
App.K12.Student.Miniapp_Flu…/lib/core/utils/subject_icons.dart
T
崔宝新 96ab0221a5 feat(my): add 我的考试 page and related modules
1. 新增我的考试页面,包含学科筛选Tab和分页考试列表
2. 新增学科图标工具类,替换我的报告页重复的学科图标逻辑
3. 在我的页面菜单中添加我的考试入口
4. 新增exam模块的API接口和数据模型
5. 优化我的报告页面卡片样式,统一与考试卡片的布局
2026-09-10 15:59:11 +08:00

29 lines
1.3 KiB
Dart
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
import 'package:new_learn/core/utils/img_url.dart';
/// ============================================================
/// 【学科图标常量】
///
/// 对标 Vue utils/constant.js 的 SUBJECT_ICON_MAP。
/// 我的报告(my_report)、我的考试(exam)等模块共用,
/// 通过学科名(如「数学」「英语」)动态取对应图标。
/// ============================================================
/// 学科名 → 图标资源路径
const Map<String, String> kSubjectIconMap = {
'语文': '/StaticResource/2026-06-11/shuxue1781163770612.png',
'化学': '/StaticResource/2026-06-11/huaxue1781163828443.png',
'英语': '/StaticResource/2026-06-11/yingyu1781163725441.png',
'物理': '/StaticResource/2026-06-11/wuli1781148438346.png',
'数学': '/StaticResource/2026-06-11/shuxue1781163770612.png',
'生物': '/StaticResource/2026-06-11/shengwu1781163791768.png',
'历史': '/StaticResource/2026-06-11/lishi1781163811822.png',
'政治': '/StaticResource/2026-06-11/zhengzhi1781163750422.png',
'地理': '/StaticResource/2026-06-11/dili1781163844311.png',
};
/// 取学科图标完整 URL(无匹配时用数学兜底,对标 Vue getSubjectIcon)
String subjectIconUrl(String subjectName) {
final path = kSubjectIconMap[subjectName] ?? kSubjectIconMap['数学']!;
return ImgUrl.build(path);
}