add my house select page

hmxc
张萌 4 years ago
parent acc1ab915f
commit 09d982d355

@ -6,6 +6,7 @@ import 'dart:io';
// Flutter imports:
import 'package:akuCommunity/constants/api.dart';
import 'package:akuCommunity/pages/goods_deto_page/select_move_company_page.dart';
import 'package:akuCommunity/pages/life_pay/widget/my_house_page.dart';
import 'package:akuCommunity/pages/manager_func.dart';
import 'package:akuCommunity/utils/bee_parse.dart';
import 'package:akuCommunity/utils/network/base_model.dart';
@ -44,7 +45,8 @@ class _DetoCreatePageState extends State<DetoCreatePage> {
String _itemName;
DateTime _date;
String get datetime=>DateUtil.formatDate(_date, format: "yyyy-MM-dd HH:mm:ss");
String get datetime =>
DateUtil.formatDate(_date, format: "yyyy-MM-dd HH:mm:ss");
int _selectWeight;
String _selectTel;
List<String> _listWeight = [
@ -67,7 +69,7 @@ class _DetoCreatePageState extends State<DetoCreatePage> {
bool needMoveCompany = false;
Widget _houseAddress(String title, subtitle) {
Widget _houseAddress(String subtitle) {
return Container(
padding: EdgeInsets.only(bottom: 24.w),
margin: EdgeInsets.only(bottom: 40.w),
@ -88,41 +90,51 @@ class _DetoCreatePageState extends State<DetoCreatePage> {
),
),
),
Row(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Container(
margin: EdgeInsets.only(right: 42.w),
child: Image.asset(
R.ASSETS_IMAGES_HOUSE_ATTESTATION_PNG,
height: 59.w,
width: 59.w,
),
),
Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
title,
style: TextStyle(
fontWeight: FontWeight.w600,
fontSize: 32.sp,
color: Color(0xff333333),
),
GestureDetector(
onTap: () {
MyHousePage().to();
},
child: Row(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Container(
margin: EdgeInsets.only(right: 42.w),
child: Image.asset(
R.ASSETS_IMAGES_HOUSE_ATTESTATION_PNG,
height: 59.w,
width: 59.w,
),
SizedBox(height: 10.w),
Text(
subtitle,
style: TextStyle(
fontWeight: FontWeight.w600,
fontSize: 32.sp,
color: Color(0xff333333),
),
Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
kEstateName,
style: TextStyle(
fontWeight: FontWeight.w600,
fontSize: 32.sp,
color: Color(0xff333333),
),
),
)
],
),
],
SizedBox(height: 10.w),
Text(
BeeParse.getEstateName(subtitle),
style: TextStyle(
fontWeight: FontWeight.w600,
fontSize: 32.sp,
color: Color(0xff333333),
),
)
],
),
Spacer(),
Icon(
CupertinoIcons.chevron_forward,
size: 40.w,
),
],
).material(color: Colors.transparent),
),
],
),
@ -350,9 +362,7 @@ class _DetoCreatePageState extends State<DetoCreatePage> {
InkWell(
onTap: () async {
_selectTel = await SelectMoveCompanyPage().to();
setState(() {
});
setState(() {});
},
child: Padding(
padding: EdgeInsets.symmetric(vertical: 30.w),
@ -398,16 +408,9 @@ class _DetoCreatePageState extends State<DetoCreatePage> {
body: ListView(
padding: EdgeInsets.all(32.w),
children: [
_houseAddress(
kEstateName,
userProvider.userDetailModel.estateNames.isEmpty
? ''
: BeeParse.getEstateName(
userProvider.userDetailModel.estateNames[0])),
_houseAddress(userProvider.currentHouse),
_getWeight(),
_itemPicker(
'出户时间', datetime,
() async {
_itemPicker('出户时间', datetime, () async {
_date = await BeeDatePicker.timePicker(DateTime.now());
setState(() {});
}),

@ -4,18 +4,16 @@ import 'package:akuCommunity/const/resource.dart';
import 'package:akuCommunity/constants/api.dart';
import 'package:akuCommunity/model/manager/life_pay_model.dart';
import 'package:akuCommunity/pages/life_pay/widget/my_house_page.dart';
import 'package:akuCommunity/pages/personal/widget/order_card.dart';
import 'package:akuCommunity/pages/things_page/widget/bee_list_view.dart';
import 'package:akuCommunity/provider/user_provider.dart';
import 'package:akuCommunity/utils/bee_parse.dart';
import 'package:akuCommunity/widget/bee_divider.dart';
import 'package:akuCommunity/widget/buttons/bee_check_box.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter_easyrefresh/easy_refresh.dart';
import 'package:get/get_state_manager/get_state_manager.dart';
import 'package:provider/provider.dart';
// Package imports:
import 'package:velocity_x/velocity_x.dart';
@ -85,7 +83,7 @@ class _LifePayPageState extends State<LifePayPage> {
size: 40.w,
),
],
),
).material(color: Colors.transparent),
),
24.w.heightBox,
],

@ -1,13 +1,15 @@
import 'package:akuCommunity/base/base_style.dart';
import 'package:akuCommunity/pages/goods_deto_page/deto_create_page/widget/common_radio.dart';
import 'package:akuCommunity/provider/user_provider.dart';
import 'package:akuCommunity/utils/bee_parse.dart';
import 'package:akuCommunity/widget/bee_divider.dart';
import 'package:akuCommunity/widget/bee_scaffold.dart';
import 'package:flutter/material.dart';
import 'package:akuCommunity/utils/headers.dart';
import 'package:provider/provider.dart';
class MyHousePage extends StatefulWidget {
final List<String> estateNames;
MyHousePage({Key key, this.estateNames}) : super(key: key);
MyHousePage({Key key}) : super(key: key);
@override
_MyHousePageState createState() => _MyHousePageState();
@ -39,27 +41,35 @@ Widget _unPaidTag() {
class _MyHousePageState extends State<MyHousePage> {
int _select;
Widget _buildCard(bool currentHouse, {bool paid = false}) {
Widget _buildCard(String currentHouse, String estateName, int index,
{bool paid = false}) {
return Container(
padding: EdgeInsets.symmetric(horizontal: 32.w, vertical: 32.w),
child: Row(
children: [
CommonRadio(
value: 1,
groupValue: _select,
size: 32.w,
GestureDetector(
onTap: () {
_select = index;
setState(() {});
},
child: CommonRadio(
value: index,
groupValue: _select,
size: 32.w,
),
),
24.w.widthBox,
Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisSize: MainAxisSize.min,
children: [
kEstateName.text.size(24.sp).color(ktextSubColor).bold.make(),
16.w.heightBox,
''.text.color(ktextPrimary).size(28.sp).bold.make(),
BeeParse.getEstateName(estateName).text.color(ktextPrimary).size(28.sp).bold.make(),
],
),
Spacer(),
currentHouse
currentHouse == estateName
? _currentHouseTag()
: paid
? _unPaidTag()
@ -71,11 +81,15 @@ class _MyHousePageState extends State<MyHousePage> {
@override
Widget build(BuildContext context) {
UserProvider userProvider = Provider.of<UserProvider>(context);
return BeeScaffold(
title: '我的房屋',
body: ListView(
children: [
_buildCard(true),
children: <Widget>[
...userProvider.userDetailModel.estateNames
.map((e) => _buildCard(userProvider.currentHouse, e,
userProvider.userDetailModel.estateNames.indexOf(e)))
.toList(),
].sepWidget(separate: BeeDivider.horizontal()),
),
);

@ -2,6 +2,7 @@
import 'dart:io';
// Flutter imports:
import 'package:akuCommunity/pages/life_pay/widget/my_house_page.dart';
import 'package:akuCommunity/utils/bee_parse.dart';
import 'package:akuCommunity/widget/buttons/bottom_button.dart';
import 'package:flutter/cupertino.dart';
@ -65,7 +66,9 @@ class _AddFixedSubmitPageState extends State<AddFixedSubmitPage> {
'报修房屋'.text.black.size(28.sp).make(),
32.w.heightBox,
GestureDetector(
onTap: () {},
onTap: () {
MyHousePage().to();
},
child: Row(
children: [
Image.asset(

@ -31,6 +31,7 @@ class UserProvider extends ChangeNotifier {
HiveStore.appBox.put('login', true);
await updateProfile();
await updateUserDetail();
await setCurrentHouse(_userDetailModel?.estateNames?.first??'');
notifyListeners();
}
@ -135,8 +136,7 @@ class UserProvider extends ChangeNotifier {
}
///
String _currentHouse =
await SignFunc.getUserDetail().then((value) => value.estateNames.first);
String _currentHouse;
String get currentHouse => _currentHouse;
setCurrentHouse(String house) {
_currentHouse = house;

Loading…
Cancel
Save