From 505e61e10d92359c98c0495e8b530d693a2b9a06 Mon Sep 17 00:00:00 2001 From: zhang <494089941@qq.com> Date: Thu, 28 Jan 2021 14:38:05 +0800 Subject: [PATCH] =?UTF-8?q?update=20=E6=8A=A5=E4=BA=8B=E6=8A=A5=E4=BF=AE?= =?UTF-8?q?=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/pages/manager_func.dart | 2 +- .../widget/add_fixed_submit_page.dart | 47 ++++++++----------- 2 files changed, 20 insertions(+), 29 deletions(-) diff --git a/lib/pages/manager_func.dart b/lib/pages/manager_func.dart index 004708b9..40e5f3b0 100644 --- a/lib/pages/manager_func.dart +++ b/lib/pages/manager_func.dart @@ -32,7 +32,7 @@ class ManagerFunc { BaseModel baseModel = await NetUtil().post( API.manager.reportRepairInsert, params: { - 'buildingUnitEstateld': id, + 'buildingUnitEstateId': id, 'type': type, 'reportDetail': reportDetail, 'fileUrls': fileUrls, diff --git a/lib/pages/things_page/widget/add_fixed_submit_page.dart b/lib/pages/things_page/widget/add_fixed_submit_page.dart index 22740739..3947d1e4 100644 --- a/lib/pages/things_page/widget/add_fixed_submit_page.dart +++ b/lib/pages/things_page/widget/add_fixed_submit_page.dart @@ -161,7 +161,9 @@ class _AddFixedSubmitPageState extends State { width: 686.w, child: TextField( controller: _textEditingController, - onEditingComplete: () {}, + onChanged: (value) { + setState(() {}); + }, maxLines: 10, minLines: 5, decoration: InputDecoration( @@ -204,6 +206,15 @@ class _AddFixedSubmitPageState extends State { } } + int _getBuildUnitEstateNameId(String estateName) { + int a = int.parse(estateName.split('|')[0]); + return a; + } + + String _getEstateName(String estateNmae) { + return estateNmae.split('|')[1]; + } + @override Widget build(BuildContext context) { UserProvider userProvider = Provider.of(context); @@ -217,37 +228,13 @@ class _AddFixedSubmitPageState extends State { kEstateName, userProvider.userDetailModel.estateNames.isEmpty ? '' - : userProvider.userDetailModel.estateNames[0]), + : _getEstateName( + userProvider.userDetailModel.estateNames[0])), _getType(), _buildReportCard(), _addImages(), ], ).expand(), - MaterialButton( - minWidth: double.infinity, - height: 98.w, - onPressed: _canSubmit(_selectType, _textEditingController.text) - ? () async { - List urls = await NetUtil() - .uploadFiles(_files, API.upload.uploadRepair); - BaseModel baseModel = await ManagerFunc.reportRepairInsert(userProvider.userDetailModel.id, - _selectType + 1, _textEditingController.text, urls); - if (baseModel.status) { - FinishFixedSubmitPage().to(); - } else - BotToast.showText(text: baseModel.message); - } - : () { - BotToast.showText(text: '请填写完整报修信息!'); - }, - child: '确认提交'.text.black.bold.size(32.sp).make(), - color: kPrimaryColor, - elevation: 0, - ) - .box - .padding(EdgeInsets.only( - bottom: MediaQuery.of(context).padding.bottom)) - .make() ], ), bottomNavi: BottomButton( @@ -256,7 +243,11 @@ class _AddFixedSubmitPageState extends State { List urls = await NetUtil() .uploadFiles(_files, API.upload.uploadRepair); BaseModel baseModel = await ManagerFunc.reportRepairInsert( - _selectType + 1, _textEditingController.text, urls); + _getBuildUnitEstateNameId( + userProvider.userDetailModel.estateNames[0]), + _selectType + 1, + _textEditingController.text, + urls); if (baseModel.status) { FinishFixedSubmitPage().to(); } else