添加评价弹窗

修改任务发布card
修改大厅详情页
pull/1/head
张萌 3 years ago
parent a2608269e9
commit 068e8af155

Binary file not shown.

After

Width:  |  Height:  |  Size: 21 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 769 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 26 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 42 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 39 KiB

@ -190,6 +190,10 @@ class $AssetsIconsGen {
/// File path: assets/icons/camera.png /// File path: assets/icons/camera.png
AssetGenImage get camera => const AssetGenImage('assets/icons/camera.png'); AssetGenImage get camera => const AssetGenImage('assets/icons/camera.png');
/// File path: assets/icons/cancel_task.png
AssetGenImage get cancelTask =>
const AssetGenImage('assets/icons/cancel_task.png');
/// File path: assets/icons/change.png /// File path: assets/icons/change.png
AssetGenImage get change => const AssetGenImage('assets/icons/change.png'); AssetGenImage get change => const AssetGenImage('assets/icons/change.png');
@ -249,6 +253,9 @@ class $AssetsIconsGen {
AssetGenImage get contract => AssetGenImage get contract =>
const AssetGenImage('assets/icons/contract.png'); const AssetGenImage('assets/icons/contract.png');
/// File path: assets/icons/copy.png
AssetGenImage get copy => const AssetGenImage('assets/icons/copy.png');
/// File path: assets/icons/delete.png /// File path: assets/icons/delete.png
AssetGenImage get delete => const AssetGenImage('assets/icons/delete.png'); AssetGenImage get delete => const AssetGenImage('assets/icons/delete.png');
@ -256,6 +263,10 @@ class $AssetsIconsGen {
AssetGenImage get deviceAlarm => AssetGenImage get deviceAlarm =>
const AssetGenImage('assets/icons/device_alarm.png'); const AssetGenImage('assets/icons/device_alarm.png');
/// File path: assets/icons/dissatisfied.png
AssetGenImage get dissatisfied =>
const AssetGenImage('assets/icons/dissatisfied.png');
/// File path: assets/icons/edit.png /// File path: assets/icons/edit.png
AssetGenImage get edit => const AssetGenImage('assets/icons/edit.png'); AssetGenImage get edit => const AssetGenImage('assets/icons/edit.png');
@ -675,6 +686,9 @@ class $AssetsIconsGen {
AssetGenImage get nearbyService => AssetGenImage get nearbyService =>
const AssetGenImage('assets/icons/nearby_service.png'); const AssetGenImage('assets/icons/nearby_service.png');
/// File path: assets/icons/normal.png
AssetGenImage get normal => const AssetGenImage('assets/icons/normal.png');
/// File path: assets/icons/oxygen.png /// File path: assets/icons/oxygen.png
AssetGenImage get oxygen => const AssetGenImage('assets/icons/oxygen.png'); AssetGenImage get oxygen => const AssetGenImage('assets/icons/oxygen.png');
@ -719,6 +733,10 @@ class $AssetsIconsGen {
/// File path: assets/icons/reward.png /// File path: assets/icons/reward.png
AssetGenImage get reward => const AssetGenImage('assets/icons/reward.png'); AssetGenImage get reward => const AssetGenImage('assets/icons/reward.png');
/// File path: assets/icons/satisfied.png
AssetGenImage get satisfied =>
const AssetGenImage('assets/icons/satisfied.png');
/// File path: assets/icons/second_hand.png /// File path: assets/icons/second_hand.png
AssetGenImage get secondHand => AssetGenImage get secondHand =>
const AssetGenImage('assets/icons/second_hand.png'); const AssetGenImage('assets/icons/second_hand.png');

@ -21,6 +21,8 @@ class HallListModel {
final List<ImgModel>? imgList; final List<ImgModel>? imgList;
final int rewardType; final int rewardType;
final int reward; final int reward;
final int createId;
final String createDate;
factory HallListModel.fromJson(Map<String, dynamic> json) => factory HallListModel.fromJson(Map<String, dynamic> json) =>
_$HallListModelFromJson(json); _$HallListModelFromJson(json);
@ -41,5 +43,7 @@ class HallListModel {
this.imgList, this.imgList,
required this.rewardType, required this.rewardType,
required this.reward, required this.reward,
required this.createId,
required this.createDate,
}); });
} }

@ -26,4 +26,6 @@ HallListModel _$HallListModelFromJson(Map<String, dynamic> json) =>
.toList(), .toList(),
rewardType: json['rewardType'] as int, rewardType: json['rewardType'] as int,
reward: json['reward'] as int, reward: json['reward'] as int,
createId: json['createId'] as int,
createDate: json['createDate'] as String,
); );

