From 7d65be0514879bfde6bcf6575ce7761cab5e2032 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9E=97=E9=94=8B?= <2535831261@qq.com> Date: Wed, 29 Jul 2026 11:51:11 +0800 Subject: [PATCH] =?UTF-8?q?=E9=80=89=E6=89=8B=E8=B5=9B=E9=A1=B9=E5=88=97?= =?UTF-8?q?=E8=A1=A8=E5=A2=9E=E5=8A=A0=20=E9=80=89=E6=89=8B=E4=B8=8E?= =?UTF-8?q?=E8=AF=A5=E8=B5=9B=E9=A1=B9=E7=9A=84=E9=80=89=E6=89=8B=E7=BC=96?= =?UTF-8?q?=E5=8F=B7=E5=B1=9E=E6=80=A7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/features/events/model/model_event_info.dart | 4 ++++ lib/features/events/pages/page_event_info.dart | 11 ++++++----- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/lib/features/events/model/model_event_info.dart b/lib/features/events/model/model_event_info.dart index c8a53cd..b4d03ae 100644 --- a/lib/features/events/model/model_event_info.dart +++ b/lib/features/events/model/model_event_info.dart @@ -127,6 +127,7 @@ class EventRegistrationItem { required this.itemName, required this.groupName, required this.matchPlace, + this.matchStartTime = '', this.matchEndTime = '', this.completed = false, @@ -136,6 +137,7 @@ class EventRegistrationItem { this.userId = '', this.playerName = '', this.playerPhone = '', + this.playerNo = '', }); final String eventId; @@ -151,6 +153,7 @@ class EventRegistrationItem { final String opponentId; final String opponentName; final List teamMembers; + final String playerNo; /// 来自报名列表父级,不在 item JSON 内 final String userId; @@ -198,6 +201,7 @@ class EventRegistrationItem { : const [], userId: userId, playerName: playerName, + playerNo: _readString(map, const ['playerNo']), ); } diff --git a/lib/features/events/pages/page_event_info.dart b/lib/features/events/pages/page_event_info.dart index 6ba7bbb..0e5e182 100644 --- a/lib/features/events/pages/page_event_info.dart +++ b/lib/features/events/pages/page_event_info.dart @@ -521,9 +521,10 @@ String _formatOpponentLine(EventRegistrationItem item) { } String _formatNumberBadge(EventRegistrationItem item) { - final place = item.matchPlace.trim(); - if (place.isEmpty) return ''; - final match = RegExp(r'\d+').firstMatch(place); - if (match != null) return '${match.group(0)}号'; - return place; + return item.playerNo.trim().isEmpty ? '' : '${item.playerNo.trim()}号'; + // final place = item.matchPlace.trim(); + // if (place.isEmpty) return ''; + // final match = RegExp(r'\d+').firstMatch(place); + // if (match != null) return '${match.group(0)}号'; + // return place; }