diff --git a/lib/modules/meeting/controllers/meeting_mine_controller.dart b/lib/modules/meeting/controllers/meeting_mine_controller.dart index 2e5470ea3..907ae480e 100644 --- a/lib/modules/meeting/controllers/meeting_mine_controller.dart +++ b/lib/modules/meeting/controllers/meeting_mine_controller.dart @@ -1,3 +1,26 @@ import 'package:get/get.dart'; -class MeetingMineController extends GetxController {} +import 'meeting_home_controller.dart'; + +class MeetingMineController extends GetxController { + final _controller = Get.find(); + + RxInt days = 0.obs; + RxInt numberFiles = 0.obs; + RxDouble hourage = 0.0.obs; + RxInt continuousDays = 0.obs; + RxInt maxNumberFiles = 0.obs; + RxDouble maxHourage = 0.0.obs; + + @override + void onInit() { + super.onInit(); + _getStatistics(); + } + + void _getStatistics() { + numberFiles.value = _controller.originalDataList.length; + + for (var element in _controller.originalDataList) {} + } +} diff --git a/lib/modules/meeting/views/bottomSheet/statistics_bottom_sheet.dart b/lib/modules/meeting/views/bottomSheet/statistics_bottom_sheet.dart new file mode 100644 index 000000000..667bf370a --- /dev/null +++ b/lib/modules/meeting/views/bottomSheet/statistics_bottom_sheet.dart @@ -0,0 +1,293 @@ +import 'package:flutter/material.dart'; +import 'package:flutter_screenutil/flutter_screenutil.dart'; +import 'package:get/get.dart'; + +import '../../controllers/meeting_mine_controller.dart'; + +class StatisticsBottomSheet extends StatefulWidget { + const StatisticsBottomSheet({super.key}); + + @override + State createState() => _StatisticsBottomSheetState(); +} + +class _StatisticsBottomSheetState extends State { + final _mineController = Get.find(); + + @override + Widget build(BuildContext context) { + return Stack( + children: [ + GestureDetector( + onTap: () => Get.back(), + behavior: HitTestBehavior.translucent, + child: SizedBox( + width: 1.sw, + height: 1.sh, + ), + ), + Column( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Container( + padding: EdgeInsets.symmetric(horizontal: 15.w, vertical: 20.w), + margin: EdgeInsets.symmetric(horizontal: 10.w), + decoration: BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.circular(16.w), + image: const DecorationImage( + alignment: Alignment.topCenter, + image: AssetImage('assets/images/mine-background.png'), + fit: BoxFit.fitWidth, + ), + ), + child: Column( + children: [ + Container( + width: 50.w, + height: 50.w, + margin: EdgeInsets.only(bottom: 10.w), + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(50.w), + image: const DecorationImage( + image: NetworkImage( + 'https://pic8.iqiyipic.com/image/20250403/ed/a7/a_100013977_m_601_m75_318_424.avif'), + fit: BoxFit.cover, + ), + ), + ), + Text( + 'tianming liu', + style: TextStyle( + color: Colors.black87, + fontSize: 20.sp, + fontWeight: FontWeight.bold, + ), + ), + Padding( + padding: EdgeInsets.symmetric(vertical: 20.w), + child: Wrap( + spacing: 5.w, + runSpacing: 5.w, + children: [ + _item( + '天', + '${_mineController.days.value}', + Colors.amber, + ), + _item( + '文件', + '${_mineController.numberFiles.value}', + Colors.blueGrey, + ), + _item( + '小时', + '${_mineController.hourage.value}', + Colors.cyan, + ), + _item( + '连续录音天数', + '${_mineController.continuousDays.value}', + Colors.deepOrangeAccent, + ), + _item( + '单日最多录音', + '${_mineController.maxNumberFiles.value}', + Colors.teal, + ), + _item( + '单日最长录音', + '${_mineController.maxHourage.value}', + Colors.pink, + ), + ], + ), + ), + Row( + children: [ + Text( + '过去12个月的热力图', + style: TextStyle( + color: Colors.grey, + fontSize: 12.sp, + ), + ), + const Spacer(), + Text( + '较冷', + style: TextStyle( + color: Colors.grey, + fontSize: 12.sp, + ), + ), + 5.horizontalSpace, + Container( + width: 10.w, + height: 10.w, + margin: EdgeInsets.symmetric(horizontal: 1.w), + decoration: BoxDecoration( + color: Colors.grey[200], + borderRadius: BorderRadius.circular(2.w), + ), + ), + Container( + width: 10.w, + height: 10.w, + margin: EdgeInsets.symmetric(horizontal: 1.w), + decoration: BoxDecoration( + color: Colors.red[100], + borderRadius: BorderRadius.circular(2.w), + ), + ), + Container( + width: 10.w, + height: 10.w, + margin: EdgeInsets.symmetric(horizontal: 1.w), + decoration: BoxDecoration( + color: Colors.red, + borderRadius: BorderRadius.circular(2.w), + ), + ), + 5.horizontalSpace, + Text( + '较热', + style: TextStyle( + color: Colors.grey, + fontSize: 12.sp, + ), + ), + ], + ), + Container( + height: 50.w, + alignment: Alignment.center, + child: GridView.builder( + shrinkWrap: true, + physics: const NeverScrollableScrollPhysics(), + gridDelegate: SliverGridDelegateWithFixedCrossAxisCount( + crossAxisCount: 52, + mainAxisSpacing: 1.w, + crossAxisSpacing: 1.w, + ), + itemCount: 364, + itemBuilder: (BuildContext context, int index) { + return Container( + color: Colors.grey[200], + ); + }, + ), + ), + DefaultTextStyle( + style: TextStyle( + color: Colors.grey, + fontSize: 10.sp, + ), + child: const Row( + mainAxisAlignment: MainAxisAlignment.spaceAround, + children: [ + Text('Jan'), + Text('Feb'), + Text('Mar'), + Text('Apr'), + Text('May'), + Text('Jun'), + Text('Jul'), + Text('Aug'), + Text('Sep'), + Text('Oct'), + Text('Nov'), + Text('Dec'), + ], + ), + ), + ], + ), + ), + SizedBox(height: 10.w), + Padding( + padding: EdgeInsets.symmetric(horizontal: 10.w), + child: Row( + children: [ + _button(Icons.share, '分享图片', Colors.deepOrange, () {}), + 10.horizontalSpace, + _button(Icons.download, '保存图片', Colors.cyan, () {}), + ], + ), + ), + ], + ), + ], + ); + } + + Widget _item(String unit, String amount, Color color) { + return Container( + width: 105.w, + height: 70.w, + padding: EdgeInsets.all(10.w), + decoration: BoxDecoration( + color: color.withOpacity(0.2), + borderRadius: BorderRadius.circular(8.w), + ), + child: Column( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + unit, + style: TextStyle( + color: Colors.grey, + fontSize: 12.sp, + ), + ), + Text( + amount, + style: TextStyle( + color: Colors.black87, + fontSize: 18.sp, + fontWeight: FontWeight.bold, + ), + ), + ], + ), + ); + } + + Widget _button(IconData icon, String title, Color color, Function() onTap) { + return Expanded( + child: GestureDetector( + onTap: onTap, + child: Container( + decoration: BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.circular(16.w), + ), + child: Container( + height: 60.w, + decoration: BoxDecoration( + color: color.withOpacity(0.1), + borderRadius: BorderRadius.circular(16.w), + ), + child: Row( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Icon( + icon, + size: 25.w, + ), + 5.horizontalSpace, + Text( + title, + style: TextStyle( + color: Colors.black87, + fontSize: 16.sp, + ), + ), + ], + ), + ), + ), + ), + ); + } +} diff --git a/lib/modules/meeting/views/meeting_mine_view.dart b/lib/modules/meeting/views/meeting_mine_view.dart index 77c9d0f43..ae0337965 100644 --- a/lib/modules/meeting/views/meeting_mine_view.dart +++ b/lib/modules/meeting/views/meeting_mine_view.dart @@ -5,14 +5,12 @@ import 'dart:io'; import '../../../routes/app_routes.dart'; import '../../profile/controllers/profile_controller.dart'; -class MeetingMineView extends StatefulWidget { - const MeetingMineView({super.key}); +import '../controllers/meeting_mine_controller.dart'; +import 'bottomSheet/statistics_bottom_sheet.dart'; - @override - State createState() => _MeetingMineViewState(); -} +class MeetingMineView extends GetView { + const MeetingMineView({super.key}); -class _MeetingMineViewState extends State { @override Widget build(BuildContext context) { return Scaffold( @@ -31,6 +29,7 @@ class _MeetingMineViewState extends State { children: [ _head(), _statistics(), + _member(), _box([ _item( Icons.article_outlined, @@ -155,45 +154,67 @@ class _MeetingMineViewState extends State { } Widget _statistics() { - return Container( - padding: EdgeInsets.all(8.w), - margin: EdgeInsets.only(bottom: 15.w), - decoration: BoxDecoration( - color: Colors.white, - borderRadius: BorderRadius.circular(16.w), - ), - child: Column( - children: [ - Row( + return GestureDetector( + onTap: () { + Get.bottomSheet( + const StatisticsBottomSheet(), + isScrollControlled: true, + ); + }, + child: Container( + padding: EdgeInsets.all(8.w), + margin: EdgeInsets.only(bottom: 15.w), + decoration: BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.circular(16.w), + ), + child: Obx( + () => Column( children: [ - _statisticsItem('2', '天', Colors.lime), - _statisticsItem('4', '文件', Colors.lightGreen), - _statisticsItem('1.5', '小时', Colors.blueGrey), - ], - ), - Container( - height: 80.w, - padding: EdgeInsets.symmetric(horizontal: 2.w), - margin: EdgeInsets.only(top: 8.w, bottom: 2.w), - child: GridView.builder( - scrollDirection: Axis.horizontal, - gridDelegate: SliverGridDelegateWithFixedCrossAxisCount( - crossAxisCount: 7, - mainAxisSpacing: 2.w, - crossAxisSpacing: 2.w, + Row( + children: [ + _statisticsItem( + '${controller.days.value}', + '天', + Colors.lime, + ), + _statisticsItem( + '${controller.numberFiles.value}', + '文件', + Colors.lightGreen, + ), + _statisticsItem( + '${controller.hourage.value}', + '小时', + Colors.blueGrey, + ), + ], ), - itemCount: 364, - itemBuilder: (BuildContext context, int index) { - return Container( - decoration: BoxDecoration( - color: Colors.grey[200], - borderRadius: BorderRadius.circular(2.w), + Container( + height: 80.w, + padding: EdgeInsets.symmetric(horizontal: 2.w), + margin: EdgeInsets.only(top: 8.w, bottom: 2.w), + child: GridView.builder( + scrollDirection: Axis.horizontal, + gridDelegate: SliverGridDelegateWithFixedCrossAxisCount( + crossAxisCount: 7, + mainAxisSpacing: 2.w, + crossAxisSpacing: 2.w, ), - ); - }, - ), + itemCount: 364, + itemBuilder: (BuildContext context, int index) { + return Container( + decoration: BoxDecoration( + color: Colors.grey[200], + borderRadius: BorderRadius.circular(2.w), + ), + ); + }, + ), + ), + ], ), - ], + ), ), ); } @@ -236,6 +257,109 @@ class _MeetingMineViewState extends State { ); } + Widget _member() { + return Container( + margin: EdgeInsets.only(bottom: 15.w), + decoration: BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.circular(16.w), + ), + child: Column( + children: [ + Padding( + padding: EdgeInsets.symmetric(horizontal: 12.w, vertical: 10.w), + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Text( + 'DEAPSOUND AI会员', + style: TextStyle( + color: Colors.black87, + fontSize: 16.sp, + ), + ), + Icon( + Icons.arrow_forward_ios, + size: 16.w, + color: Colors.grey, + ), + ], + ), + ), + Container( + padding: EdgeInsets.symmetric(horizontal: 12.w, vertical: 15.w), + decoration: BoxDecoration( + color: Colors.black87, + borderRadius: BorderRadius.circular(16.w), + ), + child: Column( + children: [ + Row( + children: [ + Icon( + Icons.auto_awesome, + color: Colors.amberAccent, + size: 25.sp, + ), + 5.horizontalSpace, + Text( + '解锁 Starter 会员', + style: TextStyle( + color: Colors.white, + fontSize: 18.sp, + fontWeight: FontWeight.bold, + ), + ), + ], + ), + Padding( + padding: EdgeInsets.only(top: 15.w), + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Text( + '绑定 DEAPSOUND 设备可激活 Starter 会员', + style: TextStyle( + color: Colors.white, + fontSize: 12.sp, + ), + ), + GestureDetector( + onTap: () {}, + child: Container( + padding: EdgeInsets.symmetric( + horizontal: 10.w, + vertical: 6.w, + ), + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(50.w), + gradient: const LinearGradient( + colors: [Colors.blue, Colors.pink], + begin: Alignment.centerLeft, + end: Alignment.centerRight, + ), + ), + child: Text( + '立即解锁', + style: TextStyle( + color: Colors.white, + fontSize: 14.sp, + fontWeight: FontWeight.bold, + ), + ), + ), + ), + ], + ), + ), + ], + ), + ), + ], + ), + ); + } + Widget _box(List children) { return Container( padding: EdgeInsets.symmetric(vertical: 5.w),