完善用户信息的页面的 补全

This commit is contained in:
fengshuo
2021-09-15 18:41:40 +08:00
parent 3b843a1f2c
commit 1ab86a751b
25 changed files with 377 additions and 126 deletions

View File

@@ -0,0 +1,16 @@
//
// LoginBindPhonePresent.h
// xplan-ios
//
// Created by 冯硕 on 2021/9/15.
//
#import "BaseMvpPresenter.h"
NS_ASSUME_NONNULL_BEGIN
@interface LoginBindPhonePresent : BaseMvpPresenter
- (void)logout;
@end
NS_ASSUME_NONNULL_END

View File

@@ -0,0 +1,22 @@
//
// LoginBindPhonePresent.m
// xplan-ios
//
// Created by on 2021/9/15.
//
#import "LoginBindPhonePresent.h"
#import "BaseMvpProtocol.h"
@implementation LoginBindPhonePresent
- (id<BaseMvpProtocol>)getView {
return ((id<BaseMvpProtocol>) [super getView]);
}
- (void)logout {
[[self getView] tokenInvalid];
}
@end

View File

@@ -6,8 +6,6 @@
//
#import "LoginForgetPasswordPresent.h"
///
#import <ReactiveObjC/ReactiveObjC.h>
///Tool
#import "AccountInfoStorage.h"
#import "DESEncrypt.h"
@@ -31,8 +29,6 @@
- (void)phoneSmsCode:(NSString *)phone type:(int)type {
[Api phoneSmsCode:[self createHttpCompletion:^(id _Nonnull data) {
[[self getView] phoneSmsCodeSuccess];
///60
[self openCutDownWithTotal:60];
} fail:^(NSInteger code, NSString * _Nullable msg) {
}] mobile:phone type:[NSString stringWithFormat:@"%d", type]];
@@ -52,20 +48,4 @@
} showLoading:YES] phone:phone newPwd:desPassword smsCode:smsCode];
}
///
/// @param total
- (void)openCutDownWithTotal:(int)total {
__block int blockTotle = total;
__block RACDisposable * disposable;
disposable = [[RACSignal interval:1 onScheduler:[RACScheduler mainThreadScheduler]] subscribeNext:^(NSDate * _Nullable x) {
blockTotle--;
[[self getView] countDownWithCurrent:blockTotle];
///
if (blockTotle == 0) {
[[self getView] countDownFinish];
[disposable dispose];
}
}];
}
@end

View File

@@ -8,9 +8,12 @@
#import "BaseMvpPresenter.h"
NS_ASSUME_NONNULL_BEGIN
@class ThirdUserInfo;
@interface LoginFullInfoPresenter : BaseMvpPresenter
/// 获取保存的第三方的数据模型
+ (ThirdUserInfo * __nullable)getThirdUserInfo;
/// 随机获取昵称
- (void)randomRequestNick;
@@ -25,10 +28,10 @@ NS_ASSUME_NONNULL_BEGIN
- (void)complectionInfoWithAvatar:(NSString *)avatar
gender:(NSString *)gender
nick:(NSString *)nick
inviteCode:(NSString *)inviteCode
roomUid:(NSString *)roomUid
shareUid:(NSString *)shareUid
shareChannel:(NSString *)shareChannel;
inviteCode:(NSString * __nullable)inviteCode
roomUid:(NSString * __nullable)roomUid
shareUid:(NSString * __nullable)shareUid
shareChannel:(NSString * __nullable)shareChannel;
@end

View File

