pull/1/head
张萌 3 years ago
commit 8266b76035

Binary file not shown.

After

Width:  |  Height:  |  Size: 570 B

@ -272,8 +272,6 @@ class _Manager {
///id
String get articleReturnList => '/user/articleBorrow/findBorrowByUserId';
///list
String get dailyPaymentList => '/user/dailyPayment/list';
///
String get findEstatelsPament => '/user/dailyPayment/findEstateIsPayment';
@ -388,6 +386,9 @@ class _Manager {
///+
String get findUnpaidAmount => '/user/dailyPayment/findUnpaidAmount';
///list
String get dailyPaymentList => '/user/dailyPayment/list';
}
class _Community {

@ -13,6 +13,8 @@ import 'package:aku_new_community/pages/goods_manage_page/select_borrow_return_p
import 'package:aku_new_community/pages/house_introduce/house_introduce.dart';
import 'package:aku_new_community/pages/industry_committee/industry_committee_page.dart';
import 'package:aku_new_community/pages/life_pay/life_pay_choose_page.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/one_alarm/widget/alarm_page.dart';
import 'package:aku_new_community/pages/opening_code_page/opening_code_page.dart';
import 'package:aku_new_community/pages/renovation_manage/new_renovation/new_renovation_page.dart';
@ -75,7 +77,7 @@ List<AO> appObjects = [
AO('开门码', R.ASSETS_ICONS_FUNC_KMM_PNG, () => OpeningCodePage()),
AO('访客邀请', R.ASSETS_ICONS_FUNC_FKYQ_PNG, () => VisitorAccessPage()),
AO('报事报修', R.ASSETS_ICONS_FUNC_BSBX_PNG, () => WorkOrderPage()),
AO('生活缴费', R.ASSETS_ICONS_FUNC_SHJF_PNG, () => LifePayChoosePage()),
AO('生活缴费', R.ASSETS_ICONS_FUNC_SHJF_PNG, () => LifePayPageNew()),
AO('业委会', R.ASSETS_ICONS_FUNC_YWH_PNG, () => IndustryCommitteePage()),
AO('建议咨询', R.ASSETS_ICONS_FUNC_JYZX_PNG,
() => AdvicePage(type: AdviceType.SUGGESTION)),

@ -34,6 +34,7 @@ class SAASAPI {
static _Information information = _Information();
static _WorkOrder workOrder = _WorkOrder();
static _Pay pay = _Pay();
static _LifePay lifePay = _LifePay();
///
static _ProfileApi profile = _ProfileApi();
@ -262,3 +263,14 @@ class _Pay {
///app
String get jcookOrderCheckAlipay => '/app/user/alipay/jcookOrderCheckAlipay';
}
class _LifePay{
///
String get livingExpensesList => '/app/user/livingExpenses/list';
///
String get paymentRecordList => '/app/user/livingExpenses/paymentRecord';
}

@ -663,6 +663,10 @@ class $AssetsIconsGen {
AssetGenImage get leaseHouse =>
const AssetGenImage('assets/icons/lease_house.png');
/// File path: assets/icons/life_pay_record.png
AssetGenImage get lifePayRecord =>
const AssetGenImage('assets/icons/life_pay_record.png');
/// File path: assets/icons/like.png
AssetGenImage get like => const AssetGenImage('assets/icons/like.png');
@ -1196,10 +1200,6 @@ class $AssetsImagesGen {
AssetGenImage get wxpay => const AssetGenImage('assets/images/wxpay.png');
}
class $AssetsJsonGen {
const $AssetsJsonGen();
}
class $AssetsStaticGen {
const $AssetsStaticGen();
@ -1298,7 +1298,6 @@ class Assets {
static const $AssetsBraceletGen bracelet = $AssetsBraceletGen();
static const $AssetsIconsGen icons = $AssetsIconsGen();
static const $AssetsImagesGen images = $AssetsImagesGen();
static const $AssetsJsonGen json = $AssetsJsonGen();
static const $AssetsStaticGen static = $AssetsStaticGen();
static const $AssetsTabGen tab = $AssetsTabGen();
}

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

@ -0,0 +1,28 @@
// GENERATED CODE - DO NOT MODIFY BY HAND
part of 'life_pay_model.dart';
// **************************************************************************
// JsonSerializableGenerator
// **************************************************************************
LifePayModel _$LifePayModelFromJson(Map<String, dynamic> json) => LifePayModel(
id: json['id'] as int,
chargesName: json['chargesName'] as String,
billDateStart: json['billDateStart'] as String,
billDateEnd: json['billDateEnd'] as String,
createDate: json['createDate'] as String,
payPrincipal: (json['payPrincipal'] as num).toDouble(),
defaultAmount: (json['defaultAmount'] as num).toDouble(),
);
Map<String, dynamic> _$LifePayModelToJson(LifePayModel instance) =>
<String, dynamic>{
'id': instance.id,
'chargesName': instance.chargesName,
'billDateStart': instance.billDateStart,
'billDateEnd': instance.billDateEnd,
'createDate': instance.createDate,
'payPrincipal': instance.payPrincipal,
'defaultAmount': instance.defaultAmount,
};

@ -6,26 +6,20 @@ part 'life_pay_record_model.g.dart';
@JsonSerializable()
class LifePayRecordModel extends Equatable {
final int id;
final String chargesTemplateDetailName;
final String roomName;
final String years;
final num paidPrice;
final String createName;
final String chargesName;
final String communityName;
final String buildingName;
final String unitName;
final String estateName;
final String billDateStart;
final String billDateEnd;
final String billCreateDate;
final num payAmount;
final String createDate;
final int payType;
final String code;
LifePayRecordModel({
required this.id,
required this.chargesTemplateDetailName,
required this.roomName,
required this.years,
required this.paidPrice,
required this.createName,
required this.createDate,
required this.payType,
required this.code,
});
factory LifePayRecordModel.fromJson(Map<String, dynamic> json) =>
_$LifePayRecordModelFromJson(json);
@ -34,14 +28,34 @@ class LifePayRecordModel extends Equatable {
List<Object> get props {
return [
id,
chargesTemplateDetailName,
roomName,
years,
paidPrice,
createName,
chargesName,
communityName,
buildingName,
unitName,
estateName,
billDateStart,
billDateEnd,
billCreateDate,
payAmount,
createDate,
payType,
code,
];
}
LifePayRecordModel({
required this.id,
required this.chargesName,
required this.communityName,
required this.buildingName,
required this.unitName,
required this.estateName,
required this.billDateStart,
required this.billDateEnd,
required this.billCreateDate,
required this.payAmount,
required this.createDate,
required this.payType,
required this.code,
});
}

@ -9,11 +9,15 @@ part of 'life_pay_record_model.dart';
LifePayRecordModel _$LifePayRecordModelFromJson(Map<String, dynamic> json) =>
LifePayRecordModel(
id: json['id'] as int,
chargesTemplateDetailName: json['chargesTemplateDetailName'] as String,
roomName: json['roomName'] as String,
years: json['years'] as String,
paidPrice: json['paidPrice'] as num,
createName: json['createName'] as String,
chargesName: json['chargesName'] as String,
communityName: json['communityName'] as String,
buildingName: json['buildingName'] as String,
unitName: json['unitName'] as String,
estateName: json['estateName'] as String,
billDateStart: json['billDateStart'] as String,
billDateEnd: json['billDateEnd'] as String,
billCreateDate: json['billCreateDate'] as String,
payAmount: json['payAmount'] as num,
createDate: json['createDate'] as String,
payType: json['payType'] as int,
code: json['code'] as String,

@ -0,0 +1,625 @@
import 'dart:convert';
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/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/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/pay_finish_page.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/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/utils/network/base_list_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/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:aku_new_community/widget/others/house_head_card.dart';
import 'package:aku_new_community/widget/others/user_tool.dart';
import 'package:bot_toast/bot_toast.dart';
import 'package:common_utils/common_utils.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter_easyrefresh/easy_refresh.dart';
import 'package:get/get.dart' hide Response;
import 'package:provider/provider.dart';
class LifePayPageNew extends StatefulWidget {
LifePayPageNew({Key? key}) : super(key: key);
@override
_LifePayPageNewState createState() => _LifePayPageNewState();
}
class MonthPay {
double payTotal; //
List<LifePayModel> selectIds; //id
List<LifePayModel> ids;//id
String itemNames; //
String timeTitle;
//
MonthPay(
{required this.payTotal,
required this.ids,
required this.itemNames,
required this.selectIds,
required this.timeTitle});
}
class _LifePayPageNewState extends State<LifePayPageNew> {
EasyRefreshController? _controller;
List<MonthPay> _selectMonths = []; //
List<LifePayModel> _models = []; //model,
int _page = 0;
int _size = 10;
double _prePrice = 0;
List<int> _selectModelIndex = []; //model
bool get allSelect =>
((_selectMonths.length == _selectModelIndex.length) && (_selectMonths.length != 0));
MonthPay get total {
double price = 0;
List<LifePayModel> ids = [];
for (var i in _selectModelIndex) {
MonthPay model = _selectMonths[i];
price += model.payTotal;
ids.addAll(model.selectIds);
}
return MonthPay( payTotal: price, ids: [], selectIds: ids, itemNames: '', timeTitle: '');
}
@override
void initState() {
super.initState();
_controller = EasyRefreshController();
_models = [
LifePayModel(
id: 1,
createDate: '2022-02-11 00:00:01',
payPrincipal: 100,
billDateStart: '2022-02-11 00:00:01',
chargesName: '物业费',
defaultAmount: 50,
billDateEnd: '2022-03-11 00:00:01'),
LifePayModel(
id: 2,
createDate: '2022-02-12 00:00:01',
payPrincipal: 100,
billDateStart: '2022-02-11 00:00:01',
chargesName: '物业费',
defaultAmount: 50,
billDateEnd: '2022-03-12 00:00:01'),
LifePayModel(
id: 3,
createDate: '2022-03-11 00:00:01',
payPrincipal: 100,
billDateStart: '2022-03-11 00:00:01',
chargesName: '物业费',
defaultAmount: 50,
billDateEnd: '2022-04-11 00:00:01'),
LifePayModel(
id: 4,
createDate: '2022-04-11 00:00:01',
payPrincipal: 100,
billDateStart: '2022-04-11 00:00:01',
chargesName: '物业费',
defaultAmount: 50,
billDateEnd: '2022-05-11 00:00:01'),
LifePayModel(
id: 5,
createDate: '2022-02-15 00:00:01',
payPrincipal: 100,
billDateStart: '2022-02-15 00:00:01',
chargesName: '物业费',
defaultAmount: 50,
billDateEnd: '2022-03-15 00:00:01'),
LifePayModel(
id: 6,
createDate: '2022-02-16 00:00:01',
payPrincipal: 100,
billDateStart: '2022-02-16 00:00:01',
chargesName: '物业费',
defaultAmount: 50,
billDateEnd: '2022-03-16 00:00:01'),
LifePayModel(
id: 7,
createDate: '2022-03-18 00:00:01',
payPrincipal: 100,
billDateStart: '2022-03-11 00:00:01',
chargesName: '物业费',
defaultAmount: 50,
billDateEnd: '2022-04-19 00:00:01'),
];
}
@override
void dispose() {
_controller?.dispose();
BotToast.closeAllLoading();
super.dispose();
}
Widget _buildCard(MonthPay model, int index) {
return Container(
padding: EdgeInsets.symmetric(vertical: 32.w,horizontal: 32.w),
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(8.w), color: kForeGroundColor),
child: Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [
GestureDetector(
onTap: () {
setState(() {
if (_selectModelIndex.contains(index)) {
_selectModelIndex.remove(index);
} else {
_selectModelIndex.add(index);
}
});
},
child: Container(
padding: EdgeInsets.only(left: 10.w,right: 10.w,bottom: 50.w),
color: Colors.transparent,
child: BeeCheckRadio(
value: index,
groupValue: _selectModelIndex,
),
),
),
],
),
24.w.widthBox,
Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisSize: MainAxisSize.min,
children: [
model.timeTitle.text.color(Colors.black.withOpacity(0.8)).bold.size(32.sp).make(),
13.w.heightBox,
'已选择:'
.richText
.withTextSpanChildren([
'${model.selectIds.length}'
.textSpan
.color(Colors.black.withOpacity(0.85))
.size(32.sp)
.bold
.make(),
' / ${model.ids.length}'
.textSpan
.color(Colors.black.withOpacity(0.25))
.size(32.sp)
.bold
.make(),
])
.color(Colors.black.withOpacity(0.65))
.size(26.sp)
.make(),
13.w.heightBox,
SizedBox(
width: 400.w,
child: Text(
model.itemNames,
maxLines: 2,
overflow: TextOverflow.ellipsis,
style: TextStyle(
color: ktextSubColor,
fontSize: 28.sp,
),
),
),
13.w.heightBox,
RichText(
text: TextSpan(
text: '合计:',
style: TextStyle(
color: ktextPrimary,
fontSize: 24.sp,
fontWeight: FontWeight.bold),
children: [
TextSpan(
text: '¥ ',
style: TextStyle(
color: kDangerColor,
fontSize: 24.sp,
fontWeight: FontWeight.bold)),
TextSpan(
text: '${model.payTotal.toStringAsFixed(2)}',
style: TextStyle(
color: kDangerColor,
fontSize: 32.sp,
fontWeight: FontWeight.bold)),
]))
],
).expand(),
Column(
mainAxisSize: MainAxisSize.max,
mainAxisAlignment: MainAxisAlignment.start,
children: [
GestureDetector(
onTap: () async {
dynamic back = await Get.to(()=>LifePayDetailPageNew(model: model,));
if(back){
for(int i=0;i<_selectMonths.length;i++){
if(_selectMonths[i].selectIds.isEmpty){
_selectModelIndex.remove(_selectMonths.indexOf(_selectMonths[i]));
}
}
setState(() {
});
}
},
child: Container(
decoration: BoxDecoration(
color: kPrimaryColor,
borderRadius: BorderRadius.circular(22.w),
),
padding:
EdgeInsets.symmetric(horizontal: 20.w, vertical: 8.w),
child: '选择明细'.text.color(Colors.black.withOpacity(0.85)).size(22.sp).bold.make(),
),
),
],
),
],
),
);
}
Widget _payButton() {
return MaterialButton(
elevation: 0,
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(37.w)),
color: kPrimaryColor,
padding: EdgeInsets.symmetric(horizontal: 50.w, vertical: 15.w),
onPressed: () async {
// Function cancel = BotToast.showLoading();
// BaseModel baseModel =
// await NetUtil().post('/user/alipay/dailyPaymentAlipay', params: {
// "ids": total.ids,
// "payType": 1, //
// "payPrice": total.payTotal.toDoubleStringAsFixed()
// });
// if (baseModel.success) {
// bool result = await PayUtil()
// .callAliPay(baseModel.msg, API.pay.dailPayMentCheck);
// if (result) {
// Get.off(() => PayFinishPage());
// }
// }
// cancel();
},
child: '去缴费'.text.black.size(32.sp).bold.make(),
);
}
Widget _buildPrePayment() {
return Container(
padding: EdgeInsets.symmetric(vertical: 32.w, horizontal: 32.w),
width: double.infinity,
color: Colors.white,
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
'当前预缴'.text.size(28.sp).color(ktextSubColor).make(),
30.w.heightBox,
Row(
children: [
'¥'.text.size(28.sp).black.make(),
16.w.widthBox,
_prePrice.text.size(40.sp).black.bold.make(),
Spacer(),
MaterialButton(
elevation: 0,
height: 50.w,
padding: EdgeInsets.symmetric(vertical: 8.w, horizontal: 25.w),
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(24.w),
side: BorderSide(color: Color(0xFF979797), width: 1.w)),
color: Colors.white,
onPressed: () {
Get.to(() => LifePrePayPage(
prePay: _prePrice,
));
},
child: '预缴充值'.text.size(28.sp).black.make(),
)
],
),
],
),
);
}
Future<double> _dailyPaymentPrePay() async {
BaseModel baseModel =
await NetUtil().get(API.manager.dailyPaymentPrePay, params: {
"estateId": 5,//UserTool.appProvider.selectedHouse!.estateId,
});
if (baseModel.success) {
return (baseModel.data as num).toDouble();
} else {
return 0;
}
}
@override
Widget build(BuildContext context) {
final appProvider = Provider.of<AppProvider>(context);
return BeeScaffold(
title: '生活缴费',
actions: [
InkWell(
onTap: () {
Get.to(() => LifePayRecordPage());
},
child: Container(
padding: EdgeInsets.fromLTRB(32.w, 28.w, 32.w, 20.w),
alignment: Alignment.center,
child: Image.asset(Assets.icons.lifePayRecord.path,width:48.w ,height: 48.w,)
),
),
],
body: EasyRefresh(
firstRefresh: true,
header: MaterialHeader(),
controller: _controller,
onRefresh: () async {
_page = 1;
_size = 10;
// BaseListModel baseListModel = await NetUtil()
// .getList(SAASAPI.lifePay.livingExpensesList, params: {
// "pageNum": _page,
// "size": _size,
// 'estateId': 5//appProvider.selectedHouse!.estateId
// });
// _models = baseListModel.rows
// .map((e) => LifePayModel.fromJson(e))
// .toList();
_selectMonths.clear();
_models = [
LifePayModel(
id: 1,
createDate: '2022-02-11 00:00:01',
payPrincipal: 100,
billDateStart: '2022-02-11 00:00:01',
chargesName: '物业费',
defaultAmount: 50,
billDateEnd: '2022-03-11 00:00:01'),
LifePayModel(
id: 2,
createDate: '2022-02-12 00:00:01',
payPrincipal: 100,
billDateStart: '2022-02-11 00:00:01',
chargesName: '物业费',
defaultAmount: 50,
billDateEnd: '2022-03-12 00:00:01'),
LifePayModel(
id: 3,
createDate: '2022-03-11 00:00:01',
payPrincipal: 100,
billDateStart: '2022-03-11 00:00:01',
chargesName: '物业费',
defaultAmount: 50,
billDateEnd: '2022-04-11 00:00:01'),
LifePayModel(
id: 4,
createDate: '2022-04-11 00:00:01',
payPrincipal: 100,
billDateStart: '2022-04-11 00:00:01',
chargesName: '物业费',
defaultAmount: 50,
billDateEnd: '2022-05-11 00:00:01'),
LifePayModel(
id: 5,
createDate: '2022-02-15 00:00:01',
payPrincipal: 100,
billDateStart: '2022-02-15 00:00:01',
chargesName: '物业费',
defaultAmount: 50,
billDateEnd: '2022-03-15 00:00:01'),
LifePayModel(
id: 6,
createDate: '2022-02-16 00:00:01',
payPrincipal: 100,
billDateStart: '2022-02-16 00:00:01',
chargesName: '物业费',
defaultAmount: 50,
billDateEnd: '2022-03-16 00:00:01'),
LifePayModel(
id: 7,
createDate: '2022-03-18 00:00:01',
payPrincipal: 100,
billDateStart: '2022-03-11 00:00:01',
chargesName: '物业费',
defaultAmount: 50,
billDateEnd: '2022-04-19 00:00:01'),
];
///
_models.forEach((element) {
if (_selectMonths.isEmpty) {
_selectMonths.add(MonthPay(
payTotal: element.payPrincipal + element.defaultAmount,
ids: [element],
itemNames: element.chargesName,
timeTitle: DateUtil.formatDate(
DateTime.parse(element.billDateStart),
format: 'yyyy-MM'), selectIds: [element],));
} else {
bool same = false;
for(int i=0;i<_selectMonths.length;i++){
if (DateUtil.formatDate(DateTime.parse(element.billDateStart),
format: 'yyyy-MM') ==
_selectMonths[i].timeTitle) {
_selectMonths[i].payTotal +=
element.defaultAmount + element.payPrincipal;
_selectMonths[i].ids.add(element);
_selectMonths[i].itemNames += ''+element.chargesName;
_selectMonths[i].selectIds.add(element);
same = true;
}
}
if(!same){
_selectMonths.add(MonthPay(
payTotal: element.payPrincipal + element.defaultAmount,
ids: [element],
selectIds: [element],
itemNames: element.chargesName,
timeTitle: DateUtil.formatDate(
DateTime.parse(element.billDateStart),
format: 'yyyy-MM')));
}
}
});
_prePrice = 0;
if (mounted) setState(() {});
},
child: Column(
children: [
HouseHeadCard(
onChanged: () {
_controller!.callRefresh();
},
context: context),
16.w.heightBox,
_buildPrePayment(),
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: [
Padding(padding: EdgeInsets.symmetric(vertical: 24.w,horizontal: 32.w),
child: '当前账单'.text.color(ktextPrimary).size(28.sp).make(),),
BeeDivider.horizontal(),
...List.generate(_selectMonths.length,
(index) => _buildCard(_selectMonths[index], index))
.sepWidget(separate: BeeDivider.horizontal()),
],
),
),
],
),
),
bottomNavi: Container(
color: kForeGroundColor,
padding: EdgeInsets.fromLTRB(
32.w, 16.w, 32.w, 12.w + MediaQuery.of(context).padding.bottom),
child: Row(
children: [
GestureDetector(
onTap: () {
if (allSelect) {
_selectModelIndex.clear();
setState(() {});
} else {
_selectModelIndex.clear();
for (var i = 0; i < _selectMonths.length; i++) {
_selectModelIndex.add(i);
}
setState(() {});
}
},
child: AnimatedContainer(
duration: Duration(milliseconds: 300),
decoration: BoxDecoration(
border: Border.all(
width: 1.w,
color: allSelect ? kPrimaryColor : kDarkSubColor),
color: allSelect ? kPrimaryColor : Colors.transparent,
borderRadius: BorderRadius.circular(20.w)),
curve: Curves.easeInOutCubic,
width: 40.w,
height: 40.w,
child: allSelect
? Icon(
CupertinoIcons.check_mark,
size: 25.w,
color: Colors.white,
)
: SizedBox(),
).material(color: Colors.transparent),
),
16.wb,
'全选'
.text
.color(ktextSubColor)
.size(28.sp)
.bold
.make(),
Spacer(),
Column(
crossAxisAlignment: CrossAxisAlignment.end,
mainAxisSize: MainAxisSize.min,
children: [
RichText(
text: TextSpan(
text: '合计:',
style: TextStyle(
color: ktextPrimary,
fontSize: 24.sp,
fontWeight: FontWeight.bold),
children: [
TextSpan(
text: ' ¥',
style: TextStyle(
color: kDangerColor,
fontSize: 24.sp,
fontWeight: FontWeight.bold)),
TextSpan(
text: '${total.payTotal.toStringAsFixed(2)}',
style: TextStyle(
color: kDangerColor,
fontSize: 32.sp,
fontWeight: FontWeight.bold)),
])),
'已选${_selectModelIndex.length}'
.text
.color(ktextSubColor)
.size(24.sp)
.make(),
],
),
24.w.widthBox,
_payButton(),
],
),
),
);
}
}

