diff --git a/lib/pages/video/detail/reply_reply/controller.dart b/lib/pages/video/detail/reply_reply/controller.dart index 6daa0b8ae..e94aaea5e 100644 --- a/lib/pages/video/detail/reply_reply/controller.dart +++ b/lib/pages/video/detail/reply_reply/controller.dart @@ -30,6 +30,9 @@ class VideoReplyReplyController extends GetxController { if (type == 'init') { currentPage = 0; } + if (isLoadingMore) { + return; + } isLoadingMore = true; final res = await ReplyHttp.replyReplyList( oid: aid!, @@ -41,7 +44,7 @@ class VideoReplyReplyController extends GetxController { final List replies = res['data'].replies; if (replies.isNotEmpty) { noMore.value = '加载中...'; - if (replyList.length == res['data'].page.count) { + if (replies.length == res['data'].page.count) { noMore.value = '没有更多了'; } currentPage++; @@ -50,21 +53,6 @@ class VideoReplyReplyController extends GetxController { noMore.value = currentPage == 0 ? '还没有评论' : '没有更多了'; } if (type == 'init') { - // List replies = res['data'].replies; - // 添加置顶回复 - // if (res['data'].upper.top != null) { - // bool flag = false; - // for (var i = 0; i < res['data'].topReplies.length; i++) { - // if (res['data'].topReplies[i].rpid == res['data'].upper.top.rpid) { - // flag = true; - // } - // } - // if (!flag) { - // replies.insert(0, res['data'].upper.top); - // } - // } - // replies.insertAll(0, res['data'].topReplies); - // res['data'].replies = replies; replyList.value = replies; } else { // 每次回复之后,翻页请求有且只有相同的一条回复数据 diff --git a/lib/pages/video/detail/reply_reply/view.dart b/lib/pages/video/detail/reply_reply/view.dart index 820a69ecb..e8754a311 100644 --- a/lib/pages/video/detail/reply_reply/view.dart +++ b/lib/pages/video/detail/reply_reply/view.dart @@ -54,7 +54,8 @@ class _VideoReplyReplyPanelState extends State { () { if (scrollController.position.pixels >= scrollController.position.maxScrollExtent - 300) { - EasyThrottle.throttle('replylist', const Duration(seconds: 2), () { + EasyThrottle.throttle('replylist', const Duration(milliseconds: 200), + () { _videoReplyReplyController.queryReplyList(type: 'onLoad'); }); }