|
|
@ -1,4 +1,6 @@
|
|
|
|
// Flutter imports:
|
|
|
|
// Flutter imports:
|
|
|
|
|
|
|
|
import 'package:akuCommunity/pages/life_pay/widget/my_house_page.dart';
|
|
|
|
|
|
|
|
import 'package:akuCommunity/widget/bee_divider.dart';
|
|
|
|
import 'package:akuCommunity/widget/others/bee_header_house.dart';
|
|
|
|
import 'package:akuCommunity/widget/others/bee_header_house.dart';
|
|
|
|
import 'package:flutter/cupertino.dart';
|
|
|
|
import 'package:flutter/cupertino.dart';
|
|
|
|
import 'package:flutter/material.dart';
|
|
|
|
import 'package:flutter/material.dart';
|
|
|
@ -31,27 +33,16 @@ class LifePayPage extends StatefulWidget {
|
|
|
|
class SelectPay {
|
|
|
|
class SelectPay {
|
|
|
|
double payTotal;
|
|
|
|
double payTotal;
|
|
|
|
int payCount;
|
|
|
|
int payCount;
|
|
|
|
SelectPay();
|
|
|
|
SelectPay({this.payCount, this.payTotal});
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
class _LifePayPageState extends State<LifePayPage> {
|
|
|
|
class _LifePayPageState extends State<LifePayPage> {
|
|
|
|
EasyRefreshController _controller;
|
|
|
|
EasyRefreshController _controller;
|
|
|
|
// List<SelectList> selectItems = [];
|
|
|
|
|
|
|
|
List<int> _selectYears = [];
|
|
|
|
List<int> _selectYears = [];
|
|
|
|
List<LifePayModel> _models = [];
|
|
|
|
List<LifePayModel> _models = [];
|
|
|
|
List<SelectPay> _selectPay = [];
|
|
|
|
List<SelectPay> _selectPay = [];
|
|
|
|
double _totalCost = 0;
|
|
|
|
double _totalCost = 0;
|
|
|
|
int _count = 0;
|
|
|
|
int _count = 0;
|
|
|
|
// int _getLength(LifePayModel model) {
|
|
|
|
|
|
|
|
// int count = 0;
|
|
|
|
|
|
|
|
// model.dailyPaymentTypeVos.forEach((element) {
|
|
|
|
|
|
|
|
// element.detailedVoList.forEach((element) {
|
|
|
|
|
|
|
|
// count++;
|
|
|
|
|
|
|
|
// });
|
|
|
|
|
|
|
|
// });
|
|
|
|
|
|
|
|
// return count;
|
|
|
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@override
|
|
|
|
@override
|
|
|
|
void initState() {
|
|
|
|
void initState() {
|
|
|
|
super.initState();
|
|
|
|
super.initState();
|
|
|
@ -64,59 +55,61 @@ class _LifePayPageState extends State<LifePayPage> {
|
|
|
|
super.dispose();
|
|
|
|
super.dispose();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// Widget _buildHouseCard(
|
|
|
|
Widget _buildHouseCard() {
|
|
|
|
// String title,
|
|
|
|
UserProvider userProvider = Provider.of<UserProvider>(context);
|
|
|
|
// String detail,
|
|
|
|
return Material(
|
|
|
|
// ) {
|
|
|
|
color: kForeGroundColor,
|
|
|
|
// return Material(
|
|
|
|
child: Padding(
|
|
|
|
// color: kForeGroundColor,
|
|
|
|
padding: EdgeInsets.all(32.w),
|
|
|
|
// child: Padding(
|
|
|
|
child: Column(
|
|
|
|
// padding: EdgeInsets.all(32.w),
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
// child: Column(
|
|
|
|
children: [
|
|
|
|
// crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
'当前房屋'.text.black.size(28.sp).make(),
|
|
|
|
// children: [
|
|
|
|
32.w.heightBox,
|
|
|
|
// '当前房屋'.text.black.size(28.sp).make(),
|
|
|
|
GestureDetector(
|
|
|
|
// 32.w.heightBox,
|
|
|
|
onTap: () {
|
|
|
|
// GestureDetector(
|
|
|
|
MyHousePage(
|
|
|
|
// onTap: () {
|
|
|
|
needFindPayTag: true,
|
|
|
|
// MyHousePage(
|
|
|
|
).to();
|
|
|
|
// needFindPayTag: true,
|
|
|
|
},
|
|
|
|
// ).to();
|
|
|
|
child: Row(
|
|
|
|
// },
|
|
|
|
children: [
|
|
|
|
// child: Row(
|
|
|
|
Image.asset(
|
|
|
|
// children: [
|
|
|
|
R.ASSETS_ICONS_HOUSE_PNG,
|
|
|
|
// Image.asset(
|
|
|
|
width: 60.w,
|
|
|
|
// R.ASSETS_ICONS_HOUSE_PNG,
|
|
|
|
height: 60.w,
|
|
|
|
// width: 60.w,
|
|
|
|
),
|
|
|
|
// height: 60.w,
|
|
|
|
40.w.widthBox,
|
|
|
|
// ),
|
|
|
|
Expanded(
|
|
|
|
// 40.w.widthBox,
|
|
|
|
child: Column(
|
|
|
|
// Expanded(
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
// child: Column(
|
|
|
|
children: [
|
|
|
|
// crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
kEstateName.text.black.size(32.sp).bold.make(),
|
|
|
|
// children: [
|
|
|
|
10.w.heightBox,
|
|
|
|
// title.text.black.size(32.sp).bold.make(),
|
|
|
|
userProvider.currentHouse.text.black
|
|
|
|
// 10.w.heightBox,
|
|
|
|
.size(32.sp)
|
|
|
|
// detail.text.black.size(32.sp).bold.make()
|
|
|
|
.bold
|
|
|
|
// ],
|
|
|
|
.make()
|
|
|
|
// ),
|
|
|
|
],
|
|
|
|
// ),
|
|
|
|
),
|
|
|
|
// Icon(
|
|
|
|
),
|
|
|
|
// CupertinoIcons.chevron_forward,
|
|
|
|
Icon(
|
|
|
|
// size: 40.w,
|
|
|
|
CupertinoIcons.chevron_forward,
|
|
|
|
// ),
|
|
|
|
size: 40.w,
|
|
|
|
// ],
|
|
|
|
),
|
|
|
|
// ).material(color: Colors.transparent),
|
|
|
|
],
|
|
|
|
// ),
|
|
|
|
).material(color: Colors.transparent),
|
|
|
|
// 24.w.heightBox,
|
|
|
|
),
|
|
|
|
// ],
|
|
|
|
24.w.heightBox,
|
|
|
|
// ),
|
|
|
|
],
|
|
|
|
// ),
|
|
|
|
),
|
|
|
|
// );
|
|
|
|
),
|
|
|
|
// }
|
|
|
|
);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
Widget _buildCard(LifePayModel model, int index) {
|
|
|
|
Widget _buildCard(LifePayModel model, int index) {
|
|
|
|
return Container(
|
|
|
|
return Container(
|
|
|
|
|
|
|
|
padding: EdgeInsets.symmetric(vertical: 20.w),
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
borderRadius: BorderRadius.circular(8.w), color: kForeGroundColor),
|
|
|
|
borderRadius: BorderRadius.circular(8.w), color: kForeGroundColor),
|
|
|
|
child: Row(
|
|
|
|
child: Row(
|
|
|
@ -127,70 +120,26 @@ class _LifePayPageState extends State<LifePayPage> {
|
|
|
|
children: [
|
|
|
|
children: [
|
|
|
|
GestureDetector(
|
|
|
|
GestureDetector(
|
|
|
|
onTap: () {
|
|
|
|
onTap: () {
|
|
|
|
// if (selectItems[index].selected.length ==
|
|
|
|
setState(() {
|
|
|
|
// _getLength(model)) {
|
|
|
|
|
|
|
|
// selectItems[index].value = false;
|
|
|
|
|
|
|
|
// selectItems[index].selected.clear();
|
|
|
|
|
|
|
|
// _selectYears.remove(index);
|
|
|
|
|
|
|
|
// } else {
|
|
|
|
|
|
|
|
// selectItems[index].value = true;
|
|
|
|
|
|
|
|
// _selectYears.add(index);
|
|
|
|
|
|
|
|
// for (var i = 0; i < model.dailyPaymentTypeVos.length; i++) {
|
|
|
|
|
|
|
|
// for (var j = 0;
|
|
|
|
|
|
|
|
// i <
|
|
|
|
|
|
|
|
// model
|
|
|
|
|
|
|
|
// .dailyPaymentTypeVos[i].detailedVoList.length;
|
|
|
|
|
|
|
|
// i++) {
|
|
|
|
|
|
|
|
// String id = model.dailyPaymentTypeVos[i].id.toString() +
|
|
|
|
|
|
|
|
// model.dailyPaymentTypeVos[i].detailedVoList[j]
|
|
|
|
|
|
|
|
// .groupId
|
|
|
|
|
|
|
|
// .toString();
|
|
|
|
|
|
|
|
// if (!selectItems[index].selected.contains(id)) {
|
|
|
|
|
|
|
|
// selectItems[index].selected.add(id);
|
|
|
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
// setState(() {});
|
|
|
|
|
|
|
|
if (_selectYears.contains(index)) {
|
|
|
|
if (_selectYears.contains(index)) {
|
|
|
|
_selectYears.remove(index);
|
|
|
|
_selectYears.remove(index);
|
|
|
|
_totalCost -= _selectPay[index].payTotal;
|
|
|
|
_totalCost -= (_selectPay[index].payTotal ?? 0.0);
|
|
|
|
_count -= _selectPay[index].payCount;
|
|
|
|
_count -= (_selectPay[index].payCount ?? 0);
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
_selectYears.add(index);
|
|
|
|
_selectYears.add(index);
|
|
|
|
_totalCost += _selectPay[index].payTotal;
|
|
|
|
_totalCost += (_selectPay[index].payTotal ?? 0.0);
|
|
|
|
_count += _selectPay[index].payCount;
|
|
|
|
_count += (_selectPay[index].payCount ?? 0);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
setState(() {});
|
|
|
|
});
|
|
|
|
},
|
|
|
|
},
|
|
|
|
child: BeeCheckRadio(
|
|
|
|
child: BeeCheckRadio(
|
|
|
|
value: index,
|
|
|
|
value: index,
|
|
|
|
groupValue: _selectYears,
|
|
|
|
groupValue: _selectYears,
|
|
|
|
// onChange: (value) {
|
|
|
|
|
|
|
|
// if (value) {
|
|
|
|
|
|
|
|
// selectItems[index].value=false;
|
|
|
|
|
|
|
|
// selectItems[index].selected.clear();
|
|
|
|
|
|
|
|
// } else {
|
|
|
|
|
|
|
|
// selectItems[index].value=true;
|
|
|
|
|
|
|
|
// for (var i = 0; i < model.dailyPaymentTypeVos.length; i++) {
|
|
|
|
|
|
|
|
// for (var j = 0;
|
|
|
|
|
|
|
|
// i <
|
|
|
|
|
|
|
|
// model
|
|
|
|
|
|
|
|
// .dailyPaymentTypeVos[i].detailedVoList.length;
|
|
|
|
|
|
|
|
// i++) {
|
|
|
|
|
|
|
|
// selectItems[index].selected.add(
|
|
|
|
|
|
|
|
// model.dailyPaymentTypeVos[i].id.toString() +
|
|
|
|
|
|
|
|
// model.dailyPaymentTypeVos[i].detailedVoList[j]
|
|
|
|
|
|
|
|
// .groupId
|
|
|
|
|
|
|
|
// .toString());
|
|
|
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
// },
|
|
|
|
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
],
|
|
|
|
],
|
|
|
|
),
|
|
|
|
),
|
|
|
|
|
|
|
|
24.w.widthBox,
|
|
|
|
Column(
|
|
|
|
Column(
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
mainAxisSize: MainAxisSize.min,
|
|
|
|
mainAxisSize: MainAxisSize.min,
|
|
|
@ -201,7 +150,7 @@ class _LifePayPageState extends State<LifePayPage> {
|
|
|
|
.size(28.sp)
|
|
|
|
.size(28.sp)
|
|
|
|
.make(),
|
|
|
|
.make(),
|
|
|
|
24.w.heightBox,
|
|
|
|
24.w.heightBox,
|
|
|
|
'待缴:${model.paymentNum}项'
|
|
|
|
'待缴:${model.paymentNum}项 已选${_selectPay[index].payCount}项'
|
|
|
|
.text
|
|
|
|
.text
|
|
|
|
.color(ktextPrimary)
|
|
|
|
.color(ktextPrimary)
|
|
|
|
.size(28.sp)
|
|
|
|
.size(28.sp)
|
|
|
@ -216,26 +165,26 @@ class _LifePayPageState extends State<LifePayPage> {
|
|
|
|
fontWeight: FontWeight.bold),
|
|
|
|
fontWeight: FontWeight.bold),
|
|
|
|
children: [
|
|
|
|
children: [
|
|
|
|
TextSpan(
|
|
|
|
TextSpan(
|
|
|
|
text: '¥',
|
|
|
|
text: '¥ ${_selectPay[index].payTotal}',
|
|
|
|
style: TextStyle(
|
|
|
|
style: TextStyle(
|
|
|
|
color: kDangerColor,
|
|
|
|
color: kDangerColor,
|
|
|
|
fontSize: 28.sp,
|
|
|
|
fontSize: 28.sp,
|
|
|
|
fontWeight: FontWeight.bold)),
|
|
|
|
fontWeight: FontWeight.bold)),
|
|
|
|
]))
|
|
|
|
]))
|
|
|
|
],
|
|
|
|
],
|
|
|
|
),
|
|
|
|
).expand(),
|
|
|
|
Column(
|
|
|
|
Column(
|
|
|
|
mainAxisSize: MainAxisSize.min,
|
|
|
|
mainAxisSize: MainAxisSize.max,
|
|
|
|
mainAxisAlignment: MainAxisAlignment.start,
|
|
|
|
mainAxisAlignment: MainAxisAlignment.start,
|
|
|
|
children: [
|
|
|
|
children: [
|
|
|
|
GestureDetector(
|
|
|
|
GestureDetector(
|
|
|
|
onTap: () {
|
|
|
|
onTap: () async {
|
|
|
|
List payMent = LifePayDetailPage(
|
|
|
|
List payMent = await LifePayDetailPage(
|
|
|
|
model: _models[index],
|
|
|
|
model: _models[index],
|
|
|
|
// selectItems: selectItems[index].selected,
|
|
|
|
|
|
|
|
).to();
|
|
|
|
).to();
|
|
|
|
_selectPay[index].payCount = payMent[0];
|
|
|
|
_selectPay[index].payCount = payMent[0];
|
|
|
|
_selectPay[index].payTotal = payMent[1];
|
|
|
|
_selectPay[index].payTotal = payMent[1];
|
|
|
|
|
|
|
|
setState(() {});
|
|
|
|
},
|
|
|
|
},
|
|
|
|
child: Container(
|
|
|
|
child: Container(
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
decoration: BoxDecoration(
|
|
|
@ -278,6 +227,8 @@ class _LifePayPageState extends State<LifePayPage> {
|
|
|
|
'estateId': userProvider.currentHouseId,
|
|
|
|
'estateId': userProvider.currentHouseId,
|
|
|
|
},
|
|
|
|
},
|
|
|
|
convert: (model) {
|
|
|
|
convert: (model) {
|
|
|
|
|
|
|
|
_selectPay = List.generate(model.tableList.length,
|
|
|
|
|
|
|
|
(index) => SelectPay(payCount: 0, payTotal: 0.0));
|
|
|
|
return model.tableList
|
|
|
|
return model.tableList
|
|
|
|
.map((e) => LifePayModel.fromJson(e))
|
|
|
|
.map((e) => LifePayModel.fromJson(e))
|
|
|
|
.toList();
|
|
|
|
.toList();
|
|
|
@ -286,13 +237,7 @@ class _LifePayPageState extends State<LifePayPage> {
|
|
|
|
_models = items;
|
|
|
|
_models = items;
|
|
|
|
return Column(
|
|
|
|
return Column(
|
|
|
|
children: [
|
|
|
|
children: [
|
|
|
|
// _buildHouseCard(
|
|
|
|
_buildHouseCard(),
|
|
|
|
// kEstateName,
|
|
|
|
|
|
|
|
// userProvider.userDetailModel.estateNames.isEmpty
|
|
|
|
|
|
|
|
// ? ''
|
|
|
|
|
|
|
|
// : BeeParse.getEstateName(
|
|
|
|
|
|
|
|
// userProvider.userDetailModel.estateNames[0])),
|
|
|
|
|
|
|
|
BeeHeaderHouse(),
|
|
|
|
|
|
|
|
16.w.heightBox,
|
|
|
|
16.w.heightBox,
|
|
|
|
Container(
|
|
|
|
Container(
|
|
|
|
padding: EdgeInsets.all(32.w),
|
|
|
|
padding: EdgeInsets.all(32.w),
|
|
|
@ -304,7 +249,8 @@ class _LifePayPageState extends State<LifePayPage> {
|
|
|
|
children: [
|
|
|
|
children: [
|
|
|
|
'缴费账单'.text.color(ktextPrimary).size(28.sp).make(),
|
|
|
|
'缴费账单'.text.color(ktextPrimary).size(28.sp).make(),
|
|
|
|
...List.generate(items.length,
|
|
|
|
...List.generate(items.length,
|
|
|
|
(index) => _buildCard(items[index], index)),
|
|
|
|
(index) => _buildCard(items[index], index))
|
|
|
|
|
|
|
|
.sepWidget(separate: BeeDivider.horizontal()),
|
|
|
|
],
|
|
|
|
],
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
@ -317,19 +263,6 @@ class _LifePayPageState extends State<LifePayPage> {
|
|
|
|
32.w, 16.w, 32.w, 12.w + MediaQuery.of(context).padding.bottom),
|
|
|
|
32.w, 16.w, 32.w, 12.w + MediaQuery.of(context).padding.bottom),
|
|
|
|
child: Row(
|
|
|
|
child: Row(
|
|
|
|
children: [
|
|
|
|
children: [
|
|
|
|
// BeeCheckBox.round(
|
|
|
|
|
|
|
|
// onChange: (value) {
|
|
|
|
|
|
|
|
// if (value) {
|
|
|
|
|
|
|
|
// _selectYears.clear();
|
|
|
|
|
|
|
|
// } else {
|
|
|
|
|
|
|
|
// for (var i = 0; i < _models.length; i++) {
|
|
|
|
|
|
|
|
// _selectYears.add(i);
|
|
|
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
// setState(() {});
|
|
|
|
|
|
|
|
// },
|
|
|
|
|
|
|
|
// size: 40.w,
|
|
|
|
|
|
|
|
// ),
|
|
|
|
|
|
|
|
GestureDetector(
|
|
|
|
GestureDetector(
|
|
|
|
onTap: () {
|
|
|
|
onTap: () {
|
|
|
|
if (_models.length == _selectYears.length) {
|
|
|
|
if (_models.length == _selectYears.length) {
|
|
|
@ -395,7 +328,7 @@ class _LifePayPageState extends State<LifePayPage> {
|
|
|
|
fontSize: 32.sp,
|
|
|
|
fontSize: 32.sp,
|
|
|
|
fontWeight: FontWeight.bold)),
|
|
|
|
fontWeight: FontWeight.bold)),
|
|
|
|
])),
|
|
|
|
])),
|
|
|
|
'$_count'.text.color(ktextSubColor).size(20.sp).make(),
|
|
|
|
'已选$_count项'.text.color(ktextSubColor).size(20.sp).make(),
|
|
|
|
],
|
|
|
|
],
|
|
|
|
),
|
|
|
|
),
|
|
|
|
24.w.widthBox,
|
|
|
|
24.w.widthBox,
|
|
|
|