From 2ba994f2f961cd55e06ed91f5bbcbde61a8d6fa4 Mon Sep 17 00:00:00 2001 From: zhang <494089941@qq.com> Date: Mon, 2 Nov 2020 15:40:12 +0800 Subject: [PATCH] =?UTF-8?q?=E8=AF=84=E8=AE=BA=E6=B6=88=E6=81=AF=E9=A1=B5?= =?UTF-8?q?=E5=AE=8C=E6=88=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- assets/message/ic_star.png | Bin 0 -> 2755 bytes lib/ui/home/messages/comment_message.dart | 146 +++++++++++++++++ lib/ui/home/messages/message.dart | 188 ++++++++++++---------- lib/ui/home/messages/system_message.dart | 42 +++-- 4 files changed, 276 insertions(+), 100 deletions(-) create mode 100644 assets/message/ic_star.png create mode 100644 lib/ui/home/messages/comment_message.dart diff --git a/assets/message/ic_star.png b/assets/message/ic_star.png new file mode 100644 index 0000000000000000000000000000000000000000..4ea81a9f6cf51469013fb6bc736de29bc46dddcd GIT binary patch literal 2755 zcma)8`8(A67ylU9hA=LPjAcj-Sw_VW?%-1~!=#~dEp1%ekfm!U%F>KbGR0g%WX;$$ z2#JX>mYNJv3}R%8geDic^Zot<-|r7+dCv2G&N;8=oacRBWJmnzy-;N+004XKY(av+ zI{rt*MFlzo_MHX*&{R9n$~p4l*IZ(N`)P%Q;TB$Rsl<3vBPB)8&h7)GNdBhm3mu5R zDaj&)=S?zg*wAnyaSbLSgTZxYUkcrS8<1?9?%T!aJAtg|31ccbsX})0x8ch!)wv$D4!C_ncMG<8m*>?EJjWBrlDSl0{;H~ zt*vxAfAjU>q{ZedLjJUPJXoNP02#j#`ia(yN>pDP$h!Fo)|0scbk_ZS0Nk#Xo#kg{ zme?v>hWeI%1fO=Jmh#}cGDC9i1Qc$2SML1{B+hmBz+&*|Y?&Q3KlM`zzIws~4 zDeaU3+(bptPQH4Pf!tXl*^)&Hqm9Chr+Z)8Ty+t2H| znXro5xfDn_C3+7mhJ5%BybPF!D5|1_`Xoo6`Vrj?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?YfsQGHQ;#M)igy@mdd6ZI=NYDrSK?JURV*(KpYLb)KA|+wTf1B*V!vk!H}(yZ?Gt&iB(#$0h293cfQB8}N6{B2(D_@8hV#+&hrfcL%N9?ib!E?{6HZ{M!)hn$>+qYVYuLd}?FXRv@kFHN+D}sQ| zM}VW$Uz;Iy+HPj%ZrZ|;mtUnS@b}&Mh((6$Y_(v#x(jxNg9?V17-~YW7xS&lAI~oB zH^tC4u7i!7OG+W*FQZO?D&Z`P(e%uf*q$gL><<4Nd3$}0N6nkGTX7T1- z71OSgLAw43Y{fH3OOEXJ&{c!w8vi#*^)%zSBBi#=ufUEZ+AB&s_bMNA z{!53m&c;`4O*#BTc-6+c3a8ll^dNeuE{`O;8mhst^~L3sCEDsa65G>BZTENXX6qz+ z_SWODeTp|Kul)$ZN!NAP=HGaxY7J(Q!J^@?k1s35TtGwrgxh3NO}xB?p~2V%*jcE? zjkCBCBP#RI=9hq)K?Pc-?oDb(hh_CJ_!c2jPWeZ0js9pWg8*MLW$ci5Ry`aZ%ub3I z7Z=lEu(H=s`YV8QhJe-A{qO6h8=`<^H~HPd!h!*ReSKR~P7iA~FW1FnG80LWny?*b zY~OX#latVUM20JGl+bU2pza_ZNlQt&kF!|UTiHz=S3(B$SGiV5)W2eU%vG(MXMt^ literal 0 HcmV?d00001 diff --git a/lib/ui/home/messages/comment_message.dart b/lib/ui/home/messages/comment_message.dart new file mode 100644 index 0000000..ddcfc86 --- /dev/null +++ b/lib/ui/home/messages/comment_message.dart @@ -0,0 +1,146 @@ +import 'package:aku_community_manager/style/app_style.dart'; +import 'package:aku_community_manager/ui/widgets/common/aku_scaffold.dart'; +import 'package:aku_ui/common_widgets/aku_common_widgets.dart'; +import 'package:flutter/material.dart'; +import 'package:flutter_screenutil/flutter_screenutil.dart'; +import 'package:aku_community_manager/const/resource.dart'; +class CommentMessage extends StatefulWidget { + CommentMessage({Key key}) : super(key: key); + + @override + _CommentMessageState createState() => _CommentMessageState(); +} + +class _CommentMessageState extends State { + Widget _messageList(String date, String name, String comment,) { + return Column( + children: [ + Container( + alignment: Alignment.center, + width: double.infinity, + height: 48.w + 33.w, + child: Text( + date, + style: TextStyle(color: AppStyle.minorTextColor, fontSize: 24.sp), + ), + ), + Container( + padding: EdgeInsets.only(top: 24.w, left: 24.w, right: 24.w), + color: Color(0xFFFFFFFF), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Row(children: [ + Container( + width: 16.w, + height: 16.w, + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(8.w), + color: Color(0xFFFF4501)), + ), + SizedBox( + width: 16.w, + ), + Text( + '系统通知', + style: TextStyle( + color: AppStyle.primaryTextColor, + fontSize: 32.sp, + fontWeight: FontWeight.w600), + ), + SizedBox(height: 8.w), + ]), + Text( + '你有一条新的报事报修,请立即处理', + style: TextStyle( + color: AppStyle.primaryTextColor, + fontSize: 28.sp, + fontWeight: FontWeight.bold), + ), + SizedBox(height: 24.w), + Row( + children: [ + Image.asset( + R.ASSETS_MESSAGE_IC_PEOPLE_PNG, + width: 40.w, + height: 40.w, + ), + SizedBox( + width: 4.w, + ), + Text( + '评论人', + style: TextStyle( + color: AppStyle.minorTextColor, fontSize: 28.sp), + ), + Spacer(), + Text( + name, + style: TextStyle( + color: AppStyle.primaryTextColor, fontSize: 28.sp), + ), + ], + ), + SizedBox(height: 16.w), + Row( + children: [ + Image.asset( + R.ASSETS_MESSAGE_IC_STAR_PNG, + width: 40.w, + height: 40.w, + ), + SizedBox( + width: 4.w, + ), + Text('综合评分', + style: TextStyle( + color: AppStyle.minorTextColor, fontSize: 28.sp)), + Spacer(), + Text(comment, + style: TextStyle( + color: AppStyle.primaryTextColor, fontSize: 28.sp)), + ], + ), + SizedBox(height: 16.w), + Divider( + height: 1.w, + ), + AkuButton( + onPressed: () {}, + child: Container( + height: 88.w, + alignment: Alignment.center, + padding: EdgeInsets.only(left: 24.w), + child: Row( + children: [ + Text( + '查看详情', + style: TextStyle( + color: AppStyle.primaryTextColor, fontSize: 28.sp), + ), + Spacer(), + Icon(Icons.arrow_forward_ios, size: 22.w), + ], + ), + ), + ), + ], + ), + ), + ], + ); + } + @override + Widget build(BuildContext context) { + return AkuScaffold( + title: '评论消息', + body: ListView( + padding: EdgeInsets.all(32.w), + children: [ + _messageList('2020-10-23 10:00', '杨建', '四星'), + _messageList('2020-10-24 11:00', '刘能', '四星'), + ], + ), + ); + } +} \ No newline at end of file diff --git a/lib/ui/home/messages/message.dart b/lib/ui/home/messages/message.dart index ef977f8..a77e093 100644 --- a/lib/ui/home/messages/message.dart +++ b/lib/ui/home/messages/message.dart @@ -1,5 +1,6 @@ import 'package:aku_community_manager/const/resource.dart'; import 'package:aku_community_manager/style/app_style.dart'; +import 'package:aku_community_manager/ui/home/messages/comment_message.dart'; import 'package:aku_community_manager/ui/home/messages/system_message.dart'; import 'package:aku_community_manager/ui/widgets/common/aku_scaffold.dart'; import 'package:aku_ui/aku_ui.dart'; @@ -16,107 +17,110 @@ class Message extends StatefulWidget { } class _MessageState extends State { - - Widget _messageTypeImage(String type){ + Widget _messageTypeImage(String type) { String path; Color ca; Color cb; - switch (type) { - case'系统消息' : - path=R.ASSETS_MESSAGE_IC_TONGZHI_PNG; - ca=Color(0xFFFFDE9A); - cb=Color(0xFFFFB00A); + switch (type) { + case '系统消息': + path = R.ASSETS_MESSAGE_IC_TONGZHI_PNG; + ca = Color(0xFFFFDE9A); + cb = Color(0xFFFFB00A); + break; + case '评论消息': + path = R.ASSETS_MESSAGE_IC_PINGLUN_PNG; + ca = Color(0xFF81D1FF); + cb = Color(0xFF1792FF); break; - case '评论消息': - path=R.ASSETS_MESSAGE_IC_PINGLUN_PNG; - ca=Color(0xFF81D1FF); - cb=Color(0xFF1792FF); - break; default: } return Container( - width: 88.w, - height: 88.w, - decoration: BoxDecoration( - borderRadius: BorderRadius.circular(44.w), - gradient: LinearGradient( - begin: Alignment.topCenter, - end: Alignment.bottomCenter, - colors: [ - ca, - cb, - ]), - ), - child: Image.asset(path,width: 70.w,height: 70.w,), - ); + width: 88.w, + height: 88.w, + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(44.w), + gradient: LinearGradient( + begin: Alignment.topCenter, + end: Alignment.bottomCenter, + colors: [ + ca, + cb, + ]), + ), + child: Image.asset( + path, + width: 70.w, + height: 70.w, + ), + ); } - Widget _messageListTile(String date, Widget messageImage, String title,String text,int number,Widget page) { + + Widget _messageListTile( + String date, Widget messageImage, String title, String text, int number, + {VoidCallback onpressed}) { return AkuButton( - color: Color(0xFFFFFFFF), - onPressed: () { - Get.to(page); - }, - child: Container( - height: 136.w, - padding: EdgeInsets.only( - top: 24.w, - left: 32.w, - bottom: 24.w, - right: 31.w, + color: Color(0xFFFFFFFF), + onPressed: onpressed, + child: Container( + height: 136.w, + padding: EdgeInsets.only( + top: 24.w, + left: 32.w, + bottom: 24.w, + right: 31.w, + ), + child: Row( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + messageImage, + SizedBox( + width: 24.w, ), - child: Row( - mainAxisAlignment: MainAxisAlignment.center, - children: [ - messageImage, - SizedBox( - width: 24.w, - ), - Expanded( - child: Column( - mainAxisSize: MainAxisSize.min, + Expanded( + child: Column( + mainAxisSize: MainAxisSize.min, + children: [ + Row( children: [ - Row( - children: [ - Text( - title, - style: AppStyle().primaryStyle, - ), - Spacer(), - Text(date, style: AppStyle().minorStyle), - ], + Text( + title, + style: AppStyle().primaryStyle, ), Spacer(), - Row( - mainAxisAlignment: MainAxisAlignment.center, - children: [ - Text(text, style: AppStyle().minorStyle), - Spacer(), - Container( - alignment: Alignment.center, - width: 32.w, - height: 32.w, - decoration: BoxDecoration( - borderRadius: BorderRadius.circular(16.w), - color: Color(0xFFFF4501)), - child: Text( - number.toString(), - style: TextStyle( - color: Color(0xFFFFFFFF), - fontSize: 20.sp, - ), - ), + Text(date, style: AppStyle().minorStyle), + ], + ), + Spacer(), + Row( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Text(text, style: AppStyle().minorStyle), + Spacer(), + Container( + alignment: Alignment.center, + width: 32.w, + height: 32.w, + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(16.w), + color: Color(0xFFFF4501)), + child: Text( + number.toString(), + style: TextStyle( + color: Color(0xFFFFFFFF), + fontSize: 20.sp, ), - ], + ), ), ], ), - ), - ], + ], + ), ), - ), - ); - - } + ], + ), + ), + ); + } @override Widget build(BuildContext context) { @@ -126,13 +130,25 @@ class _MessageState extends State { body: ListView( padding: EdgeInsets.only(top: 16.w), children: [ - _messageListTile('2020-10-23 9:00',_messageTypeImage('系统消息'), '系统消息','你有一条新的报事报修待处理' ,5,SystemMessage()), + _messageListTile('2020-10-23 9:00', _messageTypeImage('系统消息'), '系统消息', + '你有一条新的报事报修待处理', 5, onpressed: () { + Get.to(SystemMessage()); + }), Divider( height: 1.w, ), - _messageListTile('2020-10-23 10:00', _messageTypeImage('评论消息'),'评论消息', '你有一条新的评论回复',7,SystemMessage()), + _messageListTile( + '2020-10-23 10:00', + _messageTypeImage('评论消息'), + '评论消息', + '你有一条新的评论回复', + 7, + onpressed: () { + Get.to(CommentMessage()); + }, + ), ], ), ); } -} \ No newline at end of file +} diff --git a/lib/ui/home/messages/system_message.dart b/lib/ui/home/messages/system_message.dart index a839f37..97cb992 100644 --- a/lib/ui/home/messages/system_message.dart +++ b/lib/ui/home/messages/system_message.dart @@ -26,7 +26,7 @@ class _SystemMessageState extends State { ), ), Container( - padding: EdgeInsets.only(top:24.w,left:24.w,right:24.w), + padding: EdgeInsets.only(top: 24.w, left: 24.w, right: 24.w), color: Color(0xFFFFFFFF), child: Column( crossAxisAlignment: CrossAxisAlignment.start, @@ -35,7 +35,9 @@ class _SystemMessageState extends State { Container( width: 16.w, height: 16.w, - decoration: BoxDecoration(borderRadius:BorderRadius.circular(8.w),color:Color(0xFFFF4501)), + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(8.w), + color: Color(0xFFFF4501)), ), SizedBox( width: 16.w, @@ -47,7 +49,7 @@ class _SystemMessageState extends State { fontSize: 32.sp, fontWeight: FontWeight.w600), ), - SizedBox(height:8.w), + SizedBox(height: 8.w), ]), Text( '你有一条新的报事报修,请立即处理', @@ -56,10 +58,14 @@ class _SystemMessageState extends State { fontSize: 28.sp, fontWeight: FontWeight.bold), ), - SizedBox(height:24.w), + SizedBox(height: 24.w), Row( children: [ - Image.asset(R.ASSETS_MESSAGE_IC_PEOPLE_PNG,width: 40.w,height: 40.w,), + Image.asset( + R.ASSETS_MESSAGE_IC_PEOPLE_PNG, + width: 40.w, + height: 40.w, + ), SizedBox( width: 4.w, ), @@ -76,10 +82,14 @@ class _SystemMessageState extends State { ), ], ), - SizedBox(height:16.w), + SizedBox(height: 16.w), Row( children: [ - Image.asset(R.ASSETS_MESSAGE_IC_PHONE_PNG,width: 40.w,height: 40.w,), + Image.asset( + R.ASSETS_MESSAGE_IC_PHONE_PNG, + width: 40.w, + height: 40.w, + ), SizedBox( width: 4.w, ), @@ -92,10 +102,14 @@ class _SystemMessageState extends State { color: AppStyle.primaryTextColor, fontSize: 28.sp)), ], ), - SizedBox(height:16.w), + SizedBox(height: 16.w), Row( children: [ - Image.asset(R.ASSETS_MESSAGE_IC_AREA_PNG,width: 40.w,height: 40.w,), + Image.asset( + R.ASSETS_MESSAGE_IC_AREA_PNG, + width: 40.w, + height: 40.w, + ), SizedBox( width: 4.w, ), @@ -108,12 +122,12 @@ class _SystemMessageState extends State { color: AppStyle.primaryTextColor, fontSize: 28.sp)), ], ), - SizedBox(height:16.w), - Divider(height: 1.w,), + SizedBox(height: 16.w), + Divider( + height: 1.w, + ), AkuButton( - onPressed: () { - - }, + onPressed: () {}, child: Container( height: 88.w, alignment: Alignment.center,