Browse Source

优化注册页

master
王子贤 2 months ago
parent
commit
9d8c73661c
3 changed files with 263 additions and 237 deletions
  1. 1
      lib/controller/mine/user_info_controller.dart
  2. 497
      lib/pages/home/user_information_page.dart
  3. 2
      lib/pages/mine/user_info_page.dart

1
lib/controller/mine/user_info_controller.dart

@ -234,6 +234,7 @@ class UserInfoController extends GetxController {
return { return {
'birthYear': birthYear, 'birthYear': birthYear,
'birthDate': birthday.value,
'educationCode': educationCodeMap[education.value] ?? '0', 'educationCode': educationCodeMap[education.value] ?? '0',
'genderCode': gender.value == 'male' ? '0' : '1', // 1:, 2: 'genderCode': gender.value == 'male' ? '0' : '1', // 1:, 2:
'matchmakerInvitationCode': invitationCode.value, 'matchmakerInvitationCode': invitationCode.value,

497
lib/pages/home/user_information_page.dart

@ -96,217 +96,286 @@ class UserInformationPage extends StatelessWidget {
height: 384.w, height: 384.w,
fit: BoxFit.cover, 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( 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: [ children: [
Row( Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [ 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( 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( 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( bottomNavigationBar: miId != GlobalData().userData!.id ? SafeArea(

2
lib/pages/mine/user_info_page.dart

@ -472,7 +472,7 @@ class _UserInfoState extends State<UserInfoPage> {
const Align( const Align(
alignment: Alignment.centerLeft, alignment: Alignment.centerLeft,
child: Text( child: Text(
'年龄',
'出生日期',
style: TextStyle( style: TextStyle(
fontSize: 15, fontSize: 15,
color: Color.fromRGBO(144, 144, 144, 1), color: Color.fromRGBO(144, 144, 144, 1),

Loading…
Cancel
Save