重构 生活缴费模块

hmxc
张萌 4 years ago
parent 9610a1c949
commit 171e3f6596

@ -1,138 +1,139 @@
class LifePayModel { // class LifePayModel {
int? years; // int? years;
int? paymentNum; // int? paymentNum;
List<DailyPaymentTypeVos>? dailyPaymentTypeVos; // List<DailyPaymentTypeVos>? dailyPaymentTypeVos;
LifePayModel({this.years, this.paymentNum, this.dailyPaymentTypeVos}); // LifePayModel({this.years, this.paymentNum, this.dailyPaymentTypeVos});
LifePayModel.fromJson(Map<String, dynamic> json) { // LifePayModel.fromJson(Map<String, dynamic> json) {
years = json['years']; // years = json['years'];
paymentNum = json['paymentNum']; // paymentNum = json['paymentNum'];
if (json['dailyPaymentTypeVos'] != null) { // if (json['dailyPaymentTypeVos'] != null) {
dailyPaymentTypeVos = []; // dailyPaymentTypeVos = [];
json['dailyPaymentTypeVos'].forEach((v) { // json['dailyPaymentTypeVos'].forEach((v) {
dailyPaymentTypeVos!.add(new DailyPaymentTypeVos.fromJson(v)); // dailyPaymentTypeVos!.add(new DailyPaymentTypeVos.fromJson(v));
}); // });
} // }
} // }
Map<String, dynamic> toJson() { // Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>(); // final Map<String, dynamic> data = new Map<String, dynamic>();
data['years'] = this.years; // data['years'] = this.years;
data['paymentNum'] = this.paymentNum; // data['paymentNum'] = this.paymentNum;
if (this.dailyPaymentTypeVos != null) { // if (this.dailyPaymentTypeVos != null) {
data['dailyPaymentTypeVos'] = // data['dailyPaymentTypeVos'] =
this.dailyPaymentTypeVos!.map((v) => v.toJson()).toList(); // this.dailyPaymentTypeVos!.map((v) => v.toJson()).toList();
} // }
return data; // return data;
} // }
}
// }
class DailyPaymentTypeVos {
int? id; // class DailyPaymentTypeVos {
String? name; // int? id;
List<DetailedVoList>? detailedVoList; // String? name;
// List<DetailedVoList>? detailedVoList;
DailyPaymentTypeVos({this.id, this.name, this.detailedVoList});
// DailyPaymentTypeVos({this.id, this.name, this.detailedVoList});
DailyPaymentTypeVos.fromJson(Map<String, dynamic> json) {
id = json['id']; // DailyPaymentTypeVos.fromJson(Map<String, dynamic> json) {
name = json['name']; // id = json['id'];
if (json['detailedVoList'] != null) { // name = json['name'];
detailedVoList = []; // if (json['detailedVoList'] != null) {
json['detailedVoList'].forEach((v) { // detailedVoList = [];
detailedVoList!.add(new DetailedVoList.fromJson(v)); // json['detailedVoList'].forEach((v) {
}); // detailedVoList!.add(new DetailedVoList.fromJson(v));
} // });
} // }
// }
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>(); // Map<String, dynamic> toJson() {
data['id'] = this.id; // final Map<String, dynamic> data = new Map<String, dynamic>();
data['name'] = this.name; // data['id'] = this.id;
if (this.detailedVoList != null) { // data['name'] = this.name;
data['detailedVoList'] = // if (this.detailedVoList != null) {
this.detailedVoList!.map((v) => v.toJson()).toList(); // data['detailedVoList'] =
} // this.detailedVoList!.map((v) => v.toJson()).toList();
return data; // }
} // return data;
} // }
// }
class DetailedVoList {
int? groupId; // class DetailedVoList {
double? paymentPrice; // int? groupId;
List<DetailsVoList>? detailsVoList; // double? paymentPrice;
// List<DetailsVoList>? detailsVoList;
DetailedVoList({this.groupId, this.paymentPrice, this.detailsVoList});
// DetailedVoList({this.groupId, this.paymentPrice, this.detailsVoList});
DetailedVoList.fromJson(Map<String, dynamic> json) {
groupId = json['groupId']; // DetailedVoList.fromJson(Map<String, dynamic> json) {
paymentPrice = json['paymentPrice']; // groupId = json['groupId'];
if (json['detailsVoList'] != null) { // paymentPrice = json['paymentPrice'];
detailsVoList = []; // if (json['detailsVoList'] != null) {
json['detailsVoList'].forEach((v) { // detailsVoList = [];
detailsVoList!.add(new DetailsVoList.fromJson(v)); // json['detailsVoList'].forEach((v) {
}); // detailsVoList!.add(new DetailsVoList.fromJson(v));
} // });
} // }
// }
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>(); // Map<String, dynamic> toJson() {
data['groupId'] = this.groupId; // final Map<String, dynamic> data = new Map<String, dynamic>();
data['paymentPrice'] = this.paymentPrice; // data['groupId'] = this.groupId;
if (this.detailsVoList != null) { // data['paymentPrice'] = this.paymentPrice;
data['detailsVoList'] = // if (this.detailsVoList != null) {
this.detailsVoList!.map((v) => v.toJson()).toList(); // data['detailsVoList'] =
} // this.detailsVoList!.map((v) => v.toJson()).toList();
return data; // }
} // return data;
} // }
// }
class DetailsVoList {
int? id; // class DetailsVoList {
String? month; // int? id;
double? costPrice; // String? month;
double? paidPrice; // double? costPrice;
double? totalPrice; // double? paidPrice;
String? beginDate; // double? totalPrice;
String? endDate; // String? beginDate;
String? unitPriceType; // String? endDate;
int? num; // String? unitPriceType;
// int? num;
DetailsVoList(
{this.id, // DetailsVoList(
this.month, // {this.id,
this.costPrice, // this.month,
this.paidPrice, // this.costPrice,
this.totalPrice, // this.paidPrice,
this.beginDate, // this.totalPrice,
this.endDate, // this.beginDate,
this.unitPriceType, // this.endDate,
this.num}); // this.unitPriceType,
// this.num});
DetailsVoList.fromJson(Map<String, dynamic> json) {
id = json['id']; // DetailsVoList.fromJson(Map<String, dynamic> json) {
month = json['month']; // id = json['id'];
costPrice = json['costPrice']; // month = json['month'];
paidPrice = json['paidPrice']; // costPrice = json['costPrice'];
totalPrice = json['totalPrice']; // paidPrice = json['paidPrice'];
beginDate = json['beginDate']; // totalPrice = json['totalPrice'];
endDate = json['endDate']; // beginDate = json['beginDate'];
unitPriceType = json['unitPriceType']; // endDate = json['endDate'];
num = json['num']; // unitPriceType = json['unitPriceType'];
} // num = json['num'];
// }
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>(); // Map<String, dynamic> toJson() {
data['id'] = this.id; // final Map<String, dynamic> data = new Map<String, dynamic>();
data['month'] = this.month; // data['id'] = this.id;
data['costPrice'] = this.costPrice; // data['month'] = this.month;
data['paidPrice'] = this.paidPrice; // data['costPrice'] = this.costPrice;
data['totalPrice'] = this.totalPrice; // data['paidPrice'] = this.paidPrice;
data['beginDate'] = this.beginDate; // data['totalPrice'] = this.totalPrice;
data['endDate'] = this.endDate; // data['beginDate'] = this.beginDate;
data['unitPriceType'] = this.unitPriceType; // data['endDate'] = this.endDate;
data['num'] = this.num; // data['unitPriceType'] = this.unitPriceType;
return data; // data['num'] = this.num;
} // return data;
} // }
// }

