parent
7987d41f41
commit
633946636f
@ -1,48 +0,0 @@
|
||||
import 'package:flustars/flustars.dart';
|
||||
|
||||
class UserInfoModel {
|
||||
int? id;
|
||||
String? imgUrl;
|
||||
String? name;
|
||||
String? nickName;
|
||||
String? tel;
|
||||
|
||||
/// 性别 1.男 2.女
|
||||
int? sex;
|
||||
String? birthday;
|
||||
|
||||
String get sexValue {
|
||||
if (sex == null) return '未设置';
|
||||
if (sex == 1) return '男';
|
||||
if (sex == 2) return '女';
|
||||
return '未设置';
|
||||
}
|
||||
|
||||
DateTime? get birthdayDate => DateUtil.getDateTime(birthday!);
|
||||
String get birthdayValue {
|
||||
if (TextUtil.isEmpty(birthday))
|
||||
return '未设置';
|
||||
else
|
||||
return DateUtil.formatDate(birthdayDate, format: 'yyyy-MM-dd');
|
||||
}
|
||||
|
||||
UserInfoModel(
|
||||
{this.id,
|
||||
this.imgUrl,
|
||||
this.name,
|
||||
this.nickName,
|
||||
this.tel,
|
||||
this.sex,
|
||||
this.birthday});
|
||||
|
||||
UserInfoModel.fromJson(Map<String, dynamic> json) {
|
||||
id = json['id'];
|
||||
if (json['imgUrls'] != null && (json['imgUrls'] as List).length != 0)
|
||||
imgUrl = (json['imgUrls'] as List).first['url'];
|
||||
name = json['name'];
|
||||
nickName = json['nickName'];
|
||||
tel = json['tel'];
|
||||
sex = json['sex'];
|
||||
birthday = json['birthday'];
|
||||
}
|
||||
}
|
@ -0,0 +1,124 @@
|
||||
import 'package:equatable/equatable.dart';
|
||||
import 'package:json_annotation/json_annotation.dart';
|
||||
|
||||
part 'share_pay_list_model.g.dart';
|
||||
|
||||
@JsonSerializable(createToJson: true)
|
||||
class SharePayListModel extends Equatable {
|
||||
final int id;
|
||||
final String months;
|
||||
final int type;
|
||||
final int num;
|
||||
final double total;
|
||||
final List<AppMeterShareDetailsVos> appMeterShareDetailsVos;
|
||||
|
||||
factory SharePayListModel.fromJson(Map<String, dynamic> json) =>
|
||||
_$SharePayListModelFromJson(json);
|
||||
|
||||
Map<String, dynamic> toJson() => _$SharePayListModelToJson(this);
|
||||
|
||||
@override
|
||||
List<Object?> get props =>
|
||||
[id, months, type, num, total, appMeterShareDetailsVos];
|
||||
|
||||
const SharePayListModel({
|
||||
required this.id,
|
||||
required this.months,
|
||||
required this.type,
|
||||
required this.num,
|
||||
required this.total,
|
||||
required this.appMeterShareDetailsVos,
|
||||
});
|
||||
|
||||
SharePayListModel copyWith({
|
||||
int? id,
|
||||
String? months,
|
||||
int? type,
|
||||
int? num,
|
||||
double? total,
|
||||
List<AppMeterShareDetailsVos>? appMeterShareDetailsVos,
|
||||
}) {
|
||||
return SharePayListModel(
|
||||
id: id ?? this.id,
|
||||
months: months ?? this.months,
|
||||
type: type ?? this.type,
|
||||
num: num ?? this.num,
|
||||
total: total ?? this.total,
|
||||
appMeterShareDetailsVos:
|
||||
appMeterShareDetailsVos ?? this.appMeterShareDetailsVos,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@JsonSerializable(createToJson: true)
|
||||
class AppMeterShareDetailsVos extends Equatable {
|
||||
final int id;
|
||||
final double houseArea;
|
||||
final double amountPayable;
|
||||
final double paidAmount;
|
||||
final double remainingUnpaidAmount;
|
||||
final int status;
|
||||
final double rate;
|
||||
final String paymentPeriod;
|
||||
final String? paymentTime;
|
||||
final double lateFree;
|
||||
|
||||
factory AppMeterShareDetailsVos.fromJson(Map<String, dynamic> json) =>
|
||||
_$AppMeterShareDetailsVosFromJson(json);
|
||||
|
||||
Map<String, dynamic> toJson() => _$AppMeterShareDetailsVosToJson(this);
|
||||
|
||||
@override
|
||||
List<Object?> get props => [
|
||||
id,
|
||||
houseArea,
|
||||
amountPayable,
|
||||
paidAmount,
|
||||
remainingUnpaidAmount,
|
||||
status,
|
||||
rate,
|
||||
paymentPeriod,
|
||||
paymentTime,
|
||||
lateFree
|
||||
];
|
||||
|
||||
const AppMeterShareDetailsVos({
|
||||
required this.id,
|
||||
required this.houseArea,
|
||||
required this.amountPayable,
|
||||
required this.paidAmount,
|
||||
required this.remainingUnpaidAmount,
|
||||
required this.status,
|
||||
required this.rate,
|
||||
required this.paymentPeriod,
|
||||
this.paymentTime,
|
||||
required this.lateFree,
|
||||
});
|
||||
|
||||
AppMeterShareDetailsVos copyWith({
|
||||
int? id,
|
||||
double? houseArea,
|
||||
double? amountPayable,
|
||||
double? paidAmount,
|
||||
double? remainingUnpaidAmount,
|
||||
int? status,
|
||||
double? rate,
|
||||
String? paymentPeriod,
|
||||
String? paymentTime,
|
||||
double? lateFree,
|
||||
}) {
|
||||
return AppMeterShareDetailsVos(
|
||||
id: id ?? this.id,
|
||||
houseArea: houseArea ?? this.houseArea,
|
||||
amountPayable: amountPayable ?? this.amountPayable,
|
||||
paidAmount: paidAmount ?? this.paidAmount,
|
||||
remainingUnpaidAmount:
|
||||
remainingUnpaidAmount ?? this.remainingUnpaidAmount,
|
||||
status: status ?? this.status,
|
||||
rate: rate ?? this.rate,
|
||||
paymentPeriod: paymentPeriod ?? this.paymentPeriod,
|
||||
paymentTime: paymentTime ?? this.paymentTime,
|
||||
lateFree: lateFree ?? this.lateFree,
|
||||
);
|
||||
}
|
||||
}
|
@ -0,0 +1,61 @@
|
||||
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||
|
||||
part of 'share_pay_list_model.dart';
|
||||
|
||||
// **************************************************************************
|
||||
// JsonSerializableGenerator
|
||||
// **************************************************************************
|
||||
|
||||
SharePayListModel _$SharePayListModelFromJson(Map<String, dynamic> json) {
|
||||
return SharePayListModel(
|
||||
id: json['id'] as int,
|
||||
months: json['months'] as String,
|
||||
type: json['type'] as int,
|
||||
num: json['num'] as int,
|
||||
total: (json['total'] as num).toDouble(),
|
||||
appMeterShareDetailsVos: (json['appMeterShareDetailsVos'] as List<dynamic>)
|
||||
.map((e) => AppMeterShareDetailsVos.fromJson(e as Map<String, dynamic>))
|
||||
.toList(),
|
||||
);
|
||||
}
|
||||
|
||||
Map<String, dynamic> _$SharePayListModelToJson(SharePayListModel instance) =>
|
||||
<String, dynamic>{
|
||||
'id': instance.id,
|
||||
'months': instance.months,
|
||||
'type': instance.type,
|
||||
'num': instance.num,
|
||||
'total': instance.total,
|
||||
'appMeterShareDetailsVos': instance.appMeterShareDetailsVos,
|
||||
};
|
||||
|
||||
AppMeterShareDetailsVos _$AppMeterShareDetailsVosFromJson(
|
||||
Map<String, dynamic> json) {
|
||||
return AppMeterShareDetailsVos(
|
||||
id: json['id'] as int,
|
||||
houseArea: (json['houseArea'] as num).toDouble(),
|
||||
amountPayable: (json['amountPayable'] as num).toDouble(),
|
||||
paidAmount: (json['paidAmount'] as num).toDouble(),
|
||||
remainingUnpaidAmount: (json['remainingUnpaidAmount'] as num).toDouble(),
|
||||
status: json['status'] as int,
|
||||
rate: (json['rate'] as num).toDouble(),
|
||||
paymentPeriod: json['paymentPeriod'] as String,
|
||||
paymentTime: json['paymentTime'] as String?,
|
||||
lateFree: (json['lateFree'] as num).toDouble(),
|
||||
);
|
||||
}
|
||||
|
||||
Map<String, dynamic> _$AppMeterShareDetailsVosToJson(
|
||||
AppMeterShareDetailsVos instance) =>
|
||||
<String, dynamic>{
|
||||
'id': instance.id,
|
||||
'houseArea': instance.houseArea,
|
||||
'amountPayable': instance.amountPayable,
|
||||
'paidAmount': instance.paidAmount,
|
||||
'remainingUnpaidAmount': instance.remainingUnpaidAmount,
|
||||
'status': instance.status,
|
||||
'rate': instance.rate,
|
||||
'paymentPeriod': instance.paymentPeriod,
|
||||
'paymentTime': instance.paymentTime,
|
||||
'lateFree': instance.lateFree,
|
||||
};
|
@ -0,0 +1,30 @@
|
||||
import 'package:json_annotation/json_annotation.dart';
|
||||
|
||||
part 'share_pay_record_model.g.dart';
|
||||
|
||||
@JsonSerializable()
|
||||
class SharePayRecordModel {
|
||||
final double payPrice;
|
||||
final String paymentTime;
|
||||
final int payType;
|
||||
final String code;
|
||||
final String months;
|
||||
final String effectiveTimeStart;
|
||||
final String effectiveTimeEnd;
|
||||
final double shareUnitPrice;
|
||||
final double indoorArea;
|
||||
factory SharePayRecordModel.fromJson(Map<String, dynamic> json) =>
|
||||
_$SharePayRecordModelFromJson(json);
|
||||
|
||||
const SharePayRecordModel({
|
||||
required this.payPrice,
|
||||
required this.paymentTime,
|
||||
required this.payType,
|
||||
required this.code,
|
||||
required this.months,
|
||||
required this.effectiveTimeStart,
|
||||
required this.effectiveTimeEnd,
|
||||
required this.shareUnitPrice,
|
||||
required this.indoorArea,
|
||||
});
|
||||
}
|
@ -0,0 +1,21 @@
|
||||
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||
|
||||
part of 'share_pay_record_model.dart';
|
||||
|
||||
// **************************************************************************
|
||||
// JsonSerializableGenerator
|
||||
// **************************************************************************
|
||||
|
||||
SharePayRecordModel _$SharePayRecordModelFromJson(Map<String, dynamic> json) {
|
||||
return SharePayRecordModel(
|
||||
payPrice: (json['payPrice'] as num).toDouble(),
|
||||
paymentTime: json['paymentTime'] as String,
|
||||
payType: json['payType'] as int,
|
||||
code: json['code'] as String,
|
||||
months: json['months'] as String,
|
||||
effectiveTimeStart: json['effectiveTimeStart'] as String,
|
||||
effectiveTimeEnd: json['effectiveTimeEnd'] as String,
|
||||
shareUnitPrice: (json['shareUnitPrice'] as num).toDouble(),
|
||||
indoorArea: (json['indoorArea'] as num).toDouble(),
|
||||
);
|
||||
}
|
@ -0,0 +1,47 @@
|
||||
import 'package:aku_community/model/common/img_model.dart';
|
||||
import 'package:flustars/flustars.dart';
|
||||
import 'package:json_annotation/json_annotation.dart';
|
||||
|
||||
part 'user_info_model.g.dart';
|
||||
|
||||
@JsonSerializable()
|
||||
class UserInfoModel {
|
||||
int id;
|
||||
List<ImgModel> imgUrls;
|
||||
String name;
|
||||
String nickName;
|
||||
String tel;
|
||||
|
||||
/// 性别 1.男 2.女
|
||||
int? sex;
|
||||
String birthday;
|
||||
|
||||
String get sexValue {
|
||||
if (sex == null) return '未设置';
|
||||
if (sex == 1) return '男';
|
||||
if (sex == 2) return '女';
|
||||
return '未设置';
|
||||
}
|
||||
|
||||
DateTime? get birthdayDate => DateUtil.getDateTime(birthday);
|
||||
|
||||
String get birthdayValue {
|
||||
if (TextUtil.isEmpty(birthday))
|
||||
return '未设置';
|
||||
else
|
||||
return DateUtil.formatDate(birthdayDate, format: 'yyyy-MM-dd');
|
||||
}
|
||||
|
||||
factory UserInfoModel.fromJson(Map<String, dynamic> json) =>
|
||||
_$UserInfoModelFromJson(json);
|
||||
|
||||
UserInfoModel({
|
||||
required this.id,
|
||||
required this.imgUrls,
|
||||
required this.name,
|
||||
required this.nickName,
|
||||
required this.tel,
|
||||
this.sex,
|
||||
required this.birthday,
|
||||
});
|
||||
}
|
@ -0,0 +1,21 @@
|
||||
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||
|
||||
part of 'user_info_model.dart';
|
||||
|
||||
// **************************************************************************
|
||||
// JsonSerializableGenerator
|
||||
// **************************************************************************
|
||||
|
||||
UserInfoModel _$UserInfoModelFromJson(Map<String, dynamic> json) {
|
||||
return UserInfoModel(
|
||||
id: json['id'] as int,
|
||||
imgUrls: (json['imgUrls'] as List<dynamic>)
|
||||
.map((e) => ImgModel.fromJson(e as Map<String, dynamic>))
|
||||
.toList(),
|
||||
name: json['name'] as String,
|
||||
nickName: json['nickName'] as String,
|
||||
tel: json['tel'] as String,
|
||||
sex: json['sex'] as int?,
|
||||
birthday: json['birthday'] as String,
|
||||
);
|
||||
}
|
@ -0,0 +1,62 @@
|
||||
import 'package:aku_community/const/resource.dart';
|
||||
import 'package:aku_community/extensions/widget_list_ext.dart';
|
||||
import 'package:aku_community/pages/life_pay/life_pay_page.dart';
|
||||
import 'package:aku_community/pages/share_pay_page/share_pay_page.dart';
|
||||
import 'package:aku_community/widget/bee_scaffold.dart';
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:velocity_x/velocity_x.dart';
|
||||
|
||||
class LifePayChoosePage extends StatefulWidget {
|
||||
const LifePayChoosePage({Key? key}) : super(key: key);
|
||||
|
||||
@override
|
||||
_LifePayChoosePageState createState() => _LifePayChoosePageState();
|
||||
}
|
||||
|
||||
class _LifePayChoosePageState extends State<LifePayChoosePage> {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return BeeScaffold(
|
||||
title: '生活缴费',
|
||||
body: ListView(
|
||||
padding: EdgeInsets.symmetric(vertical: 40.w, horizontal: 36.w),
|
||||
children: [
|
||||
_buidTile(R.ASSETS_ICONS_GOODS_BORROW_PNG, '生活缴费', true),
|
||||
_buidTile(R.ASSETS_ICONS_GOODS_BORROW_PNG, '公摊缴费', false),
|
||||
].sepWidget(separate: 20.w.heightBox),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
Widget _buidTile(String iconPath, String text, bool isBorrow) {
|
||||
return Row(
|
||||
children: [
|
||||
SizedBox(
|
||||
width: 32.w,
|
||||
height: 32.w,
|
||||
child: Image.asset(iconPath),
|
||||
),
|
||||
28.w.widthBox,
|
||||
text.text.black.size(30.sp).make(),
|
||||
Spacer(),
|
||||
Icon(
|
||||
CupertinoIcons.chevron_forward,
|
||||
size: 32.w,
|
||||
),
|
||||
],
|
||||
)
|
||||
.box
|
||||
.padding(EdgeInsets.symmetric(vertical: 40.w, horizontal: 32.w))
|
||||
.make()
|
||||
.onInkTap(() {
|
||||
isBorrow ? Get.to(() => LifePayPage()) : Get.to(() => SharePayPage());
|
||||
}).material(
|
||||
color: Colors.white,
|
||||
borderRadius: BorderRadius.circular(8.w),
|
||||
clipBehavior: Clip.antiAlias,
|
||||
);
|
||||
}
|
||||
}
|
@ -0,0 +1,298 @@
|
||||
import 'dart:convert';
|
||||
|
||||
import 'package:aku_community/base/base_style.dart';
|
||||
import 'package:aku_community/models/life_pay/share_pay_list_model.dart';
|
||||
import 'package:aku_community/pages/life_pay/life_pay_page.dart';
|
||||
import 'package:aku_community/provider/app_provider.dart';
|
||||
import 'package:aku_community/utils/headers.dart';
|
||||
import 'package:aku_community/widget/bee_scaffold.dart';
|
||||
import 'package:aku_community/widget/buttons/bee_check_radio.dart';
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
import 'package:velocity_x/velocity_x.dart';
|
||||
|
||||
class SharePayDetailPage extends StatefulWidget {
|
||||
final SharePayListModel model;
|
||||
final SharePayListModel selectModel;
|
||||
final String months;
|
||||
|
||||
const SharePayDetailPage(
|
||||
{Key? key,
|
||||
required this.model,
|
||||
required this.selectModel,
|
||||
required this.months})
|
||||
: super(key: key);
|
||||
|
||||
@override
|
||||
_SharePayDetailPageState createState() => _SharePayDetailPageState();
|
||||
}
|
||||
|
||||
class _SharePayDetailPageState extends State<SharePayDetailPage> {
|
||||
late SharePayListModel _selectModel; //已选择的model
|
||||
late SharePayListModel _model;
|
||||
|
||||
SelectPay get total {
|
||||
int count = 0;
|
||||
double price = 0;
|
||||
List<int> ids = [];
|
||||
_selectModel.appMeterShareDetailsVos.forEach((element) {
|
||||
count++;
|
||||
price += element.remainingUnpaidAmount;
|
||||
ids.add(element.id);
|
||||
});
|
||||
return SelectPay(payCount: count, payTotal: price, ids: ids);
|
||||
}
|
||||
|
||||
bool get isAllSelect {
|
||||
return total.payCount == widget.model.num && total.payCount != 0;
|
||||
}
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
super.initState();
|
||||
_selectModel =
|
||||
SharePayListModel.fromJson(jsonDecode(jsonEncode(widget.selectModel)));
|
||||
_model = widget.model;
|
||||
}
|
||||
|
||||
// Widget _expandedTile(AppMeterShareDetailsVos model, int index) {
|
||||
// return ExpandablePanel(
|
||||
// theme: ExpandableThemeData.combine(
|
||||
// ExpandableThemeData(
|
||||
// headerAlignment: ExpandablePanelHeaderAlignment.center),
|
||||
// ExpandableThemeData.defaults),
|
||||
// header: Row(
|
||||
// crossAxisAlignment: CrossAxisAlignment.center,
|
||||
// mainAxisAlignment: MainAxisAlignment.center,
|
||||
// children: [
|
||||
// 12.w.widthBox,
|
||||
// Spacer(),
|
||||
// '¥${(model.remainingUnpaidAmount ).toStringAsFixed(2)}'
|
||||
// .text
|
||||
// .color(kDangerColor)
|
||||
// .size(28.sp)
|
||||
// .bold
|
||||
// .make(),
|
||||
// 24.w.widthBox,
|
||||
// ],
|
||||
// ).material(color: Colors.transparent),
|
||||
// collapsed: SizedBox(),
|
||||
// expanded: Column(
|
||||
// children: model.detailsVoList
|
||||
// .map((e) => _expandedChild(e, index1, index2))
|
||||
// .toList()),
|
||||
// );
|
||||
// }
|
||||
|
||||
Widget _expandedChild(AppMeterShareDetailsVos model, int index) {
|
||||
return GestureDetector(
|
||||
onTap: () {
|
||||
if (_selectModel.appMeterShareDetailsVos.contains(model)) {
|
||||
_selectModel.appMeterShareDetailsVos.remove(model);
|
||||
setState(() {});
|
||||
} else {
|
||||
_selectModel.appMeterShareDetailsVos.add(model);
|
||||
setState(() {});
|
||||
}
|
||||
},
|
||||
child: Padding(
|
||||
padding: EdgeInsets.all(8.w),
|
||||
child: Column(
|
||||
children: [
|
||||
Row(
|
||||
children: [
|
||||
BeeCheckRadio(
|
||||
value: model.id,
|
||||
groupValue: total.ids,
|
||||
),
|
||||
12.w.widthBox,
|
||||
'房屋面积'.text.size(26.sp).black.make(),
|
||||
12.wb,
|
||||
('${model.houseArea}平方米')
|
||||
.toString()
|
||||
.text
|
||||
.size(26.sp)
|
||||
.black
|
||||
.make(),
|
||||
Spacer(),
|
||||
'未缴金额'.text.size(26.sp).red500.make(),
|
||||
12.wb,
|
||||
'¥${(model.remainingUnpaidAmount).toStringAsFixed(2)}'
|
||||
.text
|
||||
.size(26.sp)
|
||||
.black
|
||||
.make(),
|
||||
40.w.widthBox,
|
||||
],
|
||||
),
|
||||
Row(
|
||||
children: [
|
||||
52.w.widthBox,
|
||||
'应缴金额'.text.size(26.sp).black.make(),
|
||||
12.wb,
|
||||
'¥${model.amountPayable}'
|
||||
.toString()
|
||||
.text
|
||||
.size(26.sp)
|
||||
.black
|
||||
.make(),
|
||||
Spacer(),
|
||||
],
|
||||
),
|
||||
Row(
|
||||
children: [
|
||||
52.w.widthBox,
|
||||
'已缴金额'.text.size(26.sp).black.make(),
|
||||
12.wb,
|
||||
'¥${model.paidAmount}'.toString().text.size(26.sp).black.make(),
|
||||
Spacer(),
|
||||
],
|
||||
),
|
||||
// Row(
|
||||
// children: [
|
||||
// 52.w.widthBox,
|
||||
// '缴费期限'.text.size(26.sp).black.make(),
|
||||
// 12.wb,
|
||||
// model.paidAmount.toString().text.size(26.sp).black.make(),
|
||||
// Spacer(),
|
||||
// ],
|
||||
// )
|
||||
].sepWidget(separate: 24.w.heightBox),
|
||||
),
|
||||
)
|
||||
.box
|
||||
.color(Colors.white)
|
||||
.padding(EdgeInsets.symmetric(vertical: 32.w, horizontal: 20.w))
|
||||
.make(),
|
||||
);
|
||||
}
|
||||
|
||||
Widget _buildCard(AppMeterShareDetailsVos model, int index) {
|
||||
final appProvider = Provider.of<AppProvider>(context);
|
||||
return Container(
|
||||
padding: EdgeInsets.symmetric(horizontal: 32.w, vertical: 20.w),
|
||||
child: Column(
|
||||
children: [
|
||||
Row(
|
||||
children: [
|
||||
model.houseArea.text.black.size(30.sp).bold.make(),
|
||||
Spacer(),
|
||||
'${S.of(context)!.tempPlotName} ${appProvider.selectedHouse!.estateId}'
|
||||
.text
|
||||
.color(ktextSubColor)
|
||||
.size(24.sp)
|
||||
.make(),
|
||||
_expandedChild(
|
||||
model,
|
||||
index,
|
||||
)
|
||||
],
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
SharePayListModel clearModel(SharePayListModel model) {
|
||||
model.appMeterShareDetailsVos.clear();
|
||||
return model;
|
||||
}
|
||||
|
||||
Map<int, String> getType = {
|
||||
1: '水费',
|
||||
2: '电费',
|
||||
};
|
||||
|
||||
@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(
|
||||
title: '公摊${getType[widget.model.type]}(${widget.months})',
|
||||
body: ListView(
|
||||
padding: EdgeInsets.only(top: 16.w),
|
||||
children: List.generate(
|
||||
_model.appMeterShareDetailsVos.length,
|
||||
(index) => _expandedChild(
|
||||
_model.appMeterShareDetailsVos[index], index))),
|
||||
bottomNavi: Container(
|
||||
padding: EdgeInsets.fromLTRB(
|
||||
32.w, 16.w, 32.w, 12.w + MediaQuery.of(context).padding.bottom),
|
||||
child: Row(
|
||||
children: [
|
||||
GestureDetector(
|
||||
onTap: () {
|
||||
if (isAllSelect) {
|
||||
clearModel(_selectModel);
|
||||
} else {
|
||||
_selectModel = SharePayListModel.fromJson(
|
||||
jsonDecode(jsonEncode(_model)));
|
||||
}
|
||||
setState(() {});
|
||||
},
|
||||
child: animatedContainer,
|
||||
),
|
||||
Spacer(),
|
||||
Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.end,
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
RichText(
|
||||
text: TextSpan(
|
||||
text: '合计:',
|
||||
style: TextStyle(
|
||||
color: ktextPrimary,
|
||||
fontSize: 32.sp,
|
||||
fontWeight: FontWeight.bold),
|
||||
children: [
|
||||
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(),
|
||||
],
|
||||
),
|
||||
8.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: _selectModel);
|
||||
},
|
||||
child: '选好了'.text.black.size(32.sp).bold.make(),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
@ -0,0 +1,156 @@
|
||||
import 'package:aku_community/base/base_style.dart';
|
||||
import 'package:aku_community/constants/api.dart';
|
||||
import 'package:aku_community/extensions/widget_list_ext.dart';
|
||||
import 'package:aku_community/models/life_pay/share_pay_record_model.dart';
|
||||
import 'package:aku_community/pages/things_page/widget/bee_list_view.dart';
|
||||
import 'package:aku_community/utils/headers.dart';
|
||||
import 'package:aku_community/widget/bee_scaffold.dart';
|
||||
import 'package:aku_community/widget/others/user_tool.dart';
|
||||
import 'package:flustars/flustars.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_easyrefresh/easy_refresh.dart';
|
||||
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
||||
import 'package:velocity_x/velocity_x.dart';
|
||||
|
||||
class ShareRecordPage extends StatefulWidget {
|
||||
const ShareRecordPage({Key? key}) : super(key: key);
|
||||
|
||||
@override
|
||||
_ShareRecordPageState createState() => _ShareRecordPageState();
|
||||
}
|
||||
|
||||
class _ShareRecordPageState extends State<ShareRecordPage> {
|
||||
EasyRefreshController? _refreshController;
|
||||
Map<int, String> getPayType = {
|
||||
1: '支付宝',
|
||||
2: '微信',
|
||||
3: '现金',
|
||||
4: 'pos',
|
||||
5: '预缴扣除'
|
||||
};
|
||||
@override
|
||||
void initState() {
|
||||
super.initState();
|
||||
_refreshController = EasyRefreshController();
|
||||
}
|
||||
|
||||
@override
|
||||
void dispose() {
|
||||
_refreshController?.dispose();
|
||||
super.dispose();
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return BeeScaffold(
|
||||
title: '公摊缴费记录',
|
||||
body: BeeListView(
|
||||
path: API.manager.sharePayRecord,
|
||||
extraParams: {"tel": UserTool.userProvider.userInfoModel!.tel},
|
||||
controller: _refreshController,
|
||||
convert: (models) {
|
||||
return models.tableList!
|
||||
.map((e) => SharePayRecordModel.fromJson(e))
|
||||
.toList();
|
||||
},
|
||||
builder: (items) {
|
||||
return ListView(
|
||||
padding: EdgeInsets.symmetric(vertical: 32.w, horizontal: 32.w),
|
||||
children: [
|
||||
'如果有疑问,请联系物业客服 '
|
||||
.richText
|
||||
.withTextSpanChildren([
|
||||
'400-6754322'
|
||||
.textSpan
|
||||
.color(Color(0xFFFF8200))
|
||||
.size(24.sp)
|
||||
.bold
|
||||
.make()
|
||||
])
|
||||
.size(24.sp)
|
||||
.color(ktextSubColor)
|
||||
.make(),
|
||||
32.w.heightBox,
|
||||
...<Widget>[
|
||||
...items
|
||||
.map((e) => _buildRecordCard(e as SharePayRecordModel))
|
||||
.toList()
|
||||
].sepWidget(separate: 24.w.heightBox)
|
||||
],
|
||||
);
|
||||
},
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
Widget _buildRecordCard(SharePayRecordModel model) {
|
||||
return Column(
|
||||
children: [
|
||||
Row(
|
||||
children: [
|
||||
'公摊费用'.text.size(30.sp).color(ktextPrimary).bold.make(),
|
||||
Spacer(),
|
||||
'${UserTool.userProvider.userInfoModel!.tel}'
|
||||
.text
|
||||
.size(24.sp)
|
||||
.color(Color(0xFF999999))
|
||||
.make()
|
||||
],
|
||||
),
|
||||
16.w.heightBox,
|
||||
Row(
|
||||
children: [
|
||||
'建筑面积'.text.color(ktextSubColor).size(24.sp).make(),
|
||||
Spacer(),
|
||||
'${model.indoorArea}平方米'
|
||||
.text
|
||||
.color(Color(0xFFFC361D))
|
||||
.size(28.sp)
|
||||
.bold
|
||||
.make()
|
||||
],
|
||||
),
|
||||
Row(
|
||||
children: [
|
||||
'缴纳金额'.text.color(ktextSubColor).size(28.sp).make(),
|
||||
Spacer(),
|
||||
'${model.payPrice}'.text.color(ktextPrimary).size(28.sp).make(),
|
||||
],
|
||||
),
|
||||
Row(
|
||||
children: [
|
||||
'缴费时间'.text.color(ktextSubColor).size(28.sp).make(),
|
||||
Spacer(),
|
||||
'${DateUtil.formatDateStr(model.paymentTime, format: "yyyy/MM/dd HH:mm")}'
|
||||
.text
|
||||
.color(ktextPrimary)
|
||||
.size(28.sp)
|
||||
.make(),
|
||||
],
|
||||
),
|
||||
Row(
|
||||
children: [
|
||||
'付款方式'.text.color(ktextSubColor).size(28.sp).make(),
|
||||
Spacer(),
|
||||
'${getPayType[model.payType]}'
|
||||
.text
|
||||
.color(ktextPrimary)
|
||||
.size(28.sp)
|
||||
.make(),
|
||||
],
|
||||
),
|
||||
Row(
|
||||
children: [
|
||||
'订单号'.text.color(ktextSubColor).size(28.sp).make(),
|
||||
Spacer(),
|
||||
'${model.code}'.text.color(ktextPrimary).size(28.sp).make(),
|
||||
],
|
||||
),
|
||||
].sepWidget(separate: 24.w.heightBox),
|
||||
)
|
||||
.box
|
||||
.color(Colors.white)
|
||||
.padding(EdgeInsets.symmetric(vertical: 32.w, horizontal: 20.w))
|
||||
.make();
|
||||
}
|
||||
}
|
Loading…
Reference in new issue