parent
ac4b56b2e1
commit
02fe969be0
@ -0,0 +1,18 @@
|
||||
class PickBuildingModel {
|
||||
int value;
|
||||
String label;
|
||||
|
||||
PickBuildingModel({this.value, this.label});
|
||||
|
||||
PickBuildingModel.fromJson(Map<String, dynamic> json) {
|
||||
value = json['value'];
|
||||
label = json['label'];
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final Map<String, dynamic> data = new Map<String, dynamic>();
|
||||
data['value'] = this.value;
|
||||
data['label'] = this.label;
|
||||
return data;
|
||||
}
|
||||
}
|
@ -0,0 +1,17 @@
|
||||
import 'package:akuCommunity/base/base_style.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:velocity_x/velocity_x.dart';
|
||||
import 'package:akuCommunity/utils/headers.dart';
|
||||
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
||||
|
||||
signUpTitle(String subTitle) {
|
||||
return Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
'欢迎登录小蜜蜂'.text.bold.size(38.sp).color(ktextPrimary).make(),
|
||||
8.hb,
|
||||
subTitle.text.size(28.sp).color(ktextSubColor).make(),
|
||||
],
|
||||
);
|
||||
}
|
@ -0,0 +1,48 @@
|
||||
import 'package:akuCommunity/model/user/pick_building_model.dart';
|
||||
import 'package:akuCommunity/pages/sign/sign_func.dart';
|
||||
import 'package:akuCommunity/pages/sign/sign_up/sign_up_pick_unit_page.dart';
|
||||
import 'package:akuCommunity/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 SignUpPickBuildingPage extends StatefulWidget {
|
||||
SignUpPickBuildingPage({Key key}) : super(key: key);
|
||||
|
||||
@override
|
||||
_SignUpPickBuildingPageState createState() => _SignUpPickBuildingPageState();
|
||||
}
|
||||
|
||||
class _SignUpPickBuildingPageState extends State<SignUpPickBuildingPage> {
|
||||
List<PickBuildingModel> _buildingModels = [];
|
||||
_buildItem(PickBuildingModel model) {
|
||||
return ListTile(
|
||||
title: model.label.text.make(),
|
||||
onTap: () {
|
||||
Get.off(SignUpPickUnitPage(buildingId: model.value));
|
||||
},
|
||||
).material(color: Colors.white);
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return BeeScaffold(
|
||||
title: '选择楼栋',
|
||||
body: EasyRefresh(
|
||||
header: MaterialHeader(),
|
||||
firstRefresh: true,
|
||||
onRefresh: () async {
|
||||
_buildingModels = await SignFunc.getBuildingInfo();
|
||||
setState(() {});
|
||||
},
|
||||
child: ListView.builder(
|
||||
itemBuilder: (context, index) {
|
||||
return _buildItem(_buildingModels[index]);
|
||||
},
|
||||
itemCount: _buildingModels.length,
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
@ -0,0 +1,29 @@
|
||||
import 'package:akuCommunity/pages/sign/sign_up/sign_up_pick_building_page.dart';
|
||||
import 'package:akuCommunity/widget/bee_scaffold.dart';
|
||||
import 'package:akuCommunity/extensions/page_router.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:velocity_x/velocity_x.dart';
|
||||
|
||||
class SignUpPickPlotPage extends StatefulWidget {
|
||||
SignUpPickPlotPage({Key key}) : super(key: key);
|
||||
|
||||
@override
|
||||
_SignUpPickPlotPageState createState() => _SignUpPickPlotPageState();
|
||||
}
|
||||
|
||||
class _SignUpPickPlotPageState extends State<SignUpPickPlotPage> {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return BeeScaffold(
|
||||
title: '选择小区',
|
||||
body: ListView(
|
||||
children: [
|
||||
ListTile(
|
||||
title: 'PLACEHOLDER PLOT'.text.make(),
|
||||
onTap: SignUpPickBuildingPage().to,
|
||||
).material(color: Colors.white),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
@ -0,0 +1,59 @@
|
||||
import 'package:akuCommunity/base/base_style.dart';
|
||||
import 'package:akuCommunity/pages/sign/sign_up/sign_up_common_widget.dart';
|
||||
import 'package:akuCommunity/provider/sign_up_provider.dart';
|
||||
import 'package:akuCommunity/utils/headers.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
import 'package:velocity_x/velocity_x.dart';
|
||||
|
||||
class SignUpPickRolePage extends StatefulWidget {
|
||||
SignUpPickRolePage({Key key}) : super(key: key);
|
||||
|
||||
@override
|
||||
_SignUpPickRolePageState createState() => _SignUpPickRolePageState();
|
||||
}
|
||||
|
||||
class _SignUpPickRolePageState extends State<SignUpPickRolePage> {
|
||||
Widget _buildTile(int type, String title) {
|
||||
final signUpProvider = Provider.of<SignUpProvider>(context);
|
||||
return RadioListTile(
|
||||
groupValue: signUpProvider.type,
|
||||
onChanged: (int value) => signUpProvider.setType(value),
|
||||
value: type,
|
||||
title: title.text.make(),
|
||||
);
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
body: ListView(
|
||||
padding: EdgeInsets.symmetric(horizontal: 32.w),
|
||||
children: [
|
||||
148.hb,
|
||||
signUpTitle('身份选择'),
|
||||
190.hb,
|
||||
...[
|
||||
_buildTile(1, '租客'),
|
||||
_buildTile(2, '业主'),
|
||||
_buildTile(3, '亲属'),
|
||||
].sepWidget(
|
||||
separate: Divider(
|
||||
height: 1.w,
|
||||
thickness: 1.w,
|
||||
color: Color(0xFFD8D8D8),
|
||||
)),
|
||||
],
|
||||
),
|
||||
bottomNavigationBar: MaterialButton(
|
||||
height: 89.w,
|
||||
color: kPrimaryColor,
|
||||
shape: StadiumBorder(),
|
||||
disabledColor: kPrimaryColor.withOpacity(0.3),
|
||||
child: '提交'.text.make(),
|
||||
onPressed: () {},
|
||||
elevation: 0,
|
||||
).pLTRB(82.w, 0, 82.w, 155.w),
|
||||
);
|
||||
}
|
||||
}
|
@ -0,0 +1,54 @@
|
||||
import 'package:akuCommunity/model/user/pick_building_model.dart';
|
||||
import 'package:akuCommunity/pages/sign/sign_func.dart';
|
||||
import 'package:akuCommunity/pages/sign/sign_up/sign_up_pick_role_page.dart';
|
||||
import 'package:akuCommunity/provider/sign_up_provider.dart';
|
||||
import 'package:akuCommunity/widget/bee_scaffold.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_easyrefresh/easy_refresh.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
import 'package:velocity_x/velocity_x.dart';
|
||||
|
||||
class SignUpPickUnitPage extends StatefulWidget {
|
||||
final int buildingId;
|
||||
SignUpPickUnitPage({Key key, this.buildingId}) : super(key: key);
|
||||
|
||||
@override
|
||||
_SignUpPickUnitPageState createState() => _SignUpPickUnitPageState();
|
||||
}
|
||||
|
||||
class _SignUpPickUnitPageState extends State<SignUpPickUnitPage> {
|
||||
List<PickBuildingModel> _buildingModels = [];
|
||||
_buildItem(PickBuildingModel model) {
|
||||
return ListTile(
|
||||
title: model.label.text.make(),
|
||||
onTap: () {
|
||||
final signUpProvider =
|
||||
Provider.of<SignUpProvider>(context, listen: false);
|
||||
signUpProvider.setEstateId(model.value);
|
||||
Get.off(SignUpPickRolePage());
|
||||
},
|
||||
).material(color: Colors.white);
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return BeeScaffold(
|
||||
title: '选择单元',
|
||||
body: EasyRefresh(
|
||||
header: MaterialHeader(),
|
||||
firstRefresh: true,
|
||||
onRefresh: () async {
|
||||
_buildingModels = await SignFunc.getUnitInfo(widget.buildingId);
|
||||
setState(() {});
|
||||
},
|
||||
child: ListView.builder(
|
||||
itemBuilder: (context, index) {
|
||||
return _buildItem(_buildingModels[index]);
|
||||
},
|
||||
itemCount: _buildingModels.length,
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
@ -0,0 +1,59 @@
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
class SignUpProvider extends ChangeNotifier {
|
||||
int _estateId;
|
||||
int get estateId => _estateId;
|
||||
int _type = 1;
|
||||
int get type => _type;
|
||||
String _nickName;
|
||||
String get nickName => _nickName;
|
||||
String _name;
|
||||
String get name => _name;
|
||||
String _tel;
|
||||
String get tel => _tel;
|
||||
int _idType;
|
||||
int get idType => _idType;
|
||||
String _idNumber;
|
||||
String get idNumber => _idNumber;
|
||||
|
||||
setEstateId(int id) {
|
||||
_estateId = id;
|
||||
notifyListeners();
|
||||
}
|
||||
|
||||
setType(int type) {
|
||||
_type = type;
|
||||
notifyListeners();
|
||||
}
|
||||
|
||||
setName(String name) {
|
||||
_name = name;
|
||||
notifyListeners();
|
||||
}
|
||||
|
||||
setTel(String tel) {
|
||||
_tel = tel;
|
||||
notifyListeners();
|
||||
}
|
||||
|
||||
setidType(int idType) {
|
||||
_idType = idType;
|
||||
notifyListeners();
|
||||
}
|
||||
|
||||
setIdNumber(String idNumber) {
|
||||
_idNumber = idNumber;
|
||||
notifyListeners();
|
||||
}
|
||||
|
||||
clearAll() {
|
||||
_estateId = null;
|
||||
_type = 1;
|
||||
_nickName = null;
|
||||
_name = null;
|
||||
_tel = null;
|
||||
_idType = null;
|
||||
_idNumber = null;
|
||||
notifyListeners();
|
||||
}
|
||||
}
|
Loading…
Reference in new issue