Blogs

We provide a wide range of Services

Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Suspendisse et justo. Praesent mattis commodo augue. Aliquam ornare hendrerit augue.
文章加载中,请稍候...
`; }); listBox.innerHTML = html; // 更新分页信息 document.getElementById("page-info").innerText = `第${currentPage}页 / 共${totalPage}页`; document.getElementById("prev-page").disabled = currentPage <= 1; document.getElementById("next-page").disabled = currentPage >= totalPage; pagerBox.style.display = totalPage > 1 ? "block" : "none"; } // 绑定分页点击事件 function bindPageEvent() { document.getElementById("prev-page").onclick = () => { if(currentPage > 1) { currentPage--; renderPage(); } }; document.getElementById("next-page").onclick = () => { const totalPage = Math.ceil(allArticleData.length / PAGE_SIZE); if(currentPage < totalPage) { currentPage++; renderPage(); } }; } // 时间戳格式化 function formatDate(timestamp) { if (!timestamp) return ""; const date = new Date(Number(timestamp)); return `${date.getFullYear()}/${String(date.getMonth()+1).padStart(2,'0')}/${String(date.getDate()).padStart(2,'0')}`; } window.addEventListener("DOMContentLoaded", loadAllArticles);