diff --git a/assets/images/cert.png b/assets/images/cert.png index 06fb3be..45df35f 100644 Binary files a/assets/images/cert.png and b/assets/images/cert.png differ diff --git a/assets/images/matchmaker.png b/assets/images/matchmaker.png index 4a4a3f2..cd3932f 100644 Binary files a/assets/images/matchmaker.png and b/assets/images/matchmaker.png differ diff --git a/assets/images/rose.png b/assets/images/rose.png index 23e262b..3a7e5d9 100644 Binary files a/assets/images/rose.png and b/assets/images/rose.png differ diff --git a/assets/images/vip_banner.png b/assets/images/vip_banner.png index 1530d86..153c98a 100644 Binary files a/assets/images/vip_banner.png and b/assets/images/vip_banner.png differ diff --git a/assets/images/wallet.png b/assets/images/wallet.png index d907d1e..11b00ba 100644 Binary files a/assets/images/wallet.png and b/assets/images/wallet.png differ diff --git a/lib/controller/global.dart b/lib/controller/global.dart index 84c3dbb..727e706 100644 --- a/lib/controller/global.dart +++ b/lib/controller/global.dart @@ -1,7 +1,14 @@ // ignore_for_file: constant_identifier_names, non_constant_identifier_names import 'dart:io'; +import 'package:dating_touchme_app/controller/discover/discover_controller.dart'; +import 'package:dating_touchme_app/controller/home/home_controller.dart'; +import 'package:dating_touchme_app/controller/message/conversation_controller.dart'; +import 'package:get/get.dart'; +import 'package:get/get_core/src/get_main.dart'; + import '../model/mine/user_data.dart'; +import 'mine/mine_controller.dart'; class GlobalData { String? qnToken;//uec接口的Token @@ -15,6 +22,11 @@ class GlobalData { userId = null; qnToken = null; userData = null; + + Get.delete(force: true); + Get.delete(force: true); + Get.delete(force: true); + Get.delete(force: true); } static GlobalData getInstance() { diff --git a/lib/controller/home/home_controller.dart b/lib/controller/home/home_controller.dart index d946abf..01de050 100644 --- a/lib/controller/home/home_controller.dart +++ b/lib/controller/home/home_controller.dart @@ -40,6 +40,7 @@ class HomeController extends GetxController { /// 加载初始数据(同时加载两个标签页的数据) void loadInitialData() async { // 并行加载两个标签页的数据 + print(12121); await Future.wait([ loadRecommendInitialData(), loadNearbyInitialData(), diff --git a/lib/network/network_config.dart b/lib/network/network_config.dart index 39ff207..f88cfa3 100644 --- a/lib/network/network_config.dart +++ b/lib/network/network_config.dart @@ -1,5 +1,8 @@ +import 'package:dating_touchme_app/controller/discover/discover_controller.dart'; import 'package:dating_touchme_app/controller/global.dart'; +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/im/im_manager.dart'; import 'package:dio/dio.dart'; import 'package:flutter_smart_dialog/flutter_smart_dialog.dart'; @@ -170,6 +173,7 @@ class ResponseInterceptor extends Interceptor { GetStorage().erase(); // 清除全局数据 GlobalData().logout(); + Get.offAll(() => LoginPage()); } } \ No newline at end of file diff --git a/lib/pages/mine/mine_page.dart b/lib/pages/mine/mine_page.dart index 0b49ea3..1e2672a 100644 --- a/lib/pages/mine/mine_page.dart +++ b/lib/pages/mine/mine_page.dart @@ -267,19 +267,27 @@ class _MinePageState extends State with AutomaticKeepAliveClientMixin{ ], ), SizedBox(height: 12.w,), - Wrap( - spacing: 8.w, - runSpacing: 8.w, - children: [ - ...controller.blockList.map((e){ - return BlockItem(item: e, showWaring: e["title"] == "认证中心" && (GlobalData().userData?.identityCard == null || GlobalData().userData?.profilePhoto == null), path: e["path"],); - }), - ], + ClipRRect( + borderRadius: BorderRadius.all(Radius.circular(9.w)), + child: Column( + children: [ + ...controller.blockList.map((e){ + return BlockItem(item: e, showWaring: e["title"] == "认证中心" && (GlobalData().userData?.identityCard == null || GlobalData().userData?.profilePhoto == null), path: e["path"],); + }), + ], + ), ), SizedBox(height: 12.w,), - ...controller.settingList.map((e){ - return SettingItem(item: e, path: e["path"],); - }), + ClipRRect( + borderRadius: BorderRadius.all(Radius.circular(9.w)), + child: Column( + children: [ + ...controller.settingList.map((e){ + return SettingItem(item: e, path: e["path"],); + }) + ], + ), + ), ], ), ); @@ -400,54 +408,66 @@ class _BlockItemState extends State { // RouteGuardService.to.toWithAuth(widget.path, null); }, child: Container( - width: 170.w, - height: 38.w, - padding: EdgeInsets.symmetric(horizontal: 7.w), + height: 48.w, + padding: EdgeInsets.only(left: 16.w), decoration: BoxDecoration( - borderRadius: BorderRadius.all(Radius.circular(9.w)), color: Colors.white ), - child: Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - Row( - children: [ - Image.asset( - widget.item["icon"], - width: 21.w, - height: 21.w, - ), - SizedBox(width: 2.w,), - Text( - widget.item["title"], - style: TextStyle( - fontSize: 12.w, - color: Colors.black, + child: Container( + padding: EdgeInsets.only(right: 16.w), + decoration: BoxDecoration( + border: widget.item["title"] != "红娘等级" ? Border( + bottom: BorderSide(width: 1, color: const Color.fromRGBO(238, 238, 238, 1)) + ) : null + ), + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Row( + children: [ + Image.asset( + widget.item["icon"], + height: 22.w, + width: 22.w, ), - ) - ], - ), - Row( - children: [ - if(widget.showWaring) Container( - width: 5.w, - height: 5.w, - margin: EdgeInsets.only(right: 4.w), - decoration: BoxDecoration( - borderRadius: BorderRadius.all(Radius.circular(5.w)), - color: const Color.fromRGBO(255, 87, 51, 1) + SizedBox(width: 16.w,), + Text( + widget.item["title"], + style: TextStyle( + fontSize: 14.w, + color: Colors.black, + fontWeight: FontWeight.w500 + ), + ) + ], + ), + Row( + children: [ + if(widget.showWaring) Container( + width: 5.w, + height: 5.w, + margin: EdgeInsets.only(right: 4.w), + decoration: BoxDecoration( + borderRadius: BorderRadius.all(Radius.circular(5.w)), + color: const Color.fromRGBO(255, 87, 51, 1) + ), ), - ), - Text( - widget.item["subTitle"], - style: TextStyle( - fontSize: 9.w, - color: const Color.fromRGBO(166, 166, 166, 1) + if(widget.item["title"] == "认证中心") Text( + widget.item["subTitle"], + style: TextStyle( + fontSize: 9.w, + color: const Color.fromRGBO(166, 166, 166, 1) + ), ), - ) - ], - ) - ], + SizedBox(width: 10.w,), + Image.asset( + Assets.imagesArrow, + width: 4.w, + ) + ], + ) + ], + ), ), ), ); diff --git a/lib/pages/setting/setting_page.dart b/lib/pages/setting/setting_page.dart index eebd3dc..1998e31 100644 --- a/lib/pages/setting/setting_page.dart +++ b/lib/pages/setting/setting_page.dart @@ -1,3 +1,7 @@ +import 'package:dating_touchme_app/controller/discover/discover_controller.dart'; +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:flutter/material.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart'; @@ -27,13 +31,6 @@ class SettingPage extends StatelessWidget { TDCellGroup( theme: TDCellGroupTheme.cardTheme, cells: [ - TDCell( - arrow: false, - title: '允许中间邀请弹窗', - rightIconWidget: TDSwitch(isOn: false,trackOnColor: const Color.fromRGBO(117, 98, 249, 1),onChanged: (bool e) { - return false; - }) - ), TDCell( arrow: false, title: '后台播放', @@ -59,12 +56,11 @@ class SettingPage extends StatelessWidget { TDCellGroup( theme: TDCellGroupTheme.cardTheme, cells: [ - TDCell(arrow: true, title: '安全中心', onClick: (cell) { - print('安全中心'); - }), TDCell(arrow: true, title: '黑名单', onClick: (cell) { Get.to(() => BlacklistPage()); }), + TDCell(arrow: true, title: '隐私设置'), + TDCell(arrow: true, title: '青少年模式'), ], ), const SizedBox(height: 12), @@ -83,62 +79,113 @@ class SettingPage extends StatelessWidget { ) ], ), - const SizedBox(height: 64), - TDButton( - text: '退出登录', - width: MediaQuery.of(context).size.width - 40, - size: TDButtonSize.large, - type: TDButtonType.fill, - shape: TDButtonShape.round, - theme: TDButtonTheme.danger, - onTap: () { - 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()); - }, - ), - ], - ), - ) - ); - }, - ); - }, + const SizedBox(height: 12), + TDCellGroup( + theme: TDCellGroupTheme.cardTheme, + cells: [ + TDCell(arrow: true, title: '退出登录', 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()); + }, + ), + ], + ), + ) + ); + }, + ); + },), + + TDCell(arrow: true, title: '退出登录', titleWidget: Text( + "账号注销", + style: TextStyle( + color: const Color.fromRGBO(248, 85, 66, 1), + fontSize: TDTheme.of(context).fontBodyLarge?.size ?? 16, + height: TDTheme.of(context).fontBodyLarge?.height ?? 24, + 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()); + }, + ), + ], + ), + ) + ); + }, + ); + },), + ], ), - const SizedBox(height: 24), ], ); }),