Commit d8d05a26 by 刘海龙

111

parent d7997742
...@@ -418,31 +418,35 @@ ...@@ -418,31 +418,35 @@
url: "{:U('exams/Index/paper')}" + "&api=1&c=" + that.conditionId +"&p=" + 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.data.totalPages>=res.data.nowPage){
let array = res.data.data.length > 0 ? res.data.data : [] if(res.status == 1) {
let zhenti = [].concat(array.map( r => { let array = res.data.data.length > 0 ? res.data.data : []
return { let zhenti = [].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 + "已做",
} is_buy: r.is_buy
})) }
that.zhenti = that.zhenti.concat(zhenti) }))
that.page ++ that.zhenti = that.zhenti.concat(zhenti)
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(数据已加载完)
}
} }
}) })
}, },
......
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