add moving company select page

update deto create page
hmxc
张萌 4 years ago
parent 3b5ada0858
commit ea9190ab5a

@ -114,8 +114,12 @@ class _Manager {
/// ///
String get reportRepairComplete => '/user/reportRepair/completeOrder'; String get reportRepairComplete => '/user/reportRepair/completeOrder';
/// ///
String get reportRepairEvaluate => '/user/reportRepair/evaluate'; String get reportRepairEvaluate => '/user/reportRepair/evaluate';
///
String get getMovingCompanyTel => '/user/articleOut/getMovingCompanyTel';
} }
class _Upload { class _Upload {

@ -0,0 +1,42 @@
class MovingCompanyModel {
List<AppMovingCompanyVoList> appMovingCompanyVoList;
MovingCompanyModel({this.appMovingCompanyVoList});
MovingCompanyModel.fromJson(Map<String, dynamic> json) {
if (json['appMovingCompanyVoList'] != null) {
appMovingCompanyVoList = new List<AppMovingCompanyVoList>();
json['appMovingCompanyVoList'].forEach((v) {
appMovingCompanyVoList.add(new AppMovingCompanyVoList.fromJson(v));
});
}
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
if (this.appMovingCompanyVoList != null) {
data['appMovingCompanyVoList'] =
this.appMovingCompanyVoList.map((v) => v.toJson()).toList();
}
return data;
}
}
class AppMovingCompanyVoList {
String name;
String tel;
AppMovingCompanyVoList({this.name, this.tel});
AppMovingCompanyVoList.fromJson(Map<String, dynamic> json) {
name = json['name'];
tel = json['tel'];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['name'] = this.name;
data['tel'] = this.tel;
return data;
}
}

@ -4,6 +4,7 @@
import 'dart:io'; import 'dart:io';
// Flutter imports: // Flutter imports:
import 'package:akuCommunity/pages/goods_deto_page/select_move_company_page.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
@ -130,34 +131,34 @@ class _DetoCreatePageState extends State<DetoCreatePage> {
); );
} }
Widget _inkWellCheckbox() { // Widget _inkWellCheckbox() {
return InkWell( // return InkWell(
child: Container( // child: Container(
padding: EdgeInsets.only(bottom: 24.w), // padding: EdgeInsets.only(bottom: 24.w),
child: Row( // child: Row(
mainAxisSize: MainAxisSize.min, // mainAxisSize: MainAxisSize.min,
mainAxisAlignment: MainAxisAlignment.start, // mainAxisAlignment: MainAxisAlignment.start,
children: [ // children: [
BeeCheckBox( // BeeCheckBox(
onChange: (value) { // onChange: (value) {
needMoveCompany = value; // needMoveCompany = value;
}, // },
), // ),
10.w.widthBox, // 10.w.widthBox,
Container( // Container(
child: Text( // child: Text(
'是否需要物业提供搬家公司联系方式', // '是否需要物业提供搬家公司联系方式',
style: TextStyle( // style: TextStyle(
fontSize: 28.sp, // fontSize: 28.sp,
color: Color(0xff333333), // color: Color(0xff333333),
), // ),
), // ),
), // ),
], // ],
), // ),
), // ),
); // );
} // }
Widget _getWeight() { Widget _getWeight() {
return Container( return Container(
@ -241,6 +242,7 @@ class _DetoCreatePageState extends State<DetoCreatePage> {
.toList() .toList()
], ],
), ),
20.w.heightBox,
], ],
), ),
); );
@ -340,6 +342,39 @@ class _DetoCreatePageState extends State<DetoCreatePage> {
setState(() {}); setState(() {});
} }
Widget _getMovingCompany(String movingCompany) {
return Container(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
'搬家公司信息'.text.color(ktextPrimary).size(28.sp).make(),
16.w.heightBox,
InkWell(
onTap: () {
SelectMoveCompanyPage().to();
},
child: Padding(
padding: EdgeInsets.symmetric(vertical: 30.w),
child: Row(
children: [
(movingCompany.isEmptyOrNull ? '请选择搬家公司' : movingCompany)
.text
.color(ktextSubColor)
.size(36.sp)
.bold
.make(),
Spacer(),
Icon(CupertinoIcons.chevron_right, size: 30.w),
],
),
),
),
BeeDivider.horizontal(),
],
),
);
}
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return BeeScaffold( return BeeScaffold(
@ -359,7 +394,7 @@ class _DetoCreatePageState extends State<DetoCreatePage> {
_showItmePicker(); _showItmePicker();
}), }),
_getApproach(), _getApproach(),
_selectApproach == 0 ? SizedBox() : _inkWellCheckbox(), _selectApproach == 0 ? SizedBox() : _getMovingCompany(''),
Container( Container(
margin: EdgeInsets.only(top: 54.w, bottom: 24.w), margin: EdgeInsets.only(top: 54.w, bottom: 24.w),
child: Text( child: Text(
@ -381,11 +416,6 @@ class _DetoCreatePageState extends State<DetoCreatePage> {
onPressed: () {}, onPressed: () {},
), ),
); );
// Positioned( //
// bottom: 0,
// child: BottomButton(title: '确认提交'),
// )
// ],
// ),
} }
} }

