diff --git a/lib/pages/life_pay/life_pay_page.dart b/lib/pages/life_pay/life_pay_page.dart index 6d85a58a..be99ce8c 100644 --- a/lib/pages/life_pay/life_pay_page.dart +++ b/lib/pages/life_pay/life_pay_page.dart @@ -212,17 +212,16 @@ class _LifePayPageState extends State { return BeeScaffold( title: '生活缴费', actions: [ - //TODO 缴费记录 无接口 - // InkWell( - // onTap: () { - // LifePayRecordPage().to(); - // }, - // child: Container( - // padding: EdgeInsets.fromLTRB(32.w, 28.w, 32.w, 20.w), - // alignment: Alignment.center, - // child: '缴费记录'.text.black.size(28.sp).make(), - // ), - // ), + InkWell( + onTap: () { + // LifePayRecordPage().to(); + }, + child: Container( + padding: EdgeInsets.fromLTRB(32.w, 28.w, 32.w, 20.w), + alignment: Alignment.center, + child: '缴费记录'.text.black.size(28.sp).make(), + ), + ), ], body: BeeListView( path: API.manager.dailyPaymentList, 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 790dd69f..757f86a7 100644 --- a/lib/pages/life_pay/widget/life_pay_detail_page.dart +++ b/lib/pages/life_pay/widget/life_pay_detail_page.dart @@ -42,6 +42,27 @@ class _LifePayDetailPageState extends State { 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) { return GestureDetector( onTap: () { @@ -75,10 +96,6 @@ class _LifePayDetailPageState extends State { .bold .make(), 24.w.widthBox, - Icon( - CupertinoIcons.chevron_forward, - size: 40.w, - ), ], ).material(color: Colors.transparent), ); @@ -131,36 +148,35 @@ class _LifePayDetailPageState extends State { children: [ GestureDetector( onTap: () { - setState(() { - if (isAllSelect) { - _selectItems.clear(); - _payNum = 0; - _payTotal = 0; - } else { - for (var i = 0; - i < widget.model.dailyPaymentTypeVos.length; - i++) { - for (var j = 0; - i < - widget.model.dailyPaymentTypeVos[i].detailedVoList - .length; - i++) { - 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(); - } + if (isAllSelect) { + _selectItems.clear(); + _payNum = 0; + _payTotal = 0; + } else { + 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(); } } } - }); + } + setState(() {}); }, child: AnimatedContainer( duration: Duration(milliseconds: 300), @@ -205,6 +221,7 @@ class _LifePayDetailPageState extends State { '已选$_payNum项'.text.color(ktextSubColor).size(20.sp).make(), ], ), + 8.w.widthBox, MaterialButton( elevation: 0, shape: RoundedRectangleBorder(