From 9348ad52ac5f9cee6a2ffc6c1d6ef5d06bcf4f18 Mon Sep 17 00:00:00 2001 From: zhang <494089941@qq.com> Date: Mon, 2 Nov 2020 11:45:59 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B6=88=E6=81=AF=E9=A1=B5=E9=9D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/ui/home/messages/message.dart | 78 ++++++++++++ lib/ui/home/messages/system_message.dart | 150 +++++++++++++++++++++++ lib/ui/home/system_message.dart | 49 -------- 3 files changed, 228 insertions(+), 49 deletions(-) create mode 100644 lib/ui/home/messages/message.dart create mode 100644 lib/ui/home/messages/system_message.dart delete mode 100644 lib/ui/home/system_message.dart diff --git a/lib/ui/home/messages/message.dart b/lib/ui/home/messages/message.dart new file mode 100644 index 0000000..4a5dcbc --- /dev/null +++ b/lib/ui/home/messages/message.dart @@ -0,0 +1,78 @@ +import 'package:aku_community_manager/style/app_style.dart'; +import 'package:aku_community_manager/ui/widgets/common/aku_scaffold.dart'; +import 'package:flutter/material.dart'; +import 'package:flutter_screenutil/flutter_screenutil.dart'; +class Message extends StatefulWidget { + Message({Key key}) : super(key: key); + + @override + _MessageState createState() => _MessageState(); +} + +class _MessageState extends State { + + Widget _messageType(String type){ + switch (type) { + case'系统消息' : + return Container( + width: 88.w,height: 88.w, + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(44.w), + gradient: LinearGradient(begin: Alignment.topCenter,end: Alignment.bottomCenter,colors: [ + Color(0xFFFFDE9A), + Color(0xFFFFB00A), + ]), + ), + child: Icon(Icons.message,size:66.w),); + break; + case '评论消息': + return Container( + width: 88.w,height: 88.w, + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(44.w), + gradient: LinearGradient(begin: Alignment.topCenter,end: Alignment.bottomCenter,colors: [ + Color(0xFF81D1FF), + Color(0xFF1792FF), + ]), + ), + child: Icon(Icons.message_sharp,size:66.w),); + default: + } + } + + Widget _messageList(String date,String type){ + return Container( + padding: EdgeInsets.only(top:24.w,left:32.w,), + child: Row( + children:[ + + SizedBox(width: 24.w,), + Column( + children: [ + Row( + children: [ + Text('系统通知',style: AppStyle().primaryStyle,), + Spacer(), + Text(date,style:AppStyle().minorStyle), + + ], + ), + ], + ), + ], + ), + ); + } + @override + Widget build(BuildContext context) { + return AkuScaffold( + title: '消息', + titleStyle: AppStyle().barTitleStyle, + body: ListView( + padding: EdgeInsets.only(top:16.w), + children: [ + + ],), + ); + } +} \ No newline at end of file diff --git a/lib/ui/home/messages/system_message.dart b/lib/ui/home/messages/system_message.dart new file mode 100644 index 0000000..409da8e --- /dev/null +++ b/lib/ui/home/messages/system_message.dart @@ -0,0 +1,150 @@ +import 'package:aku_community_manager/style/app_style.dart'; +import 'package:aku_ui/aku_ui.dart'; +import 'package:flutter/material.dart'; +import 'package:flutter_screenutil/flutter_screenutil.dart'; + +class SystemMessage extends StatefulWidget { + SystemMessage({Key key}) : super(key: key); + + @override + _SystemMessageState createState() => _SystemMessageState(); +} + +class _SystemMessageState extends State { + Widget _messageList(String date, String name, String phone, String area) { + 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.all(24.w), + color: Color(0xFFFFFFFF), + child: Column( + children: [ + Row(children: [ + Icon( + Icons.point_of_sale, + size: 16.w, + ), + SizedBox( + width: 16.w, + ), + Text( + '系统通知', + style: TextStyle( + color: AppStyle.primaryTextColor, + fontSize: 32.sp, + fontWeight: FontWeight.w600), + ), + Spacer(), + ]), + Text( + '你有一条新的报事报修,请立即处理', + style: TextStyle( + color: AppStyle.primaryTextColor, + fontSize: 28.sp, + fontWeight: FontWeight.bold), + ), + Row( + children: [ + Icon(Icons.contact_page, size: 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), + ), + ], + ), + Row( + children: [ + Icon( + Icons.phone, + size: 40.w, + ), + SizedBox( + width: 4.w, + ), + Text('联系电话', + style: TextStyle( + color: AppStyle.minorTextColor, fontSize: 28.sp)), + Spacer(), + Text(phone, + style: TextStyle( + color: AppStyle.primaryTextColor, fontSize: 28.sp)), + ], + ), + Row( + children: [ + Icon( + Icons.airplanemode_active, + size: 40.w, + ), + SizedBox( + width: 4.w, + ), + Text('报修区域', + style: TextStyle( + color: AppStyle.minorTextColor, fontSize: 28.sp)), + Spacer(), + Text(area, + style: TextStyle( + color: AppStyle.primaryTextColor, fontSize: 28.sp)), + ], + ), + Divider(), + AkuButton( + child: Container( + 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 Scaffold( + appBar: AppBar( + title: Text('消息', style: AppStyle().barTitleStyle), + ), + body: ListView( + padding: EdgeInsets.all(32.w), + children: [ + _messageList('2020-10-23 10:00', '杨建', '17867665666', '共区'), + _messageList('2020-10-22 10:00', '刘能', '17855823545', '共区'), + ], + ), + ); + } +} diff --git a/lib/ui/home/system_message.dart b/lib/ui/home/system_message.dart deleted file mode 100644 index a2ee2ec..0000000 --- a/lib/ui/home/system_message.dart +++ /dev/null @@ -1,49 +0,0 @@ -import 'package:aku_community_manager/style/app_style.dart'; -import 'package:flutter/material.dart'; -import 'package:flutter_screenutil/flutter_screenutil.dart'; -class SystemMessage extends StatefulWidget { - SystemMessage({Key key}) : super(key: key); - - @override - _SystemMessageState createState() => _SystemMessageState(); -} - -class _SystemMessageState extends State { - Widget _messageList(String date){ - 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.all(24.w), - color: Color(0xFFFFFFFF), - child: Column( - children: [ - Row( - children:[ Icon(Icons.point_of_sale,size: 16.w,), - SizedBox(width: 16.w,), - Text('系统通知',style: TextStyle(color:AppStyle.primaryTextColor,fontSize:32.sp,fontWeight: FontWeight.w600),), - ] - ), - ], - ), - ), - ], - ); - } - @override - Widget build(BuildContext context) { - return Scaffold( - appBar: AppBar( - title:Text('消息',style:AppStyle().barTitleStyle), - ), - body:ListView(children: [ - _messageList('2020-10-23 10:00') - ],) , - ); - } -} \ No newline at end of file