33 lines
758 B
JavaScript
33 lines
758 B
JavaScript
class Info {
|
|
constructor() {
|
|
this.page = 0;
|
|
this.pageRes = []
|
|
header(
|
|
query("title"),
|
|
'<i class="iconfont icon-xin"></i>'
|
|
)
|
|
this.getInfo()
|
|
}
|
|
|
|
async getInfo() {
|
|
let res = await indexServe.info({
|
|
id: query("id"),
|
|
// quantity: parseInt(query("quantity") / 20)
|
|
quantity: query("quantity")
|
|
});
|
|
|
|
for (let i = 0; i < res.length; i+=10) {
|
|
this.pageRes.push(res.slice(i, i + 10))
|
|
}
|
|
this.renderPage()
|
|
}
|
|
|
|
renderPage() {
|
|
$(".content").html(
|
|
this.pageRes[this.page].map(v => {
|
|
return `<img src="${v}" alt="">`
|
|
})
|
|
)
|
|
}
|
|
}
|
|
new Info() |