From 9d8c73661ca12ed76c7f34954e3fb4bc9915589a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8E=8B=E5=AD=90=E8=B4=A4?= Date: Sun, 4 Jan 2026 17:02:47 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E6=B3=A8=E5=86=8C=E9=A1=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/controller/mine/user_info_controller.dart | 1 + lib/pages/home/user_information_page.dart | 497 +++++++++--------- lib/pages/mine/user_info_page.dart | 2 +- 3 files changed, 263 insertions(+), 237 deletions(-) diff --git a/lib/controller/mine/user_info_controller.dart b/lib/controller/mine/user_info_controller.dart index d044445..c53943d 100644 --- a/lib/controller/mine/user_info_controller.dart +++ b/lib/controller/mine/user_info_controller.dart @@ -234,6 +234,7 @@ class UserInfoController extends GetxController { return { 'birthYear': birthYear, + 'birthDate': birthday.value, 'educationCode': educationCodeMap[education.value] ?? '0', 'genderCode': gender.value == 'male' ? '0' : '1', // 1:男, 2:女 'matchmakerInvitationCode': invitationCode.value, diff --git a/lib/pages/home/user_information_page.dart b/lib/pages/home/user_information_page.dart index 6f4d625..d7d31a2 100644 --- a/lib/pages/home/user_information_page.dart +++ b/lib/pages/home/user_information_page.dart @@ -96,217 +96,286 @@ class UserInformationPage extends StatelessWidget { height: 384.w, fit: BoxFit.cover, ), + Positioned( + left: 120.w, + top: 310.w, + width: 240.w, + child: SingleChildScrollView( + scrollDirection: Axis.horizontal, + child: Row( + children: [ + ...controller.userData.value.photoList!.asMap().entries.map((entry){ + return Container( + margin: EdgeInsets.only(right: 7.w), + child: InkWell( + onTap: (){ + controller.nowSelect.value = entry.key; + }, + child: ClipRRect( + borderRadius: BorderRadius.all(Radius.circular(7.w)), + child: Container( + width: 40.w, + height: 40.w, + decoration: BoxDecoration( + borderRadius: BorderRadius.all(Radius.circular(7.w)), + border: controller.nowSelect.value == entry.key ? Border.all(width: 2.w, color: Colors.white) : null + ), + child: Center( + child: ClipRRect( + borderRadius: BorderRadius.all(Radius.circular(7.w)), + child: CachedNetworkImage( + imageUrl: "${entry.value.photoUrl}?x-oss-process=image/format,webp/resize,w_76", + width: 38.w, + height: 38.w, + fit: BoxFit.cover, + ), + ), + ), + ), + ), + ), + ); + }), + ], + ), + ), + ), SingleChildScrollView( - child: Container( - padding: EdgeInsets.only(top: 361.w), - child: Container( - height: 812.h - 361.w - 50, - width: 375.w, - padding: EdgeInsets.only( - top: 31.w, - left: 15.w, - right: 24.w - ), - decoration: BoxDecoration( - borderRadius: BorderRadius.vertical( - top: Radius.circular(23.w) + child: Stack( + clipBehavior: Clip.none, + children: [ + Container( + padding: EdgeInsets.only(top: 361.w), + child: Container( + height: 812.h - 361.w - 50, + width: 375.w, + padding: EdgeInsets.only( + top: 31.w, + left: 15.w, + right: 24.w ), - color: Colors.white - ), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, + decoration: BoxDecoration( + borderRadius: BorderRadius.vertical( + top: Radius.circular(23.w) + ), + color: Colors.white + ), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, children: [ Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ - Text( - controller.userData.value.nickName ?? "", - style: TextStyle( - fontSize: 22.w, - color: const Color.fromRGBO(51, 51, 51, 1), - fontWeight: FontWeight.w600 - ), - ), - SizedBox(width: 13.w,), - if(controller.myUserData.value?.genderCode == 0) Container( - width: 33.w, - height: 13.w, - decoration: BoxDecoration( - borderRadius: BorderRadius.all(Radius.circular(13.w)), - color: const Color.fromRGBO(255, 237, 255, 1) - ), - child: Row( - mainAxisAlignment: MainAxisAlignment.center, - children: [ - Image.asset( - Assets.imagesFemale, - width: 8.w, - height: 8.w, - ), - SizedBox(width: 2.w,), - Text( - "${ - controller.calculateAge( - (controller.userData.value.birthDate != null && controller.userData.value.birthDate!.isNotEmpty) ? - (controller.userData.value.birthDate ?? "") : controller.userData.value.birthYear != null && controller.userData.value.birthYear!.isNotEmpty ? - "${controller.userData.value.birthYear}-01-01" : "") - }", - style: TextStyle( - fontSize: 11.w, - color: const Color.fromRGBO(255, 66, 236, 1) - ), - ) - ], - ), - ), - SizedBox(width: 3.w,), - Container( - width: 33.w, - height: 13.w, - margin: EdgeInsets.only(right: 2.w), - decoration: BoxDecoration( - borderRadius: BorderRadius.all(Radius.circular(13.w)), - color: const Color.fromRGBO(234, 255, 219, 1) - ), - child: Center( - child: Text( - "在线", + Row( + children: [ + Text( + controller.userData.value.nickName ?? "", style: TextStyle( - fontSize: 11.w, - color: const Color.fromRGBO(38, 199, 124, 1) + fontSize: 22.w, + color: const Color.fromRGBO(51, 51, 51, 1), + fontWeight: FontWeight.w600 ), ), - ), - ), - SizedBox(width: 4.w,), - if (controller.userData.value.identityCard != "" && controller.userData.value.identityCard != null) Container( - width: 43.w, - height: 13.w, - decoration: BoxDecoration( - borderRadius: BorderRadius.all(Radius.circular(13.w)), - color: const Color.fromRGBO(246, 237, 255, 1) - ), - child: Row( - mainAxisAlignment: MainAxisAlignment.center, - children: [ - Image.asset( - Assets.imagesRealName, - width: 8.w, - height: 7.w, + SizedBox(width: 13.w,), + if(controller.myUserData.value?.genderCode == 0) Container( + width: 33.w, + height: 13.w, + decoration: BoxDecoration( + borderRadius: BorderRadius.all(Radius.circular(13.w)), + color: const Color.fromRGBO(255, 237, 255, 1) ), - SizedBox(width: 2.w,), - Text( - "实名", - style: TextStyle( - fontSize: 11.w, - color: const Color.fromRGBO(160, 92, 255, 1) - ), - ) - ], - ), - ), - SizedBox(width: 4.w,), - if(controller.myUserData.value?.genderCode == 1) Container( - width: 33.w, - height: 13.w, - decoration: BoxDecoration( - borderRadius: BorderRadius.all(Radius.circular(13.w)), - color: const Color.fromRGBO(237, 245, 255, 1) - ), - child: Row( - mainAxisAlignment: MainAxisAlignment.center, - children: [ - Image.asset( - Assets.imagesMale, - width: 8.w, - height: 8.w, + child: Row( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Image.asset( + Assets.imagesFemale, + width: 8.w, + height: 8.w, + ), + SizedBox(width: 2.w,), + Text( + "${ + controller.calculateAge( + (controller.userData.value.birthDate != null && controller.userData.value.birthDate!.isNotEmpty) ? + (controller.userData.value.birthDate ?? "") : controller.userData.value.birthYear != null && controller.userData.value.birthYear!.isNotEmpty ? + "${controller.userData.value.birthYear}-01-01" : "") + }", + style: TextStyle( + fontSize: 11.w, + color: const Color.fromRGBO(255, 66, 236, 1) + ), + ) + ], + ), + ), + SizedBox(width: 3.w,), + Container( + width: 33.w, + height: 13.w, + margin: EdgeInsets.only(right: 2.w), + decoration: BoxDecoration( + borderRadius: BorderRadius.all(Radius.circular(13.w)), + color: const Color.fromRGBO(234, 255, 219, 1) ), - SizedBox(width: 2.w,), - Text( - "${controller.calculateAge(controller.userData.value.birthDate ?? (controller.userData.value.birthYear != null && controller.userData.value.birthYear!.isNotEmpty ? "${controller.userData.value.birthYear}-01-01" : ""))}", - style: TextStyle( - fontSize: 11.w, - color: const Color.fromRGBO(120, 140, 255, 1) + child: Center( + child: Text( + "在线", + style: TextStyle( + fontSize: 11.w, + color: const Color.fromRGBO(38, 199, 124, 1) + ), ), - ) - ], - ), + ), + ), + SizedBox(width: 4.w,), + if (controller.userData.value.identityCard != "" && controller.userData.value.identityCard != null) Container( + width: 43.w, + height: 13.w, + decoration: BoxDecoration( + borderRadius: BorderRadius.all(Radius.circular(13.w)), + color: const Color.fromRGBO(246, 237, 255, 1) + ), + child: Row( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Image.asset( + Assets.imagesRealName, + width: 8.w, + height: 7.w, + ), + SizedBox(width: 2.w,), + Text( + "实名", + style: TextStyle( + fontSize: 11.w, + color: const Color.fromRGBO(160, 92, 255, 1) + ), + ) + ], + ), + ), + SizedBox(width: 4.w,), + if(controller.myUserData.value?.genderCode == 1) Container( + width: 33.w, + height: 13.w, + decoration: BoxDecoration( + borderRadius: BorderRadius.all(Radius.circular(13.w)), + color: const Color.fromRGBO(237, 245, 255, 1) + ), + child: Row( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Image.asset( + Assets.imagesMale, + width: 8.w, + height: 8.w, + ), + SizedBox(width: 2.w,), + Text( + "${controller.calculateAge(controller.userData.value.birthDate ?? (controller.userData.value.birthYear != null && controller.userData.value.birthYear!.isNotEmpty ? "${controller.userData.value.birthYear}-01-01" : ""))}", + style: TextStyle( + fontSize: 11.w, + color: const Color.fromRGBO(120, 140, 255, 1) + ), + ) + ], + ), + ), + ], ), + // 语音介绍功能暂时隐藏(为了通过苹果审核) + // Container( + // width: 63.w, + // height: 27.w, + // decoration: BoxDecoration( + // borderRadius: BorderRadius.all(Radius.circular(27.w)), + // color: const Color.fromRGBO(117, 98, 249, .1) + // ), + // child: Row( + // mainAxisAlignment: MainAxisAlignment.center, + // children: [ + // Image.asset( + // Assets.imagesPlayer, + // width: 15.w, + // height: 15.w, + // ), + // SizedBox(width: 4.w,), + // Image.asset( + // Assets.imagesVoice, + // width: 15.w, + // height: 13.w, + // ), + // SizedBox(width: 4.w,), + // Text( + // "6'", + // style: TextStyle( + // fontSize: 11.w, + // color: const Color.fromRGBO(117, 98, 249, 1) + // ), + // ) + // ], + // ), + // ) ], ), - // 语音介绍功能暂时隐藏(为了通过苹果审核) - // Container( - // width: 63.w, - // height: 27.w, - // decoration: BoxDecoration( - // borderRadius: BorderRadius.all(Radius.circular(27.w)), - // color: const Color.fromRGBO(117, 98, 249, .1) - // ), - // child: Row( - // mainAxisAlignment: MainAxisAlignment.center, - // children: [ - // Image.asset( - // Assets.imagesPlayer, - // width: 15.w, - // height: 15.w, - // ), - // SizedBox(width: 4.w,), - // Image.asset( - // Assets.imagesVoice, - // width: 15.w, - // height: 13.w, - // ), - // SizedBox(width: 4.w,), - // Text( - // "6'", - // style: TextStyle( - // fontSize: 11.w, - // color: const Color.fromRGBO(117, 98, 249, 1) - // ), - // ) - // ], - // ), - // ) - ], - ), - SizedBox(height: 8.w,), - Text( - controller.userData.value.describeInfo ?? "我想找一个有缘的异性,快来联系我吧。", - style: TextStyle( - fontSize: 14.w, - color: const Color.fromRGBO(144, 144, 144, 1) - ), - ), - SizedBox(height: 11.w,), - Wrap( - spacing: 12.w, - runSpacing: 12.w, - children: [ - ...controller.tagList.map((e){ - return TagItem(label: e); - }), + SizedBox(height: 8.w,), + Text( + controller.userData.value.describeInfo ?? "我想找一个有缘的异性,快来联系我吧。", + style: TextStyle( + fontSize: 14.w, + color: const Color.fromRGBO(144, 144, 144, 1) + ), + ), + SizedBox(height: 11.w,), + Wrap( + spacing: 12.w, + runSpacing: 12.w, + children: [ + ...controller.tagList.map((e){ + return TagItem(label: e); + }), + ], + ), + SizedBox(height: 16.w,), + if ((controller.userData.value.provinceName?.isNotEmpty ?? false)) Text( + "IP属地:${controller.userData.value.provinceName}", + style: TextStyle( + fontSize: 12.w, + color: const Color.fromRGBO(144, 144, 144, 1) + ), + ), + Text( + "趣恋恋ID:${userId}", + style: TextStyle( + fontSize: 12.w, + color: const Color.fromRGBO(144, 144, 144, 1) + ), + ), ], ), - SizedBox(height: 16.w,), - if ((controller.userData.value.provinceName?.isNotEmpty ?? false)) Text( - "IP属地:${controller.userData.value.provinceName}", - style: TextStyle( - fontSize: 12.w, - color: const Color.fromRGBO(144, 144, 144, 1) + ), + ), + Positioned( + left: 15.w, + top: 301.w, + child: ClipRRect( + borderRadius: BorderRadius.all(Radius.circular(90.w)), + child: Container( + width: 90.w, + height: 90.w, + decoration: BoxDecoration( + borderRadius: BorderRadius.all(Radius.circular(90.w)), + border: Border.all(width: 3.w, color: Colors.white) ), - ), - Text( - "趣恋恋ID:${userId}", - style: TextStyle( - fontSize: 12.w, - color: const Color.fromRGBO(144, 144, 144, 1) + child: Image.asset( + Assets.imagesUserAvatar, + width: 84.w, + height: 84.w, ), ), - ], - ), - ), + ), + ) + ], ), ), Positioned( @@ -378,50 +447,6 @@ class UserInformationPage extends StatelessWidget { ), ), ), - Positioned( - left: 15.w, - top: 310.w, - width: 345.w, - child: SingleChildScrollView( - scrollDirection: Axis.horizontal, - child: Row( - children: [ - ...controller.userData.value.photoList!.asMap().entries.map((entry){ - return Container( - margin: EdgeInsets.only(right: 7.w), - child: InkWell( - onTap: (){ - controller.nowSelect.value = entry.key; - }, - child: ClipRRect( - borderRadius: BorderRadius.all(Radius.circular(7.w)), - child: Container( - width: 40.w, - height: 40.w, - decoration: BoxDecoration( - borderRadius: BorderRadius.all(Radius.circular(7.w)), - border: controller.nowSelect.value == entry.key ? Border.all(width: 2.w, color: Colors.white) : null - ), - child: Center( - child: ClipRRect( - borderRadius: BorderRadius.all(Radius.circular(7.w)), - child: CachedNetworkImage( - imageUrl: "${entry.value.photoUrl}?x-oss-process=image/format,webp/resize,w_76", - width: 38.w, - height: 38.w, - fit: BoxFit.cover, - ), - ), - ), - ), - ), - ), - ); - }), - ], - ), - ), - ), ], ), bottomNavigationBar: miId != GlobalData().userData!.id ? SafeArea( diff --git a/lib/pages/mine/user_info_page.dart b/lib/pages/mine/user_info_page.dart index fe357a9..65f0934 100644 --- a/lib/pages/mine/user_info_page.dart +++ b/lib/pages/mine/user_info_page.dart @@ -472,7 +472,7 @@ class _UserInfoState extends State { const Align( alignment: Alignment.centerLeft, child: Text( - '年龄', + '出生日期', style: TextStyle( fontSize: 15, color: Color.fromRGBO(144, 144, 144, 1),