我的房屋改版--修改租客身份下我的房屋页面样式 添加游客认证

hmxc
张萌 3 years ago
parent c83d98dc28
commit 8de7a3d14e

@ -2,6 +2,7 @@
import 'package:aku_community/pages/opening_code_page/opening_code_page.dart';
import 'package:aku_community/pages/renovation_manage/new_renovation/new_renovation_page.dart';
import 'package:aku_community/widget/others/user_tool.dart';
import 'package:flutter/material.dart';
import 'package:aku_community/const/resource.dart';
@ -118,7 +119,7 @@ List<AO> appObjects = [
];
List<AO> userAppObjects = [
AO('我的房屋', R.ASSETS_ICONS_USER_ICON_WDFW_PNG, () => HouseOwnersPage()),
AO('我的房屋', R.ASSETS_ICONS_USER_ICON_WDFW_PNG, () => HouseOwnersPage(identify: UserTool.userProvider.userDetailModel!.type??4,)),
AO('我的车位', R.ASSETS_ICONS_USER_ICON_WDCW_PNG, () => CarParkingPage()),
AO('我的车', R.ASSETS_ICONS_USER_ICON_WDC_PNG, () => CarManagePage()),
AO('社区活动', R.ASSETS_ICONS_USER_ICON_WDSQHD_PNG, () => ActivityListPage()),

@ -11,6 +11,7 @@ import 'package:aku_community/widget/bee_divider.dart';
import 'package:aku_community/widget/bee_scaffold.dart';
import 'package:aku_community/widget/buttons/bee_numberic_button.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:flutter/material.dart';
import 'package:flutter_easyrefresh/easy_refresh.dart';
@ -57,7 +58,7 @@ class _GoodsOrderDetailPageState extends State<GoodsOrderDetailPage> {
actions: [
TextButton(
onPressed: () {
Get.to(() => HouseOwnersPage());
Get.to(() => HouseOwnersPage(identify: UserTool.userProvider.userDetailModel!.type??4,));
},
child: '切换房屋'.text.size(28.sp).color(ktextPrimary).make())
],

@ -15,20 +15,24 @@ enum CardAuthType {
class HouseCard extends StatelessWidget {
final PassedHouseListModel? model;
final CardAuthType type;
final bool isOwner;
const HouseCard({
Key? key,
required this.model,
required this.type,
required this.isOwner,
}) : super(key: key);
const HouseCard.fail({
Key? key,
required this.model,
required this.isOwner,
}) : type = CardAuthType.FAIL,
super(key: key);
const HouseCard.success({
Key? key,
required this.model,
required this.isOwner,
}) : type = CardAuthType.SUCCESS,
super(key: key);
@ -49,7 +53,7 @@ class HouseCard extends StatelessWidget {
case 2:
return '';
case 3:
return '';
return '租户';
default:
return '';
}
@ -146,22 +150,25 @@ class HouseCard extends StatelessWidget {
),
],
).expand(),
//TODO
// Column(
// crossAxisAlignment: CrossAxisAlignment.start,
// children: [
// Text(
// '到期时间',
// style: Theme.of(context).textTheme.subtitle2.copyWith(
// color: Color(0xFF666666),
// ),
// ),
// Text(
// _roleName,
// style: Theme.of(context).textTheme.subtitle1,
// ),
// ],
// ).expand(),
//
isOwner
? SizedBox()
: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
'到期时间',
style:
Theme.of(context).textTheme.subtitle2!.copyWith(
color: Color(0xFF666666),
),
),
Text(
_roleName,
style: Theme.of(context).textTheme.subtitle1,
),
],
).expand(),
],
),
40.hb,
@ -175,4 +182,8 @@ class HouseCard extends StatelessWidget {
),
);
}
_isOverDate(DateTime date) {
return DateTime.now().isAfter(date);
}
}

