diff --git a/lib/pages/life_pay/life_pay_page.dart b/lib/pages/life_pay/life_pay_page.dart index 92176fd5..bdff8ee3 100644 --- a/lib/pages/life_pay/life_pay_page.dart +++ b/lib/pages/life_pay/life_pay_page.dart @@ -40,6 +40,8 @@ class _LifePayPageState extends State { List _selectPay = []; double _totalCost = 0; int _count = 0; + + bool get allSelect => ((_models.length == _selectYears.length)&&(_models.length!=0)); @override void initState() { super.initState(); @@ -213,9 +215,12 @@ class _LifePayPageState extends State { double getPayTotal(LifePayModel list) { num total = 0; - for (var item in list.dailyPaymentTypeVos!) { - total += ((item.detailedVoList![1].paymentPrice ?? 0) + - (item.detailedVoList![2].paymentPrice ?? 0)); + if (list.dailyPaymentTypeVos != null) { + for (var item in list.dailyPaymentTypeVos!) { + for (var v in item.detailedVoList!) { + total += v.paymentPrice ?? 0; + } + } } return total as double; } @@ -308,17 +313,17 @@ class _LifePayPageState extends State { decoration: BoxDecoration( border: Border.all( width: 1.w, - color: _models.length == _selectYears.length + color: allSelect ? kPrimaryColor : kDarkSubColor), - color: _models.length == _selectYears.length + color:allSelect ? kPrimaryColor : Colors.transparent, borderRadius: BorderRadius.circular(20.w)), curve: Curves.easeInOutCubic, width: 40.w, height: 40.w, - child: _models.length == _selectYears.length + child: allSelect ? Icon( CupertinoIcons.check_mark, size: 25.w, diff --git a/lib/pages/life_pay/widget/life_pay_detail_page.dart b/lib/pages/life_pay/widget/life_pay_detail_page.dart index faa3aba3..89849937 100644 --- a/lib/pages/life_pay/widget/life_pay_detail_page.dart +++ b/lib/pages/life_pay/widget/life_pay_detail_page.dart @@ -121,7 +121,7 @@ class _LifePayDetailPageState extends State { ...model.detailedVoList! .map((e) => _buildTile( e.groupId, model.id, widget.model!.years, e.paymentPrice)) - .toList(), + .toList().sepWidget(separate: 24.w.heightBox), ], ), ); diff --git a/lib/pages/tab_navigator.dart b/lib/pages/tab_navigator.dart index cbc4c0a4..0f3e26ce 100644 --- a/lib/pages/tab_navigator.dart +++ b/lib/pages/tab_navigator.dart @@ -1,13 +1,14 @@ +import 'package:aku_community/base/base_style.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; -import 'package:bot_toast/bot_toast.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:aku_community/const/resource.dart'; import 'package:aku_community/ui/community/community_views/community_page.dart'; import 'package:aku_community/ui/market/market_page.dart'; import 'package:aku_community/widget/bee_scaffold.dart'; +import 'package:get/get.dart'; import 'home/home_page.dart'; import 'personal/personal_page.dart'; import 'property/property_index.dart'; @@ -98,15 +99,59 @@ class _TabNavigatorState extends State return BeeScaffold( body: WillPopScope( onWillPop: () async { - if (_lastPressed == null || - DateTime.now().difference(_lastPressed!) > Duration(seconds: 1)) { - //两次点击间隔超过1秒重新计算 - _lastPressed = DateTime.now(); - BotToast.showText(text: '再点击一次返回退出'); - return false; - } + // if (_lastPressed == null || + // DateTime.now().difference(_lastPressed!) > Duration(seconds: 1)) { + // //两次点击间隔超过1秒重新计算 + // _lastPressed = DateTime.now(); + // BotToast.showText(text: '再点击一次返回退出'); + // return false; + // } //否则关闭app - return true; + bool _reslut = true; + showCupertinoDialog( + context: context, + builder: (context) { + return CupertinoAlertDialog( + title: Text( + '确认退出?', + style: TextStyle( + color: Colors.black, + fontSize: 40.sp, + fontWeight: FontWeight.bold, + ), + ), + actions: [ + CupertinoActionSheetAction( + onPressed: () { + Get.back(); + }, + child: Text( + '确认', + style: TextStyle( + color: Colors.black, + fontSize: 32.sp, + fontWeight: FontWeight.bold, + ), + ), + ), + CupertinoActionSheetAction( + onPressed: () { + Get.back(); + _reslut = false; + }, + child: Text( + '取消', + style: TextStyle( + color: kPrimaryColor, + fontSize: 32.sp, + fontWeight: FontWeight.bold, + ), + ), + ) + ], + ); + }); + return _reslut; }, child: TabBarView( children: _pages, diff --git a/pubspec.yaml b/pubspec.yaml index 5dfc6a53..1ca8eaf4 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -2,7 +2,7 @@ name: aku_community description: A new Flutter project. publish_to: "none" -version: 1.3.0-dev+38 +version: 1.4.0-dev+39 environment: sdk: ">=2.12.0 <3.0.0"