From 1d1e7740119d1c90775cc9f73020da67e3f401df Mon Sep 17 00:00:00 2001 From: yuchenglong Date: Mon, 19 Jan 2026 16:06:20 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E6=AF=94=E8=B5=9B=E5=8D=A1?= =?UTF-8?q?=E7=89=87=E7=9A=84=E8=81=94=E8=B5=9B=E9=94=AE=EF=BC=8C=E4=BC=98?= =?UTF-8?q?=E5=8C=96=E5=AE=9E=E6=97=B6=E6=AF=94=E5=88=86=E8=AF=B7=E6=B1=82?= =?UTF-8?q?=E5=8F=82=E6=95=B0=EF=BC=8C=E8=B0=83=E6=95=B4=E6=AF=94=E5=88=86?= =?UTF-8?q?=E6=98=BE=E7=A4=BA=E6=A0=B7=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/(tabs)/index.tsx | 1 + components/live-detail/live-score-header.tsx | 2 +- components/match-card.tsx | 13 ++++++++++++- components/match-detail/score-header.tsx | 2 +- lib/api.ts | 5 +++++ types/api.ts | 10 +++++----- 6 files changed, 25 insertions(+), 8 deletions(-) diff --git a/app/(tabs)/index.tsx b/app/(tabs)/index.tsx index 89af04f..3c71d67 100644 --- a/app/(tabs)/index.tsx +++ b/app/(tabs)/index.tsx @@ -377,6 +377,7 @@ export default function HomeScreen() { fav: false, sportId: sportId, isLive: true, + leagueKey: item.league_key, }; }); diff --git a/components/live-detail/live-score-header.tsx b/components/live-detail/live-score-header.tsx index f028d5f..f5b2071 100644 --- a/components/live-detail/live-score-header.tsx +++ b/components/live-detail/live-score-header.tsx @@ -410,7 +410,7 @@ const styles = StyleSheet.create({ }, scoreValue: { color: "#000", - fontSize: 30, + fontSize: 25, fontWeight: "700", lineHeight: 30, letterSpacing: 1, diff --git a/components/match-card.tsx b/components/match-card.tsx index 9c62d22..d84f534 100644 --- a/components/match-card.tsx +++ b/components/match-card.tsx @@ -71,7 +71,18 @@ export function MatchCard({ if (onPress) { onPress(match); } else { - router.push(`/match-detail/${match.id}`); + if (isLive) { + router.push({ + pathname: "/live-detail/[id]", + params: { + id: match.id, + league_id: match.leagueId?.toString() || "", + sport_id: match.sportId?.toString() || "", + }, + }); + } else { + router.push(`/match-detail/${match.id}`); + } } }; diff --git a/components/match-detail/score-header.tsx b/components/match-detail/score-header.tsx index 9e6c4c9..918900c 100644 --- a/components/match-detail/score-header.tsx +++ b/components/match-detail/score-header.tsx @@ -355,7 +355,7 @@ const styles = StyleSheet.create({ }, scoreValue: { color: "#000", - fontSize: 30, + fontSize: 25, fontWeight: "700", lineHeight: 30, letterSpacing: 1, diff --git a/lib/api.ts b/lib/api.ts index c1d67b9..fcef39d 100644 --- a/lib/api.ts +++ b/lib/api.ts @@ -207,6 +207,11 @@ export const fetchLiveScore = async ( leagueId?: number, timezone?: string ): Promise => { + console.log("Fetching live scores with params:", { + sportId, + leagueId, + timezone, + }); try { const params: { sport_id: number; league_id?: number; timezone?: string } = { diff --git a/types/api.ts b/types/api.ts index 3fab9c2..9631f43 100644 --- a/types/api.ts +++ b/types/api.ts @@ -25,7 +25,7 @@ export interface Match { awayTeamKey?: string; awayTeamLogo?: string; leagueName?: string; - leagueKey?: string; + leagueKey?: number; leagueLogo?: string; countryName?: string; countryKey?: string; @@ -87,11 +87,11 @@ export interface LiveScoreMatch { substitutes?: { time: string; home_scorer: - | { in: string; out: string; in_id: number; out_id: number } - | any[]; + | { in: string; out: string; in_id: number; out_id: number } + | any[]; away_scorer: - | { in: string; out: string; in_id: number; out_id: number } - | any[]; + | { in: string; out: string; in_id: number; out_id: number } + | any[]; info: string; info_time: string; score: string;