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(