Q: ${list[key][i].title}
发布时间: ${date}浏览量: ${list[key][i].click}
${list[key][i].description}
`;
}
ListContent.html(str);
};
function initProgress(dom, totalPage, index) {
let pageArr = [];
let group = 7;
let half = Math.floor(group / 2);
if (index <= half) {
for (let i = 1; i <= group; i++) pageArr.push(i); // [0, 1, 2, 3, 4, 5]
} else if (totalPage - index <= half) {
for (let i = group - 1; i >= 0; i--) pageArr.push(totalPage - i); // [totalPage-5, totalPage-4, totalPage-3, totalPage-2, totalPage-1, totalPage]
} else {
for(let i = index - half; i <= index + half; i++) {
pageArr.push(i); // [index-2, index-1, index, index+1, index+2]
}
}
let str = "";
for(let i = 0; i <= group - 1; i++) {
str += `