main
liudan 2 years ago
parent ade46ace56
commit 5528d168f3
  1. 3
      css/index.css
  2. 30
      js/index.js

@ -721,8 +721,7 @@ a:active{
margin-top:30px; margin-top:30px;
} }
.selectContainer{ .selectContainer{
text-align: left; text-align: right;
} }
.selectContainer>.select{ .selectContainer>.select{
height: 49px; height: 49px;

@ -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 data = res.data.data let num = Math.floor(res.data.total/3)
let firstList = data.slice(0,30); let data = res.data.data
let secondList = data.slice(30,30); let firstList = data.slice(0,num);
let thirdList = data.slice(31,30) let secondList = data.slice(num,num*2);
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)
} }

Loading…
Cancel
Save