diff --git a/lib/components/page_appbar.dart b/lib/components/page_appbar.dart index 9ebd4ad..6f7bcab 100644 --- a/lib/components/page_appbar.dart +++ b/lib/components/page_appbar.dart @@ -1,14 +1,16 @@ import 'package:flutter/material.dart'; -import 'package:flutter_screenutil/flutter_screenutil.dart'; +import 'package:get/get.dart'; +import 'package:tdesign_flutter/tdesign_flutter.dart'; class PageAppbar extends StatelessWidget implements PreferredSizeWidget { final Color? backgroundColor; final Color? color; + final Color? iconColor; final bool? bottom; final String title; final Widget? right; - const PageAppbar({super.key, required this.title, this.backgroundColor, this.color, this.right, this.bottom}); + const PageAppbar({super.key, required this.title, this.iconColor,this.backgroundColor, this.color, this.right, this.bottom}); @override Widget build(BuildContext context) { @@ -18,6 +20,10 @@ class PageAppbar extends StatelessWidget implements PreferredSizeWidget { centerTitle: true, foregroundColor: color, actions: right != null ? [right ?? Container()] : null, + leading: IconButton( + icon: Icon( TDIcons.chevron_left, size: 30, color: iconColor ?? Colors.black), + onPressed: () => Get.back(), + ), title: Text( title, style: TextStyle( diff --git a/lib/controller/discover/room_controller.dart b/lib/controller/discover/room_controller.dart index 717db64..c5d184e 100644 --- a/lib/controller/discover/room_controller.dart +++ b/lib/controller/discover/room_controller.dart @@ -8,6 +8,7 @@ import 'package:dating_touchme_app/model/rtc/link_mic_card_model.dart'; import 'package:dating_touchme_app/model/rtc/rtc_channel_data.dart'; import 'package:dating_touchme_app/model/rtc/rtc_channel_detail.dart'; import 'package:dating_touchme_app/network/network_service.dart'; +import 'package:dating_touchme_app/pages/mine/edit_info_page.dart'; import 'package:dating_touchme_app/rtc/rtc_manager.dart'; import 'package:dating_touchme_app/rtc/rtm_manager.dart'; import 'package:dating_touchme_app/service/live_chat_message_service.dart'; @@ -749,14 +750,30 @@ class RoomController extends GetxController with WidgetsBindingObserver { } void registerMatch() async { - if (GlobalData().userData!.identityCard != null && - GlobalData().userData!.identityCard!.isNotEmpty) { - await Get.to(() => MatchSpreadPage()); - } else { + if (GlobalData().userData!.auditProfilePhoto != null) { + showGeneralDialog( + context: Get.context!, + pageBuilder: (BuildContext buildContext, Animation animation, + Animation secondaryAnimation) { + return TDConfirmDialog( + title: '温馨提示', + content: '当前头像正在审核中,请稍候,如果长时间没有审核结果,请联系客服。', + ); + }, + ); + return; + } + if (GlobalData().userData!.profilePhoto == null || GlobalData().userData!.profilePhoto!.isEmpty) { + SmartDialog.showToast('请先上传头像'); + await Get.to(() => EditInfoPage()); + return; + } + if(GlobalData().userData!.identityCard == null || GlobalData().userData!.identityCard!.isEmpty){ SmartDialog.showToast('请先进行实名认证'); await Get.to(() => RealNamePage(type: 1)); + return; } - print(455); + await Get.to(() => MatchSpreadPage()); matchmakerFlag.value = GlobalData().userData!.matchmakerFlag!; } diff --git a/lib/controller/mine/mine_controller.dart b/lib/controller/mine/mine_controller.dart index 8d41e7e..381607c 100644 --- a/lib/controller/mine/mine_controller.dart +++ b/lib/controller/mine/mine_controller.dart @@ -3,34 +3,21 @@ import 'package:dating_touchme_app/generated/assets.dart'; import 'package:dating_touchme_app/model/mine/user_count_data.dart'; import 'package:dating_touchme_app/network/user_api.dart'; import 'package:dating_touchme_app/pages/mine/auth_center_page.dart'; +import 'package:dating_touchme_app/pages/mine/edit_info_page.dart'; import 'package:dating_touchme_app/pages/mine/my_wallet_page.dart'; import 'package:dating_touchme_app/pages/mine/real_name_page.dart'; import 'package:dating_touchme_app/pages/mine/rose_page.dart'; import 'package:dating_touchme_app/pages/mine/user_help_center_page.dart'; import 'package:dating_touchme_app/pages/setting/match_spread_page.dart'; +import 'package:flutter/material.dart'; import 'package:flutter_smart_dialog/flutter_smart_dialog.dart'; import 'package:get/get.dart'; +import 'package:tdesign_flutter/tdesign_flutter.dart'; import '../../pages/setting/setting_page.dart'; class MineController extends GetxController { - - - final blockList = [ - {"icon": Assets.imagesRose, "title": "我的玫瑰", "subTitle": "新人限时福利", "path": () => RosePage()}, - {"icon": Assets.imagesWallet, "title": "我的钱包", "subTitle": "提现无门槛", "path": () => MyWalletPage()}, - // {"icon": Assets.imagesShop, "title": "商城中心", "subTitle": "不定期更新商品", "path": () => null}, - {"icon": Assets.imagesCert, "title": "认证中心", "subTitle": GlobalData().userData?.identityCard == null || GlobalData().userData?.profilePhoto == null ? "未认证" : "已认证", "path": () => AuthCenterPage()}, - {"icon": Assets.imagesMatchmaker, "title": "红娘等级", "subTitle": "实习红娘", "path": 'MatchSpreadPage'}, - ].obs; - - final settingList = [ - {"icon": Assets.imagesSetting, "title": "设置", "path": () => SettingPage()}, - {"icon": Assets.imagesCustomer, "title": "联系客服", "path": () => null}, - {"icon": Assets.imagesMail, "title": "意见反馈", "path": () => UserHelpCenterPage()}, - ].obs; - final userData = GlobalData().userData.obs; final userId = GlobalData().userId.obs; @@ -38,8 +25,6 @@ class MineController extends GetxController { late UserApi _userApi; - - @override void onInit() { super.onInit(); @@ -49,13 +34,30 @@ class MineController extends GetxController { } void registerMatch() async { - if (GlobalData().userData!.identityCard != null && - GlobalData().userData!.identityCard!.isNotEmpty) { - await Get.to(() => MatchSpreadPage()); - } else { + if (GlobalData().userData!.auditProfilePhoto != null) { + showGeneralDialog( + context: Get.context!, + pageBuilder: (BuildContext buildContext, Animation animation, + Animation secondaryAnimation) { + return TDConfirmDialog( + title: '温馨提示', + content: '当前头像正在审核中,请稍候,如果长时间没有审核结果,请联系客服。', + ); + }, + ); + return; + } + if (GlobalData().userData!.profilePhoto == null || GlobalData().userData!.profilePhoto!.isEmpty) { + SmartDialog.showToast('请先上传头像'); + await Get.to(() => EditInfoPage()); + return; + } + if(GlobalData().userData!.identityCard == null || GlobalData().userData!.identityCard!.isEmpty){ SmartDialog.showToast('请先进行实名认证'); await Get.to(() => RealNamePage(type: 1)); + return; } + await Get.to(() => MatchSpreadPage()); } } \ No newline at end of file diff --git a/lib/pages/discover/visitor_list_page.dart b/lib/pages/discover/visitor_list_page.dart index c8f04e6..71ac742 100644 --- a/lib/pages/discover/visitor_list_page.dart +++ b/lib/pages/discover/visitor_list_page.dart @@ -5,6 +5,7 @@ import 'package:easy_refresh/easy_refresh.dart'; import 'package:flutter/material.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:get/get.dart'; +import 'package:tdesign_flutter/tdesign_flutter.dart'; import '../../controller/discover/visitor_controller.dart'; import '../../controller/global.dart'; @@ -28,6 +29,10 @@ class _VisitorListPagePageState extends State { return Scaffold( backgroundColor: Color(0xffF5F5F5), appBar: AppBar( + leading: IconButton( + icon: Icon(TDIcons.chevron_left, size: 30, color: Colors.black), + onPressed: () => Get.back(), + ), title: Obx(() => Text( '最近访客 (${visitorController.total.value})', style: TextStyle(fontSize: 16, fontWeight: FontWeight.bold), diff --git a/lib/pages/mine/mine_page.dart b/lib/pages/mine/mine_page.dart index b8d0355..c7f6018 100644 --- a/lib/pages/mine/mine_page.dart +++ b/lib/pages/mine/mine_page.dart @@ -276,16 +276,6 @@ class _MinePageState extends State with AutomaticKeepAliveClientMixin{ ], ), SizedBox(height: 12.w,), - // 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"],); - // }), - // ], - // ), - // ), TDCellGroup( theme: TDCellGroupTheme.cardTheme, @@ -392,16 +382,6 @@ class _MinePageState extends State with AutomaticKeepAliveClientMixin{ ), ], ), - // ClipRRect( - // borderRadius: BorderRadius.all(Radius.circular(9.w)), - // child: Column( - // children: [ - // ...controller.settingList.map((e){ - // return SettingItem(item: e, path: e["path"],); - // }) - // ], - // ), - // ), ], ), ); diff --git a/lib/pages/setting/match_spread_page.dart b/lib/pages/setting/match_spread_page.dart index 34c846f..6b3713e 100644 --- a/lib/pages/setting/match_spread_page.dart +++ b/lib/pages/setting/match_spread_page.dart @@ -33,7 +33,7 @@ class MatchSpreadPage extends StatelessWidget { ), child: controller.roseList.isNotEmpty ? Scaffold( backgroundColor: Colors.transparent, - appBar: PageAppbar(title: "入驻加盟", backgroundColor: Colors.transparent, color: Colors.white), + appBar: PageAppbar(title: "入驻加盟", backgroundColor: Colors.transparent, color: Colors.white, iconColor: Colors.white), body: SingleChildScrollView( child: Container( decoration: BoxDecoration(