Commit 2b7b08d0 by 刘海龙

no message

parent 4313a9de
......@@ -459,32 +459,36 @@
url: "{:U('exams/Index/paper')}" + "&api=2&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 download = [].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,
attach: r.attach
}
}))
that.download = that.download.concat(download)
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(that.page<res.data.totalPages*1||that.page==res.data.totalPages*1){
if(res.status == 1) {
let array = res.data.data.length > 0 ? res.data.data : []
let download = [].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,
attach: r.attach
}
}))
that.download = that.download.concat(download)
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("数据已加载完")
}
}
})
},
......@@ -496,20 +500,24 @@
url: "{:U('home/Home/exams')}" + "?api=1" +"&p=" + this.page,
dataType: "json",
success: function(res) {
if(res.status == 1) {
let array = res.data.data.length > 0 ? res.data.data : []
let myYiZuo = [].concat(array.map( r => {
return {
id: r.exams_paper_id,
title: r.paper_info.exams_paper_title,
price: r.paper_info.price,
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 ++
}
if(that.page<res.data.totalPages*1||that.page==res.data.totalPages*1){
if(res.status == 1) {
let array = res.data.data.length > 0 ? res.data.data : []
let myYiZuo = [].concat(array.map( r => {
return {
id: r.exams_paper_id,
title: r.paper_info.exams_paper_title,
price: r.paper_info.price,
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 ++
}
}else{
console.log("数据已加载完")
}
}
})
},
......@@ -525,18 +533,22 @@
url: "{:U('home/Home/exams')}" + "?api=1&tab=4&p=" + this.page,
dataType: "json",
success: function(res) {
if(res.status == 1) {
let array = res.data.data.length > 0 ? res.data.data : []
let myCollect = [].concat(array.map( r => {
return {
id: r.question_info.exams_question_id,
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 ++
}
if(that.page<res.data.totalPages*1||that.page==res.data.totalPages*1){
if(res.status == 1) {
let array = res.data.data.length > 0 ? res.data.data : []
let myCollect = [].concat(array.map( r => {
return {
id: r.question_info.exams_question_id,
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 ++
}
}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