@ -0,0 +1,146 @@
import 'package:aku_new_community/base/base_style.dart';
import 'package:aku_new_community/extensions/num_ext.dart';
import 'package:aku_new_community/gen/assets.gen.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:velocity_x/src/extensions/string_ext.dart';
class TaskEvaluationDialog extends StatefulWidget {
const TaskEvaluationDialog({Key? key}) : super(key: key);
@override
_TaskEvaluationDialogState createState() => _TaskEvaluationDialogState();
}
class _TaskEvaluationDialogState extends State<TaskEvaluationDialog> {
TextEditingController _controller = TextEditingController();
@override
void initState() {
super.initState();
}
@override
void dispose() {
_controller.dispose();
super.dispose();
}
@override
Widget build(BuildContext context) {
return Container(
width: double.infinity,
color: Colors.white,
padding: EdgeInsets.all(32.w),
child: Column(
children: [
Row(
children: [
'请对服务质量进行评价'
.text
.color(Colors.black.withOpacity(0.25))
.size(32.sp)
.make(),
Spacer(),
IconButton(
onPressed: () {},
icon: Icon(
CupertinoIcons.xmark,
size: 24.w,
color: Colors.black.withOpacity(0.45),
)),
],
),
40.hb,
Row(
children: [
_evaluationIcon(2, '不满意', Assets.icons.dissatisfied.path),
_evaluationIcon(6, '一般', Assets.icons.normal.path),
_evaluationIcon(10, '满意', Assets.icons.satisfied.path),
],
),
56.hb,
Container(
width: 622.w,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(16.w),
color: Colors.black.withOpacity(0.03)),
child: TextField(
maxLines: 10,
minLines: 5,
decoration: InputDecoration(
border: InputBorder.none,
),
),
),
80.hb,
Row(
children: [
MaterialButton(
onPressed: () {},
minWidth: 330.w,
height: 80.w,
elevation: 0,
color: Colors.white,
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(40.w),
side: BorderSide(color: Colors.black.withOpacity(0.25)),
),
child: Text(
'',
style: TextStyle(
fontSize: 28.sp, color: Colors.black.withOpacity(0.65)),
),
),
Spacer(),
MaterialButton(
onPressed: () {},
minWidth: 330.w,
height: 80.w,
elevation: 0,
color: kPrimaryColor,
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(40.w),
),
child: Text(
'暂不评价',
style: TextStyle(
fontSize: 28.sp, color: Colors.black.withOpacity(0.85)),
),
)
],
)
],
),
);
}
int? _currentIndex;
Widget _evaluationIcon(
int index,
String text,
String iconPath,
) {
return GestureDetector(
onTap: () {
_currentIndex = index;
setState(() {});
},
child: AnimatedContainer(
duration: Duration(milliseconds: 300),
width: _currentIndex == index ? 120.w : 80.w,
height: _currentIndex == index ? 120.w : 80.w,
child: Column(
children: [
Image.asset(iconPath,
width: double.infinity, height: double.infinity),
10.hb,
text.text.size(32.sp).color(Colors.black.withOpacity(0.65)).make(),
],
),
),
);
}
}

