分离足球事件卡片
This commit is contained in:
@@ -1,6 +1,9 @@
|
||||
import { BasketballScoreTable } from "@/components/match-detail/basketball/basketball-score-table";
|
||||
import { FootballEvents } from "@/components/match-detail/football/football-events";
|
||||
import { CardsCard } from "@/components/match-detail/football/cards-card";
|
||||
import { FootballScoreTable } from "@/components/match-detail/football/football-score-table";
|
||||
import { GoalsCard } from "@/components/match-detail/football/goals-card";
|
||||
import { LineupsCard } from "@/components/match-detail/football/lineups-card";
|
||||
import { SubstitutesCard } from "@/components/match-detail/football/substitutes-card";
|
||||
import { LeagueInfo } from "@/components/match-detail/league-info";
|
||||
import { MatchInfoCard } from "@/components/match-detail/match-info-card";
|
||||
import { MatchTabs } from "@/components/match-detail/match-tabs";
|
||||
@@ -73,6 +76,9 @@ export default function MatchDetailScreen() {
|
||||
const result = await fetchMatchDetail(id as string);
|
||||
setData(result);
|
||||
console.log("首发阵容" , result.match.players?.away_team);
|
||||
console.log("红黄牌", result.events);
|
||||
|
||||
|
||||
|
||||
} catch (err: any) {
|
||||
setError(err.message || t("detail.fetch_failed"));
|
||||
@@ -107,12 +113,11 @@ export default function MatchDetailScreen() {
|
||||
case "info":
|
||||
// 根据 sportId 显示不同的详情组件
|
||||
if (sportId === 1) {
|
||||
// 足球:显示 FootballScoreTable (半场/全场)、MatchInfoCard 和 FootballEvents
|
||||
// 足球:显示 FootballScoreTable (半场/全场) 和 MatchInfoCard
|
||||
return (
|
||||
<>
|
||||
<FootballScoreTable data={data} isDark={isDark} />
|
||||
<MatchInfoCard data={data} isDark={isDark} />
|
||||
<FootballEvents data={data} isDark={isDark} />
|
||||
</>
|
||||
);
|
||||
} else if (sportId === 2) {
|
||||
@@ -129,18 +134,31 @@ export default function MatchDetailScreen() {
|
||||
<>
|
||||
<FootballScoreTable data={data} isDark={isDark} />
|
||||
<MatchInfoCard data={data} isDark={isDark} />
|
||||
<FootballEvents data={data} isDark={isDark} />
|
||||
</>
|
||||
);
|
||||
}
|
||||
case "stats":
|
||||
return (
|
||||
<View style={styles.emptyContent}>
|
||||
<ThemedText style={styles.emptyText}>
|
||||
{t("detail.empty_stats")}
|
||||
</ThemedText>
|
||||
</View>
|
||||
);
|
||||
// 统计数据:显示进球、红黄牌、换人、首发阵容(分开显示)
|
||||
if (sportId === 1) {
|
||||
// 足球:分别显示各个卡片
|
||||
return (
|
||||
<>
|
||||
<GoalsCard data={data} isDark={isDark} />
|
||||
<CardsCard data={data} isDark={isDark} />
|
||||
<SubstitutesCard data={data} isDark={isDark} />
|
||||
<LineupsCard data={data} isDark={isDark} />
|
||||
</>
|
||||
);
|
||||
} else {
|
||||
// 其他运动暂时显示空状态
|
||||
return (
|
||||
<View style={styles.emptyContent}>
|
||||
<ThemedText style={styles.emptyText}>
|
||||
{t("detail.empty_stats")}
|
||||
</ThemedText>
|
||||
</View>
|
||||
);
|
||||
}
|
||||
case "odds":
|
||||
return (
|
||||
<View style={styles.emptyContent}>
|
||||
|
||||
Reference in New Issue
Block a user