|
|
|
@ -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 = <Map>[ |
|
|
|
{"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 = <Map>[ |
|
|
|
{"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<double> animation, |
|
|
|
Animation<double> 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()); |
|
|
|
} |
|
|
|
|
|
|
|
} |