pull/1/head
戴余标 3 years ago
commit 138803a8f8

File diff suppressed because it is too large Load Diff

@ -34,7 +34,7 @@ ActivityDetailModel _$ActivityDetailModelFromJson(Map<String, dynamic> json) =>
organizerImgList: (json['organizerImgList'] as List<dynamic>) organizerImgList: (json['organizerImgList'] as List<dynamic>)
.map((e) => ImgModel.fromJson(e as Map<String, dynamic>)) .map((e) => ImgModel.fromJson(e as Map<String, dynamic>))
.toList(), .toList(),
isRegistration:json['isRegistration'] as int isRegistration: json['isRegistration'] as int,
); );
Registration _$RegistrationFromJson(Map<String, dynamic> json) => Registration( Registration _$RegistrationFromJson(Map<String, dynamic> json) => Registration(

@ -1,33 +1,40 @@
import 'package:equatable/equatable.dart'; import 'package:equatable/equatable.dart';
import 'package:json_annotation/json_annotation.dart'; import 'package:json_annotation/json_annotation.dart';
part 'life_pay_model.g.dart';
part 'life_pay_model.g.dart';
@JsonSerializable(createToJson: true, explicitToJson: true) @JsonSerializable(createToJson: true, explicitToJson: true)
class LifePayModel extends Equatable { class LifePayModel extends Equatable {
final int id; final int id;
final String chargesName; final String? chargesName;
final String billDateStart; final String billDateStart;
final String billDateEnd; final String billDateEnd;
final String createDate; final String createDate;
final double payPrincipal; final double payPrincipal;
final double defaultAmount; final double defaultAmount;
factory LifePayModel.fromJson(Map<String, dynamic> json) =>
_$LifePayModelFromJson(json);
factory LifePayModel.fromJson(Map<String, dynamic> json) =>_$LifePayModelFromJson(json);
Map<String, dynamic> toJson() => _$LifePayModelToJson(this); Map<String, dynamic> toJson() => _$LifePayModelToJson(this);
LifePayModel({ @override
List<Object?> get props => [
id,
chargesName,
billDateStart,
billDateEnd,
createDate,
payPrincipal,
defaultAmount
];
const LifePayModel({
required this.id, required this.id,
required this.chargesName, this.chargesName,
required this.billDateStart, required this.billDateStart,
required this.billDateEnd, required this.billDateEnd,
required this.createDate, required this.createDate,
required this.payPrincipal, required this.payPrincipal,
required this.defaultAmount, required this.defaultAmount,
}); });
@override
List<Object?> get props => [id, chargesName, billDateStart,billDateEnd,createDate,payPrincipal,defaultAmount];
} }

@ -8,7 +8,7 @@ part of 'life_pay_model.dart';
LifePayModel _$LifePayModelFromJson(Map<String, dynamic> json) => LifePayModel( LifePayModel _$LifePayModelFromJson(Map<String, dynamic> json) => LifePayModel(
id: json['id'] as int, id: json['id'] as int,
chargesName: json['chargesName'] as String, chargesName: json['chargesName'] as String?,
billDateStart: json['billDateStart'] as String, billDateStart: json['billDateStart'] as String,
billDateEnd: json['billDateEnd'] as String, billDateEnd: json['billDateEnd'] as String,
createDate: json['createDate'] as String, createDate: json['createDate'] as String,

@ -20,5 +20,5 @@ ReplyListModel _$ReplyListModelFromJson(Map<String, dynamic> json) =>
dynamicImgList: (json['dynamicImgList'] as List<dynamic>) dynamicImgList: (json['dynamicImgList'] as List<dynamic>)
.map((e) => ImgModel.fromJson(e as Map<String, dynamic>)) .map((e) => ImgModel.fromJson(e as Map<String, dynamic>))
.toList(), .toList(),
jumpId:json['jumpId'] as int jumpId: json['jumpId'] as int,
); );

@ -1,6 +1,5 @@
import 'package:json_annotation/json_annotation.dart';
import 'package:aku_new_community/model/common/img_model.dart'; import 'package:aku_new_community/model/common/img_model.dart';
import 'package:json_annotation/json_annotation.dart';
part 'user_info_model.g.dart'; part 'user_info_model.g.dart';
@ -8,6 +7,7 @@ part 'user_info_model.g.dart';
class UserInfoModel { class UserInfoModel {
final int id; final int id;
final int communityId; final int communityId;
final String communityName;
final String communityCode; final String communityCode;
final String? name; final String? name;
final String? idCard; final String? idCard;
@ -44,6 +44,7 @@ class UserInfoModel {
const UserInfoModel({ const UserInfoModel({
required this.id, required this.id,
required this.communityId, required this.communityId,
required this.communityName,
required this.communityCode, required this.communityCode,
this.name, this.name,
this.idCard, this.idCard,

@ -10,6 +10,7 @@ UserInfoModel _$UserInfoModelFromJson(Map<String, dynamic> json) =>
UserInfoModel( UserInfoModel(
id: json['id'] as int, id: json['id'] as int,
communityId: json['communityId'] as int, communityId: json['communityId'] as int,
communityName: json['communityName'] as String,
communityCode: json['communityCode'] as String, communityCode: json['communityCode'] as String,
name: json['name'] as String?, name: json['name'] as String?,
idCard: json['idCard'] as String?, idCard: json['idCard'] as String?,

@ -18,10 +18,8 @@ import 'package:aku_new_community/ui/community/notice/notice_detail_page.dart';
import 'package:aku_new_community/ui/home/home_notification.dart'; import 'package:aku_new_community/ui/home/home_notification.dart';
import 'package:aku_new_community/ui/home/home_title.dart'; import 'package:aku_new_community/ui/home/home_title.dart';
import 'package:aku_new_community/ui/home/public_infomation/public_information_detail_page.dart'; import 'package:aku_new_community/ui/home/public_infomation/public_information_detail_page.dart';
import 'package:aku_new_community/ui/manager/advice/advice_page.dart';
import 'package:aku_new_community/ui/market/search/good_detail_page.dart'; import 'package:aku_new_community/ui/market/search/good_detail_page.dart';
import 'package:aku_new_community/utils/headers.dart'; import 'package:aku_new_community/utils/headers.dart';
import 'package:aku_new_community/utils/hive_store.dart';
import 'package:aku_new_community/utils/login_util.dart'; import 'package:aku_new_community/utils/login_util.dart';
import 'package:aku_new_community/utils/websocket/tips_dialog.dart'; import 'package:aku_new_community/utils/websocket/tips_dialog.dart';
import 'package:aku_new_community/widget/beeImageNetwork.dart'; import 'package:aku_new_community/widget/beeImageNetwork.dart';
@ -112,7 +110,7 @@ class _HomePageState extends State<HomePage>
left: 32.w, left: 32.w,
bottom: 20.w), bottom: 20.w),
child: Row(crossAxisAlignment: CrossAxisAlignment.center, children: [ child: Row(crossAxisAlignment: CrossAxisAlignment.center, children: [
if (appProvider.location != null) // if (appProvider.location != null)
Image.asset( Image.asset(
Assets.home.icLocation.path, Assets.home.icLocation.path,
width: 48.w, width: 48.w,
@ -120,9 +118,10 @@ class _HomePageState extends State<HomePage>
), ),
16.wb, 16.wb,
Text( Text(
appProvider.location?['city'] == null '${UserTool.userProvider.userInfoModel?.communityName ?? ""}',
? '' // appProvider.location?['city'] == null
: appProvider.location?['city'] as String? ?? '', // ? ''
// : appProvider.location?['city'] as String? ?? '',
style: TextStyle( style: TextStyle(
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,
fontSize: 28.sp, fontSize: 28.sp,
@ -356,12 +355,7 @@ class _HomePageState extends State<HomePage>
), ),
), ),
onTap: () async { onTap: () async {
var agreement = await HiveStore.appBox?.get('AdvicePage') ?? false;
if (!agreement) {
await TipsDialog.tipsDialog(); await TipsDialog.tipsDialog();
HiveStore.appBox!.put('AdvicePage', true);
}
// Get.to(AdvicePage( // Get.to(AdvicePage(
// type: AdviceType.SUGGESTION)); // type: AdviceType.SUGGESTION));
}, },

@ -1,22 +1,15 @@
import 'dart:convert';
import 'package:aku_new_community/base/base_style.dart'; import 'package:aku_new_community/base/base_style.dart';
import 'package:aku_new_community/constants/api.dart';
import 'package:aku_new_community/constants/saas_api.dart'; import 'package:aku_new_community/constants/saas_api.dart';
import 'package:aku_new_community/gen/assets.gen.dart'; import 'package:aku_new_community/gen/assets.gen.dart';
import 'package:aku_new_community/models/life_pay/life_pay_list_model.dart';
import 'package:aku_new_community/models/life_pay/life_pay_model.dart'; import 'package:aku_new_community/models/life_pay/life_pay_model.dart';
import 'package:aku_new_community/pages/life_pay/life_pay_record_page.dart'; import 'package:aku_new_community/pages/life_pay/life_pay_record_page.dart';
import 'package:aku_new_community/pages/life_pay/life_pre_pay_page.dart'; import 'package:aku_new_community/pages/life_pay/life_pre_pay_page.dart';
import 'package:aku_new_community/pages/life_pay/pay_finish_page.dart'; import 'package:aku_new_community/pages/life_pay/pay_finish_page.dart';
import 'package:aku_new_community/pages/life_pay/pay_util.dart'; import 'package:aku_new_community/pages/life_pay/pay_util.dart';
import 'package:aku_new_community/pages/life_pay/widget/life_pay_detail_page.dart';
import 'package:aku_new_community/pages/life_pay/widget/life_pay_detail_page_new.dart'; import 'package:aku_new_community/pages/life_pay/widget/life_pay_detail_page_new.dart';
import 'package:aku_new_community/provider/app_provider.dart'; import 'package:aku_new_community/provider/app_provider.dart';
import 'package:aku_new_community/ui/profile/new_house/my_house_page.dart'; import 'package:aku_new_community/ui/profile/new_house/my_house_page.dart';
import 'package:aku_new_community/utils/bee_parse.dart';
import 'package:aku_new_community/utils/headers.dart'; import 'package:aku_new_community/utils/headers.dart';
import 'package:aku_new_community/utils/network/base_list_model.dart';
import 'package:aku_new_community/utils/network/base_model.dart'; import 'package:aku_new_community/utils/network/base_model.dart';
import 'package:aku_new_community/utils/network/net_util.dart'; import 'package:aku_new_community/utils/network/net_util.dart';
import 'package:aku_new_community/widget/bee_divider.dart'; import 'package:aku_new_community/widget/bee_divider.dart';
@ -64,12 +57,10 @@ class _LifePayPageNewState extends State<LifePayPageNew> {
List<int> _selectModelIndex = []; //model List<int> _selectModelIndex = []; //model
bool get allSelect => bool get allSelect => ((_selectMonths.length == _selectModelIndex.length) &&
((_selectMonths.length == _selectModelIndex.length) && (_selectMonths.length != 0)); (_selectMonths.length != 0));
MonthPay get total { MonthPay get total {
double price = 0; double price = 0;
List<LifePayModel> ids = []; List<LifePayModel> ids = [];
for (var i in _selectModelIndex) { for (var i in _selectModelIndex) {
@ -78,7 +69,8 @@ class _LifePayPageNewState extends State<LifePayPageNew> {
price += model.payTotal; price += model.payTotal;
ids.addAll(model.selectIds); ids.addAll(model.selectIds);
} }
return MonthPay( payTotal: price, ids: [], selectIds: ids, itemNames: '', timeTitle: ''); return MonthPay(
payTotal: price, ids: [], selectIds: ids, itemNames: '', timeTitle: '');
} }
@override @override
@ -91,7 +83,6 @@ class _LifePayPageNewState extends State<LifePayPageNew> {
Get.off(() => MyHousePage()); Get.off(() => MyHousePage());
BotToast.showText(text: '请先选择您的房屋'); BotToast.showText(text: '请先选择您的房屋');
} }
}); });
_models = [ _models = [
@ -183,7 +174,8 @@ class _LifePayPageNewState extends State<LifePayPageNew> {
}); });
}, },
child: Container( child: Container(
padding: EdgeInsets.only(left: 10.w,right: 10.w,bottom: 50.w), padding:
EdgeInsets.only(left: 10.w, right: 10.w, bottom: 50.w),
color: Colors.transparent, color: Colors.transparent,
child: BeeCheckRadio( child: BeeCheckRadio(
value: index, value: index,
@ -198,7 +190,11 @@ class _LifePayPageNewState extends State<LifePayPageNew> {
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
mainAxisSize: MainAxisSize.min, mainAxisSize: MainAxisSize.min,
children: [ children: [
model.timeTitle.text.color(Colors.black.withOpacity(0.8)).bold.size(32.sp).make(), model.timeTitle.text
.color(Colors.black.withOpacity(0.8))
.bold
.size(32.sp)
.make(),
13.w.heightBox, 13.w.heightBox,
'已选择:' '已选择:'
.richText .richText
@ -220,7 +216,6 @@ class _LifePayPageNewState extends State<LifePayPageNew> {
.size(26.sp) .size(26.sp)
.make(), .make(),
13.w.heightBox, 13.w.heightBox,
SizedBox( SizedBox(
width: 400.w, width: 400.w,
child: Text( child: Text(
@ -230,11 +225,9 @@ class _LifePayPageNewState extends State<LifePayPageNew> {
style: TextStyle( style: TextStyle(
color: ktextSubColor, color: ktextSubColor,
fontSize: 28.sp, fontSize: 28.sp,
), ),
), ),
), ),
13.w.heightBox, 13.w.heightBox,
RichText( RichText(
text: TextSpan( text: TextSpan(
@ -265,22 +258,18 @@ class _LifePayPageNewState extends State<LifePayPageNew> {
children: [ children: [
GestureDetector( GestureDetector(
onTap: () async { onTap: () async {
dynamic back = await Get.to(() => LifePayDetailPageNew(
model: model,
dynamic back = await Get.to(()=>LifePayDetailPageNew(model: model,)); ));
if (back) { if (back) {
for (int i = 0; i < _selectMonths.length; i++) { for (int i = 0; i < _selectMonths.length; i++) {
if (_selectMonths[i].selectIds.isEmpty) { if (_selectMonths[i].selectIds.isEmpty) {
_selectModelIndex.remove(_selectMonths.indexOf(_selectMonths[i])); _selectModelIndex
.remove(_selectMonths.indexOf(_selectMonths[i]));
} }
} }
setState(() { setState(() {});
});
} }
}, },
child: Container( child: Container(
decoration: BoxDecoration( decoration: BoxDecoration(
@ -289,11 +278,14 @@ class _LifePayPageNewState extends State<LifePayPageNew> {
), ),
padding: padding:
EdgeInsets.symmetric(horizontal: 20.w, vertical: 8.w), EdgeInsets.symmetric(horizontal: 20.w, vertical: 8.w),
child: '选择明细'.text.color(Colors.black.withOpacity(0.85)).size(22.sp).bold.make(), child: '选择明细'
.text
.color(Colors.black.withOpacity(0.85))
.size(22.sp)
.bold
.make(),
), ),
), ),
], ],
), ),
], ],
@ -309,14 +301,13 @@ class _LifePayPageNewState extends State<LifePayPageNew> {
padding: EdgeInsets.symmetric(horizontal: 50.w, vertical: 15.w), padding: EdgeInsets.symmetric(horizontal: 50.w, vertical: 15.w),
onPressed: () async { onPressed: () async {
Function cancel = BotToast.showLoading(); Function cancel = BotToast.showLoading();
BaseModel baseModel = BaseModel baseModel = await NetUtil()
await NetUtil().post(SAASAPI.pay.createLivingExpensesOrder, params: { .post(SAASAPI.pay.createLivingExpensesOrder, params: {
"chargesBillId": total.ids, "chargesBillId": total.ids,
"paymentAmount": total.payTotal "paymentAmount": total.payTotal
}); });
if (baseModel.success) { if (baseModel.success) {
bool result = await PayUtil().callAliPay( bool result = await PayUtil().callAliPay((baseModel.data as String),
(baseModel.data as String),
SAASAPI.pay.livingExpensesOrderCheckAlipay); SAASAPI.pay.livingExpensesOrderCheckAlipay);
if (result) { if (result) {
Get.off(() => PayFinishPage()); Get.off(() => PayFinishPage());
@ -370,10 +361,8 @@ class _LifePayPageNewState extends State<LifePayPageNew> {
} }
Future<double> _dailyPaymentPrePay() async { Future<double> _dailyPaymentPrePay() async {
BaseModel baseModel = BaseModel baseModel = await NetUtil().get(SAASAPI.lifePay.findEstateBalance,
await NetUtil().get(SAASAPI.lifePay.findEstateBalance, params: { params: {"estateId": UserTool.userProvider.defaultHouse!.id});
"estateId": UserTool.userProvider.defaultHouse!.id
});
if (baseModel.success) { if (baseModel.success) {
return (baseModel.data as num).toDouble(); return (baseModel.data as num).toDouble();
} else { } else {
@ -394,8 +383,11 @@ class _LifePayPageNewState extends State<LifePayPageNew> {
child: Container( child: Container(
padding: EdgeInsets.fromLTRB(32.w, 28.w, 32.w, 20.w), padding: EdgeInsets.fromLTRB(32.w, 28.w, 32.w, 20.w),
alignment: Alignment.center, alignment: Alignment.center,
child: Image.asset(Assets.icons.lifePayRecord.path,width:48.w ,height: 48.w,) child: Image.asset(
), Assets.icons.lifePayRecord.path,
width: 48.w,
height: 48.w,
)),
), ),
], ],
body: EasyRefresh( body: EasyRefresh(
@ -403,26 +395,19 @@ class _LifePayPageNewState extends State<LifePayPageNew> {
header: MaterialHeader(), header: MaterialHeader(),
controller: _controller, controller: _controller,
onRefresh: () async { onRefresh: () async {
_prePrice = await _dailyPaymentPrePay(); _prePrice = await _dailyPaymentPrePay();
_selectMonths.clear(); _selectMonths.clear();
BaseModel model = await NetUtil() BaseModel model = await NetUtil().get(
.get(SAASAPI.lifePay.livingExpensesList, params: { SAASAPI.lifePay.livingExpensesList,
'estateId': UserTool.userProvider.defaultHouse!.id params: {'estateId': UserTool.userProvider.defaultHouse!.id});
});
if (model.success) { if (model.success) {
if (model.data != null) if (model.data != null)
_models = (model.data as List) _models = (model.data as List)
.map((e) => LifePayModel.fromJson(e)) .map((e) => LifePayModel.fromJson(e))
.toList(); .toList();
} }
/// ///
if (_models.isNotEmpty) if (_models.isNotEmpty)
_models.forEach((element) { _models.forEach((element) {
@ -430,21 +415,23 @@ class _LifePayPageNewState extends State<LifePayPageNew> {
_selectMonths.add(MonthPay( _selectMonths.add(MonthPay(
payTotal: element.payPrincipal + element.defaultAmount, payTotal: element.payPrincipal + element.defaultAmount,
ids: [element], ids: [element],
itemNames: element.chargesName, itemNames: element.chargesName ?? '',
timeTitle: DateUtil.formatDate( timeTitle: DateUtil.formatDate(
DateTime.parse(element.billDateStart), DateTime.parse(element.billDateStart),
format: 'yyyy-MM'), selectIds: [element],)); format: 'yyyy-MM'),
selectIds: [element],
));
} else { } else {
bool same = false; bool same = false;
for (int i = 0; i < _selectMonths.length; i++) { for (int i = 0; i < _selectMonths.length; i++) {
if (DateUtil.formatDate(DateTime.parse(element.billDateStart), if (DateUtil.formatDate(DateTime.parse(element.billDateStart),
format: 'yyyy-MM') == format: 'yyyy-MM') ==
_selectMonths[i].timeTitle) { _selectMonths[i].timeTitle) {
_selectMonths[i].payTotal += _selectMonths[i].payTotal +=
element.defaultAmount + element.payPrincipal; element.defaultAmount + element.payPrincipal;
_selectMonths[i].ids.add(element); _selectMonths[i].ids.add(element);
_selectMonths[i].itemNames += ''+element.chargesName; _selectMonths[i].itemNames +=
'' + (element.chargesName ?? '');
_selectMonths[i].selectIds.add(element); _selectMonths[i].selectIds.add(element);
same = true; same = true;
@ -455,12 +442,11 @@ class _LifePayPageNewState extends State<LifePayPageNew> {
payTotal: element.payPrincipal + element.defaultAmount, payTotal: element.payPrincipal + element.defaultAmount,
ids: [element], ids: [element],
selectIds: [element], selectIds: [element],
itemNames: element.chargesName, itemNames: element.chargesName ?? '',
timeTitle: DateUtil.formatDate( timeTitle: DateUtil.formatDate(
DateTime.parse(element.billDateStart), DateTime.parse(element.billDateStart),
format: 'yyyy-MM'))); format: 'yyyy-MM')));
} }
} }
}); });
if (mounted) setState(() {}); if (mounted) setState(() {});
@ -483,9 +469,11 @@ class _LifePayPageNewState extends State<LifePayPageNew> {
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
Padding(padding: EdgeInsets.symmetric(vertical: 24.w,horizontal: 32.w), Padding(
child: '当前账单'.text.color(ktextPrimary).size(28.sp).make(),), padding:
EdgeInsets.symmetric(vertical: 24.w, horizontal: 32.w),
child: '当前账单'.text.color(ktextPrimary).size(28.sp).make(),
),
BeeDivider.horizontal(), BeeDivider.horizontal(),
...List.generate(_selectMonths.length, ...List.generate(_selectMonths.length,
(index) => _buildCard(_selectMonths[index], index)) (index) => _buildCard(_selectMonths[index], index))
@ -508,7 +496,6 @@ class _LifePayPageNewState extends State<LifePayPageNew> {
_selectModelIndex.clear(); _selectModelIndex.clear();
setState(() {}); setState(() {});
} else { } else {
_selectModelIndex.clear(); _selectModelIndex.clear();
for (var i = 0; i < _selectMonths.length; i++) { for (var i = 0; i < _selectMonths.length; i++) {
_selectModelIndex.add(i); _selectModelIndex.add(i);
@ -537,12 +524,7 @@ class _LifePayPageNewState extends State<LifePayPageNew> {
).material(color: Colors.transparent), ).material(color: Colors.transparent),
), ),
16.wb, 16.wb,
'全选' '全选'.text.color(ktextSubColor).size(28.sp).bold.make(),
.text
.color(ktextSubColor)
.size(28.sp)
.bold
.make(),
Spacer(), Spacer(),
Column( Column(
crossAxisAlignment: CrossAxisAlignment.end, crossAxisAlignment: CrossAxisAlignment.end,

@ -1,22 +1,15 @@
import 'package:aku_new_community/base/base_style.dart';
import 'package:aku_new_community/models/life_pay/life_pay_model.dart'; import 'package:aku_new_community/models/life_pay/life_pay_model.dart';
import 'package:aku_new_community/pages/life_pay/life_pay_page.dart';
import 'package:aku_new_community/pages/life_pay/life_pay_page_new.dart'; import 'package:aku_new_community/pages/life_pay/life_pay_page_new.dart';
import 'package:aku_new_community/utils/headers.dart';
import 'package:aku_new_community/widget/bee_divider.dart'; import 'package:aku_new_community/widget/bee_divider.dart';
import 'package:aku_new_community/widget/bee_scaffold.dart';
import 'package:aku_new_community/widget/buttons/bee_check_radio.dart';
import 'package:common_utils/common_utils.dart'; import 'package:common_utils/common_utils.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:expandable/expandable.dart';
import 'package:get/get.dart'; import 'package:get/get.dart';
import 'package:provider/provider.dart';
import 'package:aku_new_community/base/base_style.dart';
import 'package:aku_new_community/models/life_pay/life_pay_list_model.dart';
import 'package:aku_new_community/pages/life_pay/life_pay_page.dart';
import 'package:aku_new_community/provider/app_provider.dart';
import 'package:aku_new_community/utils/bee_parse.dart';
import 'package:aku_new_community/utils/headers.dart';
import 'package:aku_new_community/widget/bee_scaffold.dart';
import 'package:aku_new_community/widget/buttons/bee_check_radio.dart';
class LifePayDetailPageNew extends StatefulWidget { class LifePayDetailPageNew extends StatefulWidget {
final MonthPay model; final MonthPay model;
@ -35,7 +28,6 @@ class _LifePayDetailPageNewState extends State<LifePayDetailPageNew> {
List<int> _selectModelIndex = []; //model List<int> _selectModelIndex = []; //model
List<LifePayModel> _list = []; List<LifePayModel> _list = [];
SelectPay get total { SelectPay get total {
int count = 0; int count = 0;
double price = 0; double price = 0;
@ -51,7 +43,8 @@ class _LifePayDetailPageNewState extends State<LifePayDetailPageNew> {
} }
bool get isAllSelect { bool get isAllSelect {
return _selectModelIndex.length == widget.model.ids.length && _selectModelIndex != 0; return _selectModelIndex.length == widget.model.ids.length &&
_selectModelIndex != 0;
} }
@override @override
@ -59,21 +52,15 @@ class _LifePayDetailPageNewState extends State<LifePayDetailPageNew> {
super.initState(); super.initState();
for (int i = 0; i < widget.model.selectIds.length; i++) { for (int i = 0; i < widget.model.selectIds.length; i++) {
_selectModelIndex
_selectModelIndex.add(widget.model.ids.indexOf(widget.model.selectIds[i])); .add(widget.model.ids.indexOf(widget.model.selectIds[i]));
} }
for (int i = 0; i < widget.model.ids.length; i++) { for (int i = 0; i < widget.model.ids.length; i++) {
_list.add(widget.model.ids[i]); _list.add(widget.model.ids[i]);
} }
} }
Widget _buildCard(LifePayModel model, int index) { Widget _buildCard(LifePayModel model, int index) {
return Container( return Container(
padding: EdgeInsets.symmetric(vertical: 32.w, horizontal: 32.w), padding: EdgeInsets.symmetric(vertical: 32.w, horizontal: 32.w),
decoration: BoxDecoration( decoration: BoxDecoration(
@ -87,9 +74,6 @@ class _LifePayDetailPageNewState extends State<LifePayDetailPageNew> {
GestureDetector( GestureDetector(
onTap: () { onTap: () {
setState(() { setState(() {
if (_selectModelIndex.contains(index)) { if (_selectModelIndex.contains(index)) {
_selectModelIndex.remove(index); _selectModelIndex.remove(index);
widget.model.selectIds.remove(model); widget.model.selectIds.remove(model);
@ -102,7 +86,8 @@ class _LifePayDetailPageNewState extends State<LifePayDetailPageNew> {
}); });
}, },
child: Container( child: Container(
padding: EdgeInsets.only(left: 10.w,right: 10.w,top: 5.w,bottom: 50.w), padding: EdgeInsets.only(
left: 10.w, right: 10.w, top: 5.w, bottom: 50.w),
color: Colors.transparent, color: Colors.transparent,
child: BeeCheckRadio( child: BeeCheckRadio(
value: index, value: index,
@ -117,7 +102,11 @@ class _LifePayDetailPageNewState extends State<LifePayDetailPageNew> {
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
mainAxisSize: MainAxisSize.min, mainAxisSize: MainAxisSize.min,
children: [ children: [
model.chargesName.text.color(ktextSubColor).size(28.sp).make(), (model.chargesName ?? '')
.text
.color(ktextSubColor)
.size(28.sp)
.make(),
24.w.heightBox, 24.w.heightBox,
DateUtil.formatDate(DateTime.parse(model.billDateStart), DateUtil.formatDate(DateTime.parse(model.billDateStart),
format: 'yyyy/MM/dd') format: 'yyyy/MM/dd')
@ -127,23 +116,19 @@ class _LifePayDetailPageNewState extends State<LifePayDetailPageNew> {
.textSpan .textSpan
.color(Colors.black.withOpacity(0.45)) .color(Colors.black.withOpacity(0.45))
.size(24.sp) .size(24.sp)
.make(), .make(),
DateUtil.formatDate(DateTime.parse(model.billDateEnd), DateUtil.formatDate(DateTime.parse(model.billDateEnd),
format: 'yyyy/MM/dd') format: 'yyyy/MM/dd')
.textSpan .textSpan
.color(Colors.black.withOpacity(0.45)) .color(Colors.black.withOpacity(0.45))
.size(24.sp) .size(24.sp)
.make(), .make(),
]) ])
.color(Colors.black.withOpacity(0.45)) .color(Colors.black.withOpacity(0.45))
.size(24.sp) .size(24.sp)
.make(), .make(),
], ],
).expand(), ).expand(),
RichText( RichText(
text: TextSpan( text: TextSpan(
text: '¥ ', text: '¥ ',
@ -164,7 +149,6 @@ class _LifePayDetailPageNewState extends State<LifePayDetailPageNew> {
); );
} }
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
var animatedContainer = AnimatedContainer( var animatedContainer = AnimatedContainer(
@ -199,7 +183,6 @@ class _LifePayDetailPageNewState extends State<LifePayDetailPageNew> {
), ),
title: widget.model.timeTitle, title: widget.model.timeTitle,
body: WillPopScope( body: WillPopScope(
onWillPop: () async { onWillPop: () async {
/// ///
widget.model.selectIds = _list; widget.model.selectIds = _list;
@ -208,8 +191,14 @@ class _LifePayDetailPageNewState extends State<LifePayDetailPageNew> {
}, },
child: ListView( child: ListView(
padding: EdgeInsets.only(top: 16.w), padding: EdgeInsets.only(top: 16.w),
children: List.generate(widget.model.ids.length, children:
(index) => _buildCard(widget.model.ids[index], index)).sepWidget(separate: BeeDivider.horizontal(indent: 100.w,)),), List.generate(widget.model.ids.length,
(index) => _buildCard(widget.model.ids[index], index))
.sepWidget(
separate: BeeDivider.horizontal(
indent: 100.w,
)),
),
), ),
bottomNavi: Container( bottomNavi: Container(
color: Colors.white, color: Colors.white,
@ -217,7 +206,6 @@ class _LifePayDetailPageNewState extends State<LifePayDetailPageNew> {
32.w, 16.w, 32.w, 12.w + MediaQuery.of(context).padding.bottom), 32.w, 16.w, 32.w, 12.w + MediaQuery.of(context).padding.bottom),
child: Row( child: Row(
children: [ children: [
GestureDetector( GestureDetector(
onTap: () { onTap: () {
if (isAllSelect) { if (isAllSelect) {
@ -225,7 +213,6 @@ class _LifePayDetailPageNewState extends State<LifePayDetailPageNew> {
widget.model.selectIds.clear(); widget.model.selectIds.clear();
setState(() {}); setState(() {});
} else { } else {
_selectModelIndex.clear(); _selectModelIndex.clear();
for (var i = 0; i < widget.model.ids.length; i++) { for (var i = 0; i < widget.model.ids.length; i++) {
_selectModelIndex.add(i); _selectModelIndex.add(i);
@ -233,17 +220,11 @@ class _LifePayDetailPageNewState extends State<LifePayDetailPageNew> {
} }
setState(() {}); setState(() {});
} }
}, },
child: animatedContainer, child: animatedContainer,
), ),
16.wb, 16.wb,
'全选' '全选'.text.color(ktextSubColor).size(28.sp).bold.make(),
.text
.color(ktextSubColor)
.size(28.sp)
.bold
.make(),
Spacer(), Spacer(),
Column( Column(
crossAxisAlignment: CrossAxisAlignment.end, crossAxisAlignment: CrossAxisAlignment.end,
@ -270,7 +251,6 @@ class _LifePayDetailPageNewState extends State<LifePayDetailPageNew> {
fontSize: 32.sp, fontSize: 32.sp,
fontWeight: FontWeight.bold)), fontWeight: FontWeight.bold)),
])), ])),
'已选${total.payCount}' '已选${total.payCount}'
.text .text
.color(ktextSubColor) .color(ktextSubColor)

@ -33,7 +33,7 @@ class BeeImageNetwork extends StatelessWidget {
Assets.images.placeholder.path, Assets.images.placeholder.path,
width: width ?? 160.w, width: width ?? 160.w,
height: height ?? 160.w, height: height ?? 160.w,
fit: BoxFit.fill, fit: BoxFit.cover,
); );
}, },
height: height ?? 160.w, height: height ?? 160.w,

Loading…
Cancel
Save