You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

327 lines
14 KiB

import 'package:cached_network_image/cached_network_image.dart';
import 'package:dating_touchme_app/components/page_appbar.dart';
import 'package:dating_touchme_app/controller/home/event_info_controller.dart';
import 'package:dating_touchme_app/extension/ex_widget.dart';
import 'package:dating_touchme_app/generated/assets.dart';
import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:get/get.dart';
class EventInfo extends StatelessWidget {
final String id;
const EventInfo({super.key, required this.id});
@override
Widget build(BuildContext context) {
return GetX<EventInfoController>(
init: EventInfoController(id: id),
builder: (controller){
return controller.item.value.id != null ? Scaffold(
appBar: const PageAppbar(title: "活动详情"),
body: SingleChildScrollView(
child: Container(
padding: EdgeInsets.all(15.w),
child: ClipRRect(
borderRadius: BorderRadius.all(Radius.circular(8.w)),
child: Container(
width: 345.w,
color: Colors.white,
child: Column(
children: [
CachedNetworkImage(
imageUrl: controller.item.value.imgList?[0].url ?? "",
width: 345.w,
fit: BoxFit.cover,
errorWidget: (context, error, stackTrace) {
return Image.asset(
Assets.imagesBanner,
width: 345.w,
height: 150.w,
fit: BoxFit.cover,
);
},
),
Container(
padding: EdgeInsets.symmetric(horizontal: 10.w, vertical: 15.w),
margin: EdgeInsets.only(bottom: 15.w),
child: Column(
children: [
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Expanded(
child: Text(
controller.item.value.name ?? "",
style: TextStyle(
fontSize: 18.w,
color: const Color.fromRGBO(255, 66, 236, 1),
fontWeight: FontWeight.w500
),
),
),
SizedBox(width: 10.w,),
Row(
children: [
Icon(
Icons.group,
color: const Color.fromRGBO(255, 66, 236, 1),
size: 12.w,
),
SizedBox(width: 5.w,),
Text(
"${(controller.item.value.manNumber ?? 0) + (controller.item.value.womanNumber ?? 0)}人已报名",
style: TextStyle(
fontSize: 12.w,
color: const Color.fromRGBO(144, 144, 144, 1)
),
)
],
)
],
),
SizedBox(height: 5.w,),
Row(
children: [
Icon(
Icons.access_time,
color: const Color.fromRGBO(255, 66, 236, 1),
size: 12.w,
),
Text(
"活动时间:",
style: TextStyle(
fontSize: 12.w,
color: const Color.fromRGBO(144, 144, 144, 1)
),
),
Text(
"${controller.item.value.beginTime!.substring(5, controller.item.value.beginTime!.length - 3)}${controller.item.value.endTime!.substring(5, controller.item.value.endTime!.length - 3)}",
style: TextStyle(
fontSize: 12.w,
color: const Color.fromRGBO(144, 144, 144, 1)
),
)
],
),
SizedBox(height: 5.w,),
Row(
children: [
Icon(
Icons.location_on_outlined,
color: const Color.fromRGBO(255, 66, 236, 1),
size: 12.w,
),
Text(
"地址:",
style: TextStyle(
fontSize: 12.w,
color: const Color.fromRGBO(144, 144, 144, 1)
),
),
Text(
"${controller.item.value.cityName ?? ""}${controller.item.value.districtName ?? ""}${controller.item.value.detailedAddress ?? ""}",
style: TextStyle(
fontSize: 12.w,
color: const Color.fromRGBO(144, 144, 144, 1)
),
)
],
),
SizedBox(height: 5.w,),
Row(
children: [
Icon(
Icons.group_outlined,
color: const Color.fromRGBO(255, 66, 236, 1),
size: 12.w,
),
Text(
"人数:",
style: TextStyle(
fontSize: 12.w,
color: const Color.fromRGBO(144, 144, 144, 1)
),
),
Text(
"${controller.item.value.numberMan}人 女${controller.item.value.womanNumber}",
style: TextStyle(
fontSize: 12.w,
color: const Color.fromRGBO(144, 144, 144, 1)
),
)
],
),
SizedBox(height: 15.w,),
Stack(
children: [
ClipRRect(
borderRadius: BorderRadius.all(Radius.circular(13.w)),
child: Row(
children: [
Expanded(
child: Container(
height: 13.w,
color: const Color.fromRGBO(237, 245, 255, 1),
),
),
Expanded(
child: Container(
height: 13.w,
color: const Color.fromRGBO(255, 237, 255, 1),
),
),
],
),
),
Positioned(
child: Center(
child: Transform(
transform: Matrix4.skewX(0.6),
child: Container(width: 20.w, height: 13.w, color: Colors.white,),
),
),
)
],
),
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Row(
children: [
Text(
"",
style: TextStyle(
fontSize: 13.w,
color: const Color.fromRGBO(144, 144, 144, 1)
),
),
Text(
"${(controller.item.value.manNumber ?? 0)}",
style: TextStyle(
fontSize: 13.w,
color: const Color.fromRGBO(237, 245, 255, 1),
),
),
],
),
Row(
children: [
Text(
"",
style: TextStyle(
fontSize: 13.w,
color: const Color.fromRGBO(144, 144, 144, 1)
),
),
Text(
"${(controller.item.value.womanNumber ?? 0)}",
style: TextStyle(
fontSize: 13.w,
color: const Color.fromRGBO(255, 237, 255, 1),
),
),
],
),
],
),
],
),
),
CachedNetworkImage(
imageUrl: controller.item.value.contentPic ?? "",
width: 345.w,
fit: BoxFit.cover,
)
],
),
),
),
),
),
bottomNavigationBar: (controller.item.value.participantStatus == 0 || controller.item.value.participantStatus == -1) ? Container(
height: 60.w,
color: Colors.white,
child: Center(
child: Container(
width: 350.w,
height: 45.w,
decoration: BoxDecoration(
borderRadius: BorderRadius.all(Radius.circular(45.w)),
color: Colors.grey,
),
child: Center(
child: Text(
"已报名",
style: TextStyle(
fontSize: 18.w,
color: Colors.white,
fontWeight: FontWeight.w500
),
),
),
),
),
) : controller.isOpen.value ? Container(
height: 60.w,
color: Colors.white,
child: Center(
child: Container(
width: 350.w,
height: 45.w,
decoration: BoxDecoration(
borderRadius: BorderRadius.all(Radius.circular(45.w)),
gradient: LinearGradient(
begin: Alignment.centerLeft, // 90deg: 从左到右
end: Alignment.centerRight,
colors: [
Color.fromRGBO(131, 89, 255, 1), // 起点颜色
Color.fromRGBO(77, 127, 231, 1), // 中间颜色
Color.fromRGBO(61, 138, 224, 1), // 终点颜色
],
stops: [0.0, 0.7753, 1.0], // 对应 0%、77.53%、100%
),
),
child: Center(
child: Text(
"立即报名",
style: TextStyle(
fontSize: 18.w,
color: Colors.white,
fontWeight: FontWeight.w500
),
),
),
),
),
).onTap((){
controller.submit();
}) : Container(
height: 60.w,
color: Colors.white,
child: Center(
child: Container(
width: 350.w,
height: 45.w,
decoration: BoxDecoration(
borderRadius: BorderRadius.all(Radius.circular(45.w)),
color: Colors.grey,
),
child: Center(
child: Text(
"活动已结束",
style: TextStyle(
fontSize: 18.w,
color: Colors.white,
fontWeight: FontWeight.w500
),
),
),
),
),
),
) : Container();
},
);
}
}