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(() { SmartDialog.show(widget: Tips(() {
delComment(); delComment(memberComment);
})); }));
} }
/// ///
delComment() async { delComment(memberComment) async {
BaseData? baseData = await apiService?.delComment( BaseData? baseData = await apiService?.delComment(memberComment.id)
widget.arguments?["activityId"] ?? widget.arguments?["articleId"])
.catchError((onError) {}); .catchError((onError) {});
if (baseData?.isSuccess ?? false) { if (baseData?.isSuccess ?? false) {
CommentListState _commentList = commentKey.currentState as CommentListState; 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, // showPressMenu(memberList[position].createUser,
// memberList[position]); // 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( return Container(
padding: EdgeInsets.symmetric(vertical: 8.w), padding: EdgeInsets.symmetric(vertical: 8.w),
child: Column( child: Column(
@ -372,7 +372,7 @@ class CommentListState extends State<CommentList> {
behavior: HitTestBehavior.opaque, behavior: HitTestBehavior.opaque,
onTap: () { onTap: () {
if (member.createUser?.isNotEmpty ?? false) { if (member.createUser?.isNotEmpty ?? false) {
showPressMenu(member.createUser!, memberList); showPressMenu(member.createUser!, memberList[index]);
} }
setState(() {}); setState(() {});
}, },
@ -398,6 +398,7 @@ class CommentListState extends State<CommentList> {
SizedBox( SizedBox(
height: 12.h, height: 12.h,
), ),
if(member.parentUserName != "" || member.parentContent != "")
Container( Container(
margin: EdgeInsets.only(left: 68.w, right: 16.w), margin: EdgeInsets.only(left: 68.w, right: 16.w),
decoration: BoxDecoration( decoration: BoxDecoration(

Loading…
Cancel
Save