获取房屋列表

hmxc
小赖 4 years ago
parent 0ea1f6cee5
commit 33c5cb4299

@ -66,6 +66,12 @@ class _User {
///app
String get feedback => '/user/feedback/submit';
///()
String get authHouse => '/user/myHouse/authentication';
///
String get houseList => '/user/myHouse/list';
}
class _Manager {

@ -12,6 +12,7 @@ import 'package:akuCommunity/utils/headers.dart';
import 'package:akuCommunity/widget/bee_divider.dart';
import 'package:akuCommunity/widget/bee_scaffold.dart';
@Deprecated("my_house_page need to be cleaned.")
class MyHousePage extends StatefulWidget {
final bool needFindPayTag;
MyHousePage({Key key, this.needFindPayTag = false}) : super(key: key);

@ -1,7 +1,11 @@
import 'package:akuCommunity/constants/api.dart';
import 'package:akuCommunity/ui/profile/house/house_item.dart';
import 'package:akuCommunity/ui/profile/house/pick_building_page.dart';
import 'package:akuCommunity/ui/profile/house/pick_role_page.dart';
import 'package:akuCommunity/utils/network/base_model.dart';
import 'package:akuCommunity/utils/network/net_util.dart';
import 'package:akuCommunity/widget/bee_scaffold.dart';
import 'package:bot_toast/bot_toast.dart';
import 'package:flustars/flustars.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
@ -240,7 +244,9 @@ class _AddHousePageState extends State<AddHousePage> {
child: Text('提交审核'),
onPressed: _buttonCanTap
? () {
if (_formKey.currentState.validate()) {}
if (_formKey.currentState.validate()) {
_identifyHouse();
}
}
: null,
style: ButtonStyle(
@ -250,4 +256,32 @@ class _AddHousePageState extends State<AddHousePage> {
),
);
}
_identifyHouse() async {
Map<String, dynamic> params = {
'estateId': _item.house.value,
'name': _nameController.text,
'type': _roleType,
'idType': 1,
'idNumber': _idController.text,
};
if (_roleType == 3) {
params.putIfAbsent(
'effectiveTimeStart',
() => DateUtil.formatDate(_range.start, format: 'yyyy-MM-dd HH:mm'),
);
params.putIfAbsent(
'effectiveTimeEnd',
() => DateUtil.formatDate(_range.end, format: 'yyyy-MM-dd HH:mm'),
);
}
VoidCallback cancel = BotToast.showLoading();
await NetUtil().post(
API.user.authHouse,
params: params,
showMessage: true,
);
cancel();
Get.back();
}
}

@ -1,7 +1,11 @@
import 'package:akuCommunity/constants/api.dart';
import 'package:akuCommunity/ui/profile/house/add_house_page.dart';
import 'package:akuCommunity/utils/network/base_list_model.dart';
import 'package:akuCommunity/utils/network/net_util.dart';
import 'package:akuCommunity/widget/bee_scaffold.dart';
import 'package:flutter/material.dart';
import 'package:akuCommunity/const/resource.dart';
import 'package:flutter_easyrefresh/easy_refresh.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:get/get.dart';
@ -13,22 +17,37 @@ class HouseOwnersPage extends StatefulWidget {
}
class _HouseOwnersPageState extends State<HouseOwnersPage> {
EasyRefreshController _refreshController = EasyRefreshController();
@override
Widget build(BuildContext context) {
final media = MediaQuery.of(context);
return BeeScaffold(
title: '我的房屋',
body: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Padding(
padding: EdgeInsets.symmetric(horizontal: 75.w),
child: Image.asset(R.ASSETS_STATIC_REVIEWING_WEBP),
),
ElevatedButton(
onPressed: _addHouse,
child: Text('添加房屋'),
actions: [],
body: EasyRefresh(
header: MaterialHeader(),
controller: _refreshController,
firstRefresh: true,
onRefresh: () async {
await _getFirstHouse();
},
child: SizedBox(
height: media.size.height - media.padding.top - 56,
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Padding(
padding: EdgeInsets.symmetric(horizontal: 75.w),
child: Image.asset(R.ASSETS_STATIC_REVIEWING_WEBP),
),
ElevatedButton(
onPressed: _addHouse,
child: Text('添加房屋'),
),
],
),
],
),
),
);
}
@ -36,4 +55,12 @@ class _HouseOwnersPageState extends State<HouseOwnersPage> {
_addHouse() async {
await Get.to(() => AddHousePage());
}
Future _getFirstHouse() async {
BaseListModel model = await NetUtil().getList(
API.user.houseList,
params: {'pageNum': 1, 'size': 1},
);
print(model.tableList);
}
}

Loading…
Cancel
Save