提交 517aaa24 编写于 作者: chendeli's avatar chendeli

add

上级 8d47241c
...@@ -47,7 +47,7 @@ export default { ...@@ -47,7 +47,7 @@ export default {
data () { data () {
return { return {
list:[], list:[],
pageNo:1, pageNo:2,
isDisabled:false, isDisabled:false,
pageSize:10, pageSize:10,
title:'为您推荐', title:'为您推荐',
...@@ -62,6 +62,7 @@ export default { ...@@ -62,6 +62,7 @@ export default {
ptop:20, ptop:20,
popHeight:0, popHeight:0,
menuptop:0, menuptop:0,
isReauestBack:true,
} }
}, },
props:{ props:{
...@@ -89,7 +90,7 @@ export default { ...@@ -89,7 +90,7 @@ export default {
mounted(){ mounted(){
this.list = this.parmData; this.list = this.parmData;
this.pageNo = this.adjustPageNo; //this.pageNo = this.adjustPageNo;
// if(window.__isAndroid){ // if(window.__isAndroid){
// this.popHeight = this.statusBarHeight/2 // this.popHeight = this.statusBarHeight/2
...@@ -180,13 +181,14 @@ export default { ...@@ -180,13 +181,14 @@ export default {
//滑动加载更多 //滑动加载更多
loadMore(){ loadMore(){
let _this = this; let _this = this;
// alert(_this.pageNo);
if(!_this.noMore){
_this.pageNo += 1; if(_this.isReauestBack){
_this.isLoading = true; _this.isLoading = true;
_this.loading = true;
//埋点 //埋点
this.pageBurialPoin({ this.pageBurialPoin({
menuLevel:1, menuLevel:1,
...@@ -256,37 +258,26 @@ export default { ...@@ -256,37 +258,26 @@ export default {
token:_this.userToken, token:_this.userToken,
setEntry: 'headers' setEntry: 'headers'
} }
_this.GET('contents/courses/recommendCourseList',parm).then(function(res){ _this.GET('contents/courses/recommendCourseList',parm).then(function(res){
if(res.code === '000000'){ if(res.code === '000000'){
if(res.data == null || !res.data){ if(res.data == null || res.data.length == 0){
res.data = []; res.data = [];
_this.isLoading = false; _this.isLoading = false;
_this.noMore = true; _this.noMore = true;
_this.loading = true; _this.loading = true;
_this.isReauestBack = false;
}else{ }else{
_this.isReauestBack = true;
_this.list = [..._this.list ,...res.data]; _this.list = [..._this.list ,...res.data];
_this.isLoading = true; _this.isLoading = true;
_this.noMore = false; _this.noMore = false;
_this.loading = false; _this.loading = false;
_this.pageNo += 1;
} }
// if(type == 'loadMore'){
// _this.list = [..._this.list ,...res.data];
// }
// else{
// _this.list = res.data || [];
// }
} }
///_this.clientHeight = 'auto'
},function(){
_this.isLoading = false;
_this.noMore = false;
_this.loading = false;
}) })
} }
} }
......
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
</p> </p>
<div class="course-opt"> <div class="course-opt">
<span class="opt-info">{{!item.showTime ? '' : item.showTime + ' |'}} {{item.joinNum}}人已学</span> <span class="opt-info">{{!item.showTime ? '' : item.showTime + ' |'}} {{item.joinNum}}人已学</span>
<span :class="item.whetherFavors==2?'opt collect':'opt collected'"@click="collectFun(item.whetherFavors,item.id)"> <span :class="item.whetherFavors==2?'opt collect':'opt collected'"@click="collectFun(item.whetherFavors,item.id,item.name)">
{{item.whetherFavors==2?'收藏':'已收藏'}} {{item.whetherFavors==2?'收藏':'已收藏'}}
</span> </span>
...@@ -100,7 +100,7 @@ export default { ...@@ -100,7 +100,7 @@ export default {
}, },
//收藏 取消收藏 //收藏 取消收藏
collectFun(status,id){ collectFun(status,id,name){
// alert(this.userToken) // alert(this.userToken)
status = status == 1 ? 2 : 1; status = status == 1 ? 2 : 1;
this.pageBurialPoin({ this.pageBurialPoin({
...@@ -109,7 +109,7 @@ export default { ...@@ -109,7 +109,7 @@ export default {
functionCode:'f_new_course', functionCode:'f_new_course',
actionCode:'c_collect', actionCode:'c_collect',
labelId:id, labelId:id,
/// labelValue :item.name, labelValue :name,
}) })
let _this = this, let _this = this,
parm = { parm = {
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册