|
|
|
@ -178,8 +178,10 @@ class _StoreDetailsPage extends State<StoreDetailsPage> {
|
|
|
|
|
|
|
|
|
|
//给文章/活动点赞 |
|
|
|
|
queryInformationLikes() async { |
|
|
|
|
BaseData baseData = |
|
|
|
|
await apiService.commentLike(widget.arguments["activityId"] ?? widget.arguments["articleId"]).catchError((onError) {}); |
|
|
|
|
BaseData baseData = await apiService |
|
|
|
|
.commentLike( |
|
|
|
|
widget.arguments["activityId"] ?? widget.arguments["articleId"]) |
|
|
|
|
.catchError((onError) {}); |
|
|
|
|
if (baseData != null && baseData.isSuccess) { |
|
|
|
|
setState(() { |
|
|
|
|
isLiked = true; |
|
|
|
@ -192,9 +194,10 @@ class _StoreDetailsPage extends State<StoreDetailsPage> {
|
|
|
|
|
//发布评论 |
|
|
|
|
queryMemberComment(String content) async { |
|
|
|
|
BaseData baseData = await apiService.memberComment({ |
|
|
|
|
"content":content, |
|
|
|
|
"parentId":0, |
|
|
|
|
"relationalId":widget.arguments["activityId"] ?? widget.arguments["articleId"], |
|
|
|
|
"content": content, |
|
|
|
|
"parentId": 0, |
|
|
|
|
"relationalId": |
|
|
|
|
widget.arguments["activityId"] ?? widget.arguments["articleId"], |
|
|
|
|
"relationalType": 1 |
|
|
|
|
}).catchError((error) { |
|
|
|
|
_refreshController.refreshFailed(); |
|
|
|
@ -383,7 +386,8 @@ class _StoreDetailsPage extends State<StoreDetailsPage> {
|
|
|
|
|
SizedBox( |
|
|
|
|
width: 16.w, |
|
|
|
|
), |
|
|
|
|
Text("喜欢(${article?.likes??activity?.likes??"0"})", |
|
|
|
|
Text( |
|
|
|
|
"喜欢(${article?.likes ?? activity?.likes ?? "0"})", |
|
|
|
|
style: TextStyle( |
|
|
|
|
fontSize: 16.sp, |
|
|
|
|
fontWeight: FontWeight.bold, |
|
|
|
@ -399,7 +403,8 @@ class _StoreDetailsPage extends State<StoreDetailsPage> {
|
|
|
|
|
itemBuilder: (context, position) { |
|
|
|
|
return GestureDetector( |
|
|
|
|
onTap: () {}, |
|
|
|
|
child: commentItem(memberList[position],position,memberList.length), |
|
|
|
|
child: commentItem(memberList[position], position, |
|
|
|
|
memberList.length), |
|
|
|
|
); |
|
|
|
|
}, |
|
|
|
|
), |
|
|
|
@ -459,14 +464,14 @@ class _StoreDetailsPage extends State<StoreDetailsPage> {
|
|
|
|
|
Padding( |
|
|
|
|
padding: EdgeInsets.only(left: 20.w, right: 20.w), |
|
|
|
|
child: GestureDetector( |
|
|
|
|
onTap: (){ |
|
|
|
|
onTap: () { |
|
|
|
|
var commentText = commentTextController.text; |
|
|
|
|
if (commentText == "") { |
|
|
|
|
return; |
|
|
|
|
} |
|
|
|
|
queryMemberComment(commentText); |
|
|
|
|
}, |
|
|
|
|
child:Text( |
|
|
|
|
child: Text( |
|
|
|
|
"发送", |
|
|
|
|
style: TextStyle( |
|
|
|
|
fontSize: 16.sp, |
|
|
|
@ -475,9 +480,14 @@ class _StoreDetailsPage extends State<StoreDetailsPage> {
|
|
|
|
|
), |
|
|
|
|
), |
|
|
|
|
), |
|
|
|
|
GestureDetector(onTap: (){ |
|
|
|
|
queryInformationLikes(); |
|
|
|
|
},child: Image.asset(isLiked?"assets/image/icon_like.png":"assets/image/icon_like_h.png"),) |
|
|
|
|
GestureDetector( |
|
|
|
|
onTap: () { |
|
|
|
|
queryInformationLikes(); |
|
|
|
|
}, |
|
|
|
|
child: Image.asset(isLiked |
|
|
|
|
? "assets/image/icon_like.png" |
|
|
|
|
: "assets/image/icon_like_h.png"), |
|
|
|
|
) |
|
|
|
|
], |
|
|
|
|
), |
|
|
|
|
), |
|
|
|
@ -539,7 +549,7 @@ class _StoreDetailsPage extends State<StoreDetailsPage> {
|
|
|
|
|
); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
Widget commentItem(MemberCommentList memberList,int index,int max) { |
|
|
|
|
Widget commentItem(MemberCommentList memberList, int index, int max) { |
|
|
|
|
return Container( |
|
|
|
|
child: Column( |
|
|
|
|
children: [ |
|
|
|
@ -634,30 +644,32 @@ class _StoreDetailsPage extends State<StoreDetailsPage> {
|
|
|
|
|
SizedBox( |
|
|
|
|
height: 12.h, |
|
|
|
|
), |
|
|
|
|
if(memberList.parentContent != null) |
|
|
|
|
Container( |
|
|
|
|
width: double.infinity, |
|
|
|
|
margin: EdgeInsets.only(left: 68.w, right: 16.w), |
|
|
|
|
decoration: new BoxDecoration( |
|
|
|
|
color: Color(0xffF2F2F2), |
|
|
|
|
borderRadius: BorderRadius.circular(2.0), |
|
|
|
|
), |
|
|
|
|
child: Padding( |
|
|
|
|
padding: EdgeInsets.only(left: 4.w, top: 4.h, bottom: 4.h), |
|
|
|
|
child: Row( |
|
|
|
|
children: [ |
|
|
|
|
Text( |
|
|
|
|
memberList.parentUserName??"", |
|
|
|
|
style: TextStyle(fontSize: 12.sp, color: Color(0xff808080)), |
|
|
|
|
), |
|
|
|
|
Text( |
|
|
|
|
memberList.parentContent ?? "", |
|
|
|
|
style: TextStyle(fontSize: 12.sp, color: Color(0xff808080)), |
|
|
|
|
), |
|
|
|
|
], |
|
|
|
|
if (memberList.parentContent != null) |
|
|
|
|
Container( |
|
|
|
|
width: double.infinity, |
|
|
|
|
margin: EdgeInsets.only(left: 68.w, right: 16.w), |
|
|
|
|
decoration: new BoxDecoration( |
|
|
|
|
color: Color(0xffF2F2F2), |
|
|
|
|
borderRadius: BorderRadius.circular(2.0), |
|
|
|
|
), |
|
|
|
|
child: Padding( |
|
|
|
|
padding: EdgeInsets.only(left: 4.w, top: 4.h, bottom: 4.h), |
|
|
|
|
child: Row( |
|
|
|
|
children: [ |
|
|
|
|
Text( |
|
|
|
|
memberList.parentUserName ?? "", |
|
|
|
|
style: |
|
|
|
|
TextStyle(fontSize: 12.sp, color: Color(0xff808080)), |
|
|
|
|
), |
|
|
|
|
Text( |
|
|
|
|
memberList.parentContent ?? "", |
|
|
|
|
style: |
|
|
|
|
TextStyle(fontSize: 12.sp, color: Color(0xff808080)), |
|
|
|
|
), |
|
|
|
|
], |
|
|
|
|
), |
|
|
|
|
), |
|
|
|
|
), |
|
|
|
|
), |
|
|
|
|
if (index == max - 1) |
|
|
|
|
Container( |
|
|
|
|
height: 63.h, |
|
|
|
|