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

4
.gitignore vendored

@ -58,4 +58,6 @@ coverage/
!**/ios/**/default.mode2v3 !**/ios/**/default.mode2v3
!**/ios/**/default.pbxuser !**/ios/**/default.pbxuser
!**/ios/**/default.perspectivev3 !**/ios/**/default.perspectivev3
!/packages/flutter_tools/test/data/dart_dependencies_test/**/.packages !/packages/flutter_tools/test/data/dart_dependencies_test/**/.packages
commit.csv
.~lock.commit.csv#

@ -130,6 +130,18 @@ class _Manager {
///app ///app
String get articleOutDelete => '/user/articleOut/falseDelete'; 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 { 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 approach;
int status; int status;
String movingCompanyTel; String movingCompanyTel;
List<ImgUrl> imgUrl;
GoodsOutModel( GoodsOutModel(
{this.id, {this.id,
@ -14,7 +15,8 @@ class GoodsOutModel {
this.expectedTime, this.expectedTime,
this.approach, this.approach,
this.status, this.status,
this.movingCompanyTel}); this.movingCompanyTel,
this.imgUrl});
GoodsOutModel.fromJson(Map<String, dynamic> json) { GoodsOutModel.fromJson(Map<String, dynamic> json) {
id = json['id']; id = json['id'];
@ -24,6 +26,12 @@ class GoodsOutModel {
approach = json['approach']; approach = json['approach'];
status = json['status']; status = json['status'];
movingCompanyTel = json['movingCompanyTel']; 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() { Map<String, dynamic> toJson() {
@ -35,6 +43,37 @@ class GoodsOutModel {
data['approach'] = this.approach; data['approach'] = this.approach;
data['status'] = this.status; data['status'] = this.status;
data['movingCompanyTel'] = this.movingCompanyTel; 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; 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: // Flutter imports:
import 'package:akuCommunity/constants/api.dart'; import 'package:akuCommunity/constants/api.dart';
import 'package:akuCommunity/pages/goods_deto_page/select_move_company_page.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/pages/manager_func.dart';
import 'package:akuCommunity/utils/bee_parse.dart'; import 'package:akuCommunity/utils/bee_parse.dart';
import 'package:akuCommunity/utils/network/base_model.dart'; import 'package:akuCommunity/utils/network/base_model.dart';
@ -44,7 +45,8 @@ class _DetoCreatePageState extends State<DetoCreatePage> {
String _itemName; String _itemName;
DateTime _date; 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; int _selectWeight;
String _selectTel; String _selectTel;
List<String> _listWeight = [ List<String> _listWeight = [
@ -67,7 +69,7 @@ class _DetoCreatePageState extends State<DetoCreatePage> {
bool needMoveCompany = false; bool needMoveCompany = false;
Widget _houseAddress(String title, subtitle) { Widget _houseAddress(String subtitle) {
return Container( return Container(
padding: EdgeInsets.only(bottom: 24.w), padding: EdgeInsets.only(bottom: 24.w),
margin: EdgeInsets.only(bottom: 40.w), margin: EdgeInsets.only(bottom: 40.w),
@ -88,41 +90,51 @@ class _DetoCreatePageState extends State<DetoCreatePage> {
), ),
), ),
), ),
Row( GestureDetector(
mainAxisAlignment: MainAxisAlignment.start, onTap: () {
crossAxisAlignment: CrossAxisAlignment.center, MyHousePage().to();
children: [ },
Container( child: Row(
margin: EdgeInsets.only(right: 42.w), mainAxisAlignment: MainAxisAlignment.start,
child: Image.asset( crossAxisAlignment: CrossAxisAlignment.center,
R.ASSETS_IMAGES_HOUSE_ATTESTATION_PNG, children: [
height: 59.w, Container(
width: 59.w, margin: EdgeInsets.only(right: 42.w),
), child: Image.asset(
), R.ASSETS_IMAGES_HOUSE_ATTESTATION_PNG,
Column( height: 59.w,
crossAxisAlignment: CrossAxisAlignment.start, width: 59.w,
children: [
Text(
title,
style: TextStyle(
fontWeight: FontWeight.w600,
fontSize: 32.sp,
color: Color(0xff333333),
),
), ),
SizedBox(height: 10.w), ),
Text( Column(
subtitle, crossAxisAlignment: CrossAxisAlignment.start,
style: TextStyle( children: [
fontWeight: FontWeight.w600, Text(
fontSize: 32.sp, kEstateName,
color: Color(0xff333333), 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(() {}); setState(() {});
} }
Widget _getMovingCompany(String movingCompany) { Widget _getMovingCompany() {
return Container( return Container(
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
@ -350,12 +362,13 @@ class _DetoCreatePageState extends State<DetoCreatePage> {
InkWell( InkWell(
onTap: () async { onTap: () async {
_selectTel = await SelectMoveCompanyPage().to(); _selectTel = await SelectMoveCompanyPage().to();
setState(() {});
}, },
child: Padding( child: Padding(
padding: EdgeInsets.symmetric(vertical: 30.w), padding: EdgeInsets.symmetric(vertical: 30.w),
child: Row( child: Row(
children: [ children: [
(movingCompany.isEmptyOrNull ? '请选择搬家公司' : movingCompany) (_selectTel.isEmptyOrNull ? '请选择搬家公司' : _selectTel)
.text .text
.color(ktextSubColor) .color(ktextSubColor)
.size(36.sp) .size(36.sp)
@ -395,16 +408,9 @@ class _DetoCreatePageState extends State<DetoCreatePage> {
body: ListView( body: ListView(
padding: EdgeInsets.all(32.w), padding: EdgeInsets.all(32.w),
children: [ children: [
_houseAddress( _houseAddress(userProvider.currentHouse),
kEstateName,
userProvider.userDetailModel.estateNames.isEmpty
? ''
: BeeParse.getEstateName(
userProvider.userDetailModel.estateNames[0])),
_getWeight(), _getWeight(),
_itemPicker( _itemPicker('出户时间', datetime, () async {
'出户时间', datetime,
() async {
_date = await BeeDatePicker.timePicker(DateTime.now()); _date = await BeeDatePicker.timePicker(DateTime.now());
setState(() {}); setState(() {});
}), }),
@ -412,7 +418,7 @@ class _DetoCreatePageState extends State<DetoCreatePage> {
_showItmePicker(); _showItmePicker();
}), }),
_getApproach(), _getApproach(),
_selectApproach == 0 ? SizedBox() : _getMovingCompany(''), _selectApproach == 0 ? SizedBox() : _getMovingCompany(),
Container( Container(
margin: EdgeInsets.only(top: 54.w, bottom: 24.w), margin: EdgeInsets.only(top: 54.w, bottom: 24.w),
child: Text( child: Text(

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

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

@ -1,6 +1,12 @@
// Flutter imports: // 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/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_easyrefresh/easy_refresh.dart';
// Package imports: // Package imports:
import 'package:velocity_x/velocity_x.dart'; import 'package:velocity_x/velocity_x.dart';
@ -8,8 +14,7 @@ import 'package:velocity_x/velocity_x.dart';
// Project imports: // Project imports:
import 'package:akuCommunity/utils/headers.dart'; import 'package:akuCommunity/utils/headers.dart';
import 'package:akuCommunity/widget/bee_scaffold.dart'; import 'package:akuCommunity/widget/bee_scaffold.dart';
import 'package:akuCommunity/widget/bottom_button.dart'; import 'package:akuCommunity/const/resource.dart';
import 'package:akuCommunity/widget/cached_image_wrapper.dart';
class GoodsManagePage extends StatefulWidget { class GoodsManagePage extends StatefulWidget {
GoodsManagePage({Key key}) : super(key: key); GoodsManagePage({Key key}) : super(key: key);
@ -19,46 +24,9 @@ class GoodsManagePage extends StatefulWidget {
} }
class _GoodsManagePageState extends State<GoodsManagePage> { class _GoodsManagePageState extends State<GoodsManagePage> {
List<Map<String, dynamic>> _listGoods = [ EasyRefreshController _easyRefreshController;
{
'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
}
];
Container _goodsCard(String imagePath, title, int goodsNum) { Container _goodsCard(ArticleBorrowModel model) {
return Container( return Container(
margin: EdgeInsets.only( margin: EdgeInsets.only(
top: 20.w, top: 20.w,
@ -73,28 +41,28 @@ class _GoodsManagePageState extends State<GoodsManagePage> {
), ),
decoration: BoxDecoration( decoration: BoxDecoration(
color: Colors.white, color: Colors.white,
borderRadius: BorderRadius.all(Radius.circular(6)), borderRadius: BorderRadius.all(Radius.circular(6.w)),
), ),
child: Row( child: Row(
mainAxisAlignment: MainAxisAlignment.start, mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
Container( Container(
height: 120.w,
width: 160.w,
margin: EdgeInsets.only(right: 20.w), margin: EdgeInsets.only(right: 20.w),
child: ClipRRect( child: ClipRRect(
child: CachedImageWrapper( child: FadeInImage.assetNetwork(
url: imagePath, placeholder: R.ASSETS_IMAGES_LOGO_PNG,
width: 160.w, image: API.image(
height: 120.w, model.imgUrls.isEmpty ? '' : model.imgUrls.first.url))),
),
),
), ),
Column( Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.start, mainAxisAlignment: MainAxisAlignment.start,
children: [ children: [
Text( Text(
'物品名称:$title', '物品名称:${model.name}',
style: TextStyle( style: TextStyle(
fontSize: 28.sp, fontSize: 28.sp,
color: Color(0xff4a4b51), color: Color(0xff4a4b51),
@ -102,7 +70,7 @@ class _GoodsManagePageState extends State<GoodsManagePage> {
), ),
SizedBox(height: 20.w), SizedBox(height: 20.w),
Text( Text(
'数量剩余:$goodsNum', '数量剩余:${model.quantity}',
style: TextStyle( style: TextStyle(
fontSize: 24.sp, fontSize: 24.sp,
color: Color(0xff999999), color: Color(0xff999999),
@ -121,31 +89,36 @@ class _GoodsManagePageState extends State<GoodsManagePage> {
title: '借还管理', title: '借还管理',
actions: [ actions: [
InkWell( InkWell(
onTap: () {}, onTap: () {
MineGoodsPage().to();
},
child: Container( child: Container(
padding: EdgeInsets.fromLTRB(32.w, 28.w, 32.w, 20.w), padding: EdgeInsets.fromLTRB(32.w, 28.w, 32.w, 20.w),
alignment: Alignment.center, alignment: Alignment.center,
child: '我的借还物品'.text.black.size(28.sp).make())) child: '我的借还物品'.text.black.size(28.sp).make()))
], ],
body: Stack(
children: [ body: BeeListView(
Column( path: API.manager.articleBorrow,
children: _listGoods controller: _easyRefreshController,
.map((item) => _goodsCard( convert: (models) {
item['imagePath'], return models.tableList
item['title'], .map((e) => ArticleBorrowModel.fromJson(e))
item['goodsNum'], .toList();
)) },
.toList(), builder: (items) {
), return ListView.separated(
Positioned( itemBuilder: (context, index) {
bottom: 0, return _goodsCard(items[index]);
child: BottomButton( },
title: '扫一扫出借', separatorBuilder: (_, __) {
fun: () {}, return 16.w.heightBox;
), },
), itemCount: items.length);
], }),
bottomNavi: BottomButton(
child: '扫一扫出借'.text.black.size(32.sp).bold.make(),
onPressed: () {},
), ),
); );
} }

@ -1,9 +1,12 @@
// Flutter imports: // 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/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_easyrefresh/easy_refresh.dart';
// Package imports:
import 'package:pull_to_refresh/pull_to_refresh.dart';
// Project imports: // Project imports:
import 'package:akuCommunity/utils/headers.dart'; import 'package:akuCommunity/utils/headers.dart';
@ -17,81 +20,25 @@ class MineGoodsPage extends StatefulWidget {
} }
class _MineGoodsPageState extends State<MineGoodsPage> { class _MineGoodsPageState extends State<MineGoodsPage> {
List<Map<String, dynamic>> _listGoods = [ EasyRefreshController _controller;
{
'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);
@override @override
void initState() { void initState() {
super.initState(); super.initState();
} _controller = EasyRefreshController();
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();
} }
@override @override
void dispose() { void dispose() {
super.dispose(); super.dispose();
_refreshController.dispose(); _controller.dispose();
} }
InkWell _frmLoss() { InkWell _frmLoss(int id) {
return InkWell( return InkWell(
onTap: () {}, onTap: () async {
await ManagerFunc.fromLoss(id);
},
child: Container( child: Container(
width: 120.w, width: 120.w,
height: 44.w, height: 44.w,
@ -109,8 +56,15 @@ class _MineGoodsPageState extends State<MineGoodsPage> {
); );
} }
Container _goodsCard( String _getDatelength(int date) {
String title, borrowTime, timeLength, status, int goodsNum) { if (date >= 24) {
return '${date / 24}' + '${date % 24}';
} else {
return '$date';
}
}
Container _goodsCard(MineGoodsModel model) {
return Container( return Container(
margin: EdgeInsets.only( margin: EdgeInsets.only(
top: 20.w, top: 20.w,
@ -136,7 +90,7 @@ class _MineGoodsPageState extends State<MineGoodsPage> {
mainAxisAlignment: MainAxisAlignment.start, mainAxisAlignment: MainAxisAlignment.start,
children: [ children: [
Text( Text(
'物品名称:$title', '物品名称:${model.name}',
style: TextStyle( style: TextStyle(
fontSize: 28.sp, fontSize: 28.sp,
color: Color(0xff4a4b51), color: Color(0xff4a4b51),
@ -145,7 +99,7 @@ class _MineGoodsPageState extends State<MineGoodsPage> {
Container( Container(
margin: EdgeInsets.only(top: 16.w), margin: EdgeInsets.only(top: 16.w),
child: Text( child: Text(
'借还数量:$goodsNum', '借还数量:10',
style: TextStyle( style: TextStyle(
fontSize: 24.sp, fontSize: 24.sp,
color: Color(0xff333333), color: Color(0xff333333),
@ -155,7 +109,7 @@ class _MineGoodsPageState extends State<MineGoodsPage> {
Container( Container(
margin: EdgeInsets.only(top: 16.w), margin: EdgeInsets.only(top: 16.w),
child: Text( child: Text(
'借用时间: $borrowTime', '借用时间: ${model.beginDate}',
style: TextStyle( style: TextStyle(
fontSize: 24.sp, fontSize: 24.sp,
color: Color(0xff999999), color: Color(0xff999999),
@ -165,7 +119,7 @@ class _MineGoodsPageState extends State<MineGoodsPage> {
Container( Container(
margin: EdgeInsets.only(top: 16.w), margin: EdgeInsets.only(top: 16.w),
child: Text( child: Text(
'借用时长: $timeLength', '借用时长: ${_getDatelength(model.borrowDate)}',
style: TextStyle( style: TextStyle(
fontSize: 24.sp, fontSize: 24.sp,
color: Color(0xff999999), color: Color(0xff999999),
@ -178,23 +132,23 @@ class _MineGoodsPageState extends State<MineGoodsPage> {
mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [ children: [
Text( Text(
'借用状态: $status', '借用状态: ${BeeMap.borrowStatus}',
style: TextStyle( style: TextStyle(
fontSize: 24.sp, fontSize: 24.sp,
color: Color(0xff999999), color: Color(0xff999999),
), ),
), ),
_frmLoss(), _frmLoss(model.id),
], ],
), ),
), ),
SizedBox(height: 12.w), SizedBox(height: 12.w),
Divider(color: Color(0xfff9f9f9)), Divider(color: Color(0xfff9f9f9)),
status == '未还' model.borrowStatus == 1
? Container( ? Container(
margin: EdgeInsets.only(bottom: 9.w), margin: EdgeInsets.only(bottom: 9.w),
child: Text( child: Text(
'温馨提示:您的物品已借用$timeLength天,如果用完,请及时归还', '温馨提示:您的物品已借用${_getDatelength(model.borrowDate)},如果用完,请及时归还',
style: TextStyle( style: TextStyle(
fontSize: 22.sp, fontSize: 22.sp,
color: Color(0xff999999), color: Color(0xff999999),
@ -214,26 +168,42 @@ class _MineGoodsPageState extends State<MineGoodsPage> {
Widget build(BuildContext context) { Widget build(BuildContext context) {
return BeeScaffold( return BeeScaffold(
title: '我的借还物品', title: '我的借还物品',
body: RefreshConfiguration( // body: RefreshConfiguration(
child: SmartRefresher( // child: SmartRefresher(
controller: _refreshController, // controller: _refreshController,
header: WaterDropHeader(), // header: WaterDropHeader(),
footer: ClassicFooter(), // footer: ClassicFooter(),
onRefresh: _onRefresh, // onRefresh: _onRefresh,
onLoading: _onLoading, // onLoading: _onLoading,
enablePullUp: true, // enablePullUp: true,
child: ListView.builder( // child: ListView.builder(
itemBuilder: (BuildContext context, int index) => _goodsCard( // itemBuilder: (BuildContext context, int index) => _goodsCard(
_listGoods[index]['title'], // _listGoods[index]['title'],
_listGoods[index]['borrowTime'], // _listGoods[index]['borrowTime'],
_listGoods[index]['timeLength'], // _listGoods[index]['timeLength'],
_listGoods[index]['status'], // _listGoods[index]['status'],
_listGoods[index]['goodsNum'], // _listGoods[index]['goodsNum'],
), // ),
itemCount: _listGoods.length, // 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: // 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/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_easyrefresh/easy_refresh.dart';
import 'package:provider/provider.dart';
// Package imports: // Package imports:
import 'package:velocity_x/velocity_x.dart'; import 'package:velocity_x/velocity_x.dart';
// Project imports: // 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/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/utils/headers.dart';
import 'package:akuCommunity/widget/bee_scaffold.dart'; import 'package:akuCommunity/widget/bee_scaffold.dart';
import 'widget/order_card.dart';
import 'widget/submit_bar.dart';
class LifePayPage extends StatefulWidget { class LifePayPage extends StatefulWidget {
LifePayPage({Key key}) : super(key: key); LifePayPage({Key key}) : super(key: key);
@ -22,8 +30,142 @@ class LifePayPage extends StatefulWidget {
} }
class _LifePayPageState extends State<LifePayPage> { 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 @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
UserProvider userProvider = Provider.of<UserProvider>(context);
return BeeScaffold( return BeeScaffold(
title: '生活缴费', title: '生活缴费',
actions: [ actions: [
@ -38,44 +180,84 @@ class _LifePayPageState extends State<LifePayPage> {
), ),
), ),
], ],
body: Stack( body: BeeListView(
children: [ path: API.manager.dailyPaymentList,
ListView( controller: _controller,
padding: EdgeInsets.only(bottom: 130.w), convert: (model) {
children: [ return model.tableList
Container( .map((e) => LifePayMolde.fromJson(e))
margin: EdgeInsets.only( .toList();
top: 32.w, },
left: 32.w, builder: (items) {
right: 32.w, return Column(
), children: [
child: RichText( _buildHouseCard(
text: TextSpan( kEstateName,
style: userProvider.userDetailModel.estateNames.isEmpty
TextStyle(fontSize: 28.sp, color: Color(0xff666666)), ? ''
children: <InlineSpan>[ : BeeParse.getEstateName(
TextSpan( userProvider.userDetailModel.estateNames[0])),
text: '深圳华茂悦峰', 16.w.heightBox,
), Container(
TextSpan( padding: EdgeInsets.all(32.w),
text: '1幢-1单元-702室', width: double.infinity,
style: TextStyle(fontWeight: FontWeight.bold), 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() bottomNavi: Container(
..putMap('commentMap', {'title': '明细', 'isActions': false}), padding: EdgeInsets.fromLTRB(
).to), 32.w, 16.w, 32.w, 12.w + MediaQuery.of(context).padding.bottom),
], child: Row(
), children: [
Positioned( BeeCheckBox.round(
bottom: 0, onChange: (value) {},
child: SubmitBar(title: '去缴费'), 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: // Project imports:
import 'package:akuCommunity/base/base_style.dart'; 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'; import 'package:akuCommunity/utils/headers.dart';
class OrderCard extends StatefulWidget { class OrderCard extends StatefulWidget {
final Function fun; OrderCard({Key key,}) : super(key: key);
OrderCard({Key key,this.fun}) : super(key: key);
@override @override
_OrderCardState createState() => _OrderCardState(); _OrderCardState createState() => _OrderCardState();
} }
class _OrderCardState extends State<OrderCard> { class _OrderCardState extends State<OrderCard> {
Container _orderInfo() { Widget _orderInfo() {
return Container( return Container(
margin: EdgeInsets.only( margin: EdgeInsets.only(
top: 20.w, top: 20.w,
@ -77,11 +74,11 @@ class _OrderCardState extends State<OrderCard> {
); );
} }
InkWell _checkInfo(Function fun) { Widget _checkInfo() {
return InkWell( return InkWell(
onTap: (){ onTap: (){
LifePayInfoPage(bundle: Bundle() // LifePayInfoPage(bundle: Bundle()
..putMap('detailMap', {'title': '去年2019年'}),).to; // ..putMap('detailMap', {'title': '去年2019年'}),).to;
}, },
child: Container( child: Container(
margin: EdgeInsets.only(top: 20.w), margin: EdgeInsets.only(top: 20.w),
@ -115,7 +112,7 @@ class _OrderCardState extends State<OrderCard> {
padding: EdgeInsets.symmetric(horizontal: 32.w), padding: EdgeInsets.symmetric(horizontal: 32.w),
decoration: BoxDecoration( decoration: BoxDecoration(
color: Colors.white, color: Colors.white,
borderRadius: BorderRadius.all(Radius.circular(6)), borderRadius: BorderRadius.all(Radius.circular(8.w)),
), ),
child: InkWell( child: InkWell(
onTap: () {}, onTap: () {},
@ -132,8 +129,8 @@ class _OrderCardState extends State<OrderCard> {
mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisAlignment: MainAxisAlignment.spaceBetween,
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
_orderInfo(), // _orderInfo(),
_checkInfo(widget.fun), // _checkInfo(),
], ],
), ),
) )

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

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

@ -17,6 +17,8 @@ class FixedCheckBox extends StatefulWidget {
class _FixedCheckBoxState extends State<FixedCheckBox> { class _FixedCheckBoxState extends State<FixedCheckBox> {
bool _isSelected = false; bool _isSelected = false;
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return GestureDetector( return GestureDetector(
@ -28,6 +30,7 @@ class _FixedCheckBoxState extends State<FixedCheckBox> {
}, },
child: AnimatedContainer( child: AnimatedContainer(
duration: Duration(milliseconds: 300), duration: Duration(milliseconds: 300),
curve: Curves.easeInOutCubic,
alignment: Alignment.center, alignment: Alignment.center,
width: 40.w, width: 40.w,
height: 40.w, height: 40.w,
@ -39,11 +42,12 @@ class _FixedCheckBoxState extends State<FixedCheckBox> {
), ),
child: AnimatedContainer( child: AnimatedContainer(
duration: Duration(milliseconds: 300), duration: Duration(milliseconds: 300),
curve: Curves.easeInOutCubic,
width: 24.w, width: 24.w,
height: 24.w, height: 24.w,
decoration: BoxDecoration( decoration: BoxDecoration(
borderRadius: BorderRadius.circular(24.w), 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); HiveStore.appBox.put('login', true);
await updateProfile(); await updateProfile();
await updateUserDetail(); await updateUserDetail();
await setCurrentHouse(_userDetailModel?.estateNames?.first??'');
notifyListeners(); notifyListeners();
} }
@ -133,4 +134,12 @@ class UserProvider extends ChangeNotifier {
await updateProfile(); await updateProfile();
} }
} }
///
String _currentHouse;
String get currentHouse => _currentHouse;
setCurrentHouse(String house) {
_currentHouse = house;
notifyListeners();
}
} }

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

@ -1,9 +1,28 @@
class BeeParse{ class BeeParse {
static int getEstateNameId(String estateName) { static int getEstateNameId(String estateName) {
int a = int.parse(estateName.split('|')[0]); int a = int.parse(estateName.split('|')[0]);
return a; return a;
} }
static String getEstateName(String estateNmae) { static String getEstateName(String estateNmae) {
return estateNmae.split('|')[1]; 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 { class BeeCheckBox extends StatefulWidget {
final Function(bool) onChange; 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 @override
_BeeCheckBoxState createState() => _BeeCheckBoxState(); _BeeCheckBoxState createState() => _BeeCheckBoxState();
} }
class _BeeCheckBoxState extends State<BeeCheckBox> { class _BeeCheckBoxState extends State<BeeCheckBox> {
double get boxSize => widget.size ?? 28.w;
bool _isSelect = false; bool _isSelect = false;
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
@ -27,13 +33,14 @@ class _BeeCheckBoxState extends State<BeeCheckBox> {
child: AnimatedContainer( child: AnimatedContainer(
duration: Duration(milliseconds: 300), duration: Duration(milliseconds: 300),
decoration: BoxDecoration( decoration: BoxDecoration(
border: Border.all( border: Border.all(
width: 1.w, color: _isSelect ? kPrimaryColor : kDarkSubColor), width: 1.w, color: _isSelect ? kPrimaryColor : kDarkSubColor),
color: _isSelect ? kPrimaryColor : Colors.transparent, color: _isSelect ? kPrimaryColor : Colors.transparent,
), borderRadius:
BorderRadius.circular(widget.isRound ? boxSize / 2 : 0)),
curve: Curves.easeInOutCubic, curve: Curves.easeInOutCubic,
width: 28.w, width: boxSize,
height: 28.w, height: boxSize,
child: _isSelect child: _isSelect
? Icon( ? Icon(
CupertinoIcons.check_mark, CupertinoIcons.check_mark,

Loading…
Cancel
Save