欢迎来到我们的即时比分中心,在这里你可以获取最新最全的竞彩足球比分信息,实时掌握比赛动态,做出更明智的投注决策。
正在进行的比赛
已结束的比赛
<script>
// 假设我们有一个名为 matches 的 JSON 对象,其中包含比赛数据const matches = [{id: 1,homeTeam: "巴塞罗那",awayTeam: "皇家马德里",startTime: "2023-03-08T14:00:00Z",homeScore: 2,awayScore: 1,status: "进行中"},{id: 2,homeTeam: "曼联",awayTeam: "利物浦",startTime: "2023-03-08T16:30:00Z",homeScore: null,awayScore: null,status: "未开始"},{id: 3,homeTeam: "拜仁慕尼黑",awayTeam: "巴黎圣日耳曼",startTime: "2023-03-08T19:00:00Z",homeScore: 1,awayScore: 3,status: "已结束"}];// 根据比赛状态将比赛数据分组const liveMatches = matches.filter(match => match.status === "进行中");const finishedMatches = matches.filter(match => match.status === "已结束");// 从 liveMatches 中生成 HTMLconst liveMatchesHtml = liveMatches.map(match => {return `
| ${match.startTime} | ${match.homeTeam} | ${match.homeScore} - ${match.awayScore} | ${match.awayTeam} |
`;}).join("");// 从 finishedMatches 中生成 HTMLconst finishedMatchesHtml = finishedMatches.map(match => {return `
| ${match.startTime} | ${match.homeTeam} | ${match.homeScore} - ${match.awayScore} | ${match.awayTeam} |
`;}).join("");// 将 HTML 填充到表格中document.getElementById("live-matches").innerHTML += liveMatchesHtml;document.getElementById("finished-matches").innerHTML += finishedMatchesHtml;
</script>