发布工单

pull/1/head
张萌 3 years ago
parent 075241dd86
commit 9fa54a5a94

Binary file not shown.

After

Width:  |  Height:  |  Size: 21 KiB

File diff suppressed because it is too large Load Diff

@ -49,8 +49,9 @@ class _PublishTaskPageState extends State<PublishTaskPage> {
// //
int _rewardType = 0; int _rewardType = 0;
//
DateTime? _appointDate; DateTime? _appointDate;
//
DateTime? _appointEndDate; DateTime? _appointEndDate;
TextEditingController _rewardController = TextEditingController(); TextEditingController _rewardController = TextEditingController();
TextEditingController _nameController = TextEditingController(); TextEditingController _nameController = TextEditingController();
@ -58,8 +59,10 @@ class _PublishTaskPageState extends State<PublishTaskPage> {
String? _content; String? _content;
List<File> _photos = []; List<File> _photos = [];
String? _voiceUri; String? _voiceUri;
//
String? _accessAddress; String? _accessAddress;
String? _accessAddressDetail; String? _accessAddressDetail;
//
String? _serviceAddress; String? _serviceAddress;
String? _serviceAddressDetail; String? _serviceAddressDetail;

@ -0,0 +1,326 @@
import 'dart:io';
import 'package:aku_new_community/extensions/num_ext.dart';
import 'package:aku_new_community/ui/function_and_service/task/task_remark_page.dart';
import 'package:aku_new_community/ui/function_and_service/work_order/work_order_map.dart';
import 'package:aku_new_community/widget/bee_divider.dart';
import 'package:aku_new_community/widget/bee_scaffold.dart';
import 'package:aku_new_community/widget/buttons/bee_long_button.dart';
import 'package:aku_new_community/widget/picker/bee_date_picker.dart';
import 'package:aku_new_community/widget/picker/bee_pick_image_widget.dart';
import 'package:aku_new_community/widget/picker/bee_picker_box.dart';
import 'package:common_utils/common_utils.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/src/extensions/string_ext.dart';
class PublishWorkOrderPage extends StatefulWidget {
const PublishWorkOrderPage({Key? key}) : super(key: key);
@override
_PublishWorkOrderPageState createState() => _PublishWorkOrderPageState();
}
class _PublishWorkOrderPageState extends State<PublishWorkOrderPage> {
int _type = 0;
DateTime? _appointDate;
DateTime? _appointEndDate;
TextEditingController _addressController = TextEditingController();
String _remark = '';
List<File> _photos = [];
@override
void initState() {
super.initState();
}
@override
void dispose() {
_addressController.dispose();
super.dispose();
}
@override
Widget build(BuildContext context) {
return BeeScaffold(
title: '发布工单',
body: SafeArea(
child: ListView(
children: [
2.hb,
Container(
width: double.infinity,
color: Colors.white,
height: 164.w,
padding: EdgeInsets.all(32.w),
child: Row(
crossAxisAlignment: CrossAxisAlignment.center,
children: [
CircleAvatar(
maxRadius: 50.w,
),
16.wb,
Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
'李一宣'
.text
.size(28.sp)
.color(Colors.black.withOpacity(0.85))
.make(),
Spacer(),
'租户 | 绿城·碧桂园3栋14单元104室'
.text
.size(24.sp)
.color(Colors.black.withOpacity(0.45))
.make(),
],
),
Spacer(),
GestureDetector(
onTap: () {},
child: Icon(
CupertinoIcons.chevron_right,
size: 40.w,
)),
],
),
),
20.hb,
_baseInfo(context),
],
),
),
bottomNavi: BeeLongButton(onPressed: () {}, text: '确认发布'),
);
}
Container _baseInfo(BuildContext context) {
var type = GestureDetector(
onTap: () async {
_type = 1;
showModalBottomSheet(
context: context,
builder: (context) {
return BeePickerBox(
onPressed: () {
Get.back();
print(_type);
setState(() {});
},
child: CupertinoPicker.builder(
itemExtent: 60.w,
childCount: WorkOrderMap.orderType.values.length,
onSelectedItemChanged: (index) {
var typeStr =
WorkOrderMap.orderType.values.toList()[index];
WorkOrderMap.orderType.forEach((key, value) {
if (value == typeStr) {
_type = key;
}
});
},
itemBuilder: (context, index) {
var str = WorkOrderMap.orderType.values.toList()[index];
return Center(
child: str.text.size(32.sp).isIntrinsic.make(),
);
}));
},
);
},
child: Material(
color: Colors.transparent,
child: Row(
children: [
SizedBox(
width: 170.w,
child: '分类'
.text
.size(28.sp)
.color(Colors.black.withOpacity(0.45))
.make(),
),
'${_type == 0 ? '请选择分类' : WorkOrderMap.orderType[_type]}'
.text
.size(28.sp)
.color(Colors.black.withOpacity(_type == 0 ? 0.25 : 0.85))
.make(),
Spacer(),
Icon(
CupertinoIcons.chevron_right,
size: 24.w,
),
],
),
),
);
var date = Row(
children: [
SizedBox(
width: 170.w,
child: '预计时间'
.text
.size(28.sp)
.color(Colors.black.withOpacity(0.45))
.make(),
),
Expanded(
child: GestureDetector(
onTap: () async {
_appointDate = await BeeDatePicker.timePicker(DateTime.now());
setState(() {});
},
child: Material(
color: Colors.transparent,
child:
'${DateUtil.formatDate(_appointDate, format: DateFormats.zh_mo_d_h_m)}'
.text
.size(24.sp)
.color(Colors.black.withOpacity(0.85))
.make(),
),
),
),
'-'.text.size(28.sp).color(Colors.black.withOpacity(0.85)).make(),
Expanded(
child: GestureDetector(
onTap: () async {
_appointEndDate = await BeeDatePicker.timePicker(DateTime.now());
setState(() {});
},
child: Material(
color: Colors.transparent,
child:
'${DateUtil.formatDate(_appointEndDate, format: DateFormats.zh_mo_d_h_m)}'
.text
.size(24.sp)
.color(Colors.black.withOpacity(_type == 0 ? 0.25 : 0.85))
.make(),
),
),
),
Icon(
CupertinoIcons.chevron_right,
size: 24.w,
),
],
);
var address = Row(
children: [
SizedBox(
width: 170.w,
child: '工单地址'
.text
.size(28.sp)
.color(Colors.black.withOpacity(0.45))
.make(),
),
Expanded(
child: TextField(
textAlign: TextAlign.start,
onChanged: (text) => setState(() {}),
autofocus: false,
controller: _addressController,
decoration: InputDecoration(
contentPadding: EdgeInsets.zero,
isDense: true,
border: InputBorder.none,
hintText: '请输入',
hintStyle: TextStyle(
fontSize: 28.sp,
color: Colors.black.withOpacity(0.25),
)),
),
),
],
);
var remark = GestureDetector(
onTap: () async {
_remark = await Get.to(() => TaskRemarkPage());
setState(() {});
},
child: Material(
color: Colors.transparent,
child: Row(
children: [
SizedBox(
width: 170.w,
child: '任务备注'
.text
.size(28.sp)
.color(Colors.black.withOpacity(0.45))
.make(),
),
Expanded(
child: '${_remark.isEmpty ? '请输入任务备注' : _remark}'
.text
.size(28.sp)
.color(
Colors.black.withOpacity(_remark.isEmpty ? 0.25 : 0.85))
.make(),
),
20.wb,
Icon(
CupertinoIcons.chevron_right,
size: 24.w,
),
],
),
),
);
return Container(
width: double.infinity,
padding: EdgeInsets.only(left: 32.w, right: 32.w, bottom: 32.w),
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.circular(16.w),
),
child: Column(
children: [
32.hb,
type,
32.hb,
BeeDivider.horizontal(),
32.hb,
date,
32.hb,
BeeDivider.horizontal(),
32.hb,
address,
32.hb,
BeeDivider.horizontal(),
32.hb,
remark,
32.hb,
BeeDivider.horizontal(),
32.hb,
Row(
children: [
'上传图片'
.text
.size(28.sp)
.color(Colors.black.withOpacity(0.45))
.make(),
Spacer(),
'建议上传图片不超过6张'
.text
.size(24.sp)
.color(Colors.black.withOpacity(0.25))
.make(),
],
),
24.hb,
BeePickImageWidget(onChanged: (value) {
_photos = value;
}),
],
),
);
}
}