@ -1,4 +1,5 @@
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/my_house_list.dart';
import 'package:aku_community/widget/buttons/bottom_button.dart';
import 'package:flutter/material.dart';
@ -17,7 +18,8 @@ import 'package:aku_community/utils/headers.dart';
import 'package:aku_community/widget/bee_scaffold.dart';
class HouseOwnersPage extends StatefulWidget {
HouseOwnersPage({Key? key}) : super(key: key);
final int identify;
HouseOwnersPage({Key? key, required this.identify}) : super(key: key);
@override
_HouseOwnersPageState createState() => _HouseOwnersPageState();
@ -38,6 +40,7 @@ class _HouseOwnersPageState extends State<HouseOwnersPage> {
return appProvider.selectedHouse != null;
}
//
Widget get _houseTitle {
// final appProvider = Provider.of<AppProvider>(context, listen: false);
if (_emptyHouse) return Text('还没有绑定房屋');
@ -46,69 +49,101 @@ class _HouseOwnersPageState extends State<HouseOwnersPage> {
return SizedBox();
}
bool get isOwner {
switch (widget.identify) {
case 1:
return true;
case 3:
return false;
default:
return false;
}
}
bool get isTourist {
switch (widget.identify) {
case 1:
return false;
case 2:
return true;
case 3:
return false;
case 4:
return true;
default:
return true;
}
}
@override
Widget build(BuildContext context) {
final appProvider = Provider.of<AppProvider>(context);
return BeeScaffold(
title: '我的房屋',
actions: [
TextButton(
onPressed: () {
Get.to(MyHouseList());
},
child: Text('审核记录'),
),
],
body: EasyRefresh(
header: MaterialHeader(),
controller: _refreshController,
firstRefresh: true,
onRefresh: () async {
appProvider.updateHouses(await HouseFunc.passedHouses);
},
child: ListView(
children: [
_emptyHouse
? 280.hb
: Padding(
padding: EdgeInsets.all(32.w),
child: HouseCard(
type: appProvider.selectedHouse!=null
? CardAuthType.SUCCESS
: CardAuthType.FAIL,
model: appProvider.selectedHouse,
),
),
if (!_emptyHouse) 88.hb,
if (!_haveAuthedHouse)
Stack(
return isTourist
? _touristBody()
: BeeScaffold(
title: '我的房屋',
actions: [
TextButton(
onPressed: () {
Get.to(() => MyHouseList());
//TODO:
},
child: Text(isOwner ? '审核记录' : '我的选房'),
),
],
body: EasyRefresh(
header: MaterialHeader(),
controller: _refreshController,
firstRefresh: true,
onRefresh: () async {
appProvider.updateHouses(await HouseFunc.passedHouses);
},
child: ListView(
children: [
Padding(
padding: EdgeInsets.symmetric(horizontal: 75.w),
child: Image.asset(R.ASSETS_STATIC_REVIEWING_WEBP),
),
Positioned(
bottom: 100.w,
left: 0,
right: 0,
child: _houseTitle.centered(),
),
_emptyHouse
? 280.hb
: Padding(
padding: EdgeInsets.all(32.w),
child: HouseCard(
isOwner: isOwner,
type: appProvider.selectedHouse != null
? CardAuthType.SUCCESS
: CardAuthType.FAIL,
model: appProvider.selectedHouse,
),
),
if (!_emptyHouse) 88.hb,
if (!_haveAuthedHouse)
Stack(
children: [
Padding(
padding: EdgeInsets.symmetric(horizontal: 75.w),
child: Image.asset(R.ASSETS_STATIC_REVIEWING_WEBP),
),
Positioned(
bottom: 100.w,
left: 0,
right: 0,
child: _houseTitle.centered(),
),
],
),
if (_emptyHouse)
Center(
child: ElevatedButton(
onPressed: _addHouse,
child: Text('添加房屋'),
),
),
if (!isOwner && !_emptyHouse) _contractRelevant(),
],
),
if (_emptyHouse)
Center(
child: ElevatedButton(
onPressed: _addHouse,
child: Text('添加房屋'),
),
),
],
),
),
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()),
);
}
///
@ -116,4 +151,83 @@ class _HouseOwnersPageState extends State<HouseOwnersPage> {
bool? result = await Get.to(() => AddHousePage());
if (result == true) _refreshController.callRefresh();
}
//
Widget _contractRelevant() {
return GridView.count(
crossAxisCount: 2,
childAspectRatio: 326 / 241,
mainAxisSpacing: 32.w,
crossAxisSpacing: 32.w,
children: [
_cardBuild(
R.ASSETS_IMAGES_PLACEHOLDER_WEBP, '缴费查询', '查看租金及保证金情况', () {}),
_cardBuild(
R.ASSETS_IMAGES_PLACEHOLDER_WEBP, '合同变更', '变更合同信息、重新签约', () {}),
_cardBuild(
R.ASSETS_IMAGES_PLACEHOLDER_WEBP, '合同续签', '到期前线上办理续签手续', () {}),
_cardBuild(R.ASSETS_IMAGES_PLACEHOLDER_WEBP, '合同终止', '线上申请终止合同', () {})
],
);
}
Widget _cardBuild(
String assetPath, String title, String subTitle, VoidCallback onPressed) {
return MaterialButton(
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(16.w)),
color: Colors.white,
elevation: 0,
minWidth: 326.w,
height: 241.w,
padding: EdgeInsets.symmetric(horizontal: 32.w, vertical: 24.w),
onPressed: onPressed,
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Image.asset(
R.ASSETS_IMAGES_PLACEHOLDER_WEBP,
width: 88.w,
height: 88.w,
),
16.w.heightBox,
title.text.size(28.sp).color(ktextPrimary).bold.make(),
16.w.heightBox,
subTitle.text
.size(24.sp)
.color(ktextSubColor)
.maxLines(2)
.ellipsis
.make()
],
),
);
}
//
Widget _touristBody() {
var center = Center(
child: Column(
children: [
280.w.heightBox,
Padding(
padding: EdgeInsets.symmetric(horizontal: 75.w),
child: Image.asset(R.ASSETS_STATIC_REVIEWING_WEBP),
),
32.w.heightBox,
MaterialButton(
color: kPrimaryColor,
minWidth: 280.w,
elevation: 0,
height: 88.w,
child: '添加房屋'.text.size(32.sp).color(ktextPrimary).bold.make(),
onPressed: () {
Get.to(() => IdentifySelectionPage());
})
],
),
);
return BeeScaffold(
title: '我的房屋',
body: center,
);
}
}