@ -36,7 +36,7 @@ class _CommonRadioState extends State<CommonRadio> {
color: _selected ? kPrimaryColor : Color(0xFF979797), color: _selected ? kPrimaryColor : Color(0xFF979797),
width: 3.w, width: 3.w,
), ),
borderRadius: BorderRadius.circular(20.w), borderRadius: BorderRadius.circular(widget.size??20.w),
), ),
duration: Duration(milliseconds: 300), duration: Duration(milliseconds: 300),
curve: Curves.easeInOutCubic, curve: Curves.easeInOutCubic,
@ -58,9 +58,13 @@ class _CommonRadioState extends State<CommonRadio> {
), ),
), ),
), ),
10.w.widthBox, ...widget.text == null
widget.text, ? [SizedBox()]
10.w.widthBox, : [
10.w.widthBox,
widget.text,
10.w.widthBox,
]
], ],
); );
} }

@ -0,0 +1,123 @@
import 'package:akuCommunity/base/base_style.dart';
import 'package:akuCommunity/model/manager/moving_company_model.dart';
import 'package:akuCommunity/pages/goods_deto_page/deto_create_page/widget/common_radio.dart';
import 'package:akuCommunity/pages/manager_func.dart';
import 'package:akuCommunity/widget/bee_divider.dart';
import 'package:akuCommunity/widget/bee_scaffold.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:akuCommunity/utils/headers.dart';
import 'package:flutter_easyrefresh/easy_refresh.dart';
class SelectMoveCompanyPage extends StatefulWidget {
SelectMoveCompanyPage({Key key}) : super(key: key);
@override
_SelectMoveCompanyPageState createState() => _SelectMoveCompanyPageState();
}
class _SelectMoveCompanyPageState extends State<SelectMoveCompanyPage> {
int _selected;
MovingCompanyModel _companyModel;
Widget _buildCard(int index, String name, String tel) {
return Container(
padding: EdgeInsets.symmetric(vertical: 28.w),
child: Row(
crossAxisAlignment: CrossAxisAlignment.center,
children: [
GestureDetector(
onTap: () {
_selected = index;
setState(() {});
},
child: Padding(
padding: EdgeInsets.symmetric(horizontal: 24.w, vertical: 24.w),
child: CommonRadio(
size: 32.w,
value: index,
groupValue: _selected,
),
),
),
Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
name.text.color(ktextPrimary).size(28.sp).bold.make(),
20.w.heightBox,
Row(
children: [
Icon(
CupertinoIcons.phone_arrow_up_right,
size: 40.w,
color: kDarkSubColor,
),
8.w.widthBox,
'电话:$tel'
.text
.color(Color(0xFF999999))
.size(24.sp)
.bold
.make(),
],
),
],
).expand(),
],
),
);
}
Widget _buildForself(int index) {
return Container(
padding: EdgeInsets.symmetric(vertical: 28.w),
child: Row(
crossAxisAlignment: CrossAxisAlignment.center,
children: [
GestureDetector(
onTap: () {
_selected = index;
setState(() {});
},
child: Padding(
padding: EdgeInsets.symmetric(horizontal: 24.w, vertical: 24.w),
child: CommonRadio(
size: 32.w,
value: index,
groupValue: _selected,
),
),
),
'自己联系'.text.color(ktextPrimary).size(28.sp).bold.make()
],
),
);
}
@override
Widget build(BuildContext context) {
return BeeScaffold(
title: '搬家公司',
body: EasyRefresh(
onRefresh: () async {
_companyModel = await ManagerFunc.getMovingCompanyTel();
},
header: MaterialHeader(),
child: ListView(
padding: EdgeInsets.all(32.w),
children: [
..._companyModel.appMovingCompanyVoList
.map((e) => _buildCard(
_companyModel.appMovingCompanyVoList.indexOf(e),
e.name,
e.tel))
.toList(),
_buildForself(
_companyModel.appMovingCompanyVoList.length
)
].sepWidget(separate: BeeDivider.horizontal()),
),
),
);
}
}

