45 lines
986 B
JavaScript
45 lines
986 B
JavaScript
class Model {
|
|
constructor() {
|
|
footer();
|
|
header("模特");
|
|
this.modelType()
|
|
}
|
|
|
|
|
|
|
|
async modelType(){
|
|
var res = await indexServe.allModel({});
|
|
console.log(res);
|
|
var hot = res.hot_models;
|
|
var news = res.newest;
|
|
hot.forEach(v => {
|
|
$(".hot_list").innerHTML+=`
|
|
<li>
|
|
<a href="./modelList.html?id=${v.id}&text=${v.title}">
|
|
<div class="hot_list_top">
|
|
<img src="${v.preview}" alt="">
|
|
<div class="xiao">${v.total}</div>
|
|
</div>
|
|
<p class="hot_list_botton">${v.title}</p>
|
|
</a>
|
|
</li>
|
|
`
|
|
});
|
|
news.forEach(v => {
|
|
$(".new_list").innerHTML+=`
|
|
<li>
|
|
<a href="./modelList.html?id=${v.id}&t=${v.title}">
|
|
<div class="new_list_top">
|
|
<img src="${v.preview}" alt="">
|
|
</div>
|
|
<p class="new_list_botton">${v.title}</p>
|
|
</a>
|
|
</li>
|
|
`
|
|
});
|
|
|
|
}
|
|
|
|
}
|
|
|
|
new Model() |