From 32c8ca64ac524f001def55ce0341730ffa4a9d10 Mon Sep 17 00:00:00 2001 From: zhangmeng <494089941@qq.com> Date: Tue, 18 May 2021 21:27:22 +0800 Subject: [PATCH] =?UTF-8?q?update=20dev=20=E8=A7=A3=E5=86=B3=E7=94=9F?= =?UTF-8?q?=E6=B4=BB=E7=BC=B4=E8=B4=B9=E5=8D=A1=E4=BD=8F=E7=9A=84=E9=97=AE?= =?UTF-8?q?=E9=A2=98=20=E6=9B=BF=E6=8D=A2=E9=80=80=E5=87=BA=E6=8F=90?= =?UTF-8?q?=E9=86=92=E6=A0=B7=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/pages/life_pay/life_pay_page.dart | 17 +++-- .../life_pay/widget/life_pay_detail_page.dart | 2 +- lib/pages/tab_navigator.dart | 63 ++++++++++++++++--- pubspec.yaml | 2 +- 4 files changed, 67 insertions(+), 17 deletions(-) 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"