|
|
|
@ -78,9 +78,9 @@ |
|
|
|
} |
|
|
|
return { |
|
|
|
tab_list: [ |
|
|
|
{name: '最新',type: 'created_at',list:[]}, |
|
|
|
{name: '最热',type: 'view_count',list:[]}, |
|
|
|
{name: '已关注',type: 'view_count',list:[]} |
|
|
|
{name: '最新',type: 'created_at',list:[],..._public}, |
|
|
|
{name: '最热',type: 'view_count',list:[],..._public}, |
|
|
|
{name: '已关注',type: 'view_count',list:[],..._public} |
|
|
|
], |
|
|
|
tab_current: 0, |
|
|
|
scrollH: 0, |
|
|
|
@ -140,7 +140,7 @@ |
|
|
|
}); |
|
|
|
}); |
|
|
|
}, |
|
|
|
getMyAttention() { |
|
|
|
getMyAttention(options = {}) { |
|
|
|
let tab_item = this.tab_list[this.tab_current]; |
|
|
|
this.$http |
|
|
|
.get({ |
|
|
|
@ -150,31 +150,22 @@ |
|
|
|
}, |
|
|
|
}) |
|
|
|
.then(res => { |
|
|
|
console.log(res) |
|
|
|
if (res.data.code == 200) { |
|
|
|
if (res.data.status) { |
|
|
|
let isPage = res.data.next_page_url == null?false:true; |
|
|
|
tab_item.isPage = isPage; |
|
|
|
if(!isPage) { |
|
|
|
tab_item.loadingClass = false; |
|
|
|
tab_item.loadingText = '没有更多数据啦~'; |
|
|
|
} |
|
|
|
if(options.type == 'pageRefresh') { |
|
|
|
uni.stopPullDownRefresh(); |
|
|
|
}else if(options.type == 'scrollRefresh') { |
|
|
|
this.isRefresher = false; |
|
|
|
} |
|
|
|
if(tab_item.page == 1) { |
|
|
|
tab_item.list = res.data.data.data; |
|
|
|
}else { |
|
|
|
tab_item.list.push(...res.data.data.data); |
|
|
|
} |
|
|
|
console.log('发现列表',tab_item.list) |
|
|
|
} else { |
|
|
|
wx.showModal({ |
|
|
|
content: res.data.message || '请下拉页面刷新重试', |
|
|
|
showCancel: false |
|
|
|
}); |
|
|
|
let isPage = res.data.data.next_page_url == null?false:true; |
|
|
|
tab_item.isPage = isPage; |
|
|
|
if(!isPage) { |
|
|
|
tab_item.loadingClass = false; |
|
|
|
tab_item.loadingText = '没有更多数据啦~'; |
|
|
|
} |
|
|
|
if(options.type == 'pageRefresh') { |
|
|
|
uni.stopPullDownRefresh(); |
|
|
|
}else if(options.type == 'scrollRefresh') { |
|
|
|
this.isRefresher = false; |
|
|
|
} |
|
|
|
if(tab_item.page == 1) { |
|
|
|
tab_item.list = res.data.data.data; |
|
|
|
}else { |
|
|
|
tab_item.list.push(...res.data.data.data); |
|
|
|
} |
|
|
|
} else { |
|
|
|
wx.showModal({ |
|
|
|
@ -186,10 +177,7 @@ |
|
|
|
}) |
|
|
|
.catch(() => { |
|
|
|
wx.hideLoading(); |
|
|
|
wx.showModal({ |
|
|
|
content: '请求失败', |
|
|
|
showCancel: false |
|
|
|
}); |
|
|
|
|
|
|
|
}); |
|
|
|
}, |
|
|
|
// 页面触底,加载下一页 |
|
|
|
@ -256,7 +244,7 @@ |
|
|
|
page_size: this.pageSize, |
|
|
|
data:{ |
|
|
|
order: discover_type, |
|
|
|
user_id: 1 |
|
|
|
user_id: this.$cookieStorage.get('user_info').id |
|
|
|
} |
|
|
|
}) |
|
|
|
.then(res => { |
|
|
|
|