|
|
@ -1,14 +1,19 @@
|
|
|
|
import 'package:akuCommunity/base/base_style.dart';
|
|
|
|
import 'package:akuCommunity/base/base_style.dart';
|
|
|
|
import 'package:akuCommunity/constants/api.dart';
|
|
|
|
import 'package:akuCommunity/constants/api.dart';
|
|
|
|
import 'package:akuCommunity/model/user/fixed_submit_model.dart';
|
|
|
|
import 'package:akuCommunity/model/user/fixed_submit_model.dart';
|
|
|
|
|
|
|
|
import 'package:akuCommunity/pages/manager_func.dart';
|
|
|
|
import 'package:akuCommunity/pages/things_page/widget/add_fixed_submit_page.dart';
|
|
|
|
import 'package:akuCommunity/pages/things_page/widget/add_fixed_submit_page.dart';
|
|
|
|
import 'package:akuCommunity/pages/things_page/widget/bee_list_view.dart';
|
|
|
|
import 'package:akuCommunity/pages/things_page/widget/bee_list_view.dart';
|
|
|
|
|
|
|
|
import 'package:akuCommunity/pages/things_page/widget/fixed_check_box.dart';
|
|
|
|
|
|
|
|
import 'package:akuCommunity/provider/user_provider.dart';
|
|
|
|
import 'package:akuCommunity/utils/bee_map.dart';
|
|
|
|
import 'package:akuCommunity/utils/bee_map.dart';
|
|
|
|
import 'package:akuCommunity/widget/bee_scaffold.dart';
|
|
|
|
import 'package:akuCommunity/widget/bee_scaffold.dart';
|
|
|
|
import 'package:akuCommunity/widget/horizontal_image_view.dart';
|
|
|
|
import 'package:akuCommunity/widget/horizontal_image_view.dart';
|
|
|
|
|
|
|
|
import 'package:bot_toast/bot_toast.dart';
|
|
|
|
import 'package:flutter/material.dart';
|
|
|
|
import 'package:flutter/material.dart';
|
|
|
|
import 'package:flutter_easyrefresh/easy_refresh.dart';
|
|
|
|
import 'package:flutter_easyrefresh/easy_refresh.dart';
|
|
|
|
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
|
|
|
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
|
|
|
|
|
|
|
import 'package:provider/provider.dart';
|
|
|
|
import 'package:velocity_x/velocity_x.dart';
|
|
|
|
import 'package:velocity_x/velocity_x.dart';
|
|
|
|
import 'package:akuCommunity/extensions/num_ext.dart';
|
|
|
|
import 'package:akuCommunity/extensions/num_ext.dart';
|
|
|
|
import 'package:akuCommunity/extensions/page_router.dart';
|
|
|
|
import 'package:akuCommunity/extensions/page_router.dart';
|
|
|
@ -22,6 +27,8 @@ class FixedSubmitPage extends StatefulWidget {
|
|
|
|
|
|
|
|
|
|
|
|
class _FixedSubmitPageState extends State<FixedSubmitPage> {
|
|
|
|
class _FixedSubmitPageState extends State<FixedSubmitPage> {
|
|
|
|
EasyRefreshController _easyRefreshController;
|
|
|
|
EasyRefreshController _easyRefreshController;
|
|
|
|
|
|
|
|
bool _isEdit = false;
|
|
|
|
|
|
|
|
List<int> _selected = [];
|
|
|
|
@override
|
|
|
|
@override
|
|
|
|
void initState() {
|
|
|
|
void initState() {
|
|
|
|
super.initState();
|
|
|
|
super.initState();
|
|
|
@ -50,8 +57,31 @@ class _FixedSubmitPageState extends State<FixedSubmitPage> {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
bool _canSkew(int state) {
|
|
|
|
|
|
|
|
switch (state) {
|
|
|
|
|
|
|
|
case 1:
|
|
|
|
|
|
|
|
case 2:
|
|
|
|
|
|
|
|
case 3:
|
|
|
|
|
|
|
|
return false;
|
|
|
|
|
|
|
|
case 4:
|
|
|
|
|
|
|
|
case 5:
|
|
|
|
|
|
|
|
case 6:
|
|
|
|
|
|
|
|
case 7:
|
|
|
|
|
|
|
|
return true;
|
|
|
|
|
|
|
|
default:
|
|
|
|
|
|
|
|
return true;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
Widget _buildCard(FixedSubmitModel model) {
|
|
|
|
Widget _buildCard(FixedSubmitModel model) {
|
|
|
|
return Container(
|
|
|
|
return AnimatedPositioned(
|
|
|
|
|
|
|
|
top: 0,
|
|
|
|
|
|
|
|
left: (_canSkew(4) && _isEdit) ? 55.w : 0,
|
|
|
|
|
|
|
|
bottom: 0,
|
|
|
|
|
|
|
|
duration: Duration(milliseconds: 300),
|
|
|
|
|
|
|
|
curve: Curves.easeInOutCubic,
|
|
|
|
|
|
|
|
child: Container(
|
|
|
|
|
|
|
|
width: 686.w,
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
color: kForeGroundColor, borderRadius: BorderRadius.circular(8.w)),
|
|
|
|
color: kForeGroundColor, borderRadius: BorderRadius.circular(8.w)),
|
|
|
|
padding: EdgeInsets.symmetric(horizontal: 24.w, vertical: 24.w),
|
|
|
|
padding: EdgeInsets.symmetric(horizontal: 24.w, vertical: 24.w),
|
|
|
@ -94,13 +124,40 @@ class _FixedSubmitPageState extends State<FixedSubmitPage> {
|
|
|
|
: SizedBox(),
|
|
|
|
: SizedBox(),
|
|
|
|
],
|
|
|
|
],
|
|
|
|
),
|
|
|
|
),
|
|
|
|
|
|
|
|
),
|
|
|
|
);
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Widget _buildCheckBox(FixedSubmitModel model) {
|
|
|
|
|
|
|
|
return Container(
|
|
|
|
|
|
|
|
alignment: Alignment.centerLeft,
|
|
|
|
|
|
|
|
constraints: BoxConstraints(minHeight: 384.w, minWidth: 686.w),
|
|
|
|
|
|
|
|
child: FixedCheckBox(
|
|
|
|
|
|
|
|
onChanged: (isSelect) {
|
|
|
|
|
|
|
|
if (isSelect) {
|
|
|
|
|
|
|
|
_selected.add(model.id);
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
_selected.remove(model.id);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
));
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@override
|
|
|
|
@override
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
|
|
|
|
UserProvider userProvider = Provider.of<UserProvider>(context);
|
|
|
|
return BeeScaffold(
|
|
|
|
return BeeScaffold(
|
|
|
|
title: '报事报修',
|
|
|
|
title: '报事报修',
|
|
|
|
|
|
|
|
actions: [
|
|
|
|
|
|
|
|
IconButton(
|
|
|
|
|
|
|
|
icon: _isEdit
|
|
|
|
|
|
|
|
? '完成'.text.black.size(28.sp).make()
|
|
|
|
|
|
|
|
: '编辑'.text.black.size(28.sp).make(),
|
|
|
|
|
|
|
|
onPressed: () {
|
|
|
|
|
|
|
|
_isEdit = !_isEdit;
|
|
|
|
|
|
|
|
setState(() {});
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
],
|
|
|
|
body: Column(
|
|
|
|
body: Column(
|
|
|
|
children: [
|
|
|
|
children: [
|
|
|
|
BeeListView(
|
|
|
|
BeeListView(
|
|
|
@ -115,7 +172,12 @@ class _FixedSubmitPageState extends State<FixedSubmitPage> {
|
|
|
|
return ListView.separated(
|
|
|
|
return ListView.separated(
|
|
|
|
padding: EdgeInsets.all(32.w),
|
|
|
|
padding: EdgeInsets.all(32.w),
|
|
|
|
itemBuilder: (context, index) {
|
|
|
|
itemBuilder: (context, index) {
|
|
|
|
return _buildCard(items[index]);
|
|
|
|
return Stack(
|
|
|
|
|
|
|
|
children: [
|
|
|
|
|
|
|
|
_buildCheckBox(items[index]),
|
|
|
|
|
|
|
|
_buildCard(items[index])
|
|
|
|
|
|
|
|
],
|
|
|
|
|
|
|
|
);
|
|
|
|
},
|
|
|
|
},
|
|
|
|
separatorBuilder: (context, index) {
|
|
|
|
separatorBuilder: (context, index) {
|
|
|
|
return 24.w.heightBox;
|
|
|
|
return 24.w.heightBox;
|
|
|
@ -124,10 +186,19 @@ class _FixedSubmitPageState extends State<FixedSubmitPage> {
|
|
|
|
},
|
|
|
|
},
|
|
|
|
).expand(),
|
|
|
|
).expand(),
|
|
|
|
MaterialButton(
|
|
|
|
MaterialButton(
|
|
|
|
onPressed: () {
|
|
|
|
onPressed: _isEdit
|
|
|
|
AddFixedSubmitPage().to();
|
|
|
|
? () {
|
|
|
|
|
|
|
|
ManagerFunc.reportRepairDelete(_selected);
|
|
|
|
|
|
|
|
_easyRefreshController.callRefresh();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
: () {
|
|
|
|
|
|
|
|
userProvider.isLogin
|
|
|
|
|
|
|
|
? AddFixedSubmitPage().to()
|
|
|
|
|
|
|
|
: BotToast.showText(text: '请先登录!');
|
|
|
|
},
|
|
|
|
},
|
|
|
|
child: '新增'.text.bold.color(ktextPrimary).size(32.sp).make(),
|
|
|
|
child: _isEdit
|
|
|
|
|
|
|
|
? '删除订单'.text.bold.color(ktextPrimary).size(32.sp).make()
|
|
|
|
|
|
|
|
: '新增'.text.bold.color(ktextPrimary).size(32.sp).make(),
|
|
|
|
minWidth: double.infinity,
|
|
|
|
minWidth: double.infinity,
|
|
|
|
height: 98.w,
|
|
|
|
height: 98.w,
|
|
|
|
elevation: 0,
|
|
|
|
elevation: 0,
|
|
|
|