import 'package:dating_touchme_app/components/page_appbar.dart'; import 'package:dating_touchme_app/controller/global.dart'; import 'package:dating_touchme_app/controller/setting/task_controller.dart'; import 'package:dating_touchme_app/model/mine/matchmaker_requirement_data.dart'; import 'package:flutter/material.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:get/get.dart'; import 'package:tdesign_flutter/tdesign_flutter.dart'; class MatchTaskPage extends StatelessWidget { const MatchTaskPage({super.key}); @override Widget build(BuildContext context) { return GetX( init: TaskController(), builder: (controller){ return Scaffold( appBar: PageAppbar(title: "红娘任务"), body: controller.loading.value ? Center( child: TDLoading( size: TDLoadingSize.medium, icon: TDLoadingIcon.activity, text: '加载中…', axis: Axis.vertical, duration: 500, ) ) : SingleChildScrollView( child: Column( children: [ Container( padding: EdgeInsets.symmetric(vertical: 12.w, horizontal: 18.w), child: Column( children: [ Row( children: [ TDText('日任务', style: TextStyle(color: Color(0xFF333333), fontWeight: FontWeight.bold, fontSize: 16.w)), SizedBox(width: 4.w), Container( width: 4, height: 4, decoration: BoxDecoration( color: Color(0xFF999999), // 圆点颜色 shape: BoxShape.circle, // 圆形 ), ), SizedBox(width: 4.w), TDText('任务时间:截止 23:25', style: TextStyle(color: Color(0xFF666666), fontSize: 16.w)), ], ), SizedBox(height: 12.w,), ...controller.roseList.asMap().entries.map((entry){ return TaskItem(item: entry.value); }), SizedBox(height: 24.w,), Row( children: [ TDText('月任务', style: TextStyle(color: Color(0xFF333333), fontWeight: FontWeight.bold, fontSize: 16.w)), SizedBox(width: 4.w), Container( width: 4, height: 4, decoration: BoxDecoration( color: Color(0xFF999999), // 圆点颜色 shape: BoxShape.circle, // 圆形 ), ), SizedBox(width: 4.w), TDText('任务时间:截止 03/15 23:59', style: TextStyle(color: Color(0xFF666666), fontSize: 16.w)), ], ), SizedBox(height: 12.w,), ...controller.roseList.asMap().entries.map((entry){ return TaskItem(item: entry.value); }), SizedBox(height: 12.w,), Row( children: [ TDText('注意事项', style: TextStyle(color: Color(0xFF333333), fontSize: 16.w)), ], ), SizedBox(height: 4.w,), Row( children: [ Text('1.月任务未通过将受到惩罚;', style: TextStyle(fontSize: 12.w, color: Color(0xFF999999))), ], ), SizedBox(height: 4.w,), Row( children: [ Text('2.任务开始时间为成为红娘的那一刻起;', style: TextStyle(fontSize: 12.w, color: Color(0xFF999999))), ], ), SizedBox(height: 12.w), ], ), ) ], ) ) ); }, ); } } class TaskItem extends StatelessWidget { final MatchmakerRequirement item; const TaskItem({super.key, required this.item }); @override Widget build(BuildContext context) { return Container( margin: EdgeInsets.only(bottom: 12.w, left: 8.w, top: 8.w), child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ TDText(item.liveConsumptionAmount! > 0 ? '累计消费' : '累计连麦相亲', style: TextStyle(color: Color(0xFF333333), fontSize: 16.w)), SizedBox(height: 4.w), TDProgress( type: TDProgressType.linear, value: 0.5, strokeWidth: 6, progressLabelPosition: TDProgressLabelPosition.right, color: Color(0xFF7562F9), ), SizedBox(height: 2.w), TDText('目前有效金额:22.66元', style: TextStyle(color: Color(0xFF999999), fontSize: 12.w)), ], ), ); } }