|
|
@ -2,12 +2,17 @@
|
|
|
|
import 'dart:io';
|
|
|
|
import 'dart:io';
|
|
|
|
|
|
|
|
|
|
|
|
// Flutter imports:
|
|
|
|
// Flutter imports:
|
|
|
|
|
|
|
|
import 'package:aku_community_manager/const/api.dart';
|
|
|
|
import 'package:aku_community_manager/ui/manage_pages/facilities/facilities_map.dart';
|
|
|
|
import 'package:aku_community_manager/ui/manage_pages/facilities/facilities_map.dart';
|
|
|
|
|
|
|
|
import 'package:aku_community_manager/utils/network/base_model.dart';
|
|
|
|
|
|
|
|
import 'package:aku_community_manager/utils/network/net_util.dart';
|
|
|
|
|
|
|
|
import 'package:bot_toast/bot_toast.dart';
|
|
|
|
import 'package:flutter/material.dart';
|
|
|
|
import 'package:flutter/material.dart';
|
|
|
|
|
|
|
|
|
|
|
|
// Package imports:
|
|
|
|
// Package imports:
|
|
|
|
import 'package:aku_ui/common_widgets/aku_button.dart';
|
|
|
|
import 'package:aku_ui/common_widgets/aku_button.dart';
|
|
|
|
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
|
|
|
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
|
|
|
|
|
|
|
import 'package:get/get.dart';
|
|
|
|
import 'package:velocity_x/velocity_x.dart';
|
|
|
|
import 'package:velocity_x/velocity_x.dart';
|
|
|
|
|
|
|
|
|
|
|
|
// Project imports:
|
|
|
|
// Project imports:
|
|
|
@ -17,7 +22,13 @@ import 'package:aku_community_manager/ui/widgets/app_widgets/aku_single_check_bu
|
|
|
|
import 'package:aku_community_manager/ui/widgets/common/aku_scaffold.dart';
|
|
|
|
import 'package:aku_community_manager/ui/widgets/common/aku_scaffold.dart';
|
|
|
|
|
|
|
|
|
|
|
|
class FacilitiesInspectReportPage extends StatefulWidget {
|
|
|
|
class FacilitiesInspectReportPage extends StatefulWidget {
|
|
|
|
FacilitiesInspectReportPage({Key key}) : super(key: key);
|
|
|
|
final int facilitiesType;
|
|
|
|
|
|
|
|
final int id;
|
|
|
|
|
|
|
|
FacilitiesInspectReportPage({
|
|
|
|
|
|
|
|
Key key,
|
|
|
|
|
|
|
|
@required this.facilitiesType,
|
|
|
|
|
|
|
|
@required this.id,
|
|
|
|
|
|
|
|
}) : super(key: key);
|
|
|
|
|
|
|
|
|
|
|
|
@override
|
|
|
|
@override
|
|
|
|
_FacilitiesInspectReportPageState createState() =>
|
|
|
|
_FacilitiesInspectReportPageState createState() =>
|
|
|
@ -28,16 +39,20 @@ class _FacilitiesInspectReportPageState
|
|
|
|
extends State<FacilitiesInspectReportPage> {
|
|
|
|
extends State<FacilitiesInspectReportPage> {
|
|
|
|
List<File> _selfPhotos;
|
|
|
|
List<File> _selfPhotos;
|
|
|
|
List<File> _scenePhotos;
|
|
|
|
List<File> _scenePhotos;
|
|
|
|
|
|
|
|
String _describtion;
|
|
|
|
|
|
|
|
int _scene = 0;
|
|
|
|
@override
|
|
|
|
@override
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
return AkuScaffold(
|
|
|
|
return AkuScaffold(
|
|
|
|
title: '检查报告',
|
|
|
|
title: '检查报告',
|
|
|
|
body: ListView(
|
|
|
|
body: ListView(
|
|
|
|
children: [
|
|
|
|
children: [
|
|
|
|
_basicMessageCard(),
|
|
|
|
// _basicMessageCard(),
|
|
|
|
_descriptionCard('场地情况', 0),
|
|
|
|
_descriptionCard(
|
|
|
|
|
|
|
|
widget.facilitiesType == 1 ? '设施情况' : '设备情况',
|
|
|
|
|
|
|
|
),
|
|
|
|
_scenePhotoCard(),
|
|
|
|
_scenePhotoCard(),
|
|
|
|
_selfPhotoCard(),
|
|
|
|
// _selfPhotoCard(),
|
|
|
|
],
|
|
|
|
],
|
|
|
|
),
|
|
|
|
),
|
|
|
|
bottom: _bottomSubmitButton(),
|
|
|
|
bottom: _bottomSubmitButton(),
|
|
|
@ -46,7 +61,24 @@ class _FacilitiesInspectReportPageState
|
|
|
|
|
|
|
|
|
|
|
|
Widget _bottomSubmitButton() {
|
|
|
|
Widget _bottomSubmitButton() {
|
|
|
|
return AkuButton(
|
|
|
|
return AkuButton(
|
|
|
|
onPressed: () {},
|
|
|
|
onPressed: () async {
|
|
|
|
|
|
|
|
List<String> _scenePhotoUrl = await NetUtil().uploadFiles(
|
|
|
|
|
|
|
|
_scenePhotos,
|
|
|
|
|
|
|
|
API.upload.uploadFacilitiCheckPhoto,
|
|
|
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
BaseModel baseModel =
|
|
|
|
|
|
|
|
await NetUtil().post(API.manage.submitFacilitiesCheckInfo, params: {
|
|
|
|
|
|
|
|
"id": widget.id,
|
|
|
|
|
|
|
|
"situation": _scene,
|
|
|
|
|
|
|
|
"detail": _describtion,
|
|
|
|
|
|
|
|
"imgUrls": _scenePhotoUrl,
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
if (baseModel.status) {
|
|
|
|
|
|
|
|
Get.back();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
BotToast.showText(text: baseModel.message);
|
|
|
|
|
|
|
|
},
|
|
|
|
width: double.infinity,
|
|
|
|
width: double.infinity,
|
|
|
|
height: 100.w,
|
|
|
|
height: 100.w,
|
|
|
|
child: '立即提交'.text.color(kTextPrimaryColor).bold.size(32.sp).make(),
|
|
|
|
child: '立即提交'.text.color(kTextPrimaryColor).bold.size(32.sp).make(),
|
|
|
@ -104,11 +136,9 @@ class _FacilitiesInspectReportPageState
|
|
|
|
);
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
int _scene = 0;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Widget _descriptionCard(
|
|
|
|
Widget _descriptionCard(
|
|
|
|
String title,
|
|
|
|
String title,
|
|
|
|
int index,
|
|
|
|
// int index,
|
|
|
|
) {
|
|
|
|
) {
|
|
|
|
return Column(
|
|
|
|
return Column(
|
|
|
|
children: [
|
|
|
|
children: [
|
|
|
@ -156,7 +186,9 @@ class _FacilitiesInspectReportPageState
|
|
|
|
minLines: 5,
|
|
|
|
minLines: 5,
|
|
|
|
maxLines: 10,
|
|
|
|
maxLines: 10,
|
|
|
|
autofocus: false,
|
|
|
|
autofocus: false,
|
|
|
|
onChanged: (value) {},
|
|
|
|
onChanged: (value) {
|
|
|
|
|
|
|
|
_describtion = value;
|
|
|
|
|
|
|
|
},
|
|
|
|
decoration: InputDecoration(
|
|
|
|
decoration: InputDecoration(
|
|
|
|
hintText: '请详细描述异常情况',
|
|
|
|
hintText: '请详细描述异常情况',
|
|
|
|
hintStyle: TextStyle(
|
|
|
|
hintStyle: TextStyle(
|
|
|
|