@@ -11,6 +11,8 @@
#import "LoginFullInfoProtocol.h"
///Tool
#import "AccountInfoStorage.h"
///Model
#import "ThirdUserInfo.h"
@implementation LoginFullInfoPresenter
@@ -19,6 +21,14 @@
}
///
+ (ThirdUserInfo * __nullable)getThirdUserInfo {
if ([AccountInfoStorage instance].thirdUserInfo) {
return [AccountInfoStorage instance].thirdUserInfo;
}
return nil;
}
///
- (void)randomRequestNick {
[Api randomNickWithComplection:[self createHttpCompletion:^(BaseModel * _Nonnull data) {
@@ -40,10 +50,10 @@
- (void)complectionInfoWithAvatar:(NSString *)avatar
gender:(NSString *)gender
nick:(NSString *)nick
inviteCode:(NSString *)inviteCode
roomUid:(NSString *)roomUid
shareUid:(NSString *)shareUid
shareChannel:(NSString *)shareChannel {
inviteCode:(NSString * __nullable)inviteCode
roomUid:(NSString * __nullable)roomUid
shareUid:(NSString * __nullable)shareUid
shareChannel:(NSString * __nullable)shareChannel {
NSString * uid = [[AccountInfoStorage instance] getUid];
NSString * ticket = [[AccountInfoStorage instance] getTicket];
if (inviteCode.length <= 0) {

View File

@@ -81,6 +81,8 @@
if (unionid == nil) {
unionid = @"";
}
///
[AccountInfoStorage instance].thirdUserInfo = userInfo;
[Api loginWithThirdPart:[self createHttpCompletion:^(BaseModel * _Nonnull data) {
[[self getBaseVC] hideHUD];

View File

@@ -24,9 +24,6 @@ NS_ASSUME_NONNULL_BEGIN
/// @param phone 手机号
/// @param code 验证码
- (void)bindWithPhone:(NSString *)phone code:(NSString *)code;
/// 开启一个倒计时
/// @param total 倒计时的时间
- (void)openCutDownWithTotal:(int)total;
@end
NS_ASSUME_NONNULL_END

View File

@@ -31,8 +31,6 @@
- (void)phoneSmsCode:(NSString *)phone type:(int)type {
[Api phoneSmsCode:[self createHttpCompletion:^(id _Nonnull data) {
[[self getView] phoneSmsCodeSuccess];
///60
[self openCutDownWithTotal:60];
} fail:^(NSInteger code, NSString * _Nullable msg) {
}] mobile:phone type:[NSString stringWithFormat:@"%d", type]];
@@ -66,23 +64,4 @@
} showLoading:YES] phone:phone code:code uid:uid ticket:ticket];
}
///
/// @param total
- (void)openCutDownWithTotal:(int)total {
__block int blockTotle = total;
__block RACDisposable * disposable;
disposable = [[RACSignal interval:1 onScheduler:[RACScheduler mainThreadScheduler]] subscribeNext:^(NSDate * _Nullable x) {
blockTotle--;
[[self getView] countDownWithCurrent:blockTotle];
///
if (blockTotle == 0) {
[[self getView] countDownFinish];
[disposable dispose];
}
}];
}
@end

View File

@@ -12,10 +12,6 @@ NS_ASSUME_NONNULL_BEGIN
@protocol LoginForgetPasswordProtocol <NSObject>
///请求手机号的验证码成功
- (void)phoneSmsCodeSuccess;
///倒计时进行中
- (void)countDownWithCurrent:(int)current;
///倒计时结束
- (void)countDownFinish;
///重置密码成功
- (void)resetPasswrodSuccess;
@end

View File

@@ -12,10 +12,6 @@ NS_ASSUME_NONNULL_BEGIN
@protocol LoginVerifCodeProtocol <NSObject>
///请求手机号的验证码成功
- (void)phoneSmsCodeSuccess;
///倒计时进行中
- (void)countDownWithCurrent:(int)current;
///倒计时结束
- (void)countDownFinish;
///登录成功
- (void)loginSuccess;
///绑定手机号成功

View File

@@ -13,8 +13,9 @@
#import "XPMacro.h"
#import "ThemeColor.h"
#import "NSString+Regex.h"
#import "UIButton+EnlargeTouchArea.h"
///Tool
#import "BaseMvpPresenter.h"
#import "LoginBindPhonePresent.h"
///VC
#import "LoginVerifCodeViewController.h"
@@ -38,8 +39,8 @@
return YES;
}
#pragma mark - life cycle
- (BaseMvpPresenter *)createPresenter {
return [[BaseMvpPresenter alloc] init];
- (LoginBindPhonePresent *)createPresenter {
return [[LoginBindPhonePresent alloc] init];
}
- (void)viewDidLoad {
@@ -63,7 +64,7 @@
- (void)viewDidLayoutSubviews {
[super viewDidLayoutSubviews];
[self.titleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
make.centerX.mas_equalTo(self.view);
make.top.mas_equalTo(self.view).offset(150);
@@ -146,8 +147,10 @@
[[self.backButton rac_signalForControlEvents:UIControlEventTouchUpInside] subscribeNext:^(__kindof UIControl * _Nullable x) {
@strongify(self)
///退
#warning to do 退
[self.navigationController dismissViewControllerAnimated:YES completion:nil];
[self dismissViewControllerAnimated:NO completion:^{
// [self.presenter logout];
#warning to do 退
}];
}];
}
@@ -211,6 +214,7 @@
_backButton = [UIButton buttonWithType:UIButtonTypeCustom];
[_backButton setImage:[UIImage imageNamed:@"common_nav_back"] forState:UIControlStateNormal];
[_backButton setImage:[UIImage imageNamed:@"common_nav_back"] forState:UIControlStateSelected];
[_backButton setEnlargeEdgeWithTop:15 right:15 bottom:15 left:15];
}
return _backButton;
}

View File

@@ -11,6 +11,7 @@
#import <ReactiveObjC/ReactiveObjC.h>
///Tool
#import "ThemeColor.h"
#import "CountDownHelper.h"
#import "UIImage+Utils.h"
///Presenter
#import "LoginForgetPasswordPresent.h"
@@ -19,7 +20,7 @@
#import "LoginForgetEditView.h"
@interface LoginForgetPasswordViewController ()<LoginForgetPasswordProtocol>
@interface LoginForgetPasswordViewController ()<LoginForgetPasswordProtocol, CountDownHelperDelegate>
///
@property (nonatomic,strong) UIStackView *stackView;
///
@@ -50,9 +51,15 @@
[self.view endEditing:NO];
}
- (void)viewDidDisappear:(BOOL)animated {
[super viewDidDisappear:animated];
[[CountDownHelper shareHelper] stopCountDown];
}
#pragma mark - Private Method
- (void)initSubViews {
self.title = @"忘记密码";
[CountDownHelper shareHelper].delegate = self;
[self.view addSubview:self.stackView];
[self.view addSubview:self.finishButton];
@@ -113,23 +120,25 @@
- (void)phoneSmsCodeSuccess {
self.codeView.authCodeButton.enabled= NO;
[self showSuccessToast:@"验证码发送成功"];
}
///
- (void)countDownWithCurrent:(int)current {
[self.codeView.authCodeButton setTitle:[NSString stringWithFormat:@"%ds后重试", current] forState:UIControlStateDisabled];
}
///
- (void)countDownFinish {
self.codeView.authCodeButton.enabled= YES;
[self.codeView.authCodeButton setTitle:@"重新发送" forState:UIControlStateNormal];
[[CountDownHelper shareHelper] openCountdownWithTime:60];
}
///
- (void)resetPasswrodSuccess {
[self showSuccessToast:@"重置密码成功"];
[[CountDownHelper shareHelper] stopCountDown];
[self showSuccessToast:@"重置密码成功"];
[self.navigationController popViewControllerAnimated:YES];
}
#pragma mark - CountDownHelperDelegate
///
- (void)onCountdownOpen:(int)time {
[self.codeView.authCodeButton setTitle:[NSString stringWithFormat:@"%ds后重试", time] forState:UIControlStateDisabled];
}
///
- (void)onCountdownFinish {
self.codeView.authCodeButton.enabled= YES;
[self.codeView.authCodeButton setTitle:@"重新发送" forState:UIControlStateNormal];
}
#pragma mark - Getters And Setters
- (UIButton *)finishButton{
if (!_finishButton) {

View File

@@ -14,6 +14,8 @@
#import "ThemeColor.h"
#import "UIImage+Utils.h"
#import "UIButton+EnlargeTouchArea.h"
///Model
#import "ThirdUserInfo.h"
///P
#import "LoginFullInfoPresenter.h"
#import "LoginFullInfoProtocol.h"
@@ -41,6 +43,10 @@
@property (nonatomic,strong) UIButton *femaleButton;
///
@property (nonatomic,strong) UIButton *nextButton;
///
@property (nonatomic,strong) ThirdUserInfo *thirdInfo;
///
@property (nonatomic,copy) NSString *sexString;
@end
@implementation LoginFullInfoViewController
@@ -56,6 +62,10 @@
[self initEvents];
}
- (void)touchesBegan:(NSSet<UITouch *> *)touches withEvent:(UIEvent *)event {
[self.view endEditing:YES];
}
#pragma mark - Private Method
- (void)initSubViews {
[self.view addSubview:self.titleLabel];
@@ -70,6 +80,12 @@
[self.sexStackView addArrangedSubview:self.maleButton];
[self.sexStackView addArrangedSubview:self.femaleButton];
if ([self.presenter getThirdUserInfo]) {
self.textField.text = [self.presenter getThirdUserInfo].userName;
} else {
[self.presenter randomRequestNick];
}
}
- (void)initSubViewConstraints {
@@ -93,7 +109,7 @@
make.left.right.mas_equalTo(self.backView).inset(25);
make.top.bottom.mas_equalTo(self.backView);
}];
[self.sexStackView mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.mas_equalTo(self.backView);
@@ -113,12 +129,15 @@
@strongify(self);
self.femaleButton.selected = NO;
x.selected = YES;
self.sexString = @"1";
}];
[[self.femaleButton rac_signalForControlEvents:UIControlEventTouchUpInside] subscribeNext:^(__kindof UIControl * _Nullable x) {
@strongify(self);
x.selected = YES;
self.maleButton.selected = NO;
self.sexString = @"2";
}];
@@ -135,9 +154,45 @@
}];
[[self.nextButton rac_signalForControlEvents:UIControlEventTouchUpInside]subscribeNext:^(__kindof UIControl * _Nullable x) {
#warning to do
@strongify(self);
[self updateUserInfo];
}];
[[self.textField.rac_textSignal map:^id _Nullable(NSString * _Nullable value) {
if (value.length > 15) {
value = [value substringToIndex:15];
}
return value;
}] subscribeNext:^(id _Nullable x) {
@strongify(self);
self.textField.text = x;
[self updateNextButton];
}];
}
///
- (void)updateUserInfo {
[self.presenter complectionInfoWithAvatar:[self getAvatarUrl] gender:self.maleButton.selected ? @"1":@"2" nick:self.textField.text inviteCode:nil roomUid:nil shareUid:nil shareChannel:nil];
}
///
- (NSString *)getAvatarUrl {
NSString * avatar;
if ([self.presenter getThirdUserInfo] && [self.presenter getThirdUserInfo].avatarUrl.length > 0) {
avatar = [self.presenter getThirdUserInfo].avatarUrl;
} else {
avatar = @"https://image.lecheng163.com/yinyou_default_avatar.png";
}
return avatar;
}
- (void)updateNextButton {
if (self.textField.text.length > 0 && self.sexString.length > 0) {
self.nextButton.enabled = YES;
} else {
self.nextButton.enabled = NO;
}
}
#pragma mark - LoginFullInfoProtocol
@@ -146,10 +201,20 @@
}
- (void)complementInfoSuccess {
UIViewController *vc = self.presentingViewController;
while (vc.presentingViewController) {
vc = vc.presentingViewController;
}
[vc dismissViewControllerAnimated:YES completion:^{
}];
}
#pragma mark - Getters And Setters
- (void)setSexString:(NSString *)sexString {
_sexString = sexString;
[self updateNextButton];
}
- (UILabel *)titleLabel {
if (!_titleLabel) {
_titleLabel = [[UILabel alloc] init];
@@ -198,6 +263,7 @@
_nameLabel.text = @"昵称";
_nameLabel.font = [UIFont systemFontOfSize:15];
_nameLabel.textColor = [ThemeColor secondTextColor];
[_nameLabel setContentCompressionResistancePriority:UILayoutPriorityRequired forAxis:UILayoutConstraintAxisHorizontal];
[_nameLabel setContentHuggingPriority:UILayoutPriorityRequired forAxis:UILayoutConstraintAxisHorizontal];
}
@@ -210,7 +276,6 @@
_textField.textColor = [ThemeColor mainTextColor];
_textField.font = [UIFont fontWithName:@"PingFang-SC-Medium" size:15.f];
_textField.borderStyle = UITextBorderStyleNone;
_textField.keyboardType = UIKeyboardTypeNumberPad;
_textField.tintColor = [ThemeColor appMainColor];
_textField.textAlignment = NSTextAlignmentRight;
_textField.backgroundColor = [UIColor clearColor];
@@ -223,7 +288,9 @@
_refreshButton = [UIButton buttonWithType:UIButtonTypeCustom];
[_refreshButton setImage:[UIImage imageNamed:@"login_full_info_refresh"] forState:UIControlStateNormal];
[_refreshButton setImage:[UIImage imageNamed:@"login_full_info_refresh"] forState:UIControlStateSelected];
[_refreshButton setEnlargeEdgeWithTop:0 right:0 bottom:0 left:25];
[_refreshButton setEnlargeEdgeWithTop:0 right:0 bottom:0 left:10];
[_refreshButton setContentHuggingPriority:UILayoutPriorityRequired forAxis:UILayoutConstraintAxisHorizontal];
[_refreshButton setContentCompressionResistancePriority:UILayoutPriorityRequired forAxis:UILayoutConstraintAxisHorizontal];
}
return _refreshButton;
}

View File

@@ -127,10 +127,18 @@
}];
}
- (void)disMissVC {
UIViewController *vc = self.presentingViewController;
while (vc.presentingViewController) {
vc = vc.presentingViewController;
}
[vc dismissViewControllerAnimated:YES completion:nil];
[self.navigationController popToRootViewControllerAnimated:NO];
}
#pragma mark - LoginPasswordProtocol
- (void)phoneAndPasswordLoginSuccess {
[self showSuccessToast:@"登录成功"];
[self.navigationController popToRootViewControllerAnimated:YES];
[self disMissVC];
}
#pragma mark - Getters And Setters

