Merge branch 'master' of 192.168.2.201:laiiihz/akuCommunity

* 'master' of 192.168.2.201:laiiihz/akuCommunity:
  add life pay detail page
  add my house select page
  add 默认房屋状态管理
  add select my house page
  add bottom button
  add house head card
  update life pay page
  dock interface:dailyPayment/list
  对接:报损
  对接:借还管理:查询该用户的所有物品借还信息
  update goods borrow page 对接 借还管理查询接口
  fixed some issues
  update animate
  update fixed page animate
hmxc
小赖 4 years ago
commit 869718a329

2
.gitignore vendored

@ -59,3 +59,5 @@ coverage/
!**/ios/**/default.pbxuser
!**/ios/**/default.perspectivev3
!/packages/flutter_tools/test/data/dart_dependencies_test/**/.packages
commit.csv
.~lock.commit.csv#

@ -130,6 +130,18 @@ class _Manager {
///app
String get articleOutDelete => '/user/articleOut/falseDelete';
///
String get articleBorrow => '/user/articleBorrow/list';
///
String get articleBorrowMylist => '/user/articleBorrow/myList';
///
String get fromLoss => '/user/articleBorrow/frmLoss';
///list
String get dailyPaymentList => '/user/dailyPayment/list';
}
class _Community {

@ -0,0 +1,33 @@
import 'package:akuCommunity/model/common/img_model.dart';
class ArticleBorrowModel {
int id;
String name;
int quantity;
List<ImgModel> imgUrls;
ArticleBorrowModel({this.id, this.name, this.quantity, this.imgUrls});
ArticleBorrowModel.fromJson(Map<String, dynamic> json) {
id = json['id'];
name = json['name'];
quantity = json['quantity'];
if (json['imgUrls'] != null) {
imgUrls = new List<ImgModel>();
json['imgUrls'].forEach((v) {
imgUrls.add(new ImgModel.fromJson(v));
});
}
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['id'] = this.id;
data['name'] = this.name;
data['quantity'] = this.quantity;
if (this.imgUrls != null) {
data['imgUrls'] = this.imgUrls.map((v) => v.toJson()).toList();
}
return data;
}
}

@ -6,6 +6,7 @@ class GoodsOutModel {
int approach;
int status;
String movingCompanyTel;
List<ImgUrl> imgUrl;
GoodsOutModel(
{this.id,
@ -14,7 +15,8 @@ class GoodsOutModel {
this.expectedTime,
this.approach,
this.status,
this.movingCompanyTel});
this.movingCompanyTel,
this.imgUrl});
GoodsOutModel.fromJson(Map<String, dynamic> json) {
id = json['id'];
@ -24,6 +26,12 @@ class GoodsOutModel {
approach = json['approach'];
status = json['status'];
movingCompanyTel = json['movingCompanyTel'];
if (json['imgUrl'] != null) {
imgUrl = new List<ImgUrl>();
json['imgUrl'].forEach((v) {
imgUrl.add(new ImgUrl.fromJson(v));
});
}
}
Map<String, dynamic> toJson() {
@ -35,6 +43,37 @@ class GoodsOutModel {
data['approach'] = this.approach;
data['status'] = this.status;
data['movingCompanyTel'] = this.movingCompanyTel;
if (this.imgUrl != null) {
data['imgUrl'] = this.imgUrl.map((v) => v.toJson()).toList();
}
return data;
}
}
class ImgUrl {
String url;
String size;
int longs;
int paragraph;
int sort;
ImgUrl({this.url, this.size, this.longs, this.paragraph, this.sort});
ImgUrl.fromJson(Map<String, dynamic> json) {
url = json['url'];
size = json['size'];
longs = json['longs'];
paragraph = json['paragraph'];
sort = json['sort'];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['url'] = this.url;
data['size'] = this.size;
data['longs'] = this.longs;
data['paragraph'] = this.paragraph;
data['sort'] = this.sort;
return data;
}
}

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

@ -0,0 +1,40 @@
class MineGoodsModel {
int id;
String name;
int code;
String beginDate;
String endDate;
int borrowDate;
int borrowStatus;
MineGoodsModel(
{this.id,
this.name,
this.code,
this.beginDate,
this.endDate,
this.borrowDate,
this.borrowStatus});
MineGoodsModel.fromJson(Map<String, dynamic> json) {
id = json['id'];
name = json['name'];
code = json['code'];
beginDate = json['beginDate'];
endDate = json['endDate'];
borrowDate = json['borrowDate'];
borrowStatus = json['borrowStatus'];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['id'] = this.id;
data['name'] = this.name;
data['code'] = this.code;
data['beginDate'] = this.beginDate;
data['endDate'] = this.endDate;
data['borrowDate'] = this.borrowDate;
data['borrowStatus'] = this.borrowStatus;
return data;
}
}

@ -6,6 +6,7 @@ import 'dart:io';
// Flutter imports:
import 'package:akuCommunity/constants/api.dart';
import 'package:akuCommunity/pages/goods_deto_page/select_move_company_page.dart';
import 'package:akuCommunity/pages/life_pay/widget/my_house_page.dart';
import 'package:akuCommunity/pages/manager_func.dart';
import 'package:akuCommunity/utils/bee_parse.dart';
import 'package:akuCommunity/utils/network/base_model.dart';
@ -44,7 +45,8 @@ class _DetoCreatePageState extends State<DetoCreatePage> {
String _itemName;
DateTime _date;
String get datetime=>DateUtil.formatDate(_date, format: "yyyy-MM-dd HH:mm:ss");
String get datetime =>
DateUtil.formatDate(_date, format: "yyyy-MM-dd HH:mm:ss");
int _selectWeight;
String _selectTel;
List<String> _listWeight = [
@ -67,7 +69,7 @@ class _DetoCreatePageState extends State<DetoCreatePage> {
bool needMoveCompany = false;
Widget _houseAddress(String title, subtitle) {
Widget _houseAddress(String subtitle) {
return Container(
padding: EdgeInsets.only(bottom: 24.w),
margin: EdgeInsets.only(bottom: 40.w),
@ -88,41 +90,51 @@ class _DetoCreatePageState extends State<DetoCreatePage> {
),
),
),
Row(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Container(
margin: EdgeInsets.only(right: 42.w),
child: Image.asset(
R.ASSETS_IMAGES_HOUSE_ATTESTATION_PNG,
height: 59.w,
width: 59.w,
),
),
Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
title,
style: TextStyle(
fontWeight: FontWeight.w600,
fontSize: 32.sp,
color: Color(0xff333333),
),
GestureDetector(
onTap: () {
MyHousePage().to();
},
child: Row(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Container(
margin: EdgeInsets.only(right: 42.w),
child: Image.asset(
R.ASSETS_IMAGES_HOUSE_ATTESTATION_PNG,
height: 59.w,
width: 59.w,
),
SizedBox(height: 10.w),
Text(
subtitle,
style: TextStyle(
fontWeight: FontWeight.w600,
fontSize: 32.sp,
color: Color(0xff333333),
),
Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
kEstateName,
style: TextStyle(
fontWeight: FontWeight.w600,
fontSize: 32.sp,
color: Color(0xff333333),
),
),
)
],
),
],
SizedBox(height: 10.w),
Text(
BeeParse.getEstateName(subtitle),
style: TextStyle(
fontWeight: FontWeight.w600,
fontSize: 32.sp,
color: Color(0xff333333),
),
)
],
),
Spacer(),
Icon(
CupertinoIcons.chevron_forward,
size: 40.w,
),
],
).material(color: Colors.transparent),
),
],
),
@ -340,7 +352,7 @@ class _DetoCreatePageState extends State<DetoCreatePage> {
setState(() {});
}
Widget _getMovingCompany(String movingCompany) {
Widget _getMovingCompany() {
return Container(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
@ -350,12 +362,13 @@ class _DetoCreatePageState extends State<DetoCreatePage> {
InkWell(
onTap: () async {
_selectTel = await SelectMoveCompanyPage().to();
setState(() {});
},
child: Padding(
padding: EdgeInsets.symmetric(vertical: 30.w),
child: Row(
children: [
(movingCompany.isEmptyOrNull ? '请选择搬家公司' : movingCompany)
(_selectTel.isEmptyOrNull ? '请选择搬家公司' : _selectTel)
.text
.color(ktextSubColor)
.size(36.sp)
@ -395,16 +408,9 @@ class _DetoCreatePageState extends State<DetoCreatePage> {
body: ListView(
padding: EdgeInsets.all(32.w),
children: [
_houseAddress(
kEstateName,
userProvider.userDetailModel.estateNames.isEmpty
? ''
: BeeParse.getEstateName(
userProvider.userDetailModel.estateNames[0])),
_houseAddress(userProvider.currentHouse),
_getWeight(),
_itemPicker(
'出户时间', datetime,
() async {
_itemPicker('出户时间', datetime, () async {
_date = await BeeDatePicker.timePicker(DateTime.now());
setState(() {});
}),
@ -412,7 +418,7 @@ class _DetoCreatePageState extends State<DetoCreatePage> {
_showItmePicker();
}),
_getApproach(),
_selectApproach == 0 ? SizedBox() : _getMovingCompany(''),
_selectApproach == 0 ? SizedBox() : _getMovingCompany(),
Container(
margin: EdgeInsets.only(top: 54.w, bottom: 24.w),
child: Text(

@ -1,12 +1,15 @@
// Flutter imports:
import 'package:akuCommunity/pages/manager_func.dart';
import 'package:akuCommunity/provider/user_provider.dart';
import 'package:akuCommunity/widget/buttons/bottom_button.dart';
import 'package:akuCommunity/widget/buttons/radio_button.dart';
import 'package:bot_toast/bot_toast.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
// Package imports:
import 'package:flutter_easyrefresh/easy_refresh.dart';
import 'package:provider/provider.dart';
import 'package:velocity_x/velocity_x.dart';
// Project imports:
@ -50,8 +53,9 @@ class _GoodsDetoPageState extends State<GoodsDetoPage> {
return AnimatedPositioned(
bottom: 0,
top: 0,
left: (_canSkew(4) && _isEdit) ? 80.w : 0.w,
left: (_canSkew(model.status) && _isEdit) ? 80.w : 0.w,
duration: Duration(milliseconds: 300),
curve: Curves.easeInOutCubic,
width: 750.w,
child: GoodsInfoCard(
model: model,
@ -61,6 +65,7 @@ class _GoodsDetoPageState extends State<GoodsDetoPage> {
@override
Widget build(BuildContext context) {
UserProvider userProvider = Provider.of<UserProvider>(context);
return BeeScaffold(
title: '物品出户',
actions: [
@ -123,7 +128,9 @@ class _GoodsDetoPageState extends State<GoodsDetoPage> {
_refreshController.callRefresh();
}
: () {
DetoCreatePage().to();
userProvider.isLogin
? DetoCreatePage().to()
: BotToast.showText(text: '请先登录!');
},
child: _isEdit
? '删除'.text.size(32.sp).bold.make()

@ -2,6 +2,7 @@
import 'package:akuCommunity/base/base_style.dart';
import 'package:akuCommunity/model/manager/goods_out_model.dart';
import 'package:akuCommunity/utils/bee_map.dart';
import 'package:akuCommunity/widget/views/horizontal_image_view.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
@ -36,7 +37,7 @@ class GoodsInfoCard extends StatelessWidget {
);
}
Color _getColor(int state) {
Color _getColor(int state) {
switch (state) {
case 1:
case 2:
@ -51,6 +52,7 @@ Color _getColor(int state) {
return kDangerColor;
}
}
@override
Widget build(BuildContext context) {
return Container(
@ -135,14 +137,15 @@ Color _getColor(int state) {
children: [
Container(
alignment: Alignment.centerLeft,
margin: EdgeInsets.only(bottom: 25.w),
margin: EdgeInsets.only(bottom: 8.w),
child: Text(
'图片信息',
style: TextStyle(
fontSize: 28.sp, color: Color(0xff333333)),
),
),
ImageHorizontalList(imageUrl: []),
HorizontalImageView(
model.imgUrl.map((e) => e.url).toList()),
],
),
),
@ -150,7 +153,7 @@ Color _getColor(int state) {
),
),
GoodsInfoCardButton(
id:model.id,
id: model.id,
tel: model.movingCompanyTel,
)
],

@ -1,6 +1,12 @@
// Flutter imports:
import 'package:akuCommunity/constants/api.dart';
import 'package:akuCommunity/model/manager/article_borrow_model.dart';
import 'package:akuCommunity/pages/goods_manage_page/mine_goods_page/mine_goods_page.dart';
import 'package:akuCommunity/pages/things_page/widget/bee_list_view.dart';
import 'package:akuCommunity/widget/buttons/bottom_button.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter_easyrefresh/easy_refresh.dart';
// Package imports:
import 'package:velocity_x/velocity_x.dart';
@ -8,8 +14,7 @@ import 'package:velocity_x/velocity_x.dart';
// Project imports:
import 'package:akuCommunity/utils/headers.dart';
import 'package:akuCommunity/widget/bee_scaffold.dart';
import 'package:akuCommunity/widget/bottom_button.dart';
import 'package:akuCommunity/widget/cached_image_wrapper.dart';
import 'package:akuCommunity/const/resource.dart';
class GoodsManagePage extends StatefulWidget {
GoodsManagePage({Key key}) : super(key: key);
@ -19,46 +24,9 @@ class GoodsManagePage extends StatefulWidget {
}
class _GoodsManagePageState extends State<GoodsManagePage> {
List<Map<String, dynamic>> _listGoods = [
{
'imagePath':
'https://ss0.bdstatic.com/70cFvHSh_Q1YnxGkpoWK1HF6hhy/it/u=409315131,2212208097&fm=26&gp=0.jpg',
'title': '榔头',
'goodsNum': 4
},
{
'imagePath':
'https://timgsa.baidu.com/timg?image&quality=80&size=b9999_10000&sec=1600315000206&di=d63920cce862ea3143b94f5efd9ee48f&imgtype=0&src=http%3A%2F%2Fimg009.hc360.cn%2Fy3%2FM06%2F97%2F52%2FwKhQh1T9gwqEG8-EAAAAADtr0hA725.jpg',
'title': '梯子',
'goodsNum': 2
},
{
'imagePath':
'https://ss1.bdstatic.com/70cFuXSh_Q1YnxGkpoWK1HF6hhy/it/u=742033541,898484766&fm=26&gp=0.jpg',
'title': '电钻',
'goodsNum': 10
},
{
'imagePath':
'https://ss1.bdstatic.com/70cFuXSh_Q1YnxGkpoWK1HF6hhy/it/u=655760492,2421981969&fm=26&gp=0.jpg',
'title': '多功能螺丝刀',
'goodsNum': 7
},
{
'imagePath':
'https://timgsa.baidu.com/timg?image&quality=80&size=b9999_10000&sec=1600315263467&di=87b7fa8cd8bc03f5bd320f29efd00418&imgtype=0&src=http%3A%2F%2Ftu.ossfiles.cn%3A9186%2Fgroup3%2FM00%2F08%2FB6%2FrBpVfl8H3XuAOUA-AAFkF36vtNY168.jpg',
'title': '手电筒',
'goodsNum': 5
},
{
'imagePath':
'https://ss1.bdstatic.com/70cFvXSh_Q1YnxGkpoWK1HF6hhy/it/u=1922842359,3407397182&fm=26&gp=0.jpg',
'title': '胶带',
'goodsNum': 6
}
];
EasyRefreshController _easyRefreshController;
Container _goodsCard(String imagePath, title, int goodsNum) {
Container _goodsCard(ArticleBorrowModel model) {
return Container(
margin: EdgeInsets.only(
top: 20.w,
@ -73,28 +41,28 @@ class _GoodsManagePageState extends State<GoodsManagePage> {
),
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.all(Radius.circular(6)),
borderRadius: BorderRadius.all(Radius.circular(6.w)),
),
child: Row(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Container(
height: 120.w,
width: 160.w,
margin: EdgeInsets.only(right: 20.w),
child: ClipRRect(
child: CachedImageWrapper(
url: imagePath,
width: 160.w,
height: 120.w,
),
),
child: FadeInImage.assetNetwork(
placeholder: R.ASSETS_IMAGES_LOGO_PNG,
image: API.image(
model.imgUrls.isEmpty ? '' : model.imgUrls.first.url))),
),
Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.start,
children: [
Text(
'物品名称:$title',
'物品名称:${model.name}',
style: TextStyle(
fontSize: 28.sp,
color: Color(0xff4a4b51),
@ -102,7 +70,7 @@ class _GoodsManagePageState extends State<GoodsManagePage> {
),
SizedBox(height: 20.w),
Text(
'数量剩余:$goodsNum',
'数量剩余:${model.quantity}',
style: TextStyle(
fontSize: 24.sp,
color: Color(0xff999999),
@ -121,31 +89,36 @@ class _GoodsManagePageState extends State<GoodsManagePage> {
title: '借还管理',
actions: [
InkWell(
onTap: () {},
onTap: () {
MineGoodsPage().to();
},
child: Container(
padding: EdgeInsets.fromLTRB(32.w, 28.w, 32.w, 20.w),
alignment: Alignment.center,
child: '我的借还物品'.text.black.size(28.sp).make()))
],
body: Stack(
children: [
Column(
children: _listGoods
.map((item) => _goodsCard(
item['imagePath'],
item['title'],
item['goodsNum'],
))
.toList(),
),
Positioned(
bottom: 0,
child: BottomButton(
title: '扫一扫出借',
fun: () {},
),
),
],
body: BeeListView(
path: API.manager.articleBorrow,
controller: _easyRefreshController,
convert: (models) {
return models.tableList
.map((e) => ArticleBorrowModel.fromJson(e))
.toList();
},
builder: (items) {
return ListView.separated(
itemBuilder: (context, index) {
return _goodsCard(items[index]);
},
separatorBuilder: (_, __) {
return 16.w.heightBox;
},
itemCount: items.length);
}),
bottomNavi: BottomButton(
child: '扫一扫出借'.text.black.size(32.sp).bold.make(),
onPressed: () {},
),
);
}

@ -1,9 +1,12 @@
// Flutter imports:
import 'package:akuCommunity/constants/api.dart';
import 'package:akuCommunity/model/manager/mine_goods_model.dart';
import 'package:akuCommunity/pages/manager_func.dart';
import 'package:akuCommunity/pages/things_page/widget/bee_list_view.dart';
import 'package:akuCommunity/utils/bee_map.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
// Package imports:
import 'package:pull_to_refresh/pull_to_refresh.dart';
import 'package:flutter_easyrefresh/easy_refresh.dart';
// Project imports:
import 'package:akuCommunity/utils/headers.dart';
@ -17,81 +20,25 @@ class MineGoodsPage extends StatefulWidget {
}
class _MineGoodsPageState extends State<MineGoodsPage> {
List<Map<String, dynamic>> _listGoods = [
{
'title': '榔头',
'goodsNum': 6,
'borrowTime': '2020.09.18 12:00',
'timeLength': '7',
'status': '未还'
},
{
'title': '梯子',
'goodsNum': 1,
'borrowTime': '2020.08.28 12:00',
'timeLength': '3',
'status': '已还'
},
{
'title': '电钻',
'goodsNum': 1,
'borrowTime': '2020.07.04 12:00',
'timeLength': '6',
'status': '未还'
},
{
'title': '多功能螺丝刀',
'goodsNum': 4,
'borrowTime': '2020.04.06 12:00',
'timeLength': '4',
'status': '已还'
},
{
'title': '手电筒',
'goodsNum': 2,
'borrowTime': '2020.02.19 12:00',
'timeLength': '2',
'status': '已还'
},
{
'title': '胶带',
'goodsNum': 3,
'borrowTime': '2020.01.14 12:00',
'timeLength': '8',
'status': '未还'
},
];
RefreshController _refreshController =
RefreshController(initialRefresh: false);
EasyRefreshController _controller;
@override
void initState() {
super.initState();
}
void _onRefresh() async {
await Future.delayed(Duration(milliseconds: 1500));
_refreshController.refreshCompleted();
}
void _onLoading() async {
await Future.delayed(Duration(milliseconds: 1500));
if (mounted) setState(() {});
_refreshController.loadComplete();
_controller = EasyRefreshController();
}
@override
void dispose() {
super.dispose();
_refreshController.dispose();
_controller.dispose();
}
InkWell _frmLoss() {
InkWell _frmLoss(int id) {
return InkWell(
onTap: () {},
onTap: () async {
await ManagerFunc.fromLoss(id);
},
child: Container(
width: 120.w,
height: 44.w,
@ -109,8 +56,15 @@ class _MineGoodsPageState extends State<MineGoodsPage> {
);
}
Container _goodsCard(
String title, borrowTime, timeLength, status, int goodsNum) {
String _getDatelength(int date) {
if (date >= 24) {
return '${date / 24}' + '${date % 24}';
} else {
return '$date';
}
}
Container _goodsCard(MineGoodsModel model) {
return Container(
margin: EdgeInsets.only(
top: 20.w,
@ -136,7 +90,7 @@ class _MineGoodsPageState extends State<MineGoodsPage> {
mainAxisAlignment: MainAxisAlignment.start,
children: [
Text(
'物品名称:$title',
'物品名称:${model.name}',
style: TextStyle(
fontSize: 28.sp,
color: Color(0xff4a4b51),
@ -145,7 +99,7 @@ class _MineGoodsPageState extends State<MineGoodsPage> {
Container(
margin: EdgeInsets.only(top: 16.w),
child: Text(
'借还数量:$goodsNum',
'借还数量:10',
style: TextStyle(
fontSize: 24.sp,
color: Color(0xff333333),
@ -155,7 +109,7 @@ class _MineGoodsPageState extends State<MineGoodsPage> {
Container(
margin: EdgeInsets.only(top: 16.w),
child: Text(
'借用时间: $borrowTime',
'借用时间: ${model.beginDate}',
style: TextStyle(
fontSize: 24.sp,
color: Color(0xff999999),
@ -165,7 +119,7 @@ class _MineGoodsPageState extends State<MineGoodsPage> {
Container(
margin: EdgeInsets.only(top: 16.w),
child: Text(
'借用时长: $timeLength',
'借用时长: ${_getDatelength(model.borrowDate)}',
style: TextStyle(
fontSize: 24.sp,
color: Color(0xff999999),
@ -178,23 +132,23 @@ class _MineGoodsPageState extends State<MineGoodsPage> {
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Text(
'借用状态: $status',
'借用状态: ${BeeMap.borrowStatus}',
style: TextStyle(
fontSize: 24.sp,
color: Color(0xff999999),
),
),
_frmLoss(),
_frmLoss(model.id),
],
),
),
SizedBox(height: 12.w),
Divider(color: Color(0xfff9f9f9)),
status == '未还'
model.borrowStatus == 1
? Container(
margin: EdgeInsets.only(bottom: 9.w),
child: Text(
'温馨提示:您的物品已借用$timeLength天,如果用完,请及时归还',
'温馨提示:您的物品已借用${_getDatelength(model.borrowDate)},如果用完,请及时归还',
style: TextStyle(
fontSize: 22.sp,
color: Color(0xff999999),
@ -214,26 +168,42 @@ class _MineGoodsPageState extends State<MineGoodsPage> {
Widget build(BuildContext context) {
return BeeScaffold(
title: '我的借还物品',
body: RefreshConfiguration(
child: SmartRefresher(
controller: _refreshController,
header: WaterDropHeader(),
footer: ClassicFooter(),
onRefresh: _onRefresh,
onLoading: _onLoading,
enablePullUp: true,
child: ListView.builder(
itemBuilder: (BuildContext context, int index) => _goodsCard(
_listGoods[index]['title'],
_listGoods[index]['borrowTime'],
_listGoods[index]['timeLength'],
_listGoods[index]['status'],
_listGoods[index]['goodsNum'],
),
itemCount: _listGoods.length,
),
),
),
// body: RefreshConfiguration(
// child: SmartRefresher(
// controller: _refreshController,
// header: WaterDropHeader(),
// footer: ClassicFooter(),
// onRefresh: _onRefresh,
// onLoading: _onLoading,
// enablePullUp: true,
// child: ListView.builder(
// itemBuilder: (BuildContext context, int index) => _goodsCard(
// _listGoods[index]['title'],
// _listGoods[index]['borrowTime'],
// _listGoods[index]['timeLength'],
// _listGoods[index]['status'],
// _listGoods[index]['goodsNum'],
// ),
// itemCount: _listGoods.length,
// ),
// ),
// ),
body: BeeListView(
path: API.manager.articleBorrowMylist,
controller: _controller,
convert: (model) {
return model.tableList
.map((e) => MineGoodsModel.fromJson(e))
.toList();
},
builder: (items) {
return ListView.builder(
itemBuilder: (context, index) {
return _goodsCard(items[index]);
},
itemCount: items.length,
);
}),
);
}
}

@ -1,18 +1,26 @@
// Flutter imports:
import 'package:akuCommunity/base/base_style.dart';
import 'package:akuCommunity/const/resource.dart';
import 'package:akuCommunity/constants/api.dart';
import 'package:akuCommunity/model/manager/life_pay_model.dart';
import 'package:akuCommunity/pages/life_pay/widget/my_house_page.dart';
import 'package:akuCommunity/pages/things_page/widget/bee_list_view.dart';
import 'package:akuCommunity/provider/user_provider.dart';
import 'package:akuCommunity/utils/bee_parse.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';
import 'package:provider/provider.dart';
// Package imports:
import 'package:velocity_x/velocity_x.dart';
// Project imports:
import 'package:akuCommunity/pages/life_pay/life_pay_info_page/life_pay_info_page.dart';
import 'package:akuCommunity/pages/life_pay/life_pay_record_page/life_pay_record_page.dart';
import 'package:akuCommunity/routers/page_routers.dart';
import 'package:akuCommunity/utils/headers.dart';
import 'package:akuCommunity/widget/bee_scaffold.dart';
import 'widget/order_card.dart';
import 'widget/submit_bar.dart';
class LifePayPage extends StatefulWidget {
LifePayPage({Key key}) : super(key: key);
@ -22,8 +30,142 @@ class LifePayPage extends StatefulWidget {
}
class _LifePayPageState extends State<LifePayPage> {
EasyRefreshController _controller;
@override
void initState() {
super.initState();
_controller = EasyRefreshController();
}
@override
void dispose() {
_controller?.dispose();
super.dispose();
}
Widget _buildHouseCard(
String title,
String detail,
) {
return Material(
color: kForeGroundColor,
child: Padding(
padding: EdgeInsets.all(32.w),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
'当前房屋'.text.black.size(28.sp).make(),
32.w.heightBox,
GestureDetector(
onTap: () {
MyHousePage().to();
},
child: Row(
children: [
Image.asset(
R.ASSETS_ICONS_HOUSE_PNG,
width: 60.w,
height: 60.w,
),
40.w.widthBox,
Expanded(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
title.text.black.size(32.sp).bold.make(),
10.w.heightBox,
detail.text.black.size(32.sp).bold.make()
],
),
),
Icon(
CupertinoIcons.chevron_forward,
size: 40.w,
),
],
).material(color: Colors.transparent),
),
24.w.heightBox,
],
),
),
);
}
Widget _buildCard(LifePayMolde model) {
return Container(
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(8.w), color: kForeGroundColor),
child: Row(
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [
BeeCheckBox.round(
onChange: (value) {},
),
],
),
Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisSize: MainAxisSize.min,
children: [
'${BeeParse.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)),
]))
],
),
Column(
mainAxisSize: MainAxisSize.min,
mainAxisAlignment: MainAxisAlignment.start,
children: [
GestureDetector(
onTap: () {},
child: Container(
decoration: BoxDecoration(
color: Color(0xFF2A2A2A),
borderRadius: BorderRadius.circular(22.w),
),
padding:
EdgeInsets.symmetric(horizontal: 20.w, vertical: 8.w),
child: '选择明细'.text.color(Colors.white).size(22.sp).make(),
),
),
],
),
],
),
);
}
@override
Widget build(BuildContext context) {
UserProvider userProvider = Provider.of<UserProvider>(context);
return BeeScaffold(
title: '生活缴费',
actions: [
@ -38,44 +180,84 @@ 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),
),
]),
body: BeeListView(
path: API.manager.dailyPaymentList,
controller: _controller,
convert: (model) {
return model.tableList
.map((e) => LifePayMolde.fromJson(e))
.toList();
},
builder: (items) {
return Column(
children: [
_buildHouseCard(
kEstateName,
userProvider.userDetailModel.estateNames.isEmpty
? ''
: BeeParse.getEstateName(
userProvider.userDetailModel.estateNames[0])),
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(
items.length, (index) => _buildCard(items[index])),
],
),
),
),
OrderCard(
fun: LifePayInfoPage(
bundle: Bundle()
..putMap('commentMap', {'title': '明细', 'isActions': false}),
).to),
],
),
Positioned(
bottom: 0,
child: SubmitBar(title: '去缴费'),
),
],
],
);
}),
bottomNavi: Container(
padding: EdgeInsets.fromLTRB(
32.w, 16.w, 32.w, 12.w + MediaQuery.of(context).padding.bottom),
child: Row(
children: [
BeeCheckBox.round(
onChange: (value) {},
size: 40.w,
),
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: '¥3009.84',
style: TextStyle(
color: kDangerColor,
fontSize: 32.sp,
fontWeight: FontWeight.bold)),
])),
'已选10项'.text.color(ktextSubColor).size(20.sp).make(),
],
),
MaterialButton(
elevation: 0,
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(37.w)),
color: kPrimaryColor,
padding: EdgeInsets.symmetric(horizontal: 50.w, vertical: 15.w),
onPressed: () {},
child: '去缴费'.text.black.size(32.sp).bold.make(),
),
],
),
),
);
}

@ -0,0 +1,81 @@
import 'package:akuCommunity/base/base_style.dart';
import 'package:akuCommunity/model/manager/life_pay_model.dart';
import 'package:akuCommunity/utils/bee_parse.dart';
import 'package:akuCommunity/widget/bee_scaffold.dart';
import 'package:akuCommunity/widget/buttons/bee_check_box.dart';
import 'package:flutter/material.dart';
import 'package:akuCommunity/utils/headers.dart';
import 'package:get/get.dart';
class LifePayDetailPage extends StatefulWidget {
final LifePayMolde model;
LifePayDetailPage({
Key key,
this.model,
}) : super(key: key);
@override
_LifePayDetailPageState createState() => _LifePayDetailPageState();
}
class _LifePayDetailPageState extends State<LifePayDetailPage> {
@override
Widget build(BuildContext context) {
return BeeScaffold(
title:
'${BeeParse.getCustomYears(widget.model.years)}-${widget.model.years}年明细',
body: ListView(
padding: EdgeInsets.only(top: 16.w),
children: [
],
),
bottomNavi: Container(
padding: EdgeInsets.fromLTRB(
32.w, 16.w, 32.w, 12.w + MediaQuery.of(context).padding.bottom),
child: Row(
children: [
BeeCheckBox.round(
onChange: (value) {},
size: 40.w,
),
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: '¥3009.84',
style: TextStyle(
color: kDangerColor,
fontSize: 32.sp,
fontWeight: FontWeight.bold)),
])),
'已选10项'.text.color(ktextSubColor).size(20.sp).make(),
],
),
MaterialButton(
elevation: 0,
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(37.w)),
color: kPrimaryColor,
padding: EdgeInsets.symmetric(horizontal: 50.w, vertical: 15.w),
onPressed: () {
Get.back();
},
child: '选好了'.text.black.size(32.sp).bold.make(),
),
],
),
),
);
}
}

@ -0,0 +1,97 @@
import 'package:akuCommunity/base/base_style.dart';
import 'package:akuCommunity/pages/goods_deto_page/deto_create_page/widget/common_radio.dart';
import 'package:akuCommunity/provider/user_provider.dart';
import 'package:akuCommunity/utils/bee_parse.dart';
import 'package:akuCommunity/widget/bee_divider.dart';
import 'package:akuCommunity/widget/bee_scaffold.dart';
import 'package:flutter/material.dart';
import 'package:akuCommunity/utils/headers.dart';
import 'package:provider/provider.dart';
class MyHousePage extends StatefulWidget {
MyHousePage({Key key}) : super(key: key);
@override
_MyHousePageState createState() => _MyHousePageState();
}
Widget _currentHouseTag() {
return Container(
padding: EdgeInsets.symmetric(vertical: 12.w, horizontal: 20.w),
constraints: BoxConstraints(minWidth: 120.w),
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(36.w),
color: Color(0xFFFFF4D3),
border: Border.all(width: 2.w, color: Color(0xFFFFC40C))),
child: '当前房屋'.text.color(ktextPrimary).size(20.sp).make(),
);
}
Widget _unPaidTag() {
return Container(
padding: EdgeInsets.symmetric(vertical: 12.w, horizontal: 20.w),
constraints: BoxConstraints(minWidth: 120.w),
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(36.w),
color: Color(0xFFFFEBE8),
border: Border.all(width: 2.w, color: Color(0xFFFC361D))),
child: '当前房屋'.text.color(Color(0xFFFC361D)).size(20.sp).make(),
);
}
class _MyHousePageState extends State<MyHousePage> {
int _select;
Widget _buildCard(String currentHouse, String estateName, int index,
{bool paid = false}) {
return Container(
padding: EdgeInsets.symmetric(horizontal: 32.w, vertical: 32.w),
child: Row(
children: [
GestureDetector(
onTap: () {
_select = index;
setState(() {});
},
child: CommonRadio(
value: index,
groupValue: _select,
size: 32.w,
),
),
24.w.widthBox,
Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisSize: MainAxisSize.min,
children: [
kEstateName.text.size(24.sp).color(ktextSubColor).bold.make(),
16.w.heightBox,
BeeParse.getEstateName(estateName).text.color(ktextPrimary).size(28.sp).bold.make(),
],
),
Spacer(),
currentHouse == estateName
? _currentHouseTag()
: paid
? _unPaidTag()
: SizedBox()
],
),
);
}
@override
Widget build(BuildContext context) {
UserProvider userProvider = Provider.of<UserProvider>(context);
return BeeScaffold(
title: '我的房屋',
body: ListView(
children: <Widget>[
...userProvider.userDetailModel.estateNames
.map((e) => _buildCard(userProvider.currentHouse, e,
userProvider.userDetailModel.estateNames.indexOf(e)))
.toList(),
].sepWidget(separate: BeeDivider.horizontal()),
),
);
}
}

@ -4,20 +4,17 @@ import 'package:flutter/material.dart';
// Project imports:
import 'package:akuCommunity/base/base_style.dart';
import 'package:akuCommunity/pages/life_pay/life_pay_info_page/life_pay_info_page.dart';
import 'package:akuCommunity/routers/page_routers.dart';
import 'package:akuCommunity/utils/headers.dart';
class OrderCard extends StatefulWidget {
final Function fun;
OrderCard({Key key,this.fun}) : super(key: key);
OrderCard({Key key,}) : super(key: key);
@override
_OrderCardState createState() => _OrderCardState();
}
class _OrderCardState extends State<OrderCard> {
Container _orderInfo() {
Widget _orderInfo() {
return Container(
margin: EdgeInsets.only(
top: 20.w,
@ -77,11 +74,11 @@ class _OrderCardState extends State<OrderCard> {
);
}
InkWell _checkInfo(Function fun) {
Widget _checkInfo() {
return InkWell(
onTap: (){
LifePayInfoPage(bundle: Bundle()
..putMap('detailMap', {'title': '去年2019年'}),).to;
// LifePayInfoPage(bundle: Bundle()
// ..putMap('detailMap', {'title': '去年2019年'}),).to;
},
child: Container(
margin: EdgeInsets.only(top: 20.w),
@ -115,7 +112,7 @@ class _OrderCardState extends State<OrderCard> {
padding: EdgeInsets.symmetric(horizontal: 32.w),
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.all(Radius.circular(6)),
borderRadius: BorderRadius.all(Radius.circular(8.w)),
),
child: InkWell(
onTap: () {},
@ -132,8 +129,8 @@ class _OrderCardState extends State<OrderCard> {
mainAxisAlignment: MainAxisAlignment.spaceBetween,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
_orderInfo(),
_checkInfo(widget.fun),
// _orderInfo(),
// _checkInfo(),
],
),
)

@ -147,4 +147,15 @@ class ManagerFunc {
);
return baseModel;
}
static Future<BaseModel> fromLoss(int id)async{
BaseModel baseModel = await NetUtil().post(
API.manager.fromLoss,
params: {
'articleBorrowId':id
},
showMessage: true,
);
return baseModel;
}
}

@ -1,4 +1,5 @@
// Flutter imports:
import 'package:akuCommunity/widget/buttons/radio_button.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
@ -158,10 +159,22 @@ class _FixedSubmitPageState extends State<FixedSubmitPage> {
}
Widget _buildCheckBox(FixedSubmitModel model) {
return Container(
return
// GestureDetector(
// onTap: () {
// if (_selected.contains(model.id)) {
// _selected.remove(model.id);
// } else {
// _selected.add(model.id);
// }
// setState(() {});
// },
// child:
Container(
alignment: Alignment.centerLeft,
constraints: BoxConstraints(minHeight: 384.w, minWidth: 686.w),
child: FixedCheckBox(
key:ValueKey(model.id),
onChanged: (isSelect) {
if (isSelect) {
_selected.add(model.id);
@ -170,7 +183,10 @@ class _FixedSubmitPageState extends State<FixedSubmitPage> {
}
setState(() {});
},
));
),
// child: BeeRadio(value: model.id, groupValues: _selected),
// ),
);
}
Widget _showDeletDialog() {
@ -246,8 +262,8 @@ class _FixedSubmitPageState extends State<FixedSubmitPage> {
},
).expand(),
MaterialButton(
disabledColor: kDarkSubColor,
disabledTextColor: ktextSubColor,
disabledColor: Colors.white.withOpacity(0.5),
disabledTextColor: ktextSubColor.withOpacity(0.8),
textColor: ktextPrimary,
onPressed: _isEdit
? _selected.isEmpty

@ -2,6 +2,7 @@
import 'dart:io';
// Flutter imports:
import 'package:akuCommunity/pages/life_pay/widget/my_house_page.dart';
import 'package:akuCommunity/utils/bee_parse.dart';
import 'package:akuCommunity/widget/buttons/bottom_button.dart';
import 'package:flutter/cupertino.dart';
@ -65,7 +66,9 @@ class _AddFixedSubmitPageState extends State<AddFixedSubmitPage> {
'报修房屋'.text.black.size(28.sp).make(),
32.w.heightBox,
GestureDetector(
onTap: () {},
onTap: () {
MyHousePage().to();
},
child: Row(
children: [
Image.asset(
@ -84,10 +87,10 @@ class _AddFixedSubmitPageState extends State<AddFixedSubmitPage> {
],
),
),
// Icon(
// CupertinoIcons.chevron_forward,
// size: 40.w,
// ),
Icon(
CupertinoIcons.chevron_forward,
size: 40.w,
),
],
),
),

@ -17,6 +17,8 @@ class FixedCheckBox extends StatefulWidget {
class _FixedCheckBoxState extends State<FixedCheckBox> {
bool _isSelected = false;
@override
Widget build(BuildContext context) {
return GestureDetector(
@ -28,6 +30,7 @@ class _FixedCheckBoxState extends State<FixedCheckBox> {
},
child: AnimatedContainer(
duration: Duration(milliseconds: 300),
curve: Curves.easeInOutCubic,
alignment: Alignment.center,
width: 40.w,
height: 40.w,
@ -39,11 +42,12 @@ class _FixedCheckBoxState extends State<FixedCheckBox> {
),
child: AnimatedContainer(
duration: Duration(milliseconds: 300),
curve: Curves.easeInOutCubic,
width: 24.w,
height: 24.w,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(24.w),
color: _isSelected ? kPrimaryColor : Colors.transparent,
color: kPrimaryColor.withOpacity(_isSelected?1:0)
),
),
),

@ -31,6 +31,7 @@ class UserProvider extends ChangeNotifier {
HiveStore.appBox.put('login', true);
await updateProfile();
await updateUserDetail();
await setCurrentHouse(_userDetailModel?.estateNames?.first??'');
notifyListeners();
}
@ -133,4 +134,12 @@ class UserProvider extends ChangeNotifier {
await updateProfile();
}
}
///
String _currentHouse;
String get currentHouse => _currentHouse;
setCurrentHouse(String house) {
_currentHouse = house;
notifyListeners();
}
}

@ -32,8 +32,10 @@ class BeeMap {
2: '50kg-100kg',
3: '> 100kg',
};
Map<int,String> goodsOutApproach={
1:'自己搬运',
2:'搬家公司',
Map<int, String> goodsOutApproach = {
1: '自己搬运',
2: '搬家公司',
};
static Map<int, String> borrowStatus = {1: '出借中', 2: '已归还'};
}

@ -1,9 +1,28 @@
class BeeParse{
class BeeParse {
static int getEstateNameId(String estateName) {
int a = int.parse(estateName.split('|')[0]);
return a;
}
static String getEstateName(String estateNmae) {
return estateNmae.split('|')[1];
}
static String getCustomYears(int year) {
int dif = year - DateTime.now().year;
switch (dif) {
case -1:
return '去年';
break;
case 0:
return '今年';
case 1:
return '明年';
default:
if (dif < 0) return '${-dif}年前';
// } else {
return '$dif年后';
// }
}
}
}

@ -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) {
@ -27,13 +33,14 @@ class _BeeCheckBoxState extends State<BeeCheckBox> {
child: AnimatedContainer(
duration: Duration(milliseconds: 300),
decoration: BoxDecoration(
border: Border.all(
width: 1.w, color: _isSelect ? kPrimaryColor : kDarkSubColor),
color: _isSelect ? kPrimaryColor : Colors.transparent,
),
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