CBA(中国男子篮球职业联赛)作为中国篮球的最高水平职业联赛,一直备受球迷们的关注和热爱。在这里,您将享受到最精彩的篮球直播,见证国内顶尖篮球运动员的风采。
正在直播的比赛
即将到来的比赛
{fetch("api/live-games.json").then((res) => res.json()).then((data) => {data.forEach((game) => {const li = document.createElement("li");li.textContent = `${game.homeTeam} vs. ${game.awayTeam} (${game.time})`;li.style.cursor = "pointer";li.addEventListener("click", () => {// 根据游戏ID跳转到直播页面});liveGamesList.appendChild(li);});}).catch((err) => {console.error(err);alert("获取直播数据失败,请重试。");});};// 获取即将到来的比赛数据const getUpcomingGames = () => {fetch("api/upcoming-games.json").then((res) => res.json()).then((data) => {data.forEach((game) => {const tr = document.createElement("tr");tr.innerHTML = `
`;upcomingGamesTable.appendChild(tr);});}).catch((err) => {console.error(err);alert("获取即将到来的比赛数据失败,请重试。");});};// 获取精彩集锦数据const getHighlights = () => {fetch("api/highlights.json").then((res) => res.json()).then((data) => {data.forEach((highlight) => {if (highlight.type === "video") {const video = document.createElement("video");video.src = highlight.url;video.autoplay = true;video.loop = true;video.style.width = "100%";highlightsContainer.appendChild(video);} else if (highlight.type === "image") {const img = document.createElement("img");
img.src = highlight.url;img.alt = highlight.title;img.style.width = "100%";highlightsContainer.appendChild(img);}});}).catch((err) => {console.error(err);alert("获取精彩集锦数据失败,请重试。");});};// 获取最新新闻数据const getNews = () => {fetch("api/news.json").then((res) => res.json()).then((data) => {data.forEach((news) => {const article = document.createElement("article");article.innerHTML = `
${news.title}
${news.summary}
继续阅读
`;newsContainer.appendChild(article);});}).catch((err) => {console.error(err);alert("获取最新新闻数据失败,请重试。");});};getLiveGames();getUpcomingGames();getHighlights();getNews();
日期
|
时间
|
主队
|
客队
|
观看方式
|
2023-03-15
|
19:35
|
广东宏远
|
浙江广厦
|
CCTV5
|
2023-03-16
|
19:35
|
辽宁男篮
|
${game.date}
|
${game.time}
|
${game.homeTeam}
|
${game.awayTeam}
|
${game.watchPlatform}
|