|
|
|
@ -1,22 +1,31 @@
|
|
|
|
|
import 'dart:convert'; |
|
|
|
|
|
|
|
|
|
import 'package:dio/dio.dart'; |
|
|
|
|
import 'package:flutter/material.dart'; |
|
|
|
|
import 'package:flutter_smart_dialog/flutter_smart_dialog.dart'; |
|
|
|
|
import 'package:huixiang/generated/l10n.dart'; |
|
|
|
|
import 'package:huixiang/retrofit/data/article.dart'; |
|
|
|
|
import 'package:huixiang/retrofit/data/base_data.dart'; |
|
|
|
|
import 'package:huixiang/retrofit/data/message.dart'; |
|
|
|
|
import 'package:huixiang/retrofit/data/page.dart'; |
|
|
|
|
import 'package:huixiang/retrofit/retrofit_api.dart'; |
|
|
|
|
import 'package:huixiang/utils/font_weight.dart'; |
|
|
|
|
import 'package:huixiang/view_widget/classic_header.dart'; |
|
|
|
|
import 'package:huixiang/view_widget/comment_menu.dart'; |
|
|
|
|
import 'package:huixiang/view_widget/custom_image.dart'; |
|
|
|
|
import 'package:huixiang/view_widget/my_appbar.dart'; |
|
|
|
|
import 'package:huixiang/view_widget/my_footer.dart'; |
|
|
|
|
import 'package:huixiang/view_widget/no_data_view.dart'; |
|
|
|
|
import 'package:huixiang/view_widget/round_button.dart'; |
|
|
|
|
import 'package:huixiang/web/web_view/comment_list.dart'; |
|
|
|
|
import 'package:pull_to_refresh/pull_to_refresh.dart'; |
|
|
|
|
import 'package:shared_preferences/shared_preferences.dart'; |
|
|
|
|
import 'package:flutter_screenutil/flutter_screenutil.dart'; |
|
|
|
|
|
|
|
|
|
class SystemDetails extends StatefulWidget { |
|
|
|
|
final Map<String, dynamic> arguments; |
|
|
|
|
|
|
|
|
|
SystemDetails({this.arguments}); |
|
|
|
|
@override |
|
|
|
|
State<StatefulWidget> createState() { |
|
|
|
|
return _SystemDetails(); |
|
|
|
@ -25,10 +34,22 @@ class SystemDetails extends StatefulWidget {
|
|
|
|
|
|
|
|
|
|
class _SystemDetails extends State<SystemDetails> { |
|
|
|
|
ApiService apiService; |
|
|
|
|
int pageNum = 1; |
|
|
|
|
List<Message> messages = []; |
|
|
|
|
int msgType = 0; |
|
|
|
|
String parenId = "0"; |
|
|
|
|
var commentFocus = FocusNode(); |
|
|
|
|
String hintText = S.current.liuxianinjingcaidepinglunba; |
|
|
|
|
bool isKeyBoardShow = false; |
|
|
|
|
final GlobalKey commentKey = GlobalKey(); |
|
|
|
|
final GlobalKey inputKey = GlobalKey(); |
|
|
|
|
final TextEditingController commentTextController = TextEditingController(); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@override |
|
|
|
|
void initState() { |
|
|
|
|
super.initState(); |
|
|
|
|
msgType = widget.arguments["msgType"]; |
|
|
|
|
|
|
|
|
|
SharedPreferences.getInstance().then((value) { |
|
|
|
|
apiService = |
|
|
|
@ -37,8 +58,6 @@ class _SystemDetails extends State<SystemDetails> {
|
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
int pageNum = 1; |
|
|
|
|
List<Message> messages = []; |
|
|
|
|
|
|
|
|
|
_refresh() { |
|
|
|
|
pageNum = 1; |
|
|
|
@ -51,7 +70,7 @@ class _SystemDetails extends State<SystemDetails> {
|
|
|
|
|
"pageSize": 10, |
|
|
|
|
"searchKey": "", |
|
|
|
|
"state": "", |
|
|
|
|
"typed": "" |
|
|
|
|
"typed": msgType |
|
|
|
|
}).catchError((onError) { |
|
|
|
|
_refreshController.loadFailed(); |
|
|
|
|
_refreshController.refreshFailed(); |
|
|
|
@ -75,6 +94,46 @@ class _SystemDetails extends State<SystemDetails> {
|
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
//关注/取关会员 |
|
|
|
|
_vipFollow(followId,isFollow) async { |
|
|
|
|
BaseData baseData = await apiService.follow(followId); |
|
|
|
|
if (baseData != null && baseData.isSuccess) { |
|
|
|
|
// widget.refresh(); |
|
|
|
|
queryMessage(); |
|
|
|
|
SmartDialog.showToast(isFollow?"取关成功":"关注成功", alignment: Alignment.center); |
|
|
|
|
} else { |
|
|
|
|
SmartDialog.showToast(baseData.msg, alignment: Alignment.center); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
///评论 回复 |
|
|
|
|
_reply(messageRelational) { |
|
|
|
|
var messageRelational = jsonDecode(messages[0].relational), |
|
|
|
|
parenId = messageRelational["mid"].toString(); |
|
|
|
|
hintText = S.of(context).huifu_("${messageRelational["nickname"]}"); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
///动态发布评论 |
|
|
|
|
_queryMemberComment(String content) async { |
|
|
|
|
BaseData baseData = await apiService.memberComment({ |
|
|
|
|
"content": content, |
|
|
|
|
"parentId": parenId, |
|
|
|
|
"relationalId": messages[0].mid, |
|
|
|
|
"relationalType":4 |
|
|
|
|
}).catchError((error) {}); |
|
|
|
|
if (baseData != null && baseData.isSuccess) { |
|
|
|
|
// CommentListState state = commentKey.currentState; |
|
|
|
|
// state.queryMemberCommentList(); |
|
|
|
|
commentTextController.text = ""; |
|
|
|
|
FocusScope.of(context).unfocus(); |
|
|
|
|
Navigator.of(context).pop(); |
|
|
|
|
SmartDialog.showToast("发布成功", alignment: Alignment.center); |
|
|
|
|
} |
|
|
|
|
else{ |
|
|
|
|
SmartDialog.showToast("发布失败", alignment: Alignment.center); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
RefreshController _refreshController = RefreshController(); |
|
|
|
|
|
|
|
|
|
@override |
|
|
|
@ -83,9 +142,7 @@ class _SystemDetails extends State<SystemDetails> {
|
|
|
|
|
appBar: MyAppBar( |
|
|
|
|
background: Colors.white, |
|
|
|
|
leadingColor: Colors.black, |
|
|
|
|
// title: "订单通知", |
|
|
|
|
// title: "充值消息", |
|
|
|
|
title: "点赞", |
|
|
|
|
title: (msgType == 2) ?"订单通知":(msgType == 3) ?"充值消息":(msgType == 4) ?"关注":(msgType == 5) ?"点赞":"评论", |
|
|
|
|
titleSize: 18.sp, |
|
|
|
|
titleColor: Colors.black, |
|
|
|
|
), |
|
|
|
@ -97,7 +154,7 @@ class _SystemDetails extends State<SystemDetails> {
|
|
|
|
|
footer: CustomFooter( |
|
|
|
|
loadStyle: LoadStyle.ShowWhenLoading, |
|
|
|
|
builder: (BuildContext context, LoadStatus mode) { |
|
|
|
|
return MyFooter(mode); |
|
|
|
|
return (messages.length == 0)?Container():MyFooter(mode); |
|
|
|
|
}, |
|
|
|
|
), |
|
|
|
|
controller: _refreshController, |
|
|
|
@ -105,23 +162,29 @@ class _SystemDetails extends State<SystemDetails> {
|
|
|
|
|
onLoading: () { |
|
|
|
|
queryMessage(); |
|
|
|
|
}, |
|
|
|
|
child: Container( |
|
|
|
|
child: |
|
|
|
|
Container( |
|
|
|
|
child: SingleChildScrollView( |
|
|
|
|
physics: BouncingScrollPhysics(), |
|
|
|
|
child: Container( |
|
|
|
|
child: |
|
|
|
|
Container( |
|
|
|
|
child: Column( |
|
|
|
|
children: [ |
|
|
|
|
if(msgType == 2) |
|
|
|
|
orderMessage(), |
|
|
|
|
// rechargeMessage(), |
|
|
|
|
// fabulousMessage(), |
|
|
|
|
// commentMessage(), |
|
|
|
|
// followMessage(), |
|
|
|
|
if(msgType == 3) |
|
|
|
|
rechargeMessage(), |
|
|
|
|
if(msgType == 5) |
|
|
|
|
fabulousMessage(), |
|
|
|
|
if(msgType == 6) |
|
|
|
|
commentMessage(), |
|
|
|
|
if(msgType == 4) |
|
|
|
|
followMessage(), |
|
|
|
|
], |
|
|
|
|
), |
|
|
|
|
), |
|
|
|
|
), |
|
|
|
|
), |
|
|
|
|
|
|
|
|
|
), |
|
|
|
|
); |
|
|
|
|
} |
|
|
|
@ -410,10 +473,13 @@ class _SystemDetails extends State<SystemDetails> {
|
|
|
|
|
itemBuilder: (context, position) { |
|
|
|
|
return GestureDetector( |
|
|
|
|
onTap: () { |
|
|
|
|
// if (messages[position].typed == 2) { |
|
|
|
|
// Navigator.of(context) |
|
|
|
|
// .pushNamed('/router/exchange_order_details'); |
|
|
|
|
// } |
|
|
|
|
Navigator.of(context).pushNamed( |
|
|
|
|
'/router/community_details', |
|
|
|
|
arguments: { |
|
|
|
|
"businessId":jsonDecode(messages[position].relational)["businessId"].toString(), |
|
|
|
|
"mid":messages[position].mid |
|
|
|
|
}, |
|
|
|
|
); |
|
|
|
|
}, |
|
|
|
|
child: fabulousMessageItem(messages[position]), |
|
|
|
|
); |
|
|
|
@ -423,26 +489,27 @@ class _SystemDetails extends State<SystemDetails> {
|
|
|
|
|
); |
|
|
|
|
} |
|
|
|
|
Widget fabulousMessageItem(Message message) { |
|
|
|
|
var messageRelational = jsonDecode(message.relational); |
|
|
|
|
return Container( |
|
|
|
|
child: |
|
|
|
|
Row( |
|
|
|
|
mainAxisAlignment: MainAxisAlignment.start, |
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start, |
|
|
|
|
children: [ |
|
|
|
|
Image.asset( |
|
|
|
|
"assets/image/c_z.png", |
|
|
|
|
width: 44.w, |
|
|
|
|
height: 44.h, |
|
|
|
|
), |
|
|
|
|
// MImage( |
|
|
|
|
// "", |
|
|
|
|
// width: 44, |
|
|
|
|
// height: 44, |
|
|
|
|
// isCircle: true, |
|
|
|
|
// fit: BoxFit.cover, |
|
|
|
|
// errorSrc: "assets/image/default_1.png", |
|
|
|
|
// fadeSrc: "assets/image/default_1.png", |
|
|
|
|
// Image.asset( |
|
|
|
|
// "assets/image/c_z.png", |
|
|
|
|
// width: 44.w, |
|
|
|
|
// height: 44.h, |
|
|
|
|
// ), |
|
|
|
|
MImage( |
|
|
|
|
messageRelational["avatar"], |
|
|
|
|
width: 44, |
|
|
|
|
height: 44, |
|
|
|
|
isCircle: true, |
|
|
|
|
fit: BoxFit.cover, |
|
|
|
|
errorSrc: "assets/image/default_1.png", |
|
|
|
|
fadeSrc: "assets/image/default_1.png", |
|
|
|
|
), |
|
|
|
|
SizedBox(width: 8,), |
|
|
|
|
Expanded(child:Column( |
|
|
|
|
mainAxisAlignment: MainAxisAlignment.start, |
|
|
|
@ -451,7 +518,7 @@ class _SystemDetails extends State<SystemDetails> {
|
|
|
|
|
Row( |
|
|
|
|
children: [ |
|
|
|
|
Text( |
|
|
|
|
"张五", |
|
|
|
|
messageRelational["nickname"], |
|
|
|
|
style: TextStyle( |
|
|
|
|
fontWeight: MyFontWeight.semi_bold, |
|
|
|
|
fontSize: 14.sp, |
|
|
|
@ -483,30 +550,30 @@ class _SystemDetails extends State<SystemDetails> {
|
|
|
|
|
padding:EdgeInsets.all(5), |
|
|
|
|
child: Row( |
|
|
|
|
mainAxisAlignment: MainAxisAlignment.start, |
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start, |
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.center, |
|
|
|
|
children: [ |
|
|
|
|
Text( |
|
|
|
|
"我的评论:", |
|
|
|
|
style: TextStyle( |
|
|
|
|
fontSize: 12.sp, |
|
|
|
|
height: 1.3, |
|
|
|
|
fontWeight: MyFontWeight.regular, |
|
|
|
|
color: Color(0xFF1A1A1A), |
|
|
|
|
), |
|
|
|
|
), |
|
|
|
|
// MImage( |
|
|
|
|
// "", |
|
|
|
|
// width: 38, |
|
|
|
|
// height: 38, |
|
|
|
|
// isCircle: true, |
|
|
|
|
// fit: BoxFit.cover, |
|
|
|
|
// radius: BorderRadius.circular(2), |
|
|
|
|
// errorSrc: "assets/image/default_1.png", |
|
|
|
|
// fadeSrc: "assets/image/default_1.png", |
|
|
|
|
// Text( |
|
|
|
|
// "我的评论:", |
|
|
|
|
// style: TextStyle( |
|
|
|
|
// fontSize: 12.sp, |
|
|
|
|
// height: 1.3, |
|
|
|
|
// fontWeight: MyFontWeight.regular, |
|
|
|
|
// color: Color(0xFF1A1A1A), |
|
|
|
|
// ), |
|
|
|
|
// ), |
|
|
|
|
MImage( |
|
|
|
|
messageRelational["nickname"], |
|
|
|
|
width: 38, |
|
|
|
|
height: 38, |
|
|
|
|
isCircle: true, |
|
|
|
|
fit: BoxFit.cover, |
|
|
|
|
radius: BorderRadius.circular(2), |
|
|
|
|
errorSrc: "assets/image/default_1.png", |
|
|
|
|
fadeSrc: "assets/image/default_1.png", |
|
|
|
|
), |
|
|
|
|
SizedBox(width:2.w), |
|
|
|
|
Expanded(child:Text( |
|
|
|
|
"文本,是指书面语言的表现形式文本,文本,是指书面语言的表现形式文本。", |
|
|
|
|
messageRelational["content"], |
|
|
|
|
maxLines: 2, |
|
|
|
|
overflow:TextOverflow.ellipsis, |
|
|
|
|
style: TextStyle( |
|
|
|
@ -557,10 +624,13 @@ class _SystemDetails extends State<SystemDetails> {
|
|
|
|
|
itemBuilder: (context, position) { |
|
|
|
|
return GestureDetector( |
|
|
|
|
onTap: () { |
|
|
|
|
// if (messages[position].typed == 2) { |
|
|
|
|
// Navigator.of(context) |
|
|
|
|
// .pushNamed('/router/exchange_order_details'); |
|
|
|
|
// } |
|
|
|
|
Navigator.of(context).pushNamed( |
|
|
|
|
'/router/community_details', |
|
|
|
|
arguments: { |
|
|
|
|
"businessId":jsonDecode(messages[position].relational)["businessId"].toString(), |
|
|
|
|
"mid":messages[position].mid |
|
|
|
|
}, |
|
|
|
|
); |
|
|
|
|
}, |
|
|
|
|
child: commentMessageItem(messages[position]), |
|
|
|
|
); |
|
|
|
@ -570,26 +640,22 @@ class _SystemDetails extends State<SystemDetails> {
|
|
|
|
|
); |
|
|
|
|
} |
|
|
|
|
Widget commentMessageItem(Message message) { |
|
|
|
|
var messageRelational = jsonDecode(message.relational); |
|
|
|
|
return Container( |
|
|
|
|
child: |
|
|
|
|
Row( |
|
|
|
|
mainAxisAlignment: MainAxisAlignment.start, |
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start, |
|
|
|
|
children: [ |
|
|
|
|
Image.asset( |
|
|
|
|
"assets/image/c_z.png", |
|
|
|
|
width: 44.w, |
|
|
|
|
height: 44.h, |
|
|
|
|
), |
|
|
|
|
// MImage( |
|
|
|
|
// "", |
|
|
|
|
// width: 44, |
|
|
|
|
// height: 44, |
|
|
|
|
// isCircle: true, |
|
|
|
|
// fit: BoxFit.cover, |
|
|
|
|
// errorSrc: "assets/image/default_1.png", |
|
|
|
|
// fadeSrc: "assets/image/default_1.png", |
|
|
|
|
// ), |
|
|
|
|
MImage( |
|
|
|
|
messageRelational["avatar"], |
|
|
|
|
width: 44, |
|
|
|
|
height: 44, |
|
|
|
|
isCircle: true, |
|
|
|
|
fit: BoxFit.cover, |
|
|
|
|
errorSrc: "assets/image/default_1.png", |
|
|
|
|
fadeSrc: "assets/image/default_1.png", |
|
|
|
|
), |
|
|
|
|
SizedBox(width: 8,), |
|
|
|
|
Expanded(child:Column( |
|
|
|
|
mainAxisAlignment: MainAxisAlignment.start, |
|
|
|
@ -606,7 +672,7 @@ class _SystemDetails extends State<SystemDetails> {
|
|
|
|
|
Row( |
|
|
|
|
children: [ |
|
|
|
|
Text( |
|
|
|
|
"张五", |
|
|
|
|
messageRelational["nickname"], |
|
|
|
|
style: TextStyle( |
|
|
|
|
fontWeight: MyFontWeight.semi_bold, |
|
|
|
|
fontSize: 14.sp, |
|
|
|
@ -633,8 +699,15 @@ class _SystemDetails extends State<SystemDetails> {
|
|
|
|
|
), |
|
|
|
|
], |
|
|
|
|
),), |
|
|
|
|
Container( |
|
|
|
|
height: 21.h, |
|
|
|
|
GestureDetector( |
|
|
|
|
onTap: (){ |
|
|
|
|
setState(() { |
|
|
|
|
showDeleteDialog(); |
|
|
|
|
_reply(messageRelational); |
|
|
|
|
}); |
|
|
|
|
}, |
|
|
|
|
child: Container( |
|
|
|
|
height:22.h, |
|
|
|
|
width: 40.w, |
|
|
|
|
padding:EdgeInsets.only(left:2,right:2), |
|
|
|
|
alignment: Alignment.center, |
|
|
|
@ -655,51 +728,94 @@ class _SystemDetails extends State<SystemDetails> {
|
|
|
|
|
), |
|
|
|
|
), |
|
|
|
|
), |
|
|
|
|
) |
|
|
|
|
], |
|
|
|
|
), |
|
|
|
|
SizedBox(height:8.h,), |
|
|
|
|
Text( |
|
|
|
|
"文本,是指书面语言的表现形式,从文学角度说,通常是具有完整、系统含义(Mess…", |
|
|
|
|
maxLines: 2, |
|
|
|
|
overflow: TextOverflow.ellipsis, |
|
|
|
|
style: TextStyle( |
|
|
|
|
fontSize: 12.sp, |
|
|
|
|
height: 1.3, |
|
|
|
|
fontWeight: MyFontWeight.regular, |
|
|
|
|
color: Color(0xFF1A1A1A), |
|
|
|
|
), |
|
|
|
|
), |
|
|
|
|
SizedBox(height:12.h,), |
|
|
|
|
// Text( |
|
|
|
|
// messageRelational["content"], |
|
|
|
|
// maxLines: 2, |
|
|
|
|
// overflow: TextOverflow.ellipsis, |
|
|
|
|
// style: TextStyle( |
|
|
|
|
// fontSize: 12.sp, |
|
|
|
|
// height: 1.3, |
|
|
|
|
// fontWeight: MyFontWeight.regular, |
|
|
|
|
// color: Color(0xFF1A1A1A), |
|
|
|
|
// ), |
|
|
|
|
// ), |
|
|
|
|
// SizedBox(height:12.h,), |
|
|
|
|
// Container( |
|
|
|
|
// width: double.infinity, |
|
|
|
|
// color:Color(0xFFF2F2F2), |
|
|
|
|
// padding:EdgeInsets.all(5), |
|
|
|
|
// child: Row( |
|
|
|
|
// mainAxisAlignment: MainAxisAlignment.start, |
|
|
|
|
// crossAxisAlignment: CrossAxisAlignment.start, |
|
|
|
|
// children: [ |
|
|
|
|
// Text( |
|
|
|
|
// "我的评论:", |
|
|
|
|
// style: TextStyle( |
|
|
|
|
// fontSize: 12.sp, |
|
|
|
|
// height: 1.3, |
|
|
|
|
// fontWeight: MyFontWeight.regular, |
|
|
|
|
// color: Color(0xFF1A1A1A), |
|
|
|
|
// ), |
|
|
|
|
// ), |
|
|
|
|
// // MImage( |
|
|
|
|
// // "", |
|
|
|
|
// // width: 38, |
|
|
|
|
// // height: 38, |
|
|
|
|
// // isCircle: true, |
|
|
|
|
// // fit: BoxFit.cover, |
|
|
|
|
// // radius: BorderRadius.circular(2), |
|
|
|
|
// // errorSrc: "assets/image/default_1.png", |
|
|
|
|
// // fadeSrc: "assets/image/default_1.png", |
|
|
|
|
// // ), |
|
|
|
|
// SizedBox(width:2.w), |
|
|
|
|
// Expanded(child:Text( |
|
|
|
|
// "文本,是指书面语言的表现形式文本,文本,是指书面语言的表现形式文本。", |
|
|
|
|
// maxLines: 2, |
|
|
|
|
// overflow:TextOverflow.ellipsis, |
|
|
|
|
// style: TextStyle( |
|
|
|
|
// fontSize: 12.sp, |
|
|
|
|
// height: 1.3, |
|
|
|
|
// fontWeight: MyFontWeight.regular, |
|
|
|
|
// color: Color(0xFF808080), |
|
|
|
|
// ), |
|
|
|
|
// ),) |
|
|
|
|
// ], |
|
|
|
|
// ), |
|
|
|
|
// ), |
|
|
|
|
Container( |
|
|
|
|
width: double.infinity, |
|
|
|
|
color:Color(0xFFF2F2F2), |
|
|
|
|
padding:EdgeInsets.all(5), |
|
|
|
|
child: Row( |
|
|
|
|
mainAxisAlignment: MainAxisAlignment.start, |
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start, |
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.center, |
|
|
|
|
children: [ |
|
|
|
|
Text( |
|
|
|
|
"我的评论:", |
|
|
|
|
style: TextStyle( |
|
|
|
|
fontSize: 12.sp, |
|
|
|
|
height: 1.3, |
|
|
|
|
fontWeight: MyFontWeight.regular, |
|
|
|
|
color: Color(0xFF1A1A1A), |
|
|
|
|
), |
|
|
|
|
), |
|
|
|
|
// MImage( |
|
|
|
|
// "", |
|
|
|
|
// width: 38, |
|
|
|
|
// height: 38, |
|
|
|
|
// isCircle: true, |
|
|
|
|
// fit: BoxFit.cover, |
|
|
|
|
// radius: BorderRadius.circular(2), |
|
|
|
|
// errorSrc: "assets/image/default_1.png", |
|
|
|
|
// fadeSrc: "assets/image/default_1.png", |
|
|
|
|
// Text( |
|
|
|
|
// "我的评论:", |
|
|
|
|
// style: TextStyle( |
|
|
|
|
// fontSize: 12.sp, |
|
|
|
|
// height: 1.3, |
|
|
|
|
// fontWeight: MyFontWeight.regular, |
|
|
|
|
// color: Color(0xFF1A1A1A), |
|
|
|
|
// ), |
|
|
|
|
// ), |
|
|
|
|
MImage( |
|
|
|
|
messageRelational["nickname"], |
|
|
|
|
width: 38, |
|
|
|
|
height: 38, |
|
|
|
|
isCircle: true, |
|
|
|
|
fit: BoxFit.cover, |
|
|
|
|
radius: BorderRadius.circular(2), |
|
|
|
|
errorSrc: "assets/image/default_1.png", |
|
|
|
|
fadeSrc: "assets/image/default_1.png", |
|
|
|
|
), |
|
|
|
|
SizedBox(width:2.w), |
|
|
|
|
Expanded(child:Text( |
|
|
|
|
"文本,是指书面语言的表现形式文本,文本,是指书面语言的表现形式文本。", |
|
|
|
|
messageRelational["content"], |
|
|
|
|
maxLines: 2, |
|
|
|
|
overflow:TextOverflow.ellipsis, |
|
|
|
|
style: TextStyle( |
|
|
|
@ -763,26 +879,22 @@ class _SystemDetails extends State<SystemDetails> {
|
|
|
|
|
); |
|
|
|
|
} |
|
|
|
|
Widget followMessageItem(Message message) { |
|
|
|
|
var messageRelational = jsonDecode(message.relational); |
|
|
|
|
return Container( |
|
|
|
|
child: |
|
|
|
|
Row( |
|
|
|
|
mainAxisAlignment: MainAxisAlignment.start, |
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start, |
|
|
|
|
children: [ |
|
|
|
|
Image.asset( |
|
|
|
|
"assets/image/c_z.png", |
|
|
|
|
width: 44.w, |
|
|
|
|
height: 44.h, |
|
|
|
|
), |
|
|
|
|
// MImage( |
|
|
|
|
// "", |
|
|
|
|
// width: 44, |
|
|
|
|
// height: 44, |
|
|
|
|
// isCircle: true, |
|
|
|
|
// fit: BoxFit.cover, |
|
|
|
|
// errorSrc: "assets/image/default_1.png", |
|
|
|
|
// fadeSrc: "assets/image/default_1.png", |
|
|
|
|
// ), |
|
|
|
|
MImage( |
|
|
|
|
messageRelational["avatar"], |
|
|
|
|
width: 44, |
|
|
|
|
height: 44, |
|
|
|
|
isCircle: true, |
|
|
|
|
fit: BoxFit.cover, |
|
|
|
|
errorSrc: "assets/image/default_1.png", |
|
|
|
|
fadeSrc: "assets/image/default_1.png", |
|
|
|
|
), |
|
|
|
|
SizedBox(width: 8,), |
|
|
|
|
Expanded(child:Column( |
|
|
|
|
mainAxisAlignment: MainAxisAlignment.start, |
|
|
|
@ -799,7 +911,7 @@ class _SystemDetails extends State<SystemDetails> {
|
|
|
|
|
Row( |
|
|
|
|
children: [ |
|
|
|
|
Text( |
|
|
|
|
"张五", |
|
|
|
|
messageRelational["nickname"], |
|
|
|
|
style: TextStyle( |
|
|
|
|
fontWeight: MyFontWeight.semi_bold, |
|
|
|
|
fontSize: 14.sp, |
|
|
|
@ -826,36 +938,74 @@ class _SystemDetails extends State<SystemDetails> {
|
|
|
|
|
), |
|
|
|
|
], |
|
|
|
|
),), |
|
|
|
|
Container( |
|
|
|
|
GestureDetector( |
|
|
|
|
onTap: (){ |
|
|
|
|
setState(() { |
|
|
|
|
_vipFollow(messageRelational["mid"].toString(),message?.followed ?? false); |
|
|
|
|
}); |
|
|
|
|
}, |
|
|
|
|
child: |
|
|
|
|
RoundButton( |
|
|
|
|
height: 21.h, |
|
|
|
|
width:56.w, |
|
|
|
|
padding:EdgeInsets.only(left:5,right:5), |
|
|
|
|
alignment: Alignment.center, |
|
|
|
|
decoration: BoxDecoration( |
|
|
|
|
borderRadius: BorderRadius.circular(11), |
|
|
|
|
border: Border.all( |
|
|
|
|
width: 1, |
|
|
|
|
color: Color(0xFF00A359), |
|
|
|
|
style: BorderStyle.solid, |
|
|
|
|
), |
|
|
|
|
color: Color(0xFF00A359), |
|
|
|
|
), |
|
|
|
|
child: Row( |
|
|
|
|
children: [ |
|
|
|
|
Icon(Icons.add, |
|
|
|
|
color:Colors.white, |
|
|
|
|
size: 16, |
|
|
|
|
), |
|
|
|
|
Text( |
|
|
|
|
"回关", |
|
|
|
|
style: TextStyle( |
|
|
|
|
fontSize: 12.sp, |
|
|
|
|
fontWeight: MyFontWeight.medium, |
|
|
|
|
color: Colors.white, |
|
|
|
|
), |
|
|
|
|
), |
|
|
|
|
], |
|
|
|
|
padding: EdgeInsets.all(2), |
|
|
|
|
backgroup: (message?.followed ?? false) |
|
|
|
|
? Color(0xFFE6E6E6) |
|
|
|
|
: Color(0xFF32A060), |
|
|
|
|
textColor: (message?.followed ?? false) |
|
|
|
|
? Color(0xFF808080) |
|
|
|
|
: Colors.white, |
|
|
|
|
text: (message?.followed ?? false) ? "已关注" : "回关", |
|
|
|
|
radius:20, |
|
|
|
|
icons: Icon( |
|
|
|
|
(message?.followed ?? false) |
|
|
|
|
? Icons.check |
|
|
|
|
: Icons.add, |
|
|
|
|
color: (message?.followed?? false) |
|
|
|
|
? Color(0xFF808080) |
|
|
|
|
: Colors.white, |
|
|
|
|
size: 12, |
|
|
|
|
), |
|
|
|
|
) |
|
|
|
|
// Container( |
|
|
|
|
// height: 21.h, |
|
|
|
|
// width:56.w, |
|
|
|
|
// padding:EdgeInsets.only(left:5,right:5), |
|
|
|
|
// alignment: Alignment.center, |
|
|
|
|
// decoration: BoxDecoration( |
|
|
|
|
// borderRadius: BorderRadius.circular(11), |
|
|
|
|
// border: Border.all( |
|
|
|
|
// width: 1, |
|
|
|
|
// color: Color(0xFF00A359), |
|
|
|
|
// style: BorderStyle.solid, |
|
|
|
|
// ), |
|
|
|
|
// color: (message?.followed ?? false) |
|
|
|
|
// ? Color(0xFFE6E6E6) |
|
|
|
|
// : Color(0xFF32A060), |
|
|
|
|
// ), |
|
|
|
|
// child: Row( |
|
|
|
|
// children: [ |
|
|
|
|
// Icon((message?.followed ?? false) |
|
|
|
|
// ? Icons.check |
|
|
|
|
// : Icons.add, |
|
|
|
|
// color:(message?.followed?? false) |
|
|
|
|
// ? Color(0xFF808080) |
|
|
|
|
// : Colors.white, |
|
|
|
|
// size: 16, |
|
|
|
|
// ), |
|
|
|
|
// Text( |
|
|
|
|
// (message?.followed ?? false) ? "已关注" : "回关", |
|
|
|
|
// style: TextStyle( |
|
|
|
|
// fontSize: 12.sp, |
|
|
|
|
// fontWeight: MyFontWeight.medium, |
|
|
|
|
// color:(message?.followed ?? false) |
|
|
|
|
// ? Color(0xFF808080) |
|
|
|
|
// : Colors.white, |
|
|
|
|
// ), |
|
|
|
|
// ), |
|
|
|
|
// ], |
|
|
|
|
// ), |
|
|
|
|
// ) |
|
|
|
|
), |
|
|
|
|
], |
|
|
|
|
), |
|
|
|
@ -872,4 +1022,87 @@ class _SystemDetails extends State<SystemDetails> {
|
|
|
|
|
), |
|
|
|
|
); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
///动态弹窗 |
|
|
|
|
showDeleteDialog() { |
|
|
|
|
showDialog( |
|
|
|
|
context: context, |
|
|
|
|
builder: (context) { |
|
|
|
|
return AlertDialog( |
|
|
|
|
content: Container( |
|
|
|
|
height: 150.h, |
|
|
|
|
// padding: EdgeInsets.all(16), |
|
|
|
|
decoration: BoxDecoration( |
|
|
|
|
color: Colors.white, |
|
|
|
|
boxShadow: [ |
|
|
|
|
BoxShadow( |
|
|
|
|
color: Colors.black.withAlpha(12), |
|
|
|
|
offset: Offset(0, 2), |
|
|
|
|
blurRadius: 14, |
|
|
|
|
spreadRadius: 0, |
|
|
|
|
), |
|
|
|
|
], |
|
|
|
|
borderRadius: BorderRadius.vertical( |
|
|
|
|
top: Radius.circular(8), |
|
|
|
|
), |
|
|
|
|
), |
|
|
|
|
child: Row( |
|
|
|
|
children: [ |
|
|
|
|
Expanded( |
|
|
|
|
flex: 1, |
|
|
|
|
child: Container( |
|
|
|
|
decoration: BoxDecoration( |
|
|
|
|
color: Color(0xffF2F2F2), |
|
|
|
|
borderRadius: BorderRadius.circular(2.0), |
|
|
|
|
), |
|
|
|
|
child: Container( |
|
|
|
|
margin: EdgeInsets.symmetric(horizontal: 4.w), |
|
|
|
|
alignment: Alignment.topLeft, |
|
|
|
|
child: TextField( |
|
|
|
|
maxLines: 8, |
|
|
|
|
minLines: 1, |
|
|
|
|
focusNode:commentFocus, |
|
|
|
|
controller:commentTextController, |
|
|
|
|
decoration: InputDecoration( |
|
|
|
|
border: InputBorder.none, |
|
|
|
|
hintText:hintText, |
|
|
|
|
hintStyle: TextStyle( |
|
|
|
|
fontSize: 14.sp, |
|
|
|
|
color: Color(0xFF868686), |
|
|
|
|
), |
|
|
|
|
), |
|
|
|
|
), |
|
|
|
|
), |
|
|
|
|
), |
|
|
|
|
), |
|
|
|
|
if (!isKeyBoardShow) |
|
|
|
|
GestureDetector( |
|
|
|
|
onTap: () { |
|
|
|
|
setState(() { |
|
|
|
|
var commentText = commentTextController.text; |
|
|
|
|
if (commentText.trim() == "") { |
|
|
|
|
return; |
|
|
|
|
} |
|
|
|
|
_queryMemberComment(commentText); |
|
|
|
|
}); |
|
|
|
|
}, |
|
|
|
|
child: Container( |
|
|
|
|
padding: EdgeInsets.symmetric(horizontal: 20.w), |
|
|
|
|
child: Text( |
|
|
|
|
S.of(context).fasong, |
|
|
|
|
style: TextStyle( |
|
|
|
|
fontSize: 16.sp, |
|
|
|
|
fontWeight: FontWeight.bold, |
|
|
|
|
color: Color(0XFF1A1A1A), |
|
|
|
|
), |
|
|
|
|
), |
|
|
|
|
), |
|
|
|
|
), |
|
|
|
|
], |
|
|
|
|
), |
|
|
|
|
), |
|
|
|
|
); |
|
|
|
|
}, |
|
|
|
|
); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|