Browse Source

合并优化代码

ios
王子贤 2 months ago
parent
commit
c1fbdaadbf
14 changed files with 299 additions and 274 deletions
  1. 24
      lib/controller/home/home_controller.dart
  2. 7
      lib/controller/mine/edit_info_controller.dart
  3. 16
      lib/model/home/marriage_data.dart
  4. 8
      lib/model/home/user_info_data.dart
  5. 4
      lib/model/mine/user_data.dart
  6. 181
      lib/pages/discover/visitor_list_page.dart
  7. 86
      lib/pages/home/content_card.dart
  8. 15
      lib/pages/home/home_page.dart
  9. 2
      lib/pages/home/user_information_page.dart
  10. 5
      lib/pages/main/main_page.dart
  11. 50
      lib/pages/mine/edit_info_page.dart
  12. 3
      lib/pages/mine/mine_page.dart
  13. 38
      lib/pages/mine/phone_page.dart
  14. 134
      lib/pages/mine/signature_page.dart

24
lib/controller/home/home_controller.dart

@ -97,7 +97,8 @@ class HomeController extends GetxController {
//
final int currentPage = result['current'] ?? 1;
final int totalPages = result['pages'] ?? 1;
// final int totalPages = result['pages'] ?? 1;
final int totalPages = 100;
recommendHasMore.value = currentPage < totalPages;
print(recommendHasMore.value);
} catch (e) {
@ -128,7 +129,8 @@ class HomeController extends GetxController {
//
final int currentPage = result['current'] ?? 1;
final int totalPages = result['pages'] ?? 1;
// final int totalPages = result['pages'] ?? 1;
final int totalPages = 100;
nearbyHasMore.value = currentPage < totalPages;
} catch (e) {
_handleError('获取同城列表异常', e, '同城列表加载失败,请稍后重试');
@ -156,7 +158,8 @@ class HomeController extends GetxController {
try {
recommendIsLoading.value = true;
final nextPage = recommendPage.value + 1;
// final nextPage = recommendPage.value + 1;
final nextPage = recommendPage.value;
print('推荐列表加载更多 - 当前页: ${recommendPage.value}, 下一页: $nextPage');
// (type=0)
@ -173,7 +176,8 @@ class HomeController extends GetxController {
//
final int currentPage = result['current'] as int;
final int totalPages = result['pages'] as int;
// final int totalPages = result['pages'] ?? 1;
final int totalPages = 100;
recommendHasMore.value = currentPage < totalPages;
print('推荐列表加载更多完成 - 当前页: $currentPage, 总页数: $totalPages, 还有更多: ${recommendHasMore.value}');
} catch (e) {
@ -189,7 +193,8 @@ class HomeController extends GetxController {
try {
nearbyIsLoading.value = true;
final nextPage = nearbyPage.value + 1;
// final nextPage = recommendPage.value + 1;
final nextPage = recommendPage.value;
print('同城列表加载更多 - 当前页: ${nearbyPage.value}, 下一页: $nextPage');
// (type=1)
@ -206,7 +211,8 @@ class HomeController extends GetxController {
//
final int currentPage = result['current'] as int;
final int totalPages = result['pages'] as int;
// final int totalPages = result['pages'] ?? 1;
final int totalPages = 100;
nearbyHasMore.value = currentPage < totalPages;
print('同城列表加载更多完成 - 当前页: $currentPage, 总页数: $totalPages, 还有更多: ${nearbyHasMore.value}');
} catch (e) {
@ -250,7 +256,8 @@ class HomeController extends GetxController {
//
final int currentPage = result['current'] ?? 1;
final int totalPages = result['pages'] ?? 1;
// final int totalPages = result['pages'] ?? 1;
final int totalPages = 100;
recommendHasMore.value = currentPage < totalPages;
} catch (e) {
_handleError('刷新推荐数据异常', e, '刷新失败,请稍后重试');
@ -280,7 +287,8 @@ class HomeController extends GetxController {
//
final int currentPage = result['current'] ?? 1;
final int totalPages = result['pages'] ?? 1;
// final int totalPages = result['pages'] ?? 1;
final int totalPages = 100;
nearbyHasMore.value = currentPage < totalPages;
} catch (e) {
_handleError('刷新同城数据异常', e, '刷新失败,请稍后重试');

7
lib/controller/mine/edit_info_controller.dart

@ -36,6 +36,7 @@ class EditInfoController extends GetxController {
final message = ''.obs;
final realDescribe = ''.obs;
final messageController = TextEditingController().obs;
final name = ''.obs;
@ -301,7 +302,8 @@ class EditInfoController extends GetxController {
birthday.value = userData.value?.birthDate ?? "";
message.value = userData.value?.describeInfo ?? "";
message.value = (userData.value?.auditDescribeInfo != null && userData.value?.auditDescribeInfo != "") ? (userData.value?.auditDescribeInfo ?? "") : (userData.value?.describeInfo ?? "");
realDescribe.value = message.value;
messageController.value.value = TextEditingValue(
text: message.value,
@ -619,8 +621,11 @@ class EditInfoController extends GetxController {
final imgAuditResp = await _userApi.saveCertificationAudit(imgPayload);
if (imgAuditResp.data.isSuccess) {
realDescribe.value = message.value;
getInfo();
SmartDialog.showToast("交友心声已提交审核");
Get.back();
} else{
SmartDialog.showToast(imgAuditResp.data.message);

16
lib/model/home/marriage_data.dart

@ -19,16 +19,17 @@ class MarriageData {
final String describeInfo;
final String createTime;
final int genderCode;
final int visitCount;
final List<PhotoItem> photoList;
final bool isLive; //
// UI展示
String get name => nickName;
String get avatar => profilePhoto.trim().replaceAll('`', ''); // URL中的反引号
String get city => cityName;
String get description => describeInfo;
List<String> get images => photoList.map((photo) => photo.photoUrl.trim().replaceAll('`', '')).toList();
MarriageData({
required this.miId,
required this.userId,
@ -48,9 +49,10 @@ class MarriageData {
required this.createTime,
required this.photoList,
required this.genderCode,
required this.visitCount,
this.isLive = false,
});
factory MarriageData.fromJson(Map<String, dynamic> json) {
return MarriageData(
miId: json['miId'] ?? '',
@ -70,11 +72,12 @@ class MarriageData {
describeInfo: json['describeInfo'] ?? '',
createTime: json['createTime'] ?? '',
genderCode: json['genderCode'] ?? 0,
visitCount: json['visitCount'] ?? 0,
photoList: (json['photoList'] as List<dynamic>?)?.map((e) => PhotoItem.fromJson(e as Map<String, dynamic>)).toList() ?? [],
isLive: json['isLive'] ?? json['liveStatus'] ?? false, // isLive或liveStatus字段
);
}
/// UserInfoData MarriageData
factory MarriageData.fromUserInfoData(UserInfoData userInfo) {
return MarriageData(
@ -95,6 +98,7 @@ class MarriageData {
describeInfo: userInfo.describeInfo ?? '',
createTime: userInfo.createTime ?? '',
genderCode: userInfo.genderCode?.toInt() ?? 0,
visitCount: userInfo.visitCount?.toInt() ?? 0,
photoList: (userInfo.photoList ?? []).map((photo) => PhotoItem(
photoUrl: photo.photoUrl ?? '',
auditStatus: photo.auditStatus,
@ -112,14 +116,14 @@ class PhotoItem {
final String? id;
final num? miId;
final dynamic auditStatus;
PhotoItem({
required this.photoUrl,
this.id,
this.miId,
this.auditStatus,
});
factory PhotoItem.fromJson(Map<String, dynamic> json) {
return PhotoItem(
photoUrl: json['photoUrl'] ?? '',

8
lib/model/home/user_info_data.dart

@ -90,6 +90,7 @@ class UserInfoData {
bool? consumeRight;
bool? vip;
num? dataScoring;
num? visitCount;
String? phone;
Null? guestMatchmaker;
String? miId;
@ -187,6 +188,7 @@ class UserInfoData {
this.consumeRight,
this.vip,
this.dataScoring,
this.visitCount,
this.phone,
this.guestMatchmaker,
this.miId,
@ -296,6 +298,7 @@ class UserInfoData {
consumeRight = json['consumeRight'];
vip = json['vip'];
dataScoring = json['dataScoring'];
visitCount = json['visitCount'];
phone = json['phone'];
guestMatchmaker = json['guestMatchmaker'];
miId = json['miId'];
@ -394,7 +397,7 @@ class UserInfoData {
data['mateDescriptionAudit'] = this.mateDescriptionAudit;
if (this.marriageSeekingContacts != null) {
data['marriageSeekingContacts'] = [];
// this.marriageSeekingContacts!.map((v) => v.toJson()).toList();
// this.marriageSeekingContacts!.map((v) => v.toJson()).toList();
}
data['age'] = this.age;
data['meLike'] = this.meLike;
@ -402,6 +405,7 @@ class UserInfoData {
data['consumeRight'] = this.consumeRight;
data['vip'] = this.vip;
data['dataScoring'] = this.dataScoring;
data['visitCount'] = this.visitCount;
data['phone'] = this.phone;
data['guestMatchmaker'] = this.guestMatchmaker;
data['miId'] = this.miId;
@ -514,4 +518,4 @@ class PhotoList {
data['auditStatus'] = this.auditStatus;
return data;
}
}
}

4
lib/model/mine/user_data.dart

@ -36,6 +36,7 @@ class UserData {
final int? incomeCode;
final String? income;
final String? describeInfo;
final String? auditDescribeInfo;
final int? domicilePlaceProvinceCode;
final String? domicilePlaceProvinceName;
final int? domicilePlaceCityCode;
@ -103,6 +104,7 @@ class UserData {
this.incomeCode,
this.income,
this.describeInfo,
this.auditDescribeInfo,
this.domicilePlaceProvinceCode,
this.domicilePlaceProvinceName,
this.domicilePlaceCityCode,
@ -175,6 +177,7 @@ class UserData {
incomeCode: json['incomeCode'],
income: json['income'],
describeInfo: json['describeInfo'],
auditDescribeInfo: json['auditDescribeInfo'],
domicilePlaceProvinceCode: json['domicilePlaceProvinceCode'],
domicilePlaceProvinceName: json['domicilePlaceProvinceName'],
domicilePlaceCityCode: json['domicilePlaceCityCode'],
@ -243,6 +246,7 @@ class UserData {
'incomeCode': incomeCode,
'income': income,
'describeInfo': describeInfo,
'auditDescribeInfo': auditDescribeInfo,
'domicilePlaceProvinceCode': domicilePlaceProvinceCode,
'domicilePlaceProvinceName': domicilePlaceProvinceName,
'domicilePlaceCityCode': domicilePlaceCityCode,

181
lib/pages/discover/visitor_list_page.dart

@ -70,18 +70,16 @@ class _VisitorListPagePageState extends State<VisitorListPage> {
return EasyRefresh(
controller: visitorController.refreshController,
onRefresh: visitorController.onRefresh,
onLoad: visitorController.onLoadMore,
header: ClassicHeader(
dragText: '下拉刷新',
armedText: '释放刷新',
readyText: '刷新中...',
processingText: '刷新中...',
processedText: '刷新完成',
failedText: '刷新失败',
noMoreText: '没有更多数据',
messageText: '更新时间 %T',
showMessage: false
dragText: '下拉刷新',
armedText: '释放刷新',
readyText: '刷新中...',
processingText: '刷新中...',
processedText: '刷新完成',
failedText: '刷新失败',
noMoreText: '没有更多数据',
messageText: '更新时间 %T',
showMessage: false
),
footer: ClassicFooter(
dragText: '上拉加载',
@ -93,6 +91,15 @@ class _VisitorListPagePageState extends State<VisitorListPage> {
noMoreText: '没有更多数据',
showMessage: false,
),
//
onRefresh: () async {
visitorController.onRefresh();
},
//
onLoad: () async {
visitorController.onLoadMore();
},
child: GridView.builder(
padding: EdgeInsets.only(top: 8.w, left: 10.w, right: 8.w, bottom: 0.w),
gridDelegate: SliverGridDelegateWithFixedCrossAxisCount(
@ -122,93 +129,93 @@ class VisitorItem extends StatelessWidget {
@override
Widget build(BuildContext context) {
return Stack(
children: [
ClipRRect(
borderRadius: BorderRadius.all(Radius.circular(10.w)),
child: CachedNetworkImage(
imageUrl: "${visitor.profilePhoto}?x-oss-process=image/format,webp/resize,w_240",
width: 173.w,
height: 173.w,
fit: BoxFit.cover,
placeholder: (context, url) => Container(
color: Colors.white38,
child: Center(
child: CircularProgressIndicator(
strokeWidth: 1.w,
color: Colors.grey,
),
children: [
ClipRRect(
borderRadius: BorderRadius.all(Radius.circular(10.w)),
child: CachedNetworkImage(
imageUrl: "${visitor.profilePhoto}?x-oss-process=image/format,webp/resize,w_240",
width: 173.w,
height: 173.w,
fit: BoxFit.cover,
placeholder: (context, url) => Container(
color: Colors.white38,
child: Center(
child: CircularProgressIndicator(
strokeWidth: 1.w,
color: Colors.grey,
),
),
errorWidget: (context, url, error) =>
Image.asset(
Assets.imagesUserAvatar,
width: 173.w,
height: 173.w,
fit: BoxFit.cover,
),
),
errorWidget: (context, url, error) =>
Image.asset(
Assets.imagesUserAvatar,
width: 173.w,
height: 173.w,
fit: BoxFit.cover,
),
),
Positioned(
left: 8.w,
bottom: 12.w,
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
if(visitor.describeInfo.isNotEmpty)SizedBox(
width: 156.w,
child: Text(visitor.describeInfo,
maxLines: 1,
overflow: TextOverflow.ellipsis,
style: TextStyle(
fontSize: 12.w,
color: Colors.white,
fontWeight: FontWeight.w500,
),
),
Positioned(
left: 8.w,
bottom: 12.w,
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
if(visitor.nickName.isNotEmpty)SizedBox(
width: 156.w,
child: Text(visitor.nickName,
maxLines: 1,
overflow: TextOverflow.ellipsis,
style: TextStyle(
fontSize: 12.w,
color: Colors.white,
fontWeight: FontWeight.w500,
),
),
SizedBox(height: 2.w),
SizedBox(
width: 156.w,
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Text(
"${visitor.cityName.isNotEmpty ? '${visitor.cityName} | ' : ''}${visitor.age}",
style: TextStyle(
fontSize: 14.w,
color: Colors.white,
fontWeight: FontWeight.w500,
),
),
SizedBox(height: 2.w),
SizedBox(
width: 156.w,
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Text(
"${visitor.cityName.isNotEmpty ? '${visitor.cityName} | ' : ''}${visitor.age}",
style: TextStyle(
fontSize: 14.w,
color: Colors.white,
fontWeight: FontWeight.w500,
),
Text('访问1次', style: TextStyle(color: Color(0xffA799FF), fontSize: 12.w))
],
),
)
],
),
)
],
),
Text('访问${visitor.visitCount}', style: TextStyle(color: Color(0xffA799FF), fontSize: 12.w))
],
),
)
],
),
)
],
).onTap((){
Get.to(() => UserInformationPage(miId: visitor.miId, userId: GlobalData().userId!));
});
}
// String _formatTime(String timestamp) {
// var time = DateTime.parse(timestamp);
// final now = DateTime.now();
// final difference = now.difference(time);
//
// if (difference.inMinutes < 1) {
// return '刚刚';
// } else if (difference.inHours < 1) {
// return '${difference.inMinutes}分钟前';
// } else if (difference.inDays < 1) {
// return '${difference.inHours}小时前';
// } else if (difference.inDays < 7) {
// return '${difference.inDays}天前';
// } else {
// return '${time.month}/${time.day}';
// }
// }
// String _formatTime(String timestamp) {
// var time = DateTime.parse(timestamp);
// final now = DateTime.now();
// final difference = now.difference(time);
//
// if (difference.inMinutes < 1) {
// return '刚刚';
// } else if (difference.inHours < 1) {
// return '${difference.inMinutes}分钟前';
// } else if (difference.inDays < 1) {
// return '${difference.inHours}小时前';
// } else if (difference.inDays < 7) {
// return '${difference.inDays}天前';
// } else {
// return '${time.month}/${time.day}';
// }
// }
}

86
lib/pages/home/content_card.dart

@ -61,54 +61,6 @@ 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,
// ),
// ),
// ),
// ),
],
),
const SizedBox(width: 10),
@ -135,26 +87,6 @@ class _CardHeader extends StatelessWidget {
maxLines: 1,
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 (item.isRealNameCertified == true)
Container(
padding: const EdgeInsets.symmetric(
@ -214,7 +146,7 @@ class _CardHeader extends StatelessWidget {
SizedBox(
height: 16,
child: Text(
'${item.age ?? 0}岁 · ${item.cityName ?? ''}${item.districtName != null ? item.districtName : ''}',
'${item.age ?? 0}${(item.cityName ?? '') != "" ? "· " : ""}${item.cityName ?? ''}${item.districtName != null ? item.districtName : ''}',
style: TextStyle(
fontSize: 12,
color: Color.fromRGBO(51, 51, 51, 1),
@ -288,8 +220,8 @@ class _CardHeader extends StatelessWidget {
},
child: Image.asset(
_getButtonImage(isLive, isOnline),
width: isLive ? 60 : 40,
height: 20,
width: isLive ? 60 : 50,
height: 30,
),
),
],
@ -324,13 +256,7 @@ class ContentCard extends StatelessWidget {
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.circular(12),
boxShadow: const [
BoxShadow(
color: Color(0x14000000),
blurRadius: 8,
offset: Offset(0, 4),
),
],
),
padding: const EdgeInsets.all(12),
child: Column(
@ -338,7 +264,6 @@ class ContentCard extends StatelessWidget {
children: [
// 线 - HI位置
_CardHeader(item: item),
const SizedBox(height: 8),
// -
_buildContent(),
@ -372,7 +297,7 @@ class ContentCard extends StatelessWidget {
//
if (item.photoList != null && item.photoList!.isNotEmpty) {
contentWidgets.add(const SizedBox(height: 16));
contentWidgets.add(const SizedBox(height: 6));
// = ( - padding - ListView左右padding - ) / 3
// padding: 12 * 2 = 24
@ -437,6 +362,7 @@ class _NetworkImageWidget extends StatelessWidget {
imageUrl: '$imageUrl?x-oss-process=image/format,webp/resize,w_320',
width: 80,
height: 80,
fit: BoxFit.cover,
imageBuilder: (context, imageProvider) => Container(
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(8),

15
lib/pages/home/home_page.dart

@ -39,6 +39,21 @@ class _HomePageState extends State<HomePage>
width: double.infinity,
height: double.infinity,
),
Positioned.fill(
child: Container(
decoration: BoxDecoration(
gradient: LinearGradient(
begin: Alignment.topCenter,
end: Alignment.bottomCenter,
colors: [
Colors.transparent, // rgba(248, 242, 255, 1)
Color.fromRGBO(242, 242, 242, .2), // rgba(247, 247, 247, 1)
],
stops: [0.0, 1.0],
),
),
),
),
Scaffold(
backgroundColor: Colors.transparent,
appBar: _buildAppBar(controller),

2
lib/pages/home/user_information_page.dart

@ -369,7 +369,7 @@ class UserInformationPage extends StatelessWidget {
),
SizedBox(height: 8.w,),
Text(
controller.userData.value.describeInfo ?? "我想找一个有缘的异性,快来联系我吧。",
(miId == GlobalData().userData!.id && GlobalData().userData!.auditDescribeInfo != null && GlobalData().userData!.auditDescribeInfo != "") ? (GlobalData().userData!.auditDescribeInfo ?? "") : (controller.userData.value.describeInfo ?? "我想找一个有缘的异性,快来联系我吧。"),
style: TextStyle(
fontSize: 14.w,
color: const Color.fromRGBO(144, 144, 144, 1)

5
lib/pages/main/main_page.dart

@ -100,6 +100,7 @@ class _MainPageState extends State<MainPage> {
TDBottomTabBarBasicType.iconText,
componentType: TDBottomTabBarComponentType.normal,
useVerticalDivider: false,
barHeight: 61,
navigationTabs: [
tabItem('首页', Assets.imagesHomePre, Assets.imagesHomeNol, 0),
tabItem('广场', Assets.imagesDiscoverPre, Assets.imagesDiscoverNol, 1),
@ -118,8 +119,8 @@ class _MainPageState extends State<MainPage> {
TDBottomTabBarTabConfig tabItem(String title, String selectedIcon, String unselectedIcon, int index) {
return TDBottomTabBarTabConfig(
tabText: title,
selectedIcon: Image.asset(selectedIcon, width: 25, height: 25, fit: BoxFit.cover),
unselectedIcon: Image.asset(unselectedIcon, width: 25, height: 25, fit: BoxFit.cover),
selectedIcon: Image.asset(selectedIcon, width: 30, height: 30, fit: BoxFit.cover),
unselectedIcon: Image.asset(unselectedIcon, width: 30, height: 30, fit: BoxFit.cover),
selectTabTextStyle: TextStyle(color: Color(0xFFED4AC3)),
unselectTabTextStyle: TextStyle(color: Color(0xFF999999)),
onTap: () {

50
lib/pages/mine/edit_info_page.dart

@ -226,7 +226,21 @@ class _EditInfoPageState extends State<EditInfoPage> {
init: EditInfoController(),
builder: (controller) {
return Scaffold(
appBar: PageAppbar(title: "编辑资料"),
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),
),
),
),
),),
backgroundColor: const Color.fromRGBO(243, 243, 243, 1.0),
body: SingleChildScrollView(
@ -307,7 +321,6 @@ class _EditInfoPageState extends State<EditInfoPage> {
File(controller.avatarLocalPath.value),
width: 85.w,
height: 85.w,
fit: BoxFit.cover,
) : (controller.userData.value?.profilePhoto?.isNotEmpty ?? false) ? CachedNetworkImage(
imageUrl: "${controller.userData.value?.profilePhoto ?? ""}?x-oss-process=image/format,webp/resize,w_170",
width: 85.w,
@ -366,9 +379,8 @@ class _EditInfoPageState extends State<EditInfoPage> {
],
),
SizedBox(height: 5.w,),
Container(
SizedBox(
width: 340.w,
margin: EdgeInsets.only(bottom: 35.w),
child: Wrap(
spacing: 5.w,
runSpacing: 5.w,
@ -821,7 +833,7 @@ class _EditInfoPageState extends State<EditInfoPage> {
top: 14.w,
bottom: 14.w
),
margin: EdgeInsets.only(top: 10.w),
margin: EdgeInsets.only(top: 10.w, bottom: 15.w),
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.all(Radius.circular(9.w))
@ -829,6 +841,7 @@ class _EditInfoPageState extends State<EditInfoPage> {
child: Column(
children: [
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Text(
"交友心声",
@ -836,6 +849,18 @@ class _EditInfoPageState extends State<EditInfoPage> {
fontSize: 15.w,
fontWeight: FontWeight.w500
),
),
(controller.userData.value?.auditDescribeInfo != null && controller.userData.value?.auditDescribeInfo != "") ? Text(
"审核中",
style: TextStyle(
fontSize: 13.w,
fontWeight: FontWeight.w500,
color: Color.fromRGBO(191, 191, 191, 1)
),
) : Icon(
Icons.keyboard_arrow_right,
size: 15.w,
color: Color.fromRGBO(191, 191, 191, 1)
)
],
),
@ -843,10 +868,11 @@ class _EditInfoPageState extends State<EditInfoPage> {
Container(
alignment: Alignment.centerLeft,
child: Text(
controller.message.value,
controller.realDescribe.value != "" ? controller.realDescribe.value : "请输入交友心声",
style: TextStyle(
fontSize: 13.w,
fontWeight: FontWeight.w500
fontSize: 13.w,
fontWeight: FontWeight.w500,
color: controller.realDescribe.value != "" ? const Color.fromRGBO(51, 51, 51, 1) : const Color.fromRGBO(191, 191, 191, 1),
),
),
)
@ -854,9 +880,11 @@ class _EditInfoPageState extends State<EditInfoPage> {
],
),
).onTap((){
Get.to(() => SignaturePage())?.then((e){
controller.savaDescribeInfo();
});
if(controller.userData.value?.auditDescribeInfo != null && controller.userData.value?.auditDescribeInfo != ""){
SmartDialog.showToast("交友心声正在审核中,请勿重复提交");
return;
}
Get.to(() => SignaturePage());
}),
],
if(false && controller.menuActive.value == 2) ...[

3
lib/pages/mine/mine_page.dart

@ -184,11 +184,10 @@ class _MinePageState extends State<MinePage> with AutomaticKeepAliveClientMixin{
)
],
),
SizedBox(height: 11.w,),
Text(
"ID:${controller.userId.value ?? ""}",
style: TextStyle(
fontSize: 12.w,
fontSize: 10.w,
color: const Color.fromRGBO(51, 51, 51, 1),
fontWeight: FontWeight.w500
),

38
lib/pages/mine/phone_page.dart

@ -29,25 +29,25 @@ class PhonePage extends StatelessWidget {
const SizedBox(height: 12),
Text(_encryptPhone(controller.phone.value), style: TextStyle(fontSize: 40, fontWeight: FontWeight.bold)),
SizedBox(height: 64),
TDButton(
text: '更换手机号码',
width: MediaQuery.of(context).size.width - 50,
size: TDButtonSize.large,
type: TDButtonType.fill,
shape: TDButtonShape.round,
style: TDButtonStyle(
textColor: Colors.white,
backgroundColor: Color(0xFF7562F9),
),
activeStyle: TDButtonStyle(
textColor: Colors.white,
backgroundColor: Color(0xC37562F9),
),
onTap: (){
controller.tabIndex.value = 1;
},
),
SizedBox(height: 200),
// TDButton(
// text: '更换手机号码',
// width: MediaQuery.of(context).size.width - 50,
// size: TDButtonSize.large,
// type: TDButtonType.fill,
// shape: TDButtonShape.round,
// style: TDButtonStyle(
// textColor: Colors.white,
// backgroundColor: Color(0xFF7562F9),
// ),
// activeStyle: TDButtonStyle(
// textColor: Colors.white,
// backgroundColor: Color(0xC37562F9),
// ),
// onTap: (){
// controller.tabIndex.value = 1;
// },
// ),
// SizedBox(height: 200),
],
),
),

134
lib/pages/mine/signature_page.dart

@ -1,70 +1,94 @@
import 'package:dating_touchme_app/components/page_appbar.dart';
import 'package:dating_touchme_app/controller/mine/edit_info_controller.dart';
import 'package:dating_touchme_app/extension/ex_widget.dart';
import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:get/get.dart';
class SignaturePage extends StatefulWidget {
class SignaturePage extends StatelessWidget {
const SignaturePage({super.key});
@override
State<SignaturePage> createState() => _SignaturePageState();
}
class _SignaturePageState extends State<SignaturePage> {
String message = '拒绝内耗,向阳而生,用热爱抵御岁月漫长,用真诚对待每一次相遇拒绝内耗,向阳而生,用热爱抵御岁月漫长,用真诚对待每一次相遇';
final TextEditingController _messageController = TextEditingController();
@override
void initState() {
super.initState();
_messageController.value = TextEditingValue(
text: message,
selection: TextSelection.fromPosition(TextPosition(offset: message.length)),
);
}
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: PageAppbar(title: "交友心声",),
body: Container(
padding: EdgeInsets.all(17.w),
child: TextField(
controller: _messageController,
maxLength: 50, //
minLines: 5, //
maxLines: 5, //
style: TextStyle(
fontSize: ScreenUtil().setWidth(13),
height: 1
),
decoration: InputDecoration(
contentPadding: EdgeInsets.symmetric(
vertical: 0,
horizontal: 0
),
hintText: "请输入交友心声",
return GetX<EditInfoController>(
init: EditInfoController(),
builder: (controller) {
return Scaffold(
appBar: PageAppbar(title: "交友心声",),
body: Container(
padding: EdgeInsets.all(17.w),
child: TextField(
controller: controller.messageController.value,
maxLength: 50, //
minLines: 5, //
maxLines: 5, //
style: TextStyle(
fontSize: ScreenUtil().setWidth(13),
height: 1
),
decoration: InputDecoration(
contentPadding: EdgeInsets.symmetric(
vertical: 0,
horizontal: 0
),
hintText: "请输入交友心声",
border: const OutlineInputBorder(
borderSide: BorderSide.none, // //
),
// focusedBorder enabledBorder
focusedBorder: const OutlineInputBorder(
borderSide: BorderSide.none,
borderRadius: BorderRadius.all(Radius.circular(8.0)),
),
enabledBorder: const OutlineInputBorder(
borderSide: BorderSide.none,
borderRadius: BorderRadius.all(Radius.circular(8.0)),
border: const OutlineInputBorder(
borderSide: BorderSide.none, // //
),
// focusedBorder enabledBorder
focusedBorder: const OutlineInputBorder(
borderSide: BorderSide.none,
borderRadius: BorderRadius.all(Radius.circular(8.0)),
),
enabledBorder: const OutlineInputBorder(
borderSide: BorderSide.none,
borderRadius: BorderRadius.all(Radius.circular(8.0)),
),
),
onChanged: (value){
controller.message.value = value;
print(value);
},
),
),
onChanged: (value){
message = value;
},
),
),
bottomNavigationBar: Container(
margin: EdgeInsets.only(bottom: 30.w),
child: Container(
width: 350.w,
height: 45.w,
decoration: BoxDecoration(
borderRadius: BorderRadius.all(Radius.circular(45.w)),
gradient: LinearGradient(
begin: Alignment.centerLeft, // 90deg:
end: Alignment.centerRight,
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], // 0%77.53%100%
),
),
child: Center(
child: Text(
"保存",
style: TextStyle(
fontSize: 18.w,
color: Colors.white,
fontWeight: FontWeight.w500
),
),
),
).onTap(() async {
controller.savaDescribeInfo();
}),
),
);
},
);
}
}
Loading…
Cancel
Save