master
张萌 3 years ago
parent 9a118e2aa0
commit 1b62948817

@ -9,6 +9,8 @@ import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:get/get.dart'; import 'package:get/get.dart';
import 'package:velocity_x/velocity_x.dart'; import 'package:velocity_x/velocity_x.dart';
import '../task_func.dart';
class HallCard extends StatelessWidget { class HallCard extends StatelessWidget {
final HallListModel model; final HallListModel model;
final VoidCallback refresh; final VoidCallback refresh;
@ -109,7 +111,14 @@ class HallCard extends StatelessWidget {
Row( Row(
children: [ children: [
Spacer(), Spacer(),
CardBottomButton.yellow(text: '领取任务', onPressed: () {}), CardBottomButton.yellow(
text: '领取任务',
onPressed: () async {
var re = await TaskFunc.take(taskId: model.id);
if (re) {
refresh();
}
}),
], ],
), ),
], ],
@ -128,8 +137,22 @@ class HallCard extends StatelessWidget {
crossAxisAlignment: CrossAxisAlignment.end, crossAxisAlignment: CrossAxisAlignment.end,
children: [ children: [
40.w.heightBox, 40.w.heightBox,
CardBottomButton.white(text: '取消订单', onPressed: () {}), CardBottomButton.white(
CardBottomButton.yellow(text: '确认完成', onPressed: () {}), text: '取消订单',
onPressed: () async {
var re = await TaskFunc.cancel(taskId: model.id);
if (re) {
refresh();
}
}),
CardBottomButton.yellow(
text: '确认完成',
onPressed: () async {
var re = await TaskFunc.finish(taskId: model.id);
if (re) {
refresh();
}
}),
], ],
); );
case 4: case 4:

@ -69,22 +69,28 @@ class _HallDetailPageState extends State<HallDetailPage> {
), ),
), ),
Spacer(), Spacer(),
Padding( // Padding(
padding: EdgeInsets.only(right: 32.w), // padding: EdgeInsets.only(right: 32.w),
child: MaterialButton( // child: MaterialButton(
color: Colors.white, // color: Colors.white,
elevation: 0, // elevation: 0,
shape: RoundedRectangleBorder( // shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(8.w), // borderRadius: BorderRadius.circular(8.w),
), // ),
onPressed: () {}, // onPressed: () async {
child: '取消订单' // var re = await TaskFunc.cancel(
.text // taskId: widget.model.id);
.size(24.sp) // if (re) {
.color(Colors.black.withOpacity(0.65)) // Get.back();
.make(), // }
), // },
) // child: '取消订单'
// .text
// .size(24.sp)
// .color(Colors.black.withOpacity(0.65))
// .make(),
// ),
// )
], ],
), ),
], ],

