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 reportRepairEvaluate => '/user/reportRepair/evaluate';
///
String get getMovingCompanyTel => '/user/articleOut/getMovingCompanyTel';
}
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';
// Flutter imports:
import 'package:akuCommunity/pages/goods_deto_page/select_move_company_page.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
@ -130,34 +131,34 @@ class _DetoCreatePageState extends State<DetoCreatePage> {
);
}
Widget _inkWellCheckbox() {
return InkWell(
child: Container(
padding: EdgeInsets.only(bottom: 24.w),
child: Row(
mainAxisSize: MainAxisSize.min,
mainAxisAlignment: MainAxisAlignment.start,
children: [
BeeCheckBox(
onChange: (value) {
needMoveCompany = value;
},
),
10.w.widthBox,
Container(
child: Text(
'是否需要物业提供搬家公司联系方式',
style: TextStyle(
fontSize: 28.sp,
color: Color(0xff333333),
),
),
),
],
),
),
);
}
// Widget _inkWellCheckbox() {
// return InkWell(
// child: Container(
// padding: EdgeInsets.only(bottom: 24.w),
// child: Row(
// mainAxisSize: MainAxisSize.min,
// mainAxisAlignment: MainAxisAlignment.start,
// children: [
// BeeCheckBox(
// onChange: (value) {
// needMoveCompany = value;
// },
// ),
// 10.w.widthBox,
// Container(
// child: Text(
// '是否需要物业提供搬家公司联系方式',
// style: TextStyle(
// fontSize: 28.sp,
// color: Color(0xff333333),
// ),
// ),
// ),
// ],
// ),
// ),
// );
// }
Widget _getWeight() {
return Container(
@ -241,6 +242,7 @@ class _DetoCreatePageState extends State<DetoCreatePage> {
.toList()
],
),
20.w.heightBox,
],
),
);
@ -340,6 +342,39 @@ class _DetoCreatePageState extends State<DetoCreatePage> {
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
Widget build(BuildContext context) {
return BeeScaffold(
@ -359,7 +394,7 @@ class _DetoCreatePageState extends State<DetoCreatePage> {
_showItmePicker();
}),
_getApproach(),
_selectApproach == 0 ? SizedBox() : _inkWellCheckbox(),
_selectApproach == 0 ? SizedBox() : _getMovingCompany(''),
Container(
margin: EdgeInsets.only(top: 54.w, bottom: 24.w),
child: Text(
@ -381,11 +416,6 @@ class _DetoCreatePageState extends State<DetoCreatePage> {
onPressed: () {},
),
);
// Positioned(
// bottom: 0,
// child: BottomButton(title: '确认提交'),
// )
// ],
// ),
//
}
}

@ -36,7 +36,7 @@ class _CommonRadioState extends State<CommonRadio> {
color: _selected ? kPrimaryColor : Color(0xFF979797),
width: 3.w,
),
borderRadius: BorderRadius.circular(20.w),
borderRadius: BorderRadius.circular(widget.size??20.w),
),
duration: Duration(milliseconds: 300),
curve: Curves.easeInOutCubic,
@ -58,9 +58,13 @@ class _CommonRadioState extends State<CommonRadio> {
),
),
),
10.w.widthBox,
widget.text,
10.w.widthBox,
...widget.text == null
? [SizedBox()]
: [
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:
import 'package:akuCommunity/model/manager/moving_company_model.dart';
import 'package:dio/dio.dart';
import 'package:flustars/flustars.dart';
@ -27,10 +28,11 @@ class ManagerFunc {
}
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(
API.manager.reportRepairInsert,
params: {
'buildingUnitEstateld': id,
'type': type,
'reportDetail': reportDetail,
'fileUrls': fileUrls,
@ -92,4 +94,12 @@ class ManagerFunc {
);
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
placeholder: R.ASSETS_ICONS_PROPOSAL_PNG,
image: API
.image(userProvider.userInfoModel.imgUrl),
.image(userProvider?.userInfoModel?.imgUrl),
height: 106.w,
width: 106.w,
),

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

Loading…
Cancel
Save