6 changed files with 485 additions and 101 deletions
Split View
Diff Options
-
142lib/pages/discover/month_task_detail.dart
-
31lib/pages/discover/settlement_page.dart
-
45lib/pages/home/content_card.dart
-
41lib/pages/message/conversation_tab.dart
-
161lib/widget/live/live_room_anchor_showcase.dart
-
166lib/widget/live/month_task_dialog.dart
@ -0,0 +1,142 @@ |
|||
import 'package:dating_touchme_app/components/page_appbar.dart'; |
|||
import 'package:dating_touchme_app/controller/discover/room_controller.dart'; |
|||
import 'package:dating_touchme_app/model/discover/task_template_data.dart'; |
|||
import 'package:flutter/material.dart'; |
|||
import 'package:flutter_screenutil/flutter_screenutil.dart'; |
|||
import 'package:get/get.dart'; |
|||
|
|||
class MonthTaskDetail extends StatefulWidget { |
|||
const MonthTaskDetail({super.key}); |
|||
|
|||
@override |
|||
State<MonthTaskDetail> createState() => _MonthTaskDetailState(); |
|||
} |
|||
|
|||
class _MonthTaskDetailState extends State<MonthTaskDetail> { |
|||
@override |
|||
Widget build(BuildContext context) { |
|||
|
|||
final roomController = Get.find<RoomController>(); |
|||
return Obx( |
|||
() { |
|||
return Scaffold( |
|||
appBar: PageAppbar(title: "任务详情"), |
|||
body: SingleChildScrollView( |
|||
child: Container( |
|||
padding: EdgeInsets.symmetric( |
|||
vertical: 20.w, |
|||
horizontal: 15.w |
|||
), |
|||
child: Column( |
|||
crossAxisAlignment: CrossAxisAlignment.start, |
|||
children: [ |
|||
IntrinsicHeight( |
|||
child: Container( |
|||
margin: EdgeInsets.only(bottom: 21.w), |
|||
decoration: BoxDecoration( |
|||
border: Border( |
|||
bottom: BorderSide(width: 1.w, color: const Color.fromRGBO(212, 212, 212, 1)) |
|||
) |
|||
), |
|||
child: Row( |
|||
children: [ |
|||
Container( |
|||
width: 229.w, |
|||
decoration: BoxDecoration( |
|||
border: Border( |
|||
right: BorderSide(width: 1.w, color: const Color.fromRGBO(212, 212, 212, 1)) |
|||
) |
|||
), |
|||
child: Column( |
|||
children: [ |
|||
Container( |
|||
height: 37.w, |
|||
color: const Color.fromRGBO(247, 247, 247, 1), |
|||
child: Center( |
|||
child: Text( |
|||
"任务详情", |
|||
style: TextStyle( |
|||
fontSize: 14.w |
|||
), |
|||
), |
|||
), |
|||
), |
|||
for (int i = 0; i < roomController.taskTemplateData.value.subList!.length; i++) |
|||
Container( |
|||
padding: EdgeInsets.only(left: 14.w, right: 18.w, top: 8.w, bottom: 8.w), |
|||
decoration: BoxDecoration( |
|||
border: i < roomController.taskTemplateData.value.subList!.length - 1 ? Border( |
|||
bottom: BorderSide(width: 1.w, color: const Color.fromRGBO(212, 212, 212, 1)) |
|||
) : null |
|||
), |
|||
alignment: Alignment.centerLeft, |
|||
child: Text( |
|||
"${i + 1}.${ |
|||
roomController.taskTemplateData.value.subList![i].subTaskDesc ?? "" |
|||
}", |
|||
style: TextStyle( |
|||
fontSize: 14.w |
|||
), |
|||
), |
|||
), |
|||
], |
|||
), |
|||
), |
|||
Expanded( |
|||
child: Column( |
|||
children: [ |
|||
Container( |
|||
height: 37.w, |
|||
color: const Color.fromRGBO(247, 247, 247, 1), |
|||
child: Center( |
|||
child: Text( |
|||
"任务奖励", |
|||
style: TextStyle( |
|||
fontSize: 14.w |
|||
), |
|||
), |
|||
), |
|||
), |
|||
Expanded( |
|||
child: Container( |
|||
padding: EdgeInsets.only(left: 14.w, right: 18.w), |
|||
alignment: Alignment.center, |
|||
child: Text( |
|||
"${roomController.taskTemplateData.value.rewardValue ?? ""}元", |
|||
style: TextStyle( |
|||
fontSize: 18.w, |
|||
color: const Color.fromRGBO(239, 19, 46, 1) |
|||
), |
|||
), |
|||
), |
|||
) |
|||
], |
|||
), |
|||
) |
|||
], |
|||
), |
|||
), |
|||
), |
|||
Text( |
|||
"任务说明", |
|||
style: TextStyle( |
|||
fontSize: 14.w |
|||
), |
|||
), |
|||
SizedBox(height: 6.w,), |
|||
Text( |
|||
"${roomController.taskTemplateData.value.taskDesc ?? ""}", |
|||
style: TextStyle( |
|||
fontSize: 14.w, |
|||
color: const Color.fromRGBO(144, 144, 144, 1) |
|||
), |
|||
) |
|||
], |
|||
), |
|||
), |
|||
), |
|||
); |
|||
} |
|||
); |
|||
} |
|||
} |
|||
@ -0,0 +1,166 @@ |
|||
import 'package:dating_touchme_app/controller/discover/room_controller.dart'; |
|||
import 'package:dating_touchme_app/extension/ex_widget.dart'; |
|||
import 'package:dating_touchme_app/model/discover/task_data.dart'; |
|||
import 'package:dating_touchme_app/pages/discover/task_detail.dart'; |
|||
import 'package:flutter/material.dart'; |
|||
import 'package:flutter_screenutil/flutter_screenutil.dart'; |
|||
import 'package:flutter_smart_dialog/flutter_smart_dialog.dart'; |
|||
import 'package:get/get.dart'; |
|||
import 'package:tdesign_flutter/tdesign_flutter.dart'; |
|||
|
|||
import '../../pages/discover/month_task_detail.dart'; |
|||
|
|||
class MonthTaskDialog extends StatefulWidget { |
|||
const MonthTaskDialog({super.key}); |
|||
|
|||
@override |
|||
State<MonthTaskDialog> createState() => _MonthTaskDialogState(); |
|||
} |
|||
|
|||
class _MonthTaskDialogState extends State<MonthTaskDialog> { |
|||
@override |
|||
Widget build(BuildContext context) { |
|||
|
|||
final roomController = Get.find<RoomController>(); |
|||
return ClipRRect( |
|||
borderRadius: BorderRadius.vertical(top: Radius.circular(9.w)), |
|||
child: Material( |
|||
color: Colors.white, |
|||
child: Container( |
|||
width: 375.w, |
|||
height: 336.w, |
|||
decoration: BoxDecoration( |
|||
gradient: LinearGradient( |
|||
begin: Alignment.topCenter, |
|||
end: Alignment.bottomCenter, |
|||
colors: [ |
|||
Color.fromRGBO(236, 224, 255, 1), // 0% |
|||
Color.fromRGBO(247, 247, 247, 1), // 100% |
|||
], |
|||
), |
|||
), |
|||
child: Column( |
|||
children: [ |
|||
SizedBox( |
|||
height: 77.w, |
|||
child: Row( |
|||
mainAxisAlignment: MainAxisAlignment.spaceBetween, |
|||
children: [ |
|||
Container( |
|||
width: 68.w, |
|||
padding: EdgeInsets.only(left: 15.w), |
|||
alignment: Alignment.centerLeft, |
|||
child: Icon( |
|||
Icons.keyboard_arrow_left, |
|||
size: 26.w, |
|||
color: const Color.fromRGBO(144, 144, 144, 1), |
|||
), |
|||
), |
|||
Text( |
|||
"本月任务", |
|||
style: TextStyle( |
|||
fontSize: 21.w, |
|||
fontWeight: FontWeight.w700 |
|||
), |
|||
), |
|||
Container( |
|||
width: 68.w, |
|||
height: 22.w, |
|||
decoration: BoxDecoration( |
|||
borderRadius: BorderRadius.horizontal(left: Radius.circular(22.w)), |
|||
color: Colors.white |
|||
), |
|||
child: Center( |
|||
child: Text( |
|||
"任务详情", |
|||
style: TextStyle( |
|||
fontSize: 12.w, |
|||
color: const Color.fromRGBO(144, 144, 144, 1) |
|||
), |
|||
), |
|||
), |
|||
).onTap(() async { |
|||
// 隐藏键盘 |
|||
FocusScope.of(context).unfocus(); |
|||
// 隐藏 overlay |
|||
await roomController.getTaskTemplateData(); |
|||
await SmartDialog.dismiss(); |
|||
Get.to(() => MonthTaskDetail()); |
|||
}) |
|||
], |
|||
), |
|||
), |
|||
SingleChildScrollView( |
|||
child: Container( |
|||
padding: EdgeInsets.symmetric(horizontal: 12.w), |
|||
child: Column( |
|||
children: [ |
|||
...roomController.taskData.value.subList!.map((e){ |
|||
return TaskItem(item: e,); |
|||
}) |
|||
], |
|||
), |
|||
), |
|||
) |
|||
], |
|||
), |
|||
), |
|||
), |
|||
); |
|||
} |
|||
} |
|||
|
|||
|
|||
class TaskItem extends StatefulWidget { |
|||
final SubList item; |
|||
const TaskItem({super.key, required this.item}); |
|||
|
|||
@override |
|||
State<TaskItem> createState() => _TaskItemState(); |
|||
} |
|||
|
|||
class _TaskItemState extends State<TaskItem> { |
|||
@override |
|||
Widget build(BuildContext context) { |
|||
return Container( |
|||
width: 350.w, |
|||
margin: EdgeInsets.only(bottom: 10.w), |
|||
padding: EdgeInsets.only( |
|||
top: 15.w, |
|||
right: 10.w, |
|||
bottom: 21.w, |
|||
left: 12.w |
|||
), |
|||
child: Column( |
|||
children: [ |
|||
Row( |
|||
mainAxisAlignment: MainAxisAlignment.spaceBetween, |
|||
children: [ |
|||
Text( |
|||
widget.item.subTaskDesc ?? "", |
|||
style: TextStyle( |
|||
fontSize: 14.w |
|||
), |
|||
), |
|||
Text( |
|||
"${widget.item.completeCount ?? ""}/${widget.item.requiredCount ?? ""}${widget.item.sort == 1 ? "分钟" : widget.item.sort == 2 ? "对" : "人"}", |
|||
style: TextStyle( |
|||
fontSize: 12.w, |
|||
color: const Color.fromRGBO(144, 144, 144, 1) |
|||
), |
|||
) |
|||
], |
|||
), |
|||
SizedBox(height: 10.w,), |
|||
TDProgress( |
|||
type: TDProgressType.linear, |
|||
value: ((widget.item.completeCount ?? 0) / (widget.item.requiredCount ?? 0)), |
|||
strokeWidth: 6, |
|||
progressLabelPosition: TDProgressLabelPosition.inside, |
|||
showLabel: false, |
|||
) |
|||
], |
|||
), |
|||
); |
|||
} |
|||
} |
|||
Write
Preview
Loading…
Cancel
Save