@ -3,7 +3,7 @@ class LifePayRecordModel {
String? chargesTemplateDetailName; String? chargesTemplateDetailName;
String? roomName; String? roomName;
String? years; String? years;
int? paidPrice; num? paidPrice;
String? createDate; String? createDate;
int? payType; int? payType;
String? code; String? code;

@ -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> dailyPaymentTypeVos;
LifePayListModel({
required this.years,
required this.paymentNum,
required this.dailyPaymentTypeVos,
});
factory LifePayListModel.fromJson(Map<String, dynamic> json) =>
_$LifePayListModelFromJson(json);
factory LifePayListModel.zero() =>
LifePayListModel(years: 0, paymentNum: 0, dailyPaymentTypeVos: [
DailyPaymentTypeVos(id: 0, name: '', detailedVoList: [
DetailedVoList(groupId: 0, paymentPrice: 0, detailsVoList: [])
])
]);
Map<String, dynamic> toJson() => _$LifePayListModelToJson(this);
@override
List<Object?> get props => [years, paymentNum, dailyPaymentTypeVos];
}
@JsonSerializable(createToJson: true, explicitToJson: true)
class DailyPaymentTypeVos extends Equatable {
final int id;
final String name;
final List<DetailedVoList> detailedVoList;
DailyPaymentTypeVos({
required this.id,
required this.name,
required this.detailedVoList,
});
factory DailyPaymentTypeVos.fromJson(Map<String, dynamic> json) =>
_$DailyPaymentTypeVosFromJson(json);
Map<String, dynamic> toJson() => _$DailyPaymentTypeVosToJson(this);
@override
List<Object> get props => [id, name, detailedVoList];
}
@JsonSerializable(createToJson: true, explicitToJson: true)
class DetailedVoList extends Equatable {
final int groupId;
final num paymentPrice;
final List<DetailsVoList> detailsVoList;
DetailedVoList({
required this.groupId,
required this.paymentPrice,
required this.detailsVoList,
});
factory DetailedVoList.fromJson(Map<String, dynamic> json) =>
_$DetailedVoListFromJson(json);
Map<String, dynamic> toJson() => _$DetailedVoListToJson(this);
@override
List<Object> 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<String, dynamic> json) =>
_$DetailsVoListFromJson(json);
Map<String, dynamic> toJson() => _$DetailsVoListToJson(this);
@override
List<Object> get props {
return [
id,
month,
costPrice,
paidPrice,
totalPrice,
beginDate,
endDate,
unitPriceType,
number,
];
}
}

