添加 可选房屋列表页面

添加 补充信息页面
hmxc
张萌 3 years ago
parent 84bc9708d7
commit 38dcecbc30

@ -19,7 +19,7 @@ class HouseModel {
DateTime? get effectiveStartDate => DateUtil.getDateTime(effectiveTimeStart!); DateTime? get effectiveStartDate => DateUtil.getDateTime(effectiveTimeStart!);
DateTime? get effectiveEndDate => DateUtil.getDateTime(effectiveTimeEnd!); DateTime? get effectiveEndDate => DateUtil.getDateTime(effectiveTimeEnd!);
//TODO //
bool get reviewed => status == 4; bool get reviewed => status == 4;
String get typeValue { String get typeValue {
switch (type) { switch (type) {
@ -51,7 +51,7 @@ class HouseModel {
/// ///
/// ///
List<Color> get backgroundColor { List<Color> get backgroundColor {
//TODO
if (status != 4) if (status != 4)
return [ return [
Color(0xFFF5F5F5), Color(0xFFF5F5F5),

@ -50,7 +50,7 @@ class PassedHouseListModel extends Equatable {
/// ///
/// ///
List<Color> get backgroundColor { List<Color> get backgroundColor {
//TODO
// if (status != 4) // if (status != 4)
// return [ // return [
// Color(0xFFF5F5F5), // Color(0xFFF5F5F5),

@ -255,7 +255,7 @@ class _VotingDetailPageState extends State<VotingDetailPage> {
// .text // .text
// .color(Color(0xFF999999)) // .color(Color(0xFF999999))
// .size(32.sp) // .size(32.sp)
// .make(), //TODO: // .make(),
// 26.w.heightBox, // 26.w.heightBox,
..._model.appVoteCandidateVos! ..._model.appVoteCandidateVos!
.map((e) => _buildVoteCard(e)) .map((e) => _buildVoteCard(e))

@ -41,6 +41,7 @@ class _SplashPageState extends State<SplashPage> {
Future _initOp() async { Future _initOp() async {
//ensure call _originOp first. //ensure call _originOp first.
try {
await _originOp(); await _originOp();
final userProvider = Provider.of<UserProvider>(context, listen: false); final userProvider = Provider.of<UserProvider>(context, listen: false);
final appProvider = Provider.of<AppProvider>(context, listen: false); final appProvider = Provider.of<AppProvider>(context, listen: false);
@ -49,6 +50,9 @@ class _SplashPageState extends State<SplashPage> {
if (HiveStore.appBox!.get('login') ?? false) { if (HiveStore.appBox!.get('login') ?? false) {
await userProvider.setLogin(HiveStore.appBox!.get('token')); await userProvider.setLogin(HiveStore.appBox!.get('token'));
} }
} catch (e) {
LoggerData.addData(e);
}
} }
@override @override

@ -25,9 +25,14 @@ class UserProvider extends ChangeNotifier {
bool get isLogin => _isLogin; bool get isLogin => _isLogin;
bool get isNotLogin => !_isLogin; bool get isNotLogin => !_isLogin;
Future setLogin(int token) async { Future setLogin(int token) async {
try {
final appProvider = Provider.of<AppProvider>(Get.context!, listen: false); final appProvider = Provider.of<AppProvider>(Get.context!, listen: false);
_isLogin = true; _isLogin = true;
NetUtil().dio!.options.headers.putIfAbsent('App-Admin-Token', () => token); NetUtil()
.dio!
.options
.headers
.putIfAbsent('App-Admin-Token', () => token);
HiveStore.appBox!.put('token', token); HiveStore.appBox!.put('token', token);
HiveStore.appBox!.put('login', true); HiveStore.appBox!.put('login', true);
await updateProfile(); await updateProfile();
@ -36,6 +41,9 @@ class UserProvider extends ChangeNotifier {
WebSocketUtil().setUser(userInfoModel!.id.toString()); WebSocketUtil().setUser(userInfoModel!.id.toString());
WebSocketUtil().startWebSocket(); WebSocketUtil().startWebSocket();
notifyListeners(); notifyListeners();
} catch (e) {
LoggerData.addData(e);
}
} }
logout() { logout() {

@ -173,7 +173,7 @@ class _AddHousePageState extends State<AddHousePage> {
text: S.of(context)!.tempPlotName, text: S.of(context)!.tempPlotName,
hintText: '请选择小区', hintText: '请选择小区',
// //
// TODO //
// onTap: () { // onTap: () {
// Get.to(() => PickPlotPage()); // Get.to(() => PickPlotPage());
// }, // },

@ -1,6 +1,7 @@
import 'package:aku_community/base/base_style.dart'; import 'package:aku_community/base/base_style.dart';
import 'package:aku_community/ui/profile/house/identify_selection_page.dart'; import 'package:aku_community/ui/profile/house/identify_selection_page.dart';
import 'package:aku_community/ui/profile/house/my_house_list.dart'; import 'package:aku_community/ui/profile/house/my_house_list.dart';
import 'package:aku_community/ui/profile/house/tenant_house_list_page.dart';
import 'package:aku_community/widget/buttons/bottom_button.dart'; import 'package:aku_community/widget/buttons/bottom_button.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
@ -92,8 +93,9 @@ class _HouseOwnersPageState extends State<HouseOwnersPage> {
actions: [ actions: [
TextButton( TextButton(
onPressed: () { onPressed: () {
Get.to(() => MyHouseList()); isOwner
//TODO: ? Get.to(() => MyHouseList())
: Get.to(TenantHouseListPage());
}, },
child: Text(isOwner ? '审核记录' : '我的选房'), child: Text(isOwner ? '审核记录' : '我的选房'),
), ),

@ -0,0 +1,54 @@
import 'package:aku_community/widget/bee_scaffold.dart';
import 'package:aku_community/widget/others/bee_input_row.dart';
import 'package:flutter/material.dart';
class SupplementInformationPage extends StatefulWidget {
SupplementInformationPage({Key? key}) : super(key: key);
@override
_SupplementInformationPageState createState() =>
_SupplementInformationPageState();
}
class _SupplementInformationPageState extends State<SupplementInformationPage> {
TextEditingController _nameController = TextEditingController();
String _sex = '请选择性别';
TextEditingController _phoneController = TextEditingController();
TextEditingController _codeController = TextEditingController();
TextEditingController _emergencyContactController = TextEditingController();
TextEditingController _emergencyPhoneController = TextEditingController();
TextEditingController _addressController = TextEditingController();
TextEditingController _workUnitController = TextEditingController();
@override
void initState() {
super.initState();
}
@override
Widget build(BuildContext context) {
return BeeScaffold(
title: '补充个人信息',
bodyColor: Colors.white,
body: ListView(
children: [
BeeInputRow(
title: '承租人',
controller: _nameController,
hintText: '杨赟',
isRequire: true,
),
BeeInputRow.button(title: '性别', onPressed:(){} , hintText: _sex,isRequire: true,),
BeeInputRow(title: '手机号码', controller: _phoneController, hintText: '13742494159',isRequire: true,),
BeeInputRow(title: '身份证号', controller: _codeController, hintText: 'hintText',isRequire: true,),
BeeInputRow(title: '紧急联系人', controller: _emergencyContactController, hintText: 'hintText'),
BeeInputRow(title: '紧急联系人电话', controller: _emergencyPhoneController, hintText: 'hintText'),
BeeInputRow(title: '通讯地址(含诉讼送达地址)', controller: _addressController, hintText: 'hintText'),
BeeInputRow(title: '工作单位', controller: _workUnitController, hintText: 'hintText'),
],
),
);
}
}

@ -0,0 +1,132 @@
import 'package:aku_community/base/base_style.dart';
import 'package:aku_community/const/resource.dart';
import 'package:aku_community/widget/bee_scaffold.dart';
import 'package:aku_community/widget/buttons/card_bottom_button.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);
@override
_TenantHouseListPageState createState() => _TenantHouseListPageState();
}
class _TenantHouseListPageState extends State<TenantHouseListPage> {
bool _onload = true;
late EasyRefreshController _refreshController;
@override
void initState() {
_refreshController = EasyRefreshController();
super.initState();
}
@override
void dispose() {
_refreshController.dispose();
super.dispose();
}
@override
Widget build(BuildContext context) {
return BeeScaffold(
title: '可选房屋',
body: EasyRefresh(
firstRefresh: true,
header: MaterialHeader(),
controller: _refreshController,
onRefresh: () async {
_onload = false;
setState(() {});
},
child: _onload
? Container()
: ListView(
padding: EdgeInsets.symmetric(vertical: 24.w, horizontal: 32.w),
children: [houseCard()],
),
),
);
}
List<Color> _getColors(int type) {
switch (type) {
case 1:
return [
Color(0xFFFFE5D2),
Color(0xFFFFFFFF),
];
case 2:
return [
Color(0xFFFFEEBB),
Color(0xFFFFF4D2),
];
default:
return [Colors.white, Colors.white];
}
}
Widget houseCard() {
var buttons = Row(
children: [CardBottomButton.yellow(text: '填写信息', onPressed: () {})],
);
var bottom = Row(
children: [
Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.end,
children: [
'二类人才'.text.size(28.sp).color(ktextSubColor).make(),
8.w.heightBox,
'B座C1户型'.text.size(28.sp).color(ktextSubColor).make(),
],
).expand(),
buttons
],
);
return Container(
padding: EdgeInsets.symmetric(vertical: 24.w, horizontal: 32.w),
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(16.w),
gradient: LinearGradient(
colors: _getColors(1),
begin: Alignment.topLeft,
end: Alignment.bottomRight),
),
width: double.infinity,
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Row(
children: [
Image.asset(
R.ASSETS_IMAGES_PLACEHOLDER_WEBP,
width: 40.w,
height: 40.w,
),
16.w.widthBox,
'南宁金融人才公寓'.text.size(32.sp).color(ktextPrimary).make().expand(),
'待签署'.text.size(32.sp).color(ktextPrimary).bold.make(),
],
),
12.w.heightBox,
Row(
children: [
'1幢-1单元-702室'
.text
.size(40.sp)
.color(ktextPrimary)
.bold
.make()
.expand(),
],
),
56.w.heightBox,
bottom,
],
),
);
}
}

@ -1,4 +1,5 @@
import 'package:aku_community/base/base_style.dart'; import 'package:aku_community/base/base_style.dart';
import 'package:aku_community/ui/profile/house/tenant_house_list_page.dart';
import 'package:aku_community/widget/bee_scaffold.dart'; import 'package:aku_community/widget/bee_scaffold.dart';
import 'package:aku_community/widget/buttons/bottom_button.dart'; import 'package:aku_community/widget/buttons/bottom_button.dart';
import 'package:aku_community/widget/others/bee_input_row.dart'; import 'package:aku_community/widget/others/bee_input_row.dart';
@ -157,7 +158,7 @@ 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.off(()=>TenantHouseListPage());
}, },
child: '修改信息' child: '修改信息'
.text .text

@ -2,7 +2,7 @@ class BaseModel {
int? code; int? code;
String? message; String? message;
bool? status; bool? status;
dynamic? data; dynamic data;
BaseModel({ BaseModel({
this.code, this.code,
this.message, this.message,

@ -5,7 +5,7 @@ import 'package:aku_community/constants/app_theme.dart';
import 'package:aku_community/widget/bee_back_button.dart'; import 'package:aku_community/widget/bee_back_button.dart';
class BeeScaffold extends StatelessWidget { class BeeScaffold extends StatelessWidget {
final dynamic? title; final dynamic title;
final Widget? body; final Widget? body;
/// appbar background color /// appbar background color

@ -4,7 +4,7 @@ import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:velocity_x/velocity_x.dart'; import 'package:velocity_x/velocity_x.dart';
import 'package:aku_community/base/base_style.dart'; import 'package:aku_community/base/base_style.dart';
//button
class CardBottomButton extends StatelessWidget { class CardBottomButton extends StatelessWidget {
final String text; final String text;
final Color textColor; final Color textColor;

@ -3,7 +3,7 @@ import 'package:flutter/material.dart';
import 'package:velocity_x/velocity_x.dart'; import 'package:velocity_x/velocity_x.dart';
import 'package:aku_community/utils/headers.dart'; import 'package:aku_community/utils/headers.dart';
/// button
class ColumnActionButton extends StatelessWidget { class ColumnActionButton extends StatelessWidget {
final VoidCallback? onPressed; final VoidCallback? onPressed;
final String? title; final String? title;

@ -1,5 +1,4 @@
import 'dart:io'; import 'dart:io';
import 'dart:ui';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
@ -7,7 +6,7 @@ import 'package:get/get.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/constants/api.dart';
///
class BeeImagePreview extends StatefulWidget { class BeeImagePreview extends StatefulWidget {
static Future<T?> toFile<T>({required File file, String? tag}) async { static Future<T?> toFile<T>({required File file, String? tag}) async {
return await navigator!.push( return await navigator!.push(

@ -0,0 +1,19 @@
import 'package:aku_community/base/base_style.dart';
import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:velocity_x/velocity_x.dart';
class IdentifyCardPicker {
static front() {
return Column(
children: [
'上传身份证正面'.text.size(28.sp).color(ktextPrimary).make(),
24.w.heightBox,
Container(
width: 350.w,
height: 220.w,
)
],
);
}
}
Loading…
Cancel
Save