解决生活缴费卡住的问题
替换退出提醒样式
hmxc
张萌 4 years ago
parent 10702f3405
commit 32c8ca64ac

@ -40,6 +40,8 @@ class _LifePayPageState extends State<LifePayPage> {
List<SelectPay> _selectPay = []; List<SelectPay> _selectPay = [];
double _totalCost = 0; double _totalCost = 0;
int _count = 0; int _count = 0;
bool get allSelect => ((_models.length == _selectYears.length)&&(_models.length!=0));
@override @override
void initState() { void initState() {
super.initState(); super.initState();
@ -213,9 +215,12 @@ class _LifePayPageState extends State<LifePayPage> {
double getPayTotal(LifePayModel list) { double getPayTotal(LifePayModel list) {
num total = 0; num total = 0;
if (list.dailyPaymentTypeVos != null) {
for (var item in list.dailyPaymentTypeVos!) { for (var item in list.dailyPaymentTypeVos!) {
total += ((item.detailedVoList![1].paymentPrice ?? 0) + for (var v in item.detailedVoList!) {
(item.detailedVoList![2].paymentPrice ?? 0)); total += v.paymentPrice ?? 0;
}
}
} }
return total as double; return total as double;
} }
@ -308,17 +313,17 @@ class _LifePayPageState extends State<LifePayPage> {
decoration: BoxDecoration( decoration: BoxDecoration(
border: Border.all( border: Border.all(
width: 1.w, width: 1.w,
color: _models.length == _selectYears.length color: allSelect
? kPrimaryColor ? kPrimaryColor
: kDarkSubColor), : kDarkSubColor),
color: _models.length == _selectYears.length color:allSelect
? kPrimaryColor ? kPrimaryColor
: Colors.transparent, : Colors.transparent,
borderRadius: BorderRadius.circular(20.w)), borderRadius: BorderRadius.circular(20.w)),
curve: Curves.easeInOutCubic, curve: Curves.easeInOutCubic,
width: 40.w, width: 40.w,
height: 40.w, height: 40.w,
child: _models.length == _selectYears.length child: allSelect
? Icon( ? Icon(
CupertinoIcons.check_mark, CupertinoIcons.check_mark,
size: 25.w, size: 25.w,

@ -121,7 +121,7 @@ class _LifePayDetailPageState extends State<LifePayDetailPage> {
...model.detailedVoList! ...model.detailedVoList!
.map((e) => _buildTile( .map((e) => _buildTile(
e.groupId, model.id, widget.model!.years, e.paymentPrice)) e.groupId, model.id, widget.model!.years, e.paymentPrice))
.toList(), .toList().sepWidget(separate: 24.w.heightBox),
], ],
), ),
); );

@ -1,13 +1,14 @@
import 'package:aku_community/base/base_style.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:bot_toast/bot_toast.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:aku_community/const/resource.dart'; import 'package:aku_community/const/resource.dart';
import 'package:aku_community/ui/community/community_views/community_page.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/ui/market/market_page.dart';
import 'package:aku_community/widget/bee_scaffold.dart'; import 'package:aku_community/widget/bee_scaffold.dart';
import 'package:get/get.dart';
import 'home/home_page.dart'; import 'home/home_page.dart';
import 'personal/personal_page.dart'; import 'personal/personal_page.dart';
import 'property/property_index.dart'; import 'property/property_index.dart';
@ -98,15 +99,59 @@ class _TabNavigatorState extends State<TabNavigator>
return BeeScaffold( return BeeScaffold(
body: WillPopScope( body: WillPopScope(
onWillPop: () async { onWillPop: () async {
if (_lastPressed == null || // if (_lastPressed == null ||
DateTime.now().difference(_lastPressed!) > Duration(seconds: 1)) { // DateTime.now().difference(_lastPressed!) > Duration(seconds: 1)) {
//1 // //1
_lastPressed = DateTime.now(); // _lastPressed = DateTime.now();
BotToast.showText(text: '再点击一次返回退出'); // BotToast.showText(text: '再点击一次返回退出');
return false; // return false;
} // }
//app //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( child: TabBarView(
children: _pages, children: _pages,

@ -2,7 +2,7 @@ name: aku_community
description: A new Flutter project. description: A new Flutter project.
publish_to: "none" publish_to: "none"
version: 1.3.0-dev+38 version: 1.4.0-dev+39
environment: environment:
sdk: ">=2.12.0 <3.0.0" sdk: ">=2.12.0 <3.0.0"

Loading…
Cancel
Save