fix: 评论渲染异常、评论总数

This commit is contained in:
guozhigq
2023-08-25 21:16:16 +08:00
parent aa7419f352
commit 6083578f93
3 changed files with 7 additions and 4 deletions

View File

@ -28,6 +28,7 @@ class VideoReplyController extends GetxController {
bool isLoadingMore = false; bool isLoadingMore = false;
RxString noMore = ''.obs; RxString noMore = ''.obs;
int ps = 20; int ps = 20;
RxInt count = 0.obs;
// 当前回复的回复 // 当前回复的回复
ReplyItemModel? currentReplyItem; ReplyItemModel? currentReplyItem;
@ -96,6 +97,7 @@ class VideoReplyController extends GetxController {
replyList.addAll(replies); replyList.addAll(replies);
} }
} }
count.value = res['data'].page.count;
isLoadingMore = false; isLoadingMore = false;
return res; return res;
} }

View File

@ -160,9 +160,9 @@ class _VideoReplyPanelState extends State<VideoReplyPanel>
scale: animation, child: child); scale: animation, child: child);
}, },
child: Text( child: Text(
_videoReplyController.sortTypeTitle.value, '${_videoReplyController.count.value}条回复',
key: ValueKey<String>( key: ValueKey<int>(
_videoReplyController.sortTypeTitle.value), _videoReplyController.count.value),
), ),
), ),
), ),

View File

@ -591,7 +591,8 @@ InlineSpan buildContent(
if (content.jumpUrl.isNotEmpty && hasMatchMember) { if (content.jumpUrl.isNotEmpty && hasMatchMember) {
List urlKeys = content.jumpUrl.keys.toList(); List urlKeys = content.jumpUrl.keys.toList();
matchUrl = matchMember.splitMapJoin( matchUrl = matchMember.splitMapJoin(
RegExp("(?:${urlKeys.join("|")})"), /// RegExp.escape() 转义特殊字符
RegExp(RegExp.escape(urlKeys.join("|"))),
onMatch: (Match match) { onMatch: (Match match) {
String matchStr = match[0]!; String matchStr = match[0]!;
spanChilds.add( spanChilds.add(