|
|
@ -301,24 +301,30 @@ $(function(){ |
|
|
|
url: 'https://suzhou.njrenzhou.cn/api.php/busmap/starProject', |
|
|
|
url: 'https://suzhou.njrenzhou.cn/api.php/busmap/starProject', |
|
|
|
dataType: 'json', |
|
|
|
dataType: 'json', |
|
|
|
data:{ |
|
|
|
data:{ |
|
|
|
limit:30 |
|
|
|
limit:100000 |
|
|
|
}, |
|
|
|
}, |
|
|
|
success: function (res) { |
|
|
|
success: function (res) { |
|
|
|
|
|
|
|
console.log(Math.floor(res.data.total/3)) |
|
|
|
|
|
|
|
let num = Math.floor(res.data.total/3) |
|
|
|
let data = res.data.data |
|
|
|
let data = res.data.data |
|
|
|
let firstList = data.slice(0,30); |
|
|
|
let firstList = data.slice(0,num); |
|
|
|
let secondList = data.slice(30,30); |
|
|
|
let secondList = data.slice(num,num*2); |
|
|
|
let thirdList = data.slice(31,30) |
|
|
|
let thirdList = data.slice(num*2,num*3) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
let html='' |
|
|
|
let html='' |
|
|
|
res.data.data.forEach((item,index)=>{ |
|
|
|
let html1='' |
|
|
|
|
|
|
|
let html2='' |
|
|
|
|
|
|
|
firstList.forEach((item,index)=>{ |
|
|
|
html+=`<li><img src="https://suzhou.njrenzhou.cn${item.thumb}"></li>` |
|
|
|
html+=`<li><img src="https://suzhou.njrenzhou.cn${item.thumb}"></li>` |
|
|
|
}) |
|
|
|
}) |
|
|
|
|
|
|
|
secondList.forEach((item,index)=>{ |
|
|
|
|
|
|
|
html1+=`<li><img src="https://suzhou.njrenzhou.cn${item.thumb}"></li>` |
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
thirdList.forEach((item,index)=>{ |
|
|
|
|
|
|
|
html2+=`<li><img src="https://suzhou.njrenzhou.cn${item.thumb}"></li>` |
|
|
|
|
|
|
|
}) |
|
|
|
$('.g1 ul').append(html) |
|
|
|
$('.g1 ul').append(html) |
|
|
|
$('.g2 ul').append(html) |
|
|
|
$('.g2 ul').append(html1) |
|
|
|
$('.g3 ul').append(html) |
|
|
|
$('.g3 ul').append(html2) |
|
|
|
groupSlide() |
|
|
|
groupSlide() |
|
|
|
// console.log(firstList,secondList,thirdList)
|
|
|
|
// console.log(firstList,secondList,thirdList)
|
|
|
|
} |
|
|
|
} |
|
|
|