修改 生活缴费

hmxc
张萌 4 years ago
parent 8c67e8c28f
commit 268a48d617

@ -212,17 +212,16 @@ class _LifePayPageState extends State<LifePayPage> {
return BeeScaffold( return BeeScaffold(
title: '生活缴费', title: '生活缴费',
actions: [ actions: [
//TODO InkWell(
// InkWell( onTap: () {
// onTap: () { // LifePayRecordPage().to();
// LifePayRecordPage().to(); },
// }, child: Container(
// child: Container( padding: EdgeInsets.fromLTRB(32.w, 28.w, 32.w, 20.w),
// padding: EdgeInsets.fromLTRB(32.w, 28.w, 32.w, 20.w), alignment: Alignment.center,
// alignment: Alignment.center, child: '缴费记录'.text.black.size(28.sp).make(),
// child: '缴费记录'.text.black.size(28.sp).make(), ),
// ), ),
// ),
], ],
body: BeeListView( body: BeeListView(
path: API.manager.dailyPaymentList, path: API.manager.dailyPaymentList,

@ -42,6 +42,27 @@ class _LifePayDetailPageState extends State<LifePayDetailPage> {
return listLength == _selectItems.length; return listLength == _selectItems.length;
} }
@override
void initState() {
super.initState();
for (var i = 0; i < widget.model.dailyPaymentTypeVos.length; i++) {
for (var j = 0;
j < widget.model.dailyPaymentTypeVos[i].detailedVoList.length;
j++) {
String id = widget.model.dailyPaymentTypeVos[i].id.toString() +
widget.model.dailyPaymentTypeVos[i].detailedVoList[j].groupId
.toString();
if (!_selectItems.contains(id)) {
_selectItems.add(id);
_payNum += 1;
_payTotal += widget
.model.dailyPaymentTypeVos[i].detailedVoList[j].paymentPrice
.toDouble();
}
}
}
}
Widget _buildTile(int groupId, int id, int years, double price) { Widget _buildTile(int groupId, int id, int years, double price) {
return GestureDetector( return GestureDetector(
onTap: () { onTap: () {
@ -75,10 +96,6 @@ class _LifePayDetailPageState extends State<LifePayDetailPage> {
.bold .bold
.make(), .make(),
24.w.widthBox, 24.w.widthBox,
Icon(
CupertinoIcons.chevron_forward,
size: 40.w,
),
], ],
).material(color: Colors.transparent), ).material(color: Colors.transparent),
); );
@ -131,36 +148,35 @@ class _LifePayDetailPageState extends State<LifePayDetailPage> {
children: [ children: [
GestureDetector( GestureDetector(
onTap: () { onTap: () {
setState(() { if (isAllSelect) {
if (isAllSelect) { _selectItems.clear();
_selectItems.clear(); _payNum = 0;
_payNum = 0; _payTotal = 0;
_payTotal = 0; } else {
} else { for (var i = 0;
for (var i = 0; i < widget.model.dailyPaymentTypeVos.length;
i < widget.model.dailyPaymentTypeVos.length; i++) {
i++) { for (var j = 0;
for (var j = 0; j <
i < widget.model.dailyPaymentTypeVos[i].detailedVoList
widget.model.dailyPaymentTypeVos[i].detailedVoList .length;
.length; j++) {
i++) { String id =
String id = widget.model.dailyPaymentTypeVos[i].id.toString() +
widget.model.dailyPaymentTypeVos[i].id.toString() + widget.model.dailyPaymentTypeVos[i]
widget.model.dailyPaymentTypeVos[i] .detailedVoList[j].groupId
.detailedVoList[j].groupId .toString();
.toString(); if (!_selectItems.contains(id)) {
if (!_selectItems.contains(id)) { _selectItems.add(id);
_selectItems.add(id); _payNum += 1;
_payNum += 1; _payTotal += widget.model.dailyPaymentTypeVos[i]
_payTotal += widget.model.dailyPaymentTypeVos[i] .detailedVoList[j].paymentPrice
.detailedVoList[j].paymentPrice .toDouble();
.toDouble();
}
} }
} }
} }
}); }
setState(() {});
}, },
child: AnimatedContainer( child: AnimatedContainer(
duration: Duration(milliseconds: 300), duration: Duration(milliseconds: 300),
@ -205,6 +221,7 @@ class _LifePayDetailPageState extends State<LifePayDetailPage> {
'已选$_payNum'.text.color(ktextSubColor).size(20.sp).make(), '已选$_payNum'.text.color(ktextSubColor).size(20.sp).make(),
], ],
), ),
8.w.widthBox,
MaterialButton( MaterialButton(
elevation: 0, elevation: 0,
shape: RoundedRectangleBorder( shape: RoundedRectangleBorder(

Loading…
Cancel
Save