@ -4,6 +4,7 @@ import 'package:aku_new_community/ui/service/hall/hall_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:aku_new_community/widget/others/user_tool.dart';
import 'package:aku_new_community/widget/views/bee_grid_image_view.dart'; import 'package:aku_new_community/widget/views/bee_grid_image_view.dart';
import 'package:aku_new_community/widget/voice_player.dart'; import 'package:aku_new_community/widget/voice_player.dart';
import 'package:common_utils/common_utils.dart'; import 'package:common_utils/common_utils.dart';
@ -22,6 +23,8 @@ class HallCard extends StatelessWidget {
const HallCard({Key? key, required this.model, required this.refresh}) const HallCard({Key? key, required this.model, required this.refresh})
: super(key: key); : super(key: key);
bool get myself => UserTool.userProvider.userInfoModel!.id == model.createId;
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
var head = Row( var head = Row(
@ -37,6 +40,23 @@ class HallCard extends StatelessWidget {
.color(Color(0xFFFA8C16)) .color(Color(0xFFFA8C16))
.make(), .make(),
), ),
8.w.widthBox,
Offstage(
offstage: !myself,
child: Container(
width: 128.w,
height: 50.w,
alignment: Alignment.center,
decoration: BoxDecoration(
color: Color(0xFFFFE7BA),
borderRadius: BorderRadius.circular(8.w)),
child: '我发布的'
.text
.size(28.sp)
.color(Colors.black.withOpacity(0.85))
.make(),
),
),
Spacer(), Spacer(),
Assets.icons.intergral.image(width: 24.w, height: 24.w), Assets.icons.intergral.image(width: 24.w, height: 24.w),
8.w.widthBox, 8.w.widthBox,
@ -66,8 +86,9 @@ class HallCard extends StatelessWidget {
], ],
); );
return GestureDetector( return GestureDetector(
onTap: () { onTap: () async {
Get.to(() => HallDetailPage(model: model)); await Get.to(() => HallDetailPage(model: model));
refresh();
}, },
child: Container( child: Container(
width: double.infinity, width: double.infinity,
@ -143,14 +164,28 @@ class HallCard extends StatelessWidget {
Row( Row(
children: [ children: [
Spacer(), Spacer(),
CardBottomButton.yellow( Offstage(
text: '领取任务', offstage: !myself,
onPressed: () async { child: CardBottomButton.white(
var re = await TaskFunc.take(taskId: model.id); text: '取消发布',
if (re) { onPressed: () async {
refresh(); var re = await TaskFunc.cancel(taskId: model.id);
} if (re) {
}), refresh();
}
}),
),
Offstage(
offstage: myself,
child: CardBottomButton.yellow(
text: '领取任务',
onPressed: () async {
var re = await TaskFunc.take(taskId: model.id);
if (re) {
refresh();
}
}),
),
], ],
), ),
], ],

@ -1,11 +1,20 @@
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/hall_list_model.dart';
import 'package:aku_new_community/ui/service/task_func.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/bee_scaffold.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/others/user_tool.dart';
import 'package:aku_new_community/widget/views/bee_grid_image_view.dart';
import 'package:aku_new_community/widget/voice_player.dart';
import 'package:bot_toast/bot_toast.dart';
import 'package:common_utils/common_utils.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: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 HallDetailPage extends StatefulWidget { class HallDetailPage extends StatefulWidget {
@ -18,6 +27,9 @@ class HallDetailPage extends StatefulWidget {
} }
class _HallDetailPageState extends State<HallDetailPage> { class _HallDetailPageState extends State<HallDetailPage> {
bool get myself =>
UserTool.userProvider.userInfoModel!.id == widget.model.createId;
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return BeeScaffold( return BeeScaffold(
@ -34,15 +46,10 @@ class _HallDetailPageState extends State<HallDetailPage> {
gradient: LinearGradient( gradient: LinearGradient(
begin: Alignment.centerLeft, begin: Alignment.centerLeft,
end: Alignment.centerRight, end: Alignment.centerRight,
colors: widget.model.status == 4 colors: [
? [ Color(0xFFFFB737),
Colors.white, Color(0xFFFFD361),
Color(0xFFADACAC), ]),
]
: [
Color(0xFFFFB737),
Color(0xFFFFD361),
]),
), ),
child: Column( child: Column(
children: [ children: [
@ -54,13 +61,13 @@ class _HallDetailPageState extends State<HallDetailPage> {
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
'${TaskMap.detailStatusToString[widget.model.status]}' '未领取'
.text .text
.size(40.sp) .size(40.sp)
.color(Colors.black) .color(Colors.black)
.bold .bold
.make(), .make(),
'${TaskMap.subStatus[widget.model.status]}' '正在等待其他人接单'
.text .text
.size(24.sp) .size(24.sp)
.color(Colors.black.withOpacity(0.45)) .color(Colors.black.withOpacity(0.45))
@ -96,6 +103,29 @@ class _HallDetailPageState extends State<HallDetailPage> {
)), )),
], ],
), ),
bottomNavi: Container(
width: double.infinity,
color: Colors.white,
padding: EdgeInsets.all(32.w),
child: myself
? BeeLongButton.white(
onPressed: () async {
var re = await TaskFunc.cancel(taskId: widget.model.id);
if (re) {
Get.back();
}
},
text: '取消任务')
: BeeLongButton(
onPressed: () async {
var re = await TaskFunc.take(taskId: widget.model.id);
if (re) {
Get.back();
}
},
text: '领取任务',
),
),
); );
} }
@ -126,13 +156,38 @@ class _HallDetailPageState extends State<HallDetailPage> {
.color(Colors.black.withOpacity(0.45)) .color(Colors.black.withOpacity(0.45))
.make(), .make(),
Spacer(), Spacer(),
'${DateUtil.formatDateStr(widget.model.updateDate)}' '${DateUtil.formatDateStr(widget.model.createDate)}'
.text .text
.size(24.sp) .size(24.sp)
.color(Colors.black.withOpacity(0.45)) .color(Colors.black.withOpacity(0.45))
.make() .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)),
],
)
], ],
), ),
); );
@ -149,21 +204,18 @@ class _HallDetailPageState extends State<HallDetailPage> {
color: Color(0xFFFFF7E6), color: Color(0xFFFFF7E6),
borderRadius: BorderRadius.circular(8.w), borderRadius: BorderRadius.circular(8.w),
), ),
child: '#${TaskMap.typeToString[widget.model.type]}' child: '#${TaskMap.taskType[widget.model.type]}'
.text .text
.size(28.sp) .size(28.sp)
.color(Color(0xFFFA8C16)) .color(Color(0xFFFA8C16))
.make(), .make(),
), ),
Spacer(), 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( return Container(
width: 686.w, width: 686.w,
height: 500.w, // height: 500.w,
decoration: BoxDecoration( decoration: BoxDecoration(
color: Colors.white, color: Colors.white,
borderRadius: BorderRadius.circular(8.w), borderRadius: BorderRadius.circular(8.w),
@ -175,16 +227,19 @@ class _HallDetailPageState extends State<HallDetailPage> {
34.w.heightBox, 34.w.heightBox,
Row( Row(
children: [ children: [
Assets.icons.clockCircle.image(width: 36.w, height: 36.w), Assets.icons.watch.image(width: 40.w, height: 40.w),
24.w.widthBox, 24.w.widthBox,
'${DateUtil.formatDateStr(widget.model.readyEndTime)}' '${widget.model.serviceTime ?? '0'}'
.text .richText
.size(24.sp) .withTextSpanChildren([
.color(Colors.black.withOpacity(0.65)) ' 分钟'.textSpan.size(28.sp).color(Colors.black).make(),
])
.size(28.sp)
.color(Color(0xFFFA8C16))
.make(), .make(),
], ],
), ),
20.w.heightBox, 24.w.heightBox,
Row( Row(
children: [ children: [
Assets.icons.environment.image(width: 36.w, height: 36.w), Assets.icons.environment.image(width: 36.w, height: 36.w),
@ -206,16 +261,18 @@ class _HallDetailPageState extends State<HallDetailPage> {
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
'#${TaskMap.typeToString[widget.model.type]}'
.text
.size(28.sp)
.color(Colors.black.withOpacity(0.85))
.make(),
16.w.heightBox,
widget.model.remarks.text widget.model.remarks.text
.size(28.sp) .size(28.sp)
.color(Colors.black.withOpacity(0.65)) .color(Colors.black.withOpacity(0.65))
.make(), .make(),
24.w.heightBox,
VoicePlayer(
url: widget.model.voiceUrl,
),
24.w.heightBox,
BeeGridImageView(
urls:
widget.model.imgList?.map((e) => e.url).toList() ?? []),
], ],
), ),
), ),
@ -232,11 +289,14 @@ class _HallDetailPageState extends State<HallDetailPage> {
.color(Colors.black.withOpacity(0.45)) .color(Colors.black.withOpacity(0.45))
.make(), .make(),
Spacer(), Spacer(),
'¥${widget.model.reward}' widget.model.rewardType == 1
.text ? Text(
.size(32.sp) '¥ ',
.color(Colors.red) style: TextStyle(color: Colors.red, fontSize: 32.sp),
.make(), )
: Assets.icons.intergral.image(width: 24.w, height: 24.w),
8.w.widthBox,
'${widget.model.reward}'.text.size(32.sp).color(Colors.red).make()
], ],
), ),
], ],

