${ $item.comp }
${ $item.home }
${$item.home }
${ $item.homeScores } - ${ $item.awayScores }
${$item.away }
${ $item.away }
`, "text/html").body.children.item(0); const live = () => { /**@type {HTMLAnchorElement} */ const anchor = $item_el.querySelector(".bt-view"); anchor.classList.add("start"); return anchor; }; const play = () => { /**@type {HTMLAnchorElement} */ const anchor = $item_el.querySelector(".bt-view"); anchor.classList.add("begin"); return anchor; }; const back = () => { /**@type {HTMLAnchorElement} */ const anchor = $item_el.querySelector(".bt-view"); anchor.classList.add("recoad"); return anchor; }; switch ($item.sportId) { case 1: /* 足球 */{ if ($item.statusId >= 2 && $item.statusId = 2 && $item.statusId window.setTimeout(resolve, 0, void 0)); if (controller.signal.aborted) break; } return data.length } let start = 0; console.log(wrapper, 'wrapper') start += await render(data.slice(0, end)).then((length) => (wrapper.nextElementSibling.style.setProperty("display", (data.length > (start + length) ? "block" : "none")), length)); controller.signal.addEventListener("abort", () => wrapper.nextElementSibling.style.setProperty("display", "none"), { once: true }); wrapper.nextElementSibling.addEventListener("click", async ($event) => { $event.preventDefault(); start += await render(data.slice(start, start + 200)).then((length) => (wrapper.nextElementSibling.style.setProperty("display", (data.length > (start + length) ? "block" : "none")), length)); }, { signal: controller.signal }); console.timeEnd("update"); loading = false; } tabs.addEventListener("click", async ($event) => { for (const item of tabs?.querySelectorAll(".match_filter_item")) { if (item.contains($event.target)) { for (const el of tabs?.querySelectorAll(".match_filter_item.active")) el.classList.remove("active"); item.classList.add("active"); /* 调用更新方法 */ const $controller = new AbortController(); controller.abort(); while (loading) { await new Promise((resolve) => window.requestAnimationFrame(resolve)); } controller = $controller; for (let i = wrapper.children.length - 1; i >= 0; i--) wrapper.removeChild(wrapper.children[i]); const type = item instanceof HTMLElement ? item.getAttribute("data-type") : "0"; for (let i = 0; i v.matchTs.getTime())) + (3.6e+6 * 4); while (list[end] && list[end].matchTs.getTime() update() */ const hot_id = [/* */"competition_id=2&sport_id=1",/* */"competition_id=82&sport_id=1",/* */"competition_id=108&sport_id=1",/* */"competition_id=120&sport_id=1",/* */"competition_id=129&sport_id=1",/* */"competition_id=142&sport_id=1",/* */"competition_id=542&sport_id=1",/* */"competition_id=567&sport_id=1",/* */"competition_id=568&sport_id=1",/* */"competition_id=581&sport_id=1",/* */"competition_id=582&sport_id=1",/* */"competition_id=590&sport_id=1",/* */"competition_id=1788&sport_id=1",/* */"competition_id=1&sport_id=2",/* */"competition_id=3&sport_id=2",/* */]; const api_src = new URL("/getMatchListJsonp", location.origin); api_src.searchParams.set("days", "1"); fetch(api_src).then((response) => response.json()).then(({ matchLiveList }) => { const list = []; for (let i = 0; i a.matchTs.getTime() - b.matchTs.getTime()); const contest_all = []; const contest_football = []; const contest_basketball = []; const contest_hot = []; for (let i = 0; i { for (let i = wrapper.children.length - 1; i >= 0; i--) wrapper.removeChild(wrapper.children[i]); const type = item instanceof HTMLElement ? item.getAttribute("data-type") : "0"; for (let i = 0; i v.matchTs.getTime())) + (3.6e+6 * 4); while (list[end] && list[end].matchTs.getTime()