Browse Source

优化完成广场功能,对接活动和红娘

ios
王子贤 3 months ago
parent
commit
ae59bfd5dd
4 changed files with 583 additions and 127 deletions
  1. 270
      lib/pages/home/event_info.dart
  2. 67
      lib/pages/home/matchmaker_item.dart
  3. 48
      lib/pages/home/recommend_tab.dart
  4. 325
      lib/pages/home/timeline_info.dart

270
lib/pages/home/event_info.dart

@ -0,0 +1,270 @@
import 'package:dating_touchme_app/components/page_appbar.dart';
import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
class EventInfo extends StatelessWidget {
const EventInfo({super.key});
@override
Widget build(BuildContext context) {
return 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: [
Image.network(
"https://dating-agency-test.oss-accelerate.aliyuncs.com/1.png",
width: 345.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: [
Text(
"星河 DEEP--轻奢浪漫之旅",
style: TextStyle(
fontSize: 18.w,
color: const Color.fromRGBO(255, 66, 236, 1),
fontWeight: FontWeight.w500
),
),
Row(
children: [
Icon(
Icons.group,
color: const Color.fromRGBO(255, 66, 236, 1),
size: 12.w,
),
SizedBox(width: 5.w,),
Text(
"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(
"08-21 00:00至08-22 23:59",
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(
"广州市天河区地址待定",
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(
"男10人 女10人",
style: TextStyle(
fontSize: 12.w,
color: const Color.fromRGBO(144, 144, 144, 1)
),
)
],
),
SizedBox(height: 5.w,),
Row(
children: [
Icon(
Icons.currency_yen,
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(
"男:1520元/人",
style: TextStyle(
fontSize: 12.w,
color: const Color.fromRGBO(144, 144, 144, 1)
),
)
],
),
Row(
children: [
Icon(
Icons.currency_yen,
color: const Color.fromRGBO(255, 66, 236, 0),
size: 12.w,
),
Text(
"费用:",
style: TextStyle(
fontSize: 12.w,
color: const Color.fromRGBO(144, 144, 144, 0)
),
),
Text(
"女:1520元/人",
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(
"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(
"0人",
style: TextStyle(
fontSize: 13.w,
color: const Color.fromRGBO(255, 237, 255, 1),
),
),
],
),
],
),
],
),
),
Image.network(
"https://dating-agency-test.oss-accelerate.aliyuncs.com/09B987965731.jpg",
width: 345.w,
fit: BoxFit.cover,
)
],
),
),
),
),
),
);
}
}

67
lib/pages/home/matchmaker_item.dart

@ -0,0 +1,67 @@
import 'package:dating_touchme_app/extension/ex_widget.dart';
import 'package:dating_touchme_app/generated/assets.dart';
import 'package:dating_touchme_app/model/home/marriage_data.dart';
import 'package:dating_touchme_app/pages/home/user_information_page.dart';
import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:get/get.dart';
class MatchmakerItem extends StatefulWidget {
final MarriageData item;
const MatchmakerItem({super.key, required this.item});
@override
State<MatchmakerItem> createState() => _MatchmakerItemState();
}
class _MatchmakerItemState extends State<MatchmakerItem> {
@override
Widget build(BuildContext context) {
return Stack(
clipBehavior: Clip.none,
children: [
ClipRRect(
borderRadius: BorderRadius.all(Radius.circular(40.w)),
child: widget.item.profilePhoto != "" ? Image.network(
widget.item.profilePhoto,
width: 40.w,
height: 40.w,
fit: BoxFit.cover,
) : Image.asset(
Assets.imagesUserAvatar,
width: 40.w,
height: 40.w,
fit: BoxFit.cover,
),
),
Positioned(
left: -3.w,
bottom: -3.w,
child: Container(
width: 46.w,
height: 14.w,
padding: EdgeInsets.symmetric(horizontal: 5.w),
decoration: BoxDecoration(
borderRadius: BorderRadius.all(Radius.circular(14.w)),
color: const Color.fromRGBO(0, 0, 0, .4)
),
child: Center(
child: Text(
widget.item.nickName,
maxLines: 1,
overflow: TextOverflow.ellipsis,
style: TextStyle(
fontSize: 9.w,
fontWeight: FontWeight.w500,
color: Colors.white
),
),
),
),
)
],
).onTap((){
Get.to(() => UserInformationPage(miId: widget.item.miId, userId: widget.item.userId,));
});
}
}