@ -5,6 +5,7 @@ import 'package:aku_new_community/constants/sars_api.dart';
import 'package:aku_new_community/gen/assets.gen.dart'; import 'package:aku_new_community/gen/assets.gen.dart';
import 'package:aku_new_community/ui/service/add_appointment_address_page.dart'; import 'package:aku_new_community/ui/service/add_appointment_address_page.dart';
import 'package:aku_new_community/ui/service/task_func.dart'; import 'package:aku_new_community/ui/service/task_func.dart';
import 'package:aku_new_community/ui/service/task_map.dart';
import 'package:aku_new_community/ui/service/task_remark_page.dart'; import 'package:aku_new_community/ui/service/task_remark_page.dart';
import 'package:aku_new_community/utils/headers.dart'; import 'package:aku_new_community/utils/headers.dart';
import 'package:aku_new_community/utils/network/net_util.dart'; import 'package:aku_new_community/utils/network/net_util.dart';
@ -20,6 +21,7 @@ import 'package:bot_toast/bot_toast.dart';
import 'package:common_utils/common_utils.dart'; import 'package:common_utils/common_utils.dart';
import 'package:flutter/cupertino.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: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';
@ -32,8 +34,6 @@ class PublishTaskPage extends StatefulWidget {
} }
class _PublishTaskPageState extends State<PublishTaskPage> { class _PublishTaskPageState extends State<PublishTaskPage> {
List<String> _types = ['跑腿', '家政', '维修', '家教', '其他'];
// //
int _type = 0; int _type = 0;
List<String> _sexStr = ['', '', '不限']; List<String> _sexStr = ['', '', '不限'];
@ -75,6 +75,7 @@ class _PublishTaskPageState extends State<PublishTaskPage> {
return BeeScaffold( return BeeScaffold(
title: '发布任务', title: '发布任务',
extendBody: true, extendBody: true,
bodyColor: Color(0xFFE5E5E5),
body: Stack( body: Stack(
children: [ children: [
ClipPath( ClipPath(
@ -112,9 +113,14 @@ class _PublishTaskPageState extends State<PublishTaskPage> {
var _voiceUrl; var _voiceUrl;
if (_voiceUri != null) { if (_voiceUri != null) {
try { try {
_voiceUrl = await NetUtil().upload( var base = await NetUtil().upload(
SARSAPI.uploadFile.uploadImg, SARSAPI.uploadFile.uploadImg,
File.fromUri(Uri(path: _voiceUri))); File.fromUri(Uri(path: _voiceUri)));
if (base.success) {
_voiceUrl = base.data;
} else {
BotToast.showText(text: base.msg);
}
} catch (e) { } catch (e) {
print(e.toString()); print(e.toString());
} }
@ -171,18 +177,19 @@ class _PublishTaskPageState extends State<PublishTaskPage> {
}, },
child: CupertinoPicker.builder( child: CupertinoPicker.builder(
itemExtent: 60.w, itemExtent: 60.w,
childCount: _types.length, childCount: TaskMap.taskType.values.length,
onSelectedItemChanged: (index) { onSelectedItemChanged: (index) {
_type = index + 1; var typeStr = TaskMap.taskType.values.toList()[index];
TaskMap.taskType.forEach((key, value) {
if (value == typeStr) {
_type = key;
}
});
}, },
itemBuilder: (context, index) { itemBuilder: (context, index) {
var str = TaskMap.taskType.values.toList()[index];
return Center( return Center(
child: _types[index] child: str.text.size(32.sp).isIntrinsic.make(),
.text
.size(32.sp)
.isIntrinsic
.color(Colors.black.withOpacity(0.25))
.make(),
); );
})); }));
}, },
@ -200,7 +207,7 @@ class _PublishTaskPageState extends State<PublishTaskPage> {
.color(Colors.black.withOpacity(0.45)) .color(Colors.black.withOpacity(0.45))
.make(), .make(),
), ),
'${_type == 0 ? '请选择分类' : _types[_type - 1]}' '${_type == 0 ? '请选择分类' : TaskMap.taskType[_type]}'
.text .text
.size(28.sp) .size(28.sp)
.color(Colors.black.withOpacity(_type == 0 ? 0.25 : 0.85)) .color(Colors.black.withOpacity(_type == 0 ? 0.25 : 0.85))
@ -314,49 +321,12 @@ class _PublishTaskPageState extends State<PublishTaskPage> {
Get.back(); Get.back();
setState(() {}); setState(() {});
}, },
child: 'e' child: e.text
.text
.size(28.sp) .size(28.sp)
.isIntrinsic .isIntrinsic
.color(Colors.black.withOpacity(0.85)) .color(Colors.black.withOpacity(0.85))
.make())) .make()))
.toList(), .toList(),
CupertinoActionSheetAction(
onPressed: () {
_service = 1;
Get.back();
setState(() {});
},
child: '住户'
.text
.size(28.sp)
.isIntrinsic
.color(Colors.black.withOpacity(0.85))
.make()),
CupertinoActionSheetAction(
onPressed: () {
_service = 2;
Get.back();
setState(() {});
},
child: '物业'
.text
.size(28.sp)
.isIntrinsic
.color(Colors.black.withOpacity(0.85))
.make()),
CupertinoActionSheetAction(
onPressed: () {
_service = 3;
Get.back();
setState(() {});
},
child: '不限'
.text
.size(28.sp)
.isIntrinsic
.color(Colors.black.withOpacity(0.85))
.make())
], ],
)); ));
}, },
@ -432,7 +402,7 @@ class _PublishTaskPageState extends State<PublishTaskPage> {
child: child:
'${DateUtil.formatDate(_appointDate, format: DateFormats.zh_mo_d_h_m)}' '${DateUtil.formatDate(_appointDate, format: DateFormats.zh_mo_d_h_m)}'
.text .text
.size(28.sp) .size(24.sp)
.color(Colors.black.withOpacity(0.85)) .color(Colors.black.withOpacity(0.85))
.make(), .make(),
), ),
@ -450,13 +420,12 @@ class _PublishTaskPageState extends State<PublishTaskPage> {
child: child:
'${DateUtil.formatDate(_appointEndDate, format: DateFormats.zh_mo_d_h_m)}' '${DateUtil.formatDate(_appointEndDate, format: DateFormats.zh_mo_d_h_m)}'
.text .text
.size(28.sp) .size(24.sp)
.color(Colors.black.withOpacity(_type == 0 ? 0.25 : 0.85)) .color(Colors.black.withOpacity(_type == 0 ? 0.25 : 0.85))
.make(), .make(),
), ),
), ),
), ),
Spacer(),
Icon( Icon(
CupertinoIcons.chevron_right, CupertinoIcons.chevron_right,
size: 24.w, size: 24.w,
@ -479,7 +448,6 @@ class _PublishTaskPageState extends State<PublishTaskPage> {
onChanged: (text) => setState(() {}), onChanged: (text) => setState(() {}),
autofocus: false, autofocus: false,
controller: _nameController, controller: _nameController,
style: TextStyle(color: Colors.red),
decoration: InputDecoration( decoration: InputDecoration(
contentPadding: EdgeInsets.zero, contentPadding: EdgeInsets.zero,
isDense: true, isDense: true,
@ -509,7 +477,8 @@ class _PublishTaskPageState extends State<PublishTaskPage> {
onChanged: (text) => setState(() {}), onChanged: (text) => setState(() {}),
autofocus: false, autofocus: false,
controller: _telController, controller: _telController,
style: TextStyle(color: Colors.red), keyboardType: TextInputType.phone,
inputFormatters: [FilteringTextInputFormatter.digitsOnly],
decoration: InputDecoration( decoration: InputDecoration(
contentPadding: EdgeInsets.zero, contentPadding: EdgeInsets.zero,
isDense: true, isDense: true,
@ -523,6 +492,163 @@ class _PublishTaskPageState extends State<PublishTaskPage> {
), ),
], ],
); );
var doubleAddress = Column(
children: [
GestureDetector(
onTap: () async {
var re = await Get.to(() => AddAppointmentAddressPage());
if (re != null) {
_accessAddress = re['address'];
_accessAddressDetail = re['addressDetail'];
setState(() {});
}
},
child: Material(
color: Colors.transparent,
child: Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Column(
children: [
Container(
margin: EdgeInsets.only(left: 8.w),
width: 32.w,
height: 32.w,
alignment: Alignment.center,
decoration: BoxDecoration(
color: kPrimaryColor,
borderRadius: BorderRadius.circular(20.w)),
child: ''.text.size(20.w).black.bold.make(),
),
8.w.heightBox,
_connect(5),
8.w.heightBox,
],
),
20.w.widthBox,
SizedBox(
width: 430.w,
child: Column(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
'${_accessAddress ?? ''}'
.text
.size(32.sp)
.black
.bold
.make(),
12.w.heightBox,
'${_accessAddressDetail ?? ''}'
.text
.maxLines(1)
.overflow(TextOverflow.ellipsis)
.size(24.sp)
.color(Colors.black.withOpacity(0.45))
.make(),
],
),
),
Spacer(),
Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [
20.hb,
Icon(
CupertinoIcons.chevron_right,
size: 40.w,
color: Colors.black.withOpacity(0.45),
)
],
)
],
),
),
),
Row(
children: [
Padding(
padding: EdgeInsets.only(left: 2.w),
child: Assets.icons.connect.image(width: 40.w, height: 40.w),
),
20.wb,
BeeDivider.horizontal().expand(),
],
),
GestureDetector(
onTap: () async {
var re = await Get.to(() => AddAppointmentAddressPage());
if (re != null) {
_serviceAddress = re['address'];
_serviceAddressDetail = re['addressDetail'];
setState(() {});
}
},
child: Material(
color: Colors.transparent,
child: Row(
crossAxisAlignment: CrossAxisAlignment.end,
children: [
Column(
children: [
8.w.heightBox,
_connect(5),
8.w.heightBox,
Container(
margin: EdgeInsets.only(left: 8.w),
width: 32.w,
height: 32.w,
alignment: Alignment.center,
decoration: BoxDecoration(
color: Colors.black,
borderRadius: BorderRadius.circular(20.w)),
child: ''.text.size(20.w).white.bold.make(),
),
],
),
20.w.widthBox,
SizedBox(
width: 430.w,
child: Column(
mainAxisAlignment: MainAxisAlignment.end,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
'${_serviceAddress ?? ''}'
.text
.size(32.sp)
.black
.lineHeight(1.1)
.bold
.make(),
12.w.heightBox,
'${_serviceAddressDetail ?? ''}'
.text
.maxLines(1)
.overflow(TextOverflow.ellipsis)
.size(24.sp)
.color(Colors.black.withOpacity(0.45))
.make(),
],
),
),
Spacer(),
Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [
20.hb,
Icon(
CupertinoIcons.chevron_right,
size: 40.w,
color: Colors.black.withOpacity(0.45),
)
],
)
],
),
),
)
],
);
return Container( return Container(
width: double.infinity, width: double.infinity,
padding: padding:
@ -545,151 +671,68 @@ class _PublishTaskPageState extends State<PublishTaskPage> {
32.w.heightBox, 32.w.heightBox,
BeeDivider.horizontal(), BeeDivider.horizontal(),
32.w.heightBox, 32.w.heightBox,
GestureDetector( Offstage(
onTap: () async { offstage: _type != 1,
var re = await Get.to(() => AddAppointmentAddressPage()); child: doubleAddress,
if (re != null) {
_accessAddress = re['address'];
_accessAddressDetail = re['addressDetail'];
setState(() {});
}
},
child: Material(
color: Colors.transparent,
child: Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Column(
children: [
Container(
margin: EdgeInsets.only(left: 8.w),
width: 32.w,
height: 32.w,
alignment: Alignment.center,
decoration: BoxDecoration(
color: kPrimaryColor,
borderRadius: BorderRadius.circular(20.w)),
child: ''.text.size(20.w).black.bold.make(),
),
8.w.heightBox,
_connect(5),
8.w.heightBox,
],
),
20.w.widthBox,
SizedBox(
width: 430.w,
child: Column(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
'鲍汁牛肉饭'.text.size(32.sp).black.bold.make(),
12.w.heightBox,
'${_accessAddress ?? ''}'
.text
.maxLines(1)
.overflow(TextOverflow.ellipsis)
.size(24.sp)
.color(Colors.black.withOpacity(0.45))
.make(),
],
),
),
Spacer(),
Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [
20.hb,
Icon(
CupertinoIcons.chevron_right,
size: 40.w,
color: Colors.black.withOpacity(0.45),
)
],
)
],
),
),
), ),
Row( Offstage(
children: [ offstage: _type == 1,
Padding( child: GestureDetector(
padding: EdgeInsets.only(left: 2.w), onTap: () async {
child: Assets.icons.connect.image(width: 40.w, height: 40.w), var re = await Get.to(() => AddAppointmentAddressPage());
), if (re != null) {
20.wb, _accessAddress = re['address'];
BeeDivider.horizontal().expand(), _accessAddressDetail = re['addressDetail'];
], setState(() {});
), }
GestureDetector( },
onTap: () async { child: Material(
var re = await Get.to(() => AddAppointmentAddressPage()); color: Colors.transparent,
if (re != null) { child: Row(
_serviceAddress = re['address']; crossAxisAlignment: CrossAxisAlignment.start,
_serviceAddressDetail = re['addressDetail']; children: [
setState(() {}); Icon(
} CupertinoIcons.location,
}, size: 40.w,
child: Material( ),
color: Colors.transparent, 20.w.widthBox,
child: Row( SizedBox(
crossAxisAlignment: CrossAxisAlignment.end, width: 430.w,
children: [ child: Column(
Column( mainAxisAlignment: MainAxisAlignment.start,
children: [ crossAxisAlignment: CrossAxisAlignment.start,
8.w.heightBox, children: [
_connect(5), '${_accessAddress ?? ''}'
8.w.heightBox, .text
Container( .size(32.sp)
margin: EdgeInsets.only(left: 8.w), .black
width: 32.w, .bold
height: 32.w, .make(),
alignment: Alignment.center, 12.w.heightBox,
decoration: BoxDecoration( '${_accessAddressDetail ?? ''}'
color: Colors.black, .text
borderRadius: BorderRadius.circular(20.w)), .maxLines(1)
child: ''.text.size(20.w).white.bold.make(), .overflow(TextOverflow.ellipsis)
.size(24.sp)
.color(Colors.black.withOpacity(0.45))
.make(),
],
), ),
], ),
), Spacer(),
20.w.widthBox, Column(
SizedBox( mainAxisAlignment: MainAxisAlignment.center,
width: 430.w,
child: Column(
mainAxisAlignment: MainAxisAlignment.end,
crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
'鲍汁牛肉饭' 20.hb,
.text Icon(
.size(32.sp) CupertinoIcons.chevron_right,
.black size: 40.w,
.lineHeight(1.1) color: Colors.black.withOpacity(0.45),
.bold )
.make(),
12.w.heightBox,
'${_serviceAddress ?? ''}'
.text
.maxLines(1)
.overflow(TextOverflow.ellipsis)
.size(24.sp)
.color(Colors.black.withOpacity(0.45))
.make(),
], ],
), )
), ],
Spacer(), ),
Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [
20.hb,
Icon(
CupertinoIcons.chevron_right,
size: 40.w,
color: Colors.black.withOpacity(0.45),
)
],
)
],
), ),
), ),
) )
@ -832,6 +875,8 @@ class _PublishTaskPageState extends State<PublishTaskPage> {
onChanged: (text) => setState(() {}), onChanged: (text) => setState(() {}),
autofocus: false, autofocus: false,
controller: _rewardController, controller: _rewardController,
keyboardType: TextInputType.number,
inputFormatters: [FilteringTextInputFormatter.digitsOnly],
style: TextStyle(color: Colors.red), style: TextStyle(color: Colors.red),
decoration: InputDecoration( decoration: InputDecoration(
contentPadding: EdgeInsets.zero, contentPadding: EdgeInsets.zero,

@ -1,4 +1,3 @@
import 'package:aku_new_community/constants/api.dart';
import 'package:aku_new_community/constants/sars_api.dart'; import 'package:aku_new_community/constants/sars_api.dart';
import 'package:aku_new_community/utils/network/net_util.dart'; import 'package:aku_new_community/utils/network/net_util.dart';
@ -22,24 +21,26 @@ class TaskFunc {
required int rewardType, required int rewardType,
required String reward, required String reward,
}) async { }) async {
var base = await NetUtil().post(API.manager.task.publish, params: { var base = await NetUtil().post(SARSAPI.task.insert,
'type': type, params: {
'sex': sex, 'type': type,
'servicePersonnel': servicePersonnel, 'sex': sex,
'readyStartTime': readyStartTime, 'servicePersonnel': servicePersonnel,
'readyEndTime': readyEndTime, 'readyStartTime': readyStartTime,
'contact': contact, 'readyEndTime': readyEndTime,
'tel': tel, 'contact': contact,
'accessAddress': accessAddress, 'tel': tel,
'accessAddressDetail': accessAddressDetail, 'accessAddress': accessAddress,
'serviceAddress': serviceAddress, 'accessAddressDetail': accessAddressDetail,
'serviceAddressDetail': serviceAddressDetail, 'serviceAddress': serviceAddress,
'remarks': remarks, 'serviceAddressDetail': serviceAddressDetail,
'voiceUrl': voiceUrl, 'remarks': remarks,
'imgUrls': imgUrls, 'voiceUrl': voiceUrl,
'rewardType': rewardType, 'imgUrls': imgUrls,
'reward': reward, 'rewardType': rewardType,
}); 'reward': reward,
},
showMessage: true);
return base.success; return base.success;
} }

