diff --git a/assets/images/phone_checked.png b/assets/images/phone_checked.png new file mode 100644 index 0000000..9b9000c Binary files /dev/null and b/assets/images/phone_checked.png differ diff --git a/assets/images/photo_checked.png b/assets/images/photo_checked.png new file mode 100644 index 0000000..cbd42ee Binary files /dev/null and b/assets/images/photo_checked.png differ diff --git a/assets/images/photo_uncheck.png b/assets/images/photo_uncheck.png new file mode 100644 index 0000000..cc52ca3 Binary files /dev/null and b/assets/images/photo_uncheck.png differ diff --git a/assets/images/real_checked.png b/assets/images/real_checked.png new file mode 100644 index 0000000..bcdfaf3 Binary files /dev/null and b/assets/images/real_checked.png differ diff --git a/assets/images/real_uncheck.png b/assets/images/real_uncheck.png new file mode 100644 index 0000000..1020d14 Binary files /dev/null and b/assets/images/real_uncheck.png differ diff --git a/lib/controller/mine/auth_controller.dart b/lib/controller/mine/auth_controller.dart index 900cb14..e713cb1 100644 --- a/lib/controller/mine/auth_controller.dart +++ b/lib/controller/mine/auth_controller.dart @@ -1,6 +1,7 @@ import 'dart:async'; import 'package:get/get.dart'; import 'package:flutter_smart_dialog/flutter_smart_dialog.dart'; +import '../../generated/assets.dart'; import '../../network/user_api.dart'; import '../global.dart'; @@ -38,9 +39,9 @@ class AuthController extends GetxController { } } dataList.assignAll([ - AuthCard( title: '手机绑定', desc: '防止账号丢失', index: 1, authed: true), - AuthCard( title: '真实头像', desc: '提高交友成功率', index: 2, authed: checkPhoto), - AuthCard( title: '实名认证', desc: '提高交友成功率', index: 3, authed: realAuth), + AuthCard( title: '手机绑定', desc: '防止账号丢失', index: 1, authed: true, defaultIcon: Assets.imagesPhoneChecked, activeIcon: Assets.imagesPhoneChecked, width: 28,height: 40), + AuthCard( title: '真实头像', desc: '提高交友成功率', index: 2, authed: checkPhoto, defaultIcon: Assets.imagesPhotoUncheck, activeIcon: Assets.imagesPhotoChecked, width: 38,height: 37), + AuthCard( title: '实名认证', desc: '提高交友成功率', index: 3, authed: realAuth, defaultIcon: Assets.imagesRealUncheck, activeIcon: Assets.imagesRealChecked, width: 36,height: 40), ]); } catch (e) { SmartDialog.showToast('网络请求失败,请检查网络连接'); @@ -128,11 +129,19 @@ class AuthCard { final String desc; final int index; bool authed; + final String defaultIcon; + final String activeIcon; + final double height; + final double width; AuthCard({ required this.desc, required this.title, required this.index, required this.authed, + required this.defaultIcon, + required this.activeIcon, + required this.height, + required this.width, }); } diff --git a/lib/generated/assets.dart b/lib/generated/assets.dart index ad13fa5..b5fefa0 100644 --- a/lib/generated/assets.dart +++ b/lib/generated/assets.dart @@ -124,10 +124,15 @@ class Assets { static const String imagesMore = 'assets/images/more.png'; static const String imagesMoreIcon = 'assets/images/more_icon.png'; static const String imagesOnlineIcon = 'assets/images/online_icon.png'; + static const String imagesPhoneChecked = 'assets/images/phone_checked.png'; static const String imagesPhoto = 'assets/images/photo.png'; + static const String imagesPhotoChecked = 'assets/images/photo_checked.png'; + static const String imagesPhotoUncheck = 'assets/images/photo_uncheck.png'; static const String imagesPlayIcon = 'assets/images/play_icon.png'; static const String imagesPlayer = 'assets/images/player.png'; + static const String imagesRealChecked = 'assets/images/real_checked.png'; static const String imagesRealName = 'assets/images/real_name.png'; + static const String imagesRealUncheck = 'assets/images/real_uncheck.png'; static const String imagesRose = 'assets/images/rose.png'; static const String imagesRoseBanner = 'assets/images/rose_banner.png'; static const String imagesRoseGift = 'assets/images/rose_gift.png'; diff --git a/lib/pages/mine/auth_center_page.dart b/lib/pages/mine/auth_center_page.dart index 6b4bfe7..9cfbc51 100644 --- a/lib/pages/mine/auth_center_page.dart +++ b/lib/pages/mine/auth_center_page.dart @@ -6,6 +6,7 @@ import 'package:get/get.dart'; import '../../controller/mine/auth_controller.dart'; import '../../extension/router_service.dart'; +import '../../generated/assets.dart'; import 'edit_info_page.dart'; class AuthCenterPage extends StatelessWidget { @@ -50,14 +51,17 @@ class AuthCenterPage extends StatelessWidget { children: [ // 左侧图片 Container( - width: 40, - height: 40, + width: 72, + height: 72, decoration: BoxDecoration( - borderRadius: BorderRadius.circular(8), - color: Colors.blue[100], - image: DecorationImage( - image: NetworkImage('https://picsum.photos/40/40?random=$item.index'), - fit: BoxFit.cover, + borderRadius: BorderRadius.circular(72), + color: Color(0xFFF7F7F7), + ), + child: Center( + child: Image.asset( + item.authed ? item.activeIcon : item.defaultIcon, + width: item.width, + height: item.height, ), ), ), diff --git a/lib/pages/mine/real_name_page.dart b/lib/pages/mine/real_name_page.dart index 5ea75a7..6be4dcb 100644 --- a/lib/pages/mine/real_name_page.dart +++ b/lib/pages/mine/real_name_page.dart @@ -21,40 +21,41 @@ class RealNamePage extends StatelessWidget { body: Column( children: [ Container( - height: 48, - decoration: BoxDecoration(color: Color(0xffE7E7E7)), + height: 56, + decoration: BoxDecoration(color: Color(0xffFFFFFF)), padding: const EdgeInsets.only(left: 16), - child: Row( - crossAxisAlignment: CrossAxisAlignment.center, // 垂直居中 - children: [ - Text( - '*请填写本人实名信息', - style: TextStyle( - fontSize: 14, - color: Colors.black87, - ), + child: Center( + child: Text( + '*请填写本人实名信息', + style: TextStyle( + fontSize: 14, + color: Colors.black87, ), - ], + ), ), ), + // SizedBox(height: 12), Container( height: 56, // 固定高度确保垂直居中 + width: MediaQuery.of(context).size.width - 40, decoration: BoxDecoration( - border: Border( - bottom: BorderSide( - color: Colors.grey[400]!, - width: 0.5, - ), - ), + border: Border.all(color: Colors.grey.shade300), + borderRadius: BorderRadius.circular(28), + // border: Border( + // bottom: BorderSide( + // color: Colors.grey[400]!, + // width: 0.5, + // ), + // ), ), child: Row( crossAxisAlignment: CrossAxisAlignment.center, // 垂直居中 children: [ // 左侧标签 - 固定宽度 + 垂直居中 Container( - width: 100, + width: 108, alignment: Alignment.centerLeft, - padding: const EdgeInsets.only(left: 16), + padding: const EdgeInsets.only(left: 24), child: Text( '姓名:', style: TextStyle( @@ -63,7 +64,7 @@ class RealNamePage extends StatelessWidget { ), ), ), - SizedBox(width: 12), + // SizedBox(width: 4), // 输入框区域 - 使用Expanded填充剩余空间 Expanded( @@ -90,25 +91,28 @@ class RealNamePage extends StatelessWidget { ], ), ), - // SizedBox(height: 30), + SizedBox(height: 24), Container( height: 56, // 固定高度确保垂直居中 + width: MediaQuery.of(context).size.width - 40, decoration: BoxDecoration( - border: Border( - bottom: BorderSide( - color: Colors.grey[400]!, - width: 0.5, - ), - ), + border: Border.all(color: Colors.grey.shade300), + borderRadius: BorderRadius.circular(28), + // border: Border( + // bottom: BorderSide( + // color: Colors.grey[400]!, + // width: 0.5, + // ), + // ), ), child: Row( crossAxisAlignment: CrossAxisAlignment.center, // 垂直居中 children: [ // 左侧标签 - 固定宽度 + 垂直居中 Container( - width: 100, + width: 108, alignment: Alignment.centerLeft, - padding: const EdgeInsets.only(left: 16), + padding: const EdgeInsets.only(left: 24), child: Text( '身份证号:', style: TextStyle( @@ -117,7 +121,7 @@ class RealNamePage extends StatelessWidget { ), ), ), - SizedBox(width: 12), + // SizedBox(width: 4), // 输入框区域 - 使用Expanded填充剩余空间 Expanded(