Browse Source

文章\活动评论回复删除异常bug处理;

dart3
wurong 5 months ago
parent
commit
c91751baa8
  1. 9
      lib/web/web_page.dart
  2. 7
      lib/web/web_view/comment_list.dart

9
lib/web/web_page.dart

@ -363,16 +363,15 @@ class _WebPage extends State<WebPage> 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;

7
lib/web/web_view/comment_list.dart

@ -130,7 +130,7 @@ class CommentListState extends State<CommentList> {
// showPressMenu(memberList[position].createUser,
// memberList[position]);
},
child: commentItem(memberList[position]),
child: commentItem(memberList[position],position),
),
);
},
@ -240,7 +240,7 @@ class CommentListState extends State<CommentList> {
});
}
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<CommentList> {
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<CommentList> {
SizedBox(
height: 12.h,
),
if(member.parentUserName != "" || member.parentContent != "")
Container(
margin: EdgeInsets.only(left: 68.w, right: 16.w),
decoration: BoxDecoration(

Loading…
Cancel
Save