* '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 animatehmxc
commit
869718a329
@ -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;
|
||||
}
|
||||
}
|
@ -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;
|
||||
}
|
||||
}
|
@ -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()),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
@ -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年后';
|
||||
// }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in new issue