xugenyuan

ref |> 解决评论列表翻页新问题

... ... @@ -260,7 +260,6 @@ export struct CommentComponent {
this.publishCommentModel.targetType)
.then(commentListModel => {
console.log('评论:', JSON.stringify(commentListModel.list))
this.currentPage++
if (Number.parseInt(commentListModel.totalCommentNum) >
Number.parseInt(this.publishCommentModel.totalCommentNumer)) {
... ... @@ -279,7 +278,9 @@ export struct CommentComponent {
if (commentListModel && commentListModel.list && commentListModel.list.length > 0) {
this.allDatas.clearAllData() // 防止数据重复问题
if (this.currentPage == 1) {
this.allDatas.clearAllData() // 防止数据重复问题
}
commentListModel.list.forEach(element => {
element.hasMore = Number.parseInt(element.childCommentNum) ? true : false
let newModel = commentViewModel.deepCopyCommentItemModel(element)
... ... @@ -293,6 +294,8 @@ export struct CommentComponent {
} else {
this.hasMore = false
}
this.currentPage++
if (!this.fixedHeightMode && this.reachEndLoadMoreFinish) {
this.reachEndLoadMoreFinish()
}
... ...