48
lib/pages/home/recommend_tab.dart

@ -1,4 +1,8 @@
import 'package:dating_touchme_app/extension/ex_widget.dart';
import 'package:dating_touchme_app/generated/assets.dart'; import 'package:dating_touchme_app/generated/assets.dart';
import 'package:dating_touchme_app/pages/home/event_info.dart';
import 'package:dating_touchme_app/pages/home/matchmaker_item.dart';
import 'package:dating_touchme_app/pages/mine/open_webview.dart';
import 'package:easy_refresh/easy_refresh.dart'; import 'package:easy_refresh/easy_refresh.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart';
@ -123,9 +127,14 @@ class _RecommendTabState extends State<RecommendTab>
children: [ children: [
Stack( Stack(
children: [ children: [
Image.asset(
Assets.imagesEvent,
width: 174.w,
ClipRRect(
borderRadius: BorderRadius.all(Radius.circular(8.w)),
child: Image.network(
"https://dating-agency-test.oss-accelerate.aliyuncs.com/1.png",
width: 174.w,
height: 84.w,
fit: BoxFit.cover,
),
), ),
Positioned( Positioned(
child: Container( child: Container(
@ -133,8 +142,8 @@ class _RecommendTabState extends State<RecommendTab>
height: 17.w, height: 17.w,
decoration: BoxDecoration( decoration: BoxDecoration(
borderRadius: BorderRadius.only( borderRadius: BorderRadius.only(
topLeft: Radius.circular(17.w),
bottomRight: Radius.circular(17.w),
topLeft: Radius.circular(8.w),
bottomRight: Radius.circular(8.w),
), ),
color: const Color.fromRGBO(234, 57, 49, 1) color: const Color.fromRGBO(234, 57, 49, 1)
), ),
@ -158,7 +167,7 @@ class _RecommendTabState extends State<RecommendTab>
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
Text( Text(
"万人联谊活动",
"星河 DEEP--轻奢浪漫之旅",
style: TextStyle( style: TextStyle(
fontSize: 13.w, fontSize: 13.w,
fontWeight: FontWeight.w500 fontWeight: FontWeight.w500
@ -168,7 +177,7 @@ class _RecommendTabState extends State<RecommendTab>
mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [ children: [
Text( Text(
"255人已报名",
"0人已报名",
style: TextStyle( style: TextStyle(
fontSize: 9.w, fontSize: 9.w,
color: const Color.fromRGBO(144, 144, 144, 1), color: const Color.fromRGBO(144, 144, 144, 1),
@ -190,7 +199,9 @@ class _RecommendTabState extends State<RecommendTab>
) )
], ],
), ),
),
).onTap((){
Get.to(() => EventInfo());
}),
Container( Container(
width: 167.w, width: 167.w,
height: 126.w, height: 126.w,
@ -211,14 +222,15 @@ class _RecommendTabState extends State<RecommendTab>
fontWeight: FontWeight.w700 fontWeight: FontWeight.w700
), ),
), ),
Text(
"查看更多",
style: TextStyle(
fontSize: 9.w,
color: const Color.fromRGBO(144, 144, 144, 1),
fontWeight: FontWeight.w500
),
)
],
),
Wrap(
spacing: 14.w,
runSpacing: 8.w,
children: [
...controller.nearbyFeed.take(6).toList().map((e){
return MatchmakerItem(item: e);
})
], ],
) )
], ],
@ -233,7 +245,9 @@ class _RecommendTabState extends State<RecommendTab>
Assets.imagesBanner, Assets.imagesBanner,
width: 375.w - 24, width: 375.w - 24,
), ),
),
).onTap((){
Get.to(() => OpenWebView(url: "https://www.quzhaoqin.com/"));
}),
Expanded( Expanded(
child: ListView.separated( child: ListView.separated(
// 使 // 使

325
lib/pages/home/timeline_info.dart

@ -1,7 +1,9 @@
import 'package:dating_touchme_app/components/page_appbar.dart'; import 'package:dating_touchme_app/components/page_appbar.dart';
import 'package:dating_touchme_app/extension/ex_widget.dart';
import 'package:dating_touchme_app/generated/assets.dart'; import 'package:dating_touchme_app/generated/assets.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:tdesign_flutter/tdesign_flutter.dart';
class TimelineInfo extends StatefulWidget { class TimelineInfo extends StatefulWidget {
const TimelineInfo({super.key}); const TimelineInfo({super.key});
@ -11,146 +13,249 @@ class TimelineInfo extends StatefulWidget {
} }
class _TimelineInfoState extends State<TimelineInfo> { class _TimelineInfoState extends State<TimelineInfo> {
bool showInput = false;
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Scaffold( return Scaffold(
appBar: PageAppbar(title: "详情"), appBar: PageAppbar(title: "详情"),
body: SingleChildScrollView(
child: Container(
padding: EdgeInsets.symmetric(
horizontal: 16.w,
vertical: 10.w
),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
body: Stack(
children: [
SingleChildScrollView(
child: Container(
padding: EdgeInsets.symmetric(
horizontal: 16.w,
vertical: 10.w
),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
Row( Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [ children: [
Image.asset(
Assets.imagesUserAvatar,
width: 40.w,
height: 40.w,
Row(
children: [
Image.asset(
Assets.imagesUserAvatar,
width: 40.w,
height: 40.w,
),
SizedBox(width: 8.w,),
Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
"刘美玲",
style: TextStyle(
fontSize: 13.w,
fontWeight: FontWeight.w500
),
),
Text(
"15:16",
style: TextStyle(
fontSize: 11.w,
color: const Color.fromRGBO(51, 51, 51, .6),
fontWeight: FontWeight.w500
),
)
],
)
],
),
PopupMenuButton<String>(
tooltip: "",
padding: EdgeInsets.zero,
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(14)),
color: Colors.white,
elevation: 8,
offset: Offset(0, 32.w), //
itemBuilder: (context) => [
const PopupMenuItem(value: 'report', child: Text('举报')),
],
onSelected: (v) {
if (v == 'report') {
print("举报");
}
},
child: Icon(
Icons.keyboard_control,
size: 15.w,
color: const Color.fromRGBO(51, 51, 51, 1),
), //
), ),
SizedBox(width: 8.w,),
Column(
crossAxisAlignment: CrossAxisAlignment.start,
],
),
Container(
margin: EdgeInsets.symmetric(vertical: 11.w),
child: Text(
"你总顾及别人,那谁来顾及你。你总顾及别人,那谁来顾及你。你总顾及别人,那谁来顾及你。你总顾及别人,那谁来顾及你。"
),
),
Image.asset(
Assets.imagesRoseBanner,
width: 343.w,
),
SizedBox(height: 15.w,),
Row(
mainAxisAlignment: MainAxisAlignment.end,
children: [
Row(
children: [ children: [
Image.asset(
Assets.imagesLikeIcon,
width: 14.w,
height: 12.w,
),
SizedBox(width: 6.w,),
Text( Text(
"刘美玲",
"47",
style: TextStyle( style: TextStyle(
fontSize: 13.w,
fontWeight: FontWeight.w500
fontSize: 11.w,
color: const Color.fromRGBO(144, 144, 144, .6)
), ),
)
],
),
SizedBox(width: 33.w,),
Row(
children: [
Image.asset(
Assets.imagesCommentIcon,
width: 15.w,
height: 15.w,
), ),
SizedBox(width: 6.w,),
Text( Text(
"15:16",
"23",
style: TextStyle( style: TextStyle(
fontSize: 11.w, fontSize: 11.w,
color: const Color.fromRGBO(51, 51, 51, .6),
fontWeight: FontWeight.w500
color: const Color.fromRGBO(144, 144, 144, .6)
), ),
) )
], ],
)
).onTap((){
showInput = true;
setState(() {
});
}),
], ],
), ),
PopupMenuButton<String>(
tooltip: "",
padding: EdgeInsets.zero,
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(14)),
color: Colors.white,
elevation: 8,
offset: Offset(0, 32.w), //
itemBuilder: (context) => [
const PopupMenuItem(value: 'report', child: Text('举报')),
],
onSelected: (v) {
if (v == 'report') {
print("举报");
}
},
child: Icon(
Icons.keyboard_control,
size: 15.w,
color: const Color.fromRGBO(51, 51, 51, 1),
), //
SizedBox(height: 18.w,),
Text(
"全部评论(23)",
style: TextStyle(
fontSize: 13.w,
color: const Color.fromRGBO(144, 144, 144, 1),
fontWeight: FontWeight.w500
),
), ),
SizedBox(height: 20.w,),
CommentItem(),
CommentItem(),
CommentItem(),
CommentItem(),
CommentItem(),
CommentItem(),
CommentItem(),
], ],
), ),
Container(
margin: EdgeInsets.symmetric(vertical: 11.w),
child: Text(
"你总顾及别人,那谁来顾及你。你总顾及别人,那谁来顾及你。你总顾及别人,那谁来顾及你。你总顾及别人,那谁来顾及你。"
),
),
Image.asset(
Assets.imagesRoseBanner,
width: 343.w,
),
SizedBox(height: 15.w,),
Row(
mainAxisAlignment: MainAxisAlignment.end,
),
),
if(showInput) Positioned.fill(
child: Container(
color: const Color.fromRGBO(0, 0, 0, .4),
).onTap((){
showInput = false;
setState(() {
});
}),
),
if(showInput) Positioned(
left: 0,
bottom: 0,
child: Container(
width: 375.w,
height: 60.w,
color: Colors.white,
padding: EdgeInsets.all(10.w),
child: Row(
children: [ children: [
Row(
children: [
Image.asset(
Assets.imagesLikeIcon,
width: 14.w,
height: 12.w,
Expanded(
child: Container(
decoration: BoxDecoration(
color: const Color.fromRGBO(247, 247, 247, 1),
borderRadius: BorderRadius.all(Radius.circular(40.w))
), ),
SizedBox(width: 6.w,),
Text(
"47",
child: TextField(
// controller: _codeController,
autofocus: true,
style: TextStyle( style: TextStyle(
fontSize: 11.w,
color: const Color.fromRGBO(144, 144, 144, .6)
fontSize: ScreenUtil().setWidth(14),
height: 1
), ),
)
],
decoration: InputDecoration(
contentPadding: EdgeInsets.symmetric(
vertical: 0,
horizontal: 17.w
),
hintText: "请输入评论",
border: const OutlineInputBorder(
borderSide: BorderSide.none, // //
),
// focusedBorder enabledBorder
focusedBorder: const OutlineInputBorder(
borderSide: BorderSide.none,
borderRadius: BorderRadius.all(Radius.circular(4.0)),
),
enabledBorder: const OutlineInputBorder(
borderSide: BorderSide.none,
borderRadius: BorderRadius.all(Radius.circular(4.0)),
),
),
onChanged: (value){
},
),
),
), ),
SizedBox(width: 33.w,),
Row(
children: [
Image.asset(
Assets.imagesCommentIcon,
width: 15.w,
height: 15.w,
Container(
width: 60.w,
height: 30.w,
margin: EdgeInsets.only(left: 15.w),
decoration: BoxDecoration(
borderRadius: BorderRadius.all(Radius.circular(30.w)),
gradient: LinearGradient(
begin: Alignment.centerLeft, // 0%
end: Alignment.centerRight, // 100%
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], // CSS 0%77.53%100%
), ),
SizedBox(width: 6.w,),
Text(
"23",
),
child: Center(
child: Text(
"发送",
style: TextStyle( style: TextStyle(
fontSize: 11.w,
color: const Color.fromRGBO(144, 144, 144, .6)
fontSize: 12.w,
color: Colors.white
), ),
)
],
),
),
),
)
], ],
), ),
SizedBox(height: 18.w,),
Text(
"全部评论(23)",
style: TextStyle(
fontSize: 13.w,
color: const Color.fromRGBO(144, 144, 144, 1),
fontWeight: FontWeight.w500
),
),
SizedBox(height: 20.w,),
CommentItem(),
CommentItem(),
CommentItem(),
CommentItem(),
CommentItem(),
CommentItem(),
CommentItem(),
],
),
),
),
)
],
), ),
); );
} }
@ -216,10 +321,10 @@ class _CommentItemState extends State<CommentItem> {
], ],
), ),
), ),
Image.asset(
Assets.imagesLikeIcon,
width: 14.w,
)
// Image.asset(
// Assets.imagesLikeIcon,
// width: 14.w,
// )
], ],
), ),
); );

Loading…
Cancel
Save