对接 查询可选房屋列表

hmxc
张萌 3 years ago
parent d3843c9e5e
commit 709c178c2a

@ -0,0 +1,65 @@
import 'package:equatable/equatable.dart';
import 'package:json_annotation/json_annotation.dart';
part 'lease_list_model.g.dart';
@JsonSerializable()
class LeaseListModel extends Equatable {
final int id;
final String roomName;
final int type;
final String estateType;
final int status;
LeaseListModel({
required this.id,
required this.roomName,
required this.type,
required this.estateType,
required this.status,
});
factory LeaseListModel.fromJson(Map<String, dynamic> json) =>
_$LeaseListModelFromJson(json);
@override
List<Object> get props {
return [
id,
roomName,
type,
estateType,
status,
];
}
String get getTypeString {
switch (this.type) {
case 1:
return '一类人才';
case 2:
return '二类人才';
case 3:
return '三类人才';
default:
return '未知';
}
}
String get statusString {
switch (this.status) {
case 1:
return '待签署';
case 2:
return '待提交';
case 3:
return '审核中';
case 4:
return '已驳回';
case 5:
return '待支付';
case 6:
return '已完成';
default:
return '未知';
}
}
}

@ -0,0 +1,17 @@
// GENERATED CODE - DO NOT MODIFY BY HAND
part of 'lease_list_model.dart';
// **************************************************************************
// JsonSerializableGenerator
// **************************************************************************
LeaseListModel _$LeaseListModelFromJson(Map<String, dynamic> json) {
return LeaseListModel(
id: json['id'] as int,
roomName: json['roomName'] as String,
type: json['type'] as int,
estateType: json['estateType'] as String,
status: json['status'] as int,
);
}