@ -1,15 +1,20 @@
import 'package:aku_new_community/extensions/widget_list_ext.dart';
import 'package:aku_new_community/gen/assets.gen.dart'; import 'package:aku_new_community/gen/assets.gen.dart';
import 'package:aku_new_community/models/task/hall_list_model.dart'; import 'package:aku_new_community/models/task/my_take_task_list_model.dart';
import 'package:aku_new_community/ui/service/my_take_task/my_take_task_detail_page.dart';
import 'package:aku_new_community/ui/service/task_map.dart'; import 'package:aku_new_community/ui/service/task_map.dart';
import 'package:aku_new_community/widget/bee_divider.dart'; import 'package:aku_new_community/widget/bee_divider.dart';
import 'package:aku_new_community/widget/buttons/card_bottom_button.dart'; import 'package:aku_new_community/widget/buttons/card_bottom_button.dart';
import 'package:flustars/flustars.dart'; import 'package:flustars/flustars.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:get/get.dart';
import 'package:velocity_x/velocity_x.dart'; import 'package:velocity_x/velocity_x.dart';
import '../task_func.dart';
class MyTakeTaskCard extends StatelessWidget { class MyTakeTaskCard extends StatelessWidget {
final HallListModel model; final MyTakeTaskListModel model;
final VoidCallback refresh; final VoidCallback refresh;
const MyTakeTaskCard({Key? key, required this.model, required this.refresh}) const MyTakeTaskCard({Key? key, required this.model, required this.refresh})
@ -17,116 +22,121 @@ class MyTakeTaskCard extends StatelessWidget {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Container( return GestureDetector(
width: double.infinity, onTap: () {
decoration: BoxDecoration( Get.to(() => MyTakeTaskDetailPage(model: model));
color: Color(0xFFFFF7E6), },
borderRadius: BorderRadius.circular(8.w), child: Container(
), width: double.infinity,
padding: EdgeInsets.symmetric(horizontal: 24.w, vertical: 24.w), decoration: BoxDecoration(
child: Column( color: Colors.white,
children: [ borderRadius: BorderRadius.circular(8.w),
Row( ),
children: [ padding: EdgeInsets.symmetric(horizontal: 24.w, vertical: 24.w),
'接单时间 ${DateUtil.formatDateStr(model.createDate)}' child: Column(
.text children: [
.size(26.sp) Row(
.color(Colors.black.withOpacity(0.45))
.make(),
Spacer(),
'${TaskMap.statusToString[model.status]}'
.text
.size(28.sp)
.color(Colors.black.withOpacity(0.85))
.bold
.make()
],
),
20.w.heightBox,
BeeDivider.horizontal(),
34.w.heightBox,
Row(
children: [
Assets.icons.clockCircle.image(width: 36.w, height: 36.w),
24.w.widthBox,
'${DateUtil.formatDateStr(model.appointmentDate)}'
.text
.size(24.sp)
.color(Colors.black.withOpacity(0.65))
.make(),
],
),
20.w.heightBox,
Row(
children: [
Assets.icons.environment.image(width: 36.w, height: 36.w),
24.w.widthBox,
'${model.appointmentAddress}'
.text
.size(24.sp)
.color(Colors.black.withOpacity(0.65))
.make(),
],
),
34.w.heightBox,
Container(
width: 638.w,
decoration: BoxDecoration(
color: Colors.black.withOpacity(0.03),
borderRadius: BorderRadius.circular(8.w)),
padding: EdgeInsets.symmetric(horizontal: 24.w, vertical: 24.w),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
'#${TaskMap.typeToString[model.type]}' '接单时间 ${DateUtil.formatDateStr(model.createDate)}'
.text
.size(26.sp)
.color(Colors.black.withOpacity(0.45))
.make(),
Spacer(),
'${TaskMap.statusToString[model.status]}'
.text .text
.size(28.sp) .size(28.sp)
.color(Colors.black.withOpacity(0.85)) .color(Colors.black.withOpacity(0.85))
.bold
.make()
],
),
20.w.heightBox,
BeeDivider.horizontal(),
34.w.heightBox,
Row(
children: [
Assets.icons.clockCircle.image(width: 36.w, height: 36.w),
24.w.widthBox,
'${DateUtil.formatDateStr(model.appointmentDate)}'
.text
.size(24.sp)
.color(Colors.black.withOpacity(0.65))
.make(), .make(),
16.w.heightBox, ],
model.content.text ),
.size(28.sp) 20.w.heightBox,
Row(
children: [
Assets.icons.environment.image(width: 36.w, height: 36.w),
24.w.widthBox,
'${model.appointmentAddress}'
.text
.size(24.sp)
.color(Colors.black.withOpacity(0.65)) .color(Colors.black.withOpacity(0.65))
.make(), .make(),
], ],
), ),
), 34.w.heightBox,
40.w.heightBox, Container(
Row( width: 638.w,
children: [ decoration: BoxDecoration(
Spacer(), color: Colors.black.withOpacity(0.03),
RichText( borderRadius: BorderRadius.circular(8.w)),
text: TextSpan( padding: EdgeInsets.symmetric(horizontal: 24.w, vertical: 24.w),
text: '实付 ', child: Column(
children: model.rewardType == 2 crossAxisAlignment: CrossAxisAlignment.start,
? [ children: [
WidgetSpan( '#${TaskMap.typeToString[model.type]}'
child: Assets.icons.intergral .text
.image(width: 24.w, height: 24.w), .size(28.sp)
), .color(Colors.black.withOpacity(0.85))
model.reward .make(),
.toString() 16.w.heightBox,
.textSpan model.content.text
.size(32.sp) .size(28.sp)
.color(Colors.red) .color(Colors.black.withOpacity(0.65))
.make(), .make(),
] ],
: [ ),
'¥ ${model.reward}' ),
.toString() 40.w.heightBox,
.textSpan Row(
.size(32.sp) children: [
.color(Colors.red) Spacer(),
.make(), RichText(
], text: TextSpan(
style: TextStyle( text: '实付 ',
color: Colors.black.withOpacity(0.65), fontSize: 24.sp), children: model.rewardType == 2
), ? [
) WidgetSpan(
], child: Assets.icons.intergral
), .image(width: 24.w, height: 24.w),
_cardBottom(model.status), ),
], model.reward
.toString()
.textSpan
.size(32.sp)
.color(Colors.red)
.make(),
]
: [
'¥ ${model.reward}'
.toString()
.textSpan
.size(32.sp)
.color(Colors.red)
.make(),
],
style: TextStyle(
color: Colors.black.withOpacity(0.65), fontSize: 24.sp),
),
)
],
),
_cardBottom(model.status),
],
),
), ),
); );
} }
@ -139,10 +149,25 @@ class MyTakeTaskCard extends StatelessWidget {
children: [ children: [
40.w.heightBox, 40.w.heightBox,
Row( Row(
mainAxisAlignment: MainAxisAlignment.end,
children: [ children: [
CardBottomButton.white(text: '取消订单', onPressed: () {}), // CardBottomButton.white(
CardBottomButton.yellow(text: '确认完成', onPressed: () {}), // text: '取消订单',
], // onPressed: () async {
// var re = await TaskFunc.cancel(taskId: model.id);
// if (re) {
// refresh();
// }
// }),
CardBottomButton.yellow(
text: '确认完成',
onPressed: () async {
var re = await TaskFunc.finish(taskId: model.id);
if (re) {
refresh();
}
}),
].sepWidget(separate: 10.w.widthBox),
) )
], ],
); );