@ -1,4 +1,12 @@
class TaskMap { class TaskMap {
static Map<int, String> taskMode = {1: '大厅', 2: '我服务的', 3: '我发布的'};
static Map<int, String> taskType = {
1: '跑腿',
2: '家政',
3: '维修',
4: '家教',
9: '其他'
};
static Map<int, String> statusToString = { static Map<int, String> statusToString = {
1: '未接单', 1: '未接单',
2: '待处理', 2: '待处理',

@ -2,6 +2,7 @@ import 'package:aku_new_community/ui/service/hall/hall_view.dart';
import 'package:aku_new_community/ui/service/my_take_task/my_take_task_view.dart'; import 'package:aku_new_community/ui/service/my_take_task/my_take_task_view.dart';
import 'package:aku_new_community/ui/service/my_task/my_task_view.dart'; import 'package:aku_new_community/ui/service/my_task/my_task_view.dart';
import 'package:aku_new_community/ui/service/publish_task_page.dart'; import 'package:aku_new_community/ui/service/publish_task_page.dart';
import 'package:aku_new_community/ui/service/task_map.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/painter/tab_indicator.dart'; import 'package:aku_new_community/widget/painter/tab_indicator.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
@ -19,16 +20,15 @@ class TaskPage extends StatefulWidget {
class _TaskPageState extends State<TaskPage> with TickerProviderStateMixin { class _TaskPageState extends State<TaskPage> with TickerProviderStateMixin {
late TabController _tabController; late TabController _tabController;
List<String> _tabs = ['大厅', '我服务的', '我发布的'];
List<String> _types = ['跑腿', '家政', '维修', '家教', '其他'];
List<EasyRefreshController> _refreshControllers = []; List<EasyRefreshController> _refreshControllers = [];
int _currentType = 0; int _currentType = 0;
@override @override
void initState() { void initState() {
_tabController = TabController(length: _tabs.length, vsync: this); _tabController =
_refreshControllers = _tabs.map((e) => EasyRefreshController()).toList(); TabController(length: TaskMap.taskMode.values.length, vsync: this);
_refreshControllers =
TaskMap.taskMode.values.map((e) => EasyRefreshController()).toList();
super.initState(); super.initState();
} }
@ -46,8 +46,10 @@ class _TaskPageState extends State<TaskPage> with TickerProviderStateMixin {
title: '', title: '',
actions: [ actions: [
IconButton( IconButton(
onPressed: () { onPressed: () async {
Get.to(() => PublishTaskPage()); await Get.to(() => PublishTaskPage());
_tabController.animateTo(0);
_refreshControllers[0].callRefresh();
}, },
icon: Icon( icon: Icon(
Icons.add_circle_outline, Icons.add_circle_outline,
@ -64,7 +66,7 @@ class _TaskPageState extends State<TaskPage> with TickerProviderStateMixin {
padding: EdgeInsets.symmetric(horizontal: 16.w), padding: EdgeInsets.symmetric(horizontal: 16.w),
child: Row( child: Row(
children: [ children: [
..._tabs ...TaskMap.taskMode.values
.mapIndexed((currentValue, index) => .mapIndexed((currentValue, index) =>
_tabCard(currentValue, index)) _tabCard(currentValue, index))
.toList(), .toList(),
@ -74,7 +76,7 @@ class _TaskPageState extends State<TaskPage> with TickerProviderStateMixin {
Padding( Padding(
padding: EdgeInsets.symmetric(vertical: 24.w, horizontal: 32.w), padding: EdgeInsets.symmetric(vertical: 24.w, horizontal: 32.w),
child: Row( child: Row(
children: _types children: TaskMap.taskType.values
.mapIndexed((currentValue, index) => .mapIndexed((currentValue, index) =>
_typeBar(currentValue, index)) _typeBar(currentValue, index))
.toList(), .toList(),

@ -18,7 +18,7 @@ class HiveStore {
static Box? get dataBox => _dataBox; static Box? get dataBox => _dataBox;
static Box? _shortcutBox; static Box? _shortcutBox;
static Box? get shortcutBox => _dataBox; static Box? get shortcutBox => _shortcutBox;
static Future init() async { static Future init() async {
if (!kIsWeb) { if (!kIsWeb) {

@ -6,8 +6,18 @@ import 'package:velocity_x/src/extensions/string_ext.dart';
class BeeLongButton extends StatelessWidget { class BeeLongButton extends StatelessWidget {
final VoidCallback? onPressed; final VoidCallback? onPressed;
final String text; final String text;
final Color backColor;
final BorderSide border;
const BeeLongButton({Key? key, required this.onPressed, required this.text}) const BeeLongButton({Key? key, required this.onPressed, required this.text})
: super(key: key); : backColor = kPrimaryColor,
border = BorderSide.none,
super(key: key);
BeeLongButton.white({Key? key, required this.onPressed, required this.text})
: backColor = Colors.white,
border = BorderSide(color: Colors.black.withOpacity(0.45)),
super(key: key);
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
@ -17,8 +27,9 @@ class BeeLongButton extends StatelessWidget {
disabledColor: Colors.black.withOpacity(0.06), disabledColor: Colors.black.withOpacity(0.06),
disabledTextColor: Colors.black.withOpacity(0.25), disabledTextColor: Colors.black.withOpacity(0.25),
textColor: Colors.black.withOpacity(0.85), textColor: Colors.black.withOpacity(0.85),
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(65.w)), shape: RoundedRectangleBorder(
color: kPrimaryColor, borderRadius: BorderRadius.circular(65.w), side: border),
color: backColor,
onPressed: onPressed, onPressed: onPressed,
child: text.text.size(32.sp).bold.make(), child: text.text.size(32.sp).bold.make(),
); );

Loading…
Cancel
Save