@ -117,7 +117,7 @@ class WorkOrderCard extends StatelessWidget {
.size(24.sp) .size(24.sp)
.color(Colors.black.withOpacity(0.45)) .color(Colors.black.withOpacity(0.45))
.make(), .make(),
280.wb, Spacer(),
CardBottomButton.yellow(text: '催促进度', onPressed: () {}), CardBottomButton.yellow(text: '催促进度', onPressed: () {}),
24.wb, 24.wb,
GestureDetector( GestureDetector(

@ -1,4 +1,17 @@
import 'package:aku_new_community/extensions/num_ext.dart';
import 'package:aku_new_community/gen/assets.gen.dart';
import 'package:aku_new_community/widget/bee_divider.dart';
import 'package:aku_new_community/widget/bee_scaffold.dart';
import 'package:aku_new_community/widget/others/stack_avatar.dart';
import 'package:aku_new_community/widget/views/bee_grid_image_view.dart';
import 'package:bot_toast/bot_toast.dart';
import 'package:common_utils/common_utils.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:velocity_x/src/extensions/num_ext.dart';
import 'package:velocity_x/src/extensions/string_ext.dart';
class WorkOrderDetailPage extends StatefulWidget { class WorkOrderDetailPage extends StatefulWidget {
const WorkOrderDetailPage({Key? key}) : super(key: key); const WorkOrderDetailPage({Key? key}) : super(key: key);
@ -10,6 +23,257 @@ class WorkOrderDetailPage extends StatefulWidget {
class _WorkOrderDetailPageState extends State<WorkOrderDetailPage> { class _WorkOrderDetailPageState extends State<WorkOrderDetailPage> {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Container(); return BeeScaffold(
title: '',
body: Stack(
children: [
Container(
width: double.infinity,
height: 380.w,
decoration: BoxDecoration(
gradient: LinearGradient(
begin: Alignment.centerLeft,
end: Alignment.centerRight,
colors: false
? [
Colors.white,
Color(0xFFADACAC),
]
: [
Color(0xFFFFB737),
Color(0xFFFFD361),
]),
),
child: Column(
children: [
150.w.heightBox,
Row(
children: [
Padding(
padding: EdgeInsets.symmetric(horizontal: 32.w),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
'detailStatusToString'
.text
.size(40.sp)
.color(Colors.black)
.bold
.make(),
'subStatusString'
.text
.size(24.sp)
.color(Colors.black.withOpacity(0.45))
.make(),
],
),
),
Spacer(),
],
),
],
),
),
SafeArea(
child: ListView(
padding: EdgeInsets.only(top: 120.w, left: 32.w, right: 32.w),
children: [
_head(),
24.hb,
_content(),
24.w.heightBox,
_taskInfo(),
],
)),
],
),
);
}
Widget _servicePeople() {
return Container(
padding: EdgeInsets.all(24.w),
width: double.infinity,
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.circular(12.w),
),
child: Column(
children: [
'服务人员名单'
.text
.size(28.sp)
.color(Colors.black.withOpacity(0.85))
.make(),
24.hb,
BeeDivider.horizontal(),
24.hb,
GestureDetector(
onTap: () {},
child: Material(
color: Colors.transparent,
child: Row(
children: [
StackAvatar(avatars: []),
Spacer(),
'点击查看'
.text
.size(28.sp)
.color(Colors.black.withOpacity(0.65))
.make(),
Icon(
CupertinoIcons.chevron_right,
size: 24.w,
)
],
),
),
)
],
),
);
}
Widget _head() {
return Container(
padding: EdgeInsets.all(24.w),
width: double.infinity,
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.circular(12.w),
),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Row(
children: [
Container(
padding: EdgeInsets.symmetric(vertical: 8.w, horizontal: 16.w),
decoration: BoxDecoration(
color: Color(0xFFFFFBE6),
borderRadius: BorderRadius.circular(8.w),
),
child: '家政服务'.text.size(24.sp).color(Color(0xFFD48806)).make(),
),
],
),
16.hb,
Row(
children: [
Assets.icons.alarmClock.image(width: 40.w, height: 40.w),
24.wb,
'2022.02.21 15:30'
.text
.size(24.sp)
.color(Colors.black.withOpacity(0.45))
.make(),
],
),
16.hb,
Row(
children: [
Assets.icons.taskLocation.image(width: 40.w, height: 40.w),
24.wb,
'绿城·碧桂园3好楼门外'
.text
.size(24.sp)
.color(Colors.black.withOpacity(0.45))
.make(),
],
),
24.hb,
],
),
);
}
Widget _content() {
return Container(
padding: EdgeInsets.all(24.w),
width: double.infinity,
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.circular(12.w),
),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
'xxxxxxxxxxxxxxxxxxxxxxxx'
.text
.size(28.sp)
.color(Colors.black.withOpacity(0.65))
.make(),
24.hb,
BeeGridImageView(
urls: [],
),
24.hb,
],
),
);
}
Widget _taskInfo() {
return Container(
width: 686.w,
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.circular(8.w),
),
padding: EdgeInsets.symmetric(horizontal: 24.w, vertical: 24.w),
child: Column(
children: [
Row(
children: [
'任务信息'.text.size(28.sp).color(Colors.black).bold.make(),
Spacer(),
],
),
24.w.heightBox,
BeeDivider.horizontal(),
24.w.heightBox,
Row(
children: [
'创建时间'
.text
.size(24.sp)
.color(Colors.black.withOpacity(0.45))
.make(),
Spacer(),
'${DateUtil.formatDateStr('')}'
.text
.size(24.sp)
.color(Colors.black.withOpacity(0.45))
.make(),
64.w.widthBox,
],
),
24.w.heightBox,
Row(
children: [
'任务单号'
.text
.size(24.sp)
.color(Colors.black.withOpacity(0.45))
.make(),
Spacer(),
'widget.model.code}'
.text
.size(24.sp)
.color(Colors.black.withOpacity(0.45))
.make(),
24.w.widthBox,
GestureDetector(
onTap: () async {
await Clipboard.setData(
ClipboardData(text: 'widget.model.code'));
BotToast.showText(text: '已复制到粘贴板');
},
child: Assets.icons.copy.image(width: 40.w, height: 40.w)),
],
)
],
),
);
} }
} }