@ -0,0 +1,268 @@
import 'package:aku_new_community/gen/assets.gen.dart';
import 'package:aku_new_community/models/task/my_take_task_list_model.dart';
import 'package:aku_new_community/ui/service/task_map.dart';
import 'package:aku_new_community/widget/bee_divider.dart';
import 'package:aku_new_community/widget/bee_scaffold.dart';
import 'package:flustars/flustars.dart';
import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:velocity_x/velocity_x.dart';
class MyTakeTaskDetailPage extends StatefulWidget {
final MyTakeTaskListModel model;
const MyTakeTaskDetailPage({Key? key, required this.model}) : super(key: key);
@override
_MyTakeTaskDetailPageState createState() => _MyTakeTaskDetailPageState();
}
class _MyTakeTaskDetailPageState extends State<MyTakeTaskDetailPage> {
@override
Widget build(BuildContext context) {
return BeeScaffold(
extendBody: true,
title: '',
body: Stack(
children: [
Column(
children: [
Container(
width: double.infinity,
height: 380.w,
decoration: BoxDecoration(
gradient: LinearGradient(
begin: Alignment.centerLeft,
end: Alignment.centerRight,
colors: widget.model.status == 4
? [
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: [
'${TaskMap.detailStatusToString[widget.model.status]}'
.text
.size(40.sp)
.color(Colors.black)
.bold
.make(),
'${TaskMap.subStatus[widget.model.status]}'
.text
.size(24.sp)
.color(Colors.black.withOpacity(0.45))
.make(),
],
),
),
Spacer(),
// Padding(
// padding: EdgeInsets.only(right: 32.w),
// child: MaterialButton(
// color: Colors.white,
// elevation: 0,
// shape: RoundedRectangleBorder(
// borderRadius: BorderRadius.circular(8.w),
// ),
// onPressed: () async {
// var re = await TaskFunc.cancel(
// taskId: widget.model.id);
// if (re) {
// Get.back();
// }
// },
// child: '取消订单'
// .text
// .size(24.sp)
// .color(Colors.black.withOpacity(0.65))
// .make(),
// ),
// )
],
),
],
),
),
Flexible(
child: Container(
width: double.infinity,
color: Color(0xFFE5E5E5),
),
),
],
),
Positioned(
top: 280.w,
left: 32.w,
right: 32.w,
child: Column(
mainAxisSize: MainAxisSize.min,
children: [
_content(),
24.w.heightBox,
_taskInfo(),
],
)),
],
),
);
}
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(widget.model.createDate)}'
.text
.size(24.sp)
.color(Colors.black.withOpacity(0.45))
.make()
],
),
],
),
);
}
Widget _content() {
var head = Row(
children: [
Container(
width: 100.w,
height: 50.w,
alignment: Alignment.center,
decoration: BoxDecoration(
color: Color(0xFFFFF7E6),
borderRadius: BorderRadius.circular(8.w),
),
child: '#${TaskMap.typeToString[widget.model.type]}'
.text
.size(28.sp)
.color(Color(0xFFFA8C16))
.make(),
),
Spacer(),
Assets.icons.intergral.image(width: 24.w, height: 24.w),
8.w.widthBox,
'${widget.model.reward}'.text.size(32.sp).color(Colors.red).make()
],
);
return Container(
width: 686.w,
height: 500.w,
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.circular(8.w),
),
padding: EdgeInsets.symmetric(horizontal: 24.w, vertical: 24.w),
child: Column(
children: [
head,
34.w.heightBox,
Row(
children: [
Assets.icons.clockCircle.image(width: 36.w, height: 36.w),
24.w.widthBox,
'${DateUtil.formatDateStr(widget.model.appointmentDate)}'
.text
.size(24.sp)
.color(Colors.black.withOpacity(0.65))
.make(),
],
),
20.w.heightBox,
Row(
children: [
Assets.icons.environment.image(width: 36.w, height: 36.w),
24.w.widthBox,
'${widget.model.appointmentAddress}'
.text
.size(24.sp)
.color(Colors.black.withOpacity(0.65))
.make(),
],
),
34.w.heightBox,
Container(
width: 638.w,
decoration: BoxDecoration(
color: Colors.black.withOpacity(0.03),
borderRadius: BorderRadius.circular(8.w)),
padding: EdgeInsets.symmetric(horizontal: 24.w, vertical: 24.w),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
'#${TaskMap.typeToString[widget.model.type]}'
.text
.size(28.sp)
.color(Colors.black.withOpacity(0.85))
.make(),
16.w.heightBox,
widget.model.content.text
.size(28.sp)
.color(Colors.black.withOpacity(0.65))
.make(),
],
),
),
32.w.heightBox,
BeeDivider.horizontal(),
32.w.heightBox,
Row(
children: [
Assets.icons.reward.image(width: 36.w, height: 36.w),
24.w.widthBox,
'报酬'
.text
.size(26.sp)
.color(Colors.black.withOpacity(0.45))
.make(),
Spacer(),
'¥${widget.model.reward}'
.text
.size(32.sp)
.color(Colors.red)
.make(),
],
),
],
),
);
}
}