@ -31,6 +31,7 @@ class _NewRenovationViewState extends State<NewRenovationView>
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
super.build(context);
return BeeListView( return BeeListView(
path: API.manager.newRenovationList, path: API.manager.newRenovationList,
extraParams: { extraParams: {

@ -69,7 +69,6 @@ class _FeedBackPageState extends State<FeedBackPage> {
onTap: () async { onTap: () async {
if (_formKey.currentState!.validate()) { if (_formKey.currentState!.validate()) {
if (_files.isNotEmpty) { if (_files.isNotEmpty) {
//TODO upload file
} }
var cancelAction = BotToast.showLoading(); var cancelAction = BotToast.showLoading();
await NetUtil().post( await NetUtil().post(

@ -7,7 +7,7 @@ import 'package:aku_community/utils/network/net_util.dart';
class MyOrderFunc { class MyOrderFunc {
/// ///
static Future confirmReceive(int goodsAppointmentId) async { static Future confirmReceive(int goodsAppointmentId) async {
BaseModel baseModel = await NetUtil().get(API.market.confirmReceive, await NetUtil().get(API.market.confirmReceive,
params: {"goodsAppointmentId": goodsAppointmentId}, showMessage: true); params: {"goodsAppointmentId": goodsAppointmentId}, showMessage: true);
} }

@ -54,6 +54,7 @@ class HouseFunc {
} }
} }
Map<String, int> getSex = { Map<String, int> getSex = {
'': 1, '': 1,
'': 2, '': 2,

@ -1,6 +1,12 @@
import 'package:aku_community/base/base_style.dart'; import 'package:aku_community/base/base_style.dart';
import 'package:aku_community/const/resource.dart'; import 'package:aku_community/const/resource.dart';
import 'package:aku_community/constants/api.dart';
import 'package:aku_community/models/house/lease_list_model.dart';
import 'package:aku_community/pages/things_page/widget/bee_list_view.dart';
import 'package:aku_community/ui/profile/house/contract_pay_page.dart';
import 'package:aku_community/ui/profile/house/download_contract_page.dart';
import 'package:aku_community/ui/profile/house/supplement_information_page.dart'; import 'package:aku_community/ui/profile/house/supplement_information_page.dart';
import 'package:aku_community/ui/profile/house/upload_contracts_page.dart';
import 'package:aku_community/widget/bee_scaffold.dart'; import 'package:aku_community/widget/bee_scaffold.dart';
import 'package:aku_community/widget/buttons/card_bottom_button.dart'; import 'package:aku_community/widget/buttons/card_bottom_button.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
@ -35,21 +41,40 @@ class _TenantHouseListPageState extends State<TenantHouseListPage> {
Widget build(BuildContext context) { Widget build(BuildContext context) {
return BeeScaffold( return BeeScaffold(
title: '可选房屋', title: '可选房屋',
body: EasyRefresh( // body: EasyRefresh(
firstRefresh: true, // firstRefresh: true,
header: MaterialHeader(), // header: MaterialHeader(),
controller: _refreshController, // controller: _refreshController,
onRefresh: () async { // onRefresh: () async {
_onload = false; // _onload = false;
setState(() {}); // setState(() {});
}, // },
child: _onload // child: _onload
? Container() // ? Container()
: ListView( // : ListView(
// padding: EdgeInsets.symmetric(vertical: 24.w, horizontal: 32.w),
// children: [houseCard()],
// ),
// ),
body: BeeListView(
path: API.house.leaseList,
controller: _refreshController,
convert: (models) {
return models.tableList!
.map((e) => LeaseListModel.fromJson(e))
.toList();
},
builder: (items) {
return ListView.separated(
padding: EdgeInsets.symmetric(vertical: 24.w, horizontal: 32.w), padding: EdgeInsets.symmetric(vertical: 24.w, horizontal: 32.w),
children: [houseCard()], itemBuilder: (context, index) {
), return houseCard(items[index]);
), },
separatorBuilder: (_, __) {
return 24.w.heightBox;
},
itemCount: items.length);
}),
); );
} }
@ -65,30 +90,42 @@ class _TenantHouseListPageState extends State<TenantHouseListPage> {
Color(0xFFFFEEBB), Color(0xFFFFEEBB),
Color(0xFFFFF4D2), Color(0xFFFFF4D2),
]; ];
case 3:
return [
Color(0xFFFFEEBB),
Color(0xFFFFF4D2),
];
case 4:
return [
Color(0xFFFFEEBB),
Color(0xFFFFF4D2),
];
case 5:
return [
Color(0xFFFFEEBB),
Color(0xFFFFF4D2),
];
case 6:
return [
Color(0xFFFFEEBB),
Color(0xFFFFF4D2),
];
default: default:
return [Colors.white, Colors.white]; return [Colors.white, Colors.white];
} }
} }
Widget houseCard() { Widget houseCard(LeaseListModel model) {
var buttons = Row( var buttons = getButtons(model.status);
children: [
CardBottomButton.yellow(
text: '填写信息',
onPressed: () {
Get.to(() => SupplementInformationPage());
})
],
);
var bottom = Row( var bottom = Row(
children: [ children: [
Column( Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.end, mainAxisAlignment: MainAxisAlignment.end,
children: [ children: [
'二类人才'.text.size(28.sp).color(ktextSubColor).make(), model.getTypeString.text.size(28.sp).color(ktextSubColor).make(),
8.w.heightBox, 8.w.heightBox,
'B座C1户型'.text.size(28.sp).color(ktextSubColor).make(), model.estateType.text.size(28.sp).color(ktextSubColor).make(),
], ],
).expand(), ).expand(),
buttons buttons
@ -116,14 +153,17 @@ class _TenantHouseListPageState extends State<TenantHouseListPage> {
), ),
16.w.widthBox, 16.w.widthBox,
'南宁金融人才公寓'.text.size(32.sp).color(ktextPrimary).make().expand(), '南宁金融人才公寓'.text.size(32.sp).color(ktextPrimary).make().expand(),
'待签署'.text.size(32.sp).color(ktextPrimary).bold.make(), model.statusString.text
.size(32.sp)
.color(ktextPrimary)
.bold
.make(),
], ],
), ),
12.w.heightBox, 12.w.heightBox,
Row( Row(
children: [ children: [
'1幢-1单元-702室' model.roomName.text
.text
.size(40.sp) .size(40.sp)
.color(ktextPrimary) .color(ktextPrimary)
.bold .bold
@ -137,4 +177,76 @@ class _TenantHouseListPageState extends State<TenantHouseListPage> {
), ),
); );
} }
Row getButtons(int status) {
switch (status) {
case 1:
return Row(
children: [
CardBottomButton.yellow(
text: '填写信息',
onPressed: () {
Get.to(() => SupplementInformationPage());
})
],
);
case 2:
return Row(
children: [
CardBottomButton.yellow(
text: '上传合同',
onPressed: () {
Get.to(() => UploadContractsPage());
}),
CardBottomButton.white(
text: '下载合同',
onPressed: () {
Get.to(() => DownLoadContractPage(firstRoute: false));
}),
],
);
case 3:
return Row(
children: [],
);
case 4:
return Row(
children: [
CardBottomButton.yellow(
text: '重新上传',
onPressed: () {
Get.to(() => UploadContractsPage());
}),
CardBottomButton.white(
text: '修改信息',
onPressed: () {
Get.to(() => SupplementInformationPage());
}),
],
);
case 5:
return Row(
children: [
CardBottomButton.yellow(
text: '去支付',
onPressed: () {
Get.to(() => ContractPayPage());
})
],
);
case 6:
return Row(
children: [
CardBottomButton.yellow(
text: '租户页面',
onPressed: () {
Get.back();
})
],
);
default:
return Row();
}
}
} }

@ -233,8 +233,9 @@ class _UserIdentifyPageState extends State<UserIdentifyPage> {
'返回'.text.size(34.sp).isIntrinsic.color(ktextPrimary).make()), '返回'.text.size(34.sp).isIntrinsic.color(ktextPrimary).make()),
CupertinoDialogAction( CupertinoDialogAction(
onPressed: () { onPressed: () {
Get.back(); // Get.back();
Get.back(); // Get.back();
Get.to(() => TenantHouseListPage());
}, },
child: '回到首页' child: '回到首页'
.text .text

Loading…
Cancel
Save