@ -0,0 +1,76 @@
import 'package:aku_new_community/extensions/num_ext.dart';
import 'package:aku_new_community/gen/assets.gen.dart';
import 'package:aku_new_community/widget/buttons/card_bottom_button.dart';
import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:get/get.dart';
import 'package:velocity_x/src/extensions/string_ext.dart';
class WorkOrderFinishDialog extends StatelessWidget {
final VoidCallback onConfirm;
const WorkOrderFinishDialog({Key? key, required this.onConfirm})
: super(key: key);
@override
Widget build(BuildContext context) {
return Center(
child: Stack(
clipBehavior: Clip.none,
children: [
Material(
borderRadius: BorderRadius.circular(16.w),
child: Container(
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.circular(16.w),
),
width: 628.w,
height: 555.w,
child: Column(
children: [
196.hb,
'是否确认工单完成'.text.color(Colors.black).isIntrinsic.make(),
40.hb,
'请确认问题是否已得到解决'
.text
.size(28.sp)
.color(Colors.black.withOpacity(0.45))
.isIntrinsic
.make(),
80.hb,
Padding(
padding:
EdgeInsets.symmetric(vertical: 40.w, horizontal: 32.w),
child: Row(
children: [
CardBottomButton.white(
width: 270.w,
height: 64.w,
text: '查看报告',
onPressed: () {
Get.back();
}),
Spacer(),
CardBottomButton.yellow(
width: 270.w,
height: 64.w,
text: '确认完成',
onPressed: onConfirm),
],
),
)
],
),
),
),
Positioned(
left: 193.w,
top: -150.w,
child: Assets.icons.finishOrder.image(width: 293.w, height: 322.w),
),
],
),
);
}
}

