parent
72032e06a1
commit
c77c8170b4
@ -1,20 +1,29 @@
|
||||
import 'package:aku_community_manager/mock_models/outdoor_models/outdoor_model.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
class OutdoorProvider extends ChangeNotifier{
|
||||
List<ItemsOutdoorModel> _itemOutdoorModel=ItemsOutdoorModel.initList();
|
||||
class OutdoorProvider extends ChangeNotifier {
|
||||
List<ItemsOutdoorModel> _itemOutdoorModel = ItemsOutdoorModel.initList();
|
||||
List<ItemsOutdoorModel> get itemOutdoorModels => _itemOutdoorModel;
|
||||
addOutdoormodel(ItemsOutdoorModel model){
|
||||
addOutdoormodel(ItemsOutdoorModel model) {
|
||||
_itemOutdoorModel.insert(0, model);
|
||||
notifyListeners();
|
||||
notifyListeners();
|
||||
}
|
||||
|
||||
List<ItemsOutdoorModel> getOutdoorModels(int index) {
|
||||
return [
|
||||
_itemOutdoorModel
|
||||
.where((element) => element.status == OUTDOORSTATUS.NOT_OUT)
|
||||
.toList(),
|
||||
_itemOutdoorModel
|
||||
.where((element) => element.status == OUTDOORSTATUS.OUT_DONE)
|
||||
.toList(),
|
||||
_itemOutdoorModel
|
||||
.where((element) => element.status == OUTDOORSTATUS.REJECTED)
|
||||
.toList(),
|
||||
_itemOutdoorModel
|
||||
.where((element) => element.status == OUTDOORSTATUS.CANCELLATION)
|
||||
.toList(),
|
||||
_itemOutdoorModel,
|
||||
][index];
|
||||
}
|
||||
List<ItemsOutdoorModel> getOutdoorModels(int index){
|
||||
return [
|
||||
_itemOutdoorModel.where((element) => element.status==OUTDOORSTATUS.NOT_OUT).toList(),
|
||||
_itemOutdoorModel.where((element) => element.status==OUTDOORSTATUS.OUT_DONE).toList(),
|
||||
_itemOutdoorModel.where((element) => element.status==OUTDOORSTATUS.REJECTED).toList(),
|
||||
_itemOutdoorModel.where((element) => element.status==OUTDOORSTATUS.CANCELLATION).toList(),
|
||||
_itemOutdoorModel,
|
||||
][index];
|
||||
}
|
||||
}
|
@ -0,0 +1,209 @@
|
||||
import 'package:aku_community_manager/mock_models/outdoor_models/outdoor_model.dart';
|
||||
import 'package:aku_community_manager/style/app_style.dart';
|
||||
import 'package:aku_community_manager/tools/widget_tool.dart';
|
||||
import 'package:aku_community_manager/ui/widgets/common/aku_radio.dart';
|
||||
import 'package:aku_community_manager/ui/widgets/common/aku_scaffold.dart';
|
||||
import 'package:aku_ui/common_widgets/aku_common_widgets.dart';
|
||||
import 'package:bot_toast/bot_toast.dart';
|
||||
import 'package:common_utils/common_utils.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:get/get.dart';
|
||||
|
||||
class OutdoorNotpassPage extends StatefulWidget {
|
||||
final ItemsOutdoorModel model;
|
||||
OutdoorNotpassPage({Key key, @required this.model}) : super(key: key);
|
||||
|
||||
@override
|
||||
_OutdoorNotpassPageState createState() => _OutdoorNotpassPageState();
|
||||
}
|
||||
|
||||
class _OutdoorNotpassPageState extends State<OutdoorNotpassPage> {
|
||||
String _currentTime = DateUtil.formatDate(DateTime.now());
|
||||
List<String> _rejectReason = ['业主不同意', '申报物品与实际不符', '该房子处于法院查封状态', '其他'];
|
||||
int _select = 0;
|
||||
TextEditingController _textEditingController;
|
||||
@override
|
||||
void initState() {
|
||||
super.initState();
|
||||
_textEditingController = TextEditingController();
|
||||
}
|
||||
|
||||
@override
|
||||
void dispose() {
|
||||
_textEditingController?.dispose();
|
||||
super.dispose();
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return AkuScaffold(
|
||||
title: '不放行',
|
||||
body: Column(
|
||||
children: [
|
||||
AkuBox.h(16),
|
||||
Container(
|
||||
padding: EdgeInsets.only(
|
||||
left: 32.w,
|
||||
),
|
||||
color: Color(0xFFFFFFFF),
|
||||
alignment: Alignment.center,
|
||||
width: double.infinity,
|
||||
height: 96.w,
|
||||
child: Row(
|
||||
children: [
|
||||
Text(
|
||||
'当前时间',
|
||||
style: AppStyle().secondaryTextStyle,
|
||||
),
|
||||
AkuBox.w(80),
|
||||
Text(
|
||||
_currentTime,
|
||||
style: AppStyle().primaryStyle,
|
||||
),
|
||||
Spacer(),
|
||||
],
|
||||
),
|
||||
),
|
||||
Divider(
|
||||
height: 1.w,
|
||||
),
|
||||
Container(
|
||||
padding: EdgeInsets.only(top: 28.w, left: 32.w),
|
||||
color: Color(0xFFFFFFFF),
|
||||
height: 328.w,
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.start,
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Text(
|
||||
'不放行理由',
|
||||
style: AppStyle().secondaryTextStyle,
|
||||
),
|
||||
AkuBox.w(52),
|
||||
Expanded(
|
||||
child: Column(
|
||||
children: [
|
||||
Row(
|
||||
children: [
|
||||
AkuRadio(
|
||||
size: 32.w,
|
||||
value: 0,
|
||||
grouvalue: _select,
|
||||
onchanged: (newvalue) {
|
||||
setState(() {
|
||||
_select = newvalue;
|
||||
});
|
||||
},
|
||||
),
|
||||
AkuBox.w(16),
|
||||
Text(
|
||||
_rejectReason[0],
|
||||
style: AppStyle().primaryStyle,
|
||||
),
|
||||
],
|
||||
),
|
||||
Spacer(),
|
||||
Row(
|
||||
children: [
|
||||
AkuRadio(
|
||||
size: 32.w,
|
||||
value: 1,
|
||||
grouvalue: _select,
|
||||
onchanged: (newvalue) {
|
||||
setState(() {
|
||||
_select = newvalue;
|
||||
});
|
||||
},
|
||||
),
|
||||
AkuBox.w(16),
|
||||
Text(
|
||||
_rejectReason[1],
|
||||
style: AppStyle().primaryStyle,
|
||||
),
|
||||
],
|
||||
),
|
||||
Spacer(),
|
||||
Row(
|
||||
children: [
|
||||
AkuRadio(
|
||||
size: 32.w,
|
||||
value: 2,
|
||||
grouvalue: _select,
|
||||
onchanged: (newvalue) {
|
||||
setState(() {
|
||||
_select = newvalue;
|
||||
});
|
||||
},
|
||||
),
|
||||
AkuBox.w(16),
|
||||
Text(
|
||||
_rejectReason[2],
|
||||
style: AppStyle().primaryStyle,
|
||||
),
|
||||
],
|
||||
),
|
||||
Spacer(),
|
||||
Row(
|
||||
children: [
|
||||
AkuRadio(
|
||||
size: 32.w,
|
||||
value: 3,
|
||||
grouvalue: _select,
|
||||
onchanged: (newvalue) {
|
||||
setState(() {
|
||||
_select = newvalue;
|
||||
});
|
||||
},
|
||||
),
|
||||
AkuBox.w(16),
|
||||
Text(
|
||||
_rejectReason[3],
|
||||
style: AppStyle().primaryStyle,
|
||||
),
|
||||
],
|
||||
),
|
||||
Container(
|
||||
height: 96.w,
|
||||
child: TextFormField(
|
||||
controller: _textEditingController,
|
||||
style: TextStyle(
|
||||
color: AppStyle.primaryTextColor, fontSize: 32.w),
|
||||
decoration: InputDecoration(
|
||||
border: InputBorder.none,
|
||||
hintText: '请输入其他理由',
|
||||
hintStyle: AppStyle().secondaryTextStyle),
|
||||
)),
|
||||
],
|
||||
)),
|
||||
],
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
bottom: AkuButton(
|
||||
onPressed: () {
|
||||
widget.model.finalOutTime = _currentTime;
|
||||
widget.model.datetime = DateTime.now();
|
||||
_select == 3
|
||||
? widget.model.rejectReason = _textEditingController.text
|
||||
: widget.model.rejectReason = _rejectReason[_select];
|
||||
widget.model.status = OUTDOORSTATUS.REJECTED;
|
||||
Get.back();
|
||||
Get.back();
|
||||
},
|
||||
child: Container(
|
||||
color: Color(0xFFFFC40C),
|
||||
height: 98.w,
|
||||
alignment: Alignment.center,
|
||||
child: Text(
|
||||
'确认不放行',
|
||||
style: TextStyle(
|
||||
color: AppStyle.primaryTextColor,
|
||||
fontSize: 32.sp,
|
||||
fontWeight: FontWeight.bold),
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
@ -0,0 +1,137 @@
|
||||
import 'package:aku_community_manager/mock_models/outdoor_models/outdoor_model.dart';
|
||||
import 'package:aku_community_manager/provider/outdoor_provider.dart';
|
||||
import 'package:aku_community_manager/style/app_style.dart';
|
||||
import 'package:aku_community_manager/tools/widget_tool.dart';
|
||||
import 'package:aku_community_manager/ui/sub_pages/items_outdoor/items_outdoor_details_page.dart';
|
||||
import 'package:aku_community_manager/ui/widgets/common/aku_scaffold.dart';
|
||||
import 'package:aku_ui/common_widgets/aku_common_widgets.dart';
|
||||
import 'package:bot_toast/bot_toast.dart';
|
||||
import 'package:common_utils/common_utils.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
|
||||
class OutdoorPassPage extends StatefulWidget {
|
||||
final ItemsOutdoorModel model;
|
||||
OutdoorPassPage({Key key,@required this.model}) : super(key: key);
|
||||
|
||||
@override
|
||||
_OutdoorPassPageState createState() => _OutdoorPassPageState();
|
||||
}
|
||||
|
||||
class _OutdoorPassPageState extends State<OutdoorPassPage> {
|
||||
TextEditingController _textController;
|
||||
@override
|
||||
void initState() {
|
||||
super.initState();
|
||||
_textController = TextEditingController();
|
||||
}
|
||||
|
||||
@override
|
||||
void dispose() {
|
||||
_textController?.dispose();
|
||||
super.dispose();
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
OutdoorProvider _outdoorModels = Provider.of<OutdoorProvider>(context);
|
||||
String _currentTime = DateUtil.formatDate(DateTime.now());
|
||||
|
||||
return AkuScaffold(
|
||||
title: '放行',
|
||||
body: Column(
|
||||
children: [
|
||||
AkuBox.h(16),
|
||||
Container(
|
||||
padding: EdgeInsets.only(
|
||||
left: 32.w,
|
||||
),
|
||||
color: Color(0xFFFFFFFF),
|
||||
alignment: Alignment.center,
|
||||
width: double.infinity,
|
||||
height: 96.w,
|
||||
child: Row(
|
||||
children: [
|
||||
Text(
|
||||
'当前时间',
|
||||
style: AppStyle().secondaryTextStyle,
|
||||
),
|
||||
AkuBox.w(80),
|
||||
Text(
|
||||
_currentTime,
|
||||
style: AppStyle().primaryStyle,
|
||||
),
|
||||
Spacer(),
|
||||
],
|
||||
),
|
||||
),
|
||||
Divider(
|
||||
height: 1.w,
|
||||
),
|
||||
Container(
|
||||
padding: EdgeInsets.only(left: 32.w),
|
||||
color: Color(0xFFFFFFFF),
|
||||
alignment: Alignment.center,
|
||||
width: double.infinity,
|
||||
height: 96.w,
|
||||
child: Row(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
Text(
|
||||
'当前出口',
|
||||
style: AppStyle().secondaryTextStyle,
|
||||
),
|
||||
AkuBox.w(32),
|
||||
Expanded(
|
||||
child: Container(
|
||||
height: double.infinity,
|
||||
width: double.infinity,
|
||||
padding: EdgeInsets.only(left: 48.w),
|
||||
child: TextFormField(
|
||||
controller: _textController,
|
||||
maxLines: 1,
|
||||
style: TextStyle(
|
||||
color: AppStyle.primaryTextColor,
|
||||
fontSize: 32.sp,
|
||||
),
|
||||
decoration: InputDecoration(
|
||||
hintText: '请输入当前入口',
|
||||
hintStyle: AppStyle().secondaryTextStyle,
|
||||
border: InputBorder.none),
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
bottom: AkuButton(
|
||||
onPressed:_textController.text==null?(){
|
||||
BotToast.showText(text: '出口不能为空!');
|
||||
}: () {
|
||||
widget.model.finalOutTime=_currentTime;
|
||||
widget.model.outPlace=_textController.text;
|
||||
widget.model.datetime=DateTime.now();
|
||||
widget.model.status=OUTDOORSTATUS.OUT_DONE;
|
||||
Get.back();
|
||||
Get.back();
|
||||
},
|
||||
child: Container(
|
||||
color: Color(0xFFFFC40C),
|
||||
height: 98.w,
|
||||
alignment: Alignment.center,
|
||||
child: Text(
|
||||
'确认放行',
|
||||
style: TextStyle(
|
||||
color: AppStyle.primaryTextColor,
|
||||
fontSize: 32.sp,
|
||||
fontWeight: FontWeight.bold),
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
@ -0,0 +1,49 @@
|
||||
import 'dart:ffi';
|
||||
|
||||
import 'package:aku_community_manager/style/app_style.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
class AkuRadio extends StatefulWidget {
|
||||
final double size;
|
||||
final int grouvalue;
|
||||
final int value;
|
||||
final AkuValueChange onchanged;
|
||||
AkuRadio({Key key, this.size, this.grouvalue, this.value, this.onchanged})
|
||||
: super(key: key);
|
||||
|
||||
@override
|
||||
_AkuRadioState createState() => _AkuRadioState();
|
||||
}
|
||||
|
||||
class _AkuRadioState extends State<AkuRadio> {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return GestureDetector(
|
||||
onTap: () {
|
||||
widget.onchanged(widget.value);
|
||||
},
|
||||
child: Container(
|
||||
alignment: Alignment.center,
|
||||
width: widget.size,
|
||||
height: widget.size,
|
||||
decoration: BoxDecoration(
|
||||
border: Border.all(color: Color(0xFFE8E8E8),width: 2.w),
|
||||
borderRadius: BorderRadius.circular(widget.size / 2),
|
||||
gradient: LinearGradient(
|
||||
begin: Alignment.topLeft,
|
||||
end: Alignment.bottomRight,
|
||||
colors: widget.grouvalue == widget.value
|
||||
? [Color(0xFFFFE080), Color(0xFFFFC40C)]
|
||||
: [Color(0xFFFFFFFF), Color(0xFFFFFFFF)])),
|
||||
child: widget.grouvalue == widget.value
|
||||
? Icon(
|
||||
Icons.check,
|
||||
size: widget.size * 0.8,
|
||||
)
|
||||
: SizedBox(),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
typedef AkuValueChange = void Function(int);
|
Loading…
Reference in new issue