From 8a72fb270ee413ed396247ba816e9d49e534e3ef Mon Sep 17 00:00:00 2001 From: tanlongsheng <252620078@qq.com> Date: Tue, 15 Jul 2025 16:26:52 +0800 Subject: [PATCH 1/3] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E4=BC=9A=E8=AE=AE?= =?UTF-8?q?=E5=8A=A9=E6=89=8B=E6=88=91=E7=9A=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../meeting/views/meeting_mine_view.dart | 104 ++++++++++++++++++ 1 file changed, 104 insertions(+) diff --git a/lib/modules/meeting/views/meeting_mine_view.dart b/lib/modules/meeting/views/meeting_mine_view.dart index cceb7b243..40fcf6c6e 100644 --- a/lib/modules/meeting/views/meeting_mine_view.dart +++ b/lib/modules/meeting/views/meeting_mine_view.dart @@ -27,6 +27,7 @@ class _MeetingMineViewState extends State { children: [ _head(), _statistics(), + _member(), _box([ _item( Icons.article_outlined, @@ -215,6 +216,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), From 586f3e655607282af11a08a16a332e7758905cb4 Mon Sep 17 00:00:00 2001 From: tanlongsheng <252620078@qq.com> Date: Tue, 15 Jul 2025 20:34:36 +0800 Subject: [PATCH 2/3] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E4=BC=9A=E8=AE=AE?= =?UTF-8?q?=E5=8A=A9=E6=89=8B=E7=BB=9F=E8=AE=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../bottomSheet/statistics_bottom_sheet.dart | 265 ++++++++++++++++++ .../meeting/views/meeting_mine_view.dart | 85 +++--- 2 files changed, 313 insertions(+), 37 deletions(-) create mode 100644 lib/modules/meeting/views/bottomSheet/statistics_bottom_sheet.dart 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..772acae49 --- /dev/null +++ b/lib/modules/meeting/views/bottomSheet/statistics_bottom_sheet.dart @@ -0,0 +1,265 @@ +import 'package:flutter/material.dart'; +import 'package:flutter_screenutil/flutter_screenutil.dart'; +import 'package:get/get.dart'; + +class StatisticsBottomSheet extends StatefulWidget { + const StatisticsBottomSheet({super.key}); + + @override + State createState() => _StatisticsBottomSheetState(); +} + +class _StatisticsBottomSheetState extends State { + @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('天', '1', Colors.amber), + _item('文件', '3', Colors.blueGrey), + _item('小时', '0.2', Colors.cyan), + _item('连续录音天数', '1', Colors.deepOrangeAccent), + _item('单日最多录音', '3', Colors.teal), + _item('单日最长录音', '0.2', 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 40fcf6c6e..7d97abf27 100644 --- a/lib/modules/meeting/views/meeting_mine_view.dart +++ b/lib/modules/meeting/views/meeting_mine_view.dart @@ -1,5 +1,8 @@ import 'package:flutter/material.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart'; +import 'package:get/get.dart'; + +import 'bottomSheet/statistics_bottom_sheet.dart'; class MeetingMineView extends StatefulWidget { const MeetingMineView({super.key}); @@ -135,45 +138,53 @@ 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( - 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, + 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: Column( + children: [ + Row( + 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, + ), + itemCount: 364, + itemBuilder: (BuildContext context, int index) { + return Container( + decoration: BoxDecoration( + color: Colors.grey[200], + borderRadius: BorderRadius.circular(2.w), + ), + ); + }, ), - itemCount: 364, - itemBuilder: (BuildContext context, int index) { - return Container( - decoration: BoxDecoration( - color: Colors.grey[200], - borderRadius: BorderRadius.circular(2.w), - ), - ); - }, ), - ), - ], + ], + ), ), ); } From 476b7306187955b8e26f5ea2d38130da1359937e Mon Sep 17 00:00:00 2001 From: tanlongsheng <252620078@qq.com> Date: Wed, 16 Jul 2025 11:06:56 +0800 Subject: [PATCH 3/3] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E4=BC=9A=E8=AE=AE?= =?UTF-8?q?=E5=8A=A9=E6=89=8B=E7=BB=9F=E8=AE=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controllers/meeting_mine_controller.dart | 25 +++++- .../bottomSheet/statistics_bottom_sheet.dart | 40 +++++++-- .../meeting/views/meeting_mine_view.dart | 82 +++++++++++-------- 3 files changed, 104 insertions(+), 43 deletions(-) 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 index 772acae49..667bf370a 100644 --- a/lib/modules/meeting/views/bottomSheet/statistics_bottom_sheet.dart +++ b/lib/modules/meeting/views/bottomSheet/statistics_bottom_sheet.dart @@ -2,6 +2,8 @@ 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}); @@ -10,6 +12,8 @@ class StatisticsBottomSheet extends StatefulWidget { } class _StatisticsBottomSheetState extends State { + final _mineController = Get.find(); + @override Widget build(BuildContext context) { return Stack( @@ -66,12 +70,36 @@ class _StatisticsBottomSheetState extends State { spacing: 5.w, runSpacing: 5.w, children: [ - _item('天', '1', Colors.amber), - _item('文件', '3', Colors.blueGrey), - _item('小时', '0.2', Colors.cyan), - _item('连续录音天数', '1', Colors.deepOrangeAccent), - _item('单日最多录音', '3', Colors.teal), - _item('单日最长录音', '0.2', Colors.pink), + _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, + ), ], ), ), diff --git a/lib/modules/meeting/views/meeting_mine_view.dart b/lib/modules/meeting/views/meeting_mine_view.dart index 7d97abf27..9b09005b4 100644 --- a/lib/modules/meeting/views/meeting_mine_view.dart +++ b/lib/modules/meeting/views/meeting_mine_view.dart @@ -2,16 +2,12 @@ import 'package:flutter/material.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:get/get.dart'; +import '../controllers/meeting_mine_controller.dart'; import 'bottomSheet/statistics_bottom_sheet.dart'; -class MeetingMineView extends StatefulWidget { +class MeetingMineView extends GetView { const MeetingMineView({super.key}); - @override - State createState() => _MeetingMineViewState(); -} - -class _MeetingMineViewState extends State { @override Widget build(BuildContext context) { return Scaffold( @@ -152,38 +148,52 @@ class _MeetingMineViewState extends State { color: Colors.white, borderRadius: BorderRadius.circular(16.w), ), - child: Column( - children: [ - Row( - 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, + child: Obx( + () => Column( + children: [ + Row( + children: [ + _statisticsItem( + '${controller.days.value}', + '天', + Colors.lime, + ), + _statisticsItem( + '${controller.numberFiles.value}', + '文件', + Colors.lightGreen, + ), + _statisticsItem( + '${controller.hourage.value}', + '小时', + 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, + ), + itemCount: 364, + itemBuilder: (BuildContext context, int index) { + return Container( + decoration: BoxDecoration( + color: Colors.grey[200], + borderRadius: BorderRadius.circular(2.w), + ), + ); + }, ), - itemCount: 364, - itemBuilder: (BuildContext context, int index) { - return Container( - decoration: BoxDecoration( - color: Colors.grey[200], - borderRadius: BorderRadius.circular(2.w), - ), - ); - }, ), - ), - ], + ], + ), ), ), );