diff --git a/android/app/src/main/AndroidManifest.xml b/android/app/src/main/AndroidManifest.xml index ce234f4..235e0d8 100644 --- a/android/app/src/main/AndroidManifest.xml +++ b/android/app/src/main/AndroidManifest.xml @@ -34,6 +34,7 @@ { AMapFlutterLocation _amapFlutterLocation; Map _location; WeatherCityModel cityModel; - DateTime _date = DateTime.now(); + DateTime _date = DateTime( + DateTime.now().year, DateTime.now().month, DateTime.now().day, 0, 0); String _dateText = DateUtil.formatDate(DateTime.now(), format: 'M月d日'); //DateTime _selectedDay; //CalendarFormat _calendarFormat = CalendarFormat.month; @@ -484,7 +486,11 @@ class _ChooseTicketsTypePageState extends State { }, )); } else { - Get.to(); + print(_date); + Get.to(ChooseTicketsPage( + fromText: _originText, + toText: _destinationText, + originDate: _date)); } print('查询'); }, diff --git a/lib/pages/user/user_benefit_currency_pag.dart b/lib/pages/user/user_benefit_currency_pag.dart index 4078eaf..87695cc 100644 --- a/lib/pages/user/user_benefit_currency_pag.dart +++ b/lib/pages/user/user_benefit_currency_pag.dart @@ -84,6 +84,42 @@ class _UserBenefitCurrencyPageState extends State { bool _onload = true; List _gone = []; + @override + void initState() { + super.initState(); + if (widget.receivedType == '未到账') { + _TformatType = 'yyyy-MM'; + _TTableformatType = 'M月d日'; + } else if (widget.receivedType == '已到账') { + _TformatType = 'yyyy'; + _TTableformatType = 'M月'; + } + if (!_notSelfNotGUide) { + if (widget.receivedType == '已到账') { + if (_yearChoose == true) { + formatType = 'yyyy'; + } else if (_monthChoose == true) { + formatType = 'yyyy-MM'; + } + } else if (widget.receivedType == '未到账') { + if (_yearChoose == true) { + formatType = 'yyyy'; + } else if (_monthChoose == true) { + formatType = 'yyyy-MM'; + } + } + _onload = false; + } else { + //团队补贴 + + if (widget.receivedType == '未到账') { + formatType = 'yyyy-MM'; + } else if (widget.receivedType == '已到账') { + formatType = 'yyyy'; + } + } + } + _chooseMonth() { String MonthText = ''; if (widget.receivedType == '未到账') { @@ -136,14 +172,6 @@ class _UserBenefitCurrencyPageState extends State { } _chooseSelf() { - if (widget.receivedType == '未到账') { - _TformatType = 'yyyy-MM'; - _TTableformatType = 'M月d日'; - } else if (widget.receivedType == '已到账') { - _TformatType = 'yyyy'; - _TTableformatType = 'M月'; - } - return CustomImageButton( onPressed: () { _selfChoose = true; @@ -350,25 +378,28 @@ class _UserBenefitCurrencyPageState extends State { clipBehavior: Clip.antiAlias, height: 146.rw, decoration: BoxDecoration( - color: Colors.white, + borderRadius: BorderRadius.circular(5.rw), boxShadow: [ BoxShadow( - color: Color(0xFFA6A6AD).withOpacity(0.41), - offset: Offset(0, 2.rw), + offset: Offset(0, 1.rw), + color: Color.fromRGBO(166, 166, 173, 0.43), blurRadius: 6.rw, - ), + ) ], - borderRadius: BorderRadius.circular(4.rw), + image: DecorationImage( + image: AssetImage(UserLevelTool.currentCardImagePath()), + fit: BoxFit.cover, + ), ), child: Column( children: [ Container( decoration: BoxDecoration( - image: DecorationImage( - fit: BoxFit.cover, - image: AssetImage(UserLevelTool.currentCardImagePath()), - ), - ), + image: DecorationImage( + fit: BoxFit.cover, + image: AssetImage(UserLevelTool.currentCardImagePath()), + ), + color: Colors.transparent), padding: EdgeInsets.only( top: 20.rw, bottom: 10.rw, left: 20.rw, right: 20.rw), child: Row( @@ -468,21 +499,17 @@ class _UserBenefitCurrencyPageState extends State { if (!_notSelfNotGUide) { if (widget.receivedType == '已到账') { if (_yearChoose == true) { - formatType = 'yyyy'; _models = await UserBenefitFunc.receicedIncome( DateUtil.formatDate(_date, format: 'yyyy'), BenefitType); } else if (_monthChoose == true) { - formatType = 'yyyy-MM'; _models = await UserBenefitFunc.receicedIncome( DateUtil.formatDate(_date, format: 'yyyyMM'), BenefitType); } } else if (widget.receivedType == '未到账') { if (_yearChoose == true) { - formatType = 'yyyy'; _models = await UserBenefitFunc.notReceicedIncome( DateUtil.formatDate(_date, format: 'yyyy'), BenefitType); } else if (_monthChoose == true) { - formatType = 'yyyy-MM'; _models = await UserBenefitFunc.notReceicedIncome( DateUtil.formatDate(_date, format: 'yyyyMM'), BenefitType); } @@ -492,10 +519,8 @@ class _UserBenefitCurrencyPageState extends State { //团队补贴 if (widget.receivedType == '未到账') { - formatType = 'yyyy'; _models = await UserBenefitFunc.teamNotReceicedIncome(team_level); } else if (widget.receivedType == '已到账') { - formatType = 'yyyy-MM'; _models = await UserBenefitFunc.teamReceicedIncome( int.parse(DateUtil.formatDate(_date, format: 'yyyy')), team_level); @@ -567,7 +592,7 @@ class _UserBenefitCurrencyPageState extends State { ? Container( padding: EdgeInsets.only(left: 30.w), child: DateUtil.formatDate(_date, - format: _TformatType) + format: formatType) .text .black .size(14.rsp) @@ -594,7 +619,7 @@ class _UserBenefitCurrencyPageState extends State { child: Row( children: [ DateUtil.formatDate(_date, - format: _TformatType) + format: formatType) .text .black .size(14.rsp) @@ -844,8 +869,8 @@ class _UserBenefitCurrencyPageState extends State { size: 22, color: Color(0xff999999)) : Icon(Icons.keyboard_arrow_down, size: 22, color: Color(0xff999999)) - : SizedBox() - : SizedBox(), + : Icon(null, size: 22, color: Color(0xff999999)) + : Icon(null, size: 22, color: Color(0xff999999)), 20.wb ], ), diff --git a/lib/pages/user/user_benefit_shop_page.dart b/lib/pages/user/user_benefit_shop_page.dart index 0e52c20..f30a37d 100644 --- a/lib/pages/user/user_benefit_shop_page.dart +++ b/lib/pages/user/user_benefit_shop_page.dart @@ -97,7 +97,7 @@ class _UserBenefitShopPageState extends State { Container( child: Column( children: [ - '销售额(元)'.text.color(Colors.black54).size(15.rsp).make(), + '销售额(元)'.text.color(Colors.black54).size(14.rsp).make(), 20.hb, _salesVolume.text .color(Color(0xFF333333)) @@ -110,7 +110,7 @@ class _UserBenefitShopPageState extends State { Container( child: Column( children: [ - '品牌推广补贴(%)'.text.color(Colors.black54).size(15.rsp).make(), + '品牌推广补贴(%)'.text.color(Colors.black54).size(14.rsp).make(), 20.hb, _subsidy.text.color(Color(0xFF333333)).size(16.rsp).make(), ], @@ -120,7 +120,7 @@ class _UserBenefitShopPageState extends State { Container( child: Column( children: [ - ('订单数(笔)').text.color(Colors.black54).size(15.rsp).make(), + ('订单数(笔)').text.color(Colors.black54).size(14.rsp).make(), 20.hb, _count.text.color(Color(0xFF333333)).size(16.rsp).make(), ], diff --git a/lib/widgets/calendar/xiata_calendar_widget.dart b/lib/widgets/calendar/xiata_calendar_widget.dart index 55499d6..42a52e3 100644 --- a/lib/widgets/calendar/xiata_calendar_widget.dart +++ b/lib/widgets/calendar/xiata_calendar_widget.dart @@ -98,15 +98,13 @@ class _XiataCalendarWidgetState extends State { ? (DateTime date) { if (rangeMinDate == null) { setState(() { - print(rangeMinDate); - print('1111'); + rangeMinDate = date; //rangeMaxDate = null; }); } else { setState(() { - print(rangeMinDate); - print('2222'); + //rangeMaxDate = date; rangeMinDate = date; }); @@ -184,8 +182,6 @@ class _MonthView extends StatelessWidget { return const SizedBox(); } else { bool isSelected = false; - print(day); - print(rangeMinDate); if (rangeFeatureEnabled) { if (rangeMinDate != null) { diff --git a/lib/widgets/filter_tool_bar.dart b/lib/widgets/filter_tool_bar.dart index c05f1e1..4b317e6 100644 --- a/lib/widgets/filter_tool_bar.dart +++ b/lib/widgets/filter_tool_bar.dart @@ -15,8 +15,10 @@ import 'package:recook/utils/text_utils.dart'; /// 自筛选列表点击监听 typedef SelectedListener = Function(int selectedIndex, FilterItemModel item); + /// 下拉列表状态变更 typedef PopOptionHandle = Function(OptionListStatus status); + /// filterBar 标题点击、变更等监听 typedef FilterToolBarListener = Function(bool update); @@ -82,7 +84,8 @@ class FilterToolBarResultContainer extends StatefulWidget { final FilterToolBarController controller; final Widget body; - const FilterToolBarResultContainer({GlobalKey key, this.controller, this.body}) + const FilterToolBarResultContainer( + {GlobalKey key, this.controller, this.body}) : assert(controller != null, "controller 不为空"); @override @@ -139,12 +142,11 @@ class _FilterToolBarResultContainerState }); if (widget.key == null) { - widget.controller._containerKey = GlobalKey(); - }else { + widget.controller._containerKey = GlobalKey(); + } else { widget.controller._containerKey = widget.key; } - super.initState(); } @@ -156,7 +158,6 @@ class _FilterToolBarResultContainerState @override Widget build(BuildContext context) { - return Container( key: widget.controller._containerKey, child: _buildBody(context), @@ -193,34 +194,33 @@ class _FilterToolBarResultContainerState Widget _maskView() { return widget.controller._toolBarKey == null - ? Container() - : - Positioned( - top: widget.controller.toolBarDy + 40, - left: 0, - right: 0, - bottom: 0, - child: Offstage( - child: GestureDetector( - behavior: HitTestBehavior.translucent, - onTap: () { - widget.controller.helper.changeOptionListStatus( - OptionListStatus.close, - ); - widget.controller.updateToolBarState(false); - _animationController.reset(); - }, - child: Opacity( - opacity: 0.3, - child: Container( - color: Colors.black, - ), + ? Container() + : Positioned( + top: widget.controller.toolBarDy + 40, + left: 0, + right: 0, + bottom: 0, + child: Offstage( + child: GestureDetector( + behavior: HitTestBehavior.translucent, + onTap: () { + widget.controller.helper.changeOptionListStatus( + OptionListStatus.close, + ); + widget.controller.updateToolBarState(false); + _animationController.reset(); + }, + child: Opacity( + opacity: 0.3, + child: Container( + color: Colors.black, ), ), - offstage: _animation == null || - (_animation.status == AnimationStatus.dismissed), ), - ); + offstage: _animation == null || + (_animation.status == AnimationStatus.dismissed), + ), + ); } /// 有多个子列表时 因为有设置最大行数,小于最大行数[widget.maxLines]时,以子列表个数为准, @@ -272,7 +272,6 @@ class _FilterToolBarResultContainerState height: _lineHeight, child: RawMaterialButton( onPressed: () { - widget.controller.helper .changeOptionListStatus(OptionListStatus.close); widget.controller.updateToolBarState(false); @@ -337,7 +336,8 @@ class FilterToolBar extends StatefulWidget { this.selectedColor, this.maxLines = 4, this.trialing, - this.fontSize = 15.0, this.height = 40, + this.fontSize = 15.0, + this.height = 40, }) : assert(listener != null, "请设置监听事件"), assert(controller != null, "请设置controller"); @@ -403,7 +403,9 @@ class _FilterToolBarState extends State height: 40, decoration: BoxDecoration( color: Colors.white, - border: Border(top: BorderSide(color: Colors.grey[200], width: 0.5), bottom: BorderSide(color: Colors.grey[200], width: 0.5))), + border: Border( + top: BorderSide(color: Colors.grey[200], width: 0.5), + bottom: BorderSide(color: Colors.grey[200], width: 0.5))), child: Row( crossAxisAlignment: CrossAxisAlignment.stretch, children: items, @@ -547,6 +549,7 @@ class FilterItemModel { final FilterItemType type; String title; final List subtitles; + /// 列表下拉时的子标题 final List subtitleShort; bool topSelected;