@ -1,12 +1,16 @@
import 'package:aku_new_community/gen/assets.gen.dart'; import 'package:aku_new_community/gen/assets.gen.dart';
import 'package:aku_new_community/models/task/my_task_list_model.dart'; import 'package:aku_new_community/models/task/my_task_list_model.dart';
import 'package:aku_new_community/ui/service/my_task/my_task_detail_page.dart';
import 'package:aku_new_community/ui/service/task_map.dart'; import 'package:aku_new_community/ui/service/task_map.dart';
import 'package:aku_new_community/widget/buttons/card_bottom_button.dart'; import 'package:aku_new_community/widget/buttons/card_bottom_button.dart';
import 'package:flustars/flustars.dart'; import 'package:flustars/flustars.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:get/get.dart';
import 'package:velocity_x/velocity_x.dart'; import 'package:velocity_x/velocity_x.dart';
import '../task_func.dart';
class MyTaskCard extends StatelessWidget { class MyTaskCard extends StatelessWidget {
final MyTaskListModel model; final MyTaskListModel model;
final VoidCallback refresh; final VoidCallback refresh;
@ -41,110 +45,122 @@ class MyTaskCard extends StatelessWidget {
.make() .make()
], ],
); );
return Container( return GestureDetector(
width: double.infinity, onTap: () {
decoration: BoxDecoration( Get.to(() => MyTaskDetailPage(model: model));
color: Colors.white, },
borderRadius: BorderRadius.circular(8.w), child: Container(
), width: double.infinity,
padding: EdgeInsets.symmetric(horizontal: 24.w, vertical: 24.w), decoration: BoxDecoration(
child: Column( color: Colors.white,
children: [ borderRadius: BorderRadius.circular(8.w),
head, ),
34.w.heightBox, padding: EdgeInsets.symmetric(horizontal: 24.w, vertical: 24.w),
Row( child: Column(
children: [ children: [
Assets.icons.clockCircle.image(width: 36.w, height: 36.w), head,
24.w.widthBox, 34.w.heightBox,
'${DateUtil.formatDateStr(model.appointmentDate)}' Row(
.text
.size(24.sp)
.color(Colors.black.withOpacity(0.65))
.make(),
],
),
20.w.heightBox,
Row(
children: [
Assets.icons.environment.image(width: 36.w, height: 36.w),
24.w.widthBox,
'${model.appointmentAddress}'
.text
.size(24.sp)
.color(Colors.black.withOpacity(0.65))
.make(),
],
),
34.w.heightBox,
Container(
width: 638.w,
decoration: BoxDecoration(
color: Colors.black.withOpacity(0.03),
borderRadius: BorderRadius.circular(8.w)),
padding: EdgeInsets.symmetric(horizontal: 24.w, vertical: 24.w),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
'#${TaskMap.typeToString[model.type]}' Assets.icons.clockCircle.image(width: 36.w, height: 36.w),
24.w.widthBox,
'${DateUtil.formatDateStr(model.appointmentDate)}'
.text .text
.size(28.sp) .size(24.sp)
.color(Colors.black.withOpacity(0.85)) .color(Colors.black.withOpacity(0.65))
.make(), .make(),
16.w.heightBox, ],
model.content.text ),
.size(28.sp) 20.w.heightBox,
Row(
children: [
Assets.icons.environment.image(width: 36.w, height: 36.w),
24.w.widthBox,
'${model.appointmentAddress}'
.text
.size(24.sp)
.color(Colors.black.withOpacity(0.65)) .color(Colors.black.withOpacity(0.65))
.make(), .make(),
], ],
), ),
), 34.w.heightBox,
40.w.heightBox, Container(
Row( width: 638.w,
children: [ decoration: BoxDecoration(
Spacer(), color: Colors.black.withOpacity(0.03),
RichText( borderRadius: BorderRadius.circular(8.w)),
text: TextSpan( padding: EdgeInsets.symmetric(horizontal: 24.w, vertical: 24.w),
text: '实付 ', child: Column(
children: model.rewardType == 2 crossAxisAlignment: CrossAxisAlignment.start,
? [
WidgetSpan(
child: Assets.icons.intergral
.image(width: 24.w, height: 24.w),
),
model.reward
.toString()
.textSpan
.size(32.sp)
.color(Colors.red)
.make(),
]
: [
'¥ ${model.reward}'
.toString()
.textSpan
.size(32.sp)
.color(Colors.red)
.make(),
],
style: TextStyle(
color: Colors.black.withOpacity(0.65), fontSize: 24.sp),
),
)
],
),
Column(
crossAxisAlignment: CrossAxisAlignment.end,
children: [
40.w.heightBox,
Row(
children: [ children: [
Spacer(), '#${TaskMap.typeToString[model.type]}'
CardBottomButton.yellow(text: '取消订单', onPressed: () {}), .text
.size(28.sp)
.color(Colors.black.withOpacity(0.85))
.make(),
16.w.heightBox,
model.content.text
.size(28.sp)
.color(Colors.black.withOpacity(0.65))
.make(),
], ],
), ),
], ),
), 40.w.heightBox,
], Row(
children: [
Spacer(),
RichText(
text: TextSpan(
text: '实付 ',
children: model.rewardType == 2
? [
WidgetSpan(
child: Assets.icons.intergral
.image(width: 24.w, height: 24.w),
),
model.reward
.toString()
.textSpan
.size(32.sp)
.color(Colors.red)
.make(),
]
: [
'¥ ${model.reward}'
.toString()
.textSpan
.size(32.sp)
.color(Colors.red)
.make(),
],
style: TextStyle(
color: Colors.black.withOpacity(0.65), fontSize: 24.sp),
),
)
],
),
Column(
crossAxisAlignment: CrossAxisAlignment.end,
children: [
40.w.heightBox,
Row(
children: [
Spacer(),
CardBottomButton.yellow(
text: '取消订单',
onPressed: () async {
var re = await TaskFunc.cancel(taskId: model.id);
if (re) {
refresh();
}
}),
],
),
],
),
],
),
), ),
); );
} }

