Commit eb7daa3a by 刘海龙

111

parent 61477f34
...@@ -55,7 +55,7 @@ ...@@ -55,7 +55,7 @@
</div> </div>
<div class="layout_v"> <div class="layout_v">
<volist name="bestVideo" id="vo" offset="0" length='4'> <volist name="bestVideo" id="vo" offset="0" length='16'>
<a href="{:U('course/Video/view',array('id'=>$vo['id']))}"> <a href="{:U('course/Video/view',array('id'=>$vo['id']))}">
<div class="home_class_item layout_v"> <div class="home_class_item layout_v">
<div class="layout_h"> <div class="layout_h">
...@@ -174,6 +174,23 @@ ...@@ -174,6 +174,23 @@
active: 0 active: 0
} }
}, },
mounted: function() {
//滚动条到页面底部加载更多案例
$(window).scroll(function(){
var scrollTop = $(this).scrollTop(); //滚动条距离顶部的高度
var scrollHeight = $(document).height(); //当前页面的总高度
var clientHeight = $(this).height(); //当前可视的页面高度
// console.log("top:"+scrollTop+",doc:"+scrollHeight+",client:"+clientHeight);
if(scrollTop + clientHeight >= scrollHeight){ //距离顶部+当前高度 >=文档总高度 即代表滑动到底部
//滚动条到达底部
console.log(11111)
}else if(scrollTop<=0){
//滚动条到达顶部
// alert(4)
//滚动条距离顶部的高度小于等于0 TODO
}
});
}
created: function() { created: function() {
let j = {: json_encode($exams) let j = {: json_encode($exams)
}; };
......
...@@ -241,7 +241,6 @@ ...@@ -241,7 +241,6 @@
var that = this var that = this
//滚动条到页面底部加载更多案例 //滚动条到页面底部加载更多案例
$(window).scroll(function(){ $(window).scroll(function(){
var scrollTop = $(this).scrollTop(); //滚动条距离顶部的高度 var scrollTop = $(this).scrollTop(); //滚动条距离顶部的高度
var scrollHeight = $(document).height(); //当前页面的总高度 var scrollHeight = $(document).height(); //当前页面的总高度
var clientHeight = $(this).height(); //当前可视的页面高度 var clientHeight = $(this).height(); //当前可视的页面高度
...@@ -250,7 +249,6 @@ ...@@ -250,7 +249,6 @@
//滚动条到达底部 //滚动条到达底部
console.log("tab:" + that.tab) console.log("tab:" + that.tab)
console.log("page:" + that.page) console.log("page:" + that.page)
console.log(that.download)
if(that.tab==0){ if(that.tab==0){
that.loadZhenti() that.loadZhenti()
}else if(that.tab == 1) { }else if(that.tab == 1) {
...@@ -262,7 +260,6 @@ ...@@ -262,7 +260,6 @@
//滚动条到达顶部 //滚动条到达顶部
// alert(4) // alert(4)
//滚动条距离顶部的高度小于等于0 TODO //滚动条距离顶部的高度小于等于0 TODO
} }
}); });
...@@ -477,7 +474,7 @@ ...@@ -477,7 +474,7 @@
success: function(res) { success: function(res) {
if(res.status == 1) { if(res.status == 1) {
let array = res.data.data.length > 0 ? res.data.data : [] let array = res.data.data.length > 0 ? res.data.data : []
that.myYiZuo = [].concat(array.map( r => { let myYiZuo = [].concat(array.map( r => {
return { return {
id: r.exams_paper_id, id: r.exams_paper_id,
title: r.paper_info.exams_paper_title, title: r.paper_info.exams_paper_title,
...@@ -486,7 +483,8 @@ ...@@ -486,7 +483,8 @@
score: r.score score: r.score
} }
})) }))
// that.page ++ that.myYiZuo. = that.myYiZuo.concat(myYiZuo)
that.page ++
} }
} }
}) })
...@@ -512,7 +510,8 @@ ...@@ -512,7 +510,8 @@
time: new Date(r.ctime * 1000).format('yyyy-mm-dd HH:MM:ss'), time: new Date(r.ctime * 1000).format('yyyy-mm-dd HH:MM:ss'),
} }
})) }))
// that.page ++ that.myCollect = that.myCollect.concat(myCollect)
that.page ++
} }
} }
}) })
......
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