@ -1,4 +1,5 @@
// Package imports: // Package imports:
import 'package:akuCommunity/model/manager/moving_company_model.dart';
import 'package:dio/dio.dart'; import 'package:dio/dio.dart';
import 'package:flustars/flustars.dart'; import 'package:flustars/flustars.dart';
@ -27,10 +28,11 @@ class ManagerFunc {
} }
static reportRepairInsert( static reportRepairInsert(
int type, String reportDetail, List<String> fileUrls) async { int id, int type, String reportDetail, List<String> fileUrls) async {
BaseModel baseModel = await NetUtil().post( BaseModel baseModel = await NetUtil().post(
API.manager.reportRepairInsert, API.manager.reportRepairInsert,
params: { params: {
'buildingUnitEstateld': id,
'type': type, 'type': type,
'reportDetail': reportDetail, 'reportDetail': reportDetail,
'fileUrls': fileUrls, 'fileUrls': fileUrls,
@ -92,4 +94,12 @@ class ManagerFunc {
); );
return baseModel; return baseModel;
} }
static Future<MovingCompanyModel> getMovingCompanyTel() async {
BaseModel baseModel = await NetUtil().get(
API.manager.getMovingCompanyTel,
showMessage: false,
);
return MovingCompanyModel.fromJson(baseModel.data);
}
} }

@ -129,7 +129,7 @@ class _PersonalIndexState extends State<PersonalIndex>
//TODO PLACEHOLDER //TODO PLACEHOLDER
placeholder: R.ASSETS_ICONS_PROPOSAL_PNG, placeholder: R.ASSETS_ICONS_PROPOSAL_PNG,
image: API image: API
.image(userProvider.userInfoModel.imgUrl), .image(userProvider?.userInfoModel?.imgUrl),
height: 106.w, height: 106.w,
width: 106.w, width: 106.w,
), ),

@ -229,7 +229,7 @@ class _AddFixedSubmitPageState extends State<AddFixedSubmitPage> {
? () async { ? () async {
List<String> urls = await NetUtil() List<String> urls = await NetUtil()
.uploadFiles(_files, API.upload.uploadRepair); .uploadFiles(_files, API.upload.uploadRepair);
BaseModel baseModel = await ManagerFunc.reportRepairInsert( BaseModel baseModel = await ManagerFunc.reportRepairInsert(userProvider.userDetailModel.id,
_selectType + 1, _textEditingController.text, urls); _selectType + 1, _textEditingController.text, urls);
if (baseModel.status) { if (baseModel.status) {
FinishFixedSubmitPage().to(); FinishFixedSubmitPage().to();

Loading…
Cancel
Save