diff --git a/lib/controller/mine/edit_info_controller.dart b/lib/controller/mine/edit_info_controller.dart index 3ad1b2e..aa38121 100644 --- a/lib/controller/mine/edit_info_controller.dart +++ b/lib/controller/mine/edit_info_controller.dart @@ -1,3 +1,4 @@ +import 'dart:async'; import 'dart:io'; import 'package:dating_touchme_app/controller/global.dart'; @@ -34,6 +35,13 @@ class EditInfoController extends GetxController { final birthday = ''.obs; + final message = ''.obs; + final messageController = TextEditingController().obs; + + final name = ''.obs; + final nameController = TextEditingController().obs; + + // 选择日期 void selectBirthday(String selectedDate) { birthday.value = selectedDate; @@ -107,7 +115,6 @@ class EditInfoController extends GetxController { @override void onInit() { super.onInit(); - userData.value = GlobalData().userData; final ImagePickerPlatform imagePickerImplementation = ImagePickerPlatform.instance; if (imagePickerImplementation is ImagePickerAndroid) { @@ -116,6 +123,13 @@ class EditInfoController extends GetxController { _userApi = Get.find(); + getBaseData(); + + + } + + getBaseData() async { + await getInfo(); getEducationList(); getIncomeList(); getMaritalList(); @@ -132,7 +146,7 @@ class EditInfoController extends GetxController { final data = response.data.data; educationList.clear(); educationList.addAll(data?.toList() ?? []); - + educationSelect.value = educationList.indexWhere((e){ return e.value == userData.value?.educationCode; }); @@ -231,7 +245,7 @@ class EditInfoController extends GetxController { if (outerIndex != -1) { final innerIndex = occupationList[outerIndex].occupationList - !.indexWhere((child) => child.occupationCode == userData.value?.occupationCode); + !.indexWhere((child) => child.occupationCode == userData.value?.occupationCode); print("outerIndex = $outerIndex, innerIndex = $innerIndex"); @@ -286,10 +300,24 @@ class EditInfoController extends GetxController { } birthday.value = userData.value?.birthDate ?? ""; + + message.value = userData.value?.describeInfo ?? ""; + + messageController.value.value = TextEditingValue( + text: message.value, + selection: TextSelection.fromPosition(TextPosition(offset: message.value.length)), + ); + + name.value = userData.value?.nickName ?? ""; + + nameController.value.value = TextEditingValue( + text: name.value, + selection: TextSelection.fromPosition(TextPosition(offset: name.value.length)), + ); } goPreview() { - Get.to(() => UserInformationPage(miId: userData.value?.id ?? "", userId: GlobalData().userId ?? "")); + Get.to(() => UserInformationPage(miId: userData.value?.id ?? "", userId: GlobalData().userId ?? "")); } int calculateAge(String birthdayStr) { @@ -392,7 +420,9 @@ class EditInfoController extends GetxController { final ImagePicker picker = ImagePicker(); final List? image = await picker.pickMultiImage(limit: 9 - imgList.length); - if (image != null) { + print(image); + + if (image != null && image.isNotEmpty) { final futures = image.map((e){ return processSelectedMoreImage(File(e.path), type);; }); @@ -544,27 +574,21 @@ class EditInfoController extends GetxController { savaImgList() async { try{ + + final originImg = userData.value!.photoList!.map((e) => e.photoUrl).toSet(); + final result = imgList + .where((e) => !originImg.contains(e)) + .toList(); final imgPayload = { 'miId': userData.value?.id ?? 0, 'authenticationCode': '6', 'value': '0', - 'imgUrl': imgList.isNotEmpty ? imgList : ['0'], + 'imgUrl': result.isNotEmpty ? result : ['0'], }; final imgAuditResp = await _userApi.saveCertificationAudit(imgPayload); if (imgAuditResp.data.isSuccess) { - final result = await _userApi.getMarriageInformationDetail(); - // print(result.data); - if (result.data.isSuccess) { - final information = result.data.data!; - information.matchmakerFlag = userData.value?.matchmakerFlag ?? false; - information.realName = userData.value?.realName; - information.phone = userData.value?.phone; - GlobalData().userData = information; - - await storage.write('userId', GlobalData().userId); - - } + getInfo(); } else{ SmartDialog.showToast(imgAuditResp.data.message); @@ -579,6 +603,55 @@ class EditInfoController extends GetxController { } } + savaDescribeInfo() async { + try{ + + final originImg = userData.value!.photoList!.map((e) => e.photoUrl).toSet(); + final result = imgList + .where((e) => !originImg.contains(e)) + .toList(); + final imgPayload = { + 'miId': userData.value?.id ?? 0, + 'authenticationCode': '7', + 'value': message.value, + 'imgUrl': ['0'], + }; + + final imgAuditResp = await _userApi.saveCertificationAudit(imgPayload); + if (imgAuditResp.data.isSuccess) { + getInfo(); + SmartDialog.showToast("交友心声已提交审核"); + } else{ + SmartDialog.showToast(imgAuditResp.data.message); + + return; + } + } catch(e){ + print('相册提交审核失败: $e'); + SmartDialog.showToast('交友心声提交审核失败,请重试'); + return; + + } + } + + getInfo() async { + final result = await _userApi.getMarriageInformationDetail(); + // print(result.data); + if (result.data.isSuccess) { + final information = result.data.data!; + information.matchmakerFlag = userData.value?.matchmakerFlag ?? false; + information.realName = userData.value?.realName; + information.phone = userData.value?.phone; + GlobalData().userData = information; + + userData.value = GlobalData().userData; + + await storage.write('userId', GlobalData().userId); + setData(); + + } + } + deleteImgList(int index) async { if(userData.value!.photoList!.length > index){ @@ -625,6 +698,18 @@ class EditInfoController extends GetxController { } } + Timer? _debounce; + + void onTextChanged(String text) { + // 取消上一次的计时 + _debounce?.cancel(); + + _debounce = Timer(const Duration(milliseconds: 500), () { + name.value = text; + saveData(); + }); + } + saveData() async { @@ -646,7 +731,7 @@ class EditInfoController extends GetxController { 'hometownCityName': homeLocation.value != "" ? homeLocation.value.split("-")[1] : "", "incomeCode": incomeSelect.value != -1 ? incomeList[incomeSelect.value].value : "", "maritalStatusCode": maritalSelect.value != -1 ? maritalList[maritalSelect.value].value : "", - "nickName": userData.value?.nickName ?? "", + "nickName": name.value, 'occupation': occupation.value != "" ? occupation.value.split("-")[1] : "", 'occupationCode': occupationValue.length >= 2 ? occupationValue[1] : "", "propertyPermitsCode": propertySelect.value != -1 ? propertyList[propertySelect.value].value : "", diff --git a/lib/pages/home/content_card.dart b/lib/pages/home/content_card.dart index 6d8e98b..0db351b 100644 --- a/lib/pages/home/content_card.dart +++ b/lib/pages/home/content_card.dart @@ -1,11 +1,14 @@ import 'package:cached_network_image/cached_network_image.dart'; +import 'package:dating_touchme_app/controller/discover/room_controller.dart'; +import 'package:dating_touchme_app/controller/overlay_controller.dart'; import 'package:dating_touchme_app/generated/assets.dart'; -import 'package:flutter/material.dart'; -import 'package:get/get.dart'; import 'package:dating_touchme_app/model/home/marriage_data.dart'; +import 'package:dating_touchme_app/pages/discover/live_room_page.dart'; import 'package:dating_touchme_app/pages/home/user_information_page.dart'; import 'package:dating_touchme_app/pages/message/chat_page.dart'; +import 'package:flutter/material.dart'; import 'package:flutter_smart_dialog/flutter_smart_dialog.dart'; +import 'package:get/get.dart'; // 通用头部组件:头像/昵称/在线/认证/Hi/直播中徽标 class _CardHeader extends StatelessWidget { @@ -28,12 +31,12 @@ class _CardHeader extends StatelessWidget { padding: isLive ? const EdgeInsets.all(2) : EdgeInsets.zero, decoration: isLive ? BoxDecoration( - borderRadius: BorderRadius.circular(32), - border: Border.all( - color: const Color(0xFFB58BFF), - width: 2, - ), - ) + borderRadius: BorderRadius.circular(32), + border: Border.all( + color: const Color(0xFFB58BFF), + width: 2, + ), + ) : null, child: ClipRRect( borderRadius: BorderRadius.circular(30), @@ -58,54 +61,54 @@ class _CardHeader extends StatelessWidget { ), ), ), - if (isOnline) - Positioned( - right: 6, - bottom: 1, - child: Container( - width: 12, - height: 12, - decoration: BoxDecoration( - color: isOnline - ? const Color(0xFF2ED573) - : const Color(0xFFCCCCCC), // 在线绿色,离线灰色 - shape: BoxShape.circle, - boxShadow: isOnline - ? const [ - BoxShadow( - color: Color(0x332ED573), - blurRadius: 4, - offset: Offset(0, 2), - ), - ] - : [], - ), - ), - ), - if (isLive) - Positioned( - bottom: 0, - left: 0, - right: 0, - child: Container( - width: 37, - height: 14, - alignment: Alignment.center, // 关键:让子内容居中 - decoration: BoxDecoration( - image: DecorationImage( - image: AssetImage(Assets.imagesBtnBgIcon), - ), - ), - child: const Text( - '直播中', - style: TextStyle( - color: Colors.white, - fontSize: 8, - fontWeight: FontWeight.w600, - ), - ), - ), - ), + // if (isOnline) + // Positioned( + // right: 6, + // bottom: 1, + // child: Container( + // width: 12, + // height: 12, + // decoration: BoxDecoration( + // color: isOnline + // ? const Color(0xFF2ED573) + // : const Color(0xFFCCCCCC), // 在线绿色,离线灰色 + // shape: BoxShape.circle, + // boxShadow: isOnline + // ? const [ + // BoxShadow( + // color: Color(0x332ED573), + // blurRadius: 4, + // offset: Offset(0, 2), + // ), + // ] + // : [], + // ), + // ), + // ), + // if (isLive) + // Positioned( + // bottom: 0, + // left: 0, + // right: 0, + // child: Container( + // width: 37, + // height: 14, + // alignment: Alignment.center, // 关键:让子内容居中 + // decoration: BoxDecoration( + // image: DecorationImage( + // image: AssetImage(Assets.imagesBtnBgIcon), + // ), + // ), + // child: const Text( + // '直播中', + // style: TextStyle( + // color: Colors.white, + // fontSize: 8, + // fontWeight: FontWeight.w600, + // ), + // ), + // ), + // ), ], ), const SizedBox(width: 10), @@ -133,24 +136,24 @@ class _CardHeader extends StatelessWidget { overflow: TextOverflow.ellipsis, ), // 在线徽标 - if (isOnline == true) - Container( - padding: const EdgeInsets.symmetric( - horizontal: 8, - vertical: 2, - ), - decoration: BoxDecoration( - color: Color.fromRGBO(234, 255, 219, 1), - borderRadius: BorderRadius.circular(12), - ), - child: Text( - isOnline ? '在线' : '', - style: TextStyle( - fontSize: 9, - color: Color.fromRGBO(38, 199, 124, 1), - ), - ), - ), + // if (isOnline == true) + // Container( + // padding: const EdgeInsets.symmetric( + // horizontal: 8, + // vertical: 2, + // ), + // decoration: BoxDecoration( + // color: Color.fromRGBO(234, 255, 219, 1), + // borderRadius: BorderRadius.circular(12), + // ), + // child: Text( + // isOnline ? '在线' : '', + // style: TextStyle( + // fontSize: 9, + // color: Color.fromRGBO(38, 199, 124, 1), + // ), + // ), + // ), // 实名徽标 if (item.isRealNameCertified == true) Container( @@ -228,7 +231,29 @@ class _CardHeader extends StatelessWidget { // 点击事件处理 if (isLive) { // 进入直播间逻辑 - print('进入直播间'); + try { + // 1. 隐藏直播间小窗口(如果存在) + if (Get.isRegistered()) { + final overlayController = Get.find(); + overlayController.hide(); + } + + // 2. 获取 RoomController 实例 + final roomController = Get.isRegistered() + ? Get.find() + : Get.put(RoomController()); + + // 3. 如果当前已经在直播间,先退出当前直播间 + // leaveChannel 内部会处理未在频道时的情况 + await roomController.leaveChannel(); + + // 4. 跳转到新的直播间页面 + // 这里暂时使用 id: 0,实际频道信息由后端/进入逻辑决定 + await Get.to(() => const LiveRoomPage(id: 0)); + } catch (e) { + print('❌ [ContentCard] 进入直播间失败: $e'); + SmartDialog.showToast('进入直播间失败,请重试'); + } } else if (isOnline) { // HI按钮点击逻辑 - 跳转到聊天页面 try { @@ -372,11 +397,11 @@ class ContentCard extends StatelessWidget { return Padding( padding: EdgeInsets.only(left: index > 0 ? 12 : 0), child: SizedBox( - width: imageWidth, - height: imageHeight, + width: 70, + height: 70, child: _NetworkImageWidget( imageUrl: imageUrl, - aspectRatio: 1.05, + aspectRatio: 1, ), ), ); @@ -385,9 +410,12 @@ class ContentCard extends StatelessWidget { ); } - return Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: contentWidgets, + return Container( + padding: EdgeInsets.only(left: 70), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: contentWidgets, + ), ); }, ); @@ -406,24 +434,24 @@ class _NetworkImageWidget extends StatelessWidget { @override Widget build(BuildContext context) { return CachedNetworkImage( - imageUrl: '$imageUrl?x-oss-process=image/format,webp/resize,w_320', - width: double.infinity, - height: double.infinity, - imageBuilder: (context, imageProvider) => Container( - decoration: BoxDecoration( - borderRadius: BorderRadius.circular(8), - image: DecorationImage( - image: imageProvider, - fit: BoxFit.cover, - ), + imageUrl: '$imageUrl?x-oss-process=image/format,webp/resize,w_320', + width: 80, + height: 80, + imageBuilder: (context, imageProvider) => Container( + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(8), + image: DecorationImage( + image: imageProvider, + fit: BoxFit.cover, ), ), - errorWidget: (context, url, error) => Image.asset( - Assets.imagesUserAvatar, - width: 60, - height: 60, - fit: BoxFit.cover, - ), + ), + errorWidget: (context, url, error) => Image.asset( + Assets.imagesUserAvatar, + width: 60, + height: 60, + fit: BoxFit.cover, + ), ); } -} +} \ No newline at end of file diff --git a/lib/pages/home/user_information_page.dart b/lib/pages/home/user_information_page.dart index 05300ce..b0f31ee 100644 --- a/lib/pages/home/user_information_page.dart +++ b/lib/pages/home/user_information_page.dart @@ -181,231 +181,257 @@ class UserInformationPage extends StatelessWidget { await controller.getPostList(); }, child: SingleChildScrollView( - child: Container( - padding: EdgeInsets.only(top: 361.w), - child: Container( - 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( + 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( - "父母催婚找个结婚的", - 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: 10.w,), - if(controller.postList.isNotEmpty) Row( - mainAxisAlignment: MainAxisAlignment.center, - children: [ + 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: 18.w + fontSize: 12.w, + color: const Color.fromRGBO(144, 144, 144, 1) ), - ) + ), + SizedBox(height: 10.w,), + if(controller.postList.isNotEmpty) Row( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Text( + "动态", + style: TextStyle( + fontSize: 18.w + ), + ) + ], + ), + SizedBox(height: 10.w,), + ...controller.postList.map((e){ + return TimelineItem(item: e); + }) ], ), - SizedBox(height: 10.w,), - ...controller.postList.map((e){ - return TimelineItem(item: e); - }) - ], + ), ), - ), + 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) + ), + child: CachedNetworkImage( + imageUrl: "${controller.userData.value.profilePhoto}?x-oss-process=image/format,webp", + width: 84.w, + height: 84.w, + fit: BoxFit.cover, + ), + ), + ), + ) + ], ), ), ), diff --git a/lib/pages/mine/edit_info_page.dart b/lib/pages/mine/edit_info_page.dart index a4b9de0..7925321 100644 --- a/lib/pages/mine/edit_info_page.dart +++ b/lib/pages/mine/edit_info_page.dart @@ -227,20 +227,20 @@ class _EditInfoPageState extends State { builder: (controller) { return Scaffold( appBar: PageAppbar(title: "编辑资料", right: Container( - margin: EdgeInsets.only(right: 14.w), - child: InkWell( - onTap: (){ - controller.goPreview(); - }, - child: Text( - "预览", - style: TextStyle( - fontSize: 13.w, - color: const Color.fromRGBO(144, 144, 144, 1), + margin: EdgeInsets.only(right: 14.w), + child: InkWell( + onTap: (){ + controller.goPreview(); + }, + child: Text( + "预览", + style: TextStyle( + fontSize: 13.w, + color: const Color.fromRGBO(144, 144, 144, 1), + ), ), ), - ), - ),), + ),), backgroundColor: const Color.fromRGBO(243, 243, 243, 1.0), body: SingleChildScrollView( @@ -398,34 +398,15 @@ class _EditInfoPageState extends State { fit: BoxFit.cover, ), ), - if(controller.userData.value!.photoList!.isNotEmpty && controller.userData.value!.photoList!.length > entry.key)Positioned( - left: 5.w, - top: 5.w, - child: Container( - width: 20.w, - height: 20.w, - decoration: BoxDecoration( - borderRadius: BorderRadius.all(Radius.circular(20.w)), - color: const Color.fromRGBO(0, 0, 0, .3) - ), - child: Icon( - Icons.close, - size: 20.w, - ), - ).onTap((){ - controller.deleteImgList(entry.key); - }), - ), if(controller.userData.value!.photoList!.isNotEmpty && controller.userData.value!.photoList!.length > entry.key && controller.userData.value!.photoList![entry.key].auditStatus == 0)Positioned( top: 0, right: 0, child: Container( - width: 33.w, - height: 17.w, + width: 70.w, + height: 70.w, decoration: BoxDecoration( - borderRadius: BorderRadius.only( - topRight: Radius.circular(9.w), - bottomLeft: Radius.circular(9.w) + borderRadius: BorderRadius.all( + Radius.circular(9.w) ), color: const Color.fromRGBO(0, 0, 0, .4) ), @@ -433,14 +414,34 @@ class _EditInfoPageState extends State { child: Text( "审核中", style: TextStyle( - fontSize: 8.w, + fontSize: 10.w, color: Colors.white, fontWeight: FontWeight.w500 ), ), ), ), - ) + ), + + if(controller.userData.value!.photoList!.isNotEmpty && controller.userData.value!.photoList!.length > entry.key)Positioned( + right: 5.w, + top: 5.w, + child: Container( + width: 20.w, + height: 20.w, + decoration: BoxDecoration( + borderRadius: BorderRadius.all(Radius.circular(20.w)), + color: const Color.fromRGBO(0, 0, 0, .3) + ), + child: Icon( + Icons.close, + size: 20.w, + color: Colors.white, + ), + ).onTap((){ + controller.deleteImgList(entry.key); + }), + ), ], ); }), @@ -475,12 +476,12 @@ class _EditInfoPageState extends State { padding: EdgeInsets.only( left: 14.w, right: 20.w, - top: 14.w, - bottom: 14.w + top: 14.w, + bottom: 14.w ), decoration: BoxDecoration( color: Colors.white, - borderRadius: BorderRadius.all(Radius.circular(9.w)) + borderRadius: BorderRadius.all(Radius.circular(9.w)) ), child: Column( children: [ @@ -496,13 +497,37 @@ class _EditInfoPageState extends State { ], ), SizedBox(height: 2.w,), - SetItem(label: "昵称", child: Text( - controller.userData.value?.nickName ?? "", + SetItem(label: "昵称", child: Expanded(child: TextField( + controller: controller.nameController.value, + textAlign: TextAlign.right, + textAlignVertical: TextAlignVertical.center, style: TextStyle( - fontSize: 13.w, - fontWeight: FontWeight.w500 + fontSize: ScreenUtil().setWidth(13), + height: 1 ), - ), hideArrow: true,), + decoration: InputDecoration( + isDense: true, + contentPadding: EdgeInsets.only( + left: 0, + right: -8 + ), + 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: controller.onTextChanged, + ))), SetItem(label: "性别", child: Text( "${controller.userData.value?.genderCode == 0 ? "男" : "女"}", style: TextStyle( @@ -800,6 +825,52 @@ class _EditInfoPageState extends State { ], ), ), + + Container( + width: 375.w, + padding: EdgeInsets.only( + left: 14.w, + right: 20.w, + top: 14.w, + bottom: 14.w + ), + margin: EdgeInsets.only(top: 10.w), + decoration: BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.all(Radius.circular(9.w)) + ), + child: Column( + children: [ + Row( + children: [ + Text( + "交友心声", + style: TextStyle( + fontSize: 15.w, + fontWeight: FontWeight.w500 + ), + ) + ], + ), + SizedBox(height: 2.w,), + Container( + alignment: Alignment.centerLeft, + child: Text( + controller.message.value, + style: TextStyle( + fontSize: 13.w, + fontWeight: FontWeight.w500 + ), + ), + ) + + ], + ), + ).onTap((){ + Get.to(() => SignaturePage())?.then((e){ + controller.savaDescribeInfo(); + }); + }), ], if(false && controller.menuActive.value == 2) ...[ Stack( @@ -1147,9 +1218,9 @@ class _SetItemState extends State { return Container( margin: EdgeInsets.only(bottom: 3.w), decoration: BoxDecoration( - border: Border( - bottom: BorderSide(width: 1, color: const Color.fromRGBO(245, 245, 245, 1)) - ) + border: Border( + bottom: BorderSide(width: 1, color: const Color.fromRGBO(245, 245, 245, 1)) + ) ), child: InkWell( child: SizedBox( @@ -1159,24 +1230,24 @@ class _SetItemState extends State { children: [ RichText( text: TextSpan( - children: [ - TextSpan( - text: widget.label, - style: TextStyle( - fontSize: 13.w, - color: const Color.fromRGBO(51, 51, 51, 1), - fontWeight: FontWeight.w500 - ) - ), - if(widget.showRequired) TextSpan( - text: "*", - style: TextStyle( - fontSize: 13.w, - color: const Color.fromRGBO(224, 54, 54, 1), - fontWeight: FontWeight.w500 - ) - ), - ] + children: [ + TextSpan( + text: widget.label, + style: TextStyle( + fontSize: 13.w, + color: const Color.fromRGBO(51, 51, 51, 1), + fontWeight: FontWeight.w500 + ) + ), + if(widget.showRequired) TextSpan( + text: "*", + style: TextStyle( + fontSize: 13.w, + color: const Color.fromRGBO(224, 54, 54, 1), + fontWeight: FontWeight.w500 + ) + ), + ] ), ), Expanded( @@ -1226,4 +1297,4 @@ class TagItem extends StatelessWidget { ), ); } -} +} \ No newline at end of file