Commit d8d05a26 by 刘海龙

111

parent d7997742
......@@ -418,31 +418,35 @@
url: "{:U('exams/Index/paper')}" + "&api=1&c=" + that.conditionId +"&p=" + this.page,
dataType: "json",
success: function(res) {
if(res.status == 1) {
let array = res.data.data.length > 0 ? res.data.data : []
let zhenti = [].concat(array.map( r => {
return {
id: r.exams_paper_id,
title: r.exams_paper_title,
price: r.price,
count: r.questions_count,
time: r.reply_time,
person: r.exams_user + "已做",
is_buy: r.is_buy
}
}))
that.zhenti = that.zhenti.concat(zhenti)
that.page ++
if(that.condition.length == 0) {
that.condition = [{ id: '', title: '全部', select: true }].concat(res.cate.map( r => {
return {
id: r.id,
title: r.title,
select: false
}
}))
}
}
if(res.data.totalPages>=res.data.nowPage){
if(res.status == 1) {
let array = res.data.data.length > 0 ? res.data.data : []
let zhenti = [].concat(array.map( r => {
return {
id: r.exams_paper_id,
title: r.exams_paper_title,
price: r.price,
count: r.questions_count,
time: r.reply_time,
person: r.exams_user + "已做",
is_buy: r.is_buy
}
}))
that.zhenti = that.zhenti.concat(zhenti)
that.page ++
if(that.condition.length == 0) {
that.condition = [{ id: '', title: '全部', select: true }].concat(res.cate.map( r => {
return {
id: r.id,
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