View File

@@ -11,6 +11,7 @@
#import <ReactiveObjC/ReactiveObjC.h>
///Tool
#import "ThemeColor.h"
#import "CountDownHelper.h"
///Presenter
#import "LoginVerifCodePresent.h"
///Protocole
@@ -18,7 +19,7 @@
///View
#import "LoginVerifCodeView.h"
@interface LoginVerifCodeViewController ()<LoginVerifCodeProtocol>
@interface LoginVerifCodeViewController ()<LoginVerifCodeProtocol, CountDownHelperDelegate>
///
@property (nonatomic,strong) UIStackView *titleStackView;
///
@@ -36,7 +37,6 @@
@end
@implementation LoginVerifCodeViewController
- (LoginVerifCodePresent *)createPresenter {
return [[LoginVerifCodePresent alloc] init];
}
@@ -53,8 +53,14 @@
[self.view endEditing:NO];
}
- (void)viewDidDisappear:(BOOL)animated {
[super viewDidDisappear:animated];
[[CountDownHelper shareHelper] stopCountDown];
}
#pragma mark - Private Method
- (void)initSubViews {
[CountDownHelper shareHelper].delegate = self;
[self.view addSubview:self.titleStackView];
[self.view addSubview:self.codeView];
[self.view addSubview:self.retryStackView];
@@ -114,35 +120,46 @@
return attribute;
}
- (void)disMissVC {
[[CountDownHelper shareHelper] stopCountDown];
UIViewController *vc = self.presentingViewController;
while (vc.presentingViewController) {
vc = vc.presentingViewController;
}
[vc dismissViewControllerAnimated:YES completion:nil];
[self.navigationController popToRootViewControllerAnimated:NO];
}
#pragma mark - LoginVerifCodeProtocol
- (void)loginSuccess {
[self showSuccessToast:@"登录成功"];
[self disMissVC];
}
///
- (void)bindPhoneSuccess {
[self disMissVC];
}
#pragma mark - LoginProtocol
- (void)phoneSmsCodeSuccess {
self.codeSendLabel.hidden = NO;
self.codeSendLabel.text = [NSString stringWithFormat:@"验证码已发送至:%@", self.phone];
[[CountDownHelper shareHelper] openCountdownWithTime:60];
}
- (void)countDownFinish {
#pragma mark - CountDownHelperDelegate
- (void)onCountdownFinish {
self.retryCodeButton.hidden = NO;
self.cutdownLabel.hidden = YES;
self.codeSendLabel.hidden = YES;
}
- (void)countDownWithCurrent:(int)current {
self.cutdownLabel.attributedText = [self createRetrySendCodeWithTime:current];
- (void)onCountdownOpen:(int)time {
self.cutdownLabel.attributedText = [self createRetrySendCodeWithTime:time];
self.retryCodeButton.hidden = YES;
self.cutdownLabel.hidden = NO;
}
- (void)loginSuccess {
[self showSuccessToast:@"登录成功"];
[self.navigationController popToRootViewControllerAnimated:YES];
}
///
- (void)bindPhoneSuccess {
[self.navigationController popToRootViewControllerAnimated:NO];
[self.navigationController dismissViewControllerAnimated:YES completion:nil];
}
#pragma mark - Getters And Setters
- (UIStackView *)titleStackView {
if (!_titleStackView) {

View File

@@ -66,7 +66,6 @@ typedef NS_ENUM(NSUInteger, XYLoginType) {
@end
@implementation LoginViewController
- (LoginPresenter *)createPresenter {
return [[LoginPresenter alloc] init];
}
@@ -77,14 +76,8 @@ typedef NS_ENUM(NSUInteger, XYLoginType) {
[self setEvents];
}
- (void)viewWillAppear:(BOOL)animated {
[super viewWillAppear:animated];
[self hideNavigationBar];
}
- (void)viewWillDisappear:(BOOL)animated {
[super viewWillDisappear:animated];
[self showNavigationBar];
- (BOOL)isHiddenNavBar {
return YES;
}
- (void)initView {
@@ -109,7 +102,6 @@ typedef NS_ENUM(NSUInteger, XYLoginType) {
}
- (void)setUpConstraints {
[self.appIcon mas_makeConstraints:^(MASConstraintMaker *make) {
make.top.mas_equalTo(110 + kSafeAreaTopHeight);
@@ -196,6 +188,7 @@ typedef NS_ENUM(NSUInteger, XYLoginType) {
[self.appleButton addGestureRecognizer:appleTap];
[[self.agreeButton rac_signalForControlEvents:UIControlEventTouchUpInside] subscribeNext:^(__kindof UIControl * _Nullable x) {
@strongify(self)
self.agreeButton.selected = !self.agreeButton.selected;
if (self.agreeButton.isSelected) {
NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
@@ -209,7 +202,7 @@ typedef NS_ENUM(NSUInteger, XYLoginType) {
//
[[self.loginButton rac_signalForControlEvents:UIControlEventTouchUpInside] subscribeNext:^(__kindof UIControl * _Nullable x) {
@strongify(self)
@strongify(self)
if (self.agreeButton.isSelected) {
[self phoneQuickLogin];
} else {
@@ -367,7 +360,7 @@ typedef NS_ENUM(NSUInteger, XYLoginType) {
}
#pragma mark - LoginProtocol
- (void)loginSuccess {
[self.navigationController popToRootViewControllerAnimated:YES];
[self dismissViewControllerAnimated:YES completion:nil];
[self showSuccessToast:@"登录成功"];
}
@@ -440,9 +433,9 @@ typedef NS_ENUM(NSUInteger, XYLoginType) {
attString.yy_color = [ThemeColor mainTextColor];
NSString *userString = @"《用户服务协议》";
NSMutableAttributedString *userAttString = [[NSMutableAttributedString alloc] initWithString:userString attributes:@{NSForegroundColorAttributeName:[ThemeColor appMainColor]}];
@weakify(self)
// @weakify(self)
[userAttString yy_setTextHighlightRange:NSMakeRange(0, userAttString.length) color:nil backgroundColor:nil userInfo:nil tapAction:^(UIView * _Nonnull containerView, NSAttributedString * _Nonnull text, NSRange range, CGRect rect) {
@strongify(self);
// @strongify(self);
//
// [self goToWebview:HtmlUrlKey(kUserProtocalURL)];
} longPressAction:nil];
@@ -452,7 +445,7 @@ typedef NS_ENUM(NSUInteger, XYLoginType) {
NSString *protocolString = @"《隐私政策》";
NSMutableAttributedString *privateString = [[NSMutableAttributedString alloc] initWithString:protocolString attributes:@{NSForegroundColorAttributeName:[ThemeColor appMainColor]}];
[privateString yy_setTextHighlightRange:NSMakeRange(0, privateString.length) color:nil backgroundColor:nil userInfo:nil tapAction:^(UIView * _Nonnull containerView, NSAttributedString * _Nonnull text, NSRange range, CGRect rect) {
@strongify(self);
// @strongify(self);
//
// [self goToWebview:HtmlUrlKey(kPrivacyURL)];
} longPressAction:nil];

View File

@@ -11,6 +11,7 @@
#import "XPMacro.h"
#import "ThemeColor.h"
#import "UIImage+Utils.h"
#import "XCHUDTool.h"
///VC
#import "TabbarViewController.h"
#import "BaseViewController.h"
@@ -41,7 +42,7 @@
- (void)viewWillAppear:(BOOL)animated {
[super viewWillAppear:animated];
[self.navigationController setNavigationBarHidden:YES animated:YES];
[self.presenter autoLogin];
[self.presenter autoLogin];
}
- (MainPresenter *)presenter {
@@ -65,8 +66,6 @@
[self bindPhone];
return;
}
userInfo.nick = nil;
userInfo.avatar = nil;
if (userInfo.nick == nil || userInfo.avatar == nil) {
[self completeUserInfo];
return;
@@ -76,7 +75,9 @@
- (void)tokenInvalid {
LoginViewController *lvc = [[LoginViewController alloc] init];
[self.navigationController pushViewController:lvc animated:YES];
BaseNavigationController * nav = [[BaseNavigationController alloc] initWithRootViewController:lvc];
nav.modalPresentationStyle = UIModalPresentationFullScreen;
[self.navigationController presentViewController:nav animated:YES completion:nil];
}
- (void)completeUserInfo {
@@ -131,4 +132,21 @@
[itemVc.tabBarItem setTitleTextAttributes:@{NSForegroundColorAttributeName:[ThemeColor tabbarNormalColor]} forState:UIControlStateNormal];
}
#pragma mark - main
- (void)showSuccessToast:(NSString *)msg {
[XCHUDTool showSuccessWithMessage:msg];
}
- (void)showErrorToast:(NSString *)msg {
[XCHUDTool showErrorWithMessage:msg];
}
- (void)showLoading {
[XCHUDTool showGIFLoading];
}
- (void)hideHUD {
[XCHUDTool hideHUD];
}
@end