119 lines
4.0 KiB
Objective-C
119 lines
4.0 KiB
Objective-C
//
|
|
// MvpViewController.m
|
|
// YUMI
|
|
//
|
|
// Created by admin on 2023/3/9.
|
|
//
|
|
|
|
#import "MvpViewController.h"
|
|
#import "BaseMvpProtocol.h"
|
|
#import "BaseMvpPresenter.h"
|
|
#import "XPLoginViewController.h"
|
|
#import "BaseNavigationController.h"
|
|
#import "LoginFullInfoViewController.h"
|
|
#import "XPWebViewController.h"
|
|
//Tool
|
|
#import "TTPopup.h"
|
|
#import "PLTimeUtil.h"
|
|
#import "DJDKMIMOMColor.h"
|
|
#import "YUMIMacroUitls.h"
|
|
#import "YUMIHtmlUrl.h"
|
|
|
|
@interface MvpViewController ()
|
|
|
|
@end
|
|
|
|
@implementation MvpViewController
|
|
|
|
- (__kindof id)presenter {
|
|
if (_presenter == nil) {
|
|
_presenter = [self createPresenter];
|
|
[_presenter attatchView:self];
|
|
}
|
|
return _presenter;
|
|
}
|
|
|
|
- (__kindof id)createPresenter {
|
|
return [[BaseMvpPresenter alloc] init];
|
|
}
|
|
|
|
- (void)viewDidLoad {
|
|
[super viewDidLoad];
|
|
}
|
|
|
|
- (void)tokenInvalid {
|
|
[[NSNotificationCenter defaultCenter]postNotificationName:@"kLogout" object:nil];
|
|
XPLoginViewController *loginVC = [[XPLoginViewController alloc] init];
|
|
BaseNavigationController * nav = [[BaseNavigationController alloc] initWithRootViewController:loginVC];
|
|
nav.modalPresentationStyle = UIModalPresentationFullScreen;
|
|
[self.navigationController presentViewController:nav animated:YES completion:nil];
|
|
}
|
|
|
|
- (void)accountCanceled:(NSDictionary *)data {
|
|
NSString *date = [NSString stringWithFormat:@"%.0f",[[data objectForKey:@"cancelDate"] doubleValue]];
|
|
NSString *dateDes = [NSString stringWithFormat:YMLocalizedString(@"MvpViewController0"), [PLTimeUtil getDateWithYYMMDD:date]];
|
|
NSString *msg = [NSString stringWithFormat:YMLocalizedString(@"MvpViewController1"), dateDes];
|
|
TTAlertMessageAttributedConfig *dateAttrConfig = [[TTAlertMessageAttributedConfig alloc] init];
|
|
dateAttrConfig.text = dateDes;
|
|
dateAttrConfig.color = DJDKMIMOMColor.appMainColor;
|
|
|
|
TTAlertConfig *config = [[TTAlertConfig alloc] init];
|
|
config.title = YMLocalizedString(@"MvpViewController2");
|
|
config.message = msg;
|
|
config.messageAttributedConfig = @[dateAttrConfig];
|
|
|
|
[TTPopup alertWithConfig:config confirmHandler:^{
|
|
|
|
} cancelHandler:^{
|
|
|
|
}];
|
|
}
|
|
|
|
- (void)completeUserInfo {
|
|
LoginFullInfoViewController * bindPhoneVC = [[LoginFullInfoViewController alloc] init];
|
|
BaseNavigationController * nav = [[BaseNavigationController alloc] initWithRootViewController:bindPhoneVC];
|
|
nav.modalPresentationStyle = UIModalPresentationFullScreen;
|
|
[self.navigationController presentViewController:nav animated:YES completion:nil];
|
|
}
|
|
|
|
///实名认证弹窗
|
|
- (void)showRealNameAuthenticationTipsAlertView {
|
|
TTAlertConfig *config = [[TTAlertConfig alloc] init];
|
|
config.message = YMLocalizedString(@"MvpViewController3");
|
|
config.messageLineSpacing = 4;
|
|
config.confirmButtonConfig.title = YMLocalizedString(@"MvpViewController4");
|
|
config.confirmButtonConfig.titleColor = UIColor.whiteColor;
|
|
config.confirmButtonConfig.backgroundColor = [DJDKMIMOMColor appMainColor];
|
|
|
|
TTAlertMessageAttributedConfig *nameAttrConf = [[TTAlertMessageAttributedConfig alloc] init];
|
|
nameAttrConf.text = YMLocalizedString(@"MvpViewController5");
|
|
nameAttrConf.color = [DJDKMIMOMColor appMainColor];
|
|
config.messageAttributedConfig = @[nameAttrConf];
|
|
|
|
[TTPopup alertWithConfig:config confirmHandler:^{
|
|
|
|
} cancelHandler:^{
|
|
}];
|
|
}
|
|
|
|
///封禁账号
|
|
- (void)accountBanned:(BaseModel *)data {
|
|
TTAlertConfig * config = [[TTAlertConfig alloc] init];
|
|
config.title = YMLocalizedString(@"MvpViewController6");
|
|
NSString *dateDes = [PLTimeUtil getDateWithYYMMDD:data.date];
|
|
NSString * title = [NSString stringWithFormat:YMLocalizedString(@"MvpViewController7"), data.reason,dateDes];
|
|
TTAlertMessageAttributedConfig * inviteAlertConfig = [[TTAlertMessageAttributedConfig alloc] init];
|
|
inviteAlertConfig.text = dateDes;
|
|
inviteAlertConfig.color = [DJDKMIMOMColor appMainColor];
|
|
inviteAlertConfig.font = [UIFont systemFontOfSize:15];
|
|
config.message = title;
|
|
config.messageAttributedConfig = @[inviteAlertConfig];
|
|
[TTPopup alertWithConfig:config confirmHandler:^{
|
|
|
|
} cancelHandler:^{
|
|
|
|
}];
|
|
}
|
|
|
|
@end
|