diff --git a/assets/static_temp/f1.webp b/assets/static_temp/f1.webp new file mode 100644 index 0000000..b879037 Binary files /dev/null and b/assets/static_temp/f1.webp differ diff --git a/assets/static_temp/f2.webp b/assets/static_temp/f2.webp new file mode 100644 index 0000000..06f8f44 Binary files /dev/null and b/assets/static_temp/f2.webp differ diff --git a/assets/static_temp/f3.webp b/assets/static_temp/f3.webp new file mode 100644 index 0000000..6538003 Binary files /dev/null and b/assets/static_temp/f3.webp differ diff --git a/assets/static_temp/f4.webp b/assets/static_temp/f4.webp new file mode 100644 index 0000000..5771768 Binary files /dev/null and b/assets/static_temp/f4.webp differ diff --git a/assets/static_temp/f5.webp b/assets/static_temp/f5.webp new file mode 100644 index 0000000..7fea546 Binary files /dev/null and b/assets/static_temp/f5.webp differ diff --git a/commands/gen_webp.sh b/commands/gen_webp.sh new file mode 100755 index 0000000..72af5f4 --- /dev/null +++ b/commands/gen_webp.sh @@ -0,0 +1 @@ +cwebp -q 60 -resize 1000 0 $1 -o ./assets/static_temp/$2 \ No newline at end of file diff --git a/lib/ui/sub_pages/activity_manager/activity_detail_page.dart b/lib/ui/sub_pages/activity_manager/activity_detail_page.dart new file mode 100644 index 0000000..7566dca --- /dev/null +++ b/lib/ui/sub_pages/activity_manager/activity_detail_page.dart @@ -0,0 +1,107 @@ +import 'package:aku_community_manager/style/app_style.dart'; +import 'package:aku_community_manager/tools/widget_tool.dart'; +import 'package:aku_community_manager/ui/sub_pages/activity_manager/fake_activity_model.dart'; +import 'package:aku_community_manager/ui/widgets/common/aku_scaffold.dart'; +import 'package:common_utils/common_utils.dart'; +import 'package:flutter/material.dart'; +import 'package:aku_community_manager/tools/screen_tool.dart'; + +class ActivityDetailPage extends StatefulWidget { + final FakeActivityManagerModel model; + ActivityDetailPage({Key key, @required this.model}) : super(key: key); + + @override + _ActivityDetailPageState createState() => _ActivityDetailPageState(); +} + +class _ActivityDetailPageState extends State { + static const String format = 'yyyy年MM月dd日HH:mm'; + String get startDate => + DateUtil.formatDate(widget.model.dateStart, format: format); + String get endDate => + DateUtil.formatDate(widget.model.dateEnd, format: format); + String get checkInDate => + DateUtil.formatDate(widget.model.checkInDate, format: format); + + @override + Widget build(BuildContext context) { + return AkuScaffold( + title: '活动详情', + body: ListView( + children: [ + Hero( + tag: widget.model.title, + child: Image.asset( + widget.model.imgPath, + height: 228.w, + fit: BoxFit.cover, + ), + ), + Padding( + padding: EdgeInsets.symmetric( + vertical: 24.w, + horizontal: 32.w, + ), + child: Column( + mainAxisSize: MainAxisSize.min, + children: [ + Text( + widget.model.title, + style: TextStyle( + color: AppStyle.primaryTextColor, + fontSize: 36.sp, + fontWeight: FontWeight.bold, + ), + ), + AkuBox.h(16), + Text( + widget.model.article, + style: TextStyle( + color: AppStyle.primaryTextColor, + fontSize: 28.sp, + ), + ), + AkuBox.h(40), + _buildTile('开始时间', startDate), + _buildTile('结束时间', endDate), + _buildTile('地点', widget.model.location), + _buildTile('参与人数', widget.model.people), + _buildTile('报名截止', checkInDate), + ], + ), + ), + ], + ), + ); + } + + _buildTile(String title, String subTitle) { + return Padding( + padding: EdgeInsets.symmetric(vertical: 6.w), + child: Row( + children: [ + SizedBox( + width: 164.w, + child: Text( + title, + style: TextStyle( + color: AppStyle.primaryTextColor, + fontSize: 28.w, + ), + ), + ), + Expanded( + child: Text( + subTitle, + style: TextStyle( + color: AppStyle.primaryTextColor, + fontSize: 28.w, + fontWeight: FontWeight.bold, + ), + ), + ), + ], + ), + ); + } +} diff --git a/lib/ui/sub_pages/activity_manager/activity_manager_card.dart b/lib/ui/sub_pages/activity_manager/activity_manager_card.dart new file mode 100644 index 0000000..37e44c1 --- /dev/null +++ b/lib/ui/sub_pages/activity_manager/activity_manager_card.dart @@ -0,0 +1,113 @@ +import 'package:aku_community_manager/style/app_style.dart'; +import 'package:aku_community_manager/tools/widget_tool.dart'; +import 'package:aku_community_manager/ui/sub_pages/activity_manager/activity_detail_page.dart'; +import 'package:aku_community_manager/ui/sub_pages/activity_manager/fake_activity_model.dart'; +import 'package:common_utils/common_utils.dart'; +import 'package:flutter/material.dart'; +import 'package:aku_community_manager/tools/screen_tool.dart'; +import 'package:get/route_manager.dart'; + +class ActivityManagerCard extends StatelessWidget { + String get startDate => + DateUtil.formatDate(model.dateStart, format: 'yyyy-MM-dd'); + + String get endDate => + DateUtil.formatDate(model.dateEnd, format: 'yyyy-MM-dd'); + + final FakeActivityManagerModel model; + const ActivityManagerCard({Key key, @required this.model}) : super(key: key); + + @override + Widget build(BuildContext context) { + return Container( + margin: EdgeInsets.symmetric(vertical: 24.w, horizontal: 32.w), + child: GestureDetector( + onTap: () { + Get.to(ActivityDetailPage(model: model)); + }, + child: Column( + mainAxisSize: MainAxisSize.min, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + ClipRRect( + borderRadius: BorderRadius.vertical(top: Radius.circular(8.w)), + child: Container( + height: 228.w, + width: double.infinity, + child: Hero( + tag: model.title, + child: Image.asset( + model.imgPath, + fit: BoxFit.cover, + ), + ), + ), + ), + Container( + padding: EdgeInsets.all(24.w), + child: Column( + mainAxisSize: MainAxisSize.min, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + model.title, + style: TextStyle( + color: AppStyle.primaryTextColor, + fontSize: 28.sp, + fontWeight: FontWeight.bold, + ), + ), + AkuBox.h(12), + _buildTile('主办方:', model.hostName), + _buildTile('地点:', model.location), + _buildTile('报名时间:', '$startDate\至$endDate'), + ], + ), + ), + ], + ), + ), + decoration: BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.circular(8.w), + border: Border.all( + color: Color(0xFFE8E8E8), + width: 2.w, + ), + boxShadow: [ + BoxShadow( + offset: Offset(0, 2.w), + blurRadius: 20.w, + color: Color(0xFFEFEFEF), + ) + ], + ), + ); + } + + _buildTile(String title, String subTitle) { + return Row( + children: [ + SizedBox( + width: 120.w, + child: Text( + title, + style: TextStyle( + color: AppStyle.minorTextColor, + fontSize: 24.sp, + ), + ), + ), + Expanded( + child: Text( + subTitle, + style: TextStyle( + color: AppStyle.primaryTextColor, + fontSize: 24.sp, + ), + ), + ), + ], + ); + } +} diff --git a/lib/ui/sub_pages/activity_manager/activity_manager_page.dart b/lib/ui/sub_pages/activity_manager/activity_manager_page.dart index 0d9cd65..b9d4605 100644 --- a/lib/ui/sub_pages/activity_manager/activity_manager_page.dart +++ b/lib/ui/sub_pages/activity_manager/activity_manager_page.dart @@ -1,3 +1,5 @@ +import 'package:aku_community_manager/ui/sub_pages/activity_manager/activity_manager_card.dart'; +import 'package:aku_community_manager/ui/sub_pages/activity_manager/fake_activity_model.dart'; import 'package:aku_community_manager/ui/widgets/common/aku_scaffold.dart'; import 'package:flutter/material.dart'; @@ -13,10 +15,12 @@ class _ActivityManagerPageState extends State { Widget build(BuildContext context) { return AkuScaffold( title: '活动管理', - body: ListView( - children: [ - Text('a'), - ], + body: ListView.builder( + itemBuilder: (context, index) { + final model = fakeAcitivityManagerModels[index]; + return ActivityManagerCard(model: model); + }, + itemCount: fakeAcitivityManagerModels.length, ), ); } diff --git a/lib/ui/sub_pages/activity_manager/fake_activity_model.dart b/lib/ui/sub_pages/activity_manager/fake_activity_model.dart new file mode 100644 index 0000000..928686a --- /dev/null +++ b/lib/ui/sub_pages/activity_manager/fake_activity_model.dart @@ -0,0 +1,57 @@ +import 'package:aku_community_manager/const/resource.dart'; + +class FakeActivityManagerModel { + String title; + String imgPath; + String location; + String hostName; + + String article; + String people; + + DateTime dateStart; + DateTime dateEnd; + DateTime checkInDate; + FakeActivityManagerModel({ + this.title, + this.imgPath, + this.location, + this.hostName, + this.article, + this.people, + this.dateStart, + this.dateEnd, + this.checkInDate, + }); +} + +List fakeAcitivityManagerModels = [ + FakeActivityManagerModel( + title: '华茂悦峰社区第三届六一亲子活动', + imgPath: R.ASSETS_STATIC_TEMP_F1_WEBP, + location: '中央活动区', + hostName: '深圳万科物业有限公司', + article: + '''为丰富文化体育生活,不断增进小区凝聚力和人与人之间的协作能力,市委政法委机关党办、机关工会联合举办“我参与、我健康、我快乐”系列主题活动。 + 鞋底擦地的沙沙声,拉绳时的呼号声,乘着悠悠暖风奏成一曲夏的交响乐。汗水落地迸溅的瞬间,队员们奋力拼搏的身姿,与融融暖阳,绘成一幅夏的长卷。 + ''', + people: '不限', + dateStart: DateTime(2020, 4, 12, 12, 0), + dateEnd: DateTime(2020, 4, 15, 12, 0), + checkInDate: DateTime(2020, 4, 13, 12, 0), + ), + FakeActivityManagerModel( + title: '宁化社区第一届煎蛋比赛报名开始', + imgPath: R.ASSETS_STATIC_TEMP_F5_WEBP, + location: '中央活动区', + hostName: '深圳万科物业有限公司', + article: + '''为丰富文化体育生活,不断增进小区凝聚力和人与人之间的协作能力,市委政法委机关党办、机关工会联合举办“我参与、我健康、我快乐”系列主题活动。 + 鞋底擦地的沙沙声,拉绳时的呼号声,乘着悠悠暖风奏成一曲夏的交响乐。汗水落地迸溅的瞬间,队员们奋力拼搏的身姿,与融融暖阳,绘成一幅夏的长卷。 + ''', + people: '不限', + dateStart: DateTime(2020, 4, 12, 12, 0), + dateEnd: DateTime(2020, 4, 15, 12, 0), + checkInDate: DateTime(2020, 4, 13, 12, 0), + ), +]; diff --git a/pubspec.yaml b/pubspec.yaml index 8dab04f..24f0812 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -70,6 +70,8 @@ flutter: - assets/home/ - assets/user/ - assets/message/ + + - assets/static_temp/ # To add assets to your application, add an assets section, like this: # assets: # - images/a_dot_burr.jpeg