diff --git a/lib/pages/home/event_info.dart b/lib/pages/home/event_info.dart new file mode 100644 index 0000000..3144fa9 --- /dev/null +++ b/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, + ) + ], + ), + ), + ), + ), + ), + ); + } +} diff --git a/lib/pages/home/matchmaker_item.dart b/lib/pages/home/matchmaker_item.dart new file mode 100644 index 0000000..29caa90 --- /dev/null +++ b/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 createState() => _MatchmakerItemState(); +} + +class _MatchmakerItemState extends State { + @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,)); + }); + } +} diff --git a/lib/pages/home/recommend_tab.dart b/lib/pages/home/recommend_tab.dart index ec3b435..e06f92a 100644 --- a/lib/pages/home/recommend_tab.dart +++ b/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/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:flutter/material.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart'; @@ -123,9 +127,14 @@ class _RecommendTabState extends State children: [ Stack( 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( child: Container( @@ -133,8 +142,8 @@ class _RecommendTabState extends State height: 17.w, decoration: BoxDecoration( 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) ), @@ -158,7 +167,7 @@ class _RecommendTabState extends State crossAxisAlignment: CrossAxisAlignment.start, children: [ Text( - "万人联谊活动", + "星河 DEEP--轻奢浪漫之旅", style: TextStyle( fontSize: 13.w, fontWeight: FontWeight.w500 @@ -168,7 +177,7 @@ class _RecommendTabState extends State mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ Text( - "255人已报名", + "0人已报名", style: TextStyle( fontSize: 9.w, color: const Color.fromRGBO(144, 144, 144, 1), @@ -190,7 +199,9 @@ class _RecommendTabState extends State ) ], ), - ), + ).onTap((){ + Get.to(() => EventInfo()); + }), Container( width: 167.w, height: 126.w, @@ -211,14 +222,15 @@ class _RecommendTabState extends State 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 Assets.imagesBanner, width: 375.w - 24, ), - ), + ).onTap((){ + Get.to(() => OpenWebView(url: "https://www.quzhaoqin.com/")); + }), Expanded( child: ListView.separated( // 关键:始终允许滚动,即使内容不足 diff --git a/lib/pages/home/timeline_info.dart b/lib/pages/home/timeline_info.dart index 4455fbb..698a5fb 100644 --- a/lib/pages/home/timeline_info.dart +++ b/lib/pages/home/timeline_info.dart @@ -1,7 +1,9 @@ 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:flutter/material.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart'; +import 'package:tdesign_flutter/tdesign_flutter.dart'; class TimelineInfo extends StatefulWidget { const TimelineInfo({super.key}); @@ -11,146 +13,249 @@ class TimelineInfo extends StatefulWidget { } class _TimelineInfoState extends State { + + bool showInput = false; + @override Widget build(BuildContext context) { return Scaffold( 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: [ Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, 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( + 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: [ + Image.asset( + Assets.imagesLikeIcon, + width: 14.w, + height: 12.w, + ), + SizedBox(width: 6.w,), Text( - "刘美玲", + "47", 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( - "15:16", + "23", style: TextStyle( 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( - 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: [ - 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( - 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( - 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 { ], ), ), - Image.asset( - Assets.imagesLikeIcon, - width: 14.w, - ) + // Image.asset( + // Assets.imagesLikeIcon, + // width: 14.w, + // ) ], ), );