@ -0,0 +1,5 @@
class WorkOrderMap {
static Map<int, String> orderType = {
1: '报事报修',
};
}

@ -1,3 +1,4 @@
import 'package:aku_new_community/ui/function_and_service/work_order/publish_work_order_page.dart';
import 'package:aku_new_community/ui/function_and_service/work_order/work_order_card.dart'; import 'package:aku_new_community/ui/function_and_service/work_order/work_order_card.dart';
import 'package:aku_new_community/widget/bee_scaffold.dart'; import 'package:aku_new_community/widget/bee_scaffold.dart';
import 'package:aku_new_community/widget/tab_bar/bee_tab_bar.dart'; import 'package:aku_new_community/widget/tab_bar/bee_tab_bar.dart';
@ -5,6 +6,7 @@ import 'package:flutter/cupertino.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:get/get.dart';
import 'package:velocity_x/velocity_x.dart'; import 'package:velocity_x/velocity_x.dart';
class WorkOrderPage extends StatefulWidget { class WorkOrderPage extends StatefulWidget {
@ -31,9 +33,11 @@ class _WorkOrderPageState extends State<WorkOrderPage>
title: '报事报修', title: '报事报修',
actions: [ actions: [
IconButton( IconButton(
onPressed: () {}, onPressed: () {
Get.to(() => PublishWorkOrderPage());
},
icon: Icon( icon: Icon(
CupertinoIcons.question_circle, CupertinoIcons.plus_circle,
size: 40.w, size: 40.w,
)) ))
], ],

@ -1,16 +1,16 @@
import 'package:aku_new_community/base/base_style.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:velocity_x/velocity_x.dart'; import 'package:velocity_x/velocity_x.dart';
import 'package:aku_new_community/base/base_style.dart';
//button //button
class CardBottomButton extends StatelessWidget { class CardBottomButton extends StatelessWidget {
final String text; final String text;
final Color textColor; final Color textColor;
final Color bgColor; final Color bgColor;
final bool hasBorder; final bool hasBorder;
final double? width;
final double? height;
final VoidCallback onPressed; final VoidCallback onPressed;
const CardBottomButton( const CardBottomButton(
@ -19,13 +19,17 @@ class CardBottomButton extends StatelessWidget {
required this.textColor, required this.textColor,
required this.bgColor, required this.bgColor,
this.hasBorder = false, this.hasBorder = false,
required this.onPressed}) required this.onPressed,
this.width,
this.height})
: super(key: key); : super(key: key);
CardBottomButton.white({ CardBottomButton.white({
Key? key, Key? key,
required this.text, required this.text,
required this.onPressed, required this.onPressed,
this.width,
this.height,
}) : this.bgColor = Colors.white, }) : this.bgColor = Colors.white,
this.textColor = ktextPrimary, this.textColor = ktextPrimary,
this.hasBorder = true, this.hasBorder = true,
@ -35,6 +39,8 @@ class CardBottomButton extends StatelessWidget {
Key? key, Key? key,
required this.text, required this.text,
required this.onPressed, required this.onPressed,
this.width,
this.height,
}) : this.bgColor = Color(0xFFFFC40C), }) : this.bgColor = Color(0xFFFFC40C),
this.textColor = ktextPrimary, this.textColor = ktextPrimary,
this.hasBorder = false, this.hasBorder = false,
@ -53,7 +59,8 @@ class CardBottomButton extends StatelessWidget {
child: text.text.size(26.sp).color(this.textColor).bold.make(), child: text.text.size(26.sp).color(this.textColor).bold.make(),
color: this.bgColor, color: this.bgColor,
padding: EdgeInsets.symmetric(vertical: 8.w, horizontal: 24.w), padding: EdgeInsets.symmetric(vertical: 8.w, horizontal: 24.w),
height: 52.w, height: height ?? 52.w,
minWidth: width,
); );
} }
} }

Loading…
Cancel
Save