@ -0,0 +1,268 @@
import 'package:aku_new_community/gen/assets.gen.dart';
import 'package:aku_new_community/models/task/my_task_list_model.dart';
import 'package:aku_new_community/ui/service/task_map.dart';
import 'package:aku_new_community/widget/bee_divider.dart';
import 'package:aku_new_community/widget/bee_scaffold.dart';
import 'package:flustars/flustars.dart';
import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:velocity_x/velocity_x.dart';
class MyTaskDetailPage extends StatefulWidget {
final MyTaskListModel model;
const MyTaskDetailPage({Key? key, required this.model}) : super(key: key);
@override
_MyTaskDetailPageState createState() => _MyTaskDetailPageState();
}
class _MyTaskDetailPageState extends State<MyTaskDetailPage> {
@override
Widget build(BuildContext context) {
return BeeScaffold(
extendBody: true,
title: '',
body: Stack(
children: [
Column(
children: [
Container(
width: double.infinity,
height: 380.w,
decoration: BoxDecoration(
gradient: LinearGradient(
begin: Alignment.centerLeft,
end: Alignment.centerRight,
colors: widget.model.status == 4
? [
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: [
'${TaskMap.detailStatusToString[widget.model.status]}'
.text
.size(40.sp)
.color(Colors.black)
.bold
.make(),
'${TaskMap.subStatus[widget.model.status]}'
.text
.size(24.sp)
.color(Colors.black.withOpacity(0.45))
.make(),
],
),
),
Spacer(),
// Padding(
// padding: EdgeInsets.only(right: 32.w),
// child: MaterialButton(
// color: Colors.white,
// elevation: 0,
// shape: RoundedRectangleBorder(
// borderRadius: BorderRadius.circular(8.w),
// ),
// onPressed: () async {
// var re = await TaskFunc.cancel(
// taskId: widget.model.id);
// if (re) {
// Get.back();
// }
// },
// child: '取消订单'
// .text
// .size(24.sp)
// .color(Colors.black.withOpacity(0.65))
// .make(),
// ),
// )
],
),
],
),
),
Flexible(
child: Container(
width: double.infinity,
color: Color(0xFFE5E5E5),
),
),
],
),
Positioned(
top: 280.w,
left: 32.w,
right: 32.w,
child: Column(
mainAxisSize: MainAxisSize.min,
children: [
_content(),
24.w.heightBox,
_taskInfo(),
],
)),
],
),
);
}
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(widget.model.createDate)}'
.text
.size(24.sp)
.color(Colors.black.withOpacity(0.45))
.make()
],
),
],
),
);
}
Widget _content() {
var head = Row(
children: [
Container(
width: 100.w,
height: 50.w,
alignment: Alignment.center,
decoration: BoxDecoration(
color: Color(0xFFFFF7E6),
borderRadius: BorderRadius.circular(8.w),
),
child: '#${TaskMap.typeToString[widget.model.type]}'
.text
.size(28.sp)
.color(Color(0xFFFA8C16))
.make(),
),
Spacer(),
Assets.icons.intergral.image(width: 24.w, height: 24.w),
8.w.widthBox,
'${widget.model.reward}'.text.size(32.sp).color(Colors.red).make()
],
);
return Container(
width: 686.w,
height: 500.w,
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.circular(8.w),
),
padding: EdgeInsets.symmetric(horizontal: 24.w, vertical: 24.w),
child: Column(
children: [
head,
34.w.heightBox,
Row(
children: [
Assets.icons.clockCircle.image(width: 36.w, height: 36.w),
24.w.widthBox,
'${DateUtil.formatDateStr(widget.model.appointmentDate)}'
.text
.size(24.sp)
.color(Colors.black.withOpacity(0.65))
.make(),
],
),
20.w.heightBox,
Row(
children: [
Assets.icons.environment.image(width: 36.w, height: 36.w),
24.w.widthBox,
'${widget.model.appointmentAddress}'
.text
.size(24.sp)
.color(Colors.black.withOpacity(0.65))
.make(),
],
),
34.w.heightBox,
Container(
width: 638.w,
decoration: BoxDecoration(
color: Colors.black.withOpacity(0.03),
borderRadius: BorderRadius.circular(8.w)),
padding: EdgeInsets.symmetric(horizontal: 24.w, vertical: 24.w),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
'#${TaskMap.typeToString[widget.model.type]}'
.text
.size(28.sp)
.color(Colors.black.withOpacity(0.85))
.make(),
16.w.heightBox,
widget.model.content.text
.size(28.sp)
.color(Colors.black.withOpacity(0.65))
.make(),
],
),
),
32.w.heightBox,
BeeDivider.horizontal(),
32.w.heightBox,
Row(
children: [
Assets.icons.reward.image(width: 36.w, height: 36.w),
24.w.widthBox,
'报酬'
.text
.size(26.sp)
.color(Colors.black.withOpacity(0.45))
.make(),
Spacer(),
'¥${widget.model.reward}'
.text
.size(32.sp)
.color(Colors.red)
.make(),
],
),
],
),
);
}
}

