chore: Initial clean commit
- Removed YuMi/Library/ (138 MB, not tracked) - Removed YuMi/Resources/ (23 MB, not tracked) - Removed old version assets (566 files, not tracked) - Excluded Pods/, xcuserdata/ and other build artifacts - Clean repository optimized for company server deployment
This commit is contained in:
103
YuMi/Structure/MVP/Api/Api.h
Normal file
103
YuMi/Structure/MVP/Api/Api.h
Normal file
@@ -0,0 +1,103 @@
|
||||
//
|
||||
// Api.h
|
||||
// YUMI
|
||||
//
|
||||
// Created by zu on 2021/9/6.
|
||||
//
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
#import "HttpRequestHelper.h"
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface Api : NSObject
|
||||
|
||||
/**
|
||||
route : 接口路径
|
||||
method : http 请求方法(POST、GET等)
|
||||
completion : 网络请求完成的回调
|
||||
... : 可变参数,第一个为 __FUNCTION__ ,接下来依次为该接口的协议参数
|
||||
*/
|
||||
+ (void)makeRequest:(NSString *)route method:(HttpRequestHelperMethod)method completion:(HttpRequestHelperCompletion)completion, ...;
|
||||
|
||||
+ (void)getUserInfo:(HttpRequestHelperCompletion)completion uid:(NSString *)uid;
|
||||
///获取多个用户的信息
|
||||
+ (void)getUserInfos:(HttpRequestHelperCompletion)completion uids:(NSString *)uids;
|
||||
+(void)testMsg:(HttpRequestHelperCompletion)completion uid:(NSString *)uid ticket:(NSString *)ticket;
|
||||
/// 获取手机号的验证码
|
||||
/// @param completion 请求完成
|
||||
/// @param mobile 手机号
|
||||
/// @param type 类型 请看XPEunm中的枚举
|
||||
+ (void)phoneSmsCode:(HttpRequestHelperCompletion)completion mobile:(NSString *)mobile type:(NSString *)type phoneAreaCode:(NSString *)phoneAreaCode;
|
||||
|
||||
/// 校验手机号码
|
||||
/// @param completion 完成
|
||||
/// @param mobile 手机号
|
||||
/// @param code 验证码
|
||||
/// @param uid 用户的uid
|
||||
/// @param ticket ticket
|
||||
+ (void)checkMoblieCode:(HttpRequestHelperCompletion)completion
|
||||
mobile:(NSString *)mobile
|
||||
code:(NSString *)code
|
||||
uid:(NSString *)uid
|
||||
ticket:(NSString *)ticket phoneAreaCode:(NSString *)phoneAreaCode;
|
||||
|
||||
/// 补全用户资料
|
||||
/// @param completion 完成
|
||||
/// @param userInfo 需要更新的用户信息
|
||||
+ (void)completeUserInfo:(HttpRequestHelperCompletion)completion
|
||||
userInfo:(NSDictionary *)userInfo;
|
||||
/// 获取用户钱包余额信息
|
||||
/// @param completion 完成
|
||||
/// @param uid 用户uid
|
||||
/// @param ticket ticketg
|
||||
+ (void)getUserWalletInfo:(HttpRequestHelperCompletion)completion
|
||||
uid:(NSString *)uid
|
||||
ticket:(NSString *)ticket;
|
||||
/// 批量验证
|
||||
/// @param completion 完成
|
||||
/// @param transcationIdStr 需要验证的数据
|
||||
+ (void)requestCheckTranscationIds:(HttpRequestHelperCompletion)completion
|
||||
transcationIdStr:(NSString *)transcationIdStr;
|
||||
|
||||
/// 锁麦/开麦
|
||||
/// @param completion 完成
|
||||
/// @param roomUid 房主的uid
|
||||
/// @param state 0 开麦 1 锁麦
|
||||
/// @param position 坑位
|
||||
/// @param ticket 用户的ticket
|
||||
/// @param uid uid
|
||||
+ (void)microMuteCompletion:(HttpRequestHelperCompletion)completion
|
||||
roomUid:(NSString *)roomUid
|
||||
state:(NSString *)state
|
||||
position:(NSString *)position
|
||||
ticket:(NSString *)ticket
|
||||
uid:(NSString *)uid;
|
||||
|
||||
/// 锁坑/开锁
|
||||
/// @param completion 完成
|
||||
/// @param roomUid 房主的uid
|
||||
/// @param state 1锁坑位,0取消锁(即取消锁坑位)
|
||||
/// @param position 坑位
|
||||
/// @param ticket 用户的ticket
|
||||
/// @param uid uid
|
||||
+ (void)microLockCompletion:(HttpRequestHelperCompletion)completion
|
||||
roomUid:(NSString *)roomUid
|
||||
state:(NSString *)state
|
||||
position:(NSString *)position
|
||||
ticket:(NSString *)ticket
|
||||
uid:(NSString *)uid;
|
||||
//充值banner位
|
||||
+(void)requestBannerListCompletion:(HttpRequestHelperCompletion)completion;
|
||||
//联系客服
|
||||
+(void)requestContactCustomerServiceCompletion:(HttpRequestHelperCompletion)completion;
|
||||
|
||||
+ (void)requestAllRegionInfoCompletion:(HttpRequestHelperCompletion)completion;
|
||||
|
||||
+ (void)requestBossMicUp:(HttpRequestHelperCompletion)completion roomUid:(NSString *)roomUid uid:(NSString *)uid;
|
||||
|
||||
+ (void)shareGetInfo:(HttpRequestHelperCompletion)completion code:(NSString *)code;
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
158
YuMi/Structure/MVP/Api/Api.m
Normal file
158
YuMi/Structure/MVP/Api/Api.m
Normal file
@@ -0,0 +1,158 @@
|
||||
//
|
||||
// Api.m
|
||||
// YUMI
|
||||
//
|
||||
// Created by zu on 2021/9/6.
|
||||
//
|
||||
|
||||
#import "Api.h"
|
||||
#import <Base64/MF_Base64Additions.h>
|
||||
@implementation Api
|
||||
+ (void)makeRequest:(NSString *)route method:(HttpRequestHelperMethod)method completion:(HttpRequestHelperCompletion)completion, ... {
|
||||
va_list arg_lists;
|
||||
va_start(arg_lists, completion);
|
||||
|
||||
// 获取第一个参数 __FUNCTION__ ,然后解析出来 key 。
|
||||
const char *functionName = va_arg(arg_lists, const char *);
|
||||
NSString *fn = [[NSString alloc] initWithUTF8String:functionName];
|
||||
// NSLog 一下 __FUNCTION__ 就知道为什么这么截取了。
|
||||
NSRange blankRange = [fn rangeOfString:@":"];
|
||||
NSUInteger start = blankRange.location + 1;
|
||||
NSUInteger length;
|
||||
if ((start + 2) < fn.length) {
|
||||
length = fn.length - start - 2;
|
||||
} else if ((start + 1) < fn.length) {
|
||||
length = fn.length -start - 1;
|
||||
} else {
|
||||
length = fn.length -start;
|
||||
}
|
||||
|
||||
NSString *fromatParamKeys = [fn substringWithRange:NSMakeRange(start, length)];
|
||||
// 构造请求的 NSMutableDictionary *params 。
|
||||
NSMutableDictionary *params = [NSMutableDictionary dictionary];
|
||||
|
||||
NSArray *paramKeys = [fromatParamKeys componentsSeparatedByString:@":"];
|
||||
NSEnumerator *enumerator = [paramKeys objectEnumerator];
|
||||
NSString *value = nil;
|
||||
while((value = va_arg(arg_lists, NSString*))){
|
||||
[params setValue:value forKey:enumerator.nextObject];
|
||||
};
|
||||
va_end(arg_lists);
|
||||
|
||||
[HttpRequestHelper request:route method:method params:params completion:completion];
|
||||
}
|
||||
|
||||
+ (void)getUserInfo:(HttpRequestHelperCompletion)completion uid:(NSString *)uid {
|
||||
NSString * fang = [NSString stringFromBase64String:@"dXNlci9nZXQ="];///user/get
|
||||
[self makeRequest:fang method:HttpRequestHelperMethodGET completion:completion, __FUNCTION__, uid, nil];
|
||||
}
|
||||
|
||||
+ (void)getUserInfos:(HttpRequestHelperCompletion)completion uids:(NSString *)uids {
|
||||
NSString * fang = [NSString stringFromBase64String:@"dXNlci9saXN0"];///user/list
|
||||
[self makeRequest:fang method:HttpRequestHelperMethodGET completion:completion, __FUNCTION__, uids, nil];
|
||||
}
|
||||
+(void)testMsg:(HttpRequestHelperCompletion)completion uid:(NSString *)uid ticket:(NSString *)ticket{
|
||||
|
||||
[self makeRequest:@"user/testMsg" method:HttpRequestHelperMethodPOST completion:completion, __FUNCTION__,uid,ticket, nil];
|
||||
}
|
||||
/// 获取手机号的验证码
|
||||
/// @param completion 请求完成
|
||||
/// @param mobile 手机号
|
||||
/// @param type 类型 请看XPEunm中的枚举
|
||||
+ (void)phoneSmsCode:(HttpRequestHelperCompletion)completion mobile:(NSString *)mobile type:(NSString *)type phoneAreaCode:(NSString *)phoneAreaCode {
|
||||
NSString * fang = [NSString stringFromBase64String:@"c21zL2dldENvZGU="];///sms/getCode
|
||||
[self makeRequest:fang method:HttpRequestHelperMethodPOST completion:completion, __FUNCTION__, mobile, type, phoneAreaCode,nil];
|
||||
}
|
||||
|
||||
/// 校验手机号码
|
||||
/// @param completion 完成
|
||||
/// @param mobile 手机号
|
||||
/// @param code 验证码
|
||||
/// @param uid 用户的uid
|
||||
/// @param ticket ticket
|
||||
+ (void)checkMoblieCode:(HttpRequestHelperCompletion)completion
|
||||
mobile:(NSString *)mobile
|
||||
code:(NSString *)code
|
||||
uid:(NSString *)uid
|
||||
ticket:(NSString *)ticket phoneAreaCode:(NSString *)phoneAreaCode{
|
||||
NSString * fang = [NSString stringFromBase64String:@"c21zL3ZlcmlmeQ=="];///sms/verify
|
||||
[self makeRequest:fang method:HttpRequestHelperMethodPOST completion:completion, __FUNCTION__, mobile, code, uid, ticket,phoneAreaCode,nil];
|
||||
}
|
||||
|
||||
/// 补全用户资料
|
||||
/// @param completion 完成
|
||||
/// @param userInfo 需要更新的用户信息
|
||||
+ (void)completeUserInfo:(HttpRequestHelperCompletion)completion
|
||||
userInfo:(NSDictionary *)userInfo {
|
||||
NSString * fang = [NSString stringFromBase64String:@"dXNlci92Mi91cGRhdGU="];///user/v2/update
|
||||
[HttpRequestHelper request:fang method:HttpRequestHelperMethodPOST params:userInfo completion:completion];
|
||||
}
|
||||
|
||||
|
||||
/// 获取用户钱包余额信息
|
||||
/// @param completion 完成
|
||||
/// @param uid 用户uid
|
||||
/// @param ticket ticketg
|
||||
+ (void)getUserWalletInfo:(HttpRequestHelperCompletion)completion uid:(NSString *)uid ticket:(NSString *)ticket {
|
||||
NSString * fang = [NSString stringFromBase64String:@"cHVyc2UvcXVlcnk="];///purse/query
|
||||
[self makeRequest:fang method:HttpRequestHelperMethodGET completion:completion, __FUNCTION__, uid, ticket,nil];
|
||||
}
|
||||
|
||||
/// 批量验证
|
||||
/// @param completion 完成
|
||||
/// @param transcationIdStr 需要验证的数据
|
||||
+ (void)requestCheckTranscationIds:(HttpRequestHelperCompletion)completion
|
||||
transcationIdStr:(NSString *)transcationIdStr {
|
||||
NSString * fang = [NSString stringFromBase64String:@"dmVyaWZ5L2NoZWNrSU9TQ2hhcmdlUmVjb3Jk"];///verify/checkIOSChargeRecord
|
||||
[self makeRequest:fang method:HttpRequestHelperMethodPOST completion:completion, __FUNCTION__,transcationIdStr, nil];
|
||||
}
|
||||
|
||||
/// 锁麦/开麦
|
||||
/// @param completion 完成
|
||||
/// @param roomUid 房主的uid
|
||||
/// @param state 0 开麦 1 锁麦
|
||||
/// @param position 坑位
|
||||
/// @param ticket 用户的ticket
|
||||
/// @param uid uid
|
||||
+ (void)microMuteCompletion:(HttpRequestHelperCompletion)completion roomUid:(NSString *)roomUid state:(NSString *)state position:(NSString *)position ticket:(NSString *)ticket uid:(NSString *)uid {
|
||||
NSString * fang = [NSString stringFromBase64String:@"cm9vbS9taWMvbG9ja21pYw=="];///@"room/mic/lockmic"
|
||||
[self makeRequest:fang method:HttpRequestHelperMethodPOST completion:completion, __FUNCTION__, roomUid, state, position, ticket, uid, nil];
|
||||
}
|
||||
|
||||
/// 锁坑/开锁
|
||||
/// @param completion 完成
|
||||
/// @param roomUid 房主的uid
|
||||
/// @param state 1锁坑位,0取消锁(即取消锁坑位)
|
||||
/// @param position 坑位
|
||||
/// @param ticket 用户的ticket
|
||||
/// @param uid uid
|
||||
+ (void)microLockCompletion:(HttpRequestHelperCompletion)completion roomUid:(NSString *)roomUid state:(NSString *)state position:(NSString *)position ticket:(NSString *)ticket uid:(NSString *)uid {
|
||||
NSString * fang = [NSString stringFromBase64String:@"cm9vbS9taWMvbG9ja3Bvcw=="];///room/mic/lockpos
|
||||
[self makeRequest:fang method:HttpRequestHelperMethodPOST completion:completion, __FUNCTION__, roomUid, state, position, ticket, uid, nil];
|
||||
}
|
||||
//充值banner位
|
||||
+(void)requestBannerListCompletion:(HttpRequestHelperCompletion)completion{
|
||||
[self makeRequest:@"charge/guide/banner" method:HttpRequestHelperMethodGET completion:completion, __FUNCTION__, nil];
|
||||
}
|
||||
//联系客服
|
||||
+(void)requestContactCustomerServiceCompletion:(HttpRequestHelperCompletion)completion{
|
||||
[self makeRequest:@"charge/guide/contact" method:HttpRequestHelperMethodGET completion:completion, __FUNCTION__, nil];
|
||||
}
|
||||
|
||||
+ (void)requestAllRegionInfoCompletion:(HttpRequestHelperCompletion)completion {
|
||||
[self makeRequest:@"regionInfo/listAll" method:HttpRequestHelperMethodGET completion:completion, __FUNCTION__, nil];
|
||||
}
|
||||
|
||||
+ (void)requestBossMicUp:(HttpRequestHelperCompletion)completion roomUid:(NSString *)roomUid uid:(NSString *)uid {
|
||||
[self makeRequest:@"room/bossMic/up" method:HttpRequestHelperMethodGET completion:completion, __FUNCTION__, roomUid, uid, nil];
|
||||
}
|
||||
|
||||
+ (void)shareGetInfo:(HttpRequestHelperCompletion)completion code:(NSString *)code {
|
||||
[self makeRequest:@"share/getInfo"
|
||||
method:HttpRequestHelperMethodGET
|
||||
completion:completion,
|
||||
__FUNCTION__,
|
||||
code, nil];
|
||||
}
|
||||
|
||||
@end
|
||||
40
YuMi/Structure/MVP/Model/AccountInfoStorage.h
Normal file
40
YuMi/Structure/MVP/Model/AccountInfoStorage.h
Normal file
@@ -0,0 +1,40 @@
|
||||
//
|
||||
// DataUtils.h
|
||||
// YYFaceAuth
|
||||
//
|
||||
// Created by chenran on 16/10/18.
|
||||
// Copyright © 2016年 zhangji. All rights reserved.
|
||||
//
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
|
||||
@class AccountModel, ThirdUserInfo, HomeTagModel,HomeUserModel;
|
||||
@interface AccountInfoStorage : NSObject
|
||||
|
||||
@property (nonatomic, strong, readonly) AccountModel *accountModel;
|
||||
@property(nonatomic,copy) NSString *name;///判断帐号是否填写资料
|
||||
///判断是否正在请求ticket,yes的话,不能用ticket请求数据,不然会出现401,要重新登录
|
||||
@property (nonatomic,assign) BOOL isRequestTicket;
|
||||
///如果是第三方登录的话 保存一下用户信息
|
||||
@property (nonatomic,strong) ThirdUserInfo *thirdUserInfo;
|
||||
@property(nonatomic,assign) BOOL isNative;
|
||||
+ (instancetype)instance;
|
||||
|
||||
- (instancetype)init NS_UNAVAILABLE;
|
||||
+ (instancetype)new NS_UNAVAILABLE;
|
||||
- (id)copy NS_UNAVAILABLE;
|
||||
- (id)mutableCopy NS_UNAVAILABLE;
|
||||
|
||||
- (AccountModel *)getCurrentAccountInfo;
|
||||
- (void)saveAccountInfo:(AccountModel *)accountInfo;
|
||||
///用于判断是否填写用户资料,没有将跳到用户填写用户资料界面
|
||||
- (HomeUserModel *)getCurrentHomeUserInfo;
|
||||
- (void)saveHomeUserInfo:(HomeUserModel *)homeUserInfo;
|
||||
- (void)saveTicket:(NSString *)ticket;
|
||||
- (NSString *)getTicket;
|
||||
- (NSString *)getUid;
|
||||
|
||||
///首页的tag列表,增加缓存,加快加载速度的优化
|
||||
- (NSArray<HomeTagModel *> *)getCurrentTagList;
|
||||
- (void)saveTagList:(NSArray<HomeTagModel *> *)tagList;
|
||||
@end
|
||||
171
YuMi/Structure/MVP/Model/AccountInfoStorage.m
Normal file
171
YuMi/Structure/MVP/Model/AccountInfoStorage.m
Normal file
@@ -0,0 +1,171 @@
|
||||
//
|
||||
// DataUtils.m
|
||||
// YYFaceAuth
|
||||
//
|
||||
// Created by chenran on 16/10/18.
|
||||
// Copyright © 2016年 zhangji. All rights reserved.
|
||||
//
|
||||
#define kFileName @"AccountInfo.data"
|
||||
#define kDataKey @"accountInfo"
|
||||
#define kHomeUserDataKey @"homeUserInfo"
|
||||
#define kHomeUserName @"HomeUserModel.data"
|
||||
|
||||
#import "AccountInfoStorage.h"
|
||||
#import "AccountModel.h"
|
||||
#import "HomeTagModel.h"
|
||||
|
||||
#define kTagListDataKey @"homeaaNewTagModel"
|
||||
#define kTagListDataName @"HomeTagNewModel.data"
|
||||
@interface AccountInfoStorage()
|
||||
@property (nonatomic,strong) HomeUserModel *homeUserInfo;
|
||||
@property (nonatomic, copy) NSString *ticket;
|
||||
@property (nonatomic, strong) AccountModel *accountModel;
|
||||
@property (nonatomic,strong) NSArray<HomeTagModel *> *tagList;
|
||||
@end
|
||||
|
||||
@implementation AccountInfoStorage
|
||||
|
||||
static AccountInfoStorage *_instance = nil;
|
||||
|
||||
+ (AccountInfoStorage *)instance {
|
||||
|
||||
static dispatch_once_t onceToken;
|
||||
|
||||
dispatch_once(&onceToken, ^{
|
||||
_instance = [[self alloc] init];
|
||||
}) ;
|
||||
|
||||
return _instance;
|
||||
}
|
||||
|
||||
-(NSString *) getFilePath{
|
||||
NSArray *array = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
|
||||
NSString *path = [[array objectAtIndex:0] stringByAppendingPathComponent:kFileName];
|
||||
if (![[NSFileManager defaultManager] fileExistsAtPath:path]) {
|
||||
[[NSFileManager defaultManager] createFileAtPath:path contents:nil attributes:nil];
|
||||
}
|
||||
return path;
|
||||
}
|
||||
|
||||
- (AccountModel *)getCurrentAccountInfo
|
||||
{
|
||||
if (self.accountModel != nil) {
|
||||
return self.accountModel;
|
||||
}
|
||||
|
||||
if ([[NSFileManager defaultManager] fileExistsAtPath:[self getFilePath]] == NO) {
|
||||
return nil;
|
||||
}
|
||||
|
||||
NSData *data = [[NSData alloc] initWithContentsOfFile:[self getFilePath]];
|
||||
if (data == nil) {
|
||||
return nil;
|
||||
}
|
||||
|
||||
NSKeyedUnarchiver *unarchiver = [[NSKeyedUnarchiver alloc] initForReadingWithData:data];
|
||||
//解档出数据模型
|
||||
self.accountModel = [unarchiver decodeObjectForKey:kDataKey];
|
||||
[unarchiver finishDecoding];//一定不要忘记finishDecoding,否则会报错
|
||||
return self.accountModel;
|
||||
}
|
||||
|
||||
- (void)saveAccountInfo:(AccountModel *)accountInfo
|
||||
{
|
||||
if (accountInfo == nil) {
|
||||
accountInfo = [[AccountModel alloc] init];
|
||||
}
|
||||
self.accountModel = accountInfo;
|
||||
NSMutableData *data = [[NSMutableData alloc] init];
|
||||
NSKeyedArchiver *archiver = [[NSKeyedArchiver alloc] initForWritingWithMutableData:data];
|
||||
[archiver encodeObject:accountInfo forKey:kDataKey];
|
||||
[archiver finishEncoding];
|
||||
[data writeToFile:[self getFilePath] atomically:YES];
|
||||
}
|
||||
- (HomeUserModel *)getCurrentHomeUserInfo
|
||||
{
|
||||
if (self.homeUserInfo != nil) {
|
||||
return self.homeUserInfo;
|
||||
}
|
||||
NSData *data = [[NSData alloc] initWithContentsOfFile:[self getHomeUserFilePath]];
|
||||
|
||||
NSKeyedUnarchiver *unarchiver = [[NSKeyedUnarchiver alloc] initForReadingWithData:data];
|
||||
//解档出数据模型
|
||||
self.homeUserInfo = [unarchiver decodeObjectForKey:kHomeUserDataKey];
|
||||
[unarchiver finishDecoding];//一定不要忘记finishDecoding,否则会报错
|
||||
return self.homeUserInfo;
|
||||
}
|
||||
- (void)saveHomeUserInfo:(HomeUserModel *)homeUserInfo
|
||||
{
|
||||
if (homeUserInfo == nil) {
|
||||
homeUserInfo = [[HomeUserModel alloc] init];
|
||||
}
|
||||
self.homeUserInfo = homeUserInfo;
|
||||
NSMutableData *data = [[NSMutableData alloc] init];
|
||||
NSKeyedArchiver *archiver = [[NSKeyedArchiver alloc] initForWritingWithMutableData:data];
|
||||
[archiver encodeObject:homeUserInfo forKey:kHomeUserDataKey];
|
||||
[archiver finishEncoding];
|
||||
[data writeToFile:[self getHomeUserFilePath] atomically:YES];
|
||||
}
|
||||
-(NSString *) getHomeUserFilePath{
|
||||
NSArray *array = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
|
||||
NSString *path = [[array objectAtIndex:0] stringByAppendingPathComponent:kHomeUserName];
|
||||
if (![[NSFileManager defaultManager] fileExistsAtPath:path]) {
|
||||
[[NSFileManager defaultManager] createFileAtPath:path contents:nil attributes:nil];
|
||||
}
|
||||
return path;
|
||||
}
|
||||
- (void)saveTicket:(NSString *)t
|
||||
{
|
||||
self.ticket = t;
|
||||
}
|
||||
|
||||
- (NSString *)getTicket
|
||||
{
|
||||
if (self.ticket == nil) {
|
||||
return @"";
|
||||
}
|
||||
return self.ticket;
|
||||
}
|
||||
|
||||
- (NSString *)getUid
|
||||
{
|
||||
AccountModel *am = [self getCurrentAccountInfo];
|
||||
if (am == nil) {
|
||||
return @"";
|
||||
}
|
||||
return am.uid;
|
||||
}
|
||||
|
||||
- (NSArray<HomeTagModel *> *)getCurrentTagList{
|
||||
if (self.tagList != nil) {
|
||||
return self.tagList;
|
||||
}
|
||||
NSData *data = [[NSData alloc] initWithContentsOfFile:[self getTagListFilePath]];
|
||||
|
||||
NSKeyedUnarchiver *unarchiver = [[NSKeyedUnarchiver alloc] initForReadingWithData:data];
|
||||
//解档出数据模型
|
||||
self.tagList = [unarchiver decodeObjectForKey:kTagListDataKey];
|
||||
[unarchiver finishDecoding];//一定不要忘记finishDecoding,否则会报错
|
||||
return self.tagList != nil ? self.tagList : @[];
|
||||
}
|
||||
- (void)saveTagList:(NSArray<HomeTagModel *> *)tagList{
|
||||
if(tagList == nil){
|
||||
tagList = @[];
|
||||
}
|
||||
self.tagList = tagList;
|
||||
NSMutableData *data = [[NSMutableData alloc] init];
|
||||
NSKeyedArchiver *archiver = [[NSKeyedArchiver alloc] initForWritingWithMutableData:data];
|
||||
[archiver encodeObject:tagList forKey:kTagListDataKey];
|
||||
[archiver finishEncoding];
|
||||
[data writeToFile:[self getTagListFilePath] atomically:YES];
|
||||
}
|
||||
|
||||
-(NSString *) getTagListFilePath{
|
||||
NSArray *array = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
|
||||
NSString *path = [[array objectAtIndex:0] stringByAppendingPathComponent:kTagListDataName];
|
||||
if (![[NSFileManager defaultManager] fileExistsAtPath:path]) {
|
||||
[[NSFileManager defaultManager] createFileAtPath:path contents:nil attributes:nil];
|
||||
}
|
||||
return path;
|
||||
}
|
||||
@end
|
||||
31
YuMi/Structure/MVP/Model/AccountModel.h
Normal file
31
YuMi/Structure/MVP/Model/AccountModel.h
Normal file
@@ -0,0 +1,31 @@
|
||||
//
|
||||
// TokenModel.h
|
||||
// YUMI
|
||||
//
|
||||
// Created by zu on 2021/9/8.
|
||||
//
|
||||
|
||||
#import "NSObject+MJExtension.h"
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface AccountModel : PIBaseModel
|
||||
|
||||
@property (nonatomic , copy) NSString *uid;
|
||||
@property (nonatomic , copy) NSString *jti;
|
||||
@property (nonatomic , copy) NSString *token_type;
|
||||
@property (nonatomic , copy) NSString *refresh_token;
|
||||
@property (nonatomic , copy) NSString *netEaseToken;
|
||||
@property (nonatomic , copy) NSString *access_token;
|
||||
@property (nonatomic , copy) NSNumber *expires_in;
|
||||
|
||||
@end
|
||||
@interface HomeUserModel : PIBaseModel
|
||||
@property (nonatomic,copy)NSString *nick;
|
||||
@property (nonatomic,copy)NSString *avatar;
|
||||
@property (nonatomic,assign)BOOL isBindPhone;
|
||||
@property (nonatomic,copy) NSString *ticket;
|
||||
@property (nonatomic,assign) BOOL isGetUserInfoSuccess;
|
||||
|
||||
@end
|
||||
NS_ASSUME_NONNULL_END
|
||||
15
YuMi/Structure/MVP/Model/AccountModel.m
Normal file
15
YuMi/Structure/MVP/Model/AccountModel.m
Normal file
@@ -0,0 +1,15 @@
|
||||
//
|
||||
// TokenModel.m
|
||||
// YUMI
|
||||
//
|
||||
// Created by zu on 2021/9/8.
|
||||
//
|
||||
|
||||
#import "AccountModel.h"
|
||||
|
||||
@implementation AccountModel
|
||||
|
||||
@end
|
||||
@implementation HomeUserModel
|
||||
|
||||
@end
|
||||
26
YuMi/Structure/MVP/Model/BaseModel.h
Normal file
26
YuMi/Structure/MVP/Model/BaseModel.h
Normal file
@@ -0,0 +1,26 @@
|
||||
//
|
||||
// BaseModel.h
|
||||
// YUMI
|
||||
//
|
||||
// Created by zu on 2021/9/8.
|
||||
//
|
||||
|
||||
#import "NSObject+MJExtension.h"
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface BaseModel : NSObject
|
||||
@property(nonatomic,assign) long timestamp;
|
||||
@property (nonatomic , strong) id data;
|
||||
@property (nonatomic , assign) NSInteger code;
|
||||
@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
|
||||
12
YuMi/Structure/MVP/Model/BaseModel.m
Normal file
12
YuMi/Structure/MVP/Model/BaseModel.m
Normal file
@@ -0,0 +1,12 @@
|
||||
//
|
||||
// BaseModel.m
|
||||
// YUMI
|
||||
//
|
||||
// Created by zu on 2021/9/8.
|
||||
//
|
||||
|
||||
#import "BaseModel.h"
|
||||
|
||||
@implementation BaseModel
|
||||
|
||||
@end
|
||||
23
YuMi/Structure/MVP/Model/GuildInfo.h
Normal file
23
YuMi/Structure/MVP/Model/GuildInfo.h
Normal file
@@ -0,0 +1,23 @@
|
||||
//
|
||||
// GuildInfo.h
|
||||
// YuMi
|
||||
//
|
||||
// Created by P on 2024/9/19.
|
||||
//
|
||||
|
||||
#import "PIBaseModel.h"
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface GuildInfo : PIBaseModel
|
||||
|
||||
@property (nonatomic, copy) NSString *avatar;
|
||||
@property (nonatomic, copy) NSString *guildName;
|
||||
@property (nonatomic, assign) NSInteger erbanNo;
|
||||
@property (nonatomic, assign) NSInteger guildId;
|
||||
@property (nonatomic, assign) NSInteger showCpAnim;
|
||||
@property (nonatomic, assign) NSInteger showCpAvatar;
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
12
YuMi/Structure/MVP/Model/GuildInfo.m
Normal file
12
YuMi/Structure/MVP/Model/GuildInfo.m
Normal file
@@ -0,0 +1,12 @@
|
||||
//
|
||||
// GuildInfo.m
|
||||
// YuMi
|
||||
//
|
||||
// Created by P on 2024/9/19.
|
||||
//
|
||||
|
||||
#import "GuildInfo.h"
|
||||
|
||||
@implementation GuildInfo
|
||||
|
||||
@end
|
||||
85
YuMi/Structure/MVP/Model/MedalModel.h
Normal file
85
YuMi/Structure/MVP/Model/MedalModel.h
Normal file
@@ -0,0 +1,85 @@
|
||||
//
|
||||
// MedalModel.h
|
||||
// YuMi
|
||||
//
|
||||
// Created by P on 2024/6/25.
|
||||
//
|
||||
|
||||
#import "PIBaseModel.h"
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
|
||||
@interface UserMedalModel : PIBaseModel
|
||||
/**
|
||||
* 用户UID
|
||||
*/
|
||||
@property (nonatomic, assign) NSInteger uid;
|
||||
/**
|
||||
* 勋章ID
|
||||
*/
|
||||
@property (nonatomic, assign) NSInteger medalId;
|
||||
/**
|
||||
* 勋章名称
|
||||
*/
|
||||
@property (nonatomic, copy) NSString *medalName;
|
||||
/**
|
||||
* 图片链接
|
||||
*/
|
||||
@property (nonatomic, copy) NSString *picUrl;
|
||||
/**
|
||||
* 排序
|
||||
*/
|
||||
@property (nonatomic, assign) NSInteger seqNo;
|
||||
/**
|
||||
* 勋章类型
|
||||
*/
|
||||
@property (nonatomic, assign) NSInteger medalType;
|
||||
|
||||
/**
|
||||
* 是否点亮
|
||||
*/
|
||||
@property (nonatomic, assign) BOOL isLightUp;
|
||||
|
||||
/**
|
||||
* 领取时间
|
||||
*/
|
||||
@property (nonatomic, assign) double receiveTime;
|
||||
|
||||
/**
|
||||
* 勋章描述
|
||||
*/
|
||||
@property (nonatomic, copy) NSString *medalDesc;
|
||||
|
||||
/**
|
||||
* 勋章横幅
|
||||
*/
|
||||
@property (nonatomic, copy) NSString *banner;
|
||||
|
||||
/**
|
||||
* 勋章数量
|
||||
*/
|
||||
@property (nonatomic, assign) NSInteger amount;
|
||||
|
||||
/**
|
||||
* 勋章小图标
|
||||
*/
|
||||
@property (nonatomic, copy) NSString *smallIcon;
|
||||
|
||||
/**
|
||||
* 业务类型
|
||||
*/
|
||||
@property (nonatomic, assign) NSInteger busType;
|
||||
|
||||
@property (nonatomic,copy) NSString *mp4Url;
|
||||
|
||||
@end
|
||||
|
||||
@interface MedalModel : PIBaseModel
|
||||
|
||||
@property (nonatomic, assign) NSInteger medalCount;
|
||||
@property (nonatomic, strong) NSArray<UserMedalModel *>* userMedals;
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
21
YuMi/Structure/MVP/Model/MedalModel.m
Normal file
21
YuMi/Structure/MVP/Model/MedalModel.m
Normal file
@@ -0,0 +1,21 @@
|
||||
//
|
||||
// MedalModel.m
|
||||
// YuMi
|
||||
//
|
||||
// Created by P on 2024/6/25.
|
||||
//
|
||||
|
||||
#import "MedalModel.h"
|
||||
|
||||
@implementation MedalModel
|
||||
+ (NSDictionary *)objectClassInArray {
|
||||
return @{
|
||||
@"userMedals":UserMedalModel.class
|
||||
};
|
||||
}
|
||||
@end
|
||||
|
||||
@implementation UserMedalModel
|
||||
|
||||
|
||||
@end
|
||||
25
YuMi/Structure/MVP/Model/NSObject+AutoCoding.h
Normal file
25
YuMi/Structure/MVP/Model/NSObject+AutoCoding.h
Normal file
@@ -0,0 +1,25 @@
|
||||
//
|
||||
// NSObject+AutoCoding.h
|
||||
// YYMobileFramework
|
||||
//
|
||||
// Created by wuwei on 14/6/13.
|
||||
// Copyright (c) 2014年 YY Inc. All rights reserved.
|
||||
//
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
|
||||
@interface NSObject (AutoCoding) <NSSecureCoding>
|
||||
|
||||
// Coding
|
||||
+ (NSDictionary *)codableProperties;
|
||||
- (void)setWithCoder:(NSCoder *)aDecoder;
|
||||
|
||||
// Properties access
|
||||
- (NSDictionary *)codableProperties;
|
||||
- (NSDictionary *)dictionaryRepresentation;
|
||||
|
||||
// Loading / Saving
|
||||
+ (instancetype)objectWithContentsOfFile:(NSString *)path;
|
||||
- (BOOL)writeToFile:(NSString *)filePath atomically:(BOOL)useAuxiliaryFile;
|
||||
|
||||
@end
|
||||
245
YuMi/Structure/MVP/Model/NSObject+AutoCoding.m
Normal file
245
YuMi/Structure/MVP/Model/NSObject+AutoCoding.m
Normal file
@@ -0,0 +1,245 @@
|
||||
//
|
||||
// NSObject+AutoCoding.m
|
||||
// YYMobileFramework
|
||||
//
|
||||
// Created by wuwei on 14/6/13.
|
||||
// Copyright (c) 2014年 YY Inc. All rights reserved.
|
||||
//
|
||||
|
||||
#import "NSObject+AutoCoding.h"
|
||||
#import <objc/runtime.h>
|
||||
|
||||
#pragma GCC diagnostic ignored "-Wgnu"
|
||||
|
||||
static NSString *const AutocodingException = @"AutocodingException";
|
||||
|
||||
@implementation NSObject (AutoCoding)
|
||||
|
||||
+ (BOOL)supportsSecureCoding
|
||||
{
|
||||
return YES;
|
||||
}
|
||||
|
||||
+ (instancetype)objectWithContentsOfFile:(NSString *)filePath
|
||||
{
|
||||
//load the file
|
||||
NSData *data = [NSData dataWithContentsOfFile:filePath];
|
||||
|
||||
//attempt to deserialise data as a plist
|
||||
id object = nil;
|
||||
if (data)
|
||||
{
|
||||
NSPropertyListFormat format;
|
||||
object = [NSPropertyListSerialization propertyListWithData:data options:NSPropertyListImmutable format:&format error:NULL];
|
||||
|
||||
//success?
|
||||
if (object)
|
||||
{
|
||||
//check if object is an NSCoded unarchive
|
||||
if ([object respondsToSelector:@selector(objectForKey:)] && [(NSDictionary *)object objectForKey:@"$archiver"])
|
||||
{
|
||||
object = [NSKeyedUnarchiver unarchiveObjectWithData:data];
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
//return raw data
|
||||
object = data;
|
||||
}
|
||||
}
|
||||
|
||||
//return object
|
||||
return object;
|
||||
}
|
||||
|
||||
- (BOOL)writeToFile:(NSString *)filePath atomically:(BOOL)useAuxiliaryFile
|
||||
{
|
||||
//note: NSData, NSDictionary and NSArray already implement this method
|
||||
//and do not save using NSCoding, however the objectWithContentsOfFile
|
||||
//method will correctly recover these objects anyway
|
||||
|
||||
//archive object
|
||||
NSData *data = [NSKeyedArchiver archivedDataWithRootObject:self];
|
||||
return [data writeToFile:filePath atomically:useAuxiliaryFile];
|
||||
}
|
||||
|
||||
+ (NSDictionary *)codableProperties
|
||||
{
|
||||
unsigned int propertyCount;
|
||||
__autoreleasing NSMutableDictionary *codableProperties = [NSMutableDictionary dictionary];
|
||||
objc_property_t *properties = class_copyPropertyList(self, &propertyCount);
|
||||
for (unsigned int i = 0; i < propertyCount; i++)
|
||||
{
|
||||
//get property name
|
||||
objc_property_t property = properties[i];
|
||||
const char *propertyName = property_getName(property);
|
||||
__autoreleasing NSString *key = @(propertyName);
|
||||
|
||||
//check if codable
|
||||
//get property type
|
||||
Class propertyClass = nil;
|
||||
char *typeEncoding = property_copyAttributeValue(property, "T");
|
||||
switch (typeEncoding[0])
|
||||
{
|
||||
case '@':
|
||||
{
|
||||
if (strlen(typeEncoding) >= 3)
|
||||
{
|
||||
char *className = strndup(typeEncoding + 2, strlen(typeEncoding) - 3);
|
||||
__autoreleasing NSString *name = @(className);
|
||||
NSRange range = [name rangeOfString:@"<"];
|
||||
if (range.location != NSNotFound)
|
||||
{
|
||||
name = [name substringToIndex:range.location];
|
||||
}
|
||||
propertyClass = NSClassFromString(name) ?: [NSObject class];
|
||||
free(className);
|
||||
}
|
||||
break;
|
||||
}
|
||||
case 'c':
|
||||
case 'i':
|
||||
case 's':
|
||||
case 'l':
|
||||
case 'q':
|
||||
case 'C':
|
||||
case 'I':
|
||||
case 'S':
|
||||
case 'L':
|
||||
case 'Q':
|
||||
case 'f':
|
||||
case 'd':
|
||||
case 'B':
|
||||
{
|
||||
propertyClass = [NSNumber class];
|
||||
break;
|
||||
}
|
||||
case '{':
|
||||
{
|
||||
propertyClass = [NSValue class];
|
||||
break;
|
||||
}
|
||||
default:
|
||||
break;
|
||||
}
|
||||
free(typeEncoding);
|
||||
|
||||
if (propertyClass && [propertyClass conformsToProtocol:@protocol(NSSecureCoding)])
|
||||
{
|
||||
//check if there is a backing ivar
|
||||
char *ivar = property_copyAttributeValue(property, "V");
|
||||
if (ivar)
|
||||
{
|
||||
//check if ivar has KVC-compliant name
|
||||
__autoreleasing NSString *ivarName = @(ivar);
|
||||
if ([ivarName isEqualToString:key] || [ivarName isEqualToString:[@"_" stringByAppendingString:key]])
|
||||
{
|
||||
//no setter, but setValue:forKey: will still work
|
||||
codableProperties[key] = propertyClass;
|
||||
}
|
||||
free(ivar);
|
||||
}
|
||||
else
|
||||
{
|
||||
//check if property is dynamic and readwrite
|
||||
char *dynamic = property_copyAttributeValue(property, "D");
|
||||
char *readonly = property_copyAttributeValue(property, "R");
|
||||
if (dynamic && !readonly)
|
||||
{
|
||||
//no ivar, but setValue:forKey: will still work
|
||||
codableProperties[key] = propertyClass;
|
||||
}
|
||||
free(dynamic);
|
||||
free(readonly);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
free(properties);
|
||||
return codableProperties;
|
||||
}
|
||||
|
||||
- (NSDictionary *)codableProperties
|
||||
{
|
||||
__autoreleasing NSDictionary *codableProperties = objc_getAssociatedObject([self class], _cmd);
|
||||
if (!codableProperties)
|
||||
{
|
||||
codableProperties = [NSMutableDictionary dictionary];
|
||||
Class subclass = [self class];
|
||||
while (subclass != [NSObject class])
|
||||
{
|
||||
[(NSMutableDictionary *)codableProperties addEntriesFromDictionary:[subclass codableProperties]];
|
||||
subclass = [subclass superclass];
|
||||
}
|
||||
codableProperties = [NSDictionary dictionaryWithDictionary:codableProperties];
|
||||
|
||||
//make the association atomically so that we don't need to bother with an @synchronize
|
||||
objc_setAssociatedObject([self class], _cmd, codableProperties, OBJC_ASSOCIATION_RETAIN);
|
||||
}
|
||||
return codableProperties;
|
||||
}
|
||||
|
||||
- (NSDictionary *)dictionaryRepresentation
|
||||
{
|
||||
NSMutableDictionary *dict = [NSMutableDictionary dictionary];
|
||||
for (__unsafe_unretained NSString *key in [self codableProperties])
|
||||
{
|
||||
id value = [self valueForKey:key];
|
||||
if (value)
|
||||
dict[key] = value;
|
||||
else
|
||||
dict[key] = @"nil";
|
||||
}
|
||||
return dict;
|
||||
}
|
||||
|
||||
- (void)setWithCoder:(NSCoder *)aDecoder
|
||||
{
|
||||
BOOL secureAvailable = [aDecoder respondsToSelector:@selector(decodeObjectOfClass:forKey:)];
|
||||
BOOL secureSupported = [[self class] supportsSecureCoding];
|
||||
NSDictionary *properties = [self codableProperties];
|
||||
for (NSString *key in properties)
|
||||
{
|
||||
id object = nil;
|
||||
Class propertyClass = properties[key];
|
||||
if (secureAvailable)
|
||||
{
|
||||
if ([propertyClass isEqual:[NSMutableAttributedString class]]) {
|
||||
continue;
|
||||
}
|
||||
object = [aDecoder decodeObjectOfClass:propertyClass forKey:key];
|
||||
}
|
||||
else
|
||||
{
|
||||
if ([propertyClass isEqual:[NSMutableAttributedString class]]) {
|
||||
continue;
|
||||
}
|
||||
object = [aDecoder decodeObjectForKey:key];
|
||||
}
|
||||
if (object)
|
||||
{
|
||||
if (secureSupported && ![object isKindOfClass:propertyClass])
|
||||
{
|
||||
[NSException raise:AutocodingException format:@"Expected '%@' to be a %@, but was actually a %@", key, propertyClass, [object class]];
|
||||
}
|
||||
[self setValue:object forKey:key];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
- (instancetype)initWithCoder:(NSCoder *)aDecoder
|
||||
{
|
||||
[self setWithCoder:aDecoder];
|
||||
return self;
|
||||
}
|
||||
|
||||
- (void)encodeWithCoder:(NSCoder *)aCoder
|
||||
{
|
||||
for (NSString *key in [self codableProperties])
|
||||
{
|
||||
id object = [self valueForKey:key];
|
||||
if (object) [aCoder encodeObject:object forKey:key];
|
||||
}
|
||||
}
|
||||
|
||||
@end
|
||||
16
YuMi/Structure/MVP/Model/PIBaseModel.h
Normal file
16
YuMi/Structure/MVP/Model/PIBaseModel.h
Normal file
@@ -0,0 +1,16 @@
|
||||
//
|
||||
// PIBaseModel.h
|
||||
// YuMi
|
||||
//
|
||||
// Created by duoban on 2023/11/15.
|
||||
//
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface PIBaseModel : NSObject
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
36
YuMi/Structure/MVP/Model/PIBaseModel.m
Normal file
36
YuMi/Structure/MVP/Model/PIBaseModel.m
Normal file
@@ -0,0 +1,36 @@
|
||||
//
|
||||
// PIBaseModel.m
|
||||
// YuMi
|
||||
//
|
||||
// Created by duoban on 2023/11/15.
|
||||
//
|
||||
|
||||
#import "PIBaseModel.h"
|
||||
|
||||
@implementation PIBaseModel
|
||||
- (NSString *)debugDescription {
|
||||
//判断是否时NSArray 或者NSDictionary NSNumber 如果是的话直接返回 debugDescription
|
||||
if ([self isKindOfClass:[NSArray class]] || [self isKindOfClass:[NSDictionary class]] || [self isKindOfClass:[NSString class]] || [self isKindOfClass:[NSNumber class]]) {
|
||||
return [self debugDescription];
|
||||
}
|
||||
//声明一个字典
|
||||
NSMutableDictionary *dictionary = [NSMutableDictionary dictionary];
|
||||
//得到当前class的所有属性
|
||||
uint count;
|
||||
objc_property_t *properties = class_copyPropertyList([self class], &count);
|
||||
|
||||
//循环并用KVC得到每个属性的值
|
||||
for (int i = 0; i<count; i++) {
|
||||
objc_property_t property = properties[i];
|
||||
NSString *name = @(property_getName(property));
|
||||
id value = [self valueForKey:name]?:@"nil";//默认值为nil字符串
|
||||
[dictionary setObject:value forKey:name];//装载到字典里
|
||||
}
|
||||
|
||||
//释放
|
||||
free(properties);
|
||||
|
||||
//return
|
||||
return [NSString stringWithFormat:@"<%@: %p> -- %@",[self class],self,dictionary];
|
||||
}
|
||||
@end
|
||||
54
YuMi/Structure/MVP/Model/RelationUserVO.h
Normal file
54
YuMi/Structure/MVP/Model/RelationUserVO.h
Normal file
@@ -0,0 +1,54 @@
|
||||
//
|
||||
// RelationUserVO.h
|
||||
// YuMi
|
||||
//
|
||||
// Created by P on 2024/9/19.
|
||||
//
|
||||
|
||||
#import "PIBaseModel.h"
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
typedef NS_ENUM(NSUInteger, CP_TYPE) {
|
||||
CP_TYPE_CP = 1,
|
||||
CP_TYPE_BRO,
|
||||
CP_TYPE_SISTER,
|
||||
CP_TYPE_FRIEND
|
||||
};
|
||||
|
||||
typedef NS_ENUM(NSUInteger, CP_CLICK_TYPE) {
|
||||
CP_CLICK_TYPE_DEFAULT = 0,
|
||||
CP_CLICK_TYPE_SENDING,
|
||||
CP_CLICK_TYPE_PASSED
|
||||
};
|
||||
|
||||
@interface RelationUserVO : PIBaseModel
|
||||
|
||||
@property (nonatomic, assign) BOOL showCpAvatar;
|
||||
@property (nonatomic, assign) BOOL showCpAnim;
|
||||
|
||||
@property (nonatomic, copy) NSString *nick;
|
||||
@property (nonatomic, copy) NSString *avatar;
|
||||
@property (nonatomic, copy) NSString *cpNick;
|
||||
@property (nonatomic, copy) NSString *cpAvatar;
|
||||
|
||||
@property (nonatomic, assign) NSInteger uid;
|
||||
@property (nonatomic, assign) NSInteger cpUid;
|
||||
@property (nonatomic, assign) NSInteger cpDay;
|
||||
@property (nonatomic, assign) NSInteger cpLevel;
|
||||
@property (nonatomic, assign) NSInteger maxCpLevel;
|
||||
@property (nonatomic, assign) NSInteger currentExp;
|
||||
@property (nonatomic, assign) NSInteger nextLevelExp;
|
||||
@property (nonatomic, assign) NSInteger cancelGoldNum;
|
||||
|
||||
@property (nonatomic, assign) NSInteger endExp;
|
||||
@property (nonatomic, assign) NSInteger startExp;
|
||||
|
||||
@property (nonatomic, assign) CP_TYPE relationNameType;
|
||||
@property (nonatomic, assign) CP_CLICK_TYPE clickFlag; //默认状态0,1-您已经提交更换申请,请耐心等待。2-你需要30天才能更换状态。
|
||||
|
||||
- (BOOL)isEmptyRelation;
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
16
YuMi/Structure/MVP/Model/RelationUserVO.m
Normal file
16
YuMi/Structure/MVP/Model/RelationUserVO.m
Normal file
@@ -0,0 +1,16 @@
|
||||
//
|
||||
// RelationUserVO.m
|
||||
// YuMi
|
||||
//
|
||||
// Created by P on 2024/9/19.
|
||||
//
|
||||
|
||||
#import "RelationUserVO.h"
|
||||
|
||||
@implementation RelationUserVO
|
||||
|
||||
- (BOOL)isEmptyRelation {
|
||||
return self.cpAvatar.length == 0 || self.cpUid == 0 || self.cpNick.length == 0;
|
||||
}
|
||||
|
||||
@end
|
||||
21
YuMi/Structure/MVP/Model/UserExpand.h
Normal file
21
YuMi/Structure/MVP/Model/UserExpand.h
Normal file
@@ -0,0 +1,21 @@
|
||||
//
|
||||
// UserExpand.h
|
||||
// YUMI
|
||||
//
|
||||
// Created by zu on 2021/9/14.
|
||||
//
|
||||
|
||||
#import "NSObject+MJExtension.h"
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface UserExpand : PIBaseModel
|
||||
@property (nonatomic , assign) NSInteger id;
|
||||
@property (nonatomic , assign) BOOL showLocation;
|
||||
@property (nonatomic , assign) NSInteger uid;
|
||||
@property (nonatomic , assign) BOOL showAge;
|
||||
@property (nonatomic , assign) BOOL matchChat;
|
||||
@property (nonatomic , assign) BOOL sysMsgNotify;
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
12
YuMi/Structure/MVP/Model/UserExpand.m
Normal file
12
YuMi/Structure/MVP/Model/UserExpand.m
Normal file
@@ -0,0 +1,12 @@
|
||||
//
|
||||
// UserExpand.m
|
||||
// YUMI
|
||||
//
|
||||
// Created by zu on 2021/9/14.
|
||||
//
|
||||
|
||||
#import "UserExpand.h"
|
||||
|
||||
@implementation UserExpand
|
||||
|
||||
@end
|
||||
220
YuMi/Structure/MVP/Model/UserInfoModel.h
Normal file
220
YuMi/Structure/MVP/Model/UserInfoModel.h
Normal file
@@ -0,0 +1,220 @@
|
||||
//
|
||||
// UserInfoModel.h
|
||||
// xplan-ios
|
||||
//
|
||||
// Created by zu on 2021/9/14.
|
||||
//
|
||||
|
||||
#import "NSObject+MJExtension.h"
|
||||
#import "UserExpand.h"
|
||||
#import "UserLevelVo.h"
|
||||
#import "UserInfoSkillVo.h"
|
||||
#import "UserVipInfoVo.h"
|
||||
#import "UserPhoto.h"
|
||||
#import "UserGiftWallInfoModel.h"
|
||||
#import "MomentsInfoModel.h"
|
||||
#import "XPSoundCardModel.h"
|
||||
#import "MedalModel.h"
|
||||
#import "RelationUserVO.h"
|
||||
#import "GuildInfo.h"
|
||||
#import "NameplateModel.h"
|
||||
#import "BaseModelVo.h"
|
||||
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface UsingPersonalBackground : PIBaseModel
|
||||
|
||||
@property(nonatomic, assign) NSInteger effectType; // 装扮动效图片类型 空/0-图,1-mp4,2-svga
|
||||
@property(nonatomic, assign) NSInteger status;
|
||||
@property(nonatomic, assign) NSInteger id;
|
||||
@property(nonatomic, assign) NSInteger partitionFlag;
|
||||
@property(nonatomic, assign) NSTimeInterval updateTime;
|
||||
@property(nonatomic, assign) NSTimeInterval createTime;
|
||||
@property(nonatomic, copy) NSString *pic;
|
||||
@property(nonatomic, copy) NSString *effect;
|
||||
@property(nonatomic, copy) NSString *name;
|
||||
|
||||
@end
|
||||
|
||||
@interface InfoCardVO : PIBaseModel
|
||||
|
||||
@property(nonatomic, assign) NSInteger effectType; // 装扮动效图片类型 空/0-图,1-mp4,2-svga
|
||||
@property(nonatomic, copy) NSString *effect;
|
||||
|
||||
@end
|
||||
|
||||
|
||||
@interface UserInfoModel : PIBaseModel
|
||||
@property (nonatomic , assign) NSInteger bindType;
|
||||
@property (nonatomic , assign) NSInteger createTime;
|
||||
@property (nonatomic , assign) BOOL parentMode;
|
||||
@property (nonatomic , assign) BOOL isBindPhone;
|
||||
@property (nonatomic , strong) UserExpand * userExpand;
|
||||
@property (nonatomic , assign) NSInteger erbanNo;
|
||||
@property (nonatomic , assign) NSInteger registerDay;
|
||||
@property (nonatomic , assign) BOOL isFirstCharge;
|
||||
@property (nonatomic , assign) BOOL hasPrettyErbanNo;
|
||||
@property (nonatomic , strong) UserLevelVo * userLevelVo;
|
||||
@property (nonatomic , assign) BOOL isBindApple;
|
||||
@property (nonatomic , assign) NSInteger fansNum;
|
||||
@property (nonatomic , assign) BOOL isBindBankCard;
|
||||
@property (nonatomic , assign) BOOL hasRegPacket;
|
||||
@property (nonatomic , assign) GenderType gender;
|
||||
@property (nonatomic , assign) NSInteger platformRole; /// 0 普通 1超管
|
||||
@property (nonatomic , assign) NSInteger uid;
|
||||
@property (nonatomic , assign) NSInteger defUser;
|
||||
@property (nonatomic , copy) NSString * phone;
|
||||
@property (nonatomic , copy) NSString * email;
|
||||
@property (nonatomic , copy) NSString * nick;
|
||||
@property (nonatomic , assign) NSInteger remainDay;
|
||||
@property (nonatomic , copy) NSString * avatar;
|
||||
@property (nonatomic , copy) NSString * reviewingAvatar;
|
||||
@property (nonatomic , assign) BOOL isReview;
|
||||
@property (nonatomic , strong) UserInfoSkillVo * userInfoSkillVo;
|
||||
@property (nonatomic,copy) NSString *region;
|
||||
@property (nonatomic,copy) NSArray *labels;
|
||||
@property (nonatomic , assign) BOOL newUser;
|
||||
@property (nonatomic , assign) NSInteger followNum;
|
||||
@property (nonatomic , assign) BOOL isBindPaymentPwd;
|
||||
@property (nonatomic , assign) BOOL isBindXCZAccount;
|
||||
@property (nonatomic , assign) BOOL isBindAlipay;
|
||||
///是否绑定了密码
|
||||
@property (nonatomic , assign) BOOL isBindPasswd;
|
||||
@property (nonatomic, assign) NSInteger visitNum;///访客数量
|
||||
@property (nonatomic, assign) NSInteger inRoomNum;///足迹
|
||||
///是否需要展示限时首充列表
|
||||
@property (nonatomic, assign) BOOL showLimitCharge;
|
||||
///限时首充结束时间
|
||||
@property (nonatomic, assign) long limitChargeEndTime;
|
||||
///相册
|
||||
@property (nonatomic, strong) NSArray<UserPhoto *> *privatePhoto;//相册
|
||||
///签名
|
||||
@property (nonatomic,copy) NSString *userDesc;
|
||||
///出生日期
|
||||
@property (nonatomic,assign) long birth;
|
||||
///是否实名认证
|
||||
@property (nonatomic,assign) BOOL isCertified;
|
||||
///铭牌背景
|
||||
@property (nonatomic, copy) NSString *nameplatePic;
|
||||
///铭牌名称
|
||||
@property (nonatomic, copy) NSString *nameplateWord;
|
||||
///是否自定义铭牌,
|
||||
@property(nonatomic,assign) BOOL isCustomWord;
|
||||
///如果在房间有直播中字段
|
||||
@property(nonatomic, copy) NSString * roomUid;
|
||||
///如果在房间,房间的标题
|
||||
@property (nonatomic, copy) NSString *roomTitle;
|
||||
///用户信息中的 座驾 并不需要CarModel 映射一下吧
|
||||
@property (nonatomic,copy) NSString *carEffect;
|
||||
///座驾特效类型 0:普通, 1:VAP特效
|
||||
@property (nonatomic, assign) NSInteger otherViewType;
|
||||
///用户信息中需要用VAP播放的座驾, 映射一下
|
||||
@property (nonatomic, copy) NSString *viewUrl;
|
||||
///用户信息中的 座驾昵称 并不需要CarModel 映射一下吧
|
||||
@property (nonatomic,copy) NSString *carName;
|
||||
///用户信息中的 头饰的动画 从 HeadwearModel 映射而来
|
||||
@property (nonatomic,copy) NSString *headwearEffect;
|
||||
///用户信息中的 头饰的动画 如果没有的话 就用这个 从 HeadwearModel 映射而来
|
||||
@property (nonatomic,copy) NSString *headwearPic;
|
||||
@property (nonatomic,assign) NSInteger headwearType; // 1 = svga, 表示 headwearEffect 是 svga 的链接
|
||||
@property (nonatomic,assign) NSInteger headWearType; // 1 = svga, 表示 headwearEffect 是 svga 的链接, W 大小写不一致是后端的原因,这里做个兼容
|
||||
///头饰(新字段) 上麦的时候 在扩展字段中的 只用在坑位上 从 HeadwearModel 映射而来
|
||||
@property (nonatomic,copy) NSString *headWearUrl;
|
||||
#pragma mark - 相亲房的字段
|
||||
///是否为相亲模式VIP坑位
|
||||
@property (nonatomic,assign) BOOL vipMic;
|
||||
///帽子 相亲中收到礼物值最高的那个人 男神 女神都有
|
||||
@property (nonatomic,copy) NSString *capUrl;
|
||||
///是不是选择了人
|
||||
@property (nonatomic,assign) BOOL hasSelectUser;
|
||||
///所选择的麦序
|
||||
@property (nonatomic,assign) int selectMicPosition;
|
||||
///VIP信息
|
||||
@property (nonatomic, strong) UserVipInfoVo *userVipInfoVO;
|
||||
///当前使用的资料卡装扮
|
||||
@property (nonatomic, copy) NSString *userInfoCardPic;
|
||||
///麦位光圈链接
|
||||
@property (nonatomic, copy) NSString *micCircle;
|
||||
///麦位昵称颜色
|
||||
@property (nonatomic, copy) NSString *micNickColor;
|
||||
|
||||
///技能卡图标列表
|
||||
@property (nonatomic, strong) NSArray *absCardPics;
|
||||
|
||||
///跟随的 本地添加的字段
|
||||
@property (nonatomic,copy) NSString *fromNick;
|
||||
@property (nonatomic,assign) UserEnterRoomFromType fromType;
|
||||
@property (nonatomic,copy) NSString *fromUid;
|
||||
///安卓房间公屏气泡
|
||||
@property (nonatomic, copy) NSString *androidBubbleUrl;
|
||||
///iOS房间公屏气泡
|
||||
@property (nonatomic, copy) NSString *iosBubbleUrl;
|
||||
#pragma mark - 小游戏
|
||||
/// 小游戏状态 0 未加入游戏;1 加入游戏未准备;2 加入游戏已准备 3 游戏中
|
||||
@property (nonatomic, assign) LittleGamePlayStatus gameStatus;
|
||||
///用户的参加PK的类型
|
||||
@property (nonatomic, assign) GroupType groupType;
|
||||
///礼物墙中的礼物
|
||||
@property (nonatomic,strong) NSArray<UserGiftWallInfoModel *> *userGiftWall;
|
||||
///礼物墙中的幸运礼物礼物
|
||||
@property (nonatomic,strong) NSArray<UserGiftWallInfoModel *> *userLuckyBagGiftWall;
|
||||
///是否防被踢
|
||||
@property (nonatomic, assign) BOOL preventKick;
|
||||
///是否符合渠道打招呼
|
||||
@property (nonatomic,assign) BOOL fromSayHelloChannel;
|
||||
///是否是封号用户
|
||||
@property (nonatomic,assign) BOOL banAccount;
|
||||
///用户的动态
|
||||
@property (nonatomic,strong) NSArray<MomentsInfoModel *> *dynamicInfo;
|
||||
///区号
|
||||
@property (nonatomic,copy) NSString *phoneAreaCode;
|
||||
///声音卡
|
||||
@property (nonatomic,strong) XPSoundCardModel *audioCard;
|
||||
|
||||
///用户所在区
|
||||
@property(nonatomic,copy) NSString *partitionId;
|
||||
///
|
||||
///
|
||||
@property (nonatomic,strong) NSMutableAttributedString *levelAtt;
|
||||
@property (nonatomic,strong) NSMutableAttributedString *idAtt;
|
||||
///是否是代充代理
|
||||
@property(nonatomic,assign) BOOL isRechargeUser;
|
||||
///pk时不能禁麦
|
||||
@property(nonatomic,assign) BOOL isNoProhibitMic;
|
||||
|
||||
@property (nonatomic, strong) MedalModel *medals;
|
||||
|
||||
@property (nonatomic, strong) RelationUserVO *relationUserVO;
|
||||
|
||||
@property (nonatomic, strong) GuildInfo *guildInfo;
|
||||
|
||||
@property (nonatomic, copy) NSArray <NameplateModel *> *userNameplateList;
|
||||
|
||||
@property(nonatomic, strong) UsingPersonalBackground *usingPersonalBackground;
|
||||
|
||||
@property(nonatomic, strong) InfoCardVO *infoCardVo;
|
||||
|
||||
/// 是否超管身份
|
||||
@property(nonatomic, assign) BOOL hasSuperRole;
|
||||
|
||||
@property(nonatomic, copy) NSString *guildNameplateIcon;
|
||||
|
||||
@property(nonatomic, assign) NSInteger uploadGifAvatarPrice;
|
||||
|
||||
@property(nonatomic, copy) NSString *regionIcon;
|
||||
@property(nonatomic, copy) NSString *visitTimeDesc;
|
||||
|
||||
@property (nonatomic, copy) NSArray <BaseModelVo *> *medalsPic;
|
||||
|
||||
- (BOOL)isUserValid;
|
||||
- (NSString *)userIDString;
|
||||
|
||||
- (BOOL)isHeadWearSVGA;
|
||||
|
||||
- (BOOL)isArabia;
|
||||
- (BOOL)isEnglish;
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
84
YuMi/Structure/MVP/Model/UserInfoModel.m
Normal file
84
YuMi/Structure/MVP/Model/UserInfoModel.m
Normal file
@@ -0,0 +1,84 @@
|
||||
//
|
||||
// UserInfoModel.m
|
||||
// xplan-ios
|
||||
//
|
||||
// Created by zu on 2021/9/14.
|
||||
//
|
||||
|
||||
#import "UserInfoModel.h"
|
||||
|
||||
@implementation InfoCardVO
|
||||
|
||||
@end
|
||||
|
||||
@implementation UsingPersonalBackground
|
||||
|
||||
@end
|
||||
|
||||
@implementation UserInfoModel
|
||||
|
||||
+ (NSDictionary *)objectClassInArray {
|
||||
return @{
|
||||
@"privatePhoto":UserPhoto.class,
|
||||
@"userGiftWall":UserGiftWallInfoModel.class,
|
||||
@"userLuckyBagGiftWall":UserGiftWallInfoModel.class,
|
||||
@"dynamicInfo":MomentsInfoModel.class,
|
||||
@"audioCard":XPSoundCardModel.class,
|
||||
@"userNameplateList":NameplateModel.class,
|
||||
@"usingPersonalBackground":UsingPersonalBackground.class,
|
||||
@"infoCardVo" : InfoCardVO.class,
|
||||
@"medalsPic": BaseModelVo.class
|
||||
};
|
||||
}
|
||||
|
||||
///如果一个模型中需要字段映射的话 比如id -> ID name -> other.name
|
||||
+ (NSDictionary *)replacedKeyFromPropertyName {
|
||||
return @{@"carEffect": @"carport.effect",
|
||||
@"viewUrl": @"carport.viewUrl",
|
||||
@"otherViewType": @"carport.otherViewType",
|
||||
@"headwearEffect" : @"userHeadwear.effect",
|
||||
@"headwearPic" : @"userHeadwear.pic",
|
||||
@"headwearType" : @"userHeadwear.type",
|
||||
@"carName": @"carport.name",
|
||||
@"reviewingAvatar" : @"newAvatar"
|
||||
};
|
||||
}
|
||||
|
||||
- (BOOL)isUserValid {
|
||||
return self.uid > 0;
|
||||
}
|
||||
|
||||
- (NSString *)userIDString {
|
||||
return [NSString stringWithFormat:@"%ld", (long)self.uid];
|
||||
}
|
||||
|
||||
- (BOOL)isEqual:(id)object {
|
||||
if (self == object) {
|
||||
return YES;
|
||||
}
|
||||
if (![object isKindOfClass:[UserInfoModel class]]) {
|
||||
return NO;
|
||||
}
|
||||
UserInfoModel *other = (UserInfoModel *)object;
|
||||
return self.uid == other.uid &&
|
||||
[self.nick isEqualToString:other.nick] &&
|
||||
[self.avatar isEqualToString:self.avatar];
|
||||
}
|
||||
|
||||
- (NSUInteger)hash {
|
||||
return self.nick.hash ^ self.uid;
|
||||
}
|
||||
|
||||
- (BOOL)isHeadWearSVGA {
|
||||
return self.headwearType == 1 || self.headWearType == 1;
|
||||
}
|
||||
|
||||
- (BOOL)isArabia {
|
||||
return [self.partitionId isEqualToString:@"2"];
|
||||
}
|
||||
|
||||
- (BOOL)isEnglish {
|
||||
return [self.partitionId isEqualToString:@"1"];
|
||||
}
|
||||
|
||||
@end
|
||||
16
YuMi/Structure/MVP/Model/UserInfoSkillVo.h
Normal file
16
YuMi/Structure/MVP/Model/UserInfoSkillVo.h
Normal file
@@ -0,0 +1,16 @@
|
||||
//
|
||||
// UserInfoSkillVo.h
|
||||
// YUMI
|
||||
//
|
||||
// Created by zu on 2021/9/14.
|
||||
//
|
||||
|
||||
#import "NSObject+MJExtension.h"
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface UserInfoSkillVo : PIBaseModel
|
||||
@property (nonatomic , assign) BOOL liveTag;
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
12
YuMi/Structure/MVP/Model/UserInfoSkillVo.m
Normal file
12
YuMi/Structure/MVP/Model/UserInfoSkillVo.m
Normal file
@@ -0,0 +1,12 @@
|
||||
//
|
||||
// UserInfoSkillVo.m
|
||||
// YUMI
|
||||
//
|
||||
// Created by zu on 2021/9/14.
|
||||
//
|
||||
|
||||
#import "UserInfoSkillVo.h"
|
||||
|
||||
@implementation UserInfoSkillVo
|
||||
|
||||
@end
|
||||
32
YuMi/Structure/MVP/Model/UserLevelVo.h
Normal file
32
YuMi/Structure/MVP/Model/UserLevelVo.h
Normal file
@@ -0,0 +1,32 @@
|
||||
//
|
||||
// UserLevelVo.h
|
||||
// YUMI
|
||||
//
|
||||
// Created by zu on 2021/9/14.
|
||||
//
|
||||
|
||||
#import "NSObject+MJExtension.h"
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
typedef NS_ENUM(NSInteger, UserLevelType) {
|
||||
UserLevelType_Common = 1,///普通人
|
||||
UserLevelType_Offical = 2,///官方
|
||||
UserLevelType_Robot = 3, ///机器人
|
||||
};
|
||||
|
||||
@interface UserLevelVo : PIBaseModel
|
||||
@property (nonatomic , copy) NSString * experUrl;
|
||||
@property (nonatomic , assign) NSInteger charmLevelSeq;
|
||||
@property (nonatomic , copy) NSString * experLevelName;
|
||||
@property (nonatomic , copy) NSString * charmLevelName;
|
||||
@property (nonatomic , assign) NSInteger charmAmount;
|
||||
@property (nonatomic , copy) NSString * experLevelGrp;
|
||||
@property (nonatomic , copy) NSString * charmUrl;
|
||||
@property (nonatomic , assign) NSInteger experLevelSeq;
|
||||
@property (nonatomic , assign) NSInteger experAmount;
|
||||
@property (nonatomic , copy) NSString * charmLevelGrp;
|
||||
///账号类型
|
||||
@property(nonatomic, assign) UserLevelType defUser; //账号类型
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
12
YuMi/Structure/MVP/Model/UserLevelVo.m
Normal file
12
YuMi/Structure/MVP/Model/UserLevelVo.m
Normal file
@@ -0,0 +1,12 @@
|
||||
//
|
||||
// UserLevelVo.m
|
||||
// YUMI
|
||||
//
|
||||
// Created by zu on 2021/9/14.
|
||||
//
|
||||
|
||||
#import "UserLevelVo.h"
|
||||
|
||||
@implementation UserLevelVo
|
||||
|
||||
@end
|
||||
18
YuMi/Structure/MVP/Model/UserPhoto.h
Normal file
18
YuMi/Structure/MVP/Model/UserPhoto.h
Normal file
@@ -0,0 +1,18 @@
|
||||
//
|
||||
// UserPhoto.h
|
||||
// YUMI
|
||||
//
|
||||
// Created by YUMI on 2021/9/23.
|
||||
//
|
||||
|
||||
#import "NSObject+MJExtension.h"
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface UserPhoto : PIBaseModel
|
||||
@property (copy, nonatomic) NSString *photoUrl;
|
||||
@property (copy, nonatomic) NSString *pid;
|
||||
@property (nonatomic, assign) BOOL isReview;
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
13
YuMi/Structure/MVP/Model/UserPhoto.m
Normal file
13
YuMi/Structure/MVP/Model/UserPhoto.m
Normal file
@@ -0,0 +1,13 @@
|
||||
//
|
||||
// UserPhoto.m
|
||||
// YUMI
|
||||
//
|
||||
// Created by YUMI on 2021/9/23.
|
||||
//
|
||||
|
||||
#import "UserPhoto.h"
|
||||
|
||||
@implementation UserPhoto
|
||||
|
||||
|
||||
@end
|
||||
55
YuMi/Structure/MVP/Model/UserVipInfoVo.h
Normal file
55
YuMi/Structure/MVP/Model/UserVipInfoVo.h
Normal file
@@ -0,0 +1,55 @@
|
||||
//
|
||||
// UserVipInfoVo.h
|
||||
// YUMI
|
||||
//
|
||||
// Created by YUMI on 2022/1/4.
|
||||
// VIP信息
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface UserVipInfoVo : PIBaseModel
|
||||
|
||||
///VIP图标
|
||||
@property (nonatomic, copy) NSString *vipIcon;
|
||||
///VIP等级
|
||||
@property (nonatomic, assign) NSInteger vipLevel;
|
||||
//用户好友昵称颜色
|
||||
@property (nonatomic, copy) NSString *friendNickColour;
|
||||
///是否防被踢
|
||||
@property (nonatomic, assign) BOOL preventKick;
|
||||
///是否隐身进房
|
||||
@property (nonatomic, assign) BOOL enterHide;
|
||||
///VIP进房特效
|
||||
@property (nonatomic, copy) NSString *enterRoomEffects;
|
||||
///VIP名称
|
||||
@property (nonatomic, copy) NSString *vipName;
|
||||
///隐身访问主页
|
||||
@property (nonatomic,assign) BOOL lookHomepageHide;
|
||||
|
||||
@property (nonatomic, copy) NSString *userCardBG;
|
||||
/// 是否可以上传动态头像
|
||||
@property (nonatomic, assign) BOOL uploadGifAvatar;
|
||||
/// 过期时间
|
||||
@property (nonatomic, assign) NSTimeInterval expireTime;
|
||||
/// 是否防跟随进房
|
||||
@property (nonatomic, assign) BOOL preventTrace;
|
||||
/// 是否防关注
|
||||
@property (nonatomic, assign) BOOL preventFollow;
|
||||
/// 查看访客
|
||||
@property(nonatomic, assign) BOOL visitHide;
|
||||
/// 是否無痕瀏覽
|
||||
@property(nonatomic, assign) BOOL visitListView;
|
||||
|
||||
@property (nonatomic, assign) bool privateChatLimit;
|
||||
|
||||
@property (nonatomic, copy) NSString *nameplateUrl;
|
||||
|
||||
@property(nonatomic, assign) NSInteger visitListVipLimit;
|
||||
|
||||
@property(nonatomic, assign) BOOL roomPicScreen; // 是否能发送房间公屏图片消息
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
12
YuMi/Structure/MVP/Model/UserVipInfoVo.m
Normal file
12
YuMi/Structure/MVP/Model/UserVipInfoVo.m
Normal file
@@ -0,0 +1,12 @@
|
||||
//
|
||||
// UserVipInfoVo.m
|
||||
// YUMI
|
||||
//
|
||||
// Created by YUMI on 2022/1/4.
|
||||
//
|
||||
|
||||
#import "UserVipInfoVo.h"
|
||||
|
||||
@implementation UserVipInfoVo
|
||||
|
||||
@end
|
||||
37
YuMi/Structure/MVP/Presenter/BaseMvpPresenter.h
Normal file
37
YuMi/Structure/MVP/Presenter/BaseMvpPresenter.h
Normal file
@@ -0,0 +1,37 @@
|
||||
//
|
||||
// BaseMvpPresenter.h
|
||||
// YUMI
|
||||
//
|
||||
// Created by admin on 2023/3/9.
|
||||
//
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
#import "BaseMvpProtocol.h"
|
||||
#import "HttpRequestHelper.h"
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
typedef void(^HttpSuccess)(BaseModel *data);
|
||||
typedef void(^HttpFail)(NSInteger code, NSString * _Nullable msg);
|
||||
|
||||
@interface BaseMvpPresenter : NSObject
|
||||
|
||||
- (void)attatchView:(id)view;
|
||||
- (id)getView;
|
||||
- (void)detatchView;
|
||||
- (void)logout;
|
||||
- (void)tokenInvalid;
|
||||
- (HttpRequestHelperCompletion)createHttpCompletion:(HttpSuccess _Nonnull)success;
|
||||
- (HttpRequestHelperCompletion)createHttpCompletion:(HttpSuccess _Nonnull)success showLoading:(BOOL)loading;
|
||||
- (HttpRequestHelperCompletion)createHttpCompletion:(HttpSuccess _Nonnull)success errorToast:(BOOL)toast;
|
||||
- (HttpRequestHelperCompletion)createHttpCompletion:(HttpSuccess _Nonnull)success showLoading:(BOOL)loading errorToast:(BOOL)toast;
|
||||
- (HttpRequestHelperCompletion)createHttpCompletion:(HttpSuccess _Nonnull)success fail:(HttpFail _Nullable)fail;
|
||||
- (HttpRequestHelperCompletion)createHttpCompletion:(HttpSuccess _Nonnull)success fail:(HttpFail _Nullable)fail showLoading:(BOOL)loading;
|
||||
- (HttpRequestHelperCompletion)createHttpCompletion:(HttpSuccess _Nonnull)success fail:(HttpFail _Nullable)fail errorToast:(BOOL)toast;
|
||||
- (HttpRequestHelperCompletion)createHttpCompletion:(HttpSuccess _Nonnull)success fail:(HttpFail _Nullable)fail showLoading:(BOOL)loading errorToast:(BOOL)toast;
|
||||
|
||||
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
164
YuMi/Structure/MVP/Presenter/BaseMvpPresenter.m
Normal file
164
YuMi/Structure/MVP/Presenter/BaseMvpPresenter.m
Normal file
@@ -0,0 +1,164 @@
|
||||
//
|
||||
// BaseMvpPresenter.m
|
||||
// YUMI
|
||||
//
|
||||
// Created by admin on 2023/3/9.
|
||||
//
|
||||
|
||||
#import "BaseMvpPresenter.h"
|
||||
#import "AccountInfoStorage.h"
|
||||
#import <NIMSDK/NIMSDK.h>
|
||||
#import "ClientConfig.h"
|
||||
#import "LoginViewController.h"
|
||||
#import "BaseNavigationController.h"
|
||||
#import "FirstRechargeManager.h"
|
||||
#import "PublicRoomManager.h"
|
||||
#import "RoomBoomManager.h"
|
||||
|
||||
@interface BaseMvpPresenter()
|
||||
|
||||
@property (nonatomic, weak) id view;
|
||||
|
||||
@end
|
||||
|
||||
@implementation BaseMvpPresenter
|
||||
|
||||
- (void)attatchView:(id)view {
|
||||
self.view = view;
|
||||
}
|
||||
|
||||
- (id)getView {
|
||||
return self.view;
|
||||
}
|
||||
|
||||
- (void)logout {
|
||||
// 1. 停止首充监控
|
||||
[[FirstRechargeManager sharedManager] stopMonitoring];
|
||||
|
||||
// 2. 重置公共房间管理器
|
||||
[[PublicRoomManager sharedManager] reset];
|
||||
|
||||
// 3. 清理房间火箭管理器状态
|
||||
[[RoomBoomManager sharedManager] leaveRoom];
|
||||
|
||||
// 4. 数据logout
|
||||
[[AccountInfoStorage instance] saveAccountInfo:nil];
|
||||
[[AccountInfoStorage instance] saveTicket:nil];
|
||||
if ([NIMSDK sharedSDK].loginManager.isLogined) {
|
||||
[[NIMSDK sharedSDK].loginManager logout:nil];
|
||||
}
|
||||
// 5. 跳登录页面
|
||||
[self tokenInvalid];
|
||||
// ///关闭心跳
|
||||
// [[ClientConfig shareConfig] resetHeartBratTimer];
|
||||
}
|
||||
|
||||
- (HttpRequestHelperCompletion)createHttpCompletion:(HttpSuccess)success {
|
||||
return [self createHttpCompletion:success fail:nil];
|
||||
}
|
||||
|
||||
- (HttpRequestHelperCompletion)createHttpCompletion:(HttpSuccess)success showLoading:(BOOL)loading {
|
||||
return [self createHttpCompletion:success fail:nil showLoading:loading];
|
||||
}
|
||||
|
||||
- (HttpRequestHelperCompletion)createHttpCompletion:(HttpSuccess)success errorToast:(BOOL)toast {
|
||||
return [self createHttpCompletion:success fail:nil errorToast:toast];
|
||||
}
|
||||
|
||||
- (HttpRequestHelperCompletion)createHttpCompletion:(HttpSuccess)success showLoading:(BOOL)loading errorToast:(BOOL)toast {
|
||||
return [self createHttpCompletion:success fail:nil showLoading:loading errorToast:toast];
|
||||
}
|
||||
|
||||
- (HttpRequestHelperCompletion)createHttpCompletion:(HttpSuccess)success fail:(HttpFail)fail {
|
||||
return [self createHttpCompletion:success fail:fail showLoading:NO errorToast:YES];
|
||||
}
|
||||
|
||||
- (HttpRequestHelperCompletion)createHttpCompletion:(HttpSuccess)success fail:(HttpFail)fail showLoading:(BOOL)loading {
|
||||
return [self createHttpCompletion:success fail:fail showLoading:loading errorToast:YES];
|
||||
}
|
||||
|
||||
- (HttpRequestHelperCompletion)createHttpCompletion:(HttpSuccess)success fail:(HttpFail)fail errorToast:(BOOL)toast {
|
||||
return [self createHttpCompletion:success fail:fail showLoading:NO errorToast:toast];
|
||||
}
|
||||
|
||||
- (HttpRequestHelperCompletion)createHttpCompletion:(HttpSuccess)success fail:(HttpFail)fail showLoading:(BOOL)loading errorToast:(BOOL)toast {
|
||||
if (loading) {
|
||||
[self.view showAnchorLoading];
|
||||
}
|
||||
return ^(BaseModel *data, NSInteger code, NSString * _Nullable msg) {
|
||||
if (loading) {
|
||||
[self.view hideHUD];
|
||||
}
|
||||
if (code == 200) {
|
||||
success(data);
|
||||
return;
|
||||
}
|
||||
|
||||
switch (code) {
|
||||
case 401: // 登录过期
|
||||
[self logout];
|
||||
return;
|
||||
case 407:
|
||||
case 408:
|
||||
[self accountBanned:data];
|
||||
return;
|
||||
case 1415: // 未完善用户信息
|
||||
[[self getView] completeUserInfo];
|
||||
return;
|
||||
case 3009: // 账号已注销
|
||||
// [[self getView] accountCanceled:data.model2dictionary];
|
||||
// return;
|
||||
case 31005: {//余额不足
|
||||
}
|
||||
break;
|
||||
case 30000: {// 青少年模式进房错误,进行弹窗处理,同时不显示 toast。
|
||||
}
|
||||
break;
|
||||
case 10111: // 金额过大,需要先实名认证
|
||||
[self.view hideHUD];
|
||||
[[self getView] showRealNameAuthenticationTipsAlertView];
|
||||
return;
|
||||
case 10108: // 未实名认证
|
||||
[self.view hideHUD];
|
||||
[[self getView] showRealNameAuthenticationTipsAlertView];
|
||||
return;
|
||||
case 25000: {// 在青少年模式下,充值已达上限
|
||||
}
|
||||
}
|
||||
|
||||
if (toast && [self.view respondsToSelector:@selector(showErrorToast:)]) {
|
||||
[self.view showErrorToast:msg];
|
||||
}
|
||||
|
||||
if (fail) {
|
||||
fail(code, msg);
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
- (void)detatchView {
|
||||
|
||||
}
|
||||
|
||||
- (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:^{ }];
|
||||
}
|
||||
|
||||
- (void)tokenInvalid {
|
||||
LoginViewController *loginVC = [[LoginViewController alloc] init];
|
||||
BaseNavigationController * nav = [[BaseNavigationController alloc] initWithRootViewController:loginVC];
|
||||
nav.modalPresentationStyle = UIModalPresentationFullScreen;
|
||||
kWindow.rootViewController = nav;
|
||||
}
|
||||
|
||||
@end
|
||||
25
YuMi/Structure/MVP/Protocol/BaseMvpProtocol.h
Normal file
25
YuMi/Structure/MVP/Protocol/BaseMvpProtocol.h
Normal file
@@ -0,0 +1,25 @@
|
||||
//
|
||||
// BaseMvpProtocol.h
|
||||
// YUMI
|
||||
//
|
||||
// Created by admin on 2023/3/9.
|
||||
//
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
#import "BaseViewController.h"
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
@class BaseModel;
|
||||
@protocol BaseMvpProtocol <NSObject, BaseViewControllerProtocol>
|
||||
|
||||
@optional
|
||||
|
||||
- (void)completeUserInfo;
|
||||
- (void)accountCanceled:(NSDictionary *)data;
|
||||
|
||||
///实名认证弹窗
|
||||
- (void)showRealNameAuthenticationTipsAlertView;
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
31
YuMi/Structure/MVP/View/MvpViewController.h
Normal file
31
YuMi/Structure/MVP/View/MvpViewController.h
Normal file
@@ -0,0 +1,31 @@
|
||||
//
|
||||
// MvpViewController.h
|
||||
// YUMI
|
||||
//
|
||||
// Created by admin on 2023/3/9.
|
||||
//
|
||||
|
||||
#import "BaseViewController.h"
|
||||
#import "BaseMvpPresenter.h"
|
||||
|
||||
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
|
||||
typedef void(^HeaderRefreshComplete)(void);
|
||||
|
||||
@interface MvpViewController<T> : BaseViewController
|
||||
|
||||
@property (nonatomic, strong) __kindof T presenter;
|
||||
|
||||
- (__kindof T)createPresenter;
|
||||
|
||||
- (void)setupTopTheme;
|
||||
|
||||
- (void)setupCustomNavigationBar:(void(^)(void))backAction title:(NSString *)title titleColor:(UIColor *)color;
|
||||
- (void)setupCustonNavigationRightButtons:(NSArray <UIButton *>*)array sizes:(NSArray <NSValue *> *)sizes;
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
221
YuMi/Structure/MVP/View/MvpViewController.m
Normal file
221
YuMi/Structure/MVP/View/MvpViewController.m
Normal file
@@ -0,0 +1,221 @@
|
||||
//
|
||||
// MvpViewController.m
|
||||
// YUMI
|
||||
//
|
||||
// Created by admin on 2023/3/9.
|
||||
//
|
||||
|
||||
#import "MvpViewController.h"
|
||||
#import "BaseMvpProtocol.h"
|
||||
#import "BaseMvpPresenter.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"
|
||||
#import "BSRealTimeView.h"
|
||||
|
||||
@interface MvpViewController ()
|
||||
|
||||
@property (nonatomic, copy) void(^backAction)(void);
|
||||
@property (nonatomic, strong) UILabel *mvpTitleLabel;
|
||||
@property (nonatomic, strong) UIButton *backButton;
|
||||
|
||||
@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)setupTopTheme {
|
||||
__block UIImageView *theme = [[UIImageView alloc] initWithFrame:CGRectMake(0, 0, KScreenWidth, kGetScaleWidth(140))];
|
||||
theme.image = [[ClientConfig shareConfig] navigationAreaBG];
|
||||
theme.contentMode = UIViewContentModeScaleAspectFill;
|
||||
[self.view addSubview:theme];
|
||||
|
||||
[[NSNotificationCenter defaultCenter] addObserverForName:[ClientConfig shareConfig].reloadNavigationAreaImageKey
|
||||
object:nil
|
||||
queue:[NSOperationQueue mainQueue]
|
||||
usingBlock:^(NSNotification * _Nonnull notification) {
|
||||
if ([notification.object isKindOfClass:[UIImage class]]) {
|
||||
theme.image = (UIImage *)notification.object;
|
||||
}
|
||||
}];
|
||||
}
|
||||
|
||||
- (void)setupCustomNavigationBar:(void(^)(void))backAction title:(NSString *)title titleColor:(UIColor *)color {
|
||||
UILabel *titleLabel = [self mvpTitleLabel];
|
||||
titleLabel.text = title;
|
||||
titleLabel.textColor = color;
|
||||
[self.view addSubview:titleLabel];
|
||||
[titleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.centerX.mas_equalTo(self.view);
|
||||
make.top.mas_equalTo(self.view).offset(kStatusBarHeight);
|
||||
make.height.mas_equalTo(22);
|
||||
}];
|
||||
|
||||
UIButton *backButton = [self mvpBackButton];
|
||||
[self.view addSubview:backButton];
|
||||
[backButton mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.leading.mas_equalTo(self.view).offset(16);
|
||||
make.centerY.mas_equalTo(titleLabel);
|
||||
make.size.mas_equalTo(CGSizeMake(22, 22));
|
||||
}];
|
||||
|
||||
self.backAction = backAction;
|
||||
}
|
||||
|
||||
- (void)setupCustonNavigationRightButtons:(NSArray <UIButton *>*)array
|
||||
sizes:(NSArray <NSValue *> *)sizes {
|
||||
if (array.count > 0 && self->_mvpTitleLabel) {
|
||||
CGFloat trailing = -16;
|
||||
for (UIButton *b in array) {
|
||||
NSInteger index = [array indexOfObject:b];
|
||||
NSValue *sizeValue = [sizes xpSafeObjectAtIndex:index];
|
||||
[self.view addSubview:b];
|
||||
[b mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.trailing.mas_equalTo(self.view).offset(trailing);
|
||||
make.centerY.mas_equalTo(self.mvpTitleLabel);
|
||||
make.size.mas_equalTo([sizeValue CGSizeValue]);
|
||||
}];
|
||||
|
||||
trailing -= 14 + [sizeValue CGSizeValue].width;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
- (void)didTapBack {
|
||||
if (self.backAction) {
|
||||
self.backAction();
|
||||
}
|
||||
[self.navigationController popViewControllerAnimated:YES];
|
||||
}
|
||||
|
||||
- (void)viewDidLoad {
|
||||
[super viewDidLoad];
|
||||
#ifdef DEBUG
|
||||
for (id obj in kWindow.subviews) {
|
||||
if([obj isKindOfClass:[BSRealTimeView class]]){
|
||||
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0.5 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
|
||||
BSRealTimeView *timeView = (BSRealTimeView *)obj;
|
||||
[timeView removeFromSuperview];
|
||||
[kWindow addSubview:timeView];
|
||||
});
|
||||
break;
|
||||
}
|
||||
}
|
||||
#else
|
||||
#endif
|
||||
}
|
||||
|
||||
- (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.1"), dateDes];
|
||||
if ([[data objectForKey:@"cancelDate"] doubleValue] == 0) {
|
||||
dateDes = @"";
|
||||
msg = YMLocalizedString(@"MvpViewController1.2");
|
||||
}
|
||||
|
||||
TTAlertMessageAttributedConfig *dateAttrConfig = [[TTAlertMessageAttributedConfig alloc] init];
|
||||
dateAttrConfig.text = dateDes;
|
||||
dateAttrConfig.color = DJDKMIMOMColor.appMainColor;
|
||||
|
||||
TTAlertConfig *config = [[TTAlertConfig alloc] init];
|
||||
config.actionStyle = 0;
|
||||
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(@"TTAlertConfig0");
|
||||
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:^{
|
||||
//
|
||||
// }];
|
||||
//}
|
||||
|
||||
- (UILabel *)mvpTitleLabel {
|
||||
if (!_mvpTitleLabel) {
|
||||
UILabel *label = [[UILabel alloc] init];
|
||||
label.textAlignment = NSTextAlignmentCenter;
|
||||
label.font = kFontMedium(17);
|
||||
label.textColor = UIColorFromRGB(0xD9E7F7);
|
||||
_mvpTitleLabel = label;
|
||||
}
|
||||
return _mvpTitleLabel;
|
||||
}
|
||||
|
||||
- (UIButton *)mvpBackButton {
|
||||
if (!_backButton) {
|
||||
UIButton *b = [UIButton buttonWithType:UIButtonTypeCustom];
|
||||
[b setImage:[kImage(@"common_nav_back_white") ms_SetImageForRTL]
|
||||
forState:UIControlStateNormal];
|
||||
[b addTarget:self
|
||||
action:@selector(didTapBack)
|
||||
forControlEvents:UIControlEventTouchUpInside];
|
||||
_backButton = b;
|
||||
}
|
||||
return _backButton;
|
||||
}
|
||||
|
||||
@end
|
||||
Reference in New Issue
Block a user