Commit 2b7b08d0 by 刘海龙

no message

parent 4313a9de
...@@ -459,32 +459,36 @@ ...@@ -459,32 +459,36 @@
url: "{:U('exams/Index/paper')}" + "&api=2&c=" + that.conditionId +"&p=" + 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(that.page<res.data.totalPages*1||that.page==res.data.totalPages*1){
let array = res.data.data.length > 0 ? res.data.data : [] if(res.status == 1) {
let download = [].concat(array.map( r => { let array = res.data.data.length > 0 ? res.data.data : []
return { let download = [].concat(array.map( r => {
id: r.exams_paper_id, return {
title: r.exams_paper_title, id: r.exams_paper_id,
price: r.price, title: r.exams_paper_title,
count: r.questions_count, price: r.price,
time: r.reply_time, count: r.questions_count,
person: r.exams_user + "已做", time: r.reply_time,
is_buy: r.is_buy, person: r.exams_user + "已做",
attach: r.attach is_buy: r.is_buy,
} attach: r.attach
})) }
that.download = that.download.concat(download) }))
that.page ++ that.download = that.download.concat(download)
if(that.condition.length == 0) { that.page ++
that.condition = [{ id: '', title: '全部', select: true }].concat(res.cate.map( r => { if(that.condition.length == 0) {
return { that.condition = [{ id: '', title: '全部', select: true }].concat(res.cate.map( r => {
id: r.id, return {
title: r.title, id: r.id,
select: false title: r.title,
} select: false
})) }
} }))
} }
}
}else{
console.log("数据已加载完")
}
} }
}) })
}, },
...@@ -496,20 +500,24 @@ ...@@ -496,20 +500,24 @@
url: "{:U('home/Home/exams')}" + "?api=1" +"&p=" + this.page, url: "{:U('home/Home/exams')}" + "?api=1" +"&p=" + this.page,
dataType: "json", dataType: "json",
success: function(res) { success: function(res) {
if(res.status == 1) { if(that.page<res.data.totalPages*1||that.page==res.data.totalPages*1){
let array = res.data.data.length > 0 ? res.data.data : [] if(res.status == 1) {
let myYiZuo = [].concat(array.map( r => { let array = res.data.data.length > 0 ? res.data.data : []
return { let myYiZuo = [].concat(array.map( r => {
id: r.exams_paper_id, return {
title: r.paper_info.exams_paper_title, id: r.exams_paper_id,
price: r.paper_info.price, title: r.paper_info.exams_paper_title,
time: new Date(r.update_time * 1000).format('yyyy-MM-dd HH:mm:ss'), price: r.paper_info.price,
score: r.score time: new Date(r.update_time * 1000).format('yyyy-MM-dd HH:mm:ss'),
} score: r.score
})) }
that.myYiZuo = that.myYiZuo.concat(myYiZuo) }))
that.page ++ that.myYiZuo = that.myYiZuo.concat(myYiZuo)
} that.page ++
}
}else{
console.log("数据已加载完")
}
} }
}) })
}, },
...@@ -525,18 +533,22 @@ ...@@ -525,18 +533,22 @@
url: "{:U('home/Home/exams')}" + "?api=1&tab=4&p=" + this.page, url: "{:U('home/Home/exams')}" + "?api=1&tab=4&p=" + this.page,
dataType: "json", dataType: "json",
success: function(res) { success: function(res) {
if(res.status == 1) { if(that.page<res.data.totalPages*1||that.page==res.data.totalPages*1){
let array = res.data.data.length > 0 ? res.data.data : [] if(res.status == 1) {
let myCollect = [].concat(array.map( r => { let array = res.data.data.length > 0 ? res.data.data : []
return { let myCollect = [].concat(array.map( r => {
id: r.question_info.exams_question_id, return {
content: r.question_info.content, id: r.question_info.exams_question_id,
time: new Date(r.ctime * 1000).format('yyyy-mm-dd HH:MM:ss'), content: r.question_info.content,
} time: new Date(r.ctime * 1000).format('yyyy-mm-dd HH:MM:ss'),
})) }
that.myCollect = that.myCollect.concat(myCollect) }))
that.page ++ that.myCollect = that.myCollect.concat(myCollect)
} that.page ++
}
}else{
console.log("数据已加载完")
}
} }
}) })
}, },
......
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