update life pay page

hmxc
张萌 4 years ago
parent 5c08941e34
commit 013cf1dfd8

@ -4,6 +4,7 @@ import 'package:akuCommunity/constants/api.dart';
import 'package:akuCommunity/model/manager/life_pay_model.dart';
import 'package:akuCommunity/pages/personal/widget/order_card.dart';
import 'package:akuCommunity/pages/things_page/widget/bee_list_view.dart';
import 'package:akuCommunity/widget/buttons/bee_check_box.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter_easyrefresh/easy_refresh.dart';
@ -37,7 +38,70 @@ class _LifePayPageState extends State<LifePayPage> {
super.dispose();
}
String _getCustomYears(int year) {
int dif = year - DateTime.now().year;
if (dif < 0) {
if (dif == -1) {
return '去年';
} else if (dif == -2) {
return '前年';
} else {
return '${-dif}年前';
}
} else if (dif == 0) {
return '今年';
} else {
if (dif == 1) {
return '明年';
} else {
return '$dif年后';
}
}
}
Widget _buildCard(LifePayMolde model) {
return Container(
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(8.w), color: kForeGroundColor),
child: Row(
children: [
BeeCheckBox.round(),
Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
'${_getCustomYears(model.years)}(${model.years})'
.text
.color(ktextSubColor)
.size(28.sp)
.make(),
24.w.heightBox,
'待缴:${model.paymentNum}'
.text
.color(ktextPrimary)
.size(28.sp)
.make(),
24.w.heightBox,
RichText(
text: TextSpan(
text: '合计:',
style: TextStyle(
color: ktextPrimary,
fontSize: 28.sp,
fontWeight: FontWeight.bold),
children: [
TextSpan(
text: '¥',
style: TextStyle(
color: kDangerColor,
fontSize: 28.sp,
fontWeight: FontWeight.bold)),
]))
],
),
],
),
);
}
@override
Widget build(BuildContext context) {
@ -55,45 +119,6 @@ class _LifePayPageState extends State<LifePayPage> {
),
),
],
// body: Stack(
// children: [
// ListView(
// padding: EdgeInsets.only(bottom: 130.w),
// children: [
// Container(
// margin: EdgeInsets.only(
// top: 32.w,
// left: 32.w,
// right: 32.w,
// ),
// child: RichText(
// text: TextSpan(
// style:
// TextStyle(fontSize: 28.sp, color: Color(0xff666666)),
// children: <InlineSpan>[
// TextSpan(
// text: '深圳华茂悦峰',
// ),
// TextSpan(
// text: '1幢-1单元-702室',
// style: TextStyle(fontWeight: FontWeight.bold),
// ),
// ]),
// ),
// ),
// OrderCard(
// fun: LifePayInfoPage(
// bundle: Bundle()
// ..putMap('commentMap', {'title': '明细', 'isActions': false}),
// ).to),
// ],
// ),
// Positioned(
// bottom: 0,
// child: SubmitBar(title: '去缴费'),
// ),
// ],
// ),
body: BeeListView(
path: API.manager.dailyPaymentList,
controller: _controller,
@ -103,11 +128,16 @@ class _LifePayPageState extends State<LifePayPage> {
.toList();
},
builder: (items) {
return ListView.builder(itemBuilder: (context, index){
return Column(
children: [
ListView.builder(
itemBuilder: (context, index) {
// return _buildCard(items[index]);
return OrderCard();
return _buildCard(items[index]);
},
// itemCount: items.length,
itemCount: 1,
),
],
);
}),
);

@ -8,13 +8,19 @@ import 'package:akuCommunity/utils/headers.dart';
class BeeCheckBox extends StatefulWidget {
final Function(bool) onChange;
BeeCheckBox({Key key, this.onChange}) : super(key: key);
final bool isRound;
final double size;
BeeCheckBox({Key key, this.onChange, this.isRound, this.size})
: super(key: key);
BeeCheckBox.round({Key key, this.onChange, this.size})
: this.isRound = true,
super(key: key);
@override
_BeeCheckBoxState createState() => _BeeCheckBoxState();
}
class _BeeCheckBoxState extends State<BeeCheckBox> {
double get boxSize => widget.size ?? 28.w;
bool _isSelect = false;
@override
Widget build(BuildContext context) {
@ -30,10 +36,11 @@ class _BeeCheckBoxState extends State<BeeCheckBox> {
border: Border.all(
width: 1.w, color: _isSelect ? kPrimaryColor : kDarkSubColor),
color: _isSelect ? kPrimaryColor : Colors.transparent,
),
borderRadius:
BorderRadius.circular(widget.isRound ? boxSize / 2 : 0)),
curve: Curves.easeInOutCubic,
width: 28.w,
height: 28.w,
width: boxSize,
height: boxSize,
child: _isSelect
? Icon(
CupertinoIcons.check_mark,

Loading…
Cancel
Save