From 171e3f6596ff1e18596d97ec1c93cf1add31778c Mon Sep 17 00:00:00 2001 From: zhangmeng <494089941@qq.com> Date: Thu, 8 Jul 2021 11:43:45 +0800 Subject: [PATCH] =?UTF-8?q?=E9=87=8D=E6=9E=84=20=E7=94=9F=E6=B4=BB?= =?UTF-8?q?=E7=BC=B4=E8=B4=B9=E6=A8=A1=E5=9D=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/model/manager/life_pay_model.dart | 277 ++++++------ lib/model/manager/life_pay_record_model.dart | 2 +- lib/models/life_pay/life_pay_list_model.dart | 102 +++++ .../life_pay/life_pay_list_model.g.dart | 87 ++++ lib/pages/life_pay/life_pay_page.dart | 343 ++++++++------ lib/pages/life_pay/life_pay_record_page.dart | 9 +- lib/pages/life_pay/shar_life_pay_model.dart | 21 + .../life_pay/widget/life_pay_detail_page.dart | 419 +++++++++++------- .../contract_stop/pay_surplus_rent_page.dart | 31 +- .../house/contract_stop/refund_bond_page.dart | 2 +- macos/Podfile.lock | 12 + pubspec.lock | 7 + pubspec.yaml | 3 +- 13 files changed, 869 insertions(+), 446 deletions(-) create mode 100644 lib/models/life_pay/life_pay_list_model.dart create mode 100644 lib/models/life_pay/life_pay_list_model.g.dart create mode 100644 lib/pages/life_pay/shar_life_pay_model.dart diff --git a/lib/model/manager/life_pay_model.dart b/lib/model/manager/life_pay_model.dart index 01bc0a59..4d854c5f 100644 --- a/lib/model/manager/life_pay_model.dart +++ b/lib/model/manager/life_pay_model.dart @@ -1,138 +1,139 @@ -class LifePayModel { - int? years; - int? paymentNum; - List? dailyPaymentTypeVos; - - LifePayModel({this.years, this.paymentNum, this.dailyPaymentTypeVos}); - - LifePayModel.fromJson(Map json) { - years = json['years']; - paymentNum = json['paymentNum']; - if (json['dailyPaymentTypeVos'] != null) { - dailyPaymentTypeVos = []; - json['dailyPaymentTypeVos'].forEach((v) { - dailyPaymentTypeVos!.add(new DailyPaymentTypeVos.fromJson(v)); - }); - } - } - - Map toJson() { - final Map data = new Map(); - data['years'] = this.years; - data['paymentNum'] = this.paymentNum; - if (this.dailyPaymentTypeVos != null) { - data['dailyPaymentTypeVos'] = - this.dailyPaymentTypeVos!.map((v) => v.toJson()).toList(); - } - return data; - } -} - -class DailyPaymentTypeVos { - int? id; - String? name; - List? detailedVoList; - - DailyPaymentTypeVos({this.id, this.name, this.detailedVoList}); - - DailyPaymentTypeVos.fromJson(Map json) { - id = json['id']; - name = json['name']; - if (json['detailedVoList'] != null) { - detailedVoList = []; - json['detailedVoList'].forEach((v) { - detailedVoList!.add(new DetailedVoList.fromJson(v)); - }); - } - } - - Map toJson() { - final Map data = new Map(); - data['id'] = this.id; - data['name'] = this.name; - if (this.detailedVoList != null) { - data['detailedVoList'] = - this.detailedVoList!.map((v) => v.toJson()).toList(); - } - return data; - } -} - -class DetailedVoList { - int? groupId; - double? paymentPrice; - List? detailsVoList; - - DetailedVoList({this.groupId, this.paymentPrice, this.detailsVoList}); - - DetailedVoList.fromJson(Map json) { - groupId = json['groupId']; - paymentPrice = json['paymentPrice']; - if (json['detailsVoList'] != null) { - detailsVoList = []; - json['detailsVoList'].forEach((v) { - detailsVoList!.add(new DetailsVoList.fromJson(v)); - }); - } - } - - Map toJson() { - final Map data = new Map(); - data['groupId'] = this.groupId; - data['paymentPrice'] = this.paymentPrice; - if (this.detailsVoList != null) { - data['detailsVoList'] = - this.detailsVoList!.map((v) => v.toJson()).toList(); - } - return data; - } -} - -class DetailsVoList { - int? id; - String? month; - double? costPrice; - double? paidPrice; - double? totalPrice; - String? beginDate; - String? endDate; - String? unitPriceType; - int? num; - - DetailsVoList( - {this.id, - this.month, - this.costPrice, - this.paidPrice, - this.totalPrice, - this.beginDate, - this.endDate, - this.unitPriceType, - this.num}); - - DetailsVoList.fromJson(Map json) { - id = json['id']; - month = json['month']; - costPrice = json['costPrice']; - paidPrice = json['paidPrice']; - totalPrice = json['totalPrice']; - beginDate = json['beginDate']; - endDate = json['endDate']; - unitPriceType = json['unitPriceType']; - num = json['num']; - } - - Map toJson() { - final Map data = new Map(); - data['id'] = this.id; - data['month'] = this.month; - data['costPrice'] = this.costPrice; - data['paidPrice'] = this.paidPrice; - data['totalPrice'] = this.totalPrice; - data['beginDate'] = this.beginDate; - data['endDate'] = this.endDate; - data['unitPriceType'] = this.unitPriceType; - data['num'] = this.num; - return data; - } -} +// class LifePayModel { +// int? years; +// int? paymentNum; +// List? dailyPaymentTypeVos; + +// LifePayModel({this.years, this.paymentNum, this.dailyPaymentTypeVos}); + +// LifePayModel.fromJson(Map json) { +// years = json['years']; +// paymentNum = json['paymentNum']; +// if (json['dailyPaymentTypeVos'] != null) { +// dailyPaymentTypeVos = []; +// json['dailyPaymentTypeVos'].forEach((v) { +// dailyPaymentTypeVos!.add(new DailyPaymentTypeVos.fromJson(v)); +// }); +// } +// } + +// Map toJson() { +// final Map data = new Map(); +// data['years'] = this.years; +// data['paymentNum'] = this.paymentNum; +// if (this.dailyPaymentTypeVos != null) { +// data['dailyPaymentTypeVos'] = +// this.dailyPaymentTypeVos!.map((v) => v.toJson()).toList(); +// } +// return data; +// } + +// } + +// class DailyPaymentTypeVos { +// int? id; +// String? name; +// List? detailedVoList; + +// DailyPaymentTypeVos({this.id, this.name, this.detailedVoList}); + +// DailyPaymentTypeVos.fromJson(Map json) { +// id = json['id']; +// name = json['name']; +// if (json['detailedVoList'] != null) { +// detailedVoList = []; +// json['detailedVoList'].forEach((v) { +// detailedVoList!.add(new DetailedVoList.fromJson(v)); +// }); +// } +// } + +// Map toJson() { +// final Map data = new Map(); +// data['id'] = this.id; +// data['name'] = this.name; +// if (this.detailedVoList != null) { +// data['detailedVoList'] = +// this.detailedVoList!.map((v) => v.toJson()).toList(); +// } +// return data; +// } +// } + +// class DetailedVoList { +// int? groupId; +// double? paymentPrice; +// List? detailsVoList; + +// DetailedVoList({this.groupId, this.paymentPrice, this.detailsVoList}); + +// DetailedVoList.fromJson(Map json) { +// groupId = json['groupId']; +// paymentPrice = json['paymentPrice']; +// if (json['detailsVoList'] != null) { +// detailsVoList = []; +// json['detailsVoList'].forEach((v) { +// detailsVoList!.add(new DetailsVoList.fromJson(v)); +// }); +// } +// } + +// Map toJson() { +// final Map data = new Map(); +// data['groupId'] = this.groupId; +// data['paymentPrice'] = this.paymentPrice; +// if (this.detailsVoList != null) { +// data['detailsVoList'] = +// this.detailsVoList!.map((v) => v.toJson()).toList(); +// } +// return data; +// } +// } + +// class DetailsVoList { +// int? id; +// String? month; +// double? costPrice; +// double? paidPrice; +// double? totalPrice; +// String? beginDate; +// String? endDate; +// String? unitPriceType; +// int? num; + +// DetailsVoList( +// {this.id, +// this.month, +// this.costPrice, +// this.paidPrice, +// this.totalPrice, +// this.beginDate, +// this.endDate, +// this.unitPriceType, +// this.num}); + +// DetailsVoList.fromJson(Map json) { +// id = json['id']; +// month = json['month']; +// costPrice = json['costPrice']; +// paidPrice = json['paidPrice']; +// totalPrice = json['totalPrice']; +// beginDate = json['beginDate']; +// endDate = json['endDate']; +// unitPriceType = json['unitPriceType']; +// num = json['num']; +// } + +// Map toJson() { +// final Map data = new Map(); +// data['id'] = this.id; +// data['month'] = this.month; +// data['costPrice'] = this.costPrice; +// data['paidPrice'] = this.paidPrice; +// data['totalPrice'] = this.totalPrice; +// data['beginDate'] = this.beginDate; +// data['endDate'] = this.endDate; +// data['unitPriceType'] = this.unitPriceType; +// data['num'] = this.num; +// return data; +// } +// } diff --git a/lib/model/manager/life_pay_record_model.dart b/lib/model/manager/life_pay_record_model.dart index aaec4893..6ad88734 100644 --- a/lib/model/manager/life_pay_record_model.dart +++ b/lib/model/manager/life_pay_record_model.dart @@ -3,7 +3,7 @@ class LifePayRecordModel { String? chargesTemplateDetailName; String? roomName; String? years; - int? paidPrice; + num? paidPrice; String? createDate; int? payType; String? code; diff --git a/lib/models/life_pay/life_pay_list_model.dart b/lib/models/life_pay/life_pay_list_model.dart new file mode 100644 index 00000000..7945b697 --- /dev/null +++ b/lib/models/life_pay/life_pay_list_model.dart @@ -0,0 +1,102 @@ +import 'package:equatable/equatable.dart'; +import 'package:json_annotation/json_annotation.dart'; +part 'life_pay_list_model.g.dart'; + +@JsonSerializable(createToJson: true, explicitToJson: true) +class LifePayListModel extends Equatable { + final int years; + final int paymentNum; + final List dailyPaymentTypeVos; + LifePayListModel({ + required this.years, + required this.paymentNum, + required this.dailyPaymentTypeVos, + }); + factory LifePayListModel.fromJson(Map json) => + _$LifePayListModelFromJson(json); + factory LifePayListModel.zero() => + LifePayListModel(years: 0, paymentNum: 0, dailyPaymentTypeVos: [ + DailyPaymentTypeVos(id: 0, name: '', detailedVoList: [ + DetailedVoList(groupId: 0, paymentPrice: 0, detailsVoList: []) + ]) + ]); + Map toJson() => _$LifePayListModelToJson(this); + @override + List get props => [years, paymentNum, dailyPaymentTypeVos]; +} + +@JsonSerializable(createToJson: true, explicitToJson: true) +class DailyPaymentTypeVos extends Equatable { + final int id; + final String name; + final List detailedVoList; + DailyPaymentTypeVos({ + required this.id, + required this.name, + required this.detailedVoList, + }); + factory DailyPaymentTypeVos.fromJson(Map json) => + _$DailyPaymentTypeVosFromJson(json); + Map toJson() => _$DailyPaymentTypeVosToJson(this); + @override + List get props => [id, name, detailedVoList]; +} + +@JsonSerializable(createToJson: true, explicitToJson: true) +class DetailedVoList extends Equatable { + final int groupId; + final num paymentPrice; + final List detailsVoList; + DetailedVoList({ + required this.groupId, + required this.paymentPrice, + required this.detailsVoList, + }); + factory DetailedVoList.fromJson(Map json) => + _$DetailedVoListFromJson(json); + Map toJson() => _$DetailedVoListToJson(this); + @override + List get props => [groupId, paymentPrice, detailsVoList]; +} + +@JsonSerializable(createToJson: true, explicitToJson: true) +class DetailsVoList extends Equatable { + final int id; + final String month; + final num costPrice; + final num paidPrice; + final num totalPrice; + final String beginDate; + final String endDate; + final String unitPriceType; + @JsonKey(name: 'num') + final int number; + DetailsVoList({ + required this.id, + required this.month, + required this.costPrice, + required this.paidPrice, + required this.totalPrice, + required this.beginDate, + required this.endDate, + required this.unitPriceType, + required this.number, + }); + factory DetailsVoList.fromJson(Map json) => + _$DetailsVoListFromJson(json); + Map toJson() => _$DetailsVoListToJson(this); + @override + List get props { + return [ + id, + month, + costPrice, + paidPrice, + totalPrice, + beginDate, + endDate, + unitPriceType, + number, + ]; + } +} diff --git a/lib/models/life_pay/life_pay_list_model.g.dart b/lib/models/life_pay/life_pay_list_model.g.dart new file mode 100644 index 00000000..4d49d710 --- /dev/null +++ b/lib/models/life_pay/life_pay_list_model.g.dart @@ -0,0 +1,87 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'life_pay_list_model.dart'; + +// ************************************************************************** +// JsonSerializableGenerator +// ************************************************************************** + +LifePayListModel _$LifePayListModelFromJson(Map json) { + return LifePayListModel( + years: json['years'] as int, + paymentNum: json['paymentNum'] as int, + dailyPaymentTypeVos: (json['dailyPaymentTypeVos'] as List) + .map((e) => DailyPaymentTypeVos.fromJson(e as Map)) + .toList(), + ); +} + +Map _$LifePayListModelToJson(LifePayListModel instance) => + { + 'years': instance.years, + 'paymentNum': instance.paymentNum, + 'dailyPaymentTypeVos': + instance.dailyPaymentTypeVos.map((e) => e.toJson()).toList(), + }; + +DailyPaymentTypeVos _$DailyPaymentTypeVosFromJson(Map json) { + return DailyPaymentTypeVos( + id: json['id'] as int, + name: json['name'] as String, + detailedVoList: (json['detailedVoList'] as List) + .map((e) => DetailedVoList.fromJson(e as Map)) + .toList(), + ); +} + +Map _$DailyPaymentTypeVosToJson( + DailyPaymentTypeVos instance) => + { + 'id': instance.id, + 'name': instance.name, + 'detailedVoList': instance.detailedVoList.map((e) => e.toJson()).toList(), + }; + +DetailedVoList _$DetailedVoListFromJson(Map json) { + return DetailedVoList( + groupId: json['groupId'] as int, + paymentPrice: json['paymentPrice'] as num, + detailsVoList: (json['detailsVoList'] as List) + .map((e) => DetailsVoList.fromJson(e as Map)) + .toList(), + ); +} + +Map _$DetailedVoListToJson(DetailedVoList instance) => + { + 'groupId': instance.groupId, + 'paymentPrice': instance.paymentPrice, + 'detailsVoList': instance.detailsVoList.map((e) => e.toJson()).toList(), + }; + +DetailsVoList _$DetailsVoListFromJson(Map json) { + return DetailsVoList( + id: json['id'] as int, + month: json['month'] as String, + costPrice: json['costPrice'] as num, + paidPrice: json['paidPrice'] as num, + totalPrice: json['totalPrice'] as num, + beginDate: json['beginDate'] as String, + endDate: json['endDate'] as String, + unitPriceType: json['unitPriceType'] as String, + number: json['num'] as int, + ); +} + +Map _$DetailsVoListToJson(DetailsVoList instance) => + { + 'id': instance.id, + 'month': instance.month, + 'costPrice': instance.costPrice, + 'paidPrice': instance.paidPrice, + 'totalPrice': instance.totalPrice, + 'beginDate': instance.beginDate, + 'endDate': instance.endDate, + 'unitPriceType': instance.unitPriceType, + 'num': instance.number, + }; diff --git a/lib/pages/life_pay/life_pay_page.dart b/lib/pages/life_pay/life_pay_page.dart index aeaee8ad..9a386995 100644 --- a/lib/pages/life_pay/life_pay_page.dart +++ b/lib/pages/life_pay/life_pay_page.dart @@ -1,3 +1,6 @@ +import 'package:aku_community/models/life_pay/life_pay_list_model.dart'; +import 'package:aku_community/utils/network/base_list_model.dart'; +import 'package:aku_community/widget/bee_divider.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; @@ -9,18 +12,15 @@ import 'package:velocity_x/velocity_x.dart'; import 'package:aku_community/base/base_style.dart'; import 'package:aku_community/constants/api.dart'; -import 'package:aku_community/model/manager/life_pay_model.dart'; import 'package:aku_community/pages/life_pay/life_pay_record_page.dart'; import 'package:aku_community/pages/life_pay/pay_finish_page.dart'; import 'package:aku_community/pages/life_pay/pay_util.dart'; import 'package:aku_community/pages/life_pay/widget/life_pay_detail_page.dart'; -import 'package:aku_community/pages/things_page/widget/bee_list_view.dart'; import 'package:aku_community/provider/app_provider.dart'; import 'package:aku_community/utils/bee_parse.dart'; import 'package:aku_community/utils/headers.dart'; import 'package:aku_community/utils/network/base_model.dart'; import 'package:aku_community/utils/network/net_util.dart'; -import 'package:aku_community/widget/bee_divider.dart'; import 'package:aku_community/widget/bee_scaffold.dart'; import 'package:aku_community/widget/buttons/bee_check_radio.dart'; import 'package:aku_community/widget/others/house_head_card.dart'; @@ -43,14 +43,46 @@ class SelectPay { class _LifePayPageState extends State { EasyRefreshController? _controller; List _selectYears = []; //选择的年份,存储其数组下标 - List _models = []; - List _selectPay = []; //辅助计算总费用数组 储存下级页面传递出来的已选费用参数 - double _totalCost = 0; //总费用 - int _count = 0; //费用项数 - List _ids = []; //存储选中的主键id数组 + List _models = []; + // List _selectPay = []; //辅助计算总费用数组 储存下级页面传递出来的已选费用参数 + // double _totalCost = 0; //总费用 + // // int _count = 0; //费用项数 + // List _ids = []; //存储选中的主键id数组 + int _page = 0; + int _size = 10; + + List _selectModels = []; //选中的models bool get allSelect => ((_models.length == _selectYears.length) && (_models.length != 0)); + SelectPay get total { + int count = 0; + double price = 0; + List ids = []; + for (var i in _selectYears) { + SelectPay _select = selectCount(_selectModels[i]); + count += _select.payCount; + price += _select.payTotal; + ids.addAll(_select.ids); + } + return SelectPay(payCount: count, payTotal: price, ids: ids); + } + + SelectPay selectCount(LifePayListModel model) { + int count = 0; + double price = 0; + List ids = []; + model.dailyPaymentTypeVos.forEach((element) { + element.detailedVoList.forEach((element) { + element.detailsVoList.forEach((element) { + count++; + price += element.costPrice; + ids.add(element.id); + }); + }); + }); + return SelectPay(payCount: count, payTotal: price, ids: ids); + } @override void initState() { @@ -65,7 +97,8 @@ class _LifePayPageState extends State { super.dispose(); } - Widget _buildCard(LifePayModel model, int index) { + Widget _buildCard(LifePayListModel model, int index) { + SelectPay _select = selectCount(_selectModels[index]); return Container( padding: EdgeInsets.symmetric(vertical: 20.w), decoration: BoxDecoration( @@ -81,16 +114,17 @@ class _LifePayPageState extends State { setState(() { if (_selectYears.contains(index)) { _selectYears.remove(index); - _totalCost -= (_selectPay[index].payTotal); - _count -= (_selectPay[index].payCount); - _selectPay[index].ids.forEach((element) { - _ids.remove(element); - }); + // _totalCost -= (_selectPay[index].payTotal); + // _count -= (_selectPay[index].payCount); + // _selectPay[index].ids.forEach((element) { + // _ids.remove(element); + // }); + } else { _selectYears.add(index); - _totalCost += (_selectPay[index].payTotal); - _count += (_selectPay[index].payCount); - _ids.addAll(_selectPay[index].ids); + // _totalCost += (_selectPay[index].payTotal); + // _count += (_selectPay[index].payCount); + // _ids.addAll(_selectPay[index].ids); } }); }, @@ -106,13 +140,13 @@ class _LifePayPageState extends State { crossAxisAlignment: CrossAxisAlignment.start, mainAxisSize: MainAxisSize.min, children: [ - '${BeeParse.getCustomYears(model.years!)}(${model.years})' + '${BeeParse.getCustomYears(model.years)}(${model.years})' .text .color(ktextSubColor) .size(28.sp) .make(), 24.w.heightBox, - '待缴:${model.paymentNum}项 已选${_selectPay[index].payCount}项' + '待缴:${model.paymentNum}项 已选${_select.payCount}项' .text .color(ktextPrimary) .size(28.sp) @@ -127,8 +161,7 @@ class _LifePayPageState extends State { fontWeight: FontWeight.bold), children: [ TextSpan( - text: - '¥ ${_selectPay[index].payTotal.toStringAsFixed(2)}', + text: '¥ ${_select.payTotal.toStringAsFixed(2)}', style: TextStyle( color: kDangerColor, fontSize: 28.sp, @@ -143,22 +176,28 @@ class _LifePayPageState extends State { GestureDetector( onTap: () async { if (_selectYears.contains(index)) { - _totalCost -= _selectPay[index].payTotal; - _count -= _selectPay[index].payCount; - _selectPay[index].ids.forEach((element) { - _ids.remove(element); - }); + // _totalCost -= _selectPay[index].payTotal; + // _count -= _selectPay[index].payCount; + // _selectPay[index].ids.forEach((element) { + // _ids.remove(element); + // }); } - List payMent = await (Get.to( - () => LifePayDetailPage(model: _models[index]))); - _selectPay[index].payCount = payMent[0]; - _selectPay[index].payTotal = payMent[1]; - _selectPay[index].ids = payMent[2]; - if (_selectYears.contains(index)) { - _totalCost += _selectPay[index].payTotal; - _count += _selectPay[index].payCount; + dynamic payMent = await (Get.to(() => LifePayDetailPage( + model: _models[index], + selectModel: _selectModels[index], + year: model.years, + ))); + if (payMent.runtimeType == LifePayListModel) { + _selectModels[index] = payMent; } + // _selectPay[index].payCount = payMent[0]; + // _selectPay[index].payTotal = payMent[1]; + // _selectPay[index].ids = payMent[2]; + // if (_selectYears.contains(index)) { + // _totalCost += _selectPay[index].payTotal; + // _count += _selectPay[index].payCount; + // } setState(() {}); }, child: Container( @@ -178,62 +217,62 @@ class _LifePayPageState extends State { ); } - double getPayTotal(LifePayModel list) { - num total = 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; - } + // double getPayTotal(LifePayListModel list) { + // num total = 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; + // } - List getIds(LifePayModel list) { - List _list = []; - if (list.dailyPaymentTypeVos != null) { - for (var item in list.dailyPaymentTypeVos!) { - for (var v in item.detailedVoList!) { - _list.addAll(_findIds(v.detailsVoList ?? [])); - } - } - } - return _list; - } + // List getIds(LifePayListModel list) { + // List _list = []; + // if (list.dailyPaymentTypeVos != null) { + // for (var item in list.dailyPaymentTypeVos!) { + // for (var v in item.detailedVoList!) { + // _list.addAll(_findIds(v.detailsVoList ?? [])); + // } + // } + // } + // return _list; + // } - List _findIds(List list) { - List _list = []; - list.forEach((element) { - _list.add(element.id!); - }); - return _list; - } + // List _findIds(List list) { + // List _list = []; + // list.forEach((element) { + // _list.add(element.id!); + // }); + // return _list; + // } - _allSelectOption() { - //若已全选则清空已选年份数组 - if (_models.length == _selectYears.length) { - _selectYears.clear(); - _ids.clear(); - _totalCost = 0; - _count = 0; - } else { - for (var i = 0; i < _models.length; i++) { - if (!_selectYears.contains(i)) { - _selectYears.add(i); - } - } - _totalCost = 0; - _count = 0; - _ids.clear(); - for (var item in _selectPay) { - _totalCost += item.payTotal; - _count += item.payCount; - _ids.addAll(item.ids); - } - } - setState(() {}); - } + // _allSelectOption() { + // //若已全选则清空已选年份数组 + // if (_models.length == _selectYears.length) { + // _selectYears.clear(); + // _ids.clear(); + // _totalCost = 0; + // _count = 0; + // } else { + // for (var i = 0; i < _models.length; i++) { + // if (!_selectYears.contains(i)) { + // _selectYears.add(i); + // } + // } + // _totalCost = 0; + // _count = 0; + // _ids.clear(); + // for (var item in _selectPay) { + // _totalCost += item.payTotal; + // _count += item.payCount; + // _ids.addAll(item.ids); + // } + // } + // setState(() {}); + // } Widget _payButton() { return MaterialButton( @@ -245,9 +284,9 @@ class _LifePayPageState extends State { Function cancel = BotToast.showLoading(); BaseModel baseModel = await NetUtil().post('/user/alipay/dailyPaymentAlipay', params: { - "ids": _ids, + "ids": total.ids, "payType": 1, //暂时写死 等待后续补充 - "payPrice": _totalCost.toStringAsFixed(2) + "payPrice": total.payTotal }); if (baseModel.status ?? false) { bool result = await PayUtil() @@ -279,52 +318,66 @@ class _LifePayPageState extends State { ), ), ], - - //TODO:重构listview; - body: BeeListView( - path: API.manager.dailyPaymentList, - controller: _controller, - extraParams: {'estateId': appProvider.selectedHouse!.estateId}, - convert: (model) { - List lifePayModels = - model.tableList!.map((e) => LifePayModel.fromJson(e)).toList(); - _selectPay.clear(); - _selectPay.addAll(lifePayModels - .map((e) => SelectPay( - payCount: e.dailyPaymentTypeVos!.length, - payTotal: getPayTotal(e), - ids: getIds(e))) - .toList()); - return lifePayModels; - }, - builder: (items) { - if (items != null) _models = items as List; - return Column( - children: [ - HouseHeadCard( - onChanged: () { - _controller!.callRefresh(); - }, - context: context), - 16.w.heightBox, - Container( - padding: EdgeInsets.all(32.w), - width: double.infinity, - color: kForeGroundColor, - constraints: BoxConstraints(minHeight: 20.w), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - '缴费账单'.text.color(ktextPrimary).size(28.sp).make(), - ...List.generate(items.length, - (index) => _buildCard(items[index], index)) - .sepWidget(separate: BeeDivider.horizontal()), - ], - ), - ), - ], - ); - }), + body: EasyRefresh( + firstRefresh: true, + header: MaterialHeader(), + controller: _controller, + onRefresh: () async { + _page = 1; + _size = 10; + BaseListModel baseListModel = await NetUtil() + .getList(API.manager.dailyPaymentList, params: { + "pageNum": _page, + "size": _size, + 'estateId': appProvider.selectedHouse!.estateId + }); + _models = baseListModel.tableList! + .map((e) => LifePayListModel.fromJson(e)) + .toList(); + // _selectPay.clear(); + _selectYears.clear(); + _selectModels = _models + .map((e) => LifePayListModel.fromJson(e.toJson())) + .toList(); + for (var i = 0; i < _selectModels.length; i++) { + _selectYears.add(i); + } + // _totalCost = 0; + // _count = 0; + // _selectPay.addAll(_models + // .map((e) => SelectPay( + // payCount: e.dailyPaymentTypeVos!.length, + // payTotal: getPayTotal(e), + // ids: getIds(e))) + // .toList()); + if (mounted) setState(() {}); + }, + child: Column( + children: [ + HouseHeadCard( + onChanged: () { + _controller!.callRefresh(); + }, + context: context), + 16.w.heightBox, + Container( + padding: EdgeInsets.all(32.w), + width: double.infinity, + color: kForeGroundColor, + constraints: BoxConstraints(minHeight: 20.w), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + '缴费账单'.text.color(ktextPrimary).size(28.sp).make(), + ...List.generate(_models.length, + (index) => _buildCard(_models[index], index)) + .sepWidget(separate: BeeDivider.horizontal()), + ], + ), + ), + ], + ), + ), bottomNavi: Container( color: kForeGroundColor, padding: EdgeInsets.fromLTRB( @@ -333,7 +386,17 @@ class _LifePayPageState extends State { children: [ GestureDetector( onTap: () { - _allSelectOption(); + // _allSelectOption(); + if (allSelect) { + _selectYears.clear(); + setState(() {}); + } else { + _selectYears.clear(); + for (var i = 0; i < _selectModels.length; i++) { + _selectYears.add(i); + } + setState(() {}); + } }, child: AnimatedContainer( duration: Duration(milliseconds: 300), @@ -369,13 +432,17 @@ class _LifePayPageState extends State { fontWeight: FontWeight.bold), children: [ TextSpan( - text: _totalCost.toStringAsFixed(2), + text: '¥${total.payTotal.toStringAsFixed(2)}', style: TextStyle( color: kDangerColor, fontSize: 32.sp, fontWeight: FontWeight.bold)), ])), - '已选$_count项'.text.color(ktextSubColor).size(20.sp).make(), + '已选${total.payCount}项' + .text + .color(ktextSubColor) + .size(20.sp) + .make(), ], ), 24.w.widthBox, diff --git a/lib/pages/life_pay/life_pay_record_page.dart b/lib/pages/life_pay/life_pay_record_page.dart index 38886cdd..22e401fe 100644 --- a/lib/pages/life_pay/life_pay_record_page.dart +++ b/lib/pages/life_pay/life_pay_record_page.dart @@ -11,6 +11,7 @@ import 'package:aku_community/model/manager/life_pay_record_model.dart'; import 'package:aku_community/pages/things_page/widget/bee_list_view.dart'; import 'package:aku_community/utils/headers.dart'; import 'package:aku_community/widget/bee_scaffold.dart'; +import 'package:aku_community/extensions/widget_list_ext.dart'; class LifePayRecordPage extends StatefulWidget { LifePayRecordPage({Key? key}) : super(key: key); @@ -64,9 +65,11 @@ class _LifePayRecordPageState extends State { .color(ktextSubColor) .make(), 32.w.heightBox, - ...items - .map((e) => _buildRecordCard(e as LifePayRecordModel)) - .toList() + ...[ + ...items + .map((e) => _buildRecordCard(e as LifePayRecordModel)) + .toList() + ].sepWidget(separate: 24.w.heightBox) ], ); }, diff --git a/lib/pages/life_pay/shar_life_pay_model.dart b/lib/pages/life_pay/shar_life_pay_model.dart new file mode 100644 index 00000000..fbe1f2fe --- /dev/null +++ b/lib/pages/life_pay/shar_life_pay_model.dart @@ -0,0 +1,21 @@ + +import 'package:aku_community/models/life_pay/life_pay_list_model.dart'; +import 'package:flutter/material.dart'; + +class SharLifPayModel extends InheritedWidget { + SharLifPayModel({Key? key, required this.child, required this.models}) + : super(key: key, child: child); + + final Widget child; + List models; + + static SharLifPayModel? of(BuildContext context) { + return context.dependOnInheritedWidgetOfExactType(); + } + + @override + bool updateShouldNotify(SharLifPayModel oldWidget) { + return oldWidget.models != models; + } + +} 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 f206e6f8..edc434b3 100644 --- a/lib/pages/life_pay/widget/life_pay_detail_page.dart +++ b/lib/pages/life_pay/widget/life_pay_detail_page.dart @@ -1,3 +1,6 @@ +import 'package:aku_community/models/life_pay/life_pay_list_model.dart'; +import 'package:aku_community/pages/life_pay/life_pay_page.dart'; +import 'package:expandable/expandable.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; @@ -5,7 +8,6 @@ import 'package:get/get.dart'; import 'package:provider/provider.dart'; import 'package:aku_community/base/base_style.dart'; -import 'package:aku_community/model/manager/life_pay_model.dart'; import 'package:aku_community/provider/app_provider.dart'; import 'package:aku_community/utils/bee_parse.dart'; import 'package:aku_community/utils/headers.dart'; @@ -13,10 +15,14 @@ import 'package:aku_community/widget/bee_scaffold.dart'; import 'package:aku_community/widget/buttons/bee_check_radio.dart'; class LifePayDetailPage extends StatefulWidget { - final LifePayModel? model; + final LifePayListModel model; + final LifePayListModel selectModel; + final int year; LifePayDetailPage({ Key? key, - this.model, + required this.model, + required this.selectModel, + required this.year, }) : super(key: key); @override @@ -24,88 +30,140 @@ class LifePayDetailPage extends StatefulWidget { } class _LifePayDetailPageState extends State { - List _selectItems = []; - List _ids = []; - double _payTotal = 0; - int _payNum = 0; - int get listLength { + // List _selectItems = []; + // List _ids = []; + // double _payTotal = 0; + // int _payNum = 0; + // int get listLength { + // int count = 0; + // widget.model.dailyPaymentTypeVos!.forEach((element) { + // element.detailedVoList!.forEach((element) { + // count++; + // }); + // }); + // return count; + // } + + // bool get isAllSelect { + // return listLength == _selectItems.length; + // } + late LifePayListModel _selectModel; + late LifePayListModel _model; + SelectPay get total { int count = 0; - widget.model!.dailyPaymentTypeVos!.forEach((element) { - element.detailedVoList!.forEach((element) { - count++; + double price = 0; + List ids = []; + _selectModel.dailyPaymentTypeVos.forEach((element) { + element.detailedVoList.forEach((element) { + element.detailsVoList.forEach((element) { + count++; + price += element.costPrice; + ids.add(element.id); + }); }); }); - return count; + return SelectPay(payCount: count, payTotal: price, ids: ids); } bool get isAllSelect { - return listLength == _selectItems.length; + return total.payCount == widget.model.paymentNum && total.payCount != 0; } @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); - _ids.addAll(_findIds(widget.model!.dailyPaymentTypeVos![i] - .detailedVoList![j].detailsVoList ?? - [])); - _payNum += 1; - _payTotal += widget - .model!.dailyPaymentTypeVos![i].detailedVoList![j].paymentPrice! - .toDouble(); - } - } - } + // 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); + // _ids.addAll(_findIds(widget.model!.dailyPaymentTypeVos![i] + // .detailedVoList![j].detailsVoList ?? + // [])); + // _payNum += 1; + // _payTotal += widget + // .model!.dailyPaymentTypeVos![i].detailedVoList![j].paymentPrice! + // .toDouble(); + // } + // } + // } + _selectModel = widget.selectModel; + _model = widget.model; } - List _findIds(List list) { - List _list = []; - list.forEach((element) { - _list.add(element.id!); - }); - return _list; - } + // List _findIds(List list) { + // List _list = []; + // list.forEach((element) { + // _list.add(element.id!); + // }); + // return _list; + // } - Widget _buildTile( - int? groupId, int? id, int? years, double? price, List list) { - return GestureDetector( - onTap: () { - String item = id.toString() + groupId.toString(); - if (_selectItems.contains(item)) { - _selectItems.remove(item); - _payNum -= 1; - _payTotal -= price!.toDouble(); - list.forEach((element) { - _ids.remove(element); - }); - } else { - _selectItems.add(item); - _ids.addAll(list); - _payNum += 1; - _payTotal += price!.toDouble(); - } + // Widget _buildTile( + // // int? groupId, int? id, int? years, double? price, List list + // DetailedVoList model,int index,int id, + // ) { + // return GestureDetector( + // onTap: () { + // // String item = id.toString() + model.groupId.toString(); + // // if (_selectItems.contains(item)) { + // // _selectItems.remove(item); + // // _payNum -= 1; + // // _payTotal -= price!.toDouble(); + // // list.forEach((element) { + // // _ids.remove(element); + // // }); + // // } else { + // // _selectItems.add(item); + // // _ids.addAll(list); + // // _payNum += 1; + // // _payTotal += price!.toDouble(); + // // } + // setState(() {}); + // }, + // child: Row( + // children: [ + // BeeCheckRadio( + // value: id.toString() + groupId.toString(), + // groupValue: _selectItems), + // 24.w.widthBox, + // groupId == 1 + // ? '$years上半年'.text.black.size(28.sp).make() + // : '$years下半年'.text.black.size(28.sp).make(), + // Spacer(), + // '¥${price.toString()}' + // .text + // .color(kDangerColor) + // .size(28.sp) + // .bold + // .make(), + // 24.w.widthBox, + // ], + // ).material(color: Colors.transparent), + // ); + // } - setState(() {}); - }, - child: Row( + Widget _expandedTile(DetailedVoList model, int index1, int index2) { + return ExpandablePanel( + theme: ExpandableThemeData.combine( + ExpandableThemeData( + headerAlignment: ExpandablePanelHeaderAlignment.center), + ExpandableThemeData.defaults), + header: Row( + crossAxisAlignment: CrossAxisAlignment.center, + mainAxisAlignment: MainAxisAlignment.center, children: [ - BeeCheckRadio( - value: id.toString() + groupId.toString(), - groupValue: _selectItems), - 24.w.widthBox, - groupId == 1 - ? '$years上半年'.text.black.size(28.sp).make() - : '$years下半年'.text.black.size(28.sp).make(), + + 12.w.widthBox, + model.groupId == 1 + ? '${widget.year}上半年'.text.black.size(28.sp).make() + : '${widget.year}下半年'.text.black.size(28.sp).make(), Spacer(), - '¥${price.toString()}' + '¥${model.paymentPrice.toStringAsFixed(2)}' .text .color(kDangerColor) .size(28.sp) @@ -114,10 +172,57 @@ class _LifePayDetailPageState extends State { 24.w.widthBox, ], ).material(color: Colors.transparent), + collapsed: SizedBox(), + expanded: Column( + children: model.detailsVoList + .map((e) => _expandedChild(e, index1, index2)) + .toList() + // .sepWidget(separate: 12.w.heightBox), + ), ); } - Widget _buildCard(DailyPaymentTypeVos model) { + Widget _expandedChild(DetailsVoList model, int index1, int index2) { + return GestureDetector( + onTap: () { + if (_selectModel + .dailyPaymentTypeVos[index1].detailedVoList[index2].detailsVoList + .contains(model)) { + _selectModel + .dailyPaymentTypeVos[index1].detailedVoList[index2].detailsVoList + .remove(model); + setState(() {}); + } else { + _selectModel + .dailyPaymentTypeVos[index1].detailedVoList[index2].detailsVoList + .add(model); + setState(() {}); + } + }, + child: Padding( + padding: EdgeInsets.all(8.w), + child: Row( + children: [ + BeeCheckRadio( + value: model.id, + groupValue: total.ids, + ), + 12.w.widthBox, + model.month.toString().text.size(26.sp).black.make(), + Spacer(), + '¥${model.totalPrice.toStringAsFixed(2)}' + .text + .size(26.sp) + .black + .make(), + 40.w.widthBox, + ], + ), + ), + ); + } + + Widget _buildCard(DailyPaymentTypeVos model, int index1) { final appProvider = Provider.of(context); return Container( padding: EdgeInsets.symmetric(horizontal: 32.w, vertical: 20.w), @@ -125,7 +230,7 @@ class _LifePayDetailPageState extends State { children: [ Row( children: [ - model.name!.text.black.size(30.sp).bold.make(), + model.name.text.black.size(30.sp).bold.make(), Spacer(), '${S.of(context)!.tempPlotName} ${appProvider.selectedHouse!.estateId}' .text @@ -134,93 +239,99 @@ class _LifePayDetailPageState extends State { .make(), ], ), - 50.w.heightBox, - ...model.detailedVoList! - .map((e) => _buildTile(e.groupId, model.id, widget.model!.years, - e.paymentPrice, _findIds(e.detailsVoList ?? []))) - .toList() - .sepWidget(separate: 24.w.heightBox), + ...List.generate( + model.detailedVoList.length, + (index) => + _expandedTile(model.detailedVoList[index], index1, index)), ], ), ); } + LifePayListModel clearModel(LifePayListModel model) { + model.dailyPaymentTypeVos.forEach((element) { + element.detailedVoList.forEach((element) { + element.detailsVoList.clear(); + }); + }); + return model; + } + @override Widget build(BuildContext context) { - return BeeScaffold( - title: - '${BeeParse.getCustomYears(widget.model!.years!)}-${widget.model!.years}年明细', - body: ListView( - padding: EdgeInsets.only(top: 16.w), - children: [ - ...widget.model!.dailyPaymentTypeVos! - .map((e) => _buildCard(e)) - .toList(), - ], - ), - bottomNavi: Container( - padding: EdgeInsets.fromLTRB( - 32.w, 16.w, 32.w, 12.w + MediaQuery.of(context).padding.bottom), - child: Row( - children: [ - GestureDetector( - onTap: () { - if (isAllSelect) { - _selectItems.clear(); - _ids.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); - _ids.addAll(_findIds(widget - .model! - .dailyPaymentTypeVos![i] - .detailedVoList![j] - .detailsVoList ?? - [])); - _payNum += 1; - _payTotal += widget.model!.dailyPaymentTypeVos![i] - .detailedVoList![j].paymentPrice! - .toDouble(); - } + var animatedContainer = AnimatedContainer( + duration: Duration(milliseconds: 300), + decoration: BoxDecoration( + border: Border.all( + width: 1.w, + color: isAllSelect ? kPrimaryColor : kDarkSubColor), + color: isAllSelect ? kPrimaryColor : Colors.transparent, + borderRadius: BorderRadius.circular(20.w)), + curve: Curves.easeInOutCubic, + width: 40.w, + height: 40.w, + child: isAllSelect + ? Icon( + CupertinoIcons.check_mark, + size: 25.w, + color: Colors.white, + ) + : SizedBox(), + ); + return BeeScaffold( + title: + '${BeeParse.getCustomYears(widget.model.years)}-${widget.model.years}年明细', + body: ListView( + padding: EdgeInsets.only(top: 16.w), + children: List.generate(_model.dailyPaymentTypeVos.length, + (index) => _buildCard(_model.dailyPaymentTypeVos[index], index))), + bottomNavi: Container( + padding: EdgeInsets.fromLTRB( + 32.w, 16.w, 32.w, 12.w + MediaQuery.of(context).padding.bottom), + child: Row( + children: [ + GestureDetector( + onTap: () { + if (isAllSelect) { + // _selectItems.clear(); + // _ids.clear(); + // _payNum = 0; + // _payTotal = 0; + clearModel(_selectModel); + } 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); + // _ids.addAll(_findIds(widget + // .model! + // .dailyPaymentTypeVos![i] + // .detailedVoList![j] + // .detailsVoList ?? + // [])); + // _payNum += 1; + // _payTotal += widget.model!.dailyPaymentTypeVos![i] + // .detailedVoList![j].paymentPrice! + // .toDouble(); + // } + // } + // } + _selectModel = LifePayListModel.fromJson(_model.toJson()); } - } - } - setState(() {}); - }, - child: AnimatedContainer( - duration: Duration(milliseconds: 300), - decoration: BoxDecoration( - border: Border.all( - width: 1.w, - color: isAllSelect ? kPrimaryColor : kDarkSubColor), - color: isAllSelect ? kPrimaryColor : Colors.transparent, - borderRadius: BorderRadius.circular(20.w)), - curve: Curves.easeInOutCubic, - width: 40.w, - height: 40.w, - child: isAllSelect - ? Icon( - CupertinoIcons.check_mark, - size: 25.w, - color: Colors.white, - ) - : SizedBox(), - ), + setState(() {}); + }, + child: animatedContainer, ), Spacer(), Column( @@ -236,13 +347,17 @@ class _LifePayDetailPageState extends State { fontWeight: FontWeight.bold), children: [ TextSpan( - text: '${_payTotal.toStringAsFixed(2)}', + text: '${total.payTotal.toStringAsFixed(2)}', style: TextStyle( color: kDangerColor, fontSize: 32.sp, fontWeight: FontWeight.bold)), ])), - '已选$_payNum项'.text.color(ktextSubColor).size(20.sp).make(), + '已选${total.payCount}' + .text + .color(ktextSubColor) + .size(20.sp) + .make(), ], ), 8.w.widthBox, @@ -253,7 +368,7 @@ class _LifePayDetailPageState extends State { color: kPrimaryColor, padding: EdgeInsets.symmetric(horizontal: 50.w, vertical: 15.w), onPressed: () { - Get.back(result: [_payNum, _payTotal, _ids]); + Get.back(result: _selectModel); }, child: '选好了'.text.black.size(32.sp).bold.make(), ), diff --git a/lib/ui/profile/house/contract_stop/pay_surplus_rent_page.dart b/lib/ui/profile/house/contract_stop/pay_surplus_rent_page.dart index 25397cba..17fb9714 100644 --- a/lib/ui/profile/house/contract_stop/pay_surplus_rent_page.dart +++ b/lib/ui/profile/house/contract_stop/pay_surplus_rent_page.dart @@ -50,10 +50,15 @@ class _PaySuerplusRentPageState extends State { hintText: DateUtil.formatDateStr(widget.time, format: 'yyyy-MM-dd'), onPressed: () {}), - BeeInputRow.button( - title: '剩余需结清房租(元)', - hintText: widget.amount.toStringAsFixed(2), - onPressed: () {}), + widget.amount <= 0 + ? BeeInputRow.button( + title: '房租余额(请联系物业退款)', + hintText: widget.amount.abs().toStringAsFixed(2), + onPressed: () {}) + : BeeInputRow.button( + title: '剩余需结清房租(元)', + hintText: widget.amount.toStringAsFixed(2), + onPressed: () {}), BeeInputRow.button( title: '支付方式', hintText: _payMethod, @@ -72,14 +77,16 @@ class _PaySuerplusRentPageState extends State { onPressed: () async { Function cancel = BotToast.showLoading(); try { - String code = await HouseFunc() - .leaseRentOrder(widget.id, 1, widget.amount.toDouble()); - bool result = - await PayUtil().callAliPay(code, API.pay.leaseRentCheck); - if (result) { - Get.back(); - Get.off(() => PayFinishPage()); - } + if (widget.amount <= 0) { + String code = await HouseFunc() + .leaseRentOrder(widget.id, 1, widget.amount.toDouble()); + bool result = + await PayUtil().callAliPay(code, API.pay.leaseRentCheck); + if (result) { + Get.back(); + Get.off(() => PayFinishPage()); + } + } else {} } catch (e) { LoggerData.addData(e); } diff --git a/lib/ui/profile/house/contract_stop/refund_bond_page.dart b/lib/ui/profile/house/contract_stop/refund_bond_page.dart index 27a80078..518bc1c8 100644 --- a/lib/ui/profile/house/contract_stop/refund_bond_page.dart +++ b/lib/ui/profile/house/contract_stop/refund_bond_page.dart @@ -31,7 +31,7 @@ class _RefundBondPageState extends State { @override Widget build(BuildContext context) { return BeeScaffold( - bgColor: Colors.white, + bodyColor: Colors.white, title: '保证金信息', body: ListView( children: [ diff --git a/macos/Podfile.lock b/macos/Podfile.lock index 24c4c506..92bf12cd 100644 --- a/macos/Podfile.lock +++ b/macos/Podfile.lock @@ -35,6 +35,9 @@ PODS: - GoogleUtilities/UserDefaults (~> 7.0) - PromisesObjC (~> 1.2) - FlutterMacOS (1.0.0) + - FMDB (2.7.5): + - FMDB/standard (= 2.7.5) + - FMDB/standard (2.7.5) - GoogleDataTransport (8.4.0): - GoogleUtilities/Environment (~> 7.2) - nanopb (~> 2.30908.0) @@ -59,6 +62,9 @@ PODS: - PromisesObjC (1.2.12) - shared_preferences_macos (0.0.1): - FlutterMacOS + - sqflite (0.0.2): + - FlutterMacOS + - FMDB (>= 2.7.5) - url_launcher_macos (0.0.1): - FlutterMacOS @@ -71,6 +77,7 @@ DEPENDENCIES: - package_info_plus_macos (from `Flutter/ephemeral/.symlinks/plugins/package_info_plus_macos/macos`) - path_provider_macos (from `Flutter/ephemeral/.symlinks/plugins/path_provider_macos/macos`) - shared_preferences_macos (from `Flutter/ephemeral/.symlinks/plugins/shared_preferences_macos/macos`) + - sqflite (from `Flutter/ephemeral/.symlinks/plugins/sqflite/macos`) - url_launcher_macos (from `Flutter/ephemeral/.symlinks/plugins/url_launcher_macos/macos`) SPEC REPOS: @@ -80,6 +87,7 @@ SPEC REPOS: - FirebaseCoreDiagnostics - FirebaseCrashlytics - FirebaseInstallations + - FMDB - GoogleDataTransport - GoogleUtilities - nanopb @@ -102,6 +110,8 @@ EXTERNAL SOURCES: :path: Flutter/ephemeral/.symlinks/plugins/path_provider_macos/macos shared_preferences_macos: :path: Flutter/ephemeral/.symlinks/plugins/shared_preferences_macos/macos + sqflite: + :path: Flutter/ephemeral/.symlinks/plugins/sqflite/macos url_launcher_macos: :path: Flutter/ephemeral/.symlinks/plugins/url_launcher_macos/macos @@ -115,6 +125,7 @@ SPEC CHECKSUMS: FirebaseCrashlytics: 272b675aa9d1e9bae1f9e1449fcc1f2cf6042806 FirebaseInstallations: a58d4f72ec5861840b84df489f2668d970df558a FlutterMacOS: 57701585bf7de1b3fc2bb61f6378d73bbdea8424 + FMDB: 2ce00b547f966261cd18927a3ddb07cb6f3db82a GoogleDataTransport: cd9db2180fcecd8da1b561aea31e3e56cf834aa7 GoogleUtilities: 284cddc7fffc14ae1907efb6f78ab95c1fccaedc nanopb: a0ba3315591a9ae0a16a309ee504766e90db0c96 @@ -123,6 +134,7 @@ SPEC CHECKSUMS: path_provider_macos: a0a3fd666cb7cd0448e936fb4abad4052961002b PromisesObjC: 3113f7f76903778cf4a0586bd1ab89329a0b7b97 shared_preferences_macos: 480ce071d0666e37cef23fe6c702293a3d21799e + sqflite: a5789cceda41d54d23f31d6de539d65bb14100ea url_launcher_macos: 45af3d61de06997666568a7149c1be98b41c95d4 PODFILE CHECKSUM: c7161fcf45d4fd9025dc0f48a76d6e64e52f8176 diff --git a/pubspec.lock b/pubspec.lock index 38116db3..f239cc00 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -323,6 +323,13 @@ packages: url: "https://pub.flutter-io.cn" source: hosted version: "2.0.0" + expandable: + dependency: "direct main" + description: + name: expandable + url: "https://pub.flutter-io.cn" + source: hosted + version: "5.0.1" extended_list_library: dependency: transitive description: diff --git a/pubspec.yaml b/pubspec.yaml index 25daf620..2757ef19 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -105,8 +105,9 @@ dependencies: #model 插件 equatable: ^2.0.0 #pdf文件预览 - # flutter_cached_pdfview: ^0.4.0-nullsafety advance_pdf_viewer: ^2.0.0 + #扩展组件 + expandable: ^5.0.1 dev_dependencies: flutter_test: