Files
2024-09-27 02:06:13 +08:00

49 lines
1.3 KiB
JavaScript
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

class ListService {
constructor(props) {
this.page = 1
this.list()
this.scrollLoadData()
}
async list() {
let res = await listervice.rightMenuList({
url: GetQueryString("url"),
p: this.page
});
res.forEach((v,i)=>{
$(".content .content_list ul").append(`
<li>
<a href="info.html?url=${v.url}">
<img src="${v.img}" alt="">
<div class="list_right">
<p>${v.title}</p>
<img src="../img/xingxing.png" alt="">
<div class="evaluate">
<i class="iconfont icon-xin"></i>
<span>${v.like}</span>
<i class="iconfont icon-faxian"></i>
<span>${v.view}</span>
</div>
</div>
</a>
</li>
`)
})
}
scrollLoadData() {
var scroll = new auiScroll({
listen: true,
distance: 10 //判断到达底部的距离isToBottom为true
}, (ret) => {
if(ret.isToBottom){
this.page += 1;
this.list()
}
});
}
}
new ListService()