选择房屋 添加选择单元步骤

hmxc
张萌 3 years ago
parent d0d99dd4dc
commit b4ff8f9432

@ -9,6 +9,7 @@ class API {
static String get resource => '$host/static';
static String image(String? path) => '$resource$path';
static String file(String? path) => '$resource$path';
static const int networkTimeOut = 10000;
@ -36,7 +37,10 @@ class _Login {
String get buildingInfo => '/login/findAllBuildingIAN';
///ID
String get unitInfo => '/login/findEstateIANByBuilding';
String get unitInfo => '/login/findUnitByBuildingId';
///
String get room => '/login/findEstateIdByUnitId';
/// app
String get signUp => '/login/register';

@ -1,12 +1,3 @@
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:bot_toast/bot_toast.dart';
import 'package:flutter_localizations/flutter_localizations.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:get/get.dart';
import 'package:provider/provider.dart';
import 'package:aku_community/constants/app_theme.dart';
import 'package:aku_community/main_initialize.dart';
import 'package:aku_community/pages/splash/splash_page.dart';
@ -15,6 +6,15 @@ import 'package:aku_community/provider/sign_up_provider.dart';
import 'package:aku_community/provider/user_provider.dart';
import 'package:aku_community/utils/developer_util.dart';
import 'package:aku_community/utils/headers.dart';
import 'package:bot_toast/bot_toast.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter_localizations/flutter_localizations.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:get/get.dart';
import 'package:jpush_flutter/jpush_flutter.dart';
import 'package:power_logger/power_logger.dart';
import 'package:provider/provider.dart';
void main() async {
const buildType = const String.fromEnvironment('BUILD_TYPE');
@ -27,7 +27,10 @@ void main() async {
await MainInitialize.initJPush();
MainInitialize.initWechat();
MainInitialize.initWebSocket();
String? rID;
JPush().getRegistrationID().then((value) => rID = value);
print('jpush registrationID is $rID');
LoggerData.addData(rID, tag: 'RegistrationID');
runApp(MyApp());
}

@ -1,25 +1,23 @@
import 'dart:io';
import 'package:aku_community/constants/app_theme.dart';
import 'package:aku_community/constants/config.dart';
import 'package:aku_community/provider/app_provider.dart';
import 'package:aku_community/utils/message_parser.dart';
import 'package:aku_community/utils/websocket/fire_dialog.dart';
import 'package:aku_community/utils/websocket/web_socket_util.dart';
import 'package:firebase_core/firebase_core.dart';
import 'package:firebase_crashlytics/firebase_crashlytics.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:firebase_core/firebase_core.dart';
import 'package:firebase_crashlytics/firebase_crashlytics.dart';
import 'package:fluwx/fluwx.dart';
import 'package:get/get.dart';
import 'package:jpush_flutter/jpush_flutter.dart';
import 'package:power_logger/power_logger.dart';
import 'package:provider/provider.dart';
import 'package:aku_community/constants/app_theme.dart';
import 'package:aku_community/constants/config.dart';
import 'package:aku_community/provider/app_provider.dart';
import 'package:aku_community/utils/message_parser.dart';
import 'package:aku_community/utils/websocket/fire_dialog.dart';
import 'package:aku_community/utils/websocket/web_socket_util.dart';
class MainInitialize {
///firebase
static Future initFirebase() async {
@ -73,10 +71,6 @@ class MainInitialize {
debug: true,
);
// jpush.applyPushAuthority();
String? rID;
jpush.getRegistrationID().then((value) => rID = value);
print('jpush registrationID is $rID');
LoggerData.addData(rID, tag: 'RegistrationID');
}
static initWechat() {

@ -1,8 +1,3 @@
import 'package:bot_toast/bot_toast.dart';
import 'package:dio/dio.dart';
import 'package:get/get.dart' hide Response;
import 'package:provider/provider.dart';
import 'package:aku_community/constants/api.dart';
import 'package:aku_community/model/user/pick_building_model.dart';
import 'package:aku_community/model/user/user_detail_model.dart';
@ -11,6 +6,10 @@ import 'package:aku_community/provider/sign_up_provider.dart';
import 'package:aku_community/provider/user_provider.dart';
import 'package:aku_community/utils/network/base_model.dart';
import 'package:aku_community/utils/network/net_util.dart';
import 'package:bot_toast/bot_toast.dart';
import 'package:dio/dio.dart';
import 'package:get/get.dart' hide Response;
import 'package:provider/provider.dart';
class SignFunc {
static Future sendMessageCode(String phone) async {
@ -39,6 +38,7 @@ class SignFunc {
return response;
}
///
static Future<List<PickBuildingModel>> getBuildingInfo() async {
BaseModel model = await NetUtil().get(API.login.buildingInfo);
return (model.data as List)
@ -46,6 +46,7 @@ class SignFunc {
.toList();
}
///
static Future<List<PickBuildingModel>> getUnitInfo(int? id) async {
BaseModel model = await NetUtil().get(
API.login.unitInfo,
@ -56,6 +57,17 @@ class SignFunc {
.toList();
}
///
static Future<List<PickBuildingModel>> getRoom(int? id) async {
BaseModel model = await NetUtil().get(
API.login.room,
params: {"unitId": id},
);
return (model.data as List)
.map((e) => PickBuildingModel.fromJson(e))
.toList();
}
///
static Future<bool> signUp() async {
final signUpProvider =

@ -1,11 +1,3 @@
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:bot_toast/bot_toast.dart';
import 'package:flustars/flustars.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:get/get.dart';
import 'package:aku_community/constants/api.dart';
import 'package:aku_community/ui/profile/house/house_item.dart';
import 'package:aku_community/ui/profile/house/pick_building_page.dart';
@ -14,6 +6,12 @@ import 'package:aku_community/utils/headers.dart';
import 'package:aku_community/utils/network/base_model.dart';
import 'package:aku_community/utils/network/net_util.dart';
import 'package:aku_community/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';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:get/get.dart';
class AddHousePage extends StatefulWidget {
AddHousePage({Key? key}) : super(key: key);
@ -37,6 +35,7 @@ class _AddHousePageState extends State<AddHousePage> {
);
TextStyle get _textStyle => _hintStyle.copyWith(color: Color(0xFF333333));
//
bool get _rentCheck => _roleType != 3 ? true : _range != null;
@ -47,6 +46,7 @@ class _AddHousePageState extends State<AddHousePage> {
_item != null &&
_roleType != null &&
_rentCheck;
_renderTile({
required String title,
Widget? item,
@ -263,7 +263,7 @@ class _AddHousePageState extends State<AddHousePage> {
_identifyHouse() async {
Map<String, dynamic> params = {
'estateId': _item!.house.value,
'estateId': _item!.room.value,
'name': _nameController.text,
'type': _roleType,
'idType': 1,

@ -2,13 +2,16 @@ import 'package:aku_community/model/user/pick_building_model.dart';
class HouseItem {
PickBuildingModel building;
PickBuildingModel house;
PickBuildingModel unit;
PickBuildingModel room;
HouseItem({
required this.building,
required this.house,
required this.unit,
required this.room,
});
int? get houseCode => house.value;
int? get houseCode => room.value;
String get houseName => '${building.label}-${house.label}';
String get houseName => '${building.label}-${unit.label}单元-${room.label}';
}

@ -1,13 +1,3 @@
import 'package:flutter/material.dart';
import 'package:bot_toast/bot_toast.dart';
import 'package:flustars/flustars.dart';
import 'package:flutter_easyrefresh/easy_refresh.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:get/get.dart';
import 'package:power_logger/power_logger.dart';
import 'package:provider/provider.dart';
import 'package:aku_community/base/base_style.dart';
import 'package:aku_community/const/resource.dart';
import 'package:aku_community/models/house/lease_detail_model.dart';
@ -25,11 +15,19 @@ import 'package:aku_community/ui/profile/house/lease_relevation/tenant_house_lis
import 'package:aku_community/ui/profile/house/my_house_list.dart';
import 'package:aku_community/utils/headers.dart';
import 'package:aku_community/widget/bee_scaffold.dart';
import 'package:aku_community/widget/buttons/bottom_button.dart';
import 'package:aku_community/widget/others/user_tool.dart';
import 'package:bot_toast/bot_toast.dart';
import 'package:flustars/flustars.dart';
import 'package:flutter/material.dart';
import 'package:flutter_easyrefresh/easy_refresh.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:get/get.dart';
import 'package:power_logger/power_logger.dart';
import 'package:provider/provider.dart';
class HouseOwnersPage extends StatefulWidget {
final int identify;
HouseOwnersPage({Key? key, required this.identify}) : super(key: key);
@override
@ -129,7 +127,7 @@ class _HouseOwnersPageState extends State<HouseOwnersPage> {
? Get.to(() => MyHouseList())
: Get.to(() => TenantHouseListPage());
},
child: Text(isOwner ? '审核记录' : '我的选房'),
child: Text('审核记录'),
),
],
body: isTourist
@ -183,9 +181,9 @@ class _HouseOwnersPageState extends State<HouseOwnersPage> {
],
),
),
bottomNavi: BottomButton(
onPressed: _addHouse,
child: '新增房屋'.text.size(32.sp).color(ktextPrimary).bold.make()),
// bottomNavi: BottomButton(
// onPressed: _addHouse,
// child: '新增房屋'.text.size(32.sp).color(ktextPrimary).bold.make()),
);
}
@ -212,8 +210,16 @@ class _HouseOwnersPageState extends State<HouseOwnersPage> {
id: UserTool.appProveider.selectedHouse!.sysLeaseId!,
));
}),
_cardBuild(R.ASSETS_ICONS_CHANGE_PNG, '合同变更', '变更合同信息、重新签约', () {}),
_cardBuild(R.ASSETS_ICONS_CONTRACT_PNG, '合同续签', '到期前线上办理续签手续', () {}),
_cardBuild(R.ASSETS_ICONS_CHANGE_PNG, '合同变更', '变更合同信息、重新签约', () {
Get.to(() => TenantHouseListPage(
leaseId: -UserTool.appProveider.selectedHouse!.sysLeaseId!,
));
}),
_cardBuild(R.ASSETS_ICONS_CONTRACT_PNG, '合同续签', '到期前线上办理续签手续', () {
Get.to(() => TenantHouseListPage(
leaseId: UserTool.appProveider.selectedHouse!.sysLeaseId!,
));
}),
_cardBuild(R.ASSETS_ICONS_FINISH_PNG, '合同终止', '线上申请终止合同', () async {
await stopContract();
})

@ -1,17 +1,16 @@
import 'package:flutter/material.dart';
import 'package:flutter_easyrefresh/easy_refresh.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:velocity_x/velocity_x.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/lease_relevation/lease_house_card.dart';
import 'package:aku_community/widget/bee_scaffold.dart';
import 'package:flutter/material.dart';
import 'package:flutter_easyrefresh/easy_refresh.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:velocity_x/velocity_x.dart';
class TenantHouseListPage extends StatefulWidget {
TenantHouseListPage({Key? key}) : super(key: key);
final int leaseId;
TenantHouseListPage({Key? key, this.leaseId = 0}) : super(key: key);
@override
_TenantHouseListPageState createState() => _TenantHouseListPageState();
@ -38,6 +37,7 @@ class _TenantHouseListPageState extends State<TenantHouseListPage> {
body: BeeListView(
path: API.house.leaseList,
controller: _refreshController,
extraParams: {'leaseParentId': widget.leaseId},
convert: (models) {
return models.tableList!
.map((e) => LeaseListModel.fromJson(e))

@ -1,14 +1,12 @@
import 'package:flutter/material.dart';
import 'package:flutter_easyrefresh/easy_refresh.dart';
import 'package:get/get.dart';
import 'package:velocity_x/velocity_x.dart';
import 'package:aku_community/model/user/pick_building_model.dart';
import 'package:aku_community/pages/sign/sign_func.dart';
import 'package:aku_community/ui/profile/house/house_item.dart';
import 'package:aku_community/ui/profile/house/pick_unit_page.dart';
import 'package:aku_community/widget/bee_scaffold.dart';
import 'package:flutter/material.dart';
import 'package:flutter_easyrefresh/easy_refresh.dart';
import 'package:get/get.dart';
import 'package:velocity_x/velocity_x.dart';
class PickBuildingPage extends StatefulWidget {
PickBuildingPage({Key? key}) : super(key: key);
@ -23,10 +21,11 @@ class _PickBuildingPageState extends State<PickBuildingPage> {
return ListTile(
title: model.label!.text.make(),
onTap: () async {
PickBuildingModel? houseModel =
List<PickBuildingModel?> houseModels =
await Get.to(() => PickUnitPage(buildingId: model.value));
if (houseModel != null) {
HouseItem item = HouseItem(building: model, house: houseModel);
if (houseModels.isNotEmpty) {
HouseItem item = HouseItem(
building: model, unit: houseModels[0]!, room: houseModels[1]!);
Get.back(result: item);
}
},

@ -0,0 +1,48 @@
import 'package:aku_community/model/user/pick_building_model.dart';
import 'package:aku_community/pages/sign/sign_func.dart';
import 'package:aku_community/widget/bee_scaffold.dart';
import 'package:flutter/material.dart';
import 'package:flutter_easyrefresh/easy_refresh.dart';
import 'package:get/get.dart';
import 'package:velocity_x/velocity_x.dart';
class PickRoomPage extends StatefulWidget {
final int unitId;
const PickRoomPage({Key? key, required this.unitId}) : super(key: key);
@override
_PickRoomPageState createState() => _PickRoomPageState();
}
class _PickRoomPageState extends State<PickRoomPage> {
List<PickBuildingModel> _buildingModels = [];
@override
Widget build(BuildContext context) {
return BeeScaffold(
title: '选择房间',
body: EasyRefresh(
header: MaterialHeader(),
firstRefresh: true,
onRefresh: () async {
_buildingModels = await SignFunc.getRoom(widget.unitId);
setState(() {});
},
child: ListView.builder(
itemBuilder: (context, index) {
return _buildItem(_buildingModels[index]);
},
itemCount: _buildingModels.length,
),
),
);
}
_buildItem(PickBuildingModel model) {
return ListTile(
title: model.label!.text.make(),
onTap: () async {
Get.back(result: model);
},
).material(color: Colors.white);
}
}

@ -1,15 +1,15 @@
import 'package:aku_community/model/user/pick_building_model.dart';
import 'package:aku_community/pages/sign/sign_func.dart';
import 'package:aku_community/ui/profile/house/pick_room_page.dart';
import 'package:aku_community/widget/bee_scaffold.dart';
import 'package:flutter/material.dart';
import 'package:flutter_easyrefresh/easy_refresh.dart';
import 'package:get/get.dart';
import 'package:velocity_x/velocity_x.dart';
import 'package:aku_community/model/user/pick_building_model.dart';
import 'package:aku_community/pages/sign/sign_func.dart';
import 'package:aku_community/widget/bee_scaffold.dart';
class PickUnitPage extends StatefulWidget {
final int? buildingId;
PickUnitPage({Key? key, this.buildingId}) : super(key: key);
@override
@ -18,11 +18,16 @@ class PickUnitPage extends StatefulWidget {
class _PickUnitPageState extends State<PickUnitPage> {
List<PickBuildingModel> _buildingModels = [];
_buildItem(PickBuildingModel model) {
return ListTile(
title: model.label!.text.make(),
onTap: () {
Get.back(result: model);
onTap: () async {
PickBuildingModel? houseModel =
await Get.to(() => PickRoomPage(unitId: model.value!));
if (houseModel != null) {
Get.back(result: [model, houseModel]);
}
},
).material(color: Colors.white);
}
@ -30,7 +35,7 @@ class _PickUnitPageState extends State<PickUnitPage> {
@override
Widget build(BuildContext context) {
return BeeScaffold(
title: '选择楼栋',
title: '选择单元',
body: EasyRefresh(
header: MaterialHeader(),
firstRefresh: true,

Loading…
Cancel
Save