Commit 3e5abea2 by 陈超

A

parent eb257fc0
...@@ -82,34 +82,18 @@ ...@@ -82,34 +82,18 @@
this.tab = tab this.tab = tab
}, },
onLoad: function() { onLoad: function() {
let that = this
let opt = that.options[that.tab]
$.ajax({ $.ajax({
type: "GET", type: "GET",
url: "{:U('news/Topic/index')}", url: "{:U('news/Topic/getTopicList')}",
data: "?cate=" + (this.tab + 1), data: "?p=" + (opt.page + 1) + "cate=" + (this.tab + 1),
dataType: "json", dataType: "json",
success: function(data) { success: function(data) {
that.loading =false that.loading =false
that.finished = true that.finished = true
console.log(data) console.log(data)
return return
let res = data
let old = []
if(that.page != 0) {
old = that.items
}
let array = res.data.length > 0 ? res.data : []
that.items = old.concat(array.map( r => {
let pi = r.mz_price
return {
id: r.id,
title: r.video_title,
cover: r.image_url,
price: pi.price == 0 ? '免费' : ('¥' + pi.price),
count: on ? r.video_order_count_mark : r.video_order_count
}
}))
that.page = res.nowPage
that.finished = res.nowPage >= res.totalPages
} }
}) })
}, },
......
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