diff --git a/assets/images/error_icon.png b/assets/images/error_icon.png new file mode 100644 index 0000000..8e4a968 Binary files /dev/null and b/assets/images/error_icon.png differ diff --git a/assets/images/success_icon.png b/assets/images/success_icon.png new file mode 100644 index 0000000..a74378b Binary files /dev/null and b/assets/images/success_icon.png differ diff --git a/assets/images/teenager_bg.png b/assets/images/teenager_bg.png new file mode 100644 index 0000000..016bd82 Binary files /dev/null and b/assets/images/teenager_bg.png differ diff --git a/assets/images/teenager_list.png b/assets/images/teenager_list.png new file mode 100644 index 0000000..42c4147 Binary files /dev/null and b/assets/images/teenager_list.png differ diff --git a/lib/generated/assets.dart b/lib/generated/assets.dart index f52f6cd..2ce9b82 100644 --- a/lib/generated/assets.dart +++ b/lib/generated/assets.dart @@ -103,9 +103,11 @@ class Assets { static const String imagesEmoji = 'assets/images/emoji.png'; static const String imagesEmojiTab = 'assets/images/emoji_tab.png'; static const String imagesEmptyIcon = 'assets/images/empty_icon.png'; + static const String imagesErrorIcon = 'assets/images/error_icon.png'; static const String imagesExitRoom = 'assets/images/exit_room.png'; static const String imagesFemale = 'assets/images/female.png'; static const String imagesFemaleEmpty = 'assets/images/female_empty.png'; + static const String imagesFilterIcon = 'assets/images/filter_icon.png'; static const String imagesFireIcon = 'assets/images/fire_icon.png'; static const String imagesFirstPay = 'assets/images/first_pay.png'; static const String imagesGift = 'assets/images/gift.png'; @@ -121,6 +123,7 @@ class Assets { static const String imagesHomeNol = 'assets/images/home_nol.png'; static const String imagesHomePre = 'assets/images/home_pre.png'; static const String imagesInformationBg = 'assets/images/information_bg.png'; + static const String imagesLastMsgIcon = 'assets/images/last_msg_icon.png'; static const String imagesLimitTime = 'assets/images/limit_time.png'; static const String imagesLiveIcon = 'assets/images/live_icon.png'; static const String imagesLocationIcon = 'assets/images/location_icon.png'; @@ -148,6 +151,7 @@ class Assets { static const String imagesMoreIcon = 'assets/images/more_icon.png'; static const String imagesMyWalletBg = 'assets/images/my_wallet_bg.png'; static const String imagesOnlineIcon = 'assets/images/online_icon.png'; + static const String imagesOnlineMsgIcon = 'assets/images/online_msg_icon.png'; static const String imagesPhoneChecked = 'assets/images/phone_checked.png'; static const String imagesPhoneHelp = 'assets/images/phone_help.png'; static const String imagesPhoto = 'assets/images/photo.png'; @@ -183,8 +187,12 @@ class Assets { static const String imagesShop = 'assets/images/shop.png'; static const String imagesSplash = 'assets/images/splash.png'; static const String imagesSubscript = 'assets/images/subscript.png'; + static const String imagesSuccessIcon = 'assets/images/success_icon.png'; static const String imagesTabChangeIcon = 'assets/images/tab_change_icon.png'; static const String imagesTalkIcon = 'assets/images/talk_icon.png'; + static const String imagesTeenagerBg = 'assets/images/teenager_bg.png'; + static const String imagesTeenagerList = 'assets/images/teenager_list.png'; + static const String imagesUnreadIcon = 'assets/images/unread_icon.png'; static const String imagesUpdataBg = 'assets/images/updata_bg.png'; static const String imagesUpdataFont = 'assets/images/updata_font.png'; static const String imagesUpdataIcon = 'assets/images/updata_icon.png'; @@ -211,8 +219,5 @@ class Assets { static const String imagesWallet = 'assets/images/wallet.png'; static const String imagesWechatPay = 'assets/images/wechat_pay.png'; static const String imagesWomenIcon = 'assets/images/women_icon.png'; - static const String imagesFilterIcon = 'assets/images/filter_icon.png'; - static const String imagesLastMsgIcon = 'assets/images/last_msg_icon.png'; - static const String imagesOnlineMsgIcon = 'assets/images/online_msg_icon.png'; - static const String imagesUnreadIcon = 'assets/images/unread_icon.png'; + } diff --git a/lib/pages/setting/deactivate_page.dart b/lib/pages/setting/deactivate_page.dart new file mode 100644 index 0000000..9f70839 --- /dev/null +++ b/lib/pages/setting/deactivate_page.dart @@ -0,0 +1,119 @@ +import 'package:dating_touchme_app/components/page_appbar.dart'; +import 'package:dating_touchme_app/generated/assets.dart'; +import 'package:flutter/material.dart'; +import 'package:flutter_screenutil/flutter_screenutil.dart'; + +class DeactivatePage extends StatelessWidget { + const DeactivatePage({super.key}); + + @override + Widget build(BuildContext context) { + return Scaffold( + appBar: PageAppbar(title: ""), + body: Container( + padding: EdgeInsets.symmetric( + vertical: 52.w, + horizontal: 15.w + ), + child: Column( + children: [ + Text( + "账号注销安全提示", + style: TextStyle( + fontSize: 16.w, + fontWeight: FontWeight.w700 + ), + ), + SizedBox(height: 35.w,), + Text( + "申请注销趣恋恋账号前,趣恋恋将进行以下验证,以保证你的账号安全、财产安全。", + style: TextStyle( + fontSize: 13.w, + fontWeight: FontWeight.w500, + color: const Color.fromRGBO(144, 144, 144, 1) + ), + ), + SizedBox(height: 15.w,), + Container( + height: 104.w, + padding: EdgeInsets.symmetric( + vertical: 20.w, + horizontal: 17.w + ), + decoration: BoxDecoration( + color: const Color.fromRGBO(245, 245, 245, 1), + borderRadius: BorderRadius.all(Radius.circular(8.w)) + ), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Row( + children: [ + Image.asset( + Assets.imagesSuccessIcon, + width: 15.w, + ), + SizedBox(width: 9.w,), + Text( + "账号处于安全状态", + style: TextStyle( + fontSize: 13.w, + color: const Color.fromRGBO(41, 186, 63, 1) + ), + ) + ], + ), + Row( + children: [ + Image.asset( + Assets.imagesErrorIcon, + width: 15.w, + ), + SizedBox(width: 9.w,), + Text( + "钱包余额未结清", + style: TextStyle( + fontSize: 13.w, + fontWeight: FontWeight.w500 + ), + ) + ], + ), + ], + ), + ), + Spacer(), + 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 + ), + ), + ), + ) + ], + ), + ), + ); + } +} diff --git a/lib/pages/setting/setting_page.dart b/lib/pages/setting/setting_page.dart index ada1640..b996f87 100644 --- a/lib/pages/setting/setting_page.dart +++ b/lib/pages/setting/setting_page.dart @@ -3,6 +3,8 @@ import 'package:dating_touchme_app/controller/home/home_controller.dart'; import 'package:dating_touchme_app/controller/message/conversation_controller.dart'; import 'package:dating_touchme_app/controller/mine/mine_controller.dart'; import 'package:dating_touchme_app/pages/mine/login_page.dart'; +import 'package:dating_touchme_app/pages/setting/deactivate_page.dart'; +import 'package:dating_touchme_app/pages/setting/teenager_mode_page.dart'; import 'package:flutter/material.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:get/get.dart'; @@ -60,7 +62,9 @@ class SettingPage extends StatelessWidget { Get.to(() => BlacklistPage()); }), TDCell(arrow: true, title: '隐私设置'), - TDCell(arrow: true, title: '青少年模式'), + TDCell(arrow: true, title: '青少年模式', onClick: (cell) { + Get.to(() => TeenagerModePage()); + },), ], ), const SizedBox(height: 12), @@ -139,50 +143,7 @@ class SettingPage extends StatelessWidget { fontWeight: FontWeight.w400, ), ), onClick: (cell){ - showGeneralDialog( - context: context, - pageBuilder: (BuildContext buildContext, Animation< - double> animation, - Animation secondaryAnimation) { - return TDAlertDialog( - title: '是否注销当前账号?', - buttonWidget: Container( - padding: EdgeInsetsGeometry.only(top: 16.w, - right: 30.w, - left: 30.w, - bottom: 32.w), - child: Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - TDButton( - text: '取 消', - width: 120, - size: TDButtonSize.large, - type: TDButtonType.fill, - shape: TDButtonShape.round, - theme: TDButtonTheme.defaultTheme, - onTap: () { - Navigator.of(context).pop(); - }, - ), - TDButton( - text: '确 定', - width: 120, - size: TDButtonSize.large, - type: TDButtonType.fill, - shape: TDButtonShape.round, - theme: TDButtonTheme.danger, - onTap: () { - controller.logout(); - Get.offAll(() => LoginPage()); - }, - ), - ], - ), - ) - ); - }, - ); + Get.to(() => DeactivatePage()); },), ], ), diff --git a/lib/pages/setting/teenager_mode_open_page.dart b/lib/pages/setting/teenager_mode_open_page.dart new file mode 100644 index 0000000..ea8006b --- /dev/null +++ b/lib/pages/setting/teenager_mode_open_page.dart @@ -0,0 +1,73 @@ +import 'package:dating_touchme_app/components/page_appbar.dart'; +import 'package:dating_touchme_app/extension/ex_widget.dart'; +import 'package:flutter/material.dart'; +import 'package:flutter/services.dart'; +import 'package:flutter_screenutil/flutter_screenutil.dart'; +import 'package:get/get.dart'; +import 'package:pinput/pinput.dart'; + +class TeenagerModeOpenPage extends StatelessWidget { + const TeenagerModeOpenPage({super.key}); + + @override + Widget build(BuildContext context) { + return Scaffold( + appBar: PageAppbar(title: "开启未成年人模式"), + body: Container( + width: 375.w, + padding: EdgeInsets.only(top: 140.w), + child: Column( + children: [ + Text( + "设置密码", + style: TextStyle( + fontSize: 21.w, + fontWeight: FontWeight.w500 + ), + ), + SizedBox(height: 25.w,), + Pinput( + inputFormatters: [ + // 只允许 0-9 + FilteringTextInputFormatter.digitsOnly, + ], + onCompleted: (pin) => print(pin), + ), + Container( + margin: EdgeInsets.only(top: 60.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((){ + Get.to(() => TeenagerModeOpenPage()); + }), + ) + ], + ), + ), + ); + } +} diff --git a/lib/pages/setting/teenager_mode_page.dart b/lib/pages/setting/teenager_mode_page.dart new file mode 100644 index 0000000..158a9bb --- /dev/null +++ b/lib/pages/setting/teenager_mode_page.dart @@ -0,0 +1,131 @@ +import 'package:dating_touchme_app/components/page_appbar.dart'; +import 'package:dating_touchme_app/extension/ex_widget.dart'; +import 'package:dating_touchme_app/generated/assets.dart'; +import 'package:dating_touchme_app/pages/setting/teenager_mode_open_page.dart'; +import 'package:flutter/material.dart'; +import 'package:flutter_screenutil/flutter_screenutil.dart'; +import 'package:get/get.dart'; + +class TeenagerModePage extends StatelessWidget { + const TeenagerModePage({super.key}); + + @override + Widget build(BuildContext context) { + return Scaffold( + appBar: PageAppbar(title: "", backgroundColor: const Color.fromRGBO(242, 241, 246, 1),), + backgroundColor: const Color.fromRGBO(242, 241, 246, 1), + body: Container( + width: 375.w, + padding: EdgeInsets.only( + top: 10.w + ), + child: Column( + children: [ + Image.asset( + Assets.imagesTeenagerBg, + width: 203.w, + height: 203.w, + ), + Text( + "未成年人模式未开启", + style: TextStyle( + fontSize: 21.w, + fontWeight: FontWeight.w500 + ), + ), + SizedBox(height: 25.w,), + Container( + padding: EdgeInsets.symmetric( + horizontal: 50.w + ), + child: Column( + children: [ + Row( + children: [ + Image.asset( + Assets.imagesTeenagerList, + width: 11.w, + ), + SizedBox(width: 6.w,), + Text( + "青少年模式中,无法进行充值、购买等操作", + style: TextStyle( + fontSize: 13.w + ), + ) + ], + ), + SizedBox(height: 14.w,), + Row( + children: [ + Image.asset( + Assets.imagesTeenagerList, + width: 11.w, + ), + SizedBox(width: 6.w,), + Text( + "无法进行连麦、直播等操作", + style: TextStyle( + fontSize: 13.w + ), + ) + ], + ), + SizedBox(height: 14.w,), + Row( + children: [ + Image.asset( + Assets.imagesTeenagerList, + width: 11.w, + ), + SizedBox(width: 6.w,), + Text( + "无法使用推荐发消息等功能", + style: TextStyle( + fontSize: 13.w + ), + ) + ], + ), + ], + ), + ), + Spacer(), + 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((){ + Get.to(() => TeenagerModeOpenPage()); + }), + ) + ], + ), + ), + ); + } +} diff --git a/pubspec.yaml b/pubspec.yaml index 5f542a3..324e520 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -76,6 +76,7 @@ dependencies: flutter_svga: ^0.0.8 url_launcher: ^6.3.2 wakelock_plus: ^1.4.0 + pinput: ^6.0.1 dev_dependencies: flutter_test: