63 lines
1.7 KiB
JavaScript
63 lines
1.7 KiB
JavaScript
|
|
class jigouxiangqing {
|
|
constructor() {
|
|
header("机构详情")
|
|
this.page = 1
|
|
|
|
this.getjigouxiangqing();
|
|
}
|
|
async getjigouxiangqing() {
|
|
var that = this
|
|
var data = {
|
|
id: query("id"),
|
|
page: that.page
|
|
}
|
|
var res = await indexServe.jigouxiangqing(data)
|
|
console.log(res);
|
|
res.data.forEach((value, index) => {
|
|
console.log(value.tags)
|
|
$(".gggg").html(`
|
|
<div class="ccccc">
|
|
<img src="${value.preview}" alt="">
|
|
<div class="list">
|
|
<span class="bb">${value.title}</span>
|
|
<p class="qq">${value.user}</p>
|
|
</div>
|
|
</div>
|
|
`)
|
|
})
|
|
// res.data.forEach((v) => {
|
|
// $(".list").html(`
|
|
// <a href="./jigouxiangqing.html?id=${v.id}&title=${v.title}" class="shuliang">
|
|
// <div class="title">${v.title}</div>
|
|
// <div class="number">${v.id}套</div>
|
|
// </a>
|
|
// `)
|
|
// })
|
|
// item($(".content .list"),
|
|
|
|
// res.data)
|
|
// this.principal[this.index].content
|
|
|
|
|
|
// console.log("123",res);
|
|
}
|
|
//请求更多数据
|
|
hotscroll() {
|
|
console.log("$('.hot')",$('.hot'));
|
|
$('.hot').onscroll = () => {
|
|
const {clientHeight, scrollHeight, scrollTop} = $('.hot');
|
|
const distance = scrollHeight- scrollTop - clientHeight;
|
|
console.log(clientHeight, scrollHeight, scrollTop);
|
|
if(distance <= 10){
|
|
console.log("滚动到底部...");
|
|
this.getModel()
|
|
}
|
|
}
|
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
new jigouxiangqing() |