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(`
  • ${v.title}

    ${v.like} ${v.view}
  • `) }) } scrollLoadData() { var scroll = new auiScroll({ listen: true, distance: 10 //判断到达底部的距离,isToBottom为true }, (ret) => { if(ret.isToBottom){ this.page += 1; this.list() } }); } } new ListService()