From 040ad7c71a4d111ca1cae7543b83696e39d75422 Mon Sep 17 00:00:00 2001 From: fengshuo <963787902@qq.com> Date: Fri, 17 Jun 2022 16:26:45 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B4=A6=E5=8F=B7=E5=B0=81=E7=A6=81=E5=BC=B9?= =?UTF-8?q?=E6=A1=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- xplan-ios/Base/MVP/Model/BaseModel.h | 5 +++++ .../Base/MVP/Presenter/BaseMvpPresenter.m | 4 ++++ xplan-ios/Base/MVP/Protocol/BaseMvpProtocol.h | 5 ++++- xplan-ios/Base/MVP/View/MvpViewController.m | 19 +++++++++++++++++++ 4 files changed, 32 insertions(+), 1 deletion(-) diff --git a/xplan-ios/Base/MVP/Model/BaseModel.h b/xplan-ios/Base/MVP/Model/BaseModel.h index a2c8e003..56af284b 100644 --- a/xplan-ios/Base/MVP/Model/BaseModel.h +++ b/xplan-ios/Base/MVP/Model/BaseModel.h @@ -16,6 +16,11 @@ NS_ASSUME_NONNULL_BEGIN @property (nonatomic , copy) NSString *message; ///注销的时间戳 因为后端返回的内容和code在同一层级 安卓已经发出去了 兼容就写在这里吧 请不要模仿 @property (nonatomic,assign) long long cancelDate; +///账号封禁返回的code +///时间 +@property (nonatomic,copy) NSString * date; +///封禁的理由 +@property (nonatomic,copy) NSString *reason; @end NS_ASSUME_NONNULL_END diff --git a/xplan-ios/Base/MVP/Presenter/BaseMvpPresenter.m b/xplan-ios/Base/MVP/Presenter/BaseMvpPresenter.m index 57034f8c..a34f8202 100644 --- a/xplan-ios/Base/MVP/Presenter/BaseMvpPresenter.m +++ b/xplan-ios/Base/MVP/Presenter/BaseMvpPresenter.m @@ -81,6 +81,10 @@ case 401: // 登录过期 [self logout]; return; + case 407: + case 408: + [[self getView] accountBanned:data]; + return; case 1415: // 未完善用户信息 [[self getView] completeUserInfo]; return; diff --git a/xplan-ios/Base/MVP/Protocol/BaseMvpProtocol.h b/xplan-ios/Base/MVP/Protocol/BaseMvpProtocol.h index c525b702..e5853db7 100644 --- a/xplan-ios/Base/MVP/Protocol/BaseMvpProtocol.h +++ b/xplan-ios/Base/MVP/Protocol/BaseMvpProtocol.h @@ -9,7 +9,7 @@ #import "BaseViewController.h" NS_ASSUME_NONNULL_BEGIN - +@class BaseModel; @protocol BaseMvpProtocol - (void)tokenInvalid; @@ -19,6 +19,9 @@ NS_ASSUME_NONNULL_BEGIN ///实名认证弹窗 - (void)showRealNameAuthenticationTipsAlertView; +///封禁账号 +- (void)accountBanned:(BaseModel *)data; + @end NS_ASSUME_NONNULL_END diff --git a/xplan-ios/Base/MVP/View/MvpViewController.m b/xplan-ios/Base/MVP/View/MvpViewController.m index f7236a5c..9d1e5c83 100644 --- a/xplan-ios/Base/MVP/View/MvpViewController.m +++ b/xplan-ios/Base/MVP/View/MvpViewController.m @@ -99,4 +99,23 @@ }]; } +///封禁账号 +- (void)accountBanned:(BaseModel *)data { + TTAlertConfig * config = [[TTAlertConfig alloc] init]; + config.title = @"您被封号了"; + NSString *dateDes = [PLTimeUtil getDateWithYYMMDD:data.date]; + NSString * title = [NSString stringWithFormat:@"您的账号因%@被封禁\n解封时间:%@", data.reason,dateDes]; + TTAlertMessageAttributedConfig * inviteAlertConfig = [[TTAlertMessageAttributedConfig alloc] init]; + inviteAlertConfig.text = dateDes; + inviteAlertConfig.color = [ThemeColor appMainColor]; + inviteAlertConfig.font = [UIFont systemFontOfSize:15]; + config.message = title; + config.messageAttributedConfig = @[inviteAlertConfig]; + [TTPopup alertWithConfig:config confirmHandler:^{ + + } cancelHandler:^{ + + }]; +} + @end