@ -266,7 +266,7 @@ class _PublishTaskPageState extends State<PublishTaskPage> {
Get.back(); Get.back();
setState(() {}); setState(() {});
}, },
child: '' child: ''
.text .text
.size(28.sp) .size(28.sp)
.isIntrinsic .isIntrinsic

@ -31,7 +31,7 @@ class TaskFunc {
static Future<bool> cancel({ static Future<bool> cancel({
required int taskId, required int taskId,
}) async { }) async {
var base = await NetUtil().post(API.manager.task.cancel, params: { var base = await NetUtil().get(API.manager.task.cancel, params: {
'taskId': taskId, 'taskId': taskId,
}); });
return base.status ?? false; return base.status ?? false;
@ -42,7 +42,7 @@ class TaskFunc {
static Future<bool> take({ static Future<bool> take({
required int taskId, required int taskId,
}) async { }) async {
var base = await NetUtil().post(API.manager.task.take, params: { var base = await NetUtil().get(API.manager.task.take, params: {
'taskId': taskId, 'taskId': taskId,
}); });
return base.status ?? false; return base.status ?? false;
@ -53,7 +53,7 @@ class TaskFunc {
static Future<bool> finish({ static Future<bool> finish({
required int taskId, required int taskId,
}) async { }) async {
var base = await NetUtil().post(API.manager.task.finish, params: { var base = await NetUtil().get(API.manager.task.finish, params: {
'taskId': taskId, 'taskId': taskId,
}); });
return base.status ?? false; return base.status ?? false;

Loading…
Cancel
Save