From c91751baa85e3233f93efc25b60cc0cc467ee38e Mon Sep 17 00:00:00 2001 From: wurong <953969641@qq.com> Date: Wed, 14 Aug 2024 16:55:05 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=87=E7=AB=A0\=E6=B4=BB=E5=8A=A8=E8=AF=84?= =?UTF-8?q?=E8=AE=BA=E5=9B=9E=E5=A4=8D=E5=88=A0=E9=99=A4=E5=BC=82=E5=B8=B8?= =?UTF-8?q?bug=E5=A4=84=E7=90=86=EF=BC=9B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/web/web_page.dart | 9 ++++----- lib/web/web_view/comment_list.dart | 7 ++++--- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/lib/web/web_page.dart b/lib/web/web_page.dart index 718ff1d3..9040e6a7 100644 --- a/lib/web/web_page.dart +++ b/lib/web/web_page.dart @@ -363,16 +363,15 @@ class _WebPage extends State with WidgetsBindingObserver { } ///删除评论的提示 - _delCommentTips() { + _delCommentTips(memberComment) { SmartDialog.show(widget: Tips(() { - delComment(); + delComment(memberComment); })); } ///删除评论 - delComment() async { - BaseData? baseData = await apiService?.delComment( - widget.arguments?["activityId"] ?? widget.arguments?["articleId"]) + delComment(memberComment) async { + BaseData? baseData = await apiService?.delComment(memberComment.id) .catchError((onError) {}); if (baseData?.isSuccess ?? false) { CommentListState _commentList = commentKey.currentState as CommentListState; diff --git a/lib/web/web_view/comment_list.dart b/lib/web/web_view/comment_list.dart index e288952d..961a573e 100644 --- a/lib/web/web_view/comment_list.dart +++ b/lib/web/web_view/comment_list.dart @@ -130,7 +130,7 @@ class CommentListState extends State { // showPressMenu(memberList[position].createUser, // memberList[position]); }, - child: commentItem(memberList[position]), + child: commentItem(memberList[position],position), ), ); }, @@ -240,7 +240,7 @@ class CommentListState extends State { }); } - Widget commentItem(MemberComment member) { + Widget commentItem(MemberComment member,int index) { return Container( padding: EdgeInsets.symmetric(vertical: 8.w), child: Column( @@ -372,7 +372,7 @@ class CommentListState extends State { behavior: HitTestBehavior.opaque, onTap: () { if (member.createUser?.isNotEmpty ?? false) { - showPressMenu(member.createUser!, memberList); + showPressMenu(member.createUser!, memberList[index]); } setState(() {}); }, @@ -398,6 +398,7 @@ class CommentListState extends State { SizedBox( height: 12.h, ), + if(member.parentUserName != "" || member.parentContent != "") Container( margin: EdgeInsets.only(left: 68.w, right: 16.w), decoration: BoxDecoration(