diff --git a/assets/icons/blood_ressure.png b/assets/icons/blood_ressure.png new file mode 100644 index 00000000..87a8003d Binary files /dev/null and b/assets/icons/blood_ressure.png differ diff --git a/assets/icons/falldown.png b/assets/icons/falldown.png new file mode 100644 index 00000000..d94b4bbd Binary files /dev/null and b/assets/icons/falldown.png differ diff --git a/assets/icons/foot.png b/assets/icons/foot.png new file mode 100644 index 00000000..df65cf50 Binary files /dev/null and b/assets/icons/foot.png differ diff --git a/assets/icons/heartbeat.png b/assets/icons/heartbeat.png new file mode 100644 index 00000000..f4373d0d Binary files /dev/null and b/assets/icons/heartbeat.png differ diff --git a/assets/icons/oxygen.png b/assets/icons/oxygen.png new file mode 100644 index 00000000..175a7d2e Binary files /dev/null and b/assets/icons/oxygen.png differ diff --git a/assets/static/bracelet_header.png b/assets/static/bracelet_header.png new file mode 100644 index 00000000..fe483aec Binary files /dev/null and b/assets/static/bracelet_header.png differ diff --git a/lib/constants/application_objects.dart b/lib/constants/application_objects.dart index 9ad97c38..98fb6484 100644 --- a/lib/constants/application_objects.dart +++ b/lib/constants/application_objects.dart @@ -17,7 +17,7 @@ import 'package:aku_new_community/pages/one_alarm/widget/alarm_page.dart'; import 'package:aku_new_community/pages/opening_code_page/opening_code_page.dart'; import 'package:aku_new_community/pages/renovation_manage/new_renovation/new_renovation_page.dart'; import 'package:aku_new_community/pages/service_browse/service_browse_page.dart'; -import 'package:aku_new_community/pages/services/old_age/old_age_support_page.dart'; +import 'package:aku_new_community/pages/services/old_age/old_age_support_page_simple.dart'; import 'package:aku_new_community/pages/setting_page/settings_page.dart'; import 'package:aku_new_community/pages/surrounding_enterprises/surrounding_enterprises_page.dart'; import 'package:aku_new_community/pages/things_page/fixed_submit_page.dart'; @@ -98,7 +98,7 @@ List appObjects = [ AO('地理信息', R.ASSETS_ICONS_FUNC_DLXX_PNG, () => GeographicInformationPage()), AO('周边企业', R.ASSETS_ICONS_FUNC_ZBQY_PNG, () => SurroundingEnterprisesPage()), AO('住房说明', R.ASSETS_ICONS_FUNC_ZFSM_PNG, () => HouseIntroducePage()), - AO('智慧养老', Assets.icons.provideAged.path, () => OldAgeSupportPage()), + AO('智慧养老', Assets.icons.provideAged.path, () => OldAgeSupportPageSimple()), AO('周边服务', Assets.icons.nearbyService.path, null), AO('小蜜蜂任务', Assets.icons.beeTask.path, null), AO('自营商城', Assets.icons.shoppingMall.path, null), diff --git a/lib/gen/assets.gen.dart b/lib/gen/assets.gen.dart index 9e1d0f65..cee00ca0 100644 --- a/lib/gen/assets.gen.dart +++ b/lib/gen/assets.gen.dart @@ -157,6 +157,10 @@ class $AssetsIconsGen { /// File path: assets/icons/bee_task.png AssetGenImage get beeTask => const AssetGenImage('assets/icons/bee_task.png'); + /// File path: assets/icons/blood_ressure.png + AssetGenImage get bloodRessure => + const AssetGenImage('assets/icons/blood_ressure.png'); + /// File path: assets/icons/borrow_failure.png AssetGenImage get borrowFailure => const AssetGenImage('assets/icons/borrow_failure.png'); @@ -239,6 +243,10 @@ class $AssetsIconsGen { AssetGenImage get facility => const AssetGenImage('assets/icons/facility.png'); + /// File path: assets/icons/falldown.png + AssetGenImage get falldown => + const AssetGenImage('assets/icons/falldown.png'); + /// File path: assets/icons/file.png AssetGenImage get file => const AssetGenImage('assets/icons/file.png'); @@ -252,6 +260,9 @@ class $AssetsIconsGen { AssetGenImage get fireAlarm => const AssetGenImage('assets/icons/fire_alarm.png'); + /// File path: assets/icons/foot.png + AssetGenImage get foot => const AssetGenImage('assets/icons/foot.png'); + /// File path: assets/icons/func_all.png AssetGenImage get funcAll => const AssetGenImage('assets/icons/func_all.png'); @@ -365,6 +376,10 @@ class $AssetsIconsGen { AssetGenImage get groupbuyTabUnselected => const AssetGenImage('assets/icons/groupbuy_tab_unselected.png'); + /// File path: assets/icons/heartbeat.png + AssetGenImage get heartbeat => + const AssetGenImage('assets/icons/heartbeat.png'); + /// File path: assets/icons/hot_fire.png AssetGenImage get hotFire => const AssetGenImage('assets/icons/hot_fire.png'); @@ -625,6 +640,9 @@ class $AssetsIconsGen { AssetGenImage get nearbyService => const AssetGenImage('assets/icons/nearby_service.png'); + /// File path: assets/icons/oxygen.png + AssetGenImage get oxygen => const AssetGenImage('assets/icons/oxygen.png'); + /// File path: assets/icons/pay.png AssetGenImage get pay => const AssetGenImage('assets/icons/pay.png'); @@ -1079,6 +1097,10 @@ class $AssetsJsonGen { class $AssetsStaticGen { const $AssetsStaticGen(); + /// File path: assets/static/bracelet_header.png + AssetGenImage get braceletHeader => + const AssetGenImage('assets/static/bracelet_header.png'); + /// File path: assets/static/car_card_grey.webp AssetGenImage get carCardGrey => const AssetGenImage('assets/static/car_card_grey.webp'); diff --git a/lib/pages/services/old_age/old_age_support_page.dart b/lib/pages/services/old_age/old_age_support_page.dart index 4be8d7f2..eb54601b 100644 --- a/lib/pages/services/old_age/old_age_support_page.dart +++ b/lib/pages/services/old_age/old_age_support_page.dart @@ -1,7 +1,11 @@ +import 'package:aku_new_community/gen/assets.gen.dart'; +import 'package:aku_new_community/widget/bee_back_button.dart'; +import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:velocity_x/velocity_x.dart'; +@Deprecated('第一版带图表,暂时不做') class OldAgeSupportPage extends StatefulWidget { const OldAgeSupportPage({Key? key}) : super(key: key); @@ -12,17 +16,144 @@ class OldAgeSupportPage extends StatefulWidget { class _OldAgeSupportPageState extends State { @override Widget build(BuildContext context) { + var date = Row( + children: [ + Container( + height: 52.w, + alignment: Alignment.center, + padding: EdgeInsets.symmetric(horizontal: 24.w), + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(52.w), + color: Colors.white.withOpacity(0.25)), + child: '数据更新自 2022年1月1日 18:21:15' + .text + .size(26.sp) + .color(Colors.black.withOpacity(0.85)) + .make(), + ), + ], + ); + var data = Row( + crossAxisAlignment: CrossAxisAlignment.end, + children: [ + 10.w.widthBox, + Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + '58 %' + .text + .size(40.sp) + .color(Colors.black.withOpacity(0.85)) + .make(), + '剩余电量' + .text + .size(28.sp) + .color(Colors.black.withOpacity(0.65)) + .make(), + Row( + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + Icon( + CupertinoIcons.circle_fill, + size: 12.sp, + color: Color(0xFF57DAD2), + ), + 4.w.widthBox, + '设备 已开机' + .text + .size(22.sp) + .lineHeight(1.2) + .color(Colors.black.withOpacity(0.45)) + .make() + ], + ) + ], + ), + Spacer(), + Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + '检测天数' + .text + .size(28.sp) + .color(Colors.black.withOpacity(0.45)) + .make(), + '58' + .richText + .withTextSpanChildren([ + ' 天' + .textSpan + .size(22.sp) + .color(Colors.black.withOpacity(0.45)) + .make(), + ]) + .size(56.sp) + .color(Color(0xFF17928A)) + .make() + ], + ), + 80.w.widthBox, + Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + '报警次数' + .text + .size(28.sp) + .color(Colors.black.withOpacity(0.45)) + .make(), + '5' + .richText + .withTextSpanChildren([ + ' 次' + .textSpan + .size(22.sp) + .color(Colors.black.withOpacity(0.45)) + .make(), + ]) + .size(56.sp) + .color(Color(0xFFF5222D)) + .make() + ], + ) + ], + ); return Scaffold( appBar: AppBar( title: '智慧养老'.text.size(32.sp).black.make(), backgroundColor: Colors.transparent, + leading: BeeBackButton(), ), extendBody: true, extendBodyBehindAppBar: true, body: Container( width: double.infinity, height: double.infinity, - decoration: BoxDecoration(), + decoration: BoxDecoration( + color: Colors.white, + image: DecorationImage( + alignment: Alignment.topCenter, + image: AssetImage(Assets.static.oldAgeBack.path))), + child: SafeArea( + child: ListView( + padding: EdgeInsets.symmetric(horizontal: 32.w), + children: [ + 38.w.heightBox, + date, + 48.w.heightBox, + data, + 50.w.heightBox, + Container( + width: 331.w, + height: 204.w, + decoration: BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.circular(16.w)), + child: Column( + children: [], + ), + ), + ], + )), ), ); } diff --git a/lib/pages/services/old_age/old_age_support_page_simple.dart b/lib/pages/services/old_age/old_age_support_page_simple.dart new file mode 100644 index 00000000..c3fd6730 --- /dev/null +++ b/lib/pages/services/old_age/old_age_support_page_simple.dart @@ -0,0 +1,466 @@ +import 'package:aku_new_community/gen/assets.gen.dart'; +import 'package:aku_new_community/widget/bee_divider.dart'; +import 'package:aku_new_community/widget/bee_scaffold.dart'; +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; +import 'package:flutter_screenutil/flutter_screenutil.dart'; +import 'package:velocity_x/velocity_x.dart'; + +class OldAgeSupportPageSimple extends StatefulWidget { + const OldAgeSupportPageSimple({Key? key}) : super(key: key); + + @override + _OldAgeSupportPageSimpleState createState() => + _OldAgeSupportPageSimpleState(); +} + +class _OldAgeSupportPageSimpleState extends State { + @override + Widget build(BuildContext context) { + var open = Row( + crossAxisAlignment: CrossAxisAlignment.center, + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Icon( + CupertinoIcons.circle_fill, + size: 16.w, + color: Color(0xFF57DAD2), + ), + 4.w.widthBox, + '设备 已开机' + .text + .size(26.sp) + .lineHeight(1.2) + .color(Colors.black.withOpacity(0.45)) + .make(), + ], + ); + return BeeScaffold( + title: 'X5手环', + extendBody: true, + body: Container( + width: double.infinity, + height: double.infinity, + decoration: BoxDecoration( + image: DecorationImage( + alignment: Alignment.topCenter, + image: AssetImage(Assets.static.braceletHeader.path)), + gradient: LinearGradient( + begin: Alignment.topCenter, + end: Alignment.bottomCenter, + colors: [Colors.white, Color(0xFFC0E5DC).withOpacity(0.355)]), + ), + child: ListView( + padding: EdgeInsets.symmetric(horizontal: 32.w), + children: [ + 550.w.heightBox, + open, + 16.w.heightBox, + Row( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + '数据更新自 2022年1月1日 18:21:15' + .text + .size(22.sp) + .color(Colors.black.withOpacity(0.25)) + .make(), + 40.w.heightBox, + ], + ), + 40.w.heightBox, + overview(), + 24.w.heightBox, + statusCard(), + 40.w.heightBox, + bottomCard(), + ], + ), + ), + ); + } + + Container bottomCard() { + var left = Column( + children: [ + Row( + children: [ + Assets.icons.bloodRessure.image(width: 40.w, height: 40.w), + '血压监督' + .text + .size(26.sp) + .bold + .color(Colors.black.withOpacity(0.85)) + .make(), + ], + ) + ], + ); + var mid = Row( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + '141' + .richText + .withTextSpanChildren([]) + .size(48.sp) + .bold + .color(Colors.red) + .make(), + 8.w.widthBox, + Column( + crossAxisAlignment: CrossAxisAlignment.end, + children: [ + 16.w.heightBox, + ' mmhg' + .text + .size(22.sp) + .color(Colors.black.withOpacity(0.25)) + .make(), + Spacer(), + '收缩压'.text.size(22.sp).color(Colors.black.withOpacity(0.65)).make(), + Spacer(), + '90-139' + .text + .size(20.sp) + .color(Colors.black.withOpacity(0.25)) + .make(), + ], + ), + ], + ); + var right = Row( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + '86' + .richText + .withTextSpanChildren([]) + .size(48.sp) + .bold + .color(Color(0xFF37C6BD)) + .make(), + 8.w.widthBox, + Column( + crossAxisAlignment: CrossAxisAlignment.end, + children: [ + 16.w.heightBox, + ' mmhg' + .text + .size(22.sp) + .color(Colors.black.withOpacity(0.25)) + .make(), + Spacer(), + '舒张压'.text.size(22.sp).color(Colors.black.withOpacity(0.65)).make(), + Spacer(), + '60-89' + .text + .size(20.sp) + .color(Colors.black.withOpacity(0.25)) + .make(), + ], + ), + ], + ); + return Container( + width: double.infinity, + height: 164.w, + decoration: BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.circular(16.w), + ), + padding: EdgeInsets.symmetric(vertical: 24.w), + child: Row( + children: [ + 32.w.widthBox, + left, + Spacer(), + mid, + 32.w.widthBox, + right, + 24.w.widthBox, + ], + ), + ); + } + + Column statusCard() { + var heart = Container( + width: 331.w, + height: 204.w, + padding: EdgeInsets.all(24.w), + decoration: BoxDecoration( + color: Colors.white, borderRadius: BorderRadius.circular(16.w)), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Row( + children: [ + Assets.icons.heartbeat.image(width: 40.w, height: 40.w), + 8.w.widthBox, + '心率' + .text + .size(26.sp) + .bold + .color(Colors.black.withOpacity(0.85)) + .make(), + ], + ), + Spacer(), + '141' + .richText + .withTextSpanChildren([ + ' 次/分' + .textSpan + .size(22.sp) + .color(Colors.black.withOpacity(0.25)) + .make() + ]) + .size(56.sp) + .bold + .color(Colors.red) + .make(), + Spacer(), + '正常为60-100次/分' + .text + .size(20.sp) + .color(Colors.black.withOpacity(0.25)) + .make() + ], + ), + ); + var fallDown = Container( + width: 331.w, + height: 204.w, + padding: EdgeInsets.all(24.w), + decoration: BoxDecoration( + color: Colors.white, borderRadius: BorderRadius.circular(16.w)), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Row( + children: [ + Assets.icons.falldown.image(width: 40.w, height: 40.w), + 8.w.widthBox, + '跌倒次数' + .text + .size(26.sp) + .bold + .color(Colors.black.withOpacity(0.85)) + .make(), + ], + ), + Spacer(), + '3' + .richText + .withTextSpanChildren([ + ' 次' + .textSpan + .size(22.sp) + .color(Colors.black.withOpacity(0.25)) + .make() + ]) + .size(56.sp) + .bold + .color(Colors.red) + .make(), + Spacer(), + '如跌倒会报警至物业后台' + .text + .size(20.sp) + .color(Colors.black.withOpacity(0.25)) + .make() + ], + ), + ); + var footSteps = Container( + width: 331.w, + height: 176.w, + padding: EdgeInsets.all(24.w), + decoration: BoxDecoration( + color: Colors.white, borderRadius: BorderRadius.circular(16.w)), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Row( + children: [ + Assets.icons.foot.image(width: 40.w, height: 40.w), + 8.w.widthBox, + '今日步数' + .text + .size(26.sp) + .bold + .color(Colors.black.withOpacity(0.85)) + .make(), + ], + ), + Spacer(), + '1042' + .richText + .withTextSpanChildren([ + ' 步' + .textSpan + .size(22.sp) + .color(Colors.black.withOpacity(0.25)) + .make() + ]) + .size(56.sp) + .bold + .color(Color(0xFF37C6BD)) + .make(), + ], + ), + ); + var blood = Container( + width: 331.w, + height: 176.w, + padding: EdgeInsets.all(24.w), + decoration: BoxDecoration( + color: Colors.white, borderRadius: BorderRadius.circular(16.w)), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Row( + children: [ + Assets.icons.oxygen.image(width: 40.w, height: 40.w), + 8.w.widthBox, + '血氧饱和度' + .text + .size(26.sp) + .bold + .color(Colors.black.withOpacity(0.85)) + .make(), + ], + ), + Spacer(), + Row( + children: [ + '98' + .richText + .withTextSpanChildren([ + ' %' + .textSpan + .size(22.sp) + .color(Colors.black.withOpacity(0.25)) + .make() + ]) + .size(56.sp) + .bold + .color(Color(0xFF37C6BD)) + .make(), + Spacer(), + '正常为95%以上' + .text + .size(22.sp) + .color(Colors.black.withOpacity(0.25)) + .make(), + ], + ), + ], + ), + ); + return Column( + children: [ + Row( + children: [heart, 24.w.widthBox, fallDown], + ), + 40.w.heightBox, + Row( + children: [footSteps, 24.w.widthBox, blood], + ) + ], + ); + } + + Container overview() { + var left = Expanded( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + '剩余电量'.text.size(28.sp).color(Colors.black.withOpacity(0.65)).make(), + '58' + .richText + .withTextSpanChildren([ + ' %' + .textSpan + .size(22.sp) + .color(Colors.black.withOpacity(0.25)) + .make(), + ]) + .size(56.sp) + .bold + .color(Colors.black.withOpacity(0.85)) + .make(), + ], + ), + ); + var mid = Expanded( + child: Center( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + '检测天数' + .text + .size(28.sp) + .color(Colors.black.withOpacity(0.45)) + .make(), + '58' + .richText + .withTextSpanChildren([ + ' 天' + .textSpan + .size(22.sp) + .color(Colors.black.withOpacity(0.45)) + .make(), + ]) + .size(56.sp) + .color(Color(0xFF17928A)) + .make() + ], + ), + ), + ); + var right = Expanded( + child: Center( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + '报警次数' + .text + .size(28.sp) + .color(Colors.black.withOpacity(0.45)) + .make(), + '5' + .richText + .withTextSpanChildren([ + ' 次' + .textSpan + .size(22.sp) + .color(Colors.black.withOpacity(0.45)) + .make(), + ]) + .size(56.sp) + .color(Color(0xFFF5222D)) + .make() + ], + ), + ), + ); + return Container( + width: 686.w, + height: 160.w, + padding: EdgeInsets.symmetric(vertical: 26.w), + decoration: BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.circular(16.w), + ), + child: Row( + children: [ + 40.w.widthBox, + left, + BeeDivider.vertical(), + mid, + BeeDivider.vertical(), + right + ], + ), + ); + } +} diff --git a/lib/widget/bee_scaffold.dart b/lib/widget/bee_scaffold.dart index 4a6e21df..932a77e3 100644 --- a/lib/widget/bee_scaffold.dart +++ b/lib/widget/bee_scaffold.dart @@ -19,6 +19,7 @@ class BeeScaffold extends StatelessWidget { final PreferredSizeWidget? appBarBottom; final FloatingActionButton? fab; final double? titleSpacing; + final bool extendBody; final SystemUiOverlayStyle systemStyle; @@ -35,6 +36,7 @@ class BeeScaffold extends StatelessWidget { this.fab, this.titleSpacing, this.systemStyle = SystemStyle.initial, + this.extendBody = false, }) : super(key: key); BeeScaffold.white({ @@ -49,6 +51,7 @@ class BeeScaffold extends StatelessWidget { this.fab, this.titleSpacing, this.systemStyle = SystemStyle.initial, + this.extendBody = false, }) : this.bodyColor = Colors.white, super(key: key); @@ -64,7 +67,7 @@ class BeeScaffold extends StatelessWidget { Widget? appBar; if (title != null) appBar = AppBar( - backgroundColor: bgColor, + backgroundColor: extendBody ? Colors.transparent : bgColor, title: _titleWidget, leading: leading ?? BeeBackButton(), actions: actions, @@ -77,6 +80,8 @@ class BeeScaffold extends StatelessWidget { child: Scaffold( backgroundColor: bodyColor, appBar: appBar as PreferredSizeWidget?, + extendBodyBehindAppBar: extendBody, + extendBody: extendBody, body: body, bottomNavigationBar: bottomNavi, floatingActionButton: fab,