@ -0,0 +1,87 @@
// GENERATED CODE - DO NOT MODIFY BY HAND
part of 'life_pay_list_model.dart';
// **************************************************************************
// JsonSerializableGenerator
// **************************************************************************
LifePayListModel _$LifePayListModelFromJson(Map<String, dynamic> json) {
return LifePayListModel(
years: json['years'] as int,
paymentNum: json['paymentNum'] as int,
dailyPaymentTypeVos: (json['dailyPaymentTypeVos'] as List<dynamic>)
.map((e) => DailyPaymentTypeVos.fromJson(e as Map<String, dynamic>))
.toList(),
);
}
Map<String, dynamic> _$LifePayListModelToJson(LifePayListModel instance) =>
<String, dynamic>{
'years': instance.years,
'paymentNum': instance.paymentNum,
'dailyPaymentTypeVos':
instance.dailyPaymentTypeVos.map((e) => e.toJson()).toList(),
};
DailyPaymentTypeVos _$DailyPaymentTypeVosFromJson(Map<String, dynamic> json) {
return DailyPaymentTypeVos(
id: json['id'] as int,
name: json['name'] as String,
detailedVoList: (json['detailedVoList'] as List<dynamic>)
.map((e) => DetailedVoList.fromJson(e as Map<String, dynamic>))
.toList(),
);
}
Map<String, dynamic> _$DailyPaymentTypeVosToJson(
DailyPaymentTypeVos instance) =>
<String, dynamic>{
'id': instance.id,
'name': instance.name,
'detailedVoList': instance.detailedVoList.map((e) => e.toJson()).toList(),
};
DetailedVoList _$DetailedVoListFromJson(Map<String, dynamic> json) {
return DetailedVoList(
groupId: json['groupId'] as int,
paymentPrice: json['paymentPrice'] as num,
detailsVoList: (json['detailsVoList'] as List<dynamic>)
.map((e) => DetailsVoList.fromJson(e as Map<String, dynamic>))
.toList(),
);
}
Map<String, dynamic> _$DetailedVoListToJson(DetailedVoList instance) =>
<String, dynamic>{
'groupId': instance.groupId,
'paymentPrice': instance.paymentPrice,
'detailsVoList': instance.detailsVoList.map((e) => e.toJson()).toList(),
};
DetailsVoList _$DetailsVoListFromJson(Map<String, dynamic> 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<String, dynamic> _$DetailsVoListToJson(DetailsVoList instance) =>
<String, dynamic>{
'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,
};

@ -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/cupertino.dart';
import 'package:flutter/material.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/base/base_style.dart';
import 'package:aku_community/constants/api.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/life_pay_record_page.dart';
import 'package:aku_community/pages/life_pay/pay_finish_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/pay_util.dart';
import 'package:aku_community/pages/life_pay/widget/life_pay_detail_page.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/provider/app_provider.dart';
import 'package:aku_community/utils/bee_parse.dart'; import 'package:aku_community/utils/bee_parse.dart';
import 'package:aku_community/utils/headers.dart'; import 'package:aku_community/utils/headers.dart';
import 'package:aku_community/utils/network/base_model.dart'; import 'package:aku_community/utils/network/base_model.dart';
import 'package:aku_community/utils/network/net_util.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/bee_scaffold.dart';
import 'package:aku_community/widget/buttons/bee_check_radio.dart'; import 'package:aku_community/widget/buttons/bee_check_radio.dart';
import 'package:aku_community/widget/others/house_head_card.dart'; import 'package:aku_community/widget/others/house_head_card.dart';
@ -43,14 +43,46 @@ class SelectPay {
class _LifePayPageState extends State<LifePayPage> { class _LifePayPageState extends State<LifePayPage> {
EasyRefreshController? _controller; EasyRefreshController? _controller;
List<int> _selectYears = []; // List<int> _selectYears = []; //
List<LifePayModel?> _models = []; List<LifePayListModel> _models = [];
List<SelectPay> _selectPay = []; // // List<SelectPay> _selectPay = []; //
double _totalCost = 0; // // double _totalCost = 0; //
int _count = 0; // // // int _count = 0; //
List _ids = []; //id // List _ids = []; //id
int _page = 0;
int _size = 10;
List<LifePayListModel> _selectModels = []; //models
bool get allSelect => bool get allSelect =>
((_models.length == _selectYears.length) && (_models.length != 0)); ((_models.length == _selectYears.length) && (_models.length != 0));
SelectPay get total {
int count = 0;
double price = 0;
List<int> 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<int> 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 @override
void initState() { void initState() {
@ -65,7 +97,8 @@ class _LifePayPageState extends State<LifePayPage> {
super.dispose(); super.dispose();
} }
Widget _buildCard(LifePayModel model, int index) { Widget _buildCard(LifePayListModel model, int index) {
SelectPay _select = selectCount(_selectModels[index]);
return Container( return Container(
padding: EdgeInsets.symmetric(vertical: 20.w), padding: EdgeInsets.symmetric(vertical: 20.w),
decoration: BoxDecoration( decoration: BoxDecoration(
@ -81,16 +114,17 @@ class _LifePayPageState extends State<LifePayPage> {
setState(() { setState(() {
if (_selectYears.contains(index)) { if (_selectYears.contains(index)) {
_selectYears.remove(index); _selectYears.remove(index);
_totalCost -= (_selectPay[index].payTotal); // _totalCost -= (_selectPay[index].payTotal);
_count -= (_selectPay[index].payCount); // _count -= (_selectPay[index].payCount);
_selectPay[index].ids.forEach((element) { // _selectPay[index].ids.forEach((element) {
_ids.remove(element); // _ids.remove(element);
}); // });
} else { } else {
_selectYears.add(index); _selectYears.add(index);
_totalCost += (_selectPay[index].payTotal); // _totalCost += (_selectPay[index].payTotal);
_count += (_selectPay[index].payCount); // _count += (_selectPay[index].payCount);
_ids.addAll(_selectPay[index].ids); // _ids.addAll(_selectPay[index].ids);
} }
}); });
}, },
@ -106,13 +140,13 @@ class _LifePayPageState extends State<LifePayPage> {
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
mainAxisSize: MainAxisSize.min, mainAxisSize: MainAxisSize.min,
children: [ children: [
'${BeeParse.getCustomYears(model.years!)}(${model.years})' '${BeeParse.getCustomYears(model.years)}(${model.years})'
.text .text
.color(ktextSubColor) .color(ktextSubColor)
.size(28.sp) .size(28.sp)
.make(), .make(),
24.w.heightBox, 24.w.heightBox,
'待缴:${model.paymentNum}项 已选${_selectPay[index].payCount}' '待缴:${model.paymentNum}项 已选${_select.payCount}'
.text .text
.color(ktextPrimary) .color(ktextPrimary)
.size(28.sp) .size(28.sp)
@ -127,8 +161,7 @@ class _LifePayPageState extends State<LifePayPage> {
fontWeight: FontWeight.bold), fontWeight: FontWeight.bold),
children: [ children: [
TextSpan( TextSpan(
text: text: '¥ ${_select.payTotal.toStringAsFixed(2)}',
'¥ ${_selectPay[index].payTotal.toStringAsFixed(2)}',
style: TextStyle( style: TextStyle(
color: kDangerColor, color: kDangerColor,
fontSize: 28.sp, fontSize: 28.sp,
@ -143,22 +176,28 @@ class _LifePayPageState extends State<LifePayPage> {
GestureDetector( GestureDetector(
onTap: () async { onTap: () async {
if (_selectYears.contains(index)) { if (_selectYears.contains(index)) {
_totalCost -= _selectPay[index].payTotal; // _totalCost -= _selectPay[index].payTotal;
_count -= _selectPay[index].payCount; // _count -= _selectPay[index].payCount;
_selectPay[index].ids.forEach((element) { // _selectPay[index].ids.forEach((element) {
_ids.remove(element); // _ids.remove(element);
}); // });
} }
List payMent = await (Get.to( dynamic payMent = await (Get.to(() => LifePayDetailPage(
() => LifePayDetailPage(model: _models[index]))); model: _models[index],
_selectPay[index].payCount = payMent[0]; selectModel: _selectModels[index],
_selectPay[index].payTotal = payMent[1]; year: model.years,
_selectPay[index].ids = payMent[2]; )));
if (_selectYears.contains(index)) { if (payMent.runtimeType == LifePayListModel) {
_totalCost += _selectPay[index].payTotal; _selectModels[index] = payMent;
_count += _selectPay[index].payCount;
} }
// _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(() {}); setState(() {});
}, },
child: Container( child: Container(
@ -178,62 +217,62 @@ class _LifePayPageState extends State<LifePayPage> {
); );
} }
double getPayTotal(LifePayModel list) { // double getPayTotal(LifePayListModel list) {
num total = 0; // num total = 0;
if (list.dailyPaymentTypeVos != null) { // if (list.dailyPaymentTypeVos != null) {
for (var item in list.dailyPaymentTypeVos!) { // for (var item in list.dailyPaymentTypeVos!) {
for (var v in item.detailedVoList!) { // for (var v in item.detailedVoList!) {
total += v.paymentPrice ?? 0; // total += v.paymentPrice ?? 0;
} // }
} // }
} // }
return total as double; // return total as double;
} // }
List<int> getIds(LifePayModel list) { // List<int> getIds(LifePayListModel list) {
List<int> _list = []; // List<int> _list = [];
if (list.dailyPaymentTypeVos != null) { // if (list.dailyPaymentTypeVos != null) {
for (var item in list.dailyPaymentTypeVos!) { // for (var item in list.dailyPaymentTypeVos!) {
for (var v in item.detailedVoList!) { // for (var v in item.detailedVoList!) {
_list.addAll(_findIds(v.detailsVoList ?? [])); // _list.addAll(_findIds(v.detailsVoList ?? []));
} // }
} // }
} // }
return _list; // return _list;
} // }
List<int> _findIds(List<DetailsVoList> list) { // List<int> _findIds(List<DetailsVoList> list) {
List<int> _list = []; // List<int> _list = [];
list.forEach((element) { // list.forEach((element) {
_list.add(element.id!); // _list.add(element.id!);
}); // });
return _list; // return _list;
} // }
_allSelectOption() { // _allSelectOption() {
// // //
if (_models.length == _selectYears.length) { // if (_models.length == _selectYears.length) {
_selectYears.clear(); // _selectYears.clear();
_ids.clear(); // _ids.clear();
_totalCost = 0; // _totalCost = 0;
_count = 0; // _count = 0;
} else { // } else {
for (var i = 0; i < _models.length; i++) { // for (var i = 0; i < _models.length; i++) {
if (!_selectYears.contains(i)) { // if (!_selectYears.contains(i)) {
_selectYears.add(i); // _selectYears.add(i);
} // }
} // }
_totalCost = 0; // _totalCost = 0;
_count = 0; // _count = 0;
_ids.clear(); // _ids.clear();
for (var item in _selectPay) { // for (var item in _selectPay) {
_totalCost += item.payTotal; // _totalCost += item.payTotal;
_count += item.payCount; // _count += item.payCount;
_ids.addAll(item.ids); // _ids.addAll(item.ids);
} // }
} // }
setState(() {}); // setState(() {});
} // }
Widget _payButton() { Widget _payButton() {
return MaterialButton( return MaterialButton(
@ -245,9 +284,9 @@ class _LifePayPageState extends State<LifePayPage> {
Function cancel = BotToast.showLoading(); Function cancel = BotToast.showLoading();
BaseModel baseModel = BaseModel baseModel =
await NetUtil().post('/user/alipay/dailyPaymentAlipay', params: { await NetUtil().post('/user/alipay/dailyPaymentAlipay', params: {
"ids": _ids, "ids": total.ids,
"payType": 1, // "payType": 1, //
"payPrice": _totalCost.toStringAsFixed(2) "payPrice": total.payTotal
}); });
if (baseModel.status ?? false) { if (baseModel.status ?? false) {
bool result = await PayUtil() bool result = await PayUtil()
@ -279,52 +318,66 @@ class _LifePayPageState extends State<LifePayPage> {
), ),
), ),
], ],
body: EasyRefresh(
//TODO:listview; firstRefresh: true,
body: BeeListView<LifePayModel>( header: MaterialHeader(),
path: API.manager.dailyPaymentList, controller: _controller,
controller: _controller, onRefresh: () async {
extraParams: {'estateId': appProvider.selectedHouse!.estateId}, _page = 1;
convert: (model) { _size = 10;
List<LifePayModel> lifePayModels = BaseListModel baseListModel = await NetUtil()
model.tableList!.map((e) => LifePayModel.fromJson(e)).toList(); .getList(API.manager.dailyPaymentList, params: {
_selectPay.clear(); "pageNum": _page,
_selectPay.addAll(lifePayModels "size": _size,
.map((e) => SelectPay( 'estateId': appProvider.selectedHouse!.estateId
payCount: e.dailyPaymentTypeVos!.length, });
payTotal: getPayTotal(e), _models = baseListModel.tableList!
ids: getIds(e))) .map((e) => LifePayListModel.fromJson(e))
.toList()); .toList();
return lifePayModels; // _selectPay.clear();
}, _selectYears.clear();
builder: (items) { _selectModels = _models
if (items != null) _models = items as List<LifePayModel?>; .map((e) => LifePayListModel.fromJson(e.toJson()))
return Column( .toList();
children: [ for (var i = 0; i < _selectModels.length; i++) {
HouseHeadCard( _selectYears.add(i);
onChanged: () { }
_controller!.callRefresh(); // _totalCost = 0;
}, // _count = 0;
context: context), // _selectPay.addAll(_models
16.w.heightBox, // .map((e) => SelectPay(
Container( // payCount: e.dailyPaymentTypeVos!.length,
padding: EdgeInsets.all(32.w), // payTotal: getPayTotal(e),
width: double.infinity, // ids: getIds(e)))
color: kForeGroundColor, // .toList());
constraints: BoxConstraints(minHeight: 20.w), if (mounted) setState(() {});
child: Column( },
crossAxisAlignment: CrossAxisAlignment.start, child: Column(
children: [ children: [
'缴费账单'.text.color(ktextPrimary).size(28.sp).make(), HouseHeadCard(
...List.generate(items.length, onChanged: () {
(index) => _buildCard(items[index], index)) _controller!.callRefresh();
.sepWidget(separate: BeeDivider.horizontal()), },
], 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( bottomNavi: Container(
color: kForeGroundColor, color: kForeGroundColor,
padding: EdgeInsets.fromLTRB( padding: EdgeInsets.fromLTRB(
@ -333,7 +386,17 @@ class _LifePayPageState extends State<LifePayPage> {
children: [ children: [
GestureDetector( GestureDetector(
onTap: () { 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( child: AnimatedContainer(
duration: Duration(milliseconds: 300), duration: Duration(milliseconds: 300),
@ -369,13 +432,17 @@ class _LifePayPageState extends State<LifePayPage> {
fontWeight: FontWeight.bold), fontWeight: FontWeight.bold),
children: [ children: [
TextSpan( TextSpan(
text: _totalCost.toStringAsFixed(2), text: '¥${total.payTotal.toStringAsFixed(2)}',
style: TextStyle( style: TextStyle(
color: kDangerColor, color: kDangerColor,
fontSize: 32.sp, fontSize: 32.sp,
fontWeight: FontWeight.bold)), fontWeight: FontWeight.bold)),
])), ])),
'已选$_count'.text.color(ktextSubColor).size(20.sp).make(), '已选${total.payCount}'
.text
.color(ktextSubColor)
.size(20.sp)
.make(),
], ],
), ),
24.w.widthBox, 24.w.widthBox,

@ -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/pages/things_page/widget/bee_list_view.dart';
import 'package:aku_community/utils/headers.dart'; import 'package:aku_community/utils/headers.dart';
import 'package:aku_community/widget/bee_scaffold.dart'; import 'package:aku_community/widget/bee_scaffold.dart';
import 'package:aku_community/extensions/widget_list_ext.dart';
class LifePayRecordPage extends StatefulWidget { class LifePayRecordPage extends StatefulWidget {
LifePayRecordPage({Key? key}) : super(key: key); LifePayRecordPage({Key? key}) : super(key: key);
@ -64,9 +65,11 @@ class _LifePayRecordPageState extends State<LifePayRecordPage> {
.color(ktextSubColor) .color(ktextSubColor)
.make(), .make(),
32.w.heightBox, 32.w.heightBox,
...items ...<Widget>[
.map((e) => _buildRecordCard(e as LifePayRecordModel)) ...items
.toList() .map((e) => _buildRecordCard(e as LifePayRecordModel))
.toList()
].sepWidget(separate: 24.w.heightBox)
], ],
); );
}, },

@ -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<LifePayListModel> models;
static SharLifPayModel? of(BuildContext context) {
return context.dependOnInheritedWidgetOfExactType<SharLifPayModel>();
}
@override
bool updateShouldNotify(SharLifPayModel oldWidget) {
return oldWidget.models != models;
}
}

@ -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/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
@ -5,7 +8,6 @@ import 'package:get/get.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
import 'package:aku_community/base/base_style.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/provider/app_provider.dart';
import 'package:aku_community/utils/bee_parse.dart'; import 'package:aku_community/utils/bee_parse.dart';
import 'package:aku_community/utils/headers.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'; import 'package:aku_community/widget/buttons/bee_check_radio.dart';
class LifePayDetailPage extends StatefulWidget { class LifePayDetailPage extends StatefulWidget {
final LifePayModel? model; final LifePayListModel model;
final LifePayListModel selectModel;
final int year;
LifePayDetailPage({ LifePayDetailPage({
Key? key, Key? key,
this.model, required this.model,
required this.selectModel,
required this.year,
}) : super(key: key); }) : super(key: key);
@override @override
@ -24,88 +30,140 @@ class LifePayDetailPage extends StatefulWidget {
} }
class _LifePayDetailPageState extends State<LifePayDetailPage> { class _LifePayDetailPageState extends State<LifePayDetailPage> {
List<String> _selectItems = []; // List<String> _selectItems = [];
List<int> _ids = []; // List<int> _ids = [];
double _payTotal = 0; // double _payTotal = 0;
int _payNum = 0; // int _payNum = 0;
int get listLength { // 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; int count = 0;
widget.model!.dailyPaymentTypeVos!.forEach((element) { double price = 0;
element.detailedVoList!.forEach((element) { List<int> ids = [];
count++; _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 { bool get isAllSelect {
return listLength == _selectItems.length; return total.payCount == widget.model.paymentNum && total.payCount != 0;
} }
@override @override
void initState() { void initState() {
super.initState(); super.initState();
for (var i = 0; i < widget.model!.dailyPaymentTypeVos!.length; i++) { // for (var i = 0; i < widget.model!.dailyPaymentTypeVos!.length; i++) {
for (var j = 0; // for (var j = 0;
j < widget.model!.dailyPaymentTypeVos![i].detailedVoList!.length; // j < widget.model!.dailyPaymentTypeVos![i].detailedVoList!.length;
j++) { // j++) {
String id = widget.model!.dailyPaymentTypeVos![i].id.toString() + // String id = widget.model!.dailyPaymentTypeVos![i].id.toString() +
widget.model!.dailyPaymentTypeVos![i].detailedVoList![j].groupId // widget.model!.dailyPaymentTypeVos![i].detailedVoList![j].groupId
.toString(); // .toString();
if (!_selectItems.contains(id)) { // if (!_selectItems.contains(id)) {
_selectItems.add(id); // _selectItems.add(id);
_ids.addAll(_findIds(widget.model!.dailyPaymentTypeVos![i] // _ids.addAll(_findIds(widget.model!.dailyPaymentTypeVos![i]
.detailedVoList![j].detailsVoList ?? // .detailedVoList![j].detailsVoList ??
[])); // []));
_payNum += 1; // _payNum += 1;
_payTotal += widget // _payTotal += widget
.model!.dailyPaymentTypeVos![i].detailedVoList![j].paymentPrice! // .model!.dailyPaymentTypeVos![i].detailedVoList![j].paymentPrice!
.toDouble(); // .toDouble();
} // }
} // }
} // }
_selectModel = widget.selectModel;
_model = widget.model;
} }
List<int> _findIds(List<DetailsVoList> list) { // List<int> _findIds(List<DetailsVoList> list) {
List<int> _list = []; // List<int> _list = [];
list.forEach((element) { // list.forEach((element) {
_list.add(element.id!); // _list.add(element.id!);
}); // });
return _list; // return _list;
} // }
Widget _buildTile( // Widget _buildTile(
int? groupId, int? id, int? years, double? price, List<int> list) { // // int? groupId, int? id, int? years, double? price, List<int> list
return GestureDetector( // DetailedVoList model,int index,int id,
onTap: () { // ) {
String item = id.toString() + groupId.toString(); // return GestureDetector(
if (_selectItems.contains(item)) { // onTap: () {
_selectItems.remove(item); // // String item = id.toString() + model.groupId.toString();
_payNum -= 1; // // if (_selectItems.contains(item)) {
_payTotal -= price!.toDouble(); // // _selectItems.remove(item);
list.forEach((element) { // // _payNum -= 1;
_ids.remove(element); // // _payTotal -= price!.toDouble();
}); // // list.forEach((element) {
} else { // // _ids.remove(element);
_selectItems.add(item); // // });
_ids.addAll(list); // // } else {
_payNum += 1; // // _selectItems.add(item);
_payTotal += price!.toDouble(); // // _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(() {}); Widget _expandedTile(DetailedVoList model, int index1, int index2) {
}, return ExpandablePanel(
child: Row( theme: ExpandableThemeData.combine(
ExpandableThemeData(
headerAlignment: ExpandablePanelHeaderAlignment.center),
ExpandableThemeData.defaults),
header: Row(
crossAxisAlignment: CrossAxisAlignment.center,
mainAxisAlignment: MainAxisAlignment.center,
children: [ children: [
BeeCheckRadio(
value: id.toString() + groupId.toString(), 12.w.widthBox,
groupValue: _selectItems), model.groupId == 1
24.w.widthBox, ? '${widget.year}上半年'.text.black.size(28.sp).make()
groupId == 1 : '${widget.year}下半年'.text.black.size(28.sp).make(),
? '$years上半年'.text.black.size(28.sp).make()
: '$years下半年'.text.black.size(28.sp).make(),
Spacer(), Spacer(),
'¥${price.toString()}' '¥${model.paymentPrice.toStringAsFixed(2)}'
.text .text
.color(kDangerColor) .color(kDangerColor)
.size(28.sp) .size(28.sp)
@ -114,10 +172,57 @@ class _LifePayDetailPageState extends State<LifePayDetailPage> {
24.w.widthBox, 24.w.widthBox,
], ],
).material(color: Colors.transparent), ).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<AppProvider>(context); final appProvider = Provider.of<AppProvider>(context);
return Container( return Container(
padding: EdgeInsets.symmetric(horizontal: 32.w, vertical: 20.w), padding: EdgeInsets.symmetric(horizontal: 32.w, vertical: 20.w),
@ -125,7 +230,7 @@ class _LifePayDetailPageState extends State<LifePayDetailPage> {
children: [ children: [
Row( Row(
children: [ children: [
model.name!.text.black.size(30.sp).bold.make(), model.name.text.black.size(30.sp).bold.make(),
Spacer(), Spacer(),
'${S.of(context)!.tempPlotName} ${appProvider.selectedHouse!.estateId}' '${S.of(context)!.tempPlotName} ${appProvider.selectedHouse!.estateId}'
.text .text
@ -134,93 +239,99 @@ class _LifePayDetailPageState extends State<LifePayDetailPage> {
.make(), .make(),
], ],
), ),
50.w.heightBox, ...List.generate(
...model.detailedVoList! model.detailedVoList.length,
.map((e) => _buildTile(e.groupId, model.id, widget.model!.years, (index) =>
e.paymentPrice, _findIds(e.detailsVoList ?? []))) _expandedTile(model.detailedVoList[index], index1, index)),
.toList()
.sepWidget(separate: 24.w.heightBox),
], ],
), ),
); );
} }
LifePayListModel clearModel(LifePayListModel model) {
model.dailyPaymentTypeVos.forEach((element) {
element.detailedVoList.forEach((element) {
element.detailsVoList.clear();
});
});
return model;
}
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return BeeScaffold( var animatedContainer = AnimatedContainer(
title: duration: Duration(milliseconds: 300),
'${BeeParse.getCustomYears(widget.model!.years!)}-${widget.model!.years}年明细', decoration: BoxDecoration(
body: ListView( border: Border.all(
padding: EdgeInsets.only(top: 16.w), width: 1.w,
children: [ color: isAllSelect ? kPrimaryColor : kDarkSubColor),
...widget.model!.dailyPaymentTypeVos! color: isAllSelect ? kPrimaryColor : Colors.transparent,
.map((e) => _buildCard(e)) borderRadius: BorderRadius.circular(20.w)),
.toList(), curve: Curves.easeInOutCubic,
], width: 40.w,
), height: 40.w,
bottomNavi: Container( child: isAllSelect
padding: EdgeInsets.fromLTRB( ? Icon(
32.w, 16.w, 32.w, 12.w + MediaQuery.of(context).padding.bottom), CupertinoIcons.check_mark,
child: Row( size: 25.w,
children: [ color: Colors.white,
GestureDetector( )
onTap: () { : SizedBox(),
if (isAllSelect) { );
_selectItems.clear(); return BeeScaffold(
_ids.clear(); title:
_payNum = 0; '${BeeParse.getCustomYears(widget.model.years)}-${widget.model.years}年明细',
_payTotal = 0; body: ListView(
} else { padding: EdgeInsets.only(top: 16.w),
for (var i = 0; children: List.generate(_model.dailyPaymentTypeVos.length,
i < widget.model!.dailyPaymentTypeVos!.length; (index) => _buildCard(_model.dailyPaymentTypeVos[index], index))),
i++) { bottomNavi: Container(
for (var j = 0; padding: EdgeInsets.fromLTRB(
j < 32.w, 16.w, 32.w, 12.w + MediaQuery.of(context).padding.bottom),
widget.model!.dailyPaymentTypeVos![i] child: Row(
.detailedVoList!.length; children: [
j++) { GestureDetector(
String id = onTap: () {
widget.model!.dailyPaymentTypeVos![i].id.toString() + if (isAllSelect) {
widget.model!.dailyPaymentTypeVos![i] // _selectItems.clear();
.detailedVoList![j].groupId // _ids.clear();
.toString(); // _payNum = 0;
if (!_selectItems.contains(id)) { // _payTotal = 0;
_selectItems.add(id); clearModel(_selectModel);
_ids.addAll(_findIds(widget } else {
.model! // for (var i = 0;
.dailyPaymentTypeVos![i] // i < widget.model.dailyPaymentTypeVos!.length;
.detailedVoList![j] // i++) {
.detailsVoList ?? // for (var j = 0;
[])); // j <
_payNum += 1; // widget.model.dailyPaymentTypeVos![i]
_payTotal += widget.model!.dailyPaymentTypeVos![i] // .detailedVoList!.length;
.detailedVoList![j].paymentPrice! // j++) {
.toDouble(); // 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(() {});
} },
setState(() {}); child: animatedContainer,
},
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(),
),
), ),
Spacer(), Spacer(),
Column( Column(
@ -236,13 +347,17 @@ class _LifePayDetailPageState extends State<LifePayDetailPage> {
fontWeight: FontWeight.bold), fontWeight: FontWeight.bold),
children: [ children: [
TextSpan( TextSpan(
text: '${_payTotal.toStringAsFixed(2)}', text: '${total.payTotal.toStringAsFixed(2)}',
style: TextStyle( style: TextStyle(
color: kDangerColor, color: kDangerColor,
fontSize: 32.sp, fontSize: 32.sp,
fontWeight: FontWeight.bold)), fontWeight: FontWeight.bold)),
])), ])),
'已选$_payNum'.text.color(ktextSubColor).size(20.sp).make(), '已选${total.payCount}'
.text
.color(ktextSubColor)
.size(20.sp)
.make(),
], ],
), ),
8.w.widthBox, 8.w.widthBox,
@ -253,7 +368,7 @@ class _LifePayDetailPageState extends State<LifePayDetailPage> {
color: kPrimaryColor, color: kPrimaryColor,
padding: EdgeInsets.symmetric(horizontal: 50.w, vertical: 15.w), padding: EdgeInsets.symmetric(horizontal: 50.w, vertical: 15.w),
onPressed: () { onPressed: () {
Get.back(result: [_payNum, _payTotal, _ids]); Get.back(result: _selectModel);
}, },
child: '选好了'.text.black.size(32.sp).bold.make(), child: '选好了'.text.black.size(32.sp).bold.make(),
), ),

@ -50,10 +50,15 @@ class _PaySuerplusRentPageState extends State<PaySuerplusRentPage> {
hintText: hintText:
DateUtil.formatDateStr(widget.time, format: 'yyyy-MM-dd'), DateUtil.formatDateStr(widget.time, format: 'yyyy-MM-dd'),
onPressed: () {}), onPressed: () {}),
BeeInputRow.button( widget.amount <= 0
title: '剩余需结清房租(元)', ? BeeInputRow.button(
hintText: widget.amount.toStringAsFixed(2), title: '房租余额(请联系物业退款)',
onPressed: () {}), hintText: widget.amount.abs().toStringAsFixed(2),
onPressed: () {})
: BeeInputRow.button(
title: '剩余需结清房租(元)',
hintText: widget.amount.toStringAsFixed(2),
onPressed: () {}),
BeeInputRow.button( BeeInputRow.button(
title: '支付方式', title: '支付方式',
hintText: _payMethod, hintText: _payMethod,
@ -72,14 +77,16 @@ class _PaySuerplusRentPageState extends State<PaySuerplusRentPage> {
onPressed: () async { onPressed: () async {
Function cancel = BotToast.showLoading(); Function cancel = BotToast.showLoading();
try { try {
String code = await HouseFunc() if (widget.amount <= 0) {
.leaseRentOrder(widget.id, 1, widget.amount.toDouble()); String code = await HouseFunc()
bool result = .leaseRentOrder(widget.id, 1, widget.amount.toDouble());
await PayUtil().callAliPay(code, API.pay.leaseRentCheck); bool result =
if (result) { await PayUtil().callAliPay(code, API.pay.leaseRentCheck);
Get.back(); if (result) {
Get.off(() => PayFinishPage()); Get.back();
} Get.off(() => PayFinishPage());
}
} else {}
} catch (e) { } catch (e) {
LoggerData.addData(e); LoggerData.addData(e);
} }

@ -31,7 +31,7 @@ class _RefundBondPageState extends State<RefundBondPage> {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return BeeScaffold( return BeeScaffold(
bgColor: Colors.white, bodyColor: Colors.white,
title: '保证金信息', title: '保证金信息',
body: ListView( body: ListView(
children: [ children: [

@ -35,6 +35,9 @@ PODS:
- GoogleUtilities/UserDefaults (~> 7.0) - GoogleUtilities/UserDefaults (~> 7.0)
- PromisesObjC (~> 1.2) - PromisesObjC (~> 1.2)
- FlutterMacOS (1.0.0) - FlutterMacOS (1.0.0)
- FMDB (2.7.5):
- FMDB/standard (= 2.7.5)
- FMDB/standard (2.7.5)
- GoogleDataTransport (8.4.0): - GoogleDataTransport (8.4.0):
- GoogleUtilities/Environment (~> 7.2) - GoogleUtilities/Environment (~> 7.2)
- nanopb (~> 2.30908.0) - nanopb (~> 2.30908.0)
@ -59,6 +62,9 @@ PODS:
- PromisesObjC (1.2.12) - PromisesObjC (1.2.12)
- shared_preferences_macos (0.0.1): - shared_preferences_macos (0.0.1):
- FlutterMacOS - FlutterMacOS
- sqflite (0.0.2):
- FlutterMacOS
- FMDB (>= 2.7.5)
- url_launcher_macos (0.0.1): - url_launcher_macos (0.0.1):
- FlutterMacOS - FlutterMacOS
@ -71,6 +77,7 @@ DEPENDENCIES:
- package_info_plus_macos (from `Flutter/ephemeral/.symlinks/plugins/package_info_plus_macos/macos`) - 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`) - path_provider_macos (from `Flutter/ephemeral/.symlinks/plugins/path_provider_macos/macos`)
- shared_preferences_macos (from `Flutter/ephemeral/.symlinks/plugins/shared_preferences_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`) - url_launcher_macos (from `Flutter/ephemeral/.symlinks/plugins/url_launcher_macos/macos`)
SPEC REPOS: SPEC REPOS:
@ -80,6 +87,7 @@ SPEC REPOS:
- FirebaseCoreDiagnostics - FirebaseCoreDiagnostics
- FirebaseCrashlytics - FirebaseCrashlytics
- FirebaseInstallations - FirebaseInstallations
- FMDB
- GoogleDataTransport - GoogleDataTransport
- GoogleUtilities - GoogleUtilities
- nanopb - nanopb
@ -102,6 +110,8 @@ EXTERNAL SOURCES:
:path: Flutter/ephemeral/.symlinks/plugins/path_provider_macos/macos :path: Flutter/ephemeral/.symlinks/plugins/path_provider_macos/macos
shared_preferences_macos: shared_preferences_macos:
:path: Flutter/ephemeral/.symlinks/plugins/shared_preferences_macos/macos :path: Flutter/ephemeral/.symlinks/plugins/shared_preferences_macos/macos
sqflite:
:path: Flutter/ephemeral/.symlinks/plugins/sqflite/macos
url_launcher_macos: url_launcher_macos:
:path: Flutter/ephemeral/.symlinks/plugins/url_launcher_macos/macos :path: Flutter/ephemeral/.symlinks/plugins/url_launcher_macos/macos
@ -115,6 +125,7 @@ SPEC CHECKSUMS:
FirebaseCrashlytics: 272b675aa9d1e9bae1f9e1449fcc1f2cf6042806 FirebaseCrashlytics: 272b675aa9d1e9bae1f9e1449fcc1f2cf6042806
FirebaseInstallations: a58d4f72ec5861840b84df489f2668d970df558a FirebaseInstallations: a58d4f72ec5861840b84df489f2668d970df558a
FlutterMacOS: 57701585bf7de1b3fc2bb61f6378d73bbdea8424 FlutterMacOS: 57701585bf7de1b3fc2bb61f6378d73bbdea8424
FMDB: 2ce00b547f966261cd18927a3ddb07cb6f3db82a
GoogleDataTransport: cd9db2180fcecd8da1b561aea31e3e56cf834aa7 GoogleDataTransport: cd9db2180fcecd8da1b561aea31e3e56cf834aa7
GoogleUtilities: 284cddc7fffc14ae1907efb6f78ab95c1fccaedc GoogleUtilities: 284cddc7fffc14ae1907efb6f78ab95c1fccaedc
nanopb: a0ba3315591a9ae0a16a309ee504766e90db0c96 nanopb: a0ba3315591a9ae0a16a309ee504766e90db0c96
@ -123,6 +134,7 @@ SPEC CHECKSUMS:
path_provider_macos: a0a3fd666cb7cd0448e936fb4abad4052961002b path_provider_macos: a0a3fd666cb7cd0448e936fb4abad4052961002b
PromisesObjC: 3113f7f76903778cf4a0586bd1ab89329a0b7b97 PromisesObjC: 3113f7f76903778cf4a0586bd1ab89329a0b7b97
shared_preferences_macos: 480ce071d0666e37cef23fe6c702293a3d21799e shared_preferences_macos: 480ce071d0666e37cef23fe6c702293a3d21799e
sqflite: a5789cceda41d54d23f31d6de539d65bb14100ea
url_launcher_macos: 45af3d61de06997666568a7149c1be98b41c95d4 url_launcher_macos: 45af3d61de06997666568a7149c1be98b41c95d4
PODFILE CHECKSUM: c7161fcf45d4fd9025dc0f48a76d6e64e52f8176 PODFILE CHECKSUM: c7161fcf45d4fd9025dc0f48a76d6e64e52f8176

@ -323,6 +323,13 @@ packages:
url: "https://pub.flutter-io.cn" url: "https://pub.flutter-io.cn"
source: hosted source: hosted
version: "2.0.0" 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: extended_list_library:
dependency: transitive dependency: transitive
description: description:

@ -105,8 +105,9 @@ dependencies:
#model 插件 #model 插件
equatable: ^2.0.0 equatable: ^2.0.0
#pdf文件预览 #pdf文件预览
# flutter_cached_pdfview: ^0.4.0-nullsafety
advance_pdf_viewer: ^2.0.0 advance_pdf_viewer: ^2.0.0
#扩展组件
expandable: ^5.0.1
dev_dependencies: dev_dependencies:
flutter_test: flutter_test:

Loading…
Cancel
Save