1.重构参赛队伍详情页面,更新数据模型以支持新结构;
2.优化比赛信息展示逻辑,增强用户交互体验; 3.修复API请求以获取队伍详情并处理异常情况。
This commit is contained in:
@@ -3,7 +3,9 @@ import 'package:flutter_riverpod/flutter_riverpod.dart';
|
||||
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
||||
import 'package:recording_tool/app/config/app_config.dart';
|
||||
import 'package:recording_tool/app/router/app_navigator.dart';
|
||||
import 'package:recording_tool/features/competition_teams/model/model_competition_team.dart';
|
||||
import 'package:recording_tool/features/competition_teams/pages/page_event_team_match.dart';
|
||||
import 'package:recording_tool/features/competition_teams/server/server_competition_teams.dart';
|
||||
import 'package:recording_tool/features/events/model/model_event_info.dart';
|
||||
import 'package:recording_tool/features/events/state/state_event_info.dart';
|
||||
import 'package:recording_tool/features/events/view_model/view_model_event_info.dart';
|
||||
@@ -25,13 +27,37 @@ class _EventInfoPageState extends ConsumerState<EventInfoPage> {
|
||||
}
|
||||
|
||||
Future<void> onItemTap(EventRegistrationItem item) async {
|
||||
// debugPrint('item tapped: ${item.itemName}');
|
||||
// await ref.read(eventInfoProvider.notifier).requestStreamKey(item);
|
||||
if (!mounted) return;
|
||||
// final profile = ref.read(eventInfoProvider).profile;
|
||||
CompetitionTeamDetail? detail;
|
||||
if (item.opponentId.isNotEmpty && item.opponentId != '0') {
|
||||
detail = await ref
|
||||
.read(competitionTeamsServerProvider)
|
||||
.fetchTeamDetail(
|
||||
itemId: item.itemId,
|
||||
eventId: item.eventId,
|
||||
scheduleId: item.scheduleId,
|
||||
opponentId: item.opponentId,
|
||||
);
|
||||
if (!mounted) return;
|
||||
AppNavigator.push(
|
||||
buildEventRegistrationDestination(
|
||||
item: item,
|
||||
playerId: widget.playerId,
|
||||
detail: detail,
|
||||
),
|
||||
context: context,
|
||||
);
|
||||
return;
|
||||
}
|
||||
|
||||
if (!mounted) return;
|
||||
|
||||
AppNavigator.push(
|
||||
buildEventRegistrationDestination(item: item, playerId: widget.playerId),
|
||||
buildEventRegistrationDestination(
|
||||
item: item,
|
||||
playerId: widget.playerId,
|
||||
detail: null,
|
||||
),
|
||||
context: context,
|
||||
);
|
||||
}
|
||||
@@ -89,9 +115,10 @@ class _EventInfoPageState extends ConsumerState<EventInfoPage> {
|
||||
Widget buildEventRegistrationDestination({
|
||||
required EventRegistrationItem item,
|
||||
required String playerId,
|
||||
required CompetitionTeamDetail? detail,
|
||||
}) {
|
||||
if (item.opponentId.isNotEmpty && item.opponentId != '0') {
|
||||
return EventTeamMatchPage(item: item, playerId: playerId);
|
||||
if (detail != null) {
|
||||
return EventTeamMatchPage(playerId: playerId, detail: detail);
|
||||
}
|
||||
return WebviewPage(
|
||||
url: AppConfig.current.mainRefereeScoreH5Url,
|
||||
|
||||
Reference in New Issue
Block a user