|
|
|
@ -1,10 +1,12 @@ |
|
|
|
import 'dart:async'; |
|
|
|
import 'package:get/get.dart'; |
|
|
|
import 'package:flutter_smart_dialog/flutter_smart_dialog.dart'; |
|
|
|
import 'package:get_storage/get_storage.dart'; |
|
|
|
import '../../generated/assets.dart'; |
|
|
|
import '../../network/user_api.dart'; |
|
|
|
import '../../pages/setting/match_league_page.dart'; |
|
|
|
import '../../pages/setting/match_spread_page.dart'; |
|
|
|
import '../discover/room_controller.dart'; |
|
|
|
import '../global.dart'; |
|
|
|
|
|
|
|
class AuthController extends GetxController { |
|
|
|
@ -112,6 +114,13 @@ class AuthController extends GetxController { |
|
|
|
GlobalData().userData!.identityCard = idcard.value; |
|
|
|
GlobalData().userData!.name = name.value; |
|
|
|
SmartDialog.showToast('认证成功'); |
|
|
|
getInfo(); |
|
|
|
final RoomController _roomController; |
|
|
|
_roomController = Get.isRegistered<RoomController>() |
|
|
|
? Get.find<RoomController>() |
|
|
|
: Get.put(RoomController()); |
|
|
|
|
|
|
|
_roomController.matchmakerFlag.value = GlobalData().userData!.matchmakerFlag!; |
|
|
|
if(type == 1){ |
|
|
|
// 进入认证成功之后的下一个页面; |
|
|
|
Get.off(() => MatchSpreadPage()); |
|
|
|
@ -122,12 +131,30 @@ class AuthController extends GetxController { |
|
|
|
SmartDialog.showToast(response.data.message); |
|
|
|
} |
|
|
|
} catch (e) { |
|
|
|
SmartDialog.showToast('网络请求失败,请检查网络连接'); |
|
|
|
// SmartDialog.showToast('网络请求失败,请检查网络连接'); |
|
|
|
// SmartDialog.showToast(response.data.message); |
|
|
|
} finally { |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
getInfo() async { |
|
|
|
final result = await _userApi.getMarriageInformationDetail(); |
|
|
|
// print(result.data); |
|
|
|
if (result.data.isSuccess) { |
|
|
|
final information = result.data.data!; |
|
|
|
information.matchmakerFlag = GlobalData().userData?.matchmakerFlag ?? false; |
|
|
|
information.realName = GlobalData().userData?.realName; |
|
|
|
information.phone = GlobalData().userData?.phone; |
|
|
|
GlobalData().userData = information; |
|
|
|
|
|
|
|
await GetStorage().write('userId', GlobalData().userId); |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
class AuthCard { |
|
|
|
|