update fixed submit add page's API

hmxc
张萌 4 years ago
parent bdc2e5922a
commit 31f8b116f6

@ -60,9 +60,12 @@ class _Manager {
/// ///
String get fixedSubmit => '/user/reportRepair/list'; String get fixedSubmit => '/user/reportRepair/list';
///访 ///访访
String get insertVisitorInfo => '/user/visitorAccess/insertVisitorInfo'; String get insertVisitorInfo => '/user/visitorAccess/insertVisitorInfo';
/// ///
String get articleOut => '/user/articleOut/list'; String get articleOut => '/user/articleOut/list';
///app
String get reportRepairInsert => '/user/reportRepair/insert';
} }

@ -14,9 +14,24 @@ class ManagerFunc {
'sex': sex, 'sex': sex,
'tel': tel, 'tel': tel,
'carNum': carNum, 'carNum': carNum,
'expectedVisitDate': DateUtil.formatDate(expectedVisitDate,format: "yyyy-MM-dd HH:mm:ss") 'expectedVisitDate': DateUtil.formatDate(expectedVisitDate,
format: "yyyy-MM-dd HH:mm:ss")
}, },
showMessage: true); showMessage: true);
return baseModel; return baseModel;
} }
static reportRepairInsert(
int type, String reportDetail, List<String> fileUrls) async {
BaseModel baseModel = await NetUtil().post(
API.manager.reportRepairInsert,
params: {
'type': type,
'reportDetail': reportDetail,
'fileUrls': fileUrls,
},
showMessage: true,
);
return baseModel;
}
} }

@ -1,9 +1,11 @@
import 'package:akuCommunity/base/base_style.dart'; import 'package:akuCommunity/base/base_style.dart';
import 'package:akuCommunity/pages/manager_func.dart';
import 'package:akuCommunity/provider/user_provider.dart'; import 'package:akuCommunity/provider/user_provider.dart';
import 'package:akuCommunity/widget/bee_divider.dart'; import 'package:akuCommunity/widget/bee_divider.dart';
import 'package:akuCommunity/widget/bee_scaffold.dart'; import 'package:akuCommunity/widget/bee_scaffold.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:get/get.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:velocity_x/velocity_x.dart'; import 'package:velocity_x/velocity_x.dart';
@ -18,8 +20,22 @@ class AddFixedSubmitPage extends StatefulWidget {
} }
class _AddFixedSubmitPageState extends State<AddFixedSubmitPage> { class _AddFixedSubmitPageState extends State<AddFixedSubmitPage> {
TextEditingController _textEditingController;
String reportText;
List<String> _buttons = ['公区保修', '家庭维修']; List<String> _buttons = ['公区保修', '家庭维修'];
int _groupValue; int _selectType;
@override
void initState() {
super.initState();
_textEditingController = TextEditingController();
}
@override
void dispose() {
_textEditingController?.dispose();
super.dispose();
}
Widget _buildHouseCard( Widget _buildHouseCard(
String title, String title,
String detail, String detail,
@ -74,23 +90,23 @@ class _AddFixedSubmitPageState extends State<AddFixedSubmitPage> {
height: 72.w, height: 72.w,
onPressed: () { onPressed: () {
setState(() { setState(() {
_groupValue = value; _selectType = value;
}); });
}, },
child: title.text child: title.text
.color(_groupValue == value ? ktextPrimary : ktextSubColor) .color(_selectType == value ? ktextPrimary : ktextSubColor)
.size(32.sp) .size(32.sp)
.make(), .make(),
padding: EdgeInsets.symmetric(horizontal: 34.w, vertical: 14.w), padding: EdgeInsets.symmetric(horizontal: 34.w, vertical: 14.w),
shape: RoundedRectangleBorder( shape: RoundedRectangleBorder(
side: BorderSide( side: BorderSide(
color: _groupValue == value ? kPrimaryColor : ktextSubColor, color: _selectType == value ? kPrimaryColor : ktextSubColor,
width: 3.w), width: 3.w),
borderRadius: BorderRadius.circular(36.w)), borderRadius: BorderRadius.circular(36.w)),
); );
} }
Widget _selectType() { Widget _getType() {
return Padding( return Padding(
padding: EdgeInsets.all(32.w), padding: EdgeInsets.all(32.w),
child: Column( child: Column(
@ -128,6 +144,8 @@ class _AddFixedSubmitPageState extends State<AddFixedSubmitPage> {
), ),
width: 686.w, width: 686.w,
child: TextField( child: TextField(
controller: _textEditingController,
onEditingComplete: () {},
maxLines: 10, maxLines: 10,
minLines: 5, minLines: 5,
decoration: InputDecoration( decoration: InputDecoration(
@ -187,7 +205,7 @@ class _AddFixedSubmitPageState extends State<AddFixedSubmitPage> {
userProvider.userDetailModel.estateNames.isEmpty userProvider.userDetailModel.estateNames.isEmpty
? '' ? ''
: userProvider.userDetailModel.estateNames[0]), : userProvider.userDetailModel.estateNames[0]),
_selectType(), _getType(),
_buildReportCard(), _buildReportCard(),
_addImages(), _addImages(),
], ],
@ -195,7 +213,11 @@ class _AddFixedSubmitPageState extends State<AddFixedSubmitPage> {
MaterialButton( MaterialButton(
minWidth: double.infinity, minWidth: double.infinity,
height: 98.w, height: 98.w,
onPressed: () {}, onPressed: () {
ManagerFunc.reportRepairInsert(
_selectType + 1, _textEditingController.text, []);
Get.back();
},
child: '确认提交'.text.black.bold.size(32.sp).make(), child: '确认提交'.text.black.bold.size(32.sp).make(),
color: kPrimaryColor, color: kPrimaryColor,
elevation: 0, elevation: 0,

Loading…
Cancel
Save