diff --git a/pagesA/articles/articles.vue b/pagesA/articles/articles.vue index e88b246..0c4af72 100644 --- a/pagesA/articles/articles.vue +++ b/pagesA/articles/articles.vue @@ -26,7 +26,7 @@ - - {{ loadMoreText }} + @@ -81,9 +81,6 @@ export default { dataList: [], total: 0 }, - hasNext: false, - isLoadMore: false, - loadMoreText: '加载中...', dataList: [] }; }, @@ -99,7 +96,6 @@ export default { }, onPullDownRefresh() { this.fnResetSetAniWaitIndex(); - this.isLoadMore = false; this.fnGetData(); }, @@ -121,7 +117,7 @@ export default { }, fnOnSearch() { this.fnResetSetAniWaitIndex(); - this.isLoadMore = false; + if (!this.queryParams.keyword) { this.dataList = [] } else { @@ -129,34 +125,17 @@ export default { } }, fnGetData() { - // uni.showLoading({ - // mask: true, - // title: '加载中...' - // }); // 设置状态为加载中 - if (!this.isLoadMore) { - this.loading = 'loading'; - } - this.loadMoreText = '加载中...'; + this.loading = 'loading'; this.$httpApi.v2 .getPostListByKeyword(this.queryParams) .then(res => { - console.log('请求结果:'); - console.log(res); - this.loading = 'success'; - this.loadMoreText = res.hasNext ? '上拉加载更多' : '呜呜,没有更多数据啦~'; - this.hasNext = res.hasNext; - if (this.isLoadMore) { - this.dataList = this.dataList.concat(res.hits); - } else { - this.dataList = res.hits; - } + this.dataList = res.hits; }) .catch(err => { console.error(err); this.loading = 'error'; - this.loadMoreText = '加载失败,请下拉刷新!'; }) .finally(() => { setTimeout(() => { @@ -169,7 +148,7 @@ export default { //跳转文章详情 fnToArticleDetail(article) { uni.navigateTo({ - url: '/pagesA/article-detail/article-detail?name=' + article.name, + url: '/pagesA/article-detail/article-detail?name=' + article.metadataName, animationType: 'slide-in-right' }); }