添加比赛卡片的联赛键,优化实时比分请求参数,调整比分显示样式

This commit is contained in:
yuchenglong
2026-01-19 16:06:20 +08:00
parent e766a833f6
commit 1d1e774011
6 changed files with 25 additions and 8 deletions

View File

@@ -377,6 +377,7 @@ export default function HomeScreen() {
fav: false,
sportId: sportId,
isLive: true,
leagueKey: item.league_key,
};
});

View File

@@ -410,7 +410,7 @@ const styles = StyleSheet.create({
},
scoreValue: {
color: "#000",
fontSize: 30,
fontSize: 25,
fontWeight: "700",
lineHeight: 30,
letterSpacing: 1,

View File

@@ -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}`);
}
}
};

View File

@@ -355,7 +355,7 @@ const styles = StyleSheet.create({
},
scoreValue: {
color: "#000",
fontSize: 30,
fontSize: 25,
fontWeight: "700",
lineHeight: 30,
letterSpacing: 1,

View File

@@ -207,6 +207,11 @@ export const fetchLiveScore = async (
leagueId?: number,
timezone?: string
): Promise<LiveScoreMatch[]> => {
console.log("Fetching live scores with params:", {
sportId,
leagueId,
timezone,
});
try {
const params: { sport_id: number; league_id?: number; timezone?: string } =
{

View File

@@ -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;