|
|
|
@ -52,7 +52,7 @@ class _CommentList extends State<CommentList> {
|
|
|
|
|
LoginTipsDialog().show(context); |
|
|
|
|
return; |
|
|
|
|
} |
|
|
|
|
BaseData baseData = await apiService.commentLike(id).catchError((error){}); |
|
|
|
|
BaseData baseData = await apiService.commentLike(id).catchError((error) {}); |
|
|
|
|
if (baseData != null && baseData.isSuccess) { |
|
|
|
|
memberList.forEach((element) { |
|
|
|
|
if (element.id == id) { |
|
|
|
@ -134,15 +134,15 @@ class _CommentList extends State<CommentList> {
|
|
|
|
|
showPressMenu(memberList[position].createUser, |
|
|
|
|
memberList[position]); |
|
|
|
|
}, |
|
|
|
|
child: commentItem(memberList[position], position, |
|
|
|
|
memberList.length), |
|
|
|
|
child: commentItem( |
|
|
|
|
memberList[position], position, memberList.length), |
|
|
|
|
), |
|
|
|
|
); |
|
|
|
|
}, |
|
|
|
|
), |
|
|
|
|
if (memberList != null && memberList.length > 0) |
|
|
|
|
Container( |
|
|
|
|
height: 63.h, |
|
|
|
|
height: commentHeight, |
|
|
|
|
decoration: BoxDecoration( |
|
|
|
|
color: Color(0xFFF2F2F2), |
|
|
|
|
boxShadow: [ |
|
|
|
@ -154,7 +154,8 @@ class _CommentList extends State<CommentList> {
|
|
|
|
|
), |
|
|
|
|
], |
|
|
|
|
), |
|
|
|
|
alignment: Alignment.center, |
|
|
|
|
alignment: Alignment.topCenter, |
|
|
|
|
padding: EdgeInsets.only(top: 22.h), |
|
|
|
|
child: Text( |
|
|
|
|
S.of(context).yixiansquanbupinglun, |
|
|
|
|
style: TextStyle( |
|
|
|
@ -166,8 +167,13 @@ class _CommentList extends State<CommentList> {
|
|
|
|
|
if (memberList == null || memberList.length == 0) |
|
|
|
|
Container( |
|
|
|
|
width: double.infinity, |
|
|
|
|
height: 80.h, |
|
|
|
|
alignment: Alignment.center, |
|
|
|
|
height: MediaQuery.of(context).size.height - |
|
|
|
|
kToolbarHeight - |
|
|
|
|
MediaQuery.of(context).padding.top - |
|
|
|
|
160.h, |
|
|
|
|
alignment: Alignment.topCenter, |
|
|
|
|
color: Color(0xFFF2F2F2), |
|
|
|
|
padding: EdgeInsets.only(top: 22.h), |
|
|
|
|
child: Text( |
|
|
|
|
S.of(context).zanwupinglun, |
|
|
|
|
style: TextStyle( |
|
|
|
@ -180,30 +186,41 @@ class _CommentList extends State<CommentList> {
|
|
|
|
|
], |
|
|
|
|
), |
|
|
|
|
), |
|
|
|
|
SizedBox( |
|
|
|
|
height: 12.h, |
|
|
|
|
), |
|
|
|
|
], |
|
|
|
|
); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
double commentHeight = 60.h; |
|
|
|
|
|
|
|
|
|
contentHeight() { |
|
|
|
|
double contentHeight = MediaQuery.of(context).size.height - |
|
|
|
|
kToolbarHeight - |
|
|
|
|
MediaQuery.of(context).padding.top - |
|
|
|
|
160.h; |
|
|
|
|
if ((contentHeight - 60.h) > (128.h * memberList.length)) { |
|
|
|
|
commentHeight = contentHeight - (128.h * memberList.length); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
//评论列表 |
|
|
|
|
queryMemberCommentList() async { |
|
|
|
|
SharedPreferences sharedPreferences = await SharedPreferences.getInstance(); |
|
|
|
|
if (apiService == null) |
|
|
|
|
apiService = ApiService(Dio(), |
|
|
|
|
context: context, token: sharedPreferences.getString("token")); |
|
|
|
|
BaseData<PageInfo<MemberCommentList>> baseData = |
|
|
|
|
await apiService.memberCommentList({ |
|
|
|
|
apiService = ApiService( |
|
|
|
|
Dio(), |
|
|
|
|
context: context, |
|
|
|
|
token: sharedPreferences.getString("token"), |
|
|
|
|
); |
|
|
|
|
BaseData<PageInfo<MemberCommentList>> baseData = await apiService.memberCommentList({ |
|
|
|
|
"pageNum": 1, |
|
|
|
|
"pageSize": 100, |
|
|
|
|
"relationalId": |
|
|
|
|
widget.arguments["activityId"] ?? widget.arguments["articleId"], |
|
|
|
|
"relationalId": widget.arguments["activityId"] ?? widget.arguments["articleId"], |
|
|
|
|
"relationalType": 1, |
|
|
|
|
}).catchError((error) {}); |
|
|
|
|
if (baseData != null && baseData.isSuccess) { |
|
|
|
|
commentTotal = baseData.data.size; |
|
|
|
|
memberList = baseData.data.list; |
|
|
|
|
contentHeight(); |
|
|
|
|
setState(() {}); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
@ -214,24 +231,6 @@ class _CommentList extends State<CommentList> {
|
|
|
|
|
return; |
|
|
|
|
} |
|
|
|
|
SharedPreferences.getInstance().then((value) { |
|
|
|
|
// showModalBottomSheet( |
|
|
|
|
// context: context, |
|
|
|
|
// backgroundColor: Colors.transparent, |
|
|
|
|
// builder: (context) { |
|
|
|
|
// return CommentMenu( |
|
|
|
|
// (type) { |
|
|
|
|
// print("click: $type"); |
|
|
|
|
// if (type == "huifu") { |
|
|
|
|
// widget.reply(memberComment); |
|
|
|
|
// } else if (type == "shanchu") { |
|
|
|
|
// widget.delCommentTips(); |
|
|
|
|
// } |
|
|
|
|
// }, |
|
|
|
|
// isSelf: userId == value.getString("userId"), |
|
|
|
|
// ); |
|
|
|
|
// }, |
|
|
|
|
// ); |
|
|
|
|
|
|
|
|
|
SmartDialog.show( |
|
|
|
|
widget: CommentMenu( |
|
|
|
|
(type) { |
|
|
|
@ -364,8 +363,8 @@ class _CommentList extends State<CommentList> {
|
|
|
|
|
), |
|
|
|
|
Container( |
|
|
|
|
padding: EdgeInsets.only( |
|
|
|
|
left: 68, |
|
|
|
|
right: 16, |
|
|
|
|
left: 68.w, |
|
|
|
|
right: 16.w, |
|
|
|
|
top: 16.h, |
|
|
|
|
bottom: 16.h, |
|
|
|
|
), |
|
|
|
|