|
|
@ -1,9 +1,16 @@
|
|
|
|
|
|
|
|
import 'dart:io';
|
|
|
|
|
|
|
|
|
|
|
|
import 'package:akuCommunity/base/base_style.dart';
|
|
|
|
import 'package:akuCommunity/base/base_style.dart';
|
|
|
|
|
|
|
|
import 'package:akuCommunity/constants/api.dart';
|
|
|
|
import 'package:akuCommunity/pages/manager_func.dart';
|
|
|
|
import 'package:akuCommunity/pages/manager_func.dart';
|
|
|
|
import 'package:akuCommunity/pages/things_page/widget/finish_fixed_submit_page.dart';
|
|
|
|
import 'package:akuCommunity/pages/things_page/widget/finish_fixed_submit_page.dart';
|
|
|
|
import 'package:akuCommunity/provider/user_provider.dart';
|
|
|
|
import 'package:akuCommunity/provider/user_provider.dart';
|
|
|
|
|
|
|
|
import 'package:akuCommunity/utils/network/base_model.dart';
|
|
|
|
|
|
|
|
import 'package:akuCommunity/utils/network/net_util.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:akuCommunity/widget/picker/grid_image_picker.dart';
|
|
|
|
|
|
|
|
import 'package:bot_toast/bot_toast.dart';
|
|
|
|
import 'package:flutter/cupertino.dart';
|
|
|
|
import 'package:flutter/cupertino.dart';
|
|
|
|
import 'package:flutter/material.dart';
|
|
|
|
import 'package:flutter/material.dart';
|
|
|
|
import 'package:provider/provider.dart';
|
|
|
|
import 'package:provider/provider.dart';
|
|
|
@ -25,6 +32,7 @@ class _AddFixedSubmitPageState extends State<AddFixedSubmitPage> {
|
|
|
|
String reportText;
|
|
|
|
String reportText;
|
|
|
|
List<String> _buttons = ['公区保修', '家庭维修'];
|
|
|
|
List<String> _buttons = ['公区保修', '家庭维修'];
|
|
|
|
int _selectType;
|
|
|
|
int _selectType;
|
|
|
|
|
|
|
|
List<File> _files;
|
|
|
|
@override
|
|
|
|
@override
|
|
|
|
void initState() {
|
|
|
|
void initState() {
|
|
|
|
super.initState();
|
|
|
|
super.initState();
|
|
|
@ -170,26 +178,9 @@ class _AddFixedSubmitPageState extends State<AddFixedSubmitPage> {
|
|
|
|
children: [
|
|
|
|
children: [
|
|
|
|
'添加图片信息(${0}/9)'.text.black.size(28.sp).make(),
|
|
|
|
'添加图片信息(${0}/9)'.text.black.size(28.sp).make(),
|
|
|
|
24.w.heightBox,
|
|
|
|
24.w.heightBox,
|
|
|
|
Row(
|
|
|
|
GridImagePicker(onChange: (files) {
|
|
|
|
children: [
|
|
|
|
_files = files;
|
|
|
|
InkWell(
|
|
|
|
})
|
|
|
|
onTap: () {},
|
|
|
|
|
|
|
|
child: Container(
|
|
|
|
|
|
|
|
alignment: Alignment.center,
|
|
|
|
|
|
|
|
width: 218.w,
|
|
|
|
|
|
|
|
height: 218.w,
|
|
|
|
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
|
|
|
|
borderRadius: BorderRadius.circular(8.w),
|
|
|
|
|
|
|
|
border: Border.all(color: Color(0xFF979797), width: 1.w),
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
child: Icon(
|
|
|
|
|
|
|
|
CupertinoIcons.plus,
|
|
|
|
|
|
|
|
size: 80.w,
|
|
|
|
|
|
|
|
color:Color(0xFFD8D8D8) ,
|
|
|
|
|
|
|
|
)),
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
],
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
],
|
|
|
|
],
|
|
|
|
),
|
|
|
|
),
|
|
|
|
);
|
|
|
|
);
|
|
|
@ -217,10 +208,15 @@ class _AddFixedSubmitPageState extends State<AddFixedSubmitPage> {
|
|
|
|
MaterialButton(
|
|
|
|
MaterialButton(
|
|
|
|
minWidth: double.infinity,
|
|
|
|
minWidth: double.infinity,
|
|
|
|
height: 98.w,
|
|
|
|
height: 98.w,
|
|
|
|
onPressed: () {
|
|
|
|
onPressed: () async {
|
|
|
|
ManagerFunc.reportRepairInsert(
|
|
|
|
List<String> urls =
|
|
|
|
_selectType + 1, _textEditingController.text, []);
|
|
|
|
await NetUtil().uploadFiles(_files, API.upload.uploadRepair);
|
|
|
|
FinishFixedSubmitPage().to();
|
|
|
|
BaseModel baseModel = await ManagerFunc.reportRepairInsert(
|
|
|
|
|
|
|
|
_selectType + 1, _textEditingController.text, urls);
|
|
|
|
|
|
|
|
if (baseModel.status) {
|
|
|
|
|
|
|
|
FinishFixedSubmitPage().to();
|
|
|
|
|
|
|
|
} else
|
|
|
|
|
|
|
|
BotToast.showText(text: baseModel.message);
|
|
|
|
},
|
|
|
|
},
|
|
|
|
child: '确认提交'.text.black.bold.size(32.sp).make(),
|
|
|
|
child: '确认提交'.text.black.bold.size(32.sp).make(),
|
|
|
|
color: kPrimaryColor,
|
|
|
|
color: kPrimaryColor,
|
|
|
|