From 6083578f9370bc922a0cbe76131cae1a194dab8b Mon Sep 17 00:00:00 2001 From: guozhigq Date: Fri, 25 Aug 2023 21:16:16 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E8=AF=84=E8=AE=BA=E6=B8=B2=E6=9F=93?= =?UTF-8?q?=E5=BC=82=E5=B8=B8=E3=80=81=E8=AF=84=E8=AE=BA=E6=80=BB=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/pages/video/detail/reply/controller.dart | 2 ++ lib/pages/video/detail/reply/view.dart | 6 +++--- lib/pages/video/detail/reply/widgets/reply_item.dart | 3 ++- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/lib/pages/video/detail/reply/controller.dart b/lib/pages/video/detail/reply/controller.dart index 07c8d526..16c7838f 100644 --- a/lib/pages/video/detail/reply/controller.dart +++ b/lib/pages/video/detail/reply/controller.dart @@ -28,6 +28,7 @@ class VideoReplyController extends GetxController { bool isLoadingMore = false; RxString noMore = ''.obs; int ps = 20; + RxInt count = 0.obs; // 当前回复的回复 ReplyItemModel? currentReplyItem; @@ -96,6 +97,7 @@ class VideoReplyController extends GetxController { replyList.addAll(replies); } } + count.value = res['data'].page.count; isLoadingMore = false; return res; } diff --git a/lib/pages/video/detail/reply/view.dart b/lib/pages/video/detail/reply/view.dart index 149a2f30..7b960014 100644 --- a/lib/pages/video/detail/reply/view.dart +++ b/lib/pages/video/detail/reply/view.dart @@ -160,9 +160,9 @@ class _VideoReplyPanelState extends State scale: animation, child: child); }, child: Text( - _videoReplyController.sortTypeTitle.value, - key: ValueKey( - _videoReplyController.sortTypeTitle.value), + '共${_videoReplyController.count.value}条回复', + key: ValueKey( + _videoReplyController.count.value), ), ), ), diff --git a/lib/pages/video/detail/reply/widgets/reply_item.dart b/lib/pages/video/detail/reply/widgets/reply_item.dart index abebf5cb..c45d56dd 100644 --- a/lib/pages/video/detail/reply/widgets/reply_item.dart +++ b/lib/pages/video/detail/reply/widgets/reply_item.dart @@ -591,7 +591,8 @@ InlineSpan buildContent( if (content.jumpUrl.isNotEmpty && hasMatchMember) { List urlKeys = content.jumpUrl.keys.toList(); matchUrl = matchMember.splitMapJoin( - RegExp("(?:${urlKeys.join("|")})"), + /// RegExp.escape() 转义特殊字符 + RegExp(RegExp.escape(urlKeys.join("|"))), onMatch: (Match match) { String matchStr = match[0]!; spanChilds.add(