* 'master' of 192.168.2.201:laiiihz/akuCommunity: finish deto create page 对接接口:提交物品出户信息 对接接口:获取搬家公司电话 update 报事报修接口 add moving company select page update deto create pagehmxc
commit
e8c1d86fd1
@ -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;
|
||||
}
|
||||
}
|
@ -0,0 +1,165 @@
|
||||
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:akuCommunity/widget/buttons/bottom_button.dart';
|
||||
import 'package:bot_toast/bot_toast.dart';
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:akuCommunity/utils/headers.dart';
|
||||
import 'package:flutter_easyrefresh/easy_refresh.dart';
|
||||
import 'package:get/get.dart';
|
||||
|
||||
class SelectMoveCompanyPage extends StatefulWidget {
|
||||
SelectMoveCompanyPage({Key key}) : super(key: key);
|
||||
|
||||
@override
|
||||
_SelectMoveCompanyPageState createState() => _SelectMoveCompanyPageState();
|
||||
}
|
||||
|
||||
class _SelectMoveCompanyPageState extends State<SelectMoveCompanyPage> {
|
||||
int _selected;
|
||||
MovingCompanyModel _companyModel;
|
||||
EasyRefreshController _controller;
|
||||
bool _onloading = true;
|
||||
String get result {
|
||||
if (_selected == _companyModel.appMovingCompanyVoList.length) {
|
||||
return null;
|
||||
} else {
|
||||
return _companyModel.appMovingCompanyVoList[_selected].tel;
|
||||
}
|
||||
}
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
super.initState();
|
||||
_controller = EasyRefreshController();
|
||||
}
|
||||
|
||||
@override
|
||||
void dispose() {
|
||||
_controller = EasyRefreshController();
|
||||
super.dispose();
|
||||
}
|
||||
|
||||
Widget _buildCard(int index, String name, String tel) {
|
||||
return GestureDetector(
|
||||
onTap: () {
|
||||
_selected = index;
|
||||
setState(() {});
|
||||
},
|
||||
child: Container(
|
||||
padding: EdgeInsets.symmetric(vertical: 28.w),
|
||||
child: Row(
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
children: [
|
||||
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 GestureDetector(
|
||||
onTap: () {
|
||||
_selected = index;
|
||||
setState(() {});
|
||||
},
|
||||
child: Container(
|
||||
padding: EdgeInsets.symmetric(vertical: 28.w),
|
||||
child: Row(
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
children: [
|
||||
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()
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
Widget _emptyWidget() {
|
||||
return Container();
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return BeeScaffold(
|
||||
title: '搬家公司',
|
||||
body: EasyRefresh(
|
||||
firstRefresh: true,
|
||||
controller: _controller,
|
||||
onRefresh: () async {
|
||||
_companyModel = await ManagerFunc.getMovingCompanyTel();
|
||||
_onloading = false;
|
||||
setState(() {});
|
||||
},
|
||||
header: MaterialHeader(),
|
||||
child: _onloading
|
||||
? _emptyWidget()
|
||||
: 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()),
|
||||
),
|
||||
),
|
||||
bottomNavi: BottomButton(
|
||||
child: '确定'.text.color(ktextPrimary).size(32.sp).bold.make(),
|
||||
onPressed: () {
|
||||
if (_selected == null) {
|
||||
BotToast.showText(text: '请选择搬家公司!');
|
||||
} else {
|
||||
Get.back(result: result);
|
||||
}
|
||||
},
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
@ -0,0 +1,9 @@
|
||||
class BeeParse{
|
||||
static int getEstateNameId(String estateName) {
|
||||
int a = int.parse(estateName.split('|')[0]);
|
||||
return a;
|
||||
}
|
||||
static String getEstateName(String estateNmae) {
|
||||
return estateNmae.split('|')[1];
|
||||
}
|
||||
}
|
Loading…
Reference in new issue