添加评价弹窗

修改任务发布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
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
AssetGenImage get change => const AssetGenImage('assets/icons/change.png');
@ -249,6 +253,9 @@ class $AssetsIconsGen {
AssetGenImage get contract =>
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
AssetGenImage get delete => const AssetGenImage('assets/icons/delete.png');
@ -256,6 +263,10 @@ class $AssetsIconsGen {
AssetGenImage get deviceAlarm =>
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
AssetGenImage get edit => const AssetGenImage('assets/icons/edit.png');
@ -675,6 +686,9 @@ class $AssetsIconsGen {
AssetGenImage get nearbyService =>
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
AssetGenImage get oxygen => const AssetGenImage('assets/icons/oxygen.png');
@ -719,6 +733,10 @@ class $AssetsIconsGen {
/// File path: 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
AssetGenImage get secondHand =>
const AssetGenImage('assets/icons/second_hand.png');

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

@ -26,4 +26,6 @@ HallListModel _$HallListModelFromJson(Map<String, dynamic> json) =>
.toList(),
rewardType: json['rewardType'] 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/widget/bee_divider.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/voice_player.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})
: super(key: key);
bool get myself => UserTool.userProvider.userInfoModel!.id == model.createId;
@override
Widget build(BuildContext context) {
var head = Row(
@ -37,6 +40,23 @@ class HallCard extends StatelessWidget {
.color(Color(0xFFFA8C16))
.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(),
Assets.icons.intergral.image(width: 24.w, height: 24.w),
8.w.widthBox,
@ -66,8 +86,9 @@ class HallCard extends StatelessWidget {
],
);
return GestureDetector(
onTap: () {
Get.to(() => HallDetailPage(model: model));
onTap: () async {
await Get.to(() => HallDetailPage(model: model));
refresh();
},
child: Container(
width: double.infinity,
@ -143,14 +164,28 @@ class HallCard extends StatelessWidget {
Row(
children: [
Spacer(),
CardBottomButton.yellow(
text: '领取任务',
onPressed: () async {
var re = await TaskFunc.take(taskId: model.id);
if (re) {
refresh();
}
}),
Offstage(
offstage: !myself,
child: CardBottomButton.white(
text: '取消发布',
onPressed: () async {
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/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/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/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:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:get/get.dart';
import 'package:velocity_x/velocity_x.dart';
class HallDetailPage extends StatefulWidget {
@ -18,6 +27,9 @@ class HallDetailPage extends StatefulWidget {
}
class _HallDetailPageState extends State<HallDetailPage> {
bool get myself =>
UserTool.userProvider.userInfoModel!.id == widget.model.createId;
@override
Widget build(BuildContext context) {
return BeeScaffold(
@ -34,15 +46,10 @@ class _HallDetailPageState extends State<HallDetailPage> {
gradient: LinearGradient(
begin: Alignment.centerLeft,
end: Alignment.centerRight,
colors: widget.model.status == 4
? [
Colors.white,
Color(0xFFADACAC),
]
: [
Color(0xFFFFB737),
Color(0xFFFFD361),
]),
colors: [
Color(0xFFFFB737),
Color(0xFFFFD361),
]),
),
child: Column(
children: [
@ -54,13 +61,13 @@ class _HallDetailPageState extends State<HallDetailPage> {
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))
@ -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))
.make(),
Spacer(),
'${DateUtil.formatDateStr(widget.model.updateDate)}'
'${DateUtil.formatDateStr(widget.model.createDate)}'
.text
.size(24.sp)
.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),
borderRadius: BorderRadius.circular(8.w),
),
child: '#${TaskMap.typeToString[widget.model.type]}'
child: '#${TaskMap.taskType[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,
// height: 500.w,
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.circular(8.w),
@ -175,16 +227,19 @@ class _HallDetailPageState extends State<HallDetailPage> {
34.w.heightBox,
Row(
children: [
Assets.icons.clockCircle.image(width: 36.w, height: 36.w),
Assets.icons.watch.image(width: 40.w, height: 40.w),
24.w.widthBox,
'${DateUtil.formatDateStr(widget.model.readyEndTime)}'
.text
.size(24.sp)
.color(Colors.black.withOpacity(0.65))
'${widget.model.serviceTime ?? '0'}'
.richText
.withTextSpanChildren([
' 分钟'.textSpan.size(28.sp).color(Colors.black).make(),
])
.size(28.sp)
.color(Color(0xFFFA8C16))
.make(),
],
),
20.w.heightBox,
24.w.heightBox,
Row(
children: [
Assets.icons.environment.image(width: 36.w, height: 36.w),
@ -206,16 +261,18 @@ class _HallDetailPageState extends State<HallDetailPage> {
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.remarks.text
.size(28.sp)
.color(Colors.black.withOpacity(0.65))
.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))
.make(),
Spacer(),
'¥${widget.model.reward}'
.text
.size(32.sp)
.color(Colors.red)
.make(),
widget.model.rewardType == 1
? Text(
'¥ ',
style: TextStyle(color: Colors.red, fontSize: 32.sp),
)
: 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/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_map.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/network/net_util.dart';
@ -20,6 +21,7 @@ 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/services.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:get/get.dart';
import 'package:velocity_x/velocity_x.dart';
@ -32,8 +34,6 @@ class PublishTaskPage extends StatefulWidget {
}
class _PublishTaskPageState extends State<PublishTaskPage> {
List<String> _types = ['跑腿', '家政', '维修', '家教', '其他'];
//
int _type = 0;
List<String> _sexStr = ['', '', '不限'];
@ -75,6 +75,7 @@ class _PublishTaskPageState extends State<PublishTaskPage> {
return BeeScaffold(
title: '发布任务',
extendBody: true,
bodyColor: Color(0xFFE5E5E5),
body: Stack(
children: [
ClipPath(
@ -112,9 +113,14 @@ class _PublishTaskPageState extends State<PublishTaskPage> {
var _voiceUrl;
if (_voiceUri != null) {
try {
_voiceUrl = await NetUtil().upload(
var base = await NetUtil().upload(
SARSAPI.uploadFile.uploadImg,
File.fromUri(Uri(path: _voiceUri)));
if (base.success) {
_voiceUrl = base.data;
} else {
BotToast.showText(text: base.msg);
}
} catch (e) {
print(e.toString());
}
@ -171,18 +177,19 @@ class _PublishTaskPageState extends State<PublishTaskPage> {
},
child: CupertinoPicker.builder(
itemExtent: 60.w,
childCount: _types.length,
childCount: TaskMap.taskType.values.length,
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) {
var str = TaskMap.taskType.values.toList()[index];
return Center(
child: _types[index]
.text
.size(32.sp)
.isIntrinsic
.color(Colors.black.withOpacity(0.25))
.make(),
child: str.text.size(32.sp).isIntrinsic.make(),
);
}));
},
@ -200,7 +207,7 @@ class _PublishTaskPageState extends State<PublishTaskPage> {
.color(Colors.black.withOpacity(0.45))
.make(),
),
'${_type == 0 ? '请选择分类' : _types[_type - 1]}'
'${_type == 0 ? '请选择分类' : TaskMap.taskType[_type]}'
.text
.size(28.sp)
.color(Colors.black.withOpacity(_type == 0 ? 0.25 : 0.85))
@ -314,49 +321,12 @@ class _PublishTaskPageState extends State<PublishTaskPage> {
Get.back();
setState(() {});
},
child: 'e'
.text
child: e.text
.size(28.sp)
.isIntrinsic
.color(Colors.black.withOpacity(0.85))
.make()))
.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:
'${DateUtil.formatDate(_appointDate, format: DateFormats.zh_mo_d_h_m)}'
.text
.size(28.sp)
.size(24.sp)
.color(Colors.black.withOpacity(0.85))
.make(),
),
@ -450,13 +420,12 @@ class _PublishTaskPageState extends State<PublishTaskPage> {
child:
'${DateUtil.formatDate(_appointEndDate, format: DateFormats.zh_mo_d_h_m)}'
.text
.size(28.sp)
.size(24.sp)
.color(Colors.black.withOpacity(_type == 0 ? 0.25 : 0.85))
.make(),
),
),
),
Spacer(),
Icon(
CupertinoIcons.chevron_right,
size: 24.w,
@ -479,7 +448,6 @@ class _PublishTaskPageState extends State<PublishTaskPage> {
onChanged: (text) => setState(() {}),
autofocus: false,
controller: _nameController,
style: TextStyle(color: Colors.red),
decoration: InputDecoration(
contentPadding: EdgeInsets.zero,
isDense: true,
@ -509,7 +477,8 @@ class _PublishTaskPageState extends State<PublishTaskPage> {
onChanged: (text) => setState(() {}),
autofocus: false,
controller: _telController,
style: TextStyle(color: Colors.red),
keyboardType: TextInputType.phone,
inputFormatters: [FilteringTextInputFormatter.digitsOnly],
decoration: InputDecoration(
contentPadding: EdgeInsets.zero,
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(
width: double.infinity,
padding:
@ -545,151 +671,68 @@ class _PublishTaskPageState extends State<PublishTaskPage> {
32.w.heightBox,
BeeDivider.horizontal(),
32.w.heightBox,
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: [
'鲍汁牛肉饭'.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),
)
],
)
],
),
),
Offstage(
offstage: _type != 1,
child: doubleAddress,
),
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(),
Offstage(
offstage: _type == 1,
child: 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: [
Icon(
CupertinoIcons.location,
size: 40.w,
),
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(),
],
),
],
),
20.w.widthBox,
SizedBox(
width: 430.w,
child: Column(
mainAxisAlignment: MainAxisAlignment.end,
crossAxisAlignment: CrossAxisAlignment.start,
),
Spacer(),
Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [
'鲍汁牛肉饭'
.text
.size(32.sp)
.black
.lineHeight(1.1)
.bold
.make(),
12.w.heightBox,
'${_serviceAddress ?? ''}'
.text
.maxLines(1)
.overflow(TextOverflow.ellipsis)
.size(24.sp)
.color(Colors.black.withOpacity(0.45))
.make(),
20.hb,
Icon(
CupertinoIcons.chevron_right,
size: 40.w,
color: Colors.black.withOpacity(0.45),
)
],
),
),
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(() {}),
autofocus: false,
controller: _rewardController,
keyboardType: TextInputType.number,
inputFormatters: [FilteringTextInputFormatter.digitsOnly],
style: TextStyle(color: Colors.red),
decoration: InputDecoration(
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/utils/network/net_util.dart';
@ -22,24 +21,26 @@ class TaskFunc {
required int rewardType,
required String reward,
}) async {
var base = await NetUtil().post(API.manager.task.publish, params: {
'type': type,
'sex': sex,
'servicePersonnel': servicePersonnel,
'readyStartTime': readyStartTime,
'readyEndTime': readyEndTime,
'contact': contact,
'tel': tel,
'accessAddress': accessAddress,
'accessAddressDetail': accessAddressDetail,
'serviceAddress': serviceAddress,
'serviceAddressDetail': serviceAddressDetail,
'remarks': remarks,
'voiceUrl': voiceUrl,
'imgUrls': imgUrls,
'rewardType': rewardType,
'reward': reward,
});
var base = await NetUtil().post(SARSAPI.task.insert,
params: {
'type': type,
'sex': sex,
'servicePersonnel': servicePersonnel,
'readyStartTime': readyStartTime,
'readyEndTime': readyEndTime,
'contact': contact,
'tel': tel,
'accessAddress': accessAddress,
'accessAddressDetail': accessAddressDetail,
'serviceAddress': serviceAddress,
'serviceAddressDetail': serviceAddressDetail,
'remarks': remarks,
'voiceUrl': voiceUrl,
'imgUrls': imgUrls,
'rewardType': rewardType,
'reward': reward,
},
showMessage: true);
return base.success;
}

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

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

@ -6,8 +6,18 @@ import 'package:velocity_x/src/extensions/string_ext.dart';
class BeeLongButton extends StatelessWidget {
final VoidCallback? onPressed;
final String text;
final Color backColor;
final BorderSide border;
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
Widget build(BuildContext context) {
@ -17,8 +27,9 @@ class BeeLongButton extends StatelessWidget {
disabledColor: Colors.black.withOpacity(0.06),
disabledTextColor: Colors.black.withOpacity(0.25),
textColor: Colors.black.withOpacity(0.85),
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(65.w)),
color: kPrimaryColor,
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(65.w), side: border),
color: backColor,
onPressed: onPressed,
child: text.text.size(32.sp).bold.make(),
);

Loading…
Cancel
Save