feat: 新增站内消息系统,支持通知与订单跳转

This commit is contained in:
andyesfly committed 2026-10-23 17:18:21 +08:00
1 parent 411ec8be23
commit c799b62f6b
14 files changed
+464 -9

No files matched your search

@@ -11,6 +11,7 @@ import '../../../shared/widgets/app_feedback.dart';
import '../../../shared/widgets/x_card.dart';
import '../../../shared/widgets/x_common.dart';
import '../../../shared/widgets/x_top_bar.dart';
import '../application/notice_routes.dart';
import '../data/notice_api.dart';
/// 消息中心:站内通知列表 + 已读标记 + 分页加载。
@@ -108,14 +109,11 @@ class _NoticeCenterPageState extends ConsumerState<NoticeCenterPage> {
Future<void> _loadMore() => _load();
/// 点击消息:先标记已读;勘察指派消息(`bizType == "survey_order"`)
/// 带 `bizId` 时跳转到对应勘察订单详情,其余保持仅标记已读。
/// 点击消息:先标记已读;能识别业务来源时跳转到对应订单详情。
Future<void> _onNoticeTap(Notice notice) async {
if (!notice.isRead) await _markRead(notice);
final bizId = notice.bizId;
if (notice.bizType == 'survey_order' && bizId != null && mounted) {
context.push('/order/survey/$bizId');
}
final route = noticeRoute(notice);
if (route != null && mounted) context.push(route);
}
Future<void> _markRead(Notice notice) async {