@ -84,15 +84,29 @@ class _LifePayRecordPageState extends State<LifePayRecordPage> {
Widget _buildRecordCard(LifePayRecordModel model) {
return Column(
children: [
Container(
padding: EdgeInsets.symmetric(vertical: 8.w,horizontal: 24.w),
decoration: BoxDecoration(
color: Colors.black.withOpacity(0.06),
borderRadius: BorderRadius.circular(8.w),
),
child: DateUtil.formatDate(
DateTime.parse(model.createDate),
format: 'MM-dd hh-mm').text
.size(24.sp)
.color(Colors.black.withOpacity(0.45))
.make(),
),
Row(
children: [
model.chargesTemplateDetailName.text
model.chargesName.text
.size(30.sp)
.color(ktextPrimary)
.bold
.make(),
Spacer(),
'${S.of(context)!.tempPlotName} ${model.roomName}'
'${S.of(context)!.tempPlotName} ${model.unitName+model.estateName}'
.text
.size(24.sp)
.color(Color(0xFF999999))
@ -100,30 +114,18 @@ class _LifePayRecordPageState extends State<LifePayRecordPage> {
],
),
16.w.heightBox,
Row(
children: [
'缴纳人'.text.color(ktextSubColor).size(24.sp).make(),
Spacer(),
'${model.createName}'
.text
.color(Color(0xFFFC361D))
.size(28.sp)
.bold
.make()
],
),
Row(
children: [
'缴纳金额'.text.color(ktextSubColor).size(28.sp).make(),
Spacer(),
'${model.paidPrice}'.text.color(ktextPrimary).size(28.sp).make(),
'${model.payAmount}'.text.color(ktextPrimary).size(28.sp).make(),
],
),
Row(
children: [
'缴费时间'.text.color(ktextSubColor).size(28.sp).make(),
'付款方式'.text.color(ktextSubColor).size(28.sp).make(),
Spacer(),
'${DateUtil.formatDateStr(model.createDate, format: "yyyy/MM/dd HH:mm")}'
'${getPayType[model.payType]}'
.text
.color(ktextPrimary)
.size(28.sp)
@ -132,22 +134,20 @@ class _LifePayRecordPageState extends State<LifePayRecordPage> {
),
Row(
children: [
'付款方式'.text.color(ktextSubColor).size(28.sp).make(),
'流水号'.text.color(ktextSubColor).size(28.sp).make(),
Spacer(),
'${getPayType[model.payType]}'
.text
.color(ktextPrimary)
.size(28.sp)
.make(),
'${model.code}'.text.color(ktextPrimary).size(28.sp).make(),
],
),
Row(
children: [
'订单'.text.color(ktextSubColor).size(28.sp).make(),
'流水'.text.color(ktextSubColor).size(28.sp).make(),
Spacer(),
'${model.code}'.text.color(ktextPrimary).size(28.sp).make(),
],
),
].sepWidget(separate: 24.w.heightBox),
)
.box

@ -1,10 +1,3 @@
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:expandable/expandable.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';
@ -13,6 +6,11 @@ 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';
import 'package:expandable/expandable.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:get/get.dart';
import 'package:provider/provider.dart';
class LifePayDetailPage extends StatefulWidget {
final LifePayListModel model;

@ -0,0 +1,298 @@
import 'package:aku_new_community/models/life_pay/life_pay_model.dart';
import 'package:aku_new_community/pages/life_pay/life_pay_page_new.dart';
import 'package:aku_new_community/widget/bee_divider.dart';
import 'package:common_utils/common_utils.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:expandable/expandable.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 {
final MonthPay model;
LifePayDetailPageNew({
Key? key,
required this.model,
}) : super(key: key);
@override
_LifePayDetailPageNewState createState() => _LifePayDetailPageNewState();
}
class _LifePayDetailPageNewState extends State<LifePayDetailPageNew> {
//model
List<int> _selectModelIndex = []; //model
List<LifePayModel> _list = [];
SelectPay get total {
int count = 0;
double price = 0;
List<int> ids = [];
widget.model.selectIds.forEach((element) {
count++;
price += (element.defaultAmount + element.payPrincipal);
ids.add(element.id);
});
widget.model.payTotal = price;
return SelectPay(payCount: count, payTotal: price, ids: ids);
}
bool get isAllSelect {
return _selectModelIndex.length == widget.model.ids.length && _selectModelIndex != 0;
}
@override
void initState() {
super.initState();
for(int i=0;i<widget.model.selectIds.length;i++){
_selectModelIndex.add(widget.model.ids.indexOf(widget.model.selectIds[i]));
}
for(int i=0;i<widget.model.ids.length;i++){
_list.add(widget.model.ids[i]);
}
}
Widget _buildCard(LifePayModel model, int index) {
return Container(
padding: EdgeInsets.symmetric(vertical:32.w,horizontal: 32.w),
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(8.w), color: kForeGroundColor),
child: Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [
GestureDetector(
onTap: () {
setState(() {
if (_selectModelIndex.contains(index)) {
_selectModelIndex.remove(index);
widget.model.selectIds.remove(model);
} else {
_selectModelIndex.add(index);
widget.model.selectIds.add(model);
}
print(widget.model.ids);
print(widget.model.selectIds);
});
},
child: Container(
padding: EdgeInsets.only(left: 10.w,right: 10.w,top: 5.w,bottom: 50.w),
color: Colors.transparent,
child: BeeCheckRadio(
value: index,
groupValue: _selectModelIndex,
),
),
),
],
),
24.w.widthBox,
Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisSize: MainAxisSize.min,
children: [
model.chargesName.text.color(ktextSubColor).size(28.sp).make(),
24.w.heightBox,
DateUtil.formatDate(DateTime.parse(model.billDateStart),
format: 'yyyy/MM/dd')
.richText
.withTextSpanChildren([
' - '
.textSpan
.color(Colors.black.withOpacity(0.45))
.size(24.sp)
.make(),
DateUtil.formatDate(DateTime.parse(model.billDateEnd),
format: 'yyyy/MM/dd')
.textSpan
.color(Colors.black.withOpacity(0.45))
.size(24.sp)
.make(),
])
.color(Colors.black.withOpacity(0.45))
.size(24.sp)
.make(),
],
).expand(),
RichText(
text: TextSpan(
text: '¥ ',
style: TextStyle(
color: kDangerColor,
fontSize: 24.sp,
fontWeight: FontWeight.bold),
children: [
TextSpan(
text: '${model.payPrincipal+model.defaultAmount}',
style: TextStyle(
color: kDangerColor,
fontSize: 30.sp,
fontWeight: FontWeight.bold)),
])),
],
),
);
}
@override
Widget build(BuildContext context) {
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(
leading: IconButton(
onPressed: () {
///
widget.model.selectIds = _list;
Get.back(result: false);
},
icon: Icon(
CupertinoIcons.chevron_back,
color: Colors.black,
),
),
title: widget.model.timeTitle,
body: WillPopScope(
onWillPop: () async{
///
widget.model.selectIds = _list;
Get.back(result: false);
return false;
},
child: ListView(
padding: EdgeInsets.only(top: 16.w),
children: List.generate(widget.model.ids.length,
(index) => _buildCard(widget.model.ids[index], index)).sepWidget(separate: BeeDivider.horizontal(indent: 100.w,)),),
),
bottomNavi: Container(
color: Colors.white,
padding: EdgeInsets.fromLTRB(
32.w, 16.w, 32.w, 12.w + MediaQuery.of(context).padding.bottom),
child: Row(
children: [
GestureDetector(
onTap: () {
if (isAllSelect) {
_selectModelIndex.clear();
widget.model.selectIds.clear();
setState(() {});
} else {
_selectModelIndex.clear();
for (var i = 0; i < widget.model.ids.length; i++) {
_selectModelIndex.add(i);
widget.model.selectIds.add(widget.model.ids[i]);
}
setState(() {});
}
},
child: animatedContainer,
),
16.wb,
'全选'
.text
.color(ktextSubColor)
.size(28.sp)
.bold
.make(),
Spacer(),
Column(
crossAxisAlignment: CrossAxisAlignment.end,
mainAxisSize: MainAxisSize.min,
children: [
RichText(
text: TextSpan(
text: '合计:',
style: TextStyle(
color: ktextPrimary,
fontSize: 24.sp,
fontWeight: FontWeight.bold),
children: [
TextSpan(
text: ' ¥',
style: TextStyle(
color: kDangerColor,
fontSize: 24.sp,
fontWeight: FontWeight.bold)),
TextSpan(
text: '${total.payTotal.toStringAsFixed(2)}',
style: TextStyle(
color: kDangerColor,
fontSize: 32.sp,
fontWeight: FontWeight.bold)),
])),
'已选${total.payCount}'
.text
.color(ktextSubColor)
.size(20.sp)
.make(),
],
),
20.w.widthBox,
MaterialButton(
elevation: 0,
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(37.w)),
color: kPrimaryColor,
padding: EdgeInsets.symmetric(horizontal: 50.w, vertical: 15.w),
onPressed: () {
Get.back(result: true);
},
child: '确定'.text.black.size(32.sp).bold.make(),
),
],
),
),
);
}
}

@ -60,7 +60,8 @@ class HouseHeadCard extends StatelessWidget {
.bold
.make(),
10.w.heightBox,
appProvider.selectedHouse!.roomName.text.black
(appProvider.selectedHouse!=null?appProvider.selectedHouse!.roomName:'').text.black
.size(32.sp)
.bold
.make()

File diff suppressed because it is too large Load Diff
Loading…
Cancel
Save