parent
cd29224814
commit
179ff34094
@ -0,0 +1,75 @@
|
|||||||
|
import 'package:aku_community_manager/models/common/img_model.dart';
|
||||||
|
|
||||||
|
class FacilitiesCheckListModel {
|
||||||
|
int id;
|
||||||
|
String code;
|
||||||
|
String facilitiesName;
|
||||||
|
String facilitiesAddress;
|
||||||
|
int status;
|
||||||
|
String beginDate;
|
||||||
|
String endDate;
|
||||||
|
int situation;
|
||||||
|
String detail;
|
||||||
|
String checkDate;
|
||||||
|
List<ImgModel> imgList;
|
||||||
|
|
||||||
|
FacilitiesCheckListModel(
|
||||||
|
{this.id,
|
||||||
|
this.code,
|
||||||
|
this.facilitiesName,
|
||||||
|
this.facilitiesAddress,
|
||||||
|
this.status,
|
||||||
|
this.beginDate,
|
||||||
|
this.endDate,
|
||||||
|
this.situation,
|
||||||
|
this.detail,
|
||||||
|
this.checkDate,
|
||||||
|
this.imgList});
|
||||||
|
|
||||||
|
String get situationString {
|
||||||
|
switch (this.situation) {
|
||||||
|
case 1:
|
||||||
|
return '正常';
|
||||||
|
case 2:
|
||||||
|
return '异常';
|
||||||
|
default:
|
||||||
|
return '未知';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
FacilitiesCheckListModel.fromJson(Map<String, dynamic> json) {
|
||||||
|
id = json['id'];
|
||||||
|
code = json['code'];
|
||||||
|
facilitiesName = json['facilitiesName'];
|
||||||
|
facilitiesAddress = json['facilitiesAddress'];
|
||||||
|
status = json['status'];
|
||||||
|
beginDate = json['beginDate'];
|
||||||
|
endDate = json['endDate'];
|
||||||
|
situation = json['situation'];
|
||||||
|
detail = json['detail'];
|
||||||
|
checkDate = json['checkDate'];
|
||||||
|
if (json['imgList'] != null) {
|
||||||
|
imgList = new List<ImgModel>();
|
||||||
|
json['imgList'].forEach((v) {
|
||||||
|
imgList.add(new ImgModel.fromJson(v));
|
||||||
|
});
|
||||||
|
} else
|
||||||
|
imgList = [];
|
||||||
|
}
|
||||||
|
|
||||||
|
Map<String, dynamic> toJson() {
|
||||||
|
final Map<String, dynamic> data = new Map<String, dynamic>();
|
||||||
|
data['id'] = this.id;
|
||||||
|
data['code'] = this.code;
|
||||||
|
data['facilitiesName'] = this.facilitiesName;
|
||||||
|
data['facilitiesAddress'] = this.facilitiesAddress;
|
||||||
|
data['status'] = this.status;
|
||||||
|
data['beginDate'] = this.beginDate;
|
||||||
|
data['endDate'] = this.endDate;
|
||||||
|
data['situation'] = this.situation;
|
||||||
|
data['detail'] = this.detail;
|
||||||
|
data['checkDate'] = this.checkDate;
|
||||||
|
data['imgList'] = this.imgList;
|
||||||
|
return data;
|
||||||
|
}
|
||||||
|
}
|
@ -1,30 +0,0 @@
|
|||||||
// Flutter imports:
|
|
||||||
import 'package:flutter/material.dart';
|
|
||||||
|
|
||||||
// Package imports:
|
|
||||||
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
|
||||||
|
|
||||||
// Project imports:
|
|
||||||
import 'package:aku_community_manager/models/manager/facilities/facilities_card.dart';
|
|
||||||
|
|
||||||
class FacilitiesView extends StatefulWidget {
|
|
||||||
final int index;
|
|
||||||
FacilitiesView({Key key, this.index}) : super(key: key);
|
|
||||||
|
|
||||||
@override
|
|
||||||
_FacilitiesViewState createState() => _FacilitiesViewState();
|
|
||||||
}
|
|
||||||
|
|
||||||
class _FacilitiesViewState extends State<FacilitiesView> {
|
|
||||||
@override
|
|
||||||
Widget build(BuildContext context) {
|
|
||||||
return ListView(
|
|
||||||
padding: EdgeInsets.symmetric(vertical: 16.w, horizontal: 32.w),
|
|
||||||
children: [
|
|
||||||
FacilitiesCard(
|
|
||||||
index: widget.index,
|
|
||||||
),
|
|
||||||
],
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
@ -0,0 +1,65 @@
|
|||||||
|
|
||||||
|
import 'package:aku_community_manager/ui/manage_pages/facilities/facilities_page.dart';
|
||||||
|
import 'package:aku_community_manager/ui/widgets/common/aku_scaffold.dart';
|
||||||
|
import 'package:flutter/cupertino.dart';
|
||||||
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
||||||
|
import 'package:get/get.dart';
|
||||||
|
import 'package:velocity_x/velocity_x.dart';
|
||||||
|
import 'package:aku_community_manager/const/resource.dart';
|
||||||
|
import 'package:aku_community_manager/tools/extensions/list_extension_tool.dart';
|
||||||
|
class FacilitiesSelectPage extends StatefulWidget {
|
||||||
|
FacilitiesSelectPage({Key key}) : super(key: key);
|
||||||
|
|
||||||
|
@override
|
||||||
|
_FacilitiesSelectPageState createState() => _FacilitiesSelectPageState();
|
||||||
|
}
|
||||||
|
|
||||||
|
class _FacilitiesSelectPageState extends State<FacilitiesSelectPage> {
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
return AkuScaffold(
|
||||||
|
title: '借还管理',
|
||||||
|
body: ListView(
|
||||||
|
padding: EdgeInsets.symmetric(vertical: 40.w, horizontal: 36.w),
|
||||||
|
children: [
|
||||||
|
_buidTile(R.ASSETS_MANAGE_IC_RENWU_PNG, '设施检查', 1),
|
||||||
|
_buidTile(R.ASSETS_MANAGE_IC_RENWU_PNG, '设备检查', 2),
|
||||||
|
].sepWidget(separate: 20.w.heightBox),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
Widget _buidTile(String iconPath, String text, int type) {
|
||||||
|
return Row(
|
||||||
|
children: [
|
||||||
|
SizedBox(
|
||||||
|
width: 32.w,
|
||||||
|
height: 32.w,
|
||||||
|
child: Image.asset(iconPath),
|
||||||
|
),
|
||||||
|
28.w.widthBox,
|
||||||
|
text.text.black.size(30.sp).make(),
|
||||||
|
Spacer(),
|
||||||
|
Icon(
|
||||||
|
CupertinoIcons.chevron_forward,
|
||||||
|
size: 32.w,
|
||||||
|
),
|
||||||
|
],
|
||||||
|
)
|
||||||
|
.box
|
||||||
|
.padding(EdgeInsets.symmetric(vertical: 40.w, horizontal: 32.w))
|
||||||
|
.make()
|
||||||
|
.onInkTap(() {
|
||||||
|
Get.to(
|
||||||
|
() => FacilitiesPage(
|
||||||
|
facilitiesType: type,
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}).material(
|
||||||
|
color: Colors.white,
|
||||||
|
borderRadius: BorderRadius.circular(8.w),
|
||||||
|
clipBehavior: Clip.antiAlias,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,66 @@
|
|||||||
|
// Flutter imports:
|
||||||
|
import 'package:aku_community_manager/const/api.dart';
|
||||||
|
import 'package:aku_community_manager/models/manager/facilities/facilities_check_list_model.dart';
|
||||||
|
import 'package:aku_community_manager/ui/manage_pages/facilities/facilities_card.dart';
|
||||||
|
import 'package:aku_community_manager/ui/widgets/common/bee_list_view.dart';
|
||||||
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:flutter_easyrefresh/easy_refresh.dart';
|
||||||
|
import 'package:velocity_x/velocity_x.dart';
|
||||||
|
|
||||||
|
// Package imports:
|
||||||
|
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
||||||
|
|
||||||
|
// Project imports:
|
||||||
|
|
||||||
|
class FacilitiesView extends StatefulWidget {
|
||||||
|
final int index;
|
||||||
|
final int facilitiesType;
|
||||||
|
FacilitiesView({Key key, this.index, this.facilitiesType}) : super(key: key);
|
||||||
|
|
||||||
|
@override
|
||||||
|
_FacilitiesViewState createState() => _FacilitiesViewState();
|
||||||
|
}
|
||||||
|
|
||||||
|
class _FacilitiesViewState extends State<FacilitiesView> {
|
||||||
|
EasyRefreshController _refreshController;
|
||||||
|
@override
|
||||||
|
void initState() {
|
||||||
|
super.initState();
|
||||||
|
_refreshController = EasyRefreshController();
|
||||||
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
void dispose() {
|
||||||
|
_refreshController.dispose();
|
||||||
|
super.dispose();
|
||||||
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
return BeeListView(
|
||||||
|
path: API.manage.facilitiesCheckList,
|
||||||
|
extraParams: {
|
||||||
|
"facilitiesType": widget.facilitiesType,
|
||||||
|
"executeStatus": widget.index + 1,
|
||||||
|
},
|
||||||
|
controller: _refreshController,
|
||||||
|
convert: (models) {
|
||||||
|
return models.tableList
|
||||||
|
.map((e) => FacilitiesCheckListModel.fromJson(e)).toList();
|
||||||
|
},
|
||||||
|
builder: (items) {
|
||||||
|
return ListView.separated(
|
||||||
|
padding: EdgeInsets.all(32.w),
|
||||||
|
itemBuilder: (context, index) {
|
||||||
|
return FacilitiesCard(
|
||||||
|
index: widget.index,
|
||||||
|
model:items[index],
|
||||||
|
);
|
||||||
|
},
|
||||||
|
separatorBuilder: (_, __) {
|
||||||
|
return 24.w.heightBox;
|
||||||
|
},
|
||||||
|
itemCount: items.length);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in new issue