@ -0,0 +1,57 @@
import 'package:aku_community/const/resource.dart';
import 'package:aku_community/ui/profile/house/my_house_list.dart';
import 'package:aku_community/ui/profile/house/user_identify_page.dart';
import 'package:aku_community/widget/bee_scaffold.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:get/get.dart';
import 'package:velocity_x/velocity_x.dart';
import 'package:aku_community/extensions/widget_list_ext.dart';
class IdentifySelectionPage extends StatelessWidget {
const IdentifySelectionPage({Key? key}) : super(key: key);
@override
Widget build(BuildContext context) {
return BeeScaffold(
title: '身份选择',
body: ListView(
children: [
20.w.heightBox,
_buidTile(R.ASSETS_ICONS_HOUSE_PNG, '业主', true),
_buidTile(R.ASSETS_ICONS_HOUSE_PNG, '租户', false)
].sepWidget(separate: 20.w.heightBox),
),
);
}
Widget _buidTile(String iconPath, String text, bool isOwner) {
return Row(
children: [
SizedBox(
width: 32.w,
height: 32.w,
child: Image.asset(iconPath),
),
28.w.widthBox,
text.text.black.size(30.sp).make(),
Spacer(),
Icon(
CupertinoIcons.chevron_forward,
size: 32.w,
),
],
)
.box
.padding(EdgeInsets.symmetric(vertical: 40.w, horizontal: 32.w))
.make()
.onInkTap(() {
Get.to(() => isOwner ? MyHouseList() : UserIdentifyPage());
}).material(
color: Colors.white,
borderRadius: BorderRadius.circular(8.w),
clipBehavior: Clip.antiAlias,
);
}
}

@ -1,5 +1,6 @@
import 'package:aku_community/base/base_style.dart';
import 'package:aku_community/model/user/house_model.dart';
import 'package:aku_community/ui/profile/house/add_house_page.dart';
import 'package:aku_community/ui/profile/house/house_func.dart';
import 'package:aku_community/widget/bee_divider.dart';
import 'package:aku_community/widget/bee_scaffold.dart';
@ -8,6 +9,7 @@ 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:velocity_x/velocity_x.dart';
import 'package:aku_community/const/resource.dart';
@ -38,6 +40,14 @@ class _MyHouseListState extends State<MyHouseList> {
Widget build(BuildContext context) {
return BeeScaffold(
title: '审核记录',
actions: [
TextButton(
onPressed: () async {
await Get.to(() => AddHousePage());
_refreshController.callRefresh();
},
child: '添加房屋'.text.size(28.sp).color(ktextPrimary).make())
],
body: EasyRefresh(
firstRefresh: true,
header: MaterialHeader(),

@ -0,0 +1,127 @@
import 'package:aku_community/base/base_style.dart';
import 'package:aku_community/widget/bee_scaffold.dart';
import 'package:aku_community/widget/buttons/bottom_button.dart';
import 'package:aku_community/widget/others/bee_input_row.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:get/get.dart';
import 'package:velocity_x/velocity_x.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:aku_community/extensions/widget_list_ext.dart';
class UserIdentifyPage extends StatefulWidget {
UserIdentifyPage({Key? key}) : super(key: key);
@override
_UserIdentifyPageState createState() => _UserIdentifyPageState();
}
class _UserIdentifyPageState extends State<UserIdentifyPage> {
TextEditingController _nameController = TextEditingController();
TextEditingController _phoneController = TextEditingController();
TextEditingController _indentifyCodeController = TextEditingController();
String _sex = '请选择性别';
String _identify = '请选择身份';
@override
Widget build(BuildContext context) {
return BeeScaffold(
title: '用户认证',
body: ListView(
padding: EdgeInsets.all(32.w),
children: [
BeeInputRow(
title: '承租人',
controller: _nameController,
hintText: '请输入姓名',
isRequire: true,
),
BeeInputRow.button(
title: '性别',
hintText: _sex,
isRequire: true,
onPressed: () async {
await Get.bottomSheet(_sexBottomSheet());
setState(() {});
},
),
BeeInputRow(
title: '手机号码',
controller: _phoneController,
formatters: [FilteringTextInputFormatter.digitsOnly],
hintText: '请输入手机号',
isRequire: true,
),
BeeInputRow(
title: '身份证号码',
controller: _indentifyCodeController,
formatters: [FilteringTextInputFormatter.digitsOnly],
hintText: '请输入身份证号',
isRequire: true,
),
BeeInputRow.button(
title: '身份',
hintText: _identify,
isRequire: true,
onPressed: () async {
await Get.bottomSheet(_identifyBottomSheet());
setState(() {});
},
)
].sepWidget(separate: 32.w.heightBox),
),
bottomNavi: BottomButton(
onPressed: () {},
child: '提交'.text.size(32.sp).bold.color(ktextPrimary).make()),
);
}
Widget _sexBottomSheet() {
return CupertinoActionSheet(
title:
'选择性别'.text.size(32.sp).bold.color(ktextPrimary).isIntrinsic.make(),
cancelButton: TextButton(
onPressed: () => Get.back(),
child: '取消'.text.size(28.sp).color(ktextSubColor).isIntrinsic.make()),
actions: [
CupertinoActionSheetAction(
onPressed: () {
_sex = '';
Get.back();
},
child: ''.text.size(30.sp).color(ktextPrimary).isIntrinsic.make()),
CupertinoActionSheetAction(
onPressed: () {
_sex = '';
Get.back();
},
child: ''.text.size(30.sp).color(ktextPrimary).isIntrinsic.make())
],
);
}
Widget _identifyBottomSheet() {
return CupertinoActionSheet(
title:
'选择身份'.text.size(32.sp).bold.color(ktextPrimary).isIntrinsic.make(),
cancelButton: TextButton(
onPressed: () => Get.back(),
child: '取消'.text.size(28.sp).color(ktextSubColor).isIntrinsic.make()),
actions: [
CupertinoActionSheetAction(
onPressed: () {
_identify = '业主';
Get.back();
},
child:
'业主'.text.size(30.sp).color(ktextPrimary).isIntrinsic.make()),
CupertinoActionSheetAction(
onPressed: () {
_identify = '租户';
Get.back();
},
child: '租户'.text.size(30.sp).color(ktextPrimary).isIntrinsic.make())
],
);
}
}

@ -1,3 +1,5 @@
import 'package:aku_community/ui/profile/house/house_owners_page.dart';
import 'package:aku_community/widget/others/user_tool.dart';
import 'package:bot_toast/bot_toast.dart';
import 'package:get/get.dart';
import 'package:provider/provider.dart';
@ -6,7 +8,6 @@ import 'package:aku_community/pages/sign/sign_in_page.dart';
import 'package:aku_community/provider/app_provider.dart';
import 'package:aku_community/provider/user_provider.dart';
import 'package:aku_community/ui/profile/house/add_house_page.dart';
import 'package:aku_community/ui/profile/house/house_owners_page.dart';
/// | | |
/// |-----|------|
@ -42,7 +43,7 @@ class LoginUtil {
}
if (appProvider.selectedHouse == null) {
BotToast.showText(text: '房屋审核中或审核失败');
Get.to(() => HouseOwnersPage());
Get.to(() => HouseOwnersPage(identify: UserTool.userProvider.userDetailModel!.type??4,));
return false;
}
return true;

@ -1,21 +1,39 @@
import 'package:aku_community/base/base_style.dart';
import 'package:aku_community/widget/bee_divider.dart';
import 'package:flutter/material.dart';
import 'package:aku_community/utils/headers.dart';
import 'package:flutter/services.dart';
class BeeInputRow extends StatefulWidget {
final String title;
final TextEditingController controller;
final TextEditingController? controller;
final List<TextInputFormatter>? formatters;
final String? hintText;
BeeInputRow(
final bool isRequire;
//
final bool isButton;
//
final VoidCallback? onPressed;
BeeInputRow({
Key? key,
required this.title,
required this.controller,
this.formatters,
required this.hintText,
this.isRequire = false,
}) : this.isButton = false,
this.onPressed = null,
super(key: key);
BeeInputRow.button(
{Key? key,
required this.title,
required this.controller,
this.formatters,
required this.hintText})
: super(key: key);
required this.hintText,
this.isRequire = false,
required this.onPressed})
: this.isButton = true,
this.formatters = null,
this.controller = null,
super(key: key);
@override
_BeeInputRowState createState() => _BeeInputRowState();
}
@ -23,14 +41,26 @@ class BeeInputRow extends StatefulWidget {
class _BeeInputRowState extends State<BeeInputRow> {
@override
Widget build(BuildContext context) {
return Container(
width: double.infinity,
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
widget.title.text.size(28.sp).color(ktextPrimary).make(),
32.w.heightBox,
TextField(
var bottom = widget.isButton
? GestureDetector(
onTap: widget.onPressed,
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Container(
width: double.infinity,
// padding: EdgeInsets.only(top: 4.w),
child: widget.hintText!.text
.size(36.sp)
.color(ktextSubColor)
.bold
.make(),
),
BeeDivider.horizontal()
],
),
)
: TextField(
inputFormatters: widget.formatters,
controller: widget.controller,
textAlign: TextAlign.start,
@ -50,7 +80,25 @@ class _BeeInputRowState extends State<BeeInputRow> {
fontWeight: FontWeight.bold,
color: ktextPrimary,
),
);
return Container(
width: double.infinity,
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Row(
children: [
widget.title.text.size(28.sp).color(ktextPrimary).make(),
10.w.widthBox,
(widget.isRequire ? '*' : '')
.text
.size(28.sp)
.color(Colors.red)
.make()
],
),
24.w.heightBox,
bottom,
],
),
);

@ -1,6 +1,6 @@
import 'package:flutter/material.dart';
import 'package:get/get.dart';
import 'package:provider/provider.dart';
import 'package:velocity_x/velocity_x.dart';

@ -1160,7 +1160,7 @@ packages:
source: hosted
version: "3.0.1"
web_socket_channel:
dependency: transitive
dependency: "direct main"
description:
name: web_socket_channel
url: "https://pub.flutter-io.cn"

Loading…
Cancel
Save