Commit 3c6fd159 by 刘海龙

111

parent 1a8bfce5
...@@ -217,15 +217,15 @@ ...@@ -217,15 +217,15 @@
// console.log("top:"+scrollTop+",doc:"+scrollHeight+",client:"+clientHeight); // console.log("top:"+scrollTop+",doc:"+scrollHeight+",client:"+clientHeight);
if(scrollTop + clientHeight >= scrollHeight){ //距离顶部+当前高度 >=文档总高度 即代表滑动到底部 if(scrollTop + clientHeight >= scrollHeight){ //距离顶部+当前高度 >=文档总高度 即代表滑动到底部
//滚动条到达底部 //滚动条到达底部
console.log("tab:" + that.tab) // console.log("tab:" + that.tab)
console.log("page:" + that.page) // console.log("page:" + that.page)
if(that.tab==0){ // if(that.tab==0){
that.loadZhenti() // that.loadZhenti()
}else if(that.tab == 1) { // }else if(that.tab == 1) {
that.loadDownload() // that.loadDownload()
} else { // } else {
that.onMyTab(that.myTab) // that.onMyTab(that.myTab)
} // }
}else if(scrollTop<=0){ }else if(scrollTop<=0){
//滚动条到达顶部 //滚动条到达顶部
// alert(4) // alert(4)
...@@ -361,10 +361,12 @@ ...@@ -361,10 +361,12 @@
let that = this let that = this
$.ajax({ $.ajax({
type: "GET", type: "GET",
url: "{:U('exams/Index/paper')}" + "&api=1&c=" + that.conditionId +"&page=" + this.page, url: "{:U('exams/Index/paper')}" + "&api=1&c=" + that.conditionId +"&p=" + this.page,
dataType: "json", dataType: "json",
success: function(res) { success: function(res) {
if(res.status == 1) { if(res.status == 1) {
console.log(res)
console.log(that.zhenti )
let array = res.data.data.length > 0 ? res.data.data : [] let array = res.data.data.length > 0 ? res.data.data : []
that.zhenti = [].concat(array.map( r => { that.zhenti = [].concat(array.map( r => {
return { return {
...@@ -396,12 +398,12 @@ ...@@ -396,12 +398,12 @@
let that = this let that = this
$.ajax({ $.ajax({
type: "GET", type: "GET",
url: "{:U('exams/Index/paper')}" + "&api=2&c=" + that.conditionId +"&page=" + this.page, url: "{:U('exams/Index/paper')}" + "&api=2&c=" + that.conditionId +"&p=" + this.page,
dataType: "json", dataType: "json",
success: function(res) { success: function(res) {
if(res.status == 1) { if(res.status == 1) {
let array = res.data.data.length > 0 ? res.data.data : [] let array = res.data.data.length > 0 ? res.data.data : []
that.download = [].concat(array.map( r => { that.download = array.concat(array.map( r => {
return { return {
id: r.exams_paper_id, id: r.exams_paper_id,
title: r.exams_paper_title, title: r.exams_paper_title,
...@@ -413,7 +415,7 @@ ...@@ -413,7 +415,7 @@
attach: r.attach attach: r.attach
} }
})) }))
that.page ++ // that.page ++
if(that.condition.length == 0) { if(that.condition.length == 0) {
that.condition = [{ id: '', title: '全部', select: true }].concat(res.cate.map( r => { that.condition = [{ id: '', title: '全部', select: true }].concat(res.cate.map( r => {
return { return {
...@@ -446,7 +448,7 @@ ...@@ -446,7 +448,7 @@
score: r.score score: r.score
} }
})) }))
that.page ++ // that.page ++
} }
} }
}) })
...@@ -472,7 +474,7 @@ ...@@ -472,7 +474,7 @@
time: new Date(r.ctime * 1000).format('yyyy-mm-dd HH:MM:ss'), time: new Date(r.ctime * 1000).format('yyyy-mm-dd HH:MM:ss'),
} }
})) }))
that.page ++ // that.page ++
} }
} }
}) })
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment