更改类名和方法名
This commit is contained in:
@@ -20,7 +20,7 @@
|
|||||||
({BOOL isEnterprise = NO;\
|
({BOOL isEnterprise = NO;\
|
||||||
if (@available(iOS 11.0, *)) {\
|
if (@available(iOS 11.0, *)) {\
|
||||||
NSString *bundleID = [[[NSBundle mainBundle] infoDictionary] objectForKey:@"CFBundleIdentifier"];\
|
NSString *bundleID = [[[NSBundle mainBundle] infoDictionary] objectForKey:@"CFBundleIdentifier"];\
|
||||||
isEnterprise = [bundleID isEqualToString:@"com.yinyou.enterprise.ios"];\
|
isEnterprise = [bundleID isEqualToString:@"linyudan.yinmeng-ios"];\
|
||||||
}\
|
}\
|
||||||
(isEnterprise);})
|
(isEnterprise);})
|
||||||
|
|
||||||
|
@@ -5,7 +5,7 @@
|
|||||||
// Created by 触海 on 2023/11/6.
|
// Created by 触海 on 2023/11/6.
|
||||||
//
|
//
|
||||||
|
|
||||||
#import "NSObject+MJExtension.h"
|
#import "NSObject+MEWExtension.h"
|
||||||
|
|
||||||
NS_ASSUME_NONNULL_BEGIN
|
NS_ASSUME_NONNULL_BEGIN
|
||||||
|
|
||||||
|
@@ -5,7 +5,7 @@
|
|||||||
// Created by 触海 on 2023/11/6.
|
// Created by 触海 on 2023/11/6.
|
||||||
//
|
//
|
||||||
|
|
||||||
#import "NSObject+MJExtension.h"
|
#import "NSObject+MEWExtension.h"
|
||||||
|
|
||||||
NS_ASSUME_NONNULL_BEGIN
|
NS_ASSUME_NONNULL_BEGIN
|
||||||
|
|
||||||
|
@@ -5,7 +5,7 @@
|
|||||||
// Created by 触海 on 2023/11/6.
|
// Created by 触海 on 2023/11/6.
|
||||||
//
|
//
|
||||||
|
|
||||||
#import "NSObject+MJExtension.h"
|
#import "NSObject+MEWExtension.h"
|
||||||
#import "YMEnum.h"
|
#import "YMEnum.h"
|
||||||
|
|
||||||
#import "UserVipInfoVo.h"
|
#import "UserVipInfoVo.h"
|
||||||
|
@@ -89,7 +89,7 @@
|
|||||||
[[self getView] completeUserInfo];
|
[[self getView] completeUserInfo];
|
||||||
return;
|
return;
|
||||||
case 3009: // 账号已注销
|
case 3009: // 账号已注销
|
||||||
[[self getView] accountCanceled:data.model2dictionary];
|
[[self getView] accountCanceled:data.mewModel2dictionary];
|
||||||
return;
|
return;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
|
@@ -84,9 +84,9 @@ static BOOL isShowing = NO;
|
|||||||
|
|
||||||
AFHTTPSessionManager *manager = [HttpRequestHelper requestManager];
|
AFHTTPSessionManager *manager = [HttpRequestHelper requestManager];
|
||||||
[manager GET:method parameters:params headers:nil progress:nil success:^(NSURLSessionDataTask * _Nonnull task, id _Nullable responseObject) {
|
[manager GET:method parameters:params headers:nil progress:nil success:^(NSURLSessionDataTask * _Nonnull task, id _Nullable responseObject) {
|
||||||
BaseModel *baseModel = [BaseModel modelWithDictionary:responseObject];
|
BaseModel *baseModel = [BaseModel mewModelWithDictionary:responseObject];
|
||||||
#ifdef DEBUG
|
#ifdef DEBUG
|
||||||
NSLog(@"\n%@", [baseModel toJSONString]);
|
NSLog(@"\n%@", [baseModel mewToJSONString]);
|
||||||
#endif
|
#endif
|
||||||
success(baseModel);
|
success(baseModel);
|
||||||
} failure:^(NSURLSessionDataTask * _Nullable task, NSError * _Nonnull error) {
|
} failure:^(NSURLSessionDataTask * _Nullable task, NSError * _Nonnull error) {
|
||||||
@@ -116,9 +116,9 @@ static BOOL isShowing = NO;
|
|||||||
|
|
||||||
AFHTTPSessionManager *manager = [HttpRequestHelper requestManager];
|
AFHTTPSessionManager *manager = [HttpRequestHelper requestManager];
|
||||||
[manager POST:method parameters:params headers:nil progress:nil success:^(NSURLSessionDataTask * _Nonnull task, id _Nullable responseObject) {
|
[manager POST:method parameters:params headers:nil progress:nil success:^(NSURLSessionDataTask * _Nonnull task, id _Nullable responseObject) {
|
||||||
BaseModel *baseModel = [BaseModel modelWithDictionary:responseObject];
|
BaseModel *baseModel = [BaseModel mewModelWithDictionary:responseObject];
|
||||||
#ifdef DEBUG
|
#ifdef DEBUG
|
||||||
NSLog(@"\n%@", [baseModel toJSONString]);
|
NSLog(@"\n%@", [baseModel mewToJSONString]);
|
||||||
#endif
|
#endif
|
||||||
success(baseModel);
|
success(baseModel);
|
||||||
} failure:^(NSURLSessionDataTask * _Nullable task, NSError * _Nonnull error) {
|
} failure:^(NSURLSessionDataTask * _Nullable task, NSError * _Nonnull error) {
|
||||||
@@ -148,9 +148,9 @@ static BOOL isShowing = NO;
|
|||||||
|
|
||||||
AFHTTPSessionManager *manager = [HttpRequestHelper requestManager];
|
AFHTTPSessionManager *manager = [HttpRequestHelper requestManager];
|
||||||
[manager DELETE:method parameters:params headers:nil success:^(NSURLSessionDataTask * _Nonnull task, id _Nullable responseObject) {
|
[manager DELETE:method parameters:params headers:nil success:^(NSURLSessionDataTask * _Nonnull task, id _Nullable responseObject) {
|
||||||
BaseModel *baseModel = [BaseModel modelWithDictionary:responseObject];
|
BaseModel *baseModel = [BaseModel mewModelWithDictionary:responseObject];
|
||||||
#ifdef DEBUG
|
#ifdef DEBUG
|
||||||
NSLog(@"\n%@", [baseModel toJSONString]);
|
NSLog(@"\n%@", [baseModel mewToJSONString]);
|
||||||
#endif
|
#endif
|
||||||
success(baseModel);
|
success(baseModel);
|
||||||
} failure:^(NSURLSessionDataTask * _Nullable task, NSError * _Nonnull error) {
|
} failure:^(NSURLSessionDataTask * _Nullable task, NSError * _Nonnull error) {
|
||||||
|
@@ -1,32 +0,0 @@
|
|||||||
//
|
|
||||||
// CountDownHelper.h
|
|
||||||
// mew-ios
|
|
||||||
//
|
|
||||||
// Created by 触海 on 2023/11/9.
|
|
||||||
//
|
|
||||||
|
|
||||||
#import <Foundation/Foundation.h>
|
|
||||||
|
|
||||||
NS_ASSUME_NONNULL_BEGIN
|
|
||||||
|
|
||||||
@protocol CountDownHelperDelegate <NSObject>
|
|
||||||
@optional
|
|
||||||
///倒计时结束
|
|
||||||
- (void)onCountdownFinish;
|
|
||||||
///倒计时进行
|
|
||||||
- (void)onCountdownOpen:(int)time;
|
|
||||||
|
|
||||||
@end
|
|
||||||
|
|
||||||
|
|
||||||
@interface CountDownHelper : NSObject
|
|
||||||
+ (instancetype)shareHelper;
|
|
||||||
// 停止倒计时
|
|
||||||
- (void)stopCountDown;
|
|
||||||
///开始倒计时
|
|
||||||
- (void)openCountdownWithTime:(int)totalTime;
|
|
||||||
///代理
|
|
||||||
@property (nonatomic,assign) id<CountDownHelperDelegate> delegate;
|
|
||||||
@end
|
|
||||||
|
|
||||||
NS_ASSUME_NONNULL_END
|
|
@@ -1,68 +0,0 @@
|
|||||||
//
|
|
||||||
// CountDownHelper.m
|
|
||||||
// mew-ios
|
|
||||||
//
|
|
||||||
// Created by 触海 on 2023/11/9.
|
|
||||||
//
|
|
||||||
|
|
||||||
#import "CountDownHelper.h"
|
|
||||||
|
|
||||||
@interface CountDownHelper ()
|
|
||||||
@property (strong, nonatomic) dispatch_source_t timer;
|
|
||||||
@end
|
|
||||||
|
|
||||||
@implementation CountDownHelper
|
|
||||||
|
|
||||||
+ (instancetype)shareHelper {
|
|
||||||
static dispatch_once_t onceToken;
|
|
||||||
static CountDownHelper * helper = nil;
|
|
||||||
dispatch_once(&onceToken, ^{
|
|
||||||
helper = [[CountDownHelper alloc] init];
|
|
||||||
});
|
|
||||||
return helper;
|
|
||||||
}
|
|
||||||
|
|
||||||
// 停止倒计时
|
|
||||||
- (void)stopCountDown {
|
|
||||||
if (self.timer != nil) {
|
|
||||||
dispatch_source_cancel(self.timer);
|
|
||||||
self.timer = nil;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// 开始倒计时
|
|
||||||
- (void)openCountdownWithTime:(int)totalTime{
|
|
||||||
if (time <= 0) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
__block int time = totalTime; //倒计时时间
|
|
||||||
if (self.timer != nil) {
|
|
||||||
dispatch_source_cancel(self.timer);
|
|
||||||
}
|
|
||||||
dispatch_queue_t queue = dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0);
|
|
||||||
self.timer = dispatch_source_create(DISPATCH_SOURCE_TYPE_TIMER, 0, 0, queue);
|
|
||||||
dispatch_source_set_timer(self.timer,dispatch_walltime(NULL, 0),1.0*NSEC_PER_SEC, 0); //每秒执行
|
|
||||||
__weak typeof(self) weakself = self;
|
|
||||||
dispatch_source_set_event_handler(self.timer, ^{
|
|
||||||
__strong typeof(weakself) self = weakself;
|
|
||||||
if(time <= 0){ //倒计时结束,关闭
|
|
||||||
dispatch_source_cancel(self.timer);
|
|
||||||
dispatch_async(dispatch_get_main_queue(), ^{
|
|
||||||
if (self.delegate && [self.delegate respondsToSelector:@selector(onCountdownFinish)]) {
|
|
||||||
[self.delegate onCountdownFinish];
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}else{
|
|
||||||
time--;
|
|
||||||
dispatch_async(dispatch_get_main_queue(), ^{
|
|
||||||
//设置按钮显示读秒效果
|
|
||||||
if (self.delegate && [self.delegate respondsToSelector:@selector(onCountdownOpen:)]) {
|
|
||||||
[self.delegate onCountdownOpen:time];
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
}
|
|
||||||
});
|
|
||||||
dispatch_resume(self.timer);
|
|
||||||
}
|
|
||||||
@end
|
|
@@ -0,0 +1,29 @@
|
|||||||
|
//
|
||||||
|
// MEWCountDownHelper.h
|
||||||
|
// yinmeng-ios
|
||||||
|
//
|
||||||
|
// Created by duoban on 2023/12/1.
|
||||||
|
//
|
||||||
|
|
||||||
|
#import <Foundation/Foundation.h>
|
||||||
|
|
||||||
|
NS_ASSUME_NONNULL_BEGIN
|
||||||
|
@protocol MEWCountDownHelperDelegate <NSObject>
|
||||||
|
@optional
|
||||||
|
///倒计时结束
|
||||||
|
- (void)mewOnCountdownFinish;
|
||||||
|
///倒计时进行
|
||||||
|
- (void)mewOnCountdownOpen:(int)time;
|
||||||
|
|
||||||
|
@end
|
||||||
|
@interface MEWCountDownHelper : NSObject
|
||||||
|
+ (instancetype)shareHelper;
|
||||||
|
// 停止倒计时
|
||||||
|
- (void)mewStopCountDown;
|
||||||
|
///开始倒计时
|
||||||
|
- (void)mewOpenCountdownWithTime:(int)totalTime;
|
||||||
|
///代理
|
||||||
|
@property (nonatomic,assign) id<MEWCountDownHelperDelegate> delegate;
|
||||||
|
@end
|
||||||
|
|
||||||
|
NS_ASSUME_NONNULL_END
|
@@ -0,0 +1,65 @@
|
|||||||
|
//
|
||||||
|
// MEWCountDownHelper.m
|
||||||
|
// yinmeng-ios
|
||||||
|
//
|
||||||
|
// Created by duoban on 2023/12/1.
|
||||||
|
//
|
||||||
|
|
||||||
|
#import "MEWCountDownHelper.h"
|
||||||
|
@interface MEWCountDownHelper()
|
||||||
|
@property (strong, nonatomic) dispatch_source_t mew_timer;
|
||||||
|
@end
|
||||||
|
@implementation MEWCountDownHelper
|
||||||
|
+ (instancetype)shareHelper {
|
||||||
|
static dispatch_once_t onceToken;
|
||||||
|
static MEWCountDownHelper * helper = nil;
|
||||||
|
dispatch_once(&onceToken, ^{
|
||||||
|
helper = [[MEWCountDownHelper alloc] init];
|
||||||
|
});
|
||||||
|
return helper;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 停止倒计时
|
||||||
|
- (void)mewStopCountDown {
|
||||||
|
if (self.mew_timer != nil) {
|
||||||
|
dispatch_source_cancel(self.mew_timer);
|
||||||
|
self.mew_timer = nil;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 开始倒计时
|
||||||
|
- (void)mewOpenCountdownWithTime:(int)totalTime{
|
||||||
|
if (time <= 0) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
__block int time = totalTime; //倒计时时间
|
||||||
|
if (self.mew_timer != nil) {
|
||||||
|
dispatch_source_cancel(self.mew_timer);
|
||||||
|
}
|
||||||
|
dispatch_queue_t queue = dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0);
|
||||||
|
self.mew_timer = dispatch_source_create(DISPATCH_SOURCE_TYPE_TIMER, 0, 0, queue);
|
||||||
|
dispatch_source_set_timer(self.mew_timer,dispatch_walltime(NULL, 0),1.0*NSEC_PER_SEC, 0); //每秒执行
|
||||||
|
__weak typeof(self) weakself = self;
|
||||||
|
dispatch_source_set_event_handler(self.mew_timer, ^{
|
||||||
|
__strong typeof(weakself) self = weakself;
|
||||||
|
if(time <= 0){ //倒计时结束,关闭
|
||||||
|
dispatch_source_cancel(self.mew_timer);
|
||||||
|
dispatch_async(dispatch_get_main_queue(), ^{
|
||||||
|
if (self.delegate && [self.delegate respondsToSelector:@selector(mewOnCountdownFinish)]) {
|
||||||
|
[self.delegate mewOnCountdownFinish];
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}else{
|
||||||
|
time--;
|
||||||
|
dispatch_async(dispatch_get_main_queue(), ^{
|
||||||
|
//设置按钮显示读秒效果
|
||||||
|
if (self.delegate && [self.delegate respondsToSelector:@selector(mewOnCountdownOpen:)]) {
|
||||||
|
[self.delegate mewOnCountdownOpen:time];
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
}
|
||||||
|
});
|
||||||
|
dispatch_resume(self.mew_timer);
|
||||||
|
}
|
||||||
|
@end
|
@@ -1,28 +1,26 @@
|
|||||||
//
|
//
|
||||||
// UploadFile.h
|
// MEWUploadFile.h
|
||||||
// mew-ios
|
// yinmeng-ios
|
||||||
//
|
//
|
||||||
// Created by 触海 on 2023/11/15.
|
// Created by duoban on 2023/12/1.
|
||||||
//
|
//
|
||||||
|
|
||||||
#import <Foundation/Foundation.h>
|
#import <Foundation/Foundation.h>
|
||||||
|
|
||||||
NS_ASSUME_NONNULL_BEGIN
|
NS_ASSUME_NONNULL_BEGIN
|
||||||
|
|
||||||
@interface UploadFile : NSObject
|
@interface MEWUploadFile : NSObject
|
||||||
|
|
||||||
/// 上传一个文件
|
/// 上传一个文件
|
||||||
/// @param filePath 文件地址
|
/// @param filePath 文件地址
|
||||||
/// @param fileName 文件的名字
|
/// @param fileName 文件的名字
|
||||||
/// @param token token
|
/// @param token token
|
||||||
/// @param success 成功
|
/// @param success 成功
|
||||||
/// @param failure 失败
|
/// @param failure 失败
|
||||||
+ (void)uploadFile:(NSString *)filePath
|
+ (void)mewUploadFile:(NSString *)filePath
|
||||||
named:(NSString *)fileName
|
named:(NSString *)fileName
|
||||||
token:(NSString *)token
|
token:(NSString *)token
|
||||||
success:(void (^)(NSString *key, NSDictionary *resp))success
|
success:(void (^)(NSString *key, NSDictionary *res))success
|
||||||
failure:(void (^)(NSNumber *resCode, NSString *message))failure;
|
failure:(void (^)(NSNumber *code, NSString *message))failure;
|
||||||
|
|
||||||
|
|
||||||
@end
|
@end
|
||||||
|
|
@@ -1,38 +1,34 @@
|
|||||||
//
|
//
|
||||||
// UploadFile.m
|
// MEWUploadFile.m
|
||||||
// mew-ios
|
// yinmeng-ios
|
||||||
//
|
//
|
||||||
// Created by 触海 on 2023/11/15.
|
// Created by duoban on 2023/12/1.
|
||||||
//
|
//
|
||||||
|
|
||||||
#import "UploadFile.h"
|
#import "MEWUploadFile.h"
|
||||||
#import <Qiniu/QiniuSDK.h>
|
#import <Qiniu/QiniuSDK.h>
|
||||||
|
@implementation MEWUploadFile
|
||||||
@implementation UploadFile
|
|
||||||
|
|
||||||
/// 上传一个文件
|
/// 上传一个文件
|
||||||
/// @param filePath 文件地址
|
/// @param filePath 文件地址
|
||||||
/// @param fileName 文件的名字
|
/// @param fileName 文件的名字
|
||||||
/// @param token token
|
/// @param token token
|
||||||
/// @param success 成功
|
/// @param success 成功
|
||||||
/// @param failure 失败
|
/// @param failure 失败
|
||||||
+ (void)uploadFile:(NSString *)filePath
|
+ (void)mewUploadFile:(NSString *)filePath
|
||||||
named:(NSString *)fileName
|
named:(NSString *)fileName
|
||||||
token:(NSString *)token
|
token:(NSString *)token
|
||||||
success:(void (^)(NSString *key, NSDictionary *resp))success
|
success:(void (^)(NSString *key, NSDictionary *res))success
|
||||||
failure:(void (^)(NSNumber *resCode, NSString *message))failure {
|
failure:(void (^)(NSNumber *code, NSString *message))failure{
|
||||||
QNConfiguration *config = [QNConfiguration build:^(QNConfigurationBuilder *builder) {
|
QNConfiguration *config = [QNConfiguration build:^(QNConfigurationBuilder *builder) {
|
||||||
builder.zone = [QNFixedZone zone2];
|
builder.zone = [QNFixedZone zone2];
|
||||||
}];
|
}];
|
||||||
QNUploadManager *upManager = [[QNUploadManager alloc] initWithConfiguration:config];
|
QNUploadManager *upManager = [[QNUploadManager alloc] initWithConfiguration:config];
|
||||||
[upManager putFile:filePath key:fileName token:token complete:^(QNResponseInfo *info, NSString *key, NSDictionary *resp) {
|
[upManager putFile:filePath key:fileName token:token complete:^(QNResponseInfo *info, NSString *key, NSDictionary *res) {
|
||||||
if (resp) {
|
if (res) {
|
||||||
success(key, resp);
|
success(key, res);
|
||||||
} else {
|
} else {
|
||||||
failure(@(info.statusCode), info.error.localizedDescription);
|
failure(@(info.statusCode), info.error.localizedDescription);
|
||||||
}
|
}
|
||||||
} option:nil];
|
} option:nil];
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@end
|
@end
|
@@ -1,11 +0,0 @@
|
|||||||
//
|
|
||||||
// GCDHelper.h
|
|
||||||
// YYMobileFramework
|
|
||||||
//
|
|
||||||
// Created by wuwei on 14/7/18.
|
|
||||||
// Copyright (c) 2014年 YY Inc. All rights reserved.
|
|
||||||
//
|
|
||||||
|
|
||||||
#import <Foundation/Foundation.h>
|
|
||||||
|
|
||||||
void dispatch_main_sync_safe(dispatch_block_t block);
|
|
@@ -1,16 +0,0 @@
|
|||||||
//
|
|
||||||
// GCDHelper.m
|
|
||||||
// YYMobileFramework
|
|
||||||
//
|
|
||||||
// Created by wuwei on 14/7/18.
|
|
||||||
// Copyright (c) 2014年 YY Inc. All rights reserved.
|
|
||||||
//
|
|
||||||
|
|
||||||
#import "GCDHelper.h"
|
|
||||||
void dispatch_main_sync_safe(dispatch_block_t block) {
|
|
||||||
if ([NSThread isMainThread]) {
|
|
||||||
block();
|
|
||||||
}else {
|
|
||||||
dispatch_sync(dispatch_get_main_queue(), block);
|
|
||||||
}
|
|
||||||
}
|
|
10
yinmeng-ios/yinmeng-ios/Base/Tool/GCDHelper/MEWGCDHelper.h
Normal file
10
yinmeng-ios/yinmeng-ios/Base/Tool/GCDHelper/MEWGCDHelper.h
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
//
|
||||||
|
// MEWGCDHelper.h
|
||||||
|
// yinmeng-ios
|
||||||
|
//
|
||||||
|
// Created by duoban on 2023/12/1.
|
||||||
|
//
|
||||||
|
|
||||||
|
#import <Foundation/Foundation.h>
|
||||||
|
|
||||||
|
void mew_dispatch_main_sync_safe(dispatch_block_t block);
|
16
yinmeng-ios/yinmeng-ios/Base/Tool/GCDHelper/MEWGCDHelper.m
Normal file
16
yinmeng-ios/yinmeng-ios/Base/Tool/GCDHelper/MEWGCDHelper.m
Normal file
@@ -0,0 +1,16 @@
|
|||||||
|
//
|
||||||
|
// MEWGCDHelper.m
|
||||||
|
// yinmeng-ios
|
||||||
|
//
|
||||||
|
// Created by duoban on 2023/12/1.
|
||||||
|
//
|
||||||
|
|
||||||
|
#import "MEWGCDHelper.h"
|
||||||
|
|
||||||
|
void mew_dispatch_main_sync_safe(dispatch_block_t block) {
|
||||||
|
if ([NSThread isMainThread]) {
|
||||||
|
block();
|
||||||
|
}else {
|
||||||
|
dispatch_sync(dispatch_get_main_queue(), block);
|
||||||
|
}
|
||||||
|
}
|
@@ -0,0 +1,29 @@
|
|||||||
|
//
|
||||||
|
// MEWRechargeStorage.h
|
||||||
|
// yinmeng-ios
|
||||||
|
//
|
||||||
|
// Created by duoban on 2023/12/1.
|
||||||
|
//
|
||||||
|
|
||||||
|
#import <Foundation/Foundation.h>
|
||||||
|
|
||||||
|
NS_ASSUME_NONNULL_BEGIN
|
||||||
|
|
||||||
|
@interface MEWRechargeStorage : NSObject
|
||||||
|
/// 根据商品id保存凭证
|
||||||
|
+ (BOOL)mewSaveTranscationId:(NSString *)transcationId
|
||||||
|
recipt:(NSString *)recipt
|
||||||
|
uid:(NSString *)uid;
|
||||||
|
|
||||||
|
/// 获取所有凭证
|
||||||
|
+ (NSArray *)mewGetAllReciptsWithUid:(NSString *)uid;
|
||||||
|
|
||||||
|
/// 根据订单删除凭证
|
||||||
|
+ (BOOL)mewDelegateTranscationId:(NSString *)transcationId
|
||||||
|
uid:(NSString *)uid;
|
||||||
|
|
||||||
|
/// 删除所有凭证
|
||||||
|
+ (void)mewDelegateAllTranscationIdsWithUid:(NSString *)uid;
|
||||||
|
@end
|
||||||
|
|
||||||
|
NS_ASSUME_NONNULL_END
|
@@ -1,31 +1,30 @@
|
|||||||
//
|
//
|
||||||
// RechargeStorage.m
|
// MEWRechargeStorage.m
|
||||||
// mew-ios
|
// yinmeng-ios
|
||||||
//
|
//
|
||||||
// Created by 触海 on 2023/11/8.
|
// Created by duoban on 2023/12/1.
|
||||||
//
|
//
|
||||||
|
|
||||||
#import "RechargeStorage.h"
|
#import "MEWRechargeStorage.h"
|
||||||
#import <SSKeychain/SSKeychain.h>
|
#import <SSKeychain/SSKeychain.h>
|
||||||
#define kappStoreKey @"kappStoreKey"
|
#define kMewAppStoreKey @"kMewAppStoreKey"
|
||||||
|
@implementation MEWRechargeStorage
|
||||||
@implementation RechargeStorage
|
|
||||||
/// 根据商品id保存凭证
|
/// 根据商品id保存凭证
|
||||||
+ (BOOL)saveTranscationId:(NSString *)transcationId
|
+ (BOOL)mewSaveTranscationId:(NSString *)transcationId
|
||||||
recipt:(NSString *)recipt
|
recipt:(NSString *)recipt
|
||||||
uid:(NSString *)uid {
|
uid:(NSString *)uid {
|
||||||
NSString * key = [NSString stringWithFormat:@"%@_%@", kappStoreKey, uid];
|
NSString * key = [NSString stringWithFormat:@"%@_%@", kMewAppStoreKey, uid];
|
||||||
return [SSKeychain setPassword:recipt forService:key account:transcationId error:nil];
|
return [SSKeychain setPassword:recipt forService:key account:transcationId error:nil];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/// 获取所有凭证
|
/// 获取所有凭证
|
||||||
+ (NSArray *)getAllReciptsWithUid:(NSString *)uid {
|
+ (NSArray *)mewGetAllReciptsWithUid:(NSString *)uid {
|
||||||
NSArray *transcationIds = [SSKeychain allAccounts];
|
NSArray *transcationIds = [SSKeychain allAccounts];
|
||||||
NSMutableArray *temArr = [NSMutableArray array];
|
NSMutableArray *temArr = [NSMutableArray array];
|
||||||
[transcationIds enumerateObjectsUsingBlock:^(id _Nonnull obj, NSUInteger idx, BOOL * _Nonnull stop) {
|
[transcationIds enumerateObjectsUsingBlock:^(id _Nonnull obj, NSUInteger idx, BOOL * _Nonnull stop) {
|
||||||
if ([obj[@"svce"] isKindOfClass:[NSString class]]) {
|
if ([obj[@"svce"] isKindOfClass:[NSString class]]) {
|
||||||
NSString * key = [NSString stringWithFormat:@"%@_%@", kappStoreKey, uid];
|
NSString * key = [NSString stringWithFormat:@"%@_%@", kMewAppStoreKey, uid];
|
||||||
if ([obj[@"svce"] isEqualToString:key]) {
|
if ([obj[@"svce"] isEqualToString:key]) {
|
||||||
NSString *recipt = [SSKeychain passwordForService:key account:obj[@"acct"] error:nil];
|
NSString *recipt = [SSKeychain passwordForService:key account:obj[@"acct"] error:nil];
|
||||||
NSData *data = [recipt dataUsingEncoding:NSUTF8StringEncoding];
|
NSData *data = [recipt dataUsingEncoding:NSUTF8StringEncoding];
|
||||||
@@ -38,17 +37,17 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// 根据订单删除凭证
|
/// 根据订单删除凭证
|
||||||
+ (BOOL)delegateTranscationId:(NSString *)transcationId uid:(NSString *)uid {
|
+ (BOOL)mewDelegateTranscationId:(NSString *)transcationId uid:(NSString *)uid {
|
||||||
NSString * key = [NSString stringWithFormat:@"%@_%@", kappStoreKey, uid];
|
NSString * key = [NSString stringWithFormat:@"%@_%@", kMewAppStoreKey, uid];
|
||||||
return [SSKeychain deletePasswordForService:key account:transcationId error:nil];
|
return [SSKeychain deletePasswordForService:key account:transcationId error:nil];
|
||||||
}
|
}
|
||||||
|
|
||||||
/// 删除所有凭证
|
/// 删除所有凭证
|
||||||
+ (void)delegateAllTranscationIdsWithUid:(NSString *)uid {
|
+ (void)mewDelegateAllTranscationIdsWithUid:(NSString *)uid {
|
||||||
NSArray *transcationIds = [SSKeychain allAccounts];
|
NSArray *transcationIds = [SSKeychain allAccounts];
|
||||||
[transcationIds enumerateObjectsUsingBlock:^(id _Nonnull obj, NSUInteger idx, BOOL * _Nonnull stop) {
|
[transcationIds enumerateObjectsUsingBlock:^(id _Nonnull obj, NSUInteger idx, BOOL * _Nonnull stop) {
|
||||||
if ([obj[@"svce"] isKindOfClass:[NSString class]]) {
|
if ([obj[@"svce"] isKindOfClass:[NSString class]]) {
|
||||||
NSString * key = [NSString stringWithFormat:@"%@_%@", kappStoreKey, uid];
|
NSString * key = [NSString stringWithFormat:@"%@_%@", kMewAppStoreKey, uid];
|
||||||
if ([obj[@"svce"] isEqualToString:key]) {
|
if ([obj[@"svce"] isEqualToString:key]) {
|
||||||
[SSKeychain deletePasswordForService:key account:obj[@"acct"]];
|
[SSKeychain deletePasswordForService:key account:obj[@"acct"]];
|
||||||
}
|
}
|
||||||
@@ -56,5 +55,4 @@
|
|||||||
}];
|
}];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@end
|
@end
|
@@ -1,31 +0,0 @@
|
|||||||
//
|
|
||||||
// RechargeStorage.h
|
|
||||||
// mew-ios
|
|
||||||
//
|
|
||||||
// Created by 触海 on 2023/11/8.
|
|
||||||
//
|
|
||||||
|
|
||||||
#import <Foundation/Foundation.h>
|
|
||||||
|
|
||||||
NS_ASSUME_NONNULL_BEGIN
|
|
||||||
|
|
||||||
@interface RechargeStorage : NSObject
|
|
||||||
|
|
||||||
/// 根据商品id保存凭证
|
|
||||||
+ (BOOL)saveTranscationId:(NSString *)transcationId
|
|
||||||
recipt:(NSString *)recipt
|
|
||||||
uid:(NSString *)uid;
|
|
||||||
|
|
||||||
/// 获取所有凭证
|
|
||||||
+ (NSArray *)getAllReciptsWithUid:(NSString *)uid;
|
|
||||||
|
|
||||||
/// 根据订单删除凭证
|
|
||||||
+ (BOOL)delegateTranscationId:(NSString *)transcationId
|
|
||||||
uid:(NSString *)uid;
|
|
||||||
|
|
||||||
/// 删除所有凭证
|
|
||||||
+ (void)delegateAllTranscationIdsWithUid:(NSString *)uid;
|
|
||||||
|
|
||||||
@end
|
|
||||||
|
|
||||||
NS_ASSUME_NONNULL_END
|
|
@@ -1,38 +0,0 @@
|
|||||||
//
|
|
||||||
// YMIAPHelper.h
|
|
||||||
// mew-ios
|
|
||||||
//
|
|
||||||
// Created by 触海 on 2023/11/8.
|
|
||||||
//
|
|
||||||
|
|
||||||
#import <Foundation/Foundation.h>
|
|
||||||
|
|
||||||
NS_ASSUME_NONNULL_BEGIN
|
|
||||||
|
|
||||||
typedef NS_ENUM(NSInteger ,PaymentStatus) {
|
|
||||||
PaymentStatus_Purchasing = 1,//付款中
|
|
||||||
PaymentStatus_Purchased, //付款操作已经完成
|
|
||||||
PaymentStatus_Failed, //付款操作失败
|
|
||||||
PaymentStatus_Deferred, //未知状态
|
|
||||||
};
|
|
||||||
|
|
||||||
@protocol YMIAPHelperDelegate <NSObject>
|
|
||||||
@optional
|
|
||||||
///当前充值的状态
|
|
||||||
- (void)rechargeProcessStatus:(PaymentStatus)status;
|
|
||||||
|
|
||||||
///充值成功回调id
|
|
||||||
- (void)rechargeSuccess:(NSString *)transactionIdentifier;
|
|
||||||
@end
|
|
||||||
|
|
||||||
@interface YMIAPHelper : NSObject
|
|
||||||
|
|
||||||
+ (instancetype)shareHelper;
|
|
||||||
///代理
|
|
||||||
@property (nonatomic,weak) id<YMIAPHelperDelegate> delegate;
|
|
||||||
///购买商品
|
|
||||||
- (void)buyAppProductWithAppProductId:(NSString *)appProductId;
|
|
||||||
@end
|
|
||||||
|
|
||||||
|
|
||||||
NS_ASSUME_NONNULL_END
|
|
@@ -1,96 +0,0 @@
|
|||||||
//
|
|
||||||
// YMIAPHelper.m
|
|
||||||
// mew-ios
|
|
||||||
//
|
|
||||||
// Created by 触海 on 2023/11/8.
|
|
||||||
//
|
|
||||||
|
|
||||||
#import "YMIAPHelper.h"
|
|
||||||
#import <IAPHelper/IAPHelper.h>
|
|
||||||
#import <IAPShare.h>
|
|
||||||
|
|
||||||
@implementation YMIAPHelper
|
|
||||||
+ (instancetype)shareHelper {
|
|
||||||
static dispatch_once_t onceToken;
|
|
||||||
static YMIAPHelper * helper;
|
|
||||||
dispatch_once(&onceToken, ^{
|
|
||||||
helper = [[YMIAPHelper alloc] init];
|
|
||||||
});
|
|
||||||
return helper;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
- (void)buyAppProductWithAppProductId:(NSString *)appProductId {
|
|
||||||
NSSet* dataSet = [[NSSet alloc] initWithObjects:appProductId, nil];
|
|
||||||
[IAPShare sharedHelper].iap = [[IAPHelper alloc] initWithProductIdentifiers:dataSet];
|
|
||||||
[[IAPShare sharedHelper].iap requestProductsWithCompletion:^(SKProductsRequest *request, SKProductsResponse *response) {
|
|
||||||
if (response != nil && response.products.count) {
|
|
||||||
///有这个内购的产品
|
|
||||||
} else if (!response.products.count) {
|
|
||||||
///请求内购产品失败,无产品数量
|
|
||||||
#warning to do 此处埋点一个 没有内购产品
|
|
||||||
if (self.delegate && [self.delegate respondsToSelector:@selector(rechargeProcessStatus:)]) {
|
|
||||||
[self.delegate rechargeProcessStatus:PaymentStatus_Failed];
|
|
||||||
}
|
|
||||||
return;
|
|
||||||
} else if (!response) {
|
|
||||||
#warning to do 此处埋点一个 请求内购没有响应
|
|
||||||
///请求内购产品失败,内购无响应
|
|
||||||
if (self.delegate && [self.delegate respondsToSelector:@selector(rechargeProcessStatus:)]) {
|
|
||||||
[self.delegate rechargeProcessStatus:PaymentStatus_Failed];
|
|
||||||
}
|
|
||||||
return;
|
|
||||||
} else {
|
|
||||||
#warning to do 此处埋点一个 异常 发起付款失败
|
|
||||||
///异常 发起付款失败
|
|
||||||
if (self.delegate && [self.delegate respondsToSelector:@selector(rechargeProcessStatus:)]) {
|
|
||||||
[self.delegate rechargeProcessStatus:PaymentStatus_Failed];
|
|
||||||
}
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if (response.products.firstObject) {
|
|
||||||
[[IAPShare sharedHelper].iap buyProduct:response.products.firstObject onCompletion:^(SKPaymentTransaction *transcation) {
|
|
||||||
NSLog(@"%@",transcation.error.description);
|
|
||||||
switch(transcation.transactionState) {
|
|
||||||
case SKPaymentTransactionStatePurchased: {
|
|
||||||
NSLog(@"付款完成状态, 要做出相关的处理");
|
|
||||||
[[SKPaymentQueue defaultQueue] finishTransaction:transcation];
|
|
||||||
if (self.delegate && [self.delegate respondsToSelector:@selector(rechargeProcessStatus:)]) {
|
|
||||||
[self.delegate rechargeProcessStatus:PaymentStatus_Purchased];
|
|
||||||
}
|
|
||||||
|
|
||||||
if (self.delegate && [self.delegate respondsToSelector:@selector(rechargeSuccess:)]) {
|
|
||||||
[self.delegate rechargeSuccess:transcation.transactionIdentifier];
|
|
||||||
}
|
|
||||||
//同步返回购买成功后,需要请求服务器二次校验
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
case SKPaymentTransactionStateFailed: {
|
|
||||||
[[SKPaymentQueue defaultQueue] finishTransaction:transcation];
|
|
||||||
if (self.delegate && [self.delegate respondsToSelector:@selector(rechargeProcessStatus:)]) {
|
|
||||||
[self.delegate rechargeProcessStatus:PaymentStatus_Failed];
|
|
||||||
}
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
case SKPaymentTransactionStatePurchasing: {
|
|
||||||
NSLog(@"正在购买中");
|
|
||||||
if (self.delegate && [self.delegate respondsToSelector:@selector(rechargeProcessStatus:)]) {
|
|
||||||
[self.delegate rechargeProcessStatus:PaymentStatus_Purchasing];
|
|
||||||
}
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
default: {
|
|
||||||
[[SKPaymentQueue defaultQueue] finishTransaction:transcation];
|
|
||||||
if (self.delegate && [self.delegate respondsToSelector:@selector(rechargeProcessStatus:)]) {
|
|
||||||
[self.delegate rechargeProcessStatus:PaymentStatus_Deferred];
|
|
||||||
}
|
|
||||||
NSLog(@"其它");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}];
|
|
||||||
}
|
|
||||||
}];
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
@end
|
|
@@ -1,15 +1,15 @@
|
|||||||
//
|
//
|
||||||
// YMHUDTool.h
|
// MewHUDTool.h
|
||||||
// mew-ios
|
// yinmeng-ios
|
||||||
//
|
//
|
||||||
// Created by 触海 on 2023/11/6.
|
// Created by duoban on 2023/12/1.
|
||||||
//
|
//
|
||||||
|
|
||||||
|
#import <Foundation/Foundation.h>
|
||||||
#import <UIKit/UIKit.h>
|
#import <UIKit/UIKit.h>
|
||||||
|
|
||||||
NS_ASSUME_NONNULL_BEGIN
|
NS_ASSUME_NONNULL_BEGIN
|
||||||
|
|
||||||
@interface YMHUDTool : NSObject
|
@interface MewHUDTool : NSObject
|
||||||
/**
|
/**
|
||||||
showGIFLoading使用注意:
|
showGIFLoading使用注意:
|
||||||
1.谁负责showLoading, 谁负责hideHUD
|
1.谁负责showLoading, 谁负责hideHUD
|
@@ -1,20 +1,16 @@
|
|||||||
//
|
//
|
||||||
// YMHUDTool.m
|
// MewHUDTool.m
|
||||||
// mew-ios
|
// yinmeng-ios
|
||||||
//
|
//
|
||||||
// Created by 触海 on 2023/11/6.
|
// Created by duoban on 2023/12/1.
|
||||||
//
|
//
|
||||||
|
|
||||||
#import "YMHUDTool.h"
|
#import "MewHUDTool.h"
|
||||||
#import <MBProgressHUD/MBProgressHUD.h>
|
#import <MBProgressHUD/MBProgressHUD.h>
|
||||||
#import "GCDHelper.h"
|
#import "MEWGCDHelper.h"
|
||||||
|
|
||||||
#define kDelayTime 2.5
|
#define kDelayTime 2.5
|
||||||
@interface YMHUDTool()
|
@implementation MewHUDTool
|
||||||
@end
|
|
||||||
|
|
||||||
@implementation YMHUDTool
|
|
||||||
|
|
||||||
static NSArray * _animationImages = nil;
|
static NSArray * _animationImages = nil;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -23,7 +19,7 @@ static NSArray * _animationImages = nil;
|
|||||||
@param view view
|
@param view view
|
||||||
*/
|
*/
|
||||||
+ (void)hideHUDInView:(nullable UIView *)view {
|
+ (void)hideHUDInView:(nullable UIView *)view {
|
||||||
dispatch_main_sync_safe(^{
|
mew_dispatch_main_sync_safe(^{
|
||||||
if (view) {
|
if (view) {
|
||||||
[MBProgressHUD hideHUDForView:view animated:NO];
|
[MBProgressHUD hideHUDForView:view animated:NO];
|
||||||
[MBProgressHUD hideHUDForView:[UIApplication sharedApplication].keyWindow animated:NO];
|
[MBProgressHUD hideHUDForView:[UIApplication sharedApplication].keyWindow animated:NO];
|
||||||
@@ -70,7 +66,7 @@ static NSArray * _animationImages = nil;
|
|||||||
if (message.length == 0) { return; }
|
if (message.length == 0) { return; }
|
||||||
__block UIView *inView = view;
|
__block UIView *inView = view;
|
||||||
|
|
||||||
dispatch_main_sync_safe(^{
|
mew_dispatch_main_sync_safe(^{
|
||||||
if (!inView) {
|
if (!inView) {
|
||||||
inView = [UIApplication sharedApplication].keyWindow;
|
inView = [UIApplication sharedApplication].keyWindow;
|
||||||
}
|
}
|
||||||
@@ -125,7 +121,7 @@ static NSArray * _animationImages = nil;
|
|||||||
|
|
||||||
[self hideHUDInView:view]; // 先隐藏
|
[self hideHUDInView:view]; // 先隐藏
|
||||||
|
|
||||||
dispatch_main_sync_safe(^{
|
mew_dispatch_main_sync_safe(^{
|
||||||
MBProgressHUD *hud = [self normalProgressHUD:view];
|
MBProgressHUD *hud = [self normalProgressHUD:view];
|
||||||
hud.userInteractionEnabled = enabled;
|
hud.userInteractionEnabled = enabled;
|
||||||
hud.mode = MBProgressHUDModeText;
|
hud.mode = MBProgressHUDModeText;
|
||||||
@@ -185,7 +181,7 @@ static NSArray * _animationImages = nil;
|
|||||||
}
|
}
|
||||||
[self hideHUDInView:view];
|
[self hideHUDInView:view];
|
||||||
|
|
||||||
dispatch_main_sync_safe(^{
|
mew_dispatch_main_sync_safe(^{
|
||||||
MBProgressHUD *hud = [MBProgressHUD showHUDAddedTo:view animated:YES];
|
MBProgressHUD *hud = [MBProgressHUD showHUDAddedTo:view animated:YES];
|
||||||
hud.userInteractionEnabled = enabled;
|
hud.userInteractionEnabled = enabled;
|
||||||
hud.bezelView.color = [[UIColor whiteColor] colorWithAlphaComponent:0.8];
|
hud.bezelView.color = [[UIColor whiteColor] colorWithAlphaComponent:0.8];
|
@@ -1,43 +1,41 @@
|
|||||||
//
|
//
|
||||||
// NSObject+MJExtension.h
|
// NSObject+MEWExtension.h
|
||||||
// mew-ios
|
// yinmeng-ios
|
||||||
//
|
//
|
||||||
// Created by 触海 on 2023/11/6.
|
// Created by duoban on 2023/12/1.
|
||||||
//
|
//
|
||||||
|
|
||||||
#import <Foundation/Foundation.h>
|
#import <Foundation/Foundation.h>
|
||||||
|
|
||||||
NS_ASSUME_NONNULL_BEGIN
|
NS_ASSUME_NONNULL_BEGIN
|
||||||
|
|
||||||
@interface NSObject (MJExtension)
|
@interface NSObject (MEWExtension)
|
||||||
|
|
||||||
/// 依据数组初始化一个实例数组
|
/// 依据数组初始化一个实例数组
|
||||||
/// @param json json 数据
|
/// @param json json 数据
|
||||||
+ (NSArray *)modelsWithArray:(id)json;
|
+ (NSArray *)mewModelsWithArray:(id)json;
|
||||||
|
|
||||||
/// 依据字典初始化一个实例
|
/// 依据字典初始化一个实例
|
||||||
/// @param dictionary 字典
|
/// @param dictionary 字典
|
||||||
+ (instancetype)modelWithDictionary:(NSDictionary *)dictionary;
|
+ (instancetype)mewModelWithDictionary:(NSDictionary *)dictionary;
|
||||||
|
|
||||||
/// 依据JSON对象初始化一个实例
|
/// 依据JSON对象初始化一个实例
|
||||||
/// @param json json 数据
|
/// @param json json 数据
|
||||||
+ (instancetype)modelWithJSON:(id)json;
|
+ (instancetype)mewModelWithJSON:(id)json;
|
||||||
|
|
||||||
///model 转字典
|
///model 转字典
|
||||||
- (NSDictionary *)model2dictionary;
|
- (NSDictionary *)mewModel2dictionary;
|
||||||
|
|
||||||
///转 json string
|
///转 json string
|
||||||
- (NSString *)toJSONString;
|
- (NSString *)mewToJSONString;
|
||||||
|
|
||||||
///转 json object
|
///转 json object
|
||||||
- (id)toJSONObject;
|
- (id)mewToJSONObject;
|
||||||
|
|
||||||
///扩展方法 按需索取 重写即可
|
///扩展方法 按需索取 重写即可
|
||||||
///如果一个模型中 包含一个数组 数组中是另一个模型
|
///如果一个模型中 包含一个数组 数组中是另一个模型
|
||||||
+ (NSDictionary *)objectClassInArray;
|
+ (NSDictionary *)mewObjectClassInArray;
|
||||||
///如果一个模型中需要字段映射的话 比如id -> ID name -> other.name
|
///如果一个模型中需要字段映射的话 比如id -> ID name -> other.name
|
||||||
+ (NSDictionary *)replacedKeyFromPropertyName;
|
+ (NSDictionary *)mewReplacedKeyFromPropertyName;
|
||||||
|
|
||||||
@end
|
@end
|
||||||
|
|
||||||
NS_ASSUME_NONNULL_END
|
NS_ASSUME_NONNULL_END
|
@@ -1,64 +1,61 @@
|
|||||||
//
|
//
|
||||||
// NSObject+MJExtension.m
|
// NSObject+MEWExtension.m
|
||||||
// mew-ios
|
// yinmeng-ios
|
||||||
//
|
//
|
||||||
// Created by 触海 on 2023/11/6.
|
// Created by duoban on 2023/12/1.
|
||||||
//
|
//
|
||||||
|
|
||||||
#import "NSObject+MJExtension.h"
|
#import "NSObject+MEWExtension.h"
|
||||||
#import <MJExtension/MJExtension.h>
|
#import <MJExtension/MJExtension.h>
|
||||||
|
@implementation NSObject (MEWExtension)
|
||||||
@implementation NSObject (MJExtension)
|
|
||||||
|
|
||||||
/// 依据数组初始化一个实例数组
|
/// 依据数组初始化一个实例数组
|
||||||
/// @param json json 数据
|
/// @param json json 数据
|
||||||
+ (NSArray *)modelsWithArray:(id)json {
|
+ (NSArray *)mewModelsWithArray:(id)json {
|
||||||
return [self mj_objectArrayWithKeyValuesArray:json];
|
return [self mj_objectArrayWithKeyValuesArray:json];
|
||||||
}
|
}
|
||||||
|
|
||||||
/// 依据字典初始化一个实例
|
/// 依据字典初始化一个实例
|
||||||
/// @param dictionary 字典
|
/// @param dictionary 字典
|
||||||
+ (instancetype)modelWithDictionary:(NSDictionary *)dictionary {
|
+ (instancetype)mewModelWithDictionary:(NSDictionary *)dictionary {
|
||||||
return [self mj_objectWithKeyValues:dictionary];
|
return [self mj_objectWithKeyValues:dictionary];
|
||||||
}
|
}
|
||||||
|
|
||||||
/// 依据JSON对象初始化一个实例
|
/// 依据JSON对象初始化一个实例
|
||||||
/// @param json json 数据
|
/// @param json json 数据
|
||||||
+ (instancetype)modelWithJSON:(id)json {
|
+ (instancetype)mewModelWithJSON:(id)json {
|
||||||
return [self mj_objectWithKeyValues:json];
|
return [self mj_objectWithKeyValues:json];
|
||||||
}
|
}
|
||||||
|
|
||||||
///model 转字典
|
///model 转字典
|
||||||
- (NSDictionary *)model2dictionary {
|
- (NSDictionary *)mewModel2dictionary {
|
||||||
return [[self mj_keyValues] copy];
|
return [[self mj_keyValues] copy];
|
||||||
}
|
}
|
||||||
|
|
||||||
- (NSString *)toJSONString {
|
- (NSString *)mewToJSONString {
|
||||||
return [self mj_JSONString];
|
return [self mj_JSONString];
|
||||||
}
|
}
|
||||||
|
|
||||||
- (id)toJSONObject {
|
- (id)mewToJSONObject {
|
||||||
return [self mj_JSONObject];
|
return [self mj_JSONObject];
|
||||||
}
|
}
|
||||||
|
|
||||||
///如果模型中包含数组的话
|
///如果模型中包含数组的话
|
||||||
+ (NSDictionary *)mj_objectClassInArray {
|
+ (NSDictionary *)mj_mewObjectClassInArray {
|
||||||
return [self objectClassInArray];
|
return [self mewObjectClassInArray];
|
||||||
}
|
}
|
||||||
|
|
||||||
///模型中需要映射 重写整个方法
|
///模型中需要映射 重写整个方法
|
||||||
+ (NSDictionary *)mj_replacedKeyFromPropertyName {
|
+ (NSDictionary *)mj_mewReplacedKeyFromPropertyName {
|
||||||
return [self replacedKeyFromPropertyName];
|
return [self mewReplacedKeyFromPropertyName];
|
||||||
}
|
}
|
||||||
|
|
||||||
///扩展方法 按需索取 重写即可
|
///扩展方法 按需索取 重写即可
|
||||||
///如果一个模型中 包含一个数组 数组中是另一个模型
|
///如果一个模型中 包含一个数组 数组中是另一个模型
|
||||||
+ (NSDictionary *)objectClassInArray {
|
+ (NSDictionary *)mewObjectClassInArray {
|
||||||
return @{};
|
return @{};
|
||||||
}
|
}
|
||||||
///如果一个模型中需要字段映射的话 比如id -> ID name -> other.name
|
///如果一个模型中需要字段映射的话 比如id -> ID name -> other.name
|
||||||
+ (NSDictionary *)replacedKeyFromPropertyName {
|
+ (NSDictionary *)mewReplacedKeyFromPropertyName {
|
||||||
return @{};
|
return @{};
|
||||||
}
|
}
|
||||||
|
|
||||||
@end
|
@end
|
16
yinmeng-ios/yinmeng-ios/Base/Tool/Safe/NSArray+MewSafe.h
Normal file
16
yinmeng-ios/yinmeng-ios/Base/Tool/Safe/NSArray+MewSafe.h
Normal file
@@ -0,0 +1,16 @@
|
|||||||
|
//
|
||||||
|
// NSArray+MewSafe.h
|
||||||
|
// yinmeng-ios
|
||||||
|
//
|
||||||
|
// Created by duoban on 2023/12/1.
|
||||||
|
//
|
||||||
|
|
||||||
|
#import <Foundation/Foundation.h>
|
||||||
|
|
||||||
|
NS_ASSUME_NONNULL_BEGIN
|
||||||
|
|
||||||
|
@interface NSArray (MewSafe)
|
||||||
|
-(id)mewSafeObjectAtIndex:(NSUInteger)index;
|
||||||
|
@end
|
||||||
|
|
||||||
|
NS_ASSUME_NONNULL_END
|
@@ -1,15 +1,14 @@
|
|||||||
//
|
//
|
||||||
// NSArray+Safe.m
|
// NSArray+MewSafe.m
|
||||||
// mew-ios
|
// yinmeng-ios
|
||||||
//
|
//
|
||||||
// Created by 触海 on 2023/11/9.
|
// Created by duoban on 2023/12/1.
|
||||||
//
|
//
|
||||||
|
|
||||||
#import "NSArray+Safe.h"
|
#import "NSArray+MewSafe.h"
|
||||||
|
|
||||||
@implementation NSArray (Safe)
|
@implementation NSArray (MewSafe)
|
||||||
|
-(id)mewSafeObjectAtIndex:(NSUInteger)index{
|
||||||
-(id)safeObjectAtIndex1:(NSUInteger)index{
|
|
||||||
if ([self isKindOfClass:[NSArray class]]){
|
if ([self isKindOfClass:[NSArray class]]){
|
||||||
if (self.count){
|
if (self.count){
|
||||||
if (self.count>index){
|
if (self.count>index){
|
||||||
@@ -20,5 +19,4 @@
|
|||||||
return nil;
|
return nil;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@end
|
@end
|
@@ -1,16 +0,0 @@
|
|||||||
//
|
|
||||||
// NSArray+Safe.h
|
|
||||||
// mew-ios
|
|
||||||
//
|
|
||||||
// Created by 触海 on 2023/11/9.
|
|
||||||
//
|
|
||||||
|
|
||||||
#import <Foundation/Foundation.h>
|
|
||||||
|
|
||||||
NS_ASSUME_NONNULL_BEGIN
|
|
||||||
|
|
||||||
@interface NSArray (Safe)
|
|
||||||
-(id)safeObjectAtIndex1:(NSUInteger)index;
|
|
||||||
@end
|
|
||||||
|
|
||||||
NS_ASSUME_NONNULL_END
|
|
@@ -0,0 +1,16 @@
|
|||||||
|
//
|
||||||
|
// NSMutableDictionary+MEWSafe.h
|
||||||
|
// yinmeng-ios
|
||||||
|
//
|
||||||
|
// Created by duoban on 2023/12/1.
|
||||||
|
//
|
||||||
|
|
||||||
|
#import <Foundation/Foundation.h>
|
||||||
|
|
||||||
|
NS_ASSUME_NONNULL_BEGIN
|
||||||
|
|
||||||
|
@interface NSMutableDictionary (MEWSafe)
|
||||||
|
- (void)mewSafeSetObject:(id)anObject forKey:(id <NSCopying>)aKey;
|
||||||
|
@end
|
||||||
|
|
||||||
|
NS_ASSUME_NONNULL_END
|
@@ -0,0 +1,15 @@
|
|||||||
|
//
|
||||||
|
// NSMutableDictionary+MEWSafe.m
|
||||||
|
// yinmeng-ios
|
||||||
|
//
|
||||||
|
// Created by duoban on 2023/12/1.
|
||||||
|
//
|
||||||
|
|
||||||
|
#import "NSMutableDictionary+MEWSafe.h"
|
||||||
|
|
||||||
|
@implementation NSMutableDictionary (MEWSafe)
|
||||||
|
- (void)mewSafeSetObject:(id)anObject forKey:(id <NSCopying>)aKey {
|
||||||
|
if (anObject == nil || aKey == nil) return;
|
||||||
|
[self setObject:anObject forKey:aKey];
|
||||||
|
}
|
||||||
|
@end
|
@@ -1,16 +0,0 @@
|
|||||||
//
|
|
||||||
// NSMutableDictionary+Safe.h
|
|
||||||
// mew-ios
|
|
||||||
//
|
|
||||||
// Created by 触海 on 2023/11/8.
|
|
||||||
//
|
|
||||||
|
|
||||||
#import <Foundation/Foundation.h>
|
|
||||||
|
|
||||||
NS_ASSUME_NONNULL_BEGIN
|
|
||||||
|
|
||||||
@interface NSMutableDictionary (Safe)
|
|
||||||
- (void)safeSetObject:(id)anObject forKey:(id <NSCopying>)aKey;
|
|
||||||
@end
|
|
||||||
|
|
||||||
NS_ASSUME_NONNULL_END
|
|
@@ -1,16 +0,0 @@
|
|||||||
//
|
|
||||||
// NSMutableDictionary+Safe.m
|
|
||||||
// mew-ios
|
|
||||||
//
|
|
||||||
// Created by 触海 on 2023/11/8.
|
|
||||||
//
|
|
||||||
|
|
||||||
#import "NSMutableDictionary+Safe.h"
|
|
||||||
|
|
||||||
@implementation NSMutableDictionary (Safe)
|
|
||||||
|
|
||||||
- (void)safeSetObject:(id)anObject forKey:(id <NSCopying>)aKey {
|
|
||||||
if (anObject == nil || aKey == nil) return;
|
|
||||||
[self setObject:anObject forKey:aKey];
|
|
||||||
}
|
|
||||||
@end
|
|
@@ -7,7 +7,7 @@
|
|||||||
|
|
||||||
#import "DESEncrypt.h"
|
#import "DESEncrypt.h"
|
||||||
#import <CommonCrypto/CommonCrypto.h>
|
#import <CommonCrypto/CommonCrypto.h>
|
||||||
#import "Base64.h"
|
#import "MEWBase64.h"
|
||||||
|
|
||||||
@implementation DESEncrypt : NSObject
|
@implementation DESEncrypt : NSObject
|
||||||
|
|
||||||
@@ -31,7 +31,7 @@ const Byte iv[] = {1,2,3,4,5,6,7,8};
|
|||||||
&numBytesEncrypted);
|
&numBytesEncrypted);
|
||||||
if (cryptStatus == kCCSuccess) {
|
if (cryptStatus == kCCSuccess) {
|
||||||
NSData *data = [NSData dataWithBytes:buffer length:(NSUInteger)numBytesEncrypted];
|
NSData *data = [NSData dataWithBytes:buffer length:(NSUInteger)numBytesEncrypted];
|
||||||
ciphertext = [Base64 encode:data];
|
ciphertext = [MEWBase64 encode:data];
|
||||||
}
|
}
|
||||||
return ciphertext;
|
return ciphertext;
|
||||||
}
|
}
|
||||||
@@ -40,7 +40,7 @@ const Byte iv[] = {1,2,3,4,5,6,7,8};
|
|||||||
+(NSString *)decryptUseDES:(NSString *)cipherText key:(NSString *)key
|
+(NSString *)decryptUseDES:(NSString *)cipherText key:(NSString *)key
|
||||||
{
|
{
|
||||||
NSString *plaintext = nil;
|
NSString *plaintext = nil;
|
||||||
NSData *cipherdata = [Base64 decode:cipherText];
|
NSData *cipherdata = [MEWBase64 decode:cipherText];
|
||||||
unsigned char buffer[200000];
|
unsigned char buffer[200000];
|
||||||
memset(buffer, 0, sizeof(char));
|
memset(buffer, 0, sizeof(char));
|
||||||
size_t numBytesDecrypted = 0;
|
size_t numBytesDecrypted = 0;
|
||||||
|
@@ -1,19 +1,17 @@
|
|||||||
//
|
//
|
||||||
// Base64.h
|
// MEWBase64.h
|
||||||
// mew-ios
|
// yinmeng-ios
|
||||||
//
|
//
|
||||||
// Created by 触海 on 2023/11/8.
|
// Created by duoban on 2023/12/1.
|
||||||
//
|
//
|
||||||
|
|
||||||
#import <Foundation/Foundation.h>
|
#import <Foundation/Foundation.h>
|
||||||
|
|
||||||
NS_ASSUME_NONNULL_BEGIN
|
NS_ASSUME_NONNULL_BEGIN
|
||||||
|
|
||||||
@interface Base64 : NSObject
|
@interface MEWBase64 : NSObject
|
||||||
|
|
||||||
+(NSString *)encode:(NSData *)data;
|
+(NSString *)encode:(NSData *)data;
|
||||||
+(NSData *)decode:(NSString *)dataString;
|
+(NSData *)decode:(NSString *)dataString;
|
||||||
|
|
||||||
@end
|
@end
|
||||||
|
|
||||||
NS_ASSUME_NONNULL_END
|
NS_ASSUME_NONNULL_END
|
@@ -1,20 +1,16 @@
|
|||||||
//
|
//
|
||||||
// Base64.m
|
// MEWBase64.m
|
||||||
// mew-ios
|
// yinmeng-ios
|
||||||
//
|
//
|
||||||
// Created by 触海 on 2023/11/8.
|
// Created by duoban on 2023/12/1.
|
||||||
//
|
//
|
||||||
|
|
||||||
#import "Base64.h"
|
#import "MEWBase64.h"
|
||||||
|
@interface MEWBase64()
|
||||||
@interface Base64()
|
|
||||||
+(int)char2Int:(char)c;
|
+(int)char2Int:(char)c;
|
||||||
@end
|
@end
|
||||||
|
|
||||||
@implementation Base64
|
|
||||||
|
|
||||||
static const char encodingTable[] = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
|
static const char encodingTable[] = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
|
||||||
|
@implementation MEWBase64
|
||||||
+(NSString *)encode:(NSData *)data
|
+(NSString *)encode:(NSData *)data
|
||||||
{
|
{
|
||||||
if (data.length == 0)
|
if (data.length == 0)
|
||||||
@@ -128,5 +124,4 @@ static const char encodingTable[] = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopq
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@end
|
@end
|
59
yinmeng-ios/yinmeng-ios/Base/Tool/ThemeColor/MEWThemeColor.h
Normal file
59
yinmeng-ios/yinmeng-ios/Base/Tool/ThemeColor/MEWThemeColor.h
Normal file
@@ -0,0 +1,59 @@
|
|||||||
|
//
|
||||||
|
// MEWMEWThemeColor.h
|
||||||
|
// yinmeng-ios
|
||||||
|
//
|
||||||
|
// Created by duoban on 2023/12/1.
|
||||||
|
//
|
||||||
|
|
||||||
|
#import <Foundation/Foundation.h>
|
||||||
|
#import <UIKit/UIKit.h>
|
||||||
|
|
||||||
|
NS_ASSUME_NONNULL_BEGIN
|
||||||
|
#define UIColorMewFromRGB(rgbValue) [UIColor colorWithRed:((float)((rgbValue & 0xFF0000) >> 16))/255.0 green:((float)((rgbValue & 0xFF00) >> 8))/255.0 blue:((float)(rgbValue & 0xFF))/255.0 alpha:1.0]
|
||||||
|
|
||||||
|
#define UIColorMewRGBAlpha(rgbValue,a) [UIColor colorWithRed:((float)((rgbValue & 0xFF0000) >> 16))/255.0 green:((float)((rgbValue & 0xFF00) >> 8))/255.0 blue:((float)(rgbValue & 0xFF))/255.0 alpha:(a)]
|
||||||
|
|
||||||
|
@interface MEWThemeColor : NSObject
|
||||||
|
/// view的背景色 0xF3F5FA
|
||||||
|
+ (UIColor *)mewAppBackgroundColor;
|
||||||
|
/// cell的背景色 0xFFFFFF
|
||||||
|
+ (UIColor *)mewAppCellBackgroundColor;
|
||||||
|
///正文颜色 0x333333
|
||||||
|
+ (UIColor *)mewMainTextColor;
|
||||||
|
/// 二级文字颜色 0x666666
|
||||||
|
+ (UIColor *)mewSecondTextColor;
|
||||||
|
///分割线的颜色 0xE8E8E8
|
||||||
|
+ (UIColor *)mewDividerColor;
|
||||||
|
|
||||||
|
/* ------弹窗相关颜色 START------ */
|
||||||
|
+ (UIColor *)mewAlertBackgroundColor;
|
||||||
|
+ (UIColor *)mewAlertTitleColor;
|
||||||
|
+ (UIColor *)mewAlertMessageColor;
|
||||||
|
+ (UIColor *)mewActionSeparatorColor;
|
||||||
|
/* ------弹窗相关颜色 END------ */
|
||||||
|
|
||||||
|
/* ------Button 相关颜色 START------ */
|
||||||
|
/// button 可用 渐变色的开始 0xFFA936
|
||||||
|
+ (UIColor *)mewConfirmButtonGradientStartColor;
|
||||||
|
/// button 可用 渐变色的开始 0xFFCB47
|
||||||
|
+ (UIColor *)mewConfirmButtonGradientEndColor;
|
||||||
|
/// 确定的按钮文字颜色 #FFFFFF
|
||||||
|
+ (UIColor *)mewConfirmButtonTextColor;
|
||||||
|
/// 取消按钮 渐变色的开始 0xF7DDBF
|
||||||
|
+ (UIColor *)mewCancelButtonGradientStartColor;
|
||||||
|
/// 取消按钮 渐变色的结束 0xF7E8C4
|
||||||
|
+ (UIColor *)mewCancelButtonGradientEndColor;
|
||||||
|
/// 取消的按钮文字颜色 0xFFA936
|
||||||
|
+ (UIColor *)mewCancelButtonTextColor;
|
||||||
|
/// 取消按钮单一普通背景色 0xFFCE4E
|
||||||
|
+ (UIColor *)mewCancelButtonNormalBgColor;
|
||||||
|
/// 按钮不可点击背景色 0xD2D5D7
|
||||||
|
+ (UIColor *)mewDisableButtonColor;
|
||||||
|
/// 按钮不可点击文字颜色 0xF9F9F9
|
||||||
|
+ (UIColor *)mewDisableButtonTextColor;
|
||||||
|
/* ------Button 相关颜色 END------ */
|
||||||
|
|
||||||
|
+ (UIColor *)mewColorWithHexString:(NSString *)hexString;
|
||||||
|
@end
|
||||||
|
|
||||||
|
NS_ASSUME_NONNULL_END
|
135
yinmeng-ios/yinmeng-ios/Base/Tool/ThemeColor/MEWThemeColor.m
Normal file
135
yinmeng-ios/yinmeng-ios/Base/Tool/ThemeColor/MEWThemeColor.m
Normal file
@@ -0,0 +1,135 @@
|
|||||||
|
//
|
||||||
|
// MEWThemeColor.m
|
||||||
|
// yinmeng-ios
|
||||||
|
//
|
||||||
|
// Created by duoban on 2023/12/1.
|
||||||
|
//
|
||||||
|
|
||||||
|
#import "MEWThemeColor.h"
|
||||||
|
|
||||||
|
@implementation MEWThemeColor
|
||||||
|
/// view的背景色 0xF3F5FA
|
||||||
|
+ (UIColor *)mewAppBackgroundColor {
|
||||||
|
return UIColorMewFromRGB(0xF8F8FB);
|
||||||
|
}
|
||||||
|
/// cell的背景色 0xFFFFFF
|
||||||
|
+ (UIColor *)mewAppCellBackgroundColor {
|
||||||
|
return UIColorMewFromRGB(0xFFFFFF);
|
||||||
|
}
|
||||||
|
///正文颜色 0x333333
|
||||||
|
+ (UIColor *)mewMainTextColor {
|
||||||
|
return UIColorMewFromRGB(0x282828);
|
||||||
|
}
|
||||||
|
/// 二级文字颜色 0x666666
|
||||||
|
+ (UIColor *)mewSecondTextColor {
|
||||||
|
return UIColorMewFromRGB(0x878B9C);
|
||||||
|
}
|
||||||
|
|
||||||
|
///分割线的颜色 0xE8E8E8
|
||||||
|
+ (UIColor *)mewDividerColor {
|
||||||
|
return UIColorMewFromRGB(0xE8E8E8);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/* ------弹窗相关颜色 START------ */
|
||||||
|
+ (UIColor *)mewAlertBackgroundColor {
|
||||||
|
return UIColorMewFromRGB(0xFFFFFF);
|
||||||
|
}
|
||||||
|
|
||||||
|
+ (UIColor *)mewAlertTitleColor {
|
||||||
|
return UIColorMewFromRGB(0x333333);
|
||||||
|
}
|
||||||
|
+ (UIColor *)mewAlertMessageColor {
|
||||||
|
return UIColorMewFromRGB(0x333333);
|
||||||
|
}
|
||||||
|
+ (UIColor *)mewActionSeparatorColor {
|
||||||
|
return UIColorMewFromRGB(0xF0F0F0);
|
||||||
|
}
|
||||||
|
/* ------弹窗相关颜色 END------ */
|
||||||
|
|
||||||
|
|
||||||
|
/* ------Button 相关颜色 START------ */
|
||||||
|
/// button 可用 渐变色的开始 0xFFA936
|
||||||
|
+ (UIColor *)mewConfirmButtonGradientStartColor {
|
||||||
|
return UIColorMewFromRGB(0xFFE710);
|
||||||
|
}
|
||||||
|
/// button 可用 渐变色的开始 0xFFCB47
|
||||||
|
+ (UIColor *)mewConfirmButtonGradientEndColor {
|
||||||
|
return UIColorMewFromRGB(0xFFE710);
|
||||||
|
}
|
||||||
|
/// 确定的按钮文字颜色 #FFFFFF
|
||||||
|
+ (UIColor *)mewConfirmButtonTextColor {
|
||||||
|
return UIColorMewFromRGB(0x282828);
|
||||||
|
}
|
||||||
|
/// 取消按钮 渐变色的开始 0xF7DDBF
|
||||||
|
+ (UIColor *)mewCancelButtonGradientStartColor {
|
||||||
|
return UIColorMewFromRGB(0xFFFACF);
|
||||||
|
}
|
||||||
|
/// 取消按钮 渐变色的结束 0xF7E8C4
|
||||||
|
+ (UIColor *)mewCancelButtonGradientEndColor {
|
||||||
|
return UIColorMewFromRGB(0xFFFACF);
|
||||||
|
}
|
||||||
|
/// 取消的按钮文字颜色 0xFFA936
|
||||||
|
+ (UIColor *)mewCancelButtonTextColor {
|
||||||
|
return UIColorMewFromRGB(0x282828);
|
||||||
|
}
|
||||||
|
/// 取消按钮单一普通背景色 0xFFCE4E
|
||||||
|
+ (UIColor *)mewCancelButtonNormalBgColor {
|
||||||
|
return UIColorMewFromRGB(0xFFFACF);
|
||||||
|
}
|
||||||
|
/// 按钮不可点击背景色 0xD2D5D7
|
||||||
|
+ (UIColor *)mewDisableButtonColor {
|
||||||
|
return UIColorMewFromRGB(0xF2F3F6);
|
||||||
|
}
|
||||||
|
/// 按钮不可点击文字颜色 0xF9F9F9
|
||||||
|
+ (UIColor *)mewDisableButtonTextColor {
|
||||||
|
return UIColorMewFromRGB(0x878B9C);
|
||||||
|
}
|
||||||
|
/* ------Button 相关颜色 END------ */
|
||||||
|
|
||||||
|
+ (UIColor *)mewColorWithHexString: (NSString *) hexString {
|
||||||
|
if (hexString.length == 0) {
|
||||||
|
return [UIColor blackColor];
|
||||||
|
}
|
||||||
|
NSString *colorString = [[hexString stringByReplacingOccurrencesOfString: @"#" withString: @""] uppercaseString];
|
||||||
|
CGFloat alpha, red, blue, green;
|
||||||
|
switch ([colorString length]) {
|
||||||
|
case 3: // #RGB
|
||||||
|
alpha = 1.0f;
|
||||||
|
red = [self mewColorComponentFrom: colorString start: 0 length: 1];
|
||||||
|
green = [self mewColorComponentFrom: colorString start: 1 length: 1];
|
||||||
|
blue = [self mewColorComponentFrom: colorString start: 2 length: 1];
|
||||||
|
break;
|
||||||
|
case 4: // #ARGB
|
||||||
|
alpha = [self mewColorComponentFrom: colorString start: 0 length: 1];
|
||||||
|
red = [self mewColorComponentFrom: colorString start: 1 length: 1];
|
||||||
|
green = [self mewColorComponentFrom: colorString start: 2 length: 1];
|
||||||
|
blue = [self mewColorComponentFrom: colorString start: 3 length: 1];
|
||||||
|
break;
|
||||||
|
case 6: // #RRGGBB
|
||||||
|
alpha = 1.0f;
|
||||||
|
red = [self mewColorComponentFrom: colorString start: 0 length: 2];
|
||||||
|
green = [self mewColorComponentFrom: colorString start: 2 length: 2];
|
||||||
|
blue = [self mewColorComponentFrom: colorString start: 4 length: 2];
|
||||||
|
break;
|
||||||
|
case 8: // #AARRGGBB
|
||||||
|
alpha = [self mewColorComponentFrom: colorString start: 0 length: 2];
|
||||||
|
red = [self mewColorComponentFrom: colorString start: 2 length: 2];
|
||||||
|
green = [self mewColorComponentFrom: colorString start: 4 length: 2];
|
||||||
|
blue = [self mewColorComponentFrom: colorString start: 6 length: 2];
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
[NSException raise:@"Invalid color value" format: @"Color value %@ is invalid. It should be a hex value of the form #RBG, #ARGB, #RRGGBB, or #AARRGGBB", hexString];
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
return [UIColor colorWithRed: red green: green blue: blue alpha: alpha];
|
||||||
|
}
|
||||||
|
|
||||||
|
+ (CGFloat) mewColorComponentFrom: (NSString *) string start: (NSUInteger) start length: (NSUInteger) length {
|
||||||
|
NSString *substring = [string substringWithRange: NSMakeRange(start, length)];
|
||||||
|
NSString *fullHex = length == 2 ? substring : [NSString stringWithFormat: @"%@%@", substring, substring];
|
||||||
|
unsigned hexComponent;
|
||||||
|
[[NSScanner scannerWithString: fullHex] scanHexInt: &hexComponent];
|
||||||
|
return hexComponent / 255.0;
|
||||||
|
}
|
||||||
|
@end
|
@@ -1,59 +0,0 @@
|
|||||||
//
|
|
||||||
// ThemeColor.h
|
|
||||||
// mew-ios
|
|
||||||
//
|
|
||||||
// Created by 触海 on 2023/11/6.
|
|
||||||
//
|
|
||||||
|
|
||||||
#import <UIKit/UIKit.h>
|
|
||||||
|
|
||||||
#define UIColorFromRGB(rgbValue) [UIColor colorWithRed:((float)((rgbValue & 0xFF0000) >> 16))/255.0 green:((float)((rgbValue & 0xFF00) >> 8))/255.0 blue:((float)(rgbValue & 0xFF))/255.0 alpha:1.0]
|
|
||||||
|
|
||||||
#define UIColorRGBAlpha(rgbValue,a) [UIColor colorWithRed:((float)((rgbValue & 0xFF0000) >> 16))/255.0 green:((float)((rgbValue & 0xFF00) >> 8))/255.0 blue:((float)(rgbValue & 0xFF))/255.0 alpha:(a)]
|
|
||||||
|
|
||||||
NS_ASSUME_NONNULL_BEGIN
|
|
||||||
|
|
||||||
@interface ThemeColor : NSObject
|
|
||||||
/// view的背景色 0xF3F5FA
|
|
||||||
+ (UIColor *)appBackgroundColor;
|
|
||||||
/// cell的背景色 0xFFFFFF
|
|
||||||
+ (UIColor *)appCellBackgroundColor;
|
|
||||||
///正文颜色 0x333333
|
|
||||||
+ (UIColor *)mainTextColor;
|
|
||||||
/// 二级文字颜色 0x666666
|
|
||||||
+ (UIColor *)secondTextColor;
|
|
||||||
///分割线的颜色 0xE8E8E8
|
|
||||||
+ (UIColor *)dividerColor;
|
|
||||||
|
|
||||||
/* ------弹窗相关颜色 START------ */
|
|
||||||
+ (UIColor *)alertBackgroundColor;
|
|
||||||
+ (UIColor *)alertTitleColor;
|
|
||||||
+ (UIColor *)alertMessageColor;
|
|
||||||
+ (UIColor *)actionSeparatorColor;
|
|
||||||
/* ------弹窗相关颜色 END------ */
|
|
||||||
|
|
||||||
/* ------Button 相关颜色 START------ */
|
|
||||||
/// button 可用 渐变色的开始 0xFFA936
|
|
||||||
+ (UIColor *)confirmButtonGradientStartColor;
|
|
||||||
/// button 可用 渐变色的开始 0xFFCB47
|
|
||||||
+ (UIColor *)confirmButtonGradientEndColor;
|
|
||||||
/// 确定的按钮文字颜色 #FFFFFF
|
|
||||||
+ (UIColor *)confirmButtonTextColor;
|
|
||||||
/// 取消按钮 渐变色的开始 0xF7DDBF
|
|
||||||
+ (UIColor *)cancelButtonGradientStartColor;
|
|
||||||
/// 取消按钮 渐变色的结束 0xF7E8C4
|
|
||||||
+ (UIColor *)cancelButtonGradientEndColor;
|
|
||||||
/// 取消的按钮文字颜色 0xFFA936
|
|
||||||
+ (UIColor *)cancelButtonTextColor;
|
|
||||||
/// 取消按钮单一普通背景色 0xFFCE4E
|
|
||||||
+ (UIColor *)cancelButtonNormalBgColor;
|
|
||||||
/// 按钮不可点击背景色 0xD2D5D7
|
|
||||||
+ (UIColor *)disableButtonColor;
|
|
||||||
/// 按钮不可点击文字颜色 0xF9F9F9
|
|
||||||
+ (UIColor *)disableButtonTextColor;
|
|
||||||
/* ------Button 相关颜色 END------ */
|
|
||||||
|
|
||||||
+ (UIColor *)colorWithHexString:(NSString *)hexString;
|
|
||||||
@end
|
|
||||||
|
|
||||||
NS_ASSUME_NONNULL_END
|
|
@@ -1,137 +0,0 @@
|
|||||||
//
|
|
||||||
// ThemeColor.m
|
|
||||||
// mew-ios
|
|
||||||
//
|
|
||||||
// Created by 触海 on 2023/11/6.
|
|
||||||
//
|
|
||||||
|
|
||||||
#import "ThemeColor.h"
|
|
||||||
|
|
||||||
@implementation ThemeColor
|
|
||||||
|
|
||||||
/// view的背景色 0xF3F5FA
|
|
||||||
+ (UIColor *)appBackgroundColor {
|
|
||||||
return UIColorFromRGB(0xF8F8FB);
|
|
||||||
}
|
|
||||||
/// cell的背景色 0xFFFFFF
|
|
||||||
+ (UIColor *)appCellBackgroundColor {
|
|
||||||
return UIColorFromRGB(0xFFFFFF);
|
|
||||||
}
|
|
||||||
///正文颜色 0x333333
|
|
||||||
+ (UIColor *)mainTextColor {
|
|
||||||
return UIColorFromRGB(0x282828);
|
|
||||||
}
|
|
||||||
/// 二级文字颜色 0x666666
|
|
||||||
+ (UIColor *)secondTextColor {
|
|
||||||
return UIColorFromRGB(0x878B9C);
|
|
||||||
}
|
|
||||||
|
|
||||||
///分割线的颜色 0xE8E8E8
|
|
||||||
+ (UIColor *)dividerColor {
|
|
||||||
return UIColorFromRGB(0xE8E8E8);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/* ------弹窗相关颜色 START------ */
|
|
||||||
+ (UIColor *)alertBackgroundColor {
|
|
||||||
return UIColorFromRGB(0xFFFFFF);
|
|
||||||
}
|
|
||||||
|
|
||||||
+ (UIColor *)alertTitleColor {
|
|
||||||
return UIColorFromRGB(0x333333);
|
|
||||||
}
|
|
||||||
+ (UIColor *)alertMessageColor {
|
|
||||||
return UIColorFromRGB(0x333333);
|
|
||||||
}
|
|
||||||
+ (UIColor *)actionSeparatorColor {
|
|
||||||
return UIColorFromRGB(0xF0F0F0);
|
|
||||||
}
|
|
||||||
/* ------弹窗相关颜色 END------ */
|
|
||||||
|
|
||||||
|
|
||||||
/* ------Button 相关颜色 START------ */
|
|
||||||
/// button 可用 渐变色的开始 0xFFA936
|
|
||||||
+ (UIColor *)confirmButtonGradientStartColor {
|
|
||||||
return UIColorFromRGB(0xFFE710);
|
|
||||||
}
|
|
||||||
/// button 可用 渐变色的开始 0xFFCB47
|
|
||||||
+ (UIColor *)confirmButtonGradientEndColor {
|
|
||||||
return UIColorFromRGB(0xFFE710);
|
|
||||||
}
|
|
||||||
/// 确定的按钮文字颜色 #FFFFFF
|
|
||||||
+ (UIColor *)confirmButtonTextColor {
|
|
||||||
return UIColorFromRGB(0x282828);
|
|
||||||
}
|
|
||||||
/// 取消按钮 渐变色的开始 0xF7DDBF
|
|
||||||
+ (UIColor *)cancelButtonGradientStartColor {
|
|
||||||
return UIColorFromRGB(0xFFFACF);
|
|
||||||
}
|
|
||||||
/// 取消按钮 渐变色的结束 0xF7E8C4
|
|
||||||
+ (UIColor *)cancelButtonGradientEndColor {
|
|
||||||
return UIColorFromRGB(0xFFFACF);
|
|
||||||
}
|
|
||||||
/// 取消的按钮文字颜色 0xFFA936
|
|
||||||
+ (UIColor *)cancelButtonTextColor {
|
|
||||||
return UIColorFromRGB(0x282828);
|
|
||||||
}
|
|
||||||
/// 取消按钮单一普通背景色 0xFFCE4E
|
|
||||||
+ (UIColor *)cancelButtonNormalBgColor {
|
|
||||||
return UIColorFromRGB(0xFFFACF);
|
|
||||||
}
|
|
||||||
/// 按钮不可点击背景色 0xD2D5D7
|
|
||||||
+ (UIColor *)disableButtonColor {
|
|
||||||
return UIColorFromRGB(0xF2F3F6);
|
|
||||||
}
|
|
||||||
/// 按钮不可点击文字颜色 0xF9F9F9
|
|
||||||
+ (UIColor *)disableButtonTextColor {
|
|
||||||
return UIColorFromRGB(0x878B9C);
|
|
||||||
}
|
|
||||||
/* ------Button 相关颜色 END------ */
|
|
||||||
|
|
||||||
+ (UIColor *)colorWithHexString: (NSString *) hexString {
|
|
||||||
if (hexString.length == 0) {
|
|
||||||
return [UIColor blackColor];
|
|
||||||
}
|
|
||||||
NSString *colorString = [[hexString stringByReplacingOccurrencesOfString: @"#" withString: @""] uppercaseString];
|
|
||||||
CGFloat alpha, red, blue, green;
|
|
||||||
switch ([colorString length]) {
|
|
||||||
case 3: // #RGB
|
|
||||||
alpha = 1.0f;
|
|
||||||
red = [self colorComponentFrom: colorString start: 0 length: 1];
|
|
||||||
green = [self colorComponentFrom: colorString start: 1 length: 1];
|
|
||||||
blue = [self colorComponentFrom: colorString start: 2 length: 1];
|
|
||||||
break;
|
|
||||||
case 4: // #ARGB
|
|
||||||
alpha = [self colorComponentFrom: colorString start: 0 length: 1];
|
|
||||||
red = [self colorComponentFrom: colorString start: 1 length: 1];
|
|
||||||
green = [self colorComponentFrom: colorString start: 2 length: 1];
|
|
||||||
blue = [self colorComponentFrom: colorString start: 3 length: 1];
|
|
||||||
break;
|
|
||||||
case 6: // #RRGGBB
|
|
||||||
alpha = 1.0f;
|
|
||||||
red = [self colorComponentFrom: colorString start: 0 length: 2];
|
|
||||||
green = [self colorComponentFrom: colorString start: 2 length: 2];
|
|
||||||
blue = [self colorComponentFrom: colorString start: 4 length: 2];
|
|
||||||
break;
|
|
||||||
case 8: // #AARRGGBB
|
|
||||||
alpha = [self colorComponentFrom: colorString start: 0 length: 2];
|
|
||||||
red = [self colorComponentFrom: colorString start: 2 length: 2];
|
|
||||||
green = [self colorComponentFrom: colorString start: 4 length: 2];
|
|
||||||
blue = [self colorComponentFrom: colorString start: 6 length: 2];
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
[NSException raise:@"Invalid color value" format: @"Color value %@ is invalid. It should be a hex value of the form #RBG, #ARGB, #RRGGBB, or #AARRGGBB", hexString];
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
return [UIColor colorWithRed: red green: green blue: blue alpha: alpha];
|
|
||||||
}
|
|
||||||
|
|
||||||
+ (CGFloat) colorComponentFrom: (NSString *) string start: (NSUInteger) start length: (NSUInteger) length {
|
|
||||||
NSString *substring = [string substringWithRange: NSMakeRange(start, length)];
|
|
||||||
NSString *fullHex = length == 2 ? substring : [NSString stringWithFormat: @"%@%@", substring, substring];
|
|
||||||
unsigned hexComponent;
|
|
||||||
[[NSScanner scannerWithString: fullHex] scanHexInt: &hexComponent];
|
|
||||||
return hexComponent / 255.0;
|
|
||||||
}
|
|
||||||
|
|
||||||
@end
|
|
@@ -0,0 +1,17 @@
|
|||||||
|
//
|
||||||
|
// MewMewTimeIntervalUtils.h
|
||||||
|
// yinmeng-ios
|
||||||
|
//
|
||||||
|
// Created by duoban on 2023/12/1.
|
||||||
|
//
|
||||||
|
|
||||||
|
#import <Foundation/Foundation.h>
|
||||||
|
|
||||||
|
NS_ASSUME_NONNULL_BEGIN
|
||||||
|
|
||||||
|
@interface MewTimeIntervalUtils : NSObject
|
||||||
|
/// 时间戳转换成字符串
|
||||||
|
+ (NSString*)mewShowTime:(NSTimeInterval) msglastTime showDetail:(BOOL)showDetail;
|
||||||
|
@end
|
||||||
|
|
||||||
|
NS_ASSUME_NONNULL_END
|
@@ -1,16 +1,15 @@
|
|||||||
//
|
//
|
||||||
// TimeIntervalUtils.m
|
// MewTimeIntervalUtils.m
|
||||||
// mew-ios
|
// yinmeng-ios
|
||||||
//
|
//
|
||||||
// Created by 触海 on 2023/11/10.
|
// Created by duoban on 2023/12/1.
|
||||||
//
|
//
|
||||||
|
|
||||||
#import "TimeIntervalUtils.h"
|
#import "MewTimeIntervalUtils.h"
|
||||||
|
|
||||||
@implementation TimeIntervalUtils
|
|
||||||
|
|
||||||
|
@implementation MewTimeIntervalUtils
|
||||||
/// 时间戳转换成字符串
|
/// 时间戳转换成字符串
|
||||||
+ (NSString*)showTime:(NSTimeInterval) msglastTime showDetail:(BOOL)showDetail {
|
+ (NSString*)mewShowTime:(NSTimeInterval) msglastTime showDetail:(BOOL)showDetail {
|
||||||
//今天的时间
|
//今天的时间
|
||||||
NSDate * nowDate = [NSDate date];
|
NSDate * nowDate = [NSDate date];
|
||||||
NSDate * msgDate = [NSDate dateWithTimeIntervalSince1970:msglastTime];
|
NSDate * msgDate = [NSDate dateWithTimeIntervalSince1970:msglastTime];
|
||||||
@@ -22,7 +21,7 @@
|
|||||||
NSInteger hour = msgDateComponents.hour;
|
NSInteger hour = msgDateComponents.hour;
|
||||||
double OnedayTimeIntervalValue = 24*60*60; //一天的秒数
|
double OnedayTimeIntervalValue = 24*60*60; //一天的秒数
|
||||||
|
|
||||||
result = [self getPeriodOfTime:hour withMinute:msgDateComponents.minute];
|
result = [self mewGetPeriodOfTime:hour withMinute:msgDateComponents.minute];
|
||||||
if (hour > 12)
|
if (hour > 12)
|
||||||
{
|
{
|
||||||
hour = hour - 12;
|
hour = hour - 12;
|
||||||
@@ -44,7 +43,7 @@
|
|||||||
}
|
}
|
||||||
else if([nowDate timeIntervalSinceDate:msgDate] < 7 * OnedayTimeIntervalValue)//一周内
|
else if([nowDate timeIntervalSinceDate:msgDate] < 7 * OnedayTimeIntervalValue)//一周内
|
||||||
{
|
{
|
||||||
NSString *weekDay = [self weekdayStr:msgDateComponents.weekday];
|
NSString *weekDay = [self mewWeekdayStr:msgDateComponents.weekday];
|
||||||
result = showDetail? [weekDay stringByAppendingFormat:@"%@ %zd:%02d",result,hour,(int)msgDateComponents.minute] : weekDay;
|
result = showDetail? [weekDay stringByAppendingFormat:@"%@ %zd:%02d",result,hour,(int)msgDateComponents.minute] : weekDay;
|
||||||
}
|
}
|
||||||
else//显示日期
|
else//显示日期
|
||||||
@@ -56,7 +55,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
#pragma mark - Private
|
#pragma mark - Private
|
||||||
+ (NSString *)getPeriodOfTime:(NSInteger)time withMinute:(NSInteger)minute {
|
+ (NSString *)mewGetPeriodOfTime:(NSInteger)time withMinute:(NSInteger)minute {
|
||||||
NSInteger totalMin = time *60 + minute;
|
NSInteger totalMin = time *60 + minute;
|
||||||
NSString *showPeriodOfTime = @"";
|
NSString *showPeriodOfTime = @"";
|
||||||
if (totalMin > 0 && totalMin <= 5 * 60)
|
if (totalMin > 0 && totalMin <= 5 * 60)
|
||||||
@@ -78,7 +77,7 @@
|
|||||||
return showPeriodOfTime;
|
return showPeriodOfTime;
|
||||||
}
|
}
|
||||||
|
|
||||||
+ (NSString*)weekdayStr:(NSInteger)dayOfWeek {
|
+ (NSString*)mewWeekdayStr:(NSInteger)dayOfWeek {
|
||||||
static NSDictionary *daysOfWeekDict = nil;
|
static NSDictionary *daysOfWeekDict = nil;
|
||||||
daysOfWeekDict = @{@(1):@"星期日",
|
daysOfWeekDict = @{@(1):@"星期日",
|
||||||
@(2):@"星期一",
|
@(2):@"星期一",
|
@@ -1,19 +0,0 @@
|
|||||||
//
|
|
||||||
// TimeIntervalUtils.h
|
|
||||||
// mew-ios
|
|
||||||
//
|
|
||||||
// Created by 触海 on 2023/11/10.
|
|
||||||
//
|
|
||||||
|
|
||||||
#import <Foundation/Foundation.h>
|
|
||||||
|
|
||||||
NS_ASSUME_NONNULL_BEGIN
|
|
||||||
|
|
||||||
@interface TimeIntervalUtils : NSObject
|
|
||||||
|
|
||||||
/// 时间戳转换成字符串
|
|
||||||
+ (NSString*)showTime:(NSTimeInterval) msglastTime showDetail:(BOOL)showDetail;
|
|
||||||
|
|
||||||
@end
|
|
||||||
|
|
||||||
NS_ASSUME_NONNULL_END
|
|
21
yinmeng-ios/yinmeng-ios/Base/Tool/Timer/MEWTimer.h
Normal file
21
yinmeng-ios/yinmeng-ios/Base/Tool/Timer/MEWTimer.h
Normal file
@@ -0,0 +1,21 @@
|
|||||||
|
//
|
||||||
|
// MEWTimer.h
|
||||||
|
// yinmeng-ios
|
||||||
|
//
|
||||||
|
// Created by duoban on 2023/12/1.
|
||||||
|
//
|
||||||
|
|
||||||
|
#import <Foundation/Foundation.h>
|
||||||
|
typedef void(^MEWTimerHandler) (id _Nullable userInfo);
|
||||||
|
NS_ASSUME_NONNULL_BEGIN
|
||||||
|
@interface MEWTimerTarget : NSObject
|
||||||
|
|
||||||
|
@end
|
||||||
|
|
||||||
|
@interface MEWTimer : NSObject
|
||||||
|
+ (NSTimer *)MEWScheduledTimerWithTimeInterval:(NSTimeInterval)interval block:(MEWTimerHandler)block userInfo:(id)userInfo repeats:(BOOL)repeats;
|
||||||
|
|
||||||
|
+ (NSTimer *)MEWScheduledTimerWithTimeInterval:(NSTimeInterval)interval target:(id)aTarget selector:(SEL)aSelector userInfo:(id)userInfo repeats:(BOOL)repeats;
|
||||||
|
@end
|
||||||
|
|
||||||
|
NS_ASSUME_NONNULL_END
|
@@ -1,20 +1,17 @@
|
|||||||
//
|
//
|
||||||
// YMWeakTimer.m
|
// MEWTimer.m
|
||||||
// mew-ios
|
// yinmeng-ios
|
||||||
//
|
//
|
||||||
// Created by 触海 on 2023/11/8.
|
// Created by duoban on 2023/12/1.
|
||||||
//
|
//
|
||||||
|
|
||||||
#import "YMWeakTimer.h"
|
#import "MEWTimer.h"
|
||||||
|
@interface MEWTimerTarget()
|
||||||
#pragma mark - YMWeakTimerTarget
|
|
||||||
@interface YMWeakTimerTarget()
|
|
||||||
@property (nonatomic, weak) id target;
|
@property (nonatomic, weak) id target;
|
||||||
@property (nonatomic, weak) NSTimer* timer;
|
@property (nonatomic, weak) NSTimer* timer;
|
||||||
@property (nonatomic, assign) SEL selector;
|
@property (nonatomic, assign) SEL selector;
|
||||||
@end
|
@end
|
||||||
|
@implementation MEWTimerTarget
|
||||||
@implementation YMWeakTimerTarget
|
|
||||||
- (void) fire:(NSTimer *)timer {
|
- (void) fire:(NSTimer *)timer {
|
||||||
if(self.target) {
|
if(self.target) {
|
||||||
#pragma clang diagnostic push
|
#pragma clang diagnostic push
|
||||||
@@ -29,26 +26,26 @@
|
|||||||
|
|
||||||
|
|
||||||
#pragma mark - YMWeakTimer
|
#pragma mark - YMWeakTimer
|
||||||
@implementation YMWeakTimer
|
@implementation MEWTimer
|
||||||
|
|
||||||
+ (NSTimer *)scheduledTimerWithTimeInterval:(NSTimeInterval)interval target:(id)aTarget selector:(SEL)aSelector userInfo:(id)userInfo repeats:(BOOL)repeats{
|
+ (NSTimer *)MEWScheduledTimerWithTimeInterval:(NSTimeInterval)interval target:(id)aTarget selector:(SEL)aSelector userInfo:(id)userInfo repeats:(BOOL)repeats{
|
||||||
YMWeakTimerTarget* timerTarget = [[YMWeakTimerTarget alloc] init];
|
MEWTimerTarget* timerTarget = [[MEWTimerTarget alloc] init];
|
||||||
timerTarget.target = aTarget;
|
timerTarget.target = aTarget;
|
||||||
timerTarget.selector = aSelector;
|
timerTarget.selector = aSelector;
|
||||||
timerTarget.timer = [NSTimer scheduledTimerWithTimeInterval:interval target:timerTarget selector:@selector(fire:) userInfo:userInfo repeats:repeats];
|
timerTarget.timer = [NSTimer scheduledTimerWithTimeInterval:interval target:timerTarget selector:@selector(fire:) userInfo:userInfo repeats:repeats];
|
||||||
return timerTarget.timer;
|
return timerTarget.timer;
|
||||||
}
|
}
|
||||||
|
|
||||||
+ (NSTimer *)scheduledTimerWithTimeInterval:(NSTimeInterval)interval block:(YMWeakTimerHandler)block userInfo:(id)userInfo repeats:(BOOL)repeats{
|
+ (NSTimer *)MEWScheduledTimerWithTimeInterval:(NSTimeInterval)interval block:(MEWTimerHandler)block userInfo:(id)userInfo repeats:(BOOL)repeats{
|
||||||
NSMutableArray *userInfoArray = [NSMutableArray arrayWithObject:[block copy]];
|
NSMutableArray *userInfoArray = [NSMutableArray arrayWithObject:[block copy]];
|
||||||
if (userInfo != nil) {
|
if (userInfo != nil) {
|
||||||
[userInfoArray addObject:userInfo];
|
[userInfoArray addObject:userInfo];
|
||||||
}
|
}
|
||||||
return [self scheduledTimerWithTimeInterval:interval target:self selector:@selector(timerBlockInvoke:) userInfo:[userInfoArray copy] repeats:repeats];
|
return [self MEWScheduledTimerWithTimeInterval:interval target:self selector:@selector(MEWSTimerBlockInvoke:) userInfo:[userInfoArray copy] repeats:repeats];
|
||||||
}
|
}
|
||||||
|
|
||||||
+ (void)timerBlockInvoke:(NSArray*)userInfo {
|
+ (void)MEWSTimerBlockInvoke:(NSArray*)userInfo {
|
||||||
YMWeakTimerHandler block = userInfo[0];
|
MEWTimerHandler block = userInfo[0];
|
||||||
id info = nil;
|
id info = nil;
|
||||||
if (userInfo.count == 2) {
|
if (userInfo.count == 2) {
|
||||||
info = userInfo[1];
|
info = userInfo[1];
|
@@ -1,24 +0,0 @@
|
|||||||
//
|
|
||||||
// YMWeakTimer.h
|
|
||||||
// mew-ios
|
|
||||||
//
|
|
||||||
// Created by 触海 on 2023/11/8.
|
|
||||||
//
|
|
||||||
|
|
||||||
#import <Foundation/Foundation.h>
|
|
||||||
|
|
||||||
NS_ASSUME_NONNULL_BEGIN
|
|
||||||
typedef void(^YMWeakTimerHandler) (id userInfo);
|
|
||||||
|
|
||||||
@interface YMWeakTimerTarget : NSObject
|
|
||||||
|
|
||||||
@end
|
|
||||||
|
|
||||||
@interface YMWeakTimer : NSObject
|
|
||||||
+ (NSTimer *)scheduledTimerWithTimeInterval:(NSTimeInterval)interval block:(YMWeakTimerHandler)block userInfo:(id)userInfo repeats:(BOOL)repeats;
|
|
||||||
|
|
||||||
+ (NSTimer *)scheduledTimerWithTimeInterval:(NSTimeInterval)interval target:(id)aTarget selector:(SEL)aSelector userInfo:(id)userInfo repeats:(BOOL)repeats;
|
|
||||||
|
|
||||||
@end
|
|
||||||
|
|
||||||
NS_ASSUME_NONNULL_END
|
|
@@ -1,88 +0,0 @@
|
|||||||
//
|
|
||||||
// YYUtility+Carrier.m
|
|
||||||
// YYFoundation
|
|
||||||
//
|
|
||||||
// Created by wuwei on 14-5-30.
|
|
||||||
// Copyright (c) 2014年 YY Inc. All rights reserved.
|
|
||||||
//
|
|
||||||
|
|
||||||
#import "YYUtility.h"
|
|
||||||
#import <CoreTelephony/CTCarrier.h>
|
|
||||||
#import <CoreTelephony/CTTelephonyNetworkInfo.h>
|
|
||||||
#import "CarrierIdentifier.h"
|
|
||||||
|
|
||||||
/*
|
|
||||||
* The most update-to-date list of MNC&MCC is fetched
|
|
||||||
* from the website below: http://www.mcc-mnc.com
|
|
||||||
*/
|
|
||||||
// MCCs
|
|
||||||
static NSString * const kMobileCountryCode_China = @"460"; // 中国
|
|
||||||
|
|
||||||
// MNCs
|
|
||||||
static NSSet * kMobileNetworkCodes_ChinaMobile; // 移动
|
|
||||||
static NSSet * kMobileNetworkCodes_ChinaUnicom; // 联通
|
|
||||||
static NSSet * kMobileNetworkCodes_ChinaTelecom; // 电信
|
|
||||||
|
|
||||||
@implementation YYUtility (Carrier)
|
|
||||||
|
|
||||||
+ (void)load
|
|
||||||
{
|
|
||||||
if (self == [YYUtility self]) {
|
|
||||||
kMobileNetworkCodes_ChinaMobile = [NSSet setWithObjects:@"00", @"02", @"07", nil]; // 中国移动
|
|
||||||
kMobileNetworkCodes_ChinaUnicom = [NSSet setWithObjects:@"01", @"06", nil]; // 中国联通
|
|
||||||
kMobileNetworkCodes_ChinaTelecom = [NSSet setWithObjects:@"03", @"05", nil]; // 中国电信
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
+ (NSString *)carrierName
|
|
||||||
{
|
|
||||||
return [self carrier].carrierName;
|
|
||||||
}
|
|
||||||
|
|
||||||
+ (NSInteger)carrierIdentifier
|
|
||||||
{
|
|
||||||
return [self identifierOfCarrier:[self carrier]];
|
|
||||||
}
|
|
||||||
|
|
||||||
+ (CTCarrier *)carrier
|
|
||||||
{
|
|
||||||
return [[CTTelephonyNetworkInfo alloc] init].subscriberCellularProvider;
|
|
||||||
}
|
|
||||||
|
|
||||||
+ (NSInteger)identifierOfCarrier:(CTCarrier *)carrier
|
|
||||||
{
|
|
||||||
CarrierIdentifier identifier = CarrierIdentifier_Unknown;
|
|
||||||
do {
|
|
||||||
if (carrier.mobileCountryCode == nil || carrier.mobileNetworkCode == nil)
|
|
||||||
{
|
|
||||||
identifier = CarrierIdentifier_Unknown;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
if ([carrier.mobileCountryCode isEqualToString:kMobileCountryCode_China])
|
|
||||||
{
|
|
||||||
if ([kMobileNetworkCodes_ChinaMobile containsObject:carrier.mobileNetworkCode])
|
|
||||||
{
|
|
||||||
identifier = CarrierIdentifier_ChinaMobile;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
else if ([kMobileNetworkCodes_ChinaUnicom containsObject:carrier.mobileNetworkCode])
|
|
||||||
{
|
|
||||||
identifier = CarrierIdentifier_ChinaUnicom;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
else if ([kMobileNetworkCodes_ChinaTelecom containsObject:carrier.mobileNetworkCode])
|
|
||||||
{
|
|
||||||
identifier = CarrierIdentifier_ChinaTelecom;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
identifier = CarrierIdentifier_Otherwise;
|
|
||||||
|
|
||||||
} while (0);
|
|
||||||
|
|
||||||
return identifier;
|
|
||||||
}
|
|
||||||
|
|
||||||
@end
|
|
@@ -22,7 +22,7 @@
|
|||||||
#import <net/if_dl.h>
|
#import <net/if_dl.h>
|
||||||
#import <sys/socket.h>
|
#import <sys/socket.h>
|
||||||
#import "SSKeychain.h"
|
#import "SSKeychain.h"
|
||||||
#import "GCDHelper.h"
|
#import "MEWGCDHelper.h"
|
||||||
|
|
||||||
|
|
||||||
#if !defined(IFT_ETHER)
|
#if !defined(IFT_ETHER)
|
||||||
@@ -135,7 +135,7 @@
|
|||||||
{
|
{
|
||||||
[AVCaptureDevice requestAccessForMediaType:AVMediaTypeVideo completionHandler:^(BOOL granted) {
|
[AVCaptureDevice requestAccessForMediaType:AVMediaTypeVideo completionHandler:^(BOOL granted) {
|
||||||
|
|
||||||
dispatch_main_sync_safe(^{
|
mew_dispatch_main_sync_safe(^{
|
||||||
if (granted)
|
if (granted)
|
||||||
{
|
{
|
||||||
available();
|
available();
|
||||||
|
@@ -6,7 +6,7 @@
|
|||||||
//
|
//
|
||||||
|
|
||||||
#import "BaseNavigationController.h"
|
#import "BaseNavigationController.h"
|
||||||
#import "ThemeColor.h"
|
#import "MEWThemeColor.h"
|
||||||
|
|
||||||
@interface BaseNavigationController ()<UIGestureRecognizerDelegate>
|
@interface BaseNavigationController ()<UIGestureRecognizerDelegate>
|
||||||
|
|
||||||
@@ -27,7 +27,7 @@
|
|||||||
if (self.childViewControllers.count > 0) {
|
if (self.childViewControllers.count > 0) {
|
||||||
viewController.hidesBottomBarWhenPushed = YES;
|
viewController.hidesBottomBarWhenPushed = YES;
|
||||||
UIBarButtonItem *leftBarButtonItem = [[UIBarButtonItem alloc] initWithImage:[UIImage imageNamed:@"mew_common_nav_back"] style:UIBarButtonItemStyleDone target:self action:@selector(backClick)];
|
UIBarButtonItem *leftBarButtonItem = [[UIBarButtonItem alloc] initWithImage:[UIImage imageNamed:@"mew_common_nav_back"] style:UIBarButtonItemStyleDone target:self action:@selector(backClick)];
|
||||||
leftBarButtonItem.tintColor = [ThemeColor mainTextColor];
|
leftBarButtonItem.tintColor = [MEWThemeColor mewMainTextColor];
|
||||||
viewController.navigationItem.leftBarButtonItem = leftBarButtonItem;
|
viewController.navigationItem.leftBarButtonItem = leftBarButtonItem;
|
||||||
}
|
}
|
||||||
viewController.navigationItem.backBarButtonItem = [[UIBarButtonItem alloc] initWithTitle:@"" style:UIBarButtonItemStylePlain target:nil action:nil];
|
viewController.navigationItem.backBarButtonItem = [[UIBarButtonItem alloc] initWithTitle:@"" style:UIBarButtonItemStylePlain target:nil action:nil];
|
||||||
@@ -41,21 +41,21 @@
|
|||||||
|
|
||||||
- (void)themeConfig {
|
- (void)themeConfig {
|
||||||
self.navigationBar.shadowImage = [[UIImage alloc] init];
|
self.navigationBar.shadowImage = [[UIImage alloc] init];
|
||||||
self.navigationBar.barTintColor = [ThemeColor appBackgroundColor];
|
self.navigationBar.barTintColor = [MEWThemeColor mewAppBackgroundColor];
|
||||||
self.navigationBar.tintColor = [UIColor whiteColor];
|
self.navigationBar.tintColor = [UIColor whiteColor];
|
||||||
self.navigationBar.translucent = NO;
|
self.navigationBar.translucent = NO;
|
||||||
self.view.backgroundColor = [ThemeColor appBackgroundColor];
|
self.view.backgroundColor = [MEWThemeColor mewAppBackgroundColor];
|
||||||
[self.navigationBar setTitleTextAttributes:@{
|
[self.navigationBar setTitleTextAttributes:@{
|
||||||
NSFontAttributeName:[UIFont systemFontOfSize:18 weight:UIFontWeightMedium],
|
NSFontAttributeName:[UIFont systemFontOfSize:18 weight:UIFontWeightMedium],
|
||||||
NSForegroundColorAttributeName:[ThemeColor mainTextColor]
|
NSForegroundColorAttributeName:[MEWThemeColor mewMainTextColor]
|
||||||
}];
|
}];
|
||||||
|
|
||||||
/// scrollEdgeAppearance 属性iOS15 强制适用于 所有导航器 如果为nil 则使用 standardAppearance属性中的设置,并修改为使用透明背景 @fengshuo
|
/// scrollEdgeAppearance 属性iOS15 强制适用于 所有导航器 如果为nil 则使用 standardAppearance属性中的设置,并修改为使用透明背景 @fengshuo
|
||||||
if (@available(iOS 15.0, *)) {
|
if (@available(iOS 15.0, *)) {
|
||||||
UINavigationBarAppearance *appearance = [UINavigationBarAppearance new];
|
UINavigationBarAppearance *appearance = [UINavigationBarAppearance new];
|
||||||
appearance.titleTextAttributes = @{NSFontAttributeName:[UIFont systemFontOfSize:18 weight:UIFontWeightMedium],
|
appearance.titleTextAttributes = @{NSFontAttributeName:[UIFont systemFontOfSize:18 weight:UIFontWeightMedium],
|
||||||
NSForegroundColorAttributeName:[ThemeColor mainTextColor]};
|
NSForegroundColorAttributeName:[MEWThemeColor mewMainTextColor]};
|
||||||
appearance.backgroundColor = [ThemeColor appCellBackgroundColor];
|
appearance.backgroundColor = [MEWThemeColor mewAppCellBackgroundColor];
|
||||||
self.navigationBar.standardAppearance = appearance;
|
self.navigationBar.standardAppearance = appearance;
|
||||||
self.navigationBar.scrollEdgeAppearance = appearance;
|
self.navigationBar.scrollEdgeAppearance = appearance;
|
||||||
}
|
}
|
||||||
|
@@ -7,7 +7,7 @@
|
|||||||
|
|
||||||
#import "BaseViewController.h"
|
#import "BaseViewController.h"
|
||||||
///Tool
|
///Tool
|
||||||
#import "YMHUDTool.h"
|
#import "MewHUDTool.h"
|
||||||
|
|
||||||
@interface BaseViewController ()
|
@interface BaseViewController ()
|
||||||
|
|
||||||
@@ -73,19 +73,19 @@
|
|||||||
|
|
||||||
#pragma mark - BaseViewControllerProtocol
|
#pragma mark - BaseViewControllerProtocol
|
||||||
- (void)showSuccessToast:(NSString *)msg {
|
- (void)showSuccessToast:(NSString *)msg {
|
||||||
[YMHUDTool showSuccessWithMessage:msg];
|
[MewHUDTool showSuccessWithMessage:msg];
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void)showErrorToast:(NSString *)msg {
|
- (void)showErrorToast:(NSString *)msg {
|
||||||
[YMHUDTool showErrorWithMessage:msg];
|
[MewHUDTool showErrorWithMessage:msg];
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void)showLoading {
|
- (void)showLoading {
|
||||||
[YMHUDTool showLoading];
|
[MewHUDTool showLoading];
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void)hideHUD {
|
- (void)hideHUD {
|
||||||
[YMHUDTool hideHUD];
|
[MewHUDTool hideHUD];
|
||||||
}
|
}
|
||||||
|
|
||||||
@end
|
@end
|
||||||
|
@@ -9,7 +9,7 @@
|
|||||||
///Third
|
///Third
|
||||||
#import <Masonry/Masonry.h>
|
#import <Masonry/Masonry.h>
|
||||||
///Tool
|
///Tool
|
||||||
#import "ThemeColor.h"
|
#import "MEWThemeColor.h"
|
||||||
#import "UIImageConstant.h"
|
#import "UIImageConstant.h"
|
||||||
|
|
||||||
@interface YMEmptyTableViewCell()
|
@interface YMEmptyTableViewCell()
|
||||||
@@ -75,7 +75,7 @@
|
|||||||
_titleLabel.numberOfLines = 2;
|
_titleLabel.numberOfLines = 2;
|
||||||
_titleLabel.font = [UIFont systemFontOfSize:16];
|
_titleLabel.font = [UIFont systemFontOfSize:16];
|
||||||
_titleLabel.textAlignment = NSTextAlignmentCenter;
|
_titleLabel.textAlignment = NSTextAlignmentCenter;
|
||||||
_titleLabel.textColor = [ThemeColor secondTextColor];
|
_titleLabel.textColor = [MEWThemeColor mewSecondTextColor];
|
||||||
}
|
}
|
||||||
return _titleLabel;
|
return _titleLabel;
|
||||||
}
|
}
|
||||||
|
@@ -6,7 +6,7 @@
|
|||||||
//
|
//
|
||||||
|
|
||||||
#import "TTActionSheetConfig.h"
|
#import "TTActionSheetConfig.h"
|
||||||
#import "ThemeColor.h"
|
#import "MEWThemeColor.h"
|
||||||
|
|
||||||
@implementation TTActionSheetConfig
|
@implementation TTActionSheetConfig
|
||||||
|
|
||||||
@@ -24,7 +24,7 @@
|
|||||||
|
|
||||||
+ (TTActionSheetConfig *)normalTitle:(NSString *)title selectColorType:(TTItemSelectType)type clickAction:(TTActionSheetClickAction)clickAction {
|
+ (TTActionSheetConfig *)normalTitle:(NSString *)title selectColorType:(TTItemSelectType)type clickAction:(TTActionSheetClickAction)clickAction {
|
||||||
|
|
||||||
UIColor *color = type == TTItemSelectHighLight ? [ThemeColor alertTitleColor] : [ThemeColor alertTitleColor];
|
UIColor *color = type == TTItemSelectHighLight ? [MEWThemeColor mewAlertTitleColor] : [MEWThemeColor mewAlertTitleColor];
|
||||||
|
|
||||||
TTActionSheetConfig *config = [self actionWithTitle:title color:color handler:clickAction];
|
TTActionSheetConfig *config = [self actionWithTitle:title color:color handler:clickAction];
|
||||||
config.type = type;
|
config.type = type;
|
||||||
|
@@ -8,13 +8,13 @@
|
|||||||
|
|
||||||
#import "TTAlertConfig.h"
|
#import "TTAlertConfig.h"
|
||||||
#import "UIImage+Utils.h"
|
#import "UIImage+Utils.h"
|
||||||
#import "ThemeColor.h"
|
#import "MEWThemeColor.h"
|
||||||
|
|
||||||
static CGFloat kAlertTitleFont = 18.f;
|
static CGFloat kAlertTitleFont = 18.f;
|
||||||
static CGFloat kAlertButtonFont = 15.f;
|
static CGFloat kAlertButtonFont = 15.f;
|
||||||
static CGFloat kAlertMessageFont = 15.f;
|
static CGFloat kAlertMessageFont = 15.f;
|
||||||
static CGFloat kAlertCornerRadius = 12.f;
|
static CGFloat kAlertCornerRadius = 12.f;
|
||||||
static CGFloat kAlertBackgroundColorAlpha = 0.3;
|
static CGFloat kmewAlertBackgroundColorAlpha = 0.3;
|
||||||
static CGFloat kAlertMessageFontLineSpace = -1;
|
static CGFloat kAlertMessageFontLineSpace = -1;
|
||||||
static CGFloat kAlertButtonCornerRadius = 8.f;
|
static CGFloat kAlertButtonCornerRadius = 8.f;
|
||||||
|
|
||||||
@@ -24,7 +24,7 @@ static CGFloat kAlertButtonCornerRadius = 8.f;
|
|||||||
self = [super init];
|
self = [super init];
|
||||||
if (self) {
|
if (self) {
|
||||||
|
|
||||||
_backgroundColor = [ThemeColor alertBackgroundColor];
|
_backgroundColor = [MEWThemeColor mewAlertBackgroundColor];
|
||||||
|
|
||||||
//背景颜色
|
//背景颜色
|
||||||
kAlertTitleFont = 16.f;
|
kAlertTitleFont = 16.f;
|
||||||
@@ -36,12 +36,12 @@ static CGFloat kAlertButtonCornerRadius = 8.f;
|
|||||||
// title
|
// title
|
||||||
_title = @"";// 标题
|
_title = @"";// 标题
|
||||||
_titleFont = [UIFont fontWithName:@"PingFangSC-Medium" size:kAlertTitleFont];// 字体
|
_titleFont = [UIFont fontWithName:@"PingFangSC-Medium" size:kAlertTitleFont];// 字体
|
||||||
_titleColor = [ThemeColor alertTitleColor];// 颜色
|
_titleColor = [MEWThemeColor mewAlertTitleColor];// 颜色
|
||||||
|
|
||||||
// message
|
// message
|
||||||
_message = @"";
|
_message = @"";
|
||||||
_messageFont = [UIFont systemFontOfSize:kAlertMessageFont];// 内容
|
_messageFont = [UIFont systemFontOfSize:kAlertMessageFont];// 内容
|
||||||
_messageColor = [ThemeColor alertMessageColor];// 颜色
|
_messageColor = [MEWThemeColor mewAlertMessageColor];// 颜色
|
||||||
_messageLineSpacing = kAlertMessageFontLineSpace;// 字体行间距
|
_messageLineSpacing = kAlertMessageFontLineSpace;// 字体行间距
|
||||||
_messageAttributedConfig = @[];// 自定义富文本样式
|
_messageAttributedConfig = @[];// 自定义富文本样式
|
||||||
|
|
||||||
@@ -49,23 +49,23 @@ static CGFloat kAlertButtonCornerRadius = 8.f;
|
|||||||
_cancelButtonConfig = [[TTAlertButtonConfig alloc] init];
|
_cancelButtonConfig = [[TTAlertButtonConfig alloc] init];
|
||||||
_cancelButtonConfig.title = @"取消";// 取消按钮
|
_cancelButtonConfig.title = @"取消";// 取消按钮
|
||||||
_cancelButtonConfig.font = [UIFont systemFontOfSize:kAlertButtonFont];// 按钮字体
|
_cancelButtonConfig.font = [UIFont systemFontOfSize:kAlertButtonFont];// 按钮字体
|
||||||
_cancelButtonConfig.titleColor = [ThemeColor cancelButtonTextColor];// 字体颜色
|
_cancelButtonConfig.titleColor = [MEWThemeColor mewCancelButtonTextColor];// 字体颜色
|
||||||
_cancelButtonConfig.backgroundImage = [UIImage gradientColorImageFromColors:@[[ThemeColor cancelButtonGradientStartColor], [ThemeColor cancelButtonGradientEndColor]] gradientType:GradientTypeLeftToRight imgSize:CGSizeMake(10, 10)];
|
_cancelButtonConfig.backgroundImage = [UIImage gradientColorImageFromColors:@[[MEWThemeColor mewCancelButtonGradientStartColor], [MEWThemeColor mewCancelButtonGradientEndColor]] gradientType:GradientTypeLeftToRight imgSize:CGSizeMake(10, 10)];
|
||||||
_cancelButtonConfig.cornerRadius = kAlertButtonCornerRadius;// 按钮背景图
|
_cancelButtonConfig.cornerRadius = kAlertButtonCornerRadius;// 按钮背景图
|
||||||
|
|
||||||
// confirm button
|
// confirm button
|
||||||
_confirmButtonConfig = [[TTAlertButtonConfig alloc] init];
|
_confirmButtonConfig = [[TTAlertButtonConfig alloc] init];
|
||||||
_confirmButtonConfig.title = @"确定";
|
_confirmButtonConfig.title = @"确定";
|
||||||
_confirmButtonConfig.font = [UIFont systemFontOfSize:kAlertButtonFont];
|
_confirmButtonConfig.font = [UIFont systemFontOfSize:kAlertButtonFont];
|
||||||
_confirmButtonConfig.titleColor = [ThemeColor confirmButtonTextColor];
|
_confirmButtonConfig.titleColor = [MEWThemeColor mewConfirmButtonTextColor];
|
||||||
_confirmButtonConfig.backgroundImage = [UIImage gradientColorImageFromColors:@[[ThemeColor confirmButtonGradientStartColor], [ThemeColor confirmButtonGradientEndColor]] gradientType:GradientTypeLeftToRight imgSize:CGSizeMake(10, 10)];
|
_confirmButtonConfig.backgroundImage = [UIImage gradientColorImageFromColors:@[[MEWThemeColor mewConfirmButtonGradientStartColor], [MEWThemeColor mewConfirmButtonGradientEndColor]] gradientType:GradientTypeLeftToRight imgSize:CGSizeMake(10, 10)];
|
||||||
_confirmButtonConfig.cornerRadius = kAlertButtonCornerRadius;
|
_confirmButtonConfig.cornerRadius = kAlertButtonCornerRadius;
|
||||||
|
|
||||||
_cornerRadius = kAlertCornerRadius;// 默认圆角
|
_cornerRadius = kAlertCornerRadius;// 默认圆角
|
||||||
_shouldDismissOnBackgroundTouch = YES;// 点击蒙层是否消失
|
_shouldDismissOnBackgroundTouch = YES;// 点击蒙层是否消失
|
||||||
|
|
||||||
// mask default 0.3 black
|
// mask default 0.3 black
|
||||||
_maskBackgroundAlpha = kAlertBackgroundColorAlpha; // alert 背景色
|
_maskBackgroundAlpha = kmewAlertBackgroundColorAlpha; // alert 背景色
|
||||||
_disableAutoDismissWhenClickButton = NO;
|
_disableAutoDismissWhenClickButton = NO;
|
||||||
}
|
}
|
||||||
return self;
|
return self;
|
||||||
|
@@ -8,7 +8,7 @@
|
|||||||
|
|
||||||
#import "TTActionSheetView.h"
|
#import "TTActionSheetView.h"
|
||||||
#import "TTActionSheetConfig.h"
|
#import "TTActionSheetConfig.h"
|
||||||
#import "ThemeColor.h"
|
#import "MEWThemeColor.h"
|
||||||
#import <Masonry/Masonry.h>
|
#import <Masonry/Masonry.h>
|
||||||
|
|
||||||
static CGFloat const kSheetViewCellHeight = 51.f;
|
static CGFloat const kSheetViewCellHeight = 51.f;
|
||||||
@@ -104,7 +104,7 @@ static NSString *const kSheetViewCellConst = @"kSheetViewCellConst";
|
|||||||
_tableView = [[UITableView alloc] initWithFrame:CGRectZero style:UITableViewStylePlain];
|
_tableView = [[UITableView alloc] initWithFrame:CGRectZero style:UITableViewStylePlain];
|
||||||
_tableView.delegate = self;
|
_tableView.delegate = self;
|
||||||
_tableView.dataSource = self;
|
_tableView.dataSource = self;
|
||||||
_tableView.separatorColor = [ThemeColor actionSeparatorColor];
|
_tableView.separatorColor = [MEWThemeColor mewActionSeparatorColor];
|
||||||
_tableView.separatorStyle = UITableViewCellSeparatorStyleSingleLine;
|
_tableView.separatorStyle = UITableViewCellSeparatorStyleSingleLine;
|
||||||
_tableView.rowHeight = kSheetViewCellHeight;
|
_tableView.rowHeight = kSheetViewCellHeight;
|
||||||
_tableView.tableFooterView = [[UIView alloc] init];
|
_tableView.tableFooterView = [[UIView alloc] init];
|
||||||
@@ -122,7 +122,7 @@ static NSString *const kSheetViewCellConst = @"kSheetViewCellConst";
|
|||||||
_cancelButton = [UIButton buttonWithType:UIButtonTypeCustom];
|
_cancelButton = [UIButton buttonWithType:UIButtonTypeCustom];
|
||||||
[_cancelButton setTitle:@"取消" forState:UIControlStateNormal];
|
[_cancelButton setTitle:@"取消" forState:UIControlStateNormal];
|
||||||
[_cancelButton setBackgroundColor:UIColor.whiteColor];
|
[_cancelButton setBackgroundColor:UIColor.whiteColor];
|
||||||
[_cancelButton setTitleColor:[ThemeColor alertMessageColor] forState:UIControlStateNormal];
|
[_cancelButton setTitleColor:[MEWThemeColor mewAlertMessageColor] forState:UIControlStateNormal];
|
||||||
[_cancelButton.titleLabel setFont:[UIFont systemFontOfSize:16]];
|
[_cancelButton.titleLabel setFont:[UIFont systemFontOfSize:16]];
|
||||||
_cancelButton.layer.cornerRadius = kSheetViewCornerRadius;
|
_cancelButton.layer.cornerRadius = kSheetViewCornerRadius;
|
||||||
_cancelButton.layer.masksToBounds = YES;
|
_cancelButton.layer.masksToBounds = YES;
|
||||||
|
@@ -8,7 +8,7 @@
|
|||||||
|
|
||||||
#import "TTAlertView.h"
|
#import "TTAlertView.h"
|
||||||
#import "TTAlertConfig.h"
|
#import "TTAlertConfig.h"
|
||||||
#import "ThemeColor.h"
|
#import "MEWThemeColor.h"
|
||||||
#import <Masonry/Masonry.h>
|
#import <Masonry/Masonry.h>
|
||||||
|
|
||||||
static CGFloat const kMargin = 25.f;
|
static CGFloat const kMargin = 25.f;
|
||||||
@@ -180,9 +180,9 @@ static CGFloat const kBtnHeight = 38.f;
|
|||||||
_messageLabel.text = config.message;
|
_messageLabel.text = config.message;
|
||||||
}
|
}
|
||||||
|
|
||||||
_cancelButton.layer.borderColor = [ThemeColor dividerColor].CGColor;
|
_cancelButton.layer.borderColor = [MEWThemeColor mewDividerColor].CGColor;
|
||||||
_cancelButton.layer.borderWidth = 2.f;
|
_cancelButton.layer.borderWidth = 2.f;
|
||||||
_confirmButton.layer.borderColor = [ThemeColor dividerColor].CGColor;
|
_confirmButton.layer.borderColor = [MEWThemeColor mewDividerColor].CGColor;
|
||||||
_confirmButton.layer.borderWidth = 2.f;
|
_confirmButton.layer.borderWidth = 2.f;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -190,15 +190,15 @@ static CGFloat const kBtnHeight = 38.f;
|
|||||||
_isConfigBoard = isConfigBoard;
|
_isConfigBoard = isConfigBoard;
|
||||||
if (isConfigBoard) {
|
if (isConfigBoard) {
|
||||||
//需要边框
|
//需要边框
|
||||||
_cancelButton.layer.borderColor = [ThemeColor dividerColor].CGColor;
|
_cancelButton.layer.borderColor = [MEWThemeColor mewDividerColor].CGColor;
|
||||||
_cancelButton.layer.borderWidth = 2.f;
|
_cancelButton.layer.borderWidth = 2.f;
|
||||||
_confirmButton.layer.borderColor = [ThemeColor dividerColor].CGColor;
|
_confirmButton.layer.borderColor = [MEWThemeColor mewDividerColor].CGColor;
|
||||||
_confirmButton.layer.borderWidth = 2.f;
|
_confirmButton.layer.borderWidth = 2.f;
|
||||||
}else {
|
}else {
|
||||||
//不需要边框
|
//不需要边框
|
||||||
_cancelButton.layer.borderColor = [ThemeColor dividerColor].CGColor;
|
_cancelButton.layer.borderColor = [MEWThemeColor mewDividerColor].CGColor;
|
||||||
_cancelButton.layer.borderWidth = 0;
|
_cancelButton.layer.borderWidth = 0;
|
||||||
_confirmButton.layer.borderColor = [ThemeColor dividerColor].CGColor;
|
_confirmButton.layer.borderColor = [MEWThemeColor mewDividerColor].CGColor;
|
||||||
_confirmButton.layer.borderWidth = 0;
|
_confirmButton.layer.borderWidth = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -25,7 +25,7 @@ typedef NS_ENUM(NSUInteger, GetSmsType) {
|
|||||||
GetSmsType_Login = 2,///登录
|
GetSmsType_Login = 2,///登录
|
||||||
GetSmsType_Reset_Password = 3,///重设密码
|
GetSmsType_Reset_Password = 3,///重设密码
|
||||||
GetSmsType_Bind_Phone = 4, ///绑定手机
|
GetSmsType_Bind_Phone = 4, ///绑定手机
|
||||||
GetSmsType_Bind_ZF = 5,///绑定支付宝
|
GetSmsType_Bind_ZF = 5,
|
||||||
GetSmsType_Reset_ZF = 6,///重设支付密码
|
GetSmsType_Reset_ZF = 6,///重设支付密码
|
||||||
GetSmsType_Unbind_Phone = 7, ///解绑手机
|
GetSmsType_Unbind_Phone = 7, ///解绑手机
|
||||||
};
|
};
|
||||||
|
@@ -7,7 +7,7 @@
|
|||||||
|
|
||||||
#import "ClientConfig.h"
|
#import "ClientConfig.h"
|
||||||
#import "Api+Main.h"
|
#import "Api+Main.h"
|
||||||
#import "YMWeakTimer.h"
|
#import "MEWTimer.h"
|
||||||
|
|
||||||
@interface ClientConfig()
|
@interface ClientConfig()
|
||||||
///重试的次数 10次 如果你还是失败的话 那就算了 没办法了
|
///重试的次数 10次 如果你还是失败的话 那就算了 没办法了
|
||||||
@@ -35,7 +35,7 @@
|
|||||||
self.retryCount = 0;
|
self.retryCount = 0;
|
||||||
NSDictionary *initData = data.data;
|
NSDictionary *initData = data.data;
|
||||||
self.iosPhoneBind = [initData[@"iosPhoneBind"] boolValue];
|
self.iosPhoneBind = [initData[@"iosPhoneBind"] boolValue];
|
||||||
ClientDataModel *model = [ClientDataModel modelWithDictionary:data.data];
|
ClientDataModel *model = [ClientDataModel mewModelWithDictionary:data.data];
|
||||||
self.configInfo = model;
|
self.configInfo = model;
|
||||||
// 表情
|
// 表情
|
||||||
|
|
||||||
@@ -68,7 +68,7 @@
|
|||||||
- (void)addHeartBratTimer {
|
- (void)addHeartBratTimer {
|
||||||
if (_timer == nil) return;
|
if (_timer == nil) return;
|
||||||
|
|
||||||
_timer = [YMWeakTimer scheduledTimerWithTimeInterval:30 block:^(id _Nonnull userInfo) {
|
_timer = [MEWTimer MEWScheduledTimerWithTimeInterval:30 block:^(id _Nonnull userInfo) {
|
||||||
|
|
||||||
[Api requestClientHeartBrat:^(BaseModel * _Nullable data, NSInteger code, NSString * _Nullable msg) {
|
[Api requestClientHeartBrat:^(BaseModel * _Nullable data, NSInteger code, NSString * _Nullable msg) {
|
||||||
|
|
||||||
|
@@ -8,7 +8,7 @@
|
|||||||
#import "MewHomePresenter.h"
|
#import "MewHomePresenter.h"
|
||||||
#import "Api+MewHome.h"
|
#import "Api+MewHome.h"
|
||||||
#import "Api+Mine.h"
|
#import "Api+Mine.h"
|
||||||
#import "UploadFile.h"
|
#import "MEWUploadFile.h"
|
||||||
#import "UserInfoModel.h"
|
#import "UserInfoModel.h"
|
||||||
#import "FansInfoModel.h"
|
#import "FansInfoModel.h"
|
||||||
/// Protocol
|
/// Protocol
|
||||||
@@ -22,8 +22,8 @@
|
|||||||
/// Mew 获取好友列表
|
/// Mew 获取好友列表
|
||||||
- (void)getMewHomeFriendListWithGender:(NSString *)gender {
|
- (void)getMewHomeFriendListWithGender:(NSString *)gender {
|
||||||
[Api getMewHomeFriendListCompleted:[self createHttpCompletion:^(BaseModel * _Nonnull data) {
|
[Api getMewHomeFriendListCompleted:[self createHttpCompletion:^(BaseModel * _Nonnull data) {
|
||||||
NSArray *array = [UserInfoModel modelsWithArray:data.data[@"randomList"]];
|
NSArray *array = [UserInfoModel mewModelsWithArray:data.data[@"randomList"]];
|
||||||
UserInfoModel *mineModel = [UserInfoModel modelWithDictionary:data.data[@"me"]];
|
UserInfoModel *mineModel = [UserInfoModel mewModelWithDictionary:data.data[@"me"]];
|
||||||
[[self getView] getMewHomeFriendListSuccesss:array selfMine:mineModel];
|
[[self getView] getMewHomeFriendListSuccesss:array selfMine:mineModel];
|
||||||
} fail:^(NSInteger code, NSString * _Nullable msg) {
|
} fail:^(NSInteger code, NSString * _Nullable msg) {
|
||||||
|
|
||||||
@@ -33,7 +33,7 @@
|
|||||||
/// 获取新朋友
|
/// 获取新朋友
|
||||||
- (void)getNewFriendListWithGender:(NSString *)gender {
|
- (void)getNewFriendListWithGender:(NSString *)gender {
|
||||||
[Api getNewFriendListComplection:[self createHttpCompletion:^(BaseModel * _Nonnull data) {
|
[Api getNewFriendListComplection:[self createHttpCompletion:^(BaseModel * _Nonnull data) {
|
||||||
NSArray *array = [UserInfoModel modelsWithArray:data];
|
NSArray *array = [UserInfoModel mewModelsWithArray:data];
|
||||||
[[self getView] getNewFriendListSuccess:array];
|
[[self getView] getNewFriendListSuccess:array];
|
||||||
} fail:^(NSInteger code, NSString * _Nullable msg) {
|
} fail:^(NSInteger code, NSString * _Nullable msg) {
|
||||||
[[self getView] getNewFriendListFail];
|
[[self getView] getNewFriendListFail];
|
||||||
@@ -47,10 +47,10 @@
|
|||||||
[Api qiniuUpLoadImage:[self createHttpCompletion:^(BaseModel * _Nonnull data) {
|
[Api qiniuUpLoadImage:[self createHttpCompletion:^(BaseModel * _Nonnull data) {
|
||||||
NSString *key = data.data[@"key"];
|
NSString *key = data.data[@"key"];
|
||||||
NSString *token = data.data[@"token"];
|
NSString *token = data.data[@"token"];
|
||||||
[UploadFile uploadFile:filePath named:key token:token success:^(NSString * _Nonnull key, NSDictionary * _Nonnull resp) {
|
[MEWUploadFile mewUploadFile:filePath named:key token:token success:^(NSString * _Nonnull key, NSDictionary * _Nonnull res) {
|
||||||
NSString *url = resp[@"path"];
|
NSString *url = res[@"path"];
|
||||||
[[self getView] uploadVoiceFileToThirdSuccess:url];
|
[[self getView] uploadVoiceFileToThirdSuccess:url];
|
||||||
} failure:^(NSNumber * _Nonnull resCode, NSString * _Nonnull message) {
|
} failure:^(NSNumber * _Nonnull code, NSString * _Nonnull message) {
|
||||||
[[self getView] uploadVoiceFileFail:message];
|
[[self getView] uploadVoiceFileFail:message];
|
||||||
}];
|
}];
|
||||||
|
|
||||||
@@ -100,7 +100,7 @@
|
|||||||
/// 获取用户信息
|
/// 获取用户信息
|
||||||
- (void)getUserInfoWithUid:(NSString *)uid {
|
- (void)getUserInfoWithUid:(NSString *)uid {
|
||||||
[Api getUserInfo:[self createHttpCompletion:^(BaseModel * _Nonnull data) {
|
[Api getUserInfo:[self createHttpCompletion:^(BaseModel * _Nonnull data) {
|
||||||
UserInfoModel *userInfo = [UserInfoModel modelWithDictionary:data.data];
|
UserInfoModel *userInfo = [UserInfoModel mewModelWithDictionary:data.data];
|
||||||
[[self getView] getUserInfoSuccess:userInfo];
|
[[self getView] getUserInfoSuccess:userInfo];
|
||||||
} fail:^(NSInteger code, NSString * _Nullable msg) {
|
} fail:^(NSInteger code, NSString * _Nullable msg) {
|
||||||
|
|
||||||
@@ -110,7 +110,7 @@
|
|||||||
/// 获取用户详细信息
|
/// 获取用户详细信息
|
||||||
- (void)getUserDetailInfoWithUid:(NSString *)uid {
|
- (void)getUserDetailInfoWithUid:(NSString *)uid {
|
||||||
[Api userDetailInfoCompletion:[self createHttpCompletion:^(BaseModel * _Nonnull data) {
|
[Api userDetailInfoCompletion:[self createHttpCompletion:^(BaseModel * _Nonnull data) {
|
||||||
UserInfoModel *infoModel = [UserInfoModel modelWithDictionary:data.data];
|
UserInfoModel *infoModel = [UserInfoModel mewModelWithDictionary:data.data];
|
||||||
[[self getView] getUserDetailInfoSuccess:infoModel];
|
[[self getView] getUserDetailInfoSuccess:infoModel];
|
||||||
|
|
||||||
}] uid:uid page:@"1" pageSize:@"20"];
|
}] uid:uid page:@"1" pageSize:@"20"];
|
||||||
@@ -124,7 +124,7 @@
|
|||||||
NSString * pageStr = [NSString stringWithFormat:@"%d", page];
|
NSString * pageStr = [NSString stringWithFormat:@"%d", page];
|
||||||
NSString * pageSizeStr = [NSString stringWithFormat:@"%d", pageSize];
|
NSString * pageSizeStr = [NSString stringWithFormat:@"%d", pageSize];
|
||||||
[Api getattentionListCompletion:[self createHttpCompletion:^(BaseModel * _Nonnull data) {
|
[Api getattentionListCompletion:[self createHttpCompletion:^(BaseModel * _Nonnull data) {
|
||||||
NSArray * array = [UserInfoModel modelsWithArray:data.data];
|
NSArray * array = [UserInfoModel mewModelsWithArray:data.data];
|
||||||
[[self getView] getUserAttentionListSuccess:array state:state];
|
[[self getView] getUserAttentionListSuccess:array state:state];
|
||||||
}fail:^(NSInteger code, NSString * _Nullable msg) {
|
}fail:^(NSInteger code, NSString * _Nullable msg) {
|
||||||
// [[self getView] getUserAttentionListFail:state];
|
// [[self getView] getUserAttentionListFail:state];
|
||||||
|
@@ -22,8 +22,8 @@
|
|||||||
#import <NIMSDK/NIMSDK.h>
|
#import <NIMSDK/NIMSDK.h>
|
||||||
/// Tool
|
/// Tool
|
||||||
#import "YMMacro.h"
|
#import "YMMacro.h"
|
||||||
#import "ThemeColor.h"
|
#import "MEWThemeColor.h"
|
||||||
#import "YMHUDTool.h"
|
#import "MewHUDTool.h"
|
||||||
/// P
|
/// P
|
||||||
#import "MewHomePresenter.h"
|
#import "MewHomePresenter.h"
|
||||||
#import "MewHomeProtocol.h"
|
#import "MewHomeProtocol.h"
|
||||||
@@ -146,7 +146,7 @@
|
|||||||
|
|
||||||
// 关注 || 取消关注成功
|
// 关注 || 取消关注成功
|
||||||
- (void)attentionUserSuccess:(BOOL)status {
|
- (void)attentionUserSuccess:(BOOL)status {
|
||||||
[YMHUDTool showSuccessWithMessage: status ? @"关注成功" : @"取消关注成功"];
|
[MewHUDTool showSuccessWithMessage: status ? @"关注成功" : @"取消关注成功"];
|
||||||
[self.userIntroductionView updateAttentionState:status];
|
[self.userIntroductionView updateAttentionState:status];
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -169,13 +169,13 @@
|
|||||||
|
|
||||||
/// 上传mew声音秀成功
|
/// 上传mew声音秀成功
|
||||||
- (void)mewPublishVoiceShowSuccess {
|
- (void)mewPublishVoiceShowSuccess {
|
||||||
[YMHUDTool showSuccessWithMessage:@"上传音频成功"];
|
[MewHUDTool showSuccessWithMessage:@"上传音频成功"];
|
||||||
[MewPushExclusiveVoiceView removeExclusiveViewFromSuperView];
|
[MewPushExclusiveVoiceView removeExclusiveViewFromSuperView];
|
||||||
}
|
}
|
||||||
|
|
||||||
/// 上传声音秀失败
|
/// 上传声音秀失败
|
||||||
- (void)uploadVoiceFileFail:(NSString *)message {
|
- (void)uploadVoiceFileFail:(NSString *)message {
|
||||||
[YMHUDTool showSuccessWithMessage:@"上传音频失败,请重新上传"];
|
[MewHUDTool showSuccessWithMessage:@"上传音频失败,请重新上传"];
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -286,7 +286,7 @@
|
|||||||
/// 上传声音秀
|
/// 上传声音秀
|
||||||
/// 声音路径,声音介绍
|
/// 声音路径,声音介绍
|
||||||
- (void)mewPushExclusiveVoice:(NSString *)filePath voiceIntroString:(nonnull NSString *)voiceIntroString dura:(NSInteger)dura {
|
- (void)mewPushExclusiveVoice:(NSString *)filePath voiceIntroString:(nonnull NSString *)voiceIntroString dura:(NSInteger)dura {
|
||||||
[YMHUDTool showLoadingWithMessage:@"正在上传音频中请稍等"];
|
[MewHUDTool showLoadingWithMessage:@"正在上传音频中请稍等"];
|
||||||
self.voiceString = voiceIntroString;
|
self.voiceString = voiceIntroString;
|
||||||
self.duration = dura;
|
self.duration = dura;
|
||||||
[self.presenter uploadVoice:filePath];
|
[self.presenter uploadVoice:filePath];
|
||||||
@@ -430,7 +430,7 @@
|
|||||||
- (UIView *)rightBgVoiceView {
|
- (UIView *)rightBgVoiceView {
|
||||||
if (!_rightBgVoiceView) {
|
if (!_rightBgVoiceView) {
|
||||||
_rightBgVoiceView = [[UIView alloc] init];
|
_rightBgVoiceView = [[UIView alloc] init];
|
||||||
_rightBgVoiceView.backgroundColor = [ThemeColor colorWithHexString:@"#1D1F33"];
|
_rightBgVoiceView.backgroundColor = [MEWThemeColor mewColorWithHexString:@"#1D1F33"];
|
||||||
}
|
}
|
||||||
return _rightBgVoiceView;
|
return _rightBgVoiceView;
|
||||||
}
|
}
|
||||||
@@ -450,7 +450,7 @@
|
|||||||
- (MewRightFollowVoiceView *)rightFollowVoiceView {
|
- (MewRightFollowVoiceView *)rightFollowVoiceView {
|
||||||
if (!_rightFollowVoiceView) {
|
if (!_rightFollowVoiceView) {
|
||||||
_rightFollowVoiceView = [[MewRightFollowVoiceView alloc] init];
|
_rightFollowVoiceView = [[MewRightFollowVoiceView alloc] init];
|
||||||
_rightFollowVoiceView.backgroundColor = [ThemeColor colorWithHexString:@"#050505"];
|
_rightFollowVoiceView.backgroundColor = [MEWThemeColor mewColorWithHexString:@"#050505"];
|
||||||
_rightFollowVoiceView.hidden = YES;
|
_rightFollowVoiceView.hidden = YES;
|
||||||
_rightFollowVoiceView.delegate = self;
|
_rightFollowVoiceView.delegate = self;
|
||||||
__weak typeof(self) weakSelf = self;
|
__weak typeof(self) weakSelf = self;
|
||||||
|
@@ -8,7 +8,7 @@
|
|||||||
#import "MewHeaderView.h"
|
#import "MewHeaderView.h"
|
||||||
/// Tool
|
/// Tool
|
||||||
#import "YMMacro.h"
|
#import "YMMacro.h"
|
||||||
#import "ThemeColor.h"
|
#import "MEWThemeColor.h"
|
||||||
#import <Masonry/Masonry.h>
|
#import <Masonry/Masonry.h>
|
||||||
|
|
||||||
@interface MewHeaderView()
|
@interface MewHeaderView()
|
||||||
@@ -117,11 +117,11 @@
|
|||||||
// _filterButton.frame = CGRectMake(24, _voiceBgImageView.frame.size.height + 10.0, 61, 27);
|
// _filterButton.frame = CGRectMake(24, _voiceBgImageView.frame.size.height + 10.0, 61, 27);
|
||||||
[_filterButton setImage:[UIImage imageNamed:@"mew_home_header_voice_filter"] forState:UIControlStateNormal];
|
[_filterButton setImage:[UIImage imageNamed:@"mew_home_header_voice_filter"] forState:UIControlStateNormal];
|
||||||
[_filterButton setTitle:@"筛选" forState:UIControlStateNormal];
|
[_filterButton setTitle:@"筛选" forState:UIControlStateNormal];
|
||||||
[_filterButton setTitleColor:[ThemeColor colorWithHexString:@"#E1E4E6"] forState:UIControlStateNormal];
|
[_filterButton setTitleColor:[MEWThemeColor mewColorWithHexString:@"#E1E4E6"] forState:UIControlStateNormal];
|
||||||
_filterButton.titleLabel.font = kFontMedium(12);
|
_filterButton.titleLabel.font = kFontMedium(12);
|
||||||
_filterButton.layer.cornerRadius = 14;
|
_filterButton.layer.cornerRadius = 14;
|
||||||
_filterButton.layer.masksToBounds = YES;
|
_filterButton.layer.masksToBounds = YES;
|
||||||
_filterButton.backgroundColor = [ThemeColor colorWithHexString:@"#1D1E1F"];
|
_filterButton.backgroundColor = [MEWThemeColor mewColorWithHexString:@"#1D1E1F"];
|
||||||
_filterButton.selected = NO;
|
_filterButton.selected = NO;
|
||||||
[_filterButton addTarget:self action:@selector(filterButtonAction:) forControlEvents:UIControlEventTouchUpInside];
|
[_filterButton addTarget:self action:@selector(filterButtonAction:) forControlEvents:UIControlEventTouchUpInside];
|
||||||
}
|
}
|
||||||
@@ -134,11 +134,11 @@
|
|||||||
// _reviewLoadButton.frame = CGRectMake(CGRectGetMaxX(_filterButton.frame) + 20, CGRectGetMinY(_filterButton.frame), 76, 27);
|
// _reviewLoadButton.frame = CGRectMake(CGRectGetMaxX(_filterButton.frame) + 20, CGRectGetMinY(_filterButton.frame), 76, 27);
|
||||||
[_reviewLoadButton setImage:[UIImage imageNamed:@"mew_home_header_renew_voice"] forState:UIControlStateNormal];
|
[_reviewLoadButton setImage:[UIImage imageNamed:@"mew_home_header_renew_voice"] forState:UIControlStateNormal];
|
||||||
[_reviewLoadButton setTitle:@"换一换" forState:UIControlStateNormal];
|
[_reviewLoadButton setTitle:@"换一换" forState:UIControlStateNormal];
|
||||||
[_reviewLoadButton setTitleColor:[ThemeColor colorWithHexString:@"#E1E4E6"] forState:UIControlStateNormal];
|
[_reviewLoadButton setTitleColor:[MEWThemeColor mewColorWithHexString:@"#E1E4E6"] forState:UIControlStateNormal];
|
||||||
_reviewLoadButton.titleLabel.font = kFontMedium(12);
|
_reviewLoadButton.titleLabel.font = kFontMedium(12);
|
||||||
_reviewLoadButton.layer.cornerRadius = 14;
|
_reviewLoadButton.layer.cornerRadius = 14;
|
||||||
_reviewLoadButton.layer.masksToBounds = YES;
|
_reviewLoadButton.layer.masksToBounds = YES;
|
||||||
_reviewLoadButton.backgroundColor = [ThemeColor colorWithHexString:@"#1D1E1F"];
|
_reviewLoadButton.backgroundColor = [MEWThemeColor mewColorWithHexString:@"#1D1E1F"];
|
||||||
[_reviewLoadButton addTarget:self action:@selector(reviewLoadButtonAction) forControlEvents:UIControlEventTouchUpInside];
|
[_reviewLoadButton addTarget:self action:@selector(reviewLoadButtonAction) forControlEvents:UIControlEventTouchUpInside];
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@@ -12,9 +12,9 @@
|
|||||||
#import <Masonry/Masonry.h>
|
#import <Masonry/Masonry.h>
|
||||||
/// Tool
|
/// Tool
|
||||||
#import "UIImage+Utils.h"
|
#import "UIImage+Utils.h"
|
||||||
#import "ThemeColor.h"
|
#import "MEWThemeColor.h"
|
||||||
#import "YMMacro.h"
|
#import "YMMacro.h"
|
||||||
#import "YMHUDTool.h"
|
#import "MewHUDTool.h"
|
||||||
#import "YMIButton.h"
|
#import "YMIButton.h"
|
||||||
|
|
||||||
@interface MewPlayVoiceView()
|
@interface MewPlayVoiceView()
|
||||||
@@ -69,7 +69,7 @@
|
|||||||
- (void)stopVoiceButtonAction:(UIButton *)sender {
|
- (void)stopVoiceButtonAction:(UIButton *)sender {
|
||||||
// 判断当前是否有用户在唱片上
|
// 判断当前是否有用户在唱片上
|
||||||
if (!self.discVoiceView.isUserOnDisc) {
|
if (!self.discVoiceView.isUserOnDisc) {
|
||||||
[YMHUDTool showErrorWithMessage:@"请添加声音到唱片才能播放"];
|
[MewHUDTool showErrorWithMessage:@"请添加声音到唱片才能播放"];
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -84,7 +84,7 @@
|
|||||||
- (void)renewPlayVoiceButtonAction {
|
- (void)renewPlayVoiceButtonAction {
|
||||||
// 判断当前是否有用户在唱片上
|
// 判断当前是否有用户在唱片上
|
||||||
if (!self.discVoiceView.isUserOnDisc) {
|
if (!self.discVoiceView.isUserOnDisc) {
|
||||||
[YMHUDTool showErrorWithMessage:@"请添加声音到唱片才能播放"];
|
[MewHUDTool showErrorWithMessage:@"请添加声音到唱片才能播放"];
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -195,9 +195,9 @@
|
|||||||
_pushVoiceButton.layer.cornerRadius = 52.0/2;
|
_pushVoiceButton.layer.cornerRadius = 52.0/2;
|
||||||
_pushVoiceButton.layer.masksToBounds = YES;
|
_pushVoiceButton.layer.masksToBounds = YES;
|
||||||
UIImage *backgroundImage = [UIImage gradientColorImageFromColors:@[
|
UIImage *backgroundImage = [UIImage gradientColorImageFromColors:@[
|
||||||
[ThemeColor colorWithHexString:@"#FF60FD"],
|
[MEWThemeColor mewColorWithHexString:@"#FF60FD"],
|
||||||
[ThemeColor colorWithHexString:@"##8974FF"],
|
[MEWThemeColor mewColorWithHexString:@"##8974FF"],
|
||||||
[ThemeColor colorWithHexString:@"#69EBFF"]
|
[MEWThemeColor mewColorWithHexString:@"#69EBFF"]
|
||||||
] gradientType:GradientTypeLeftToRight imgSize:CGSizeMake(200, 52)];
|
] gradientType:GradientTypeLeftToRight imgSize:CGSizeMake(200, 52)];
|
||||||
_pushVoiceButton.backgroundColor = [UIColor colorWithPatternImage:backgroundImage];
|
_pushVoiceButton.backgroundColor = [UIColor colorWithPatternImage:backgroundImage];
|
||||||
[_pushVoiceButton addTarget:self action:@selector(pushVoiceButtonAction) forControlEvents:UIControlEventTouchUpInside];
|
[_pushVoiceButton addTarget:self action:@selector(pushVoiceButtonAction) forControlEvents:UIControlEventTouchUpInside];
|
||||||
|
@@ -8,12 +8,12 @@
|
|||||||
#import "MewPushExclusiveVoiceView.h"
|
#import "MewPushExclusiveVoiceView.h"
|
||||||
/// Tool
|
/// Tool
|
||||||
#import "YMMacro.h"
|
#import "YMMacro.h"
|
||||||
#import "ThemeColor.h"
|
#import "MEWThemeColor.h"
|
||||||
#import "UIImage+Utils.h"
|
#import "UIImage+Utils.h"
|
||||||
#import "YYUtility.h"
|
#import "YYUtility.h"
|
||||||
#import "AccountInfoStorage.h"
|
#import "AccountInfoStorage.h"
|
||||||
#import "NSArray+Safe.h"
|
#import "NSArray+MewSafe.h"
|
||||||
#import "YMHUDTool.h"
|
#import "MewHUDTool.h"
|
||||||
/// Third
|
/// Third
|
||||||
#import <Masonry/Masonry.h>
|
#import <Masonry/Masonry.h>
|
||||||
#import <AVFoundation/AVFoundation.h>
|
#import <AVFoundation/AVFoundation.h>
|
||||||
@@ -121,7 +121,7 @@ static MewPushExclusiveVoiceView *_exclusiveVoiceView = nil;
|
|||||||
if (self) {
|
if (self) {
|
||||||
|
|
||||||
// self.recordVoiceState = RecordVoiceState_Record_Normal;
|
// self.recordVoiceState = RecordVoiceState_Record_Normal;
|
||||||
self.backgroundColor = UIColorRGBAlpha(0x000000, 0.5);
|
self.backgroundColor = UIColorMewRGBAlpha(0x000000, 0.5);
|
||||||
self.voiceButtonArrays = [NSMutableArray array];
|
self.voiceButtonArrays = [NSMutableArray array];
|
||||||
self.voiceTitleArrays = @[@"无效果", @"恐怖", @"成熟", @"萝莉"];
|
self.voiceTitleArrays = @[@"无效果", @"恐怖", @"成熟", @"萝莉"];
|
||||||
self.voiceImageArrays = @[@"mew_home_change_voice_defalut",@"mew_home_change_voice_horror",@"mew_home_change_voice_mature",@"mew_home_change_voice_girl"];
|
self.voiceImageArrays = @[@"mew_home_change_voice_defalut",@"mew_home_change_voice_horror",@"mew_home_change_voice_mature",@"mew_home_change_voice_girl"];
|
||||||
@@ -183,12 +183,12 @@ static MewPushExclusiveVoiceView *_exclusiveVoiceView = nil;
|
|||||||
/// 播放录制声音
|
/// 播放录制声音
|
||||||
- (void)playWithRecordVoice:(UIButton *)sender {
|
- (void)playWithRecordVoice:(UIButton *)sender {
|
||||||
if (self.recordVoiceState == RecordVoiceState_Record_Normal) {
|
if (self.recordVoiceState == RecordVoiceState_Record_Normal) {
|
||||||
[YMHUDTool showErrorWithMessage:@"请先录制声音"];
|
[MewHUDTool showErrorWithMessage:@"请先录制声音"];
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (self.recordVoiceState == RecordVoiceState_Record_Start) {
|
if (self.recordVoiceState == RecordVoiceState_Record_Start) {
|
||||||
[YMHUDTool showErrorWithMessage:@"正在录制声音,请先结束录制"];
|
[MewHUDTool showErrorWithMessage:@"正在录制声音,请先结束录制"];
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -199,13 +199,13 @@ static MewPushExclusiveVoiceView *_exclusiveVoiceView = nil;
|
|||||||
/// 重新播放录制声音
|
/// 重新播放录制声音
|
||||||
- (void)renewPlayWithRecordVoice {
|
- (void)renewPlayWithRecordVoice {
|
||||||
if (self.recordVoiceState == RecordVoiceState_Record_Normal) {
|
if (self.recordVoiceState == RecordVoiceState_Record_Normal) {
|
||||||
[YMHUDTool showErrorWithMessage:@"请先录制声音"];
|
[MewHUDTool showErrorWithMessage:@"请先录制声音"];
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if (self.isPlayVoice) {
|
if (self.isPlayVoice) {
|
||||||
[YMHUDTool showErrorWithMessage:@"正在播放声音,请先结束播放"];
|
[MewHUDTool showErrorWithMessage:@"正在播放声音,请先结束播放"];
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -217,7 +217,7 @@ static MewPushExclusiveVoiceView *_exclusiveVoiceView = nil;
|
|||||||
/// 发布声音
|
/// 发布声音
|
||||||
- (void)pushWithRecordVoice {
|
- (void)pushWithRecordVoice {
|
||||||
if (self.totalFilePath.length == 0 || self.totalFilePath == nil) {
|
if (self.totalFilePath.length == 0 || self.totalFilePath == nil) {
|
||||||
[YMHUDTool showErrorWithMessage:@"请先录制声音"];
|
[MewHUDTool showErrorWithMessage:@"请先录制声音"];
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -252,7 +252,7 @@ static MewPushExclusiveVoiceView *_exclusiveVoiceView = nil;
|
|||||||
- (void)startRecord {
|
- (void)startRecord {
|
||||||
[YYUtility checkMicPrivacy:^(BOOL succeed) {
|
[YYUtility checkMicPrivacy:^(BOOL succeed) {
|
||||||
if (!succeed) {
|
if (!succeed) {
|
||||||
[YMHUDTool showErrorWithMessage:@"无麦克风权限,请到设置中打开麦克风权限"];
|
[MewHUDTool showErrorWithMessage:@"无麦克风权限,请到设置中打开麦克风权限"];
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -278,7 +278,7 @@ static MewPushExclusiveVoiceView *_exclusiveVoiceView = nil;
|
|||||||
} else {
|
} else {
|
||||||
self.recordVoiceState = RecordVoiceState_Record_Normal;
|
self.recordVoiceState = RecordVoiceState_Record_Normal;
|
||||||
[self deleteAudioFile];
|
[self deleteAudioFile];
|
||||||
[YMHUDTool showErrorWithMessage:@"录制的语音至少3s"];
|
[MewHUDTool showErrorWithMessage:@"录制的语音至少3s"];
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -359,7 +359,7 @@ static MewPushExclusiveVoiceView *_exclusiveVoiceView = nil;
|
|||||||
}
|
}
|
||||||
|
|
||||||
self.longTapColorView.hidden = NO;
|
self.longTapColorView.hidden = NO;
|
||||||
self.longTapColorView.backgroundColor = [ThemeColor colorWithHexString:isRecord ? @"#FF43B1" : @"#43F4FF"];
|
self.longTapColorView.backgroundColor = [MEWThemeColor mewColorWithHexString:isRecord ? @"#FF43B1" : @"#43F4FF"];
|
||||||
}
|
}
|
||||||
|
|
||||||
/// 初始化录音对象
|
/// 初始化录音对象
|
||||||
@@ -386,7 +386,7 @@ static MewPushExclusiveVoiceView *_exclusiveVoiceView = nil;
|
|||||||
self.fileName = [NSString stringWithFormat:@"voiceShow_%@_%@.wav", [AccountInfoStorage instance].getUid, date];
|
self.fileName = [NSString stringWithFormat:@"voiceShow_%@_%@.wav", [AccountInfoStorage instance].getUid, date];
|
||||||
NSFileManager *fileMgr = [[NSFileManager alloc] init];
|
NSFileManager *fileMgr = [[NSFileManager alloc] init];
|
||||||
//创建文件管理器
|
//创建文件管理器
|
||||||
NSString *filePath = [[NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES) safeObjectAtIndex1:0] stringByAppendingPathComponent:@"voiceShow"];
|
NSString *filePath = [[NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES) mewSafeObjectAtIndex:0] stringByAppendingPathComponent:@"voiceShow"];
|
||||||
self.totalFilePath = [filePath stringByAppendingPathComponent:self.fileName];
|
self.totalFilePath = [filePath stringByAppendingPathComponent:self.fileName];
|
||||||
if (![fileMgr fileExistsAtPath:filePath]) {
|
if (![fileMgr fileExistsAtPath:filePath]) {
|
||||||
//如果不存在,则说明是第一次运行这个程序,那么建立这个文件夹
|
//如果不存在,则说明是第一次运行这个程序,那么建立这个文件夹
|
||||||
@@ -401,11 +401,11 @@ static MewPushExclusiveVoiceView *_exclusiveVoiceView = nil;
|
|||||||
[self.audioRecorder updateMeters];
|
[self.audioRecorder updateMeters];
|
||||||
NSLog(@"%f",[self.audioRecorder peakPowerForChannel:0]);
|
NSLog(@"%f",[self.audioRecorder peakPowerForChannel:0]);
|
||||||
if(!self.audioRecorder) {
|
if(!self.audioRecorder) {
|
||||||
[YMHUDTool showErrorWithMessage:@"录制失败,请重试"];
|
[MewHUDTool showErrorWithMessage:@"录制失败,请重试"];
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if(![self.audioRecorder prepareToRecord]) {
|
if(![self.audioRecorder prepareToRecord]) {
|
||||||
[YMHUDTool showErrorWithMessage:@"录制失败,请重试"];
|
[MewHUDTool showErrorWithMessage:@"录制失败,请重试"];
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
BOOL status = [self.audioRecorder record];
|
BOOL status = [self.audioRecorder record];
|
||||||
@@ -529,7 +529,7 @@ static MewPushExclusiveVoiceView *_exclusiveVoiceView = nil;
|
|||||||
CGFloat imageWidth = 60;
|
CGFloat imageWidth = 60;
|
||||||
CGFloat marginX = (KScreenWidth - 48 - 20.0 - 4 * imageWidth)/5;
|
CGFloat marginX = (KScreenWidth - 48 - 20.0 - 4 * imageWidth)/5;
|
||||||
UIButton *muteButton = [[UIButton alloc] init];
|
UIButton *muteButton = [[UIButton alloc] init];
|
||||||
muteButton.backgroundColor = [ThemeColor colorWithHexString:@"#444F75"];
|
muteButton.backgroundColor = [MEWThemeColor mewColorWithHexString:@"#444F75"];
|
||||||
[muteButton setImage:[UIImage imageNamed:@"mew_home_change_voice_bg"] forState:UIControlStateSelected];
|
[muteButton setImage:[UIImage imageNamed:@"mew_home_change_voice_bg"] forState:UIControlStateSelected];
|
||||||
[muteButton setImage:[UIImage imageNamed:@"mew_home_change_voice_nomarl"] forState:UIControlStateNormal];
|
[muteButton setImage:[UIImage imageNamed:@"mew_home_change_voice_nomarl"] forState:UIControlStateNormal];
|
||||||
muteButton.layer.cornerRadius = 8;
|
muteButton.layer.cornerRadius = 8;
|
||||||
@@ -554,7 +554,7 @@ static MewPushExclusiveVoiceView *_exclusiveVoiceView = nil;
|
|||||||
UILabel *muteLabel = [[UILabel alloc] init];
|
UILabel *muteLabel = [[UILabel alloc] init];
|
||||||
muteLabel.text = self.voiceTitleArrays[i];
|
muteLabel.text = self.voiceTitleArrays[i];
|
||||||
muteLabel.font = kFontRegular(12);
|
muteLabel.font = kFontRegular(12);
|
||||||
muteLabel.textColor = [ThemeColor colorWithHexString:@"#F0F0F0"];
|
muteLabel.textColor = [MEWThemeColor mewColorWithHexString:@"#F0F0F0"];
|
||||||
[self.voiceView addSubview:muteLabel];
|
[self.voiceView addSubview:muteLabel];
|
||||||
[muteLabel mas_makeConstraints:^(MASConstraintMaker *make) {
|
[muteLabel mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||||
make.top.equalTo(muteImageView.mas_bottom).offset(5.0);
|
make.top.equalTo(muteImageView.mas_bottom).offset(5.0);
|
||||||
@@ -584,7 +584,7 @@ static MewPushExclusiveVoiceView *_exclusiveVoiceView = nil;
|
|||||||
- (UIView *)whiteBgView {
|
- (UIView *)whiteBgView {
|
||||||
if (!_whiteBgView) {
|
if (!_whiteBgView) {
|
||||||
_whiteBgView = [[UIView alloc] init];
|
_whiteBgView = [[UIView alloc] init];
|
||||||
_whiteBgView.backgroundColor = [ThemeColor colorWithHexString:@"#525566"];;
|
_whiteBgView.backgroundColor = [MEWThemeColor mewColorWithHexString:@"#525566"];;
|
||||||
_whiteBgView.layer.cornerRadius = 15.0;
|
_whiteBgView.layer.cornerRadius = 15.0;
|
||||||
_whiteBgView.layer.masksToBounds = YES;
|
_whiteBgView.layer.masksToBounds = YES;
|
||||||
}
|
}
|
||||||
@@ -633,7 +633,7 @@ static MewPushExclusiveVoiceView *_exclusiveVoiceView = nil;
|
|||||||
- (UIView *)longTapView {
|
- (UIView *)longTapView {
|
||||||
if (!_longTapView) {
|
if (!_longTapView) {
|
||||||
_longTapView = [[UIView alloc] init];
|
_longTapView = [[UIView alloc] init];
|
||||||
_longTapView.backgroundColor = [ThemeColor colorWithHexString:@"#9552FF"];
|
_longTapView.backgroundColor = [MEWThemeColor mewColorWithHexString:@"#9552FF"];
|
||||||
_longTapView.layer.cornerRadius = 24.0;
|
_longTapView.layer.cornerRadius = 24.0;
|
||||||
_longTapView.layer.masksToBounds = YES;
|
_longTapView.layer.masksToBounds = YES;
|
||||||
//长按
|
//长按
|
||||||
@@ -665,7 +665,7 @@ static MewPushExclusiveVoiceView *_exclusiveVoiceView = nil;
|
|||||||
- (UIView *)longTapColorView {
|
- (UIView *)longTapColorView {
|
||||||
if (!_longTapColorView) {
|
if (!_longTapColorView) {
|
||||||
_longTapColorView = [[UIView alloc] init];
|
_longTapColorView = [[UIView alloc] init];
|
||||||
_longTapColorView.backgroundColor = [ThemeColor colorWithHexString:@"#43F4FF"];
|
_longTapColorView.backgroundColor = [MEWThemeColor mewColorWithHexString:@"#43F4FF"];
|
||||||
_longTapColorView.layer.cornerRadius = 6.0/2.0;
|
_longTapColorView.layer.cornerRadius = 6.0/2.0;
|
||||||
_longTapColorView.layer.masksToBounds = YES;
|
_longTapColorView.layer.masksToBounds = YES;
|
||||||
}
|
}
|
||||||
@@ -695,7 +695,7 @@ static MewPushExclusiveVoiceView *_exclusiveVoiceView = nil;
|
|||||||
- (UIView *)textBgView {
|
- (UIView *)textBgView {
|
||||||
if (!_textBgView) {
|
if (!_textBgView) {
|
||||||
_textBgView = [[UIView alloc] init];
|
_textBgView = [[UIView alloc] init];
|
||||||
_textBgView.backgroundColor = [ThemeColor colorWithHexString:@"#DCDDE0"];
|
_textBgView.backgroundColor = [MEWThemeColor mewColorWithHexString:@"#DCDDE0"];
|
||||||
_textBgView.layer.cornerRadius = 11.0;
|
_textBgView.layer.cornerRadius = 11.0;
|
||||||
_textBgView.layer.masksToBounds = YES;
|
_textBgView.layer.masksToBounds = YES;
|
||||||
}
|
}
|
||||||
@@ -706,7 +706,7 @@ static MewPushExclusiveVoiceView *_exclusiveVoiceView = nil;
|
|||||||
_textView = [[UITextView alloc] init];
|
_textView = [[UITextView alloc] init];
|
||||||
_textView.delegate = self;
|
_textView.delegate = self;
|
||||||
_textView.font = kFontRegular(13);
|
_textView.font = kFontRegular(13);
|
||||||
_textView.textColor = [ThemeColor colorWithHexString:@"#7D8499"];
|
_textView.textColor = [MEWThemeColor mewColorWithHexString:@"#7D8499"];
|
||||||
_textView.backgroundColor = UIColor.clearColor;
|
_textView.backgroundColor = UIColor.clearColor;
|
||||||
}
|
}
|
||||||
return _textView;
|
return _textView;
|
||||||
@@ -715,7 +715,7 @@ static MewPushExclusiveVoiceView *_exclusiveVoiceView = nil;
|
|||||||
if (!_placeholdLabel) {
|
if (!_placeholdLabel) {
|
||||||
_placeholdLabel = [[UILabel alloc] init];
|
_placeholdLabel = [[UILabel alloc] init];
|
||||||
_placeholdLabel.text = @"说点什么...";
|
_placeholdLabel.text = @"说点什么...";
|
||||||
_placeholdLabel.textColor = [ThemeColor colorWithHexString:@"#7D8499"];
|
_placeholdLabel.textColor = [MEWThemeColor mewColorWithHexString:@"#7D8499"];
|
||||||
_placeholdLabel.font = kFontRegular(13);
|
_placeholdLabel.font = kFontRegular(13);
|
||||||
}
|
}
|
||||||
return _placeholdLabel;
|
return _placeholdLabel;
|
||||||
@@ -729,7 +729,7 @@ static MewPushExclusiveVoiceView *_exclusiveVoiceView = nil;
|
|||||||
_pushVoiceButton.titleLabel.font = kFontSemibold(16);
|
_pushVoiceButton.titleLabel.font = kFontSemibold(16);
|
||||||
_pushVoiceButton.layer.cornerRadius = 23.0;
|
_pushVoiceButton.layer.cornerRadius = 23.0;
|
||||||
_pushVoiceButton.layer.masksToBounds = YES;
|
_pushVoiceButton.layer.masksToBounds = YES;
|
||||||
UIImage *image = [UIImage gradientColorImageFromColors:@[[ThemeColor colorWithHexString:@"#FF60FD"], [ThemeColor colorWithHexString:@"#8974FF"],[ThemeColor colorWithHexString:@"#69EBFF"]] gradientType:GradientTypeLeftToRight imgSize:CGSizeMake(KScreenWidth - 4 * 28, 46)];
|
UIImage *image = [UIImage gradientColorImageFromColors:@[[MEWThemeColor mewColorWithHexString:@"#FF60FD"], [MEWThemeColor mewColorWithHexString:@"#8974FF"],[MEWThemeColor mewColorWithHexString:@"#69EBFF"]] gradientType:GradientTypeLeftToRight imgSize:CGSizeMake(KScreenWidth - 4 * 28, 46)];
|
||||||
_pushVoiceButton.backgroundColor = [UIColor colorWithPatternImage:image];
|
_pushVoiceButton.backgroundColor = [UIColor colorWithPatternImage:image];
|
||||||
[_pushVoiceButton addTarget:self action:@selector(pushWithRecordVoice) forControlEvents:UIControlEventTouchUpInside];
|
[_pushVoiceButton addTarget:self action:@selector(pushWithRecordVoice) forControlEvents:UIControlEventTouchUpInside];
|
||||||
}
|
}
|
||||||
|
@@ -12,10 +12,10 @@
|
|||||||
#import <Masonry/Masonry.h>
|
#import <Masonry/Masonry.h>
|
||||||
/// Tool
|
/// Tool
|
||||||
#import "YMMacro.h"
|
#import "YMMacro.h"
|
||||||
#import "ThemeColor.h"
|
#import "MEWThemeColor.h"
|
||||||
#import "FansInfoModel.h"
|
#import "FansInfoModel.h"
|
||||||
#import "UserInfoModel.h"
|
#import "UserInfoModel.h"
|
||||||
#import "NSArray+Safe.h"
|
#import "NSArray+MewSafe.h"
|
||||||
|
|
||||||
@interface MewRightFollowVoiceView() <UICollectionViewDelegate, UICollectionViewDataSource>
|
@interface MewRightFollowVoiceView() <UICollectionViewDelegate, UICollectionViewDataSource>
|
||||||
|
|
||||||
@@ -53,7 +53,7 @@
|
|||||||
|
|
||||||
- (__kindof UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath {
|
- (__kindof UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath {
|
||||||
MewRightFollowVoiceCollectionCell *cell = [collectionView dequeueReusableCellWithReuseIdentifier:NSStringFromClass([MewRightFollowVoiceCollectionCell class]) forIndexPath:indexPath];
|
MewRightFollowVoiceCollectionCell *cell = [collectionView dequeueReusableCellWithReuseIdentifier:NSStringFromClass([MewRightFollowVoiceCollectionCell class]) forIndexPath:indexPath];
|
||||||
UserInfoModel *model = [self.fansListModel safeObjectAtIndex1:indexPath.row];
|
UserInfoModel *model = [self.fansListModel mewSafeObjectAtIndex:indexPath.row];
|
||||||
cell.avater = model.avatar;
|
cell.avater = model.avatar;
|
||||||
cell.nick = model.nick;
|
cell.nick = model.nick;
|
||||||
cell.sex = model.gender;
|
cell.sex = model.gender;
|
||||||
@@ -92,12 +92,12 @@
|
|||||||
MJRefreshNormalHeader *header = [MJRefreshNormalHeader headerWithRefreshingTarget:self refreshingAction:@selector(headerRefresh)];
|
MJRefreshNormalHeader *header = [MJRefreshNormalHeader headerWithRefreshingTarget:self refreshingAction:@selector(headerRefresh)];
|
||||||
header.stateLabel.font = [UIFont systemFontOfSize:10.0];
|
header.stateLabel.font = [UIFont systemFontOfSize:10.0];
|
||||||
header.lastUpdatedTimeLabel.font = [UIFont systemFontOfSize:10.0];
|
header.lastUpdatedTimeLabel.font = [UIFont systemFontOfSize:10.0];
|
||||||
header.stateLabel.textColor = [ThemeColor secondTextColor];
|
header.stateLabel.textColor = [MEWThemeColor mewSecondTextColor];
|
||||||
header.lastUpdatedTimeLabel.textColor = [ThemeColor secondTextColor];
|
header.lastUpdatedTimeLabel.textColor = [MEWThemeColor mewSecondTextColor];
|
||||||
self.followCollectionView.mj_header = header;
|
self.followCollectionView.mj_header = header;
|
||||||
|
|
||||||
MJRefreshBackNormalFooter *footer = [MJRefreshBackNormalFooter footerWithRefreshingTarget:self refreshingAction:@selector(footerRefresh)];
|
MJRefreshBackNormalFooter *footer = [MJRefreshBackNormalFooter footerWithRefreshingTarget:self refreshingAction:@selector(footerRefresh)];
|
||||||
footer.stateLabel.textColor = [ThemeColor secondTextColor];
|
footer.stateLabel.textColor = [MEWThemeColor mewSecondTextColor];
|
||||||
footer.stateLabel.font = [UIFont systemFontOfSize:10.0];
|
footer.stateLabel.font = [UIFont systemFontOfSize:10.0];
|
||||||
self.followCollectionView.mj_footer = footer;
|
self.followCollectionView.mj_footer = footer;
|
||||||
|
|
||||||
|
@@ -11,7 +11,7 @@
|
|||||||
/// Tool
|
/// Tool
|
||||||
#import "YMMacro.h"
|
#import "YMMacro.h"
|
||||||
#import "AudioPlayerManager.h"
|
#import "AudioPlayerManager.h"
|
||||||
#import "YMHUDTool.h"
|
#import "MewHUDTool.h"
|
||||||
/// Third
|
/// Third
|
||||||
#import <Masonry/Masonry.h>
|
#import <Masonry/Masonry.h>
|
||||||
/// Model
|
/// Model
|
||||||
|
@@ -11,7 +11,7 @@
|
|||||||
#import "UserInfoModel.h"
|
#import "UserInfoModel.h"
|
||||||
/// Tool
|
/// Tool
|
||||||
#import "YMMacro.h"
|
#import "YMMacro.h"
|
||||||
#import "ThemeColor.h"
|
#import "MEWThemeColor.h"
|
||||||
#import "AudioPlayerManager.h"
|
#import "AudioPlayerManager.h"
|
||||||
/// Third
|
/// Third
|
||||||
#import <Masonry/Masonry.h>
|
#import <Masonry/Masonry.h>
|
||||||
@@ -117,7 +117,7 @@ static MewUserIntroductionView *_userIntroductionView = nil;
|
|||||||
- (instancetype)initWithFrame:(CGRect)frame {
|
- (instancetype)initWithFrame:(CGRect)frame {
|
||||||
self = [super initWithFrame:frame];
|
self = [super initWithFrame:frame];
|
||||||
if (self) {
|
if (self) {
|
||||||
self.backgroundColor = UIColorRGBAlpha(0x000000, 0.4);
|
self.backgroundColor = UIColorMewRGBAlpha(0x000000, 0.4);
|
||||||
UITapGestureRecognizer *tap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(didSelectBgViewTapGesture:)];
|
UITapGestureRecognizer *tap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(didSelectBgViewTapGesture:)];
|
||||||
[self addGestureRecognizer:tap];
|
[self addGestureRecognizer:tap];
|
||||||
[self initView];
|
[self initView];
|
||||||
@@ -372,7 +372,7 @@ static MewUserIntroductionView *_userIntroductionView = nil;
|
|||||||
- (UIView *)whiteBgView {
|
- (UIView *)whiteBgView {
|
||||||
if (!_whiteBgView) {
|
if (!_whiteBgView) {
|
||||||
_whiteBgView = [[UIView alloc] init];
|
_whiteBgView = [[UIView alloc] init];
|
||||||
_whiteBgView.backgroundColor = [ThemeColor colorWithHexString:@"#525566"];
|
_whiteBgView.backgroundColor = [MEWThemeColor mewColorWithHexString:@"#525566"];
|
||||||
_whiteBgView.layer.cornerRadius = 16;
|
_whiteBgView.layer.cornerRadius = 16;
|
||||||
_whiteBgView.layer.masksToBounds = YES;
|
_whiteBgView.layer.masksToBounds = YES;
|
||||||
}
|
}
|
||||||
@@ -449,10 +449,10 @@ static MewUserIntroductionView *_userIntroductionView = nil;
|
|||||||
_starSignLabel.text = @"天蝎座";
|
_starSignLabel.text = @"天蝎座";
|
||||||
_starSignLabel.textAlignment = NSTextAlignmentCenter;
|
_starSignLabel.textAlignment = NSTextAlignmentCenter;
|
||||||
_starSignLabel.font = kFontRegular(10);
|
_starSignLabel.font = kFontRegular(10);
|
||||||
_starSignLabel.textColor = [ThemeColor colorWithHexString:@"#9168FA"];
|
_starSignLabel.textColor = [MEWThemeColor mewColorWithHexString:@"#9168FA"];
|
||||||
_starSignLabel.layer.cornerRadius = 9.0;
|
_starSignLabel.layer.cornerRadius = 9.0;
|
||||||
_starSignLabel.layer.masksToBounds = YES;
|
_starSignLabel.layer.masksToBounds = YES;
|
||||||
_starSignLabel.backgroundColor = [ThemeColor colorWithHexString:@"#E9E1FF"];
|
_starSignLabel.backgroundColor = [MEWThemeColor mewColorWithHexString:@"#E9E1FF"];
|
||||||
}
|
}
|
||||||
return _starSignLabel;
|
return _starSignLabel;
|
||||||
}
|
}
|
||||||
@@ -462,7 +462,7 @@ static MewUserIntroductionView *_userIntroductionView = nil;
|
|||||||
- (UIView *)voiceIntroductionView {
|
- (UIView *)voiceIntroductionView {
|
||||||
if (!_voiceIntroductionView) {
|
if (!_voiceIntroductionView) {
|
||||||
_voiceIntroductionView = [[UIView alloc] init];
|
_voiceIntroductionView = [[UIView alloc] init];
|
||||||
_voiceIntroductionView.backgroundColor = [ThemeColor colorWithHexString:@"#DCDDE0"];
|
_voiceIntroductionView.backgroundColor = [MEWThemeColor mewColorWithHexString:@"#DCDDE0"];
|
||||||
_voiceIntroductionView.layer.cornerRadius = 11.0;
|
_voiceIntroductionView.layer.cornerRadius = 11.0;
|
||||||
_voiceIntroductionView.layer.masksToBounds = YES;
|
_voiceIntroductionView.layer.masksToBounds = YES;
|
||||||
}
|
}
|
||||||
@@ -474,7 +474,7 @@ static MewUserIntroductionView *_userIntroductionView = nil;
|
|||||||
_voiceTitleLabel = [[UILabel alloc] init];
|
_voiceTitleLabel = [[UILabel alloc] init];
|
||||||
_voiceTitleLabel.text = @"这是一段用户签名,这是一段用户签名,这是一段用户签名~";
|
_voiceTitleLabel.text = @"这是一段用户签名,这是一段用户签名,这是一段用户签名~";
|
||||||
_voiceTitleLabel.font = kFontRegular(13);
|
_voiceTitleLabel.font = kFontRegular(13);
|
||||||
_voiceTitleLabel.textColor = [ThemeColor colorWithHexString:@"#1F1B4F"];
|
_voiceTitleLabel.textColor = [MEWThemeColor mewColorWithHexString:@"#1F1B4F"];
|
||||||
_voiceTitleLabel.numberOfLines = 0;
|
_voiceTitleLabel.numberOfLines = 0;
|
||||||
}
|
}
|
||||||
return _voiceTitleLabel;
|
return _voiceTitleLabel;
|
||||||
@@ -512,7 +512,7 @@ static MewUserIntroductionView *_userIntroductionView = nil;
|
|||||||
_voiceTimeLabel = [[UILabel alloc] init];
|
_voiceTimeLabel = [[UILabel alloc] init];
|
||||||
_voiceTimeLabel.text = @"30”";
|
_voiceTimeLabel.text = @"30”";
|
||||||
_voiceTimeLabel.font = kFontMedium(14);
|
_voiceTimeLabel.font = kFontMedium(14);
|
||||||
_voiceTimeLabel.textColor = [ThemeColor colorWithHexString:@"#1F1B4F"];
|
_voiceTimeLabel.textColor = [MEWThemeColor mewColorWithHexString:@"#1F1B4F"];
|
||||||
}
|
}
|
||||||
return _voiceTimeLabel;
|
return _voiceTimeLabel;
|
||||||
}
|
}
|
||||||
@@ -520,7 +520,7 @@ static MewUserIntroductionView *_userIntroductionView = nil;
|
|||||||
- (UIView *)horLineView {
|
- (UIView *)horLineView {
|
||||||
if (!_horLineView) {
|
if (!_horLineView) {
|
||||||
_horLineView = [[UIView alloc] init];
|
_horLineView = [[UIView alloc] init];
|
||||||
_horLineView.backgroundColor = UIColorRGBAlpha(0xFFFFFF, 0.2);
|
_horLineView.backgroundColor = UIColorMewRGBAlpha(0xFFFFFF, 0.2);
|
||||||
|
|
||||||
}
|
}
|
||||||
return _horLineView;
|
return _horLineView;
|
||||||
@@ -529,7 +529,7 @@ static MewUserIntroductionView *_userIntroductionView = nil;
|
|||||||
- (UIView *)verLineView1 {
|
- (UIView *)verLineView1 {
|
||||||
if (!_verLineView1) {
|
if (!_verLineView1) {
|
||||||
_verLineView1 = [[UIView alloc] init];
|
_verLineView1 = [[UIView alloc] init];
|
||||||
_verLineView1.backgroundColor = UIColorRGBAlpha(0xFFFFFF, 0.2);
|
_verLineView1.backgroundColor = UIColorMewRGBAlpha(0xFFFFFF, 0.2);
|
||||||
}
|
}
|
||||||
return _verLineView1;
|
return _verLineView1;
|
||||||
}
|
}
|
||||||
@@ -539,7 +539,7 @@ static MewUserIntroductionView *_userIntroductionView = nil;
|
|||||||
- (UIView *)verLineView2 {
|
- (UIView *)verLineView2 {
|
||||||
if (!_verLineView2) {
|
if (!_verLineView2) {
|
||||||
_verLineView2 = [[UIView alloc] init];
|
_verLineView2 = [[UIView alloc] init];
|
||||||
_verLineView2.backgroundColor = UIColorRGBAlpha(0xFFFFFF, 0.2);
|
_verLineView2.backgroundColor = UIColorMewRGBAlpha(0xFFFFFF, 0.2);
|
||||||
}
|
}
|
||||||
return _verLineView2;
|
return _verLineView2;
|
||||||
}
|
}
|
||||||
|
@@ -7,7 +7,7 @@
|
|||||||
|
|
||||||
#import "MewVoiceGuideView.h"
|
#import "MewVoiceGuideView.h"
|
||||||
/// Tool
|
/// Tool
|
||||||
#import "ThemeColor.h"
|
#import "MEWThemeColor.h"
|
||||||
#import "YMMacro.h"
|
#import "YMMacro.h"
|
||||||
#import <Masonry/Masonry.h>
|
#import <Masonry/Masonry.h>
|
||||||
|
|
||||||
@@ -47,7 +47,7 @@ static MewVoiceGuideView *_guideView = nil;
|
|||||||
- (instancetype)initWithFrame:(CGRect)frame {
|
- (instancetype)initWithFrame:(CGRect)frame {
|
||||||
self = [super initWithFrame:frame];
|
self = [super initWithFrame:frame];
|
||||||
if (self) {
|
if (self) {
|
||||||
self.backgroundColor = UIColorRGBAlpha(0x000000, 0.4);
|
self.backgroundColor = UIColorMewRGBAlpha(0x000000, 0.4);
|
||||||
UITapGestureRecognizer *tap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(viewWithTapGesture:)];
|
UITapGestureRecognizer *tap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(viewWithTapGesture:)];
|
||||||
[self addGestureRecognizer:tap];
|
[self addGestureRecognizer:tap];
|
||||||
[self initView];
|
[self initView];
|
||||||
@@ -125,7 +125,7 @@ static MewVoiceGuideView *_guideView = nil;
|
|||||||
- (UIView *)guideBgView {
|
- (UIView *)guideBgView {
|
||||||
if (!_guideBgView) {
|
if (!_guideBgView) {
|
||||||
_guideBgView = [[UIView alloc] init];
|
_guideBgView = [[UIView alloc] init];
|
||||||
_guideBgView.backgroundColor = [ThemeColor colorWithHexString:@"#6A60FF"];
|
_guideBgView.backgroundColor = [MEWThemeColor mewColorWithHexString:@"#6A60FF"];
|
||||||
}
|
}
|
||||||
return _guideBgView;
|
return _guideBgView;
|
||||||
}
|
}
|
||||||
|
@@ -10,7 +10,7 @@
|
|||||||
#import <Masonry/Masonry.h>
|
#import <Masonry/Masonry.h>
|
||||||
/// Tool
|
/// Tool
|
||||||
#import "YMMacro.h"
|
#import "YMMacro.h"
|
||||||
#import "ThemeColor.h"
|
#import "MEWThemeColor.h"
|
||||||
|
|
||||||
@interface YMHomeFilterView()
|
@interface YMHomeFilterView()
|
||||||
@property (nonatomic, copy) NSArray *datas;
|
@property (nonatomic, copy) NSArray *datas;
|
||||||
@@ -71,7 +71,7 @@ static NSInteger targetIndex = 0;
|
|||||||
CGFloat margin = (107 - 3 * 28 - 2 * 6.0)/2;
|
CGFloat margin = (107 - 3 * 28 - 2 * 6.0)/2;
|
||||||
for (int i = 0; i < self.datas.count; i++) {
|
for (int i = 0; i < self.datas.count; i++) {
|
||||||
UIView *colorBgView = [[UIView alloc] init];
|
UIView *colorBgView = [[UIView alloc] init];
|
||||||
colorBgView.backgroundColor = i==targetIndex ? [ThemeColor colorWithHexString:@"#DCDDE0"] : UIColor.clearColor;
|
colorBgView.backgroundColor = i==targetIndex ? [MEWThemeColor mewColorWithHexString:@"#DCDDE0"] : UIColor.clearColor;
|
||||||
colorBgView.tag = i;
|
colorBgView.tag = i;
|
||||||
colorBgView.layer.cornerRadius = 6;
|
colorBgView.layer.cornerRadius = 6;
|
||||||
colorBgView.layer.masksToBounds = YES;
|
colorBgView.layer.masksToBounds = YES;
|
||||||
@@ -88,7 +88,7 @@ static NSInteger targetIndex = 0;
|
|||||||
|
|
||||||
UILabel *titleLabel = [[UILabel alloc] init];
|
UILabel *titleLabel = [[UILabel alloc] init];
|
||||||
titleLabel.text = self.datas[i];
|
titleLabel.text = self.datas[i];
|
||||||
titleLabel.textColor = [ThemeColor colorWithHexString:@"#1F1B4F"];
|
titleLabel.textColor = [MEWThemeColor mewColorWithHexString:@"#1F1B4F"];
|
||||||
titleLabel.font = kFontMedium(12);
|
titleLabel.font = kFontMedium(12);
|
||||||
titleLabel.textAlignment = NSTextAlignmentCenter;
|
titleLabel.textAlignment = NSTextAlignmentCenter;
|
||||||
[colorBgView addSubview:titleLabel];
|
[colorBgView addSubview:titleLabel];
|
||||||
|
@@ -18,11 +18,11 @@
|
|||||||
#import <Masonry/Masonry.h>
|
#import <Masonry/Masonry.h>
|
||||||
///Tool
|
///Tool
|
||||||
#import "YMMacro.h"
|
#import "YMMacro.h"
|
||||||
#import "ThemeColor.h"
|
#import "MEWThemeColor.h"
|
||||||
#import "YMHUDTool.h"
|
#import "MewHUDTool.h"
|
||||||
#import "UIImage+Utils.h"
|
#import "UIImage+Utils.h"
|
||||||
#import "YMConstant.h"
|
#import "YMConstant.h"
|
||||||
#import "GCDHelper.h"
|
#import "MEWGCDHelper.h"
|
||||||
#import "Base.h"
|
#import "Base.h"
|
||||||
#import "AccountInfoStorage.h"
|
#import "AccountInfoStorage.h"
|
||||||
#import "Api+Login.h"
|
#import "Api+Login.h"
|
||||||
@@ -117,12 +117,6 @@ typedef NS_ENUM(NSUInteger, XYLoginType) {
|
|||||||
[self.view addSubview:self.otherLoginTitleLabel];
|
[self.view addSubview:self.otherLoginTitleLabel];
|
||||||
[self.view addSubview:self.appleButtonView];
|
[self.view addSubview:self.appleButtonView];
|
||||||
|
|
||||||
// [self.stackView addArrangedSubview:self.qqButtonView];
|
|
||||||
// [self.stackView addArrangedSubview:self.phoneButtonView];
|
|
||||||
//// [self.stackView addArrangedSubview:self.wxButtonView];
|
|
||||||
//#if __IPHONE_OS_VERSION_MAX_ALLOWED >= 130000
|
|
||||||
// [self.stackView addArrangedSubview:self.appleButton];
|
|
||||||
//#endif
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -266,7 +260,7 @@ typedef NS_ENUM(NSUInteger, XYLoginType) {
|
|||||||
#pragma mark - Event Response
|
#pragma mark - Event Response
|
||||||
- (void)loginButtonAction:(UIButton *)sender {
|
- (void)loginButtonAction:(UIButton *)sender {
|
||||||
if (!self.agreeButton.isSelected) {
|
if (!self.agreeButton.isSelected) {
|
||||||
[YMHUDTool showErrorWithMessage:@"请勾选协议"];
|
[MewHUDTool showErrorWithMessage:@"请勾选协议"];
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -295,7 +289,7 @@ typedef NS_ENUM(NSUInteger, XYLoginType) {
|
|||||||
/// 苹果登录
|
/// 苹果登录
|
||||||
- (void)loginWithApple {
|
- (void)loginWithApple {
|
||||||
if (!self.agreeButton.isSelected) {
|
if (!self.agreeButton.isSelected) {
|
||||||
[YMHUDTool showErrorWithMessage:@"请勾选协议"];
|
[MewHUDTool showErrorWithMessage:@"请勾选协议"];
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -334,7 +328,7 @@ typedef NS_ENUM(NSUInteger, XYLoginType) {
|
|||||||
/// 手机 || 密码登录 || Apple
|
/// 手机 || 密码登录 || Apple
|
||||||
//- (void)didClickRecognizer:(UITapGestureRecognizer *)tap {
|
//- (void)didClickRecognizer:(UITapGestureRecognizer *)tap {
|
||||||
// if (!self.agreeButton.isSelected) {
|
// if (!self.agreeButton.isSelected) {
|
||||||
// [YMHUDTool showErrorWithMessage:@"请勾选协议"];
|
// [MewHUDTool showErrorWithMessage:@"请勾选协议"];
|
||||||
// return;
|
// return;
|
||||||
// }
|
// }
|
||||||
//
|
//
|
||||||
@@ -371,7 +365,7 @@ typedef NS_ENUM(NSUInteger, XYLoginType) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
[AccountInfoStorage instance].thirdUserInfo = userInfo;
|
[AccountInfoStorage instance].thirdUserInfo = userInfo;
|
||||||
[YMHUDTool showLoadingWithMessage:@"正在登录中"];
|
[MewHUDTool showLoadingWithMessage:@"正在登录中"];
|
||||||
[self.presenter thirdLoginWithApple:identityToken unionId:userID];
|
[self.presenter thirdLoginWithApple:identityToken unionId:userID];
|
||||||
// [Api loginWithThirdPart:^(BaseModel * _Nonnull data, NSInteger code, NSString * _Nonnull msg) {
|
// [Api loginWithThirdPart:^(BaseModel * _Nonnull data, NSInteger code, NSString * _Nonnull msg) {
|
||||||
//
|
//
|
||||||
@@ -441,12 +435,12 @@ typedef NS_ENUM(NSUInteger, XYLoginType) {
|
|||||||
[_loginButton setTitleColor:UIColor.whiteColor forState:UIControlStateNormal];
|
[_loginButton setTitleColor:UIColor.whiteColor forState:UIControlStateNormal];
|
||||||
_loginButton.titleLabel.font = kFontMedium(16);
|
_loginButton.titleLabel.font = kFontMedium(16);
|
||||||
_loginButton.titleLabel.font = [UIFont fontWithName:@"PingFang-SC-Medium" size:18];
|
_loginButton.titleLabel.font = [UIFont fontWithName:@"PingFang-SC-Medium" size:18];
|
||||||
UIImage *bgImage = [UIImage gradientColorImageFromColors:@[[ThemeColor colorWithHexString:@"#FF60FD"],
|
UIImage *bgImage = [UIImage gradientColorImageFromColors:@[[MEWThemeColor mewColorWithHexString:@"#FF60FD"],
|
||||||
[ThemeColor colorWithHexString:@"##8974FF"],
|
[MEWThemeColor mewColorWithHexString:@"##8974FF"],
|
||||||
[ThemeColor colorWithHexString:@"#69EBFF"]] gradientType:GradientTypeLeftToRight imgSize:CGSizeMake(KScreenWidth - 80, 52)];
|
[MEWThemeColor mewColorWithHexString:@"#69EBFF"]] gradientType:GradientTypeLeftToRight imgSize:CGSizeMake(KScreenWidth - 80, 52)];
|
||||||
_loginButton.backgroundColor = [UIColor colorWithPatternImage:bgImage];
|
_loginButton.backgroundColor = [UIColor colorWithPatternImage:bgImage];
|
||||||
// [_loginButton setTitleColor:ThemeColor.mainTextColor forState:UIControlStateNormal];
|
// [_loginButton setTitleColor:ThemeColor.mewMainTextColor forState:UIControlStateNormal];
|
||||||
// UIImage *image = [UIImage gradientColorImageFromColors:@[[ThemeColor confirmButtonGradientStartColor],[ThemeColor confirmButtonGradientEndColor]] gradientType:GradientTypeLeftToRight imgSize:CGSizeMake(KScreenWidth - 52 * 2, 45)];
|
// UIImage *image = [UIImage gradientColorImageFromColors:@[[MEWThemeColor mewConfirmButtonGradientStartColor],[MEWThemeColor mewConfirmButtonGradientEndColor]] gradientType:GradientTypeLeftToRight imgSize:CGSizeMake(KScreenWidth - 52 * 2, 45)];
|
||||||
// [_loginButton setBackgroundImage:image forState:UIControlStateNormal];
|
// [_loginButton setBackgroundImage:image forState:UIControlStateNormal];
|
||||||
[_loginButton addTarget:self action:@selector(loginButtonAction:) forControlEvents:UIControlEventTouchUpInside];
|
[_loginButton addTarget:self action:@selector(loginButtonAction:) forControlEvents:UIControlEventTouchUpInside];
|
||||||
}
|
}
|
||||||
@@ -483,7 +477,7 @@ typedef NS_ENUM(NSUInteger, XYLoginType) {
|
|||||||
|
|
||||||
- (NSMutableAttributedString *)privacyAttributedStr{
|
- (NSMutableAttributedString *)privacyAttributedStr{
|
||||||
NSMutableAttributedString *attString = [[NSMutableAttributedString alloc] initWithString:@"同意"];
|
NSMutableAttributedString *attString = [[NSMutableAttributedString alloc] initWithString:@"同意"];
|
||||||
attString.yy_color = UIColorRGBAlpha(0xFFFFFF, 0.8);
|
attString.yy_color = UIColorMewRGBAlpha(0xFFFFFF, 0.8);
|
||||||
NSString *userString = @"《用户服务协议》";
|
NSString *userString = @"《用户服务协议》";
|
||||||
NSMutableAttributedString *userAttString = [[NSMutableAttributedString alloc] initWithString:userString attributes:@{NSForegroundColorAttributeName:UIColor.whiteColor}];
|
NSMutableAttributedString *userAttString = [[NSMutableAttributedString alloc] initWithString:userString attributes:@{NSForegroundColorAttributeName:UIColor.whiteColor}];
|
||||||
__weak typeof(self) weakSelf = self;
|
__weak typeof(self) weakSelf = self;
|
||||||
@@ -496,7 +490,7 @@ typedef NS_ENUM(NSUInteger, XYLoginType) {
|
|||||||
} longPressAction:nil];
|
} longPressAction:nil];
|
||||||
|
|
||||||
NSMutableAttributedString *andString = [[NSMutableAttributedString alloc] initWithString:@"和"];
|
NSMutableAttributedString *andString = [[NSMutableAttributedString alloc] initWithString:@"和"];
|
||||||
andString.yy_color = UIColorRGBAlpha(0xFFFFFF, 0.8);
|
andString.yy_color = UIColorMewRGBAlpha(0xFFFFFF, 0.8);
|
||||||
NSString *protocolString = @"《隐私政策》";
|
NSString *protocolString = @"《隐私政策》";
|
||||||
NSMutableAttributedString *privateString = [[NSMutableAttributedString alloc] initWithString:protocolString attributes:@{NSForegroundColorAttributeName:UIColor.whiteColor}];
|
NSMutableAttributedString *privateString = [[NSMutableAttributedString alloc] initWithString:protocolString attributes:@{NSForegroundColorAttributeName:UIColor.whiteColor}];
|
||||||
[privateString yy_setTextHighlightRange:NSMakeRange(0, privateString.length) color:nil backgroundColor:nil userInfo:nil tapAction:^(UIView * _Nonnull containerView, NSAttributedString * _Nonnull text, NSRange range, CGRect rect) {
|
[privateString yy_setTextHighlightRange:NSMakeRange(0, privateString.length) color:nil backgroundColor:nil userInfo:nil tapAction:^(UIView * _Nonnull containerView, NSAttributedString * _Nonnull text, NSRange range, CGRect rect) {
|
||||||
|
@@ -10,8 +10,8 @@
|
|||||||
#import <Masonry/Masonry.h>
|
#import <Masonry/Masonry.h>
|
||||||
#import <ReactiveObjC/ReactiveObjC.h>
|
#import <ReactiveObjC/ReactiveObjC.h>
|
||||||
/// Tool
|
/// Tool
|
||||||
#import "ThemeColor.h"
|
#import "MEWThemeColor.h"
|
||||||
#import "YMHUDTool.h"
|
#import "MewHUDTool.h"
|
||||||
#import "UIImage+Utils.h"
|
#import "UIImage+Utils.h"
|
||||||
#import "YMConstant.h"
|
#import "YMConstant.h"
|
||||||
#import "YMMacro.h"
|
#import "YMMacro.h"
|
||||||
@@ -53,7 +53,7 @@
|
|||||||
|
|
||||||
#pragma mark - LoginPasswordProtocol
|
#pragma mark - LoginPasswordProtocol
|
||||||
- (void)phoneAndPasswordLoginSuccess {
|
- (void)phoneAndPasswordLoginSuccess {
|
||||||
[YMHUDTool showSuccessWithMessage:@"登录成功"];
|
[MewHUDTool showSuccessWithMessage:@"登录成功"];
|
||||||
if (self.delegate) {
|
if (self.delegate) {
|
||||||
[self.delegate loginWithPasswordScuccess];
|
[self.delegate loginWithPasswordScuccess];
|
||||||
}
|
}
|
||||||
@@ -61,7 +61,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
- (void)phoneAndPasswordLoginFail:(NSString *)error {
|
- (void)phoneAndPasswordLoginFail:(NSString *)error {
|
||||||
[YMHUDTool showErrorWithMessage:error];
|
[MewHUDTool showErrorWithMessage:error];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -69,12 +69,12 @@
|
|||||||
/// 登录
|
/// 登录
|
||||||
- (void)nextButtonAction {
|
- (void)nextButtonAction {
|
||||||
if (self.phoneView.textField.text.length == 0 || [self.phoneView.textField.text isEqualToString:@""]) {
|
if (self.phoneView.textField.text.length == 0 || [self.phoneView.textField.text isEqualToString:@""]) {
|
||||||
[YMHUDTool showErrorWithMessage:@"请输入账号"];
|
[MewHUDTool showErrorWithMessage:@"请输入账号"];
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (self.codeView.textField.text.length == 0 || [self.codeView.textField.text isEqualToString:@""]) {
|
if (self.codeView.textField.text.length == 0 || [self.codeView.textField.text isEqualToString:@""]) {
|
||||||
[YMHUDTool showErrorWithMessage:@"请输入密码"];
|
[MewHUDTool showErrorWithMessage:@"请输入密码"];
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -144,7 +144,7 @@
|
|||||||
[_nextButton setImage:[UIImage imageNamed:@"mew_login_next"] forState:UIControlStateNormal];
|
[_nextButton setImage:[UIImage imageNamed:@"mew_login_next"] forState:UIControlStateNormal];
|
||||||
_nextButton.titleLabel.font = [UIFont fontWithName:@"PingFang-SC-Medium" size:18];
|
_nextButton.titleLabel.font = [UIFont fontWithName:@"PingFang-SC-Medium" size:18];
|
||||||
[_nextButton setTitleColor:UIColor.blackColor forState:UIControlStateNormal];
|
[_nextButton setTitleColor:UIColor.blackColor forState:UIControlStateNormal];
|
||||||
UIImage *image = [UIImage gradientColorImageFromColors:@[[ThemeColor colorWithHexString:@"#FF60FD"], [ThemeColor colorWithHexString:@"#8974FF"],[ThemeColor colorWithHexString:@"#69EBFF"]] gradientType:GradientTypeLeftToRight imgSize:CGSizeMake(KScreenWidth - 2*36, 52)];
|
UIImage *image = [UIImage gradientColorImageFromColors:@[[MEWThemeColor mewColorWithHexString:@"#FF60FD"], [MEWThemeColor mewColorWithHexString:@"#8974FF"],[MEWThemeColor mewColorWithHexString:@"#69EBFF"]] gradientType:GradientTypeLeftToRight imgSize:CGSizeMake(KScreenWidth - 2*36, 52)];
|
||||||
_nextButton.backgroundColor = [UIColor colorWithPatternImage:image];
|
_nextButton.backgroundColor = [UIColor colorWithPatternImage:image];
|
||||||
[_nextButton addTarget:self action:@selector(nextButtonAction) forControlEvents:UIControlEventTouchUpInside];
|
[_nextButton addTarget:self action:@selector(nextButtonAction) forControlEvents:UIControlEventTouchUpInside];
|
||||||
}
|
}
|
||||||
@@ -157,7 +157,7 @@
|
|||||||
if (!_forgetPasswordButton) {
|
if (!_forgetPasswordButton) {
|
||||||
_forgetPasswordButton = [UIButton buttonWithType:UIButtonTypeCustom];
|
_forgetPasswordButton = [UIButton buttonWithType:UIButtonTypeCustom];
|
||||||
[_forgetPasswordButton setTitle:@"忘记密码?" forState:UIControlStateNormal];
|
[_forgetPasswordButton setTitle:@"忘记密码?" forState:UIControlStateNormal];
|
||||||
[_forgetPasswordButton setTitleColor:UIColorRGBAlpha(0xFFFFFF, 0.8) forState:UIControlStateNormal];
|
[_forgetPasswordButton setTitleColor:UIColorMewRGBAlpha(0xFFFFFF, 0.8) forState:UIControlStateNormal];
|
||||||
_forgetPasswordButton.titleLabel.font = [UIFont fontWithName:@"PingFang-SC-Regular" size:14];
|
_forgetPasswordButton.titleLabel.font = [UIFont fontWithName:@"PingFang-SC-Regular" size:14];
|
||||||
// _forgetPasswordButton.hidden = NO;
|
// _forgetPasswordButton.hidden = NO;
|
||||||
[_forgetPasswordButton addTarget:self action:@selector(forgetPasswordButtonAction) forControlEvents:UIControlEventTouchUpInside];
|
[_forgetPasswordButton addTarget:self action:@selector(forgetPasswordButtonAction) forControlEvents:UIControlEventTouchUpInside];
|
||||||
|
@@ -14,9 +14,9 @@
|
|||||||
///Protocole
|
///Protocole
|
||||||
#import "LoginVerifCodeProtocol.h"
|
#import "LoginVerifCodeProtocol.h"
|
||||||
/// Tool
|
/// Tool
|
||||||
#import "ThemeColor.h"
|
#import "MEWThemeColor.h"
|
||||||
#import "YMMacro.h"
|
#import "YMMacro.h"
|
||||||
#import "YMHUDTool.h"
|
#import "MewHUDTool.h"
|
||||||
#import "UIImage+Utils.h"
|
#import "UIImage+Utils.h"
|
||||||
/// View
|
/// View
|
||||||
#import "LoginInputView.h"
|
#import "LoginInputView.h"
|
||||||
@@ -67,14 +67,14 @@
|
|||||||
#pragma mark - LoginVerifCodeProtocol
|
#pragma mark - LoginVerifCodeProtocol
|
||||||
/// 获取验证码成功
|
/// 获取验证码成功
|
||||||
- (void)phoneSmsCodeSuccess {
|
- (void)phoneSmsCodeSuccess {
|
||||||
[YMHUDTool showErrorWithMessage:[NSString stringWithFormat:@"验证码已发送\n+86 %@", self.phone]];
|
[MewHUDTool showErrorWithMessage:[NSString stringWithFormat:@"验证码已发送\n+86 %@", self.phone]];
|
||||||
/// 开启定时器
|
/// 开启定时器
|
||||||
[self openCountdownWithTime:60];
|
[self openCountdownWithTime:60];
|
||||||
}
|
}
|
||||||
|
|
||||||
/// 登录成功
|
/// 登录成功
|
||||||
- (void)loginWithPhoneSuccess {
|
- (void)loginWithPhoneSuccess {
|
||||||
[YMHUDTool showSuccessWithMessage:@"登录成功"];
|
[MewHUDTool showSuccessWithMessage:@"登录成功"];
|
||||||
[self stopCountDown];
|
[self stopCountDown];
|
||||||
if (self.delegate) {
|
if (self.delegate) {
|
||||||
[self.delegate loginWithPhoneSuccess];
|
[self.delegate loginWithPhoneSuccess];
|
||||||
@@ -92,7 +92,7 @@
|
|||||||
/// 获取验证码
|
/// 获取验证码
|
||||||
- (void)getSmsCodeButtonAction {
|
- (void)getSmsCodeButtonAction {
|
||||||
if (self.phone.length < 11 || self.phone == nil) {
|
if (self.phone.length < 11 || self.phone == nil) {
|
||||||
[YMHUDTool showErrorWithMessage:@"请输入手机号码"];
|
[MewHUDTool showErrorWithMessage:@"请输入手机号码"];
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -247,7 +247,7 @@
|
|||||||
- (LoginInputView *)phoneInputView {
|
- (LoginInputView *)phoneInputView {
|
||||||
if (!_phoneInputView) {
|
if (!_phoneInputView) {
|
||||||
_phoneInputView = [[LoginInputView alloc] init];
|
_phoneInputView = [[LoginInputView alloc] init];
|
||||||
_phoneInputView.backgroundColor = [ThemeColor colorWithHexString:@"#F8F8FB"];
|
_phoneInputView.backgroundColor = [MEWThemeColor mewColorWithHexString:@"#F8F8FB"];
|
||||||
_phoneInputView.layer.cornerRadius = 51.0/2;
|
_phoneInputView.layer.cornerRadius = 51.0/2;
|
||||||
_phoneInputView.layer.masksToBounds = YES;
|
_phoneInputView.layer.masksToBounds = YES;
|
||||||
_phoneInputView.maxLength = 11;
|
_phoneInputView.maxLength = 11;
|
||||||
@@ -270,13 +270,13 @@
|
|||||||
- (UITextField *)codeTextField {
|
- (UITextField *)codeTextField {
|
||||||
if (!_codeTextField) {
|
if (!_codeTextField) {
|
||||||
_codeTextField = [[UITextField alloc] init];
|
_codeTextField = [[UITextField alloc] init];
|
||||||
_codeTextField.textColor = [ThemeColor mainTextColor];
|
_codeTextField.textColor = [MEWThemeColor mewMainTextColor];
|
||||||
_codeTextField.font = [UIFont systemFontOfSize:18.f];
|
_codeTextField.font = [UIFont systemFontOfSize:18.f];
|
||||||
_codeTextField.keyboardType = UIKeyboardTypeNumberPad;
|
_codeTextField.keyboardType = UIKeyboardTypeNumberPad;
|
||||||
_codeTextField.tintColor = [ThemeColor mainTextColor];
|
_codeTextField.tintColor = [MEWThemeColor mewMainTextColor];
|
||||||
_codeTextField.backgroundColor = [UIColor clearColor];
|
_codeTextField.backgroundColor = [UIColor clearColor];
|
||||||
[_codeTextField addTarget:self action:@selector(textFieldDidChange:) forControlEvents:UIControlEventEditingChanged];
|
[_codeTextField addTarget:self action:@selector(textFieldDidChange:) forControlEvents:UIControlEventEditingChanged];
|
||||||
_codeTextField.attributedPlaceholder = [[NSAttributedString alloc] initWithString:@"请输入验证码" attributes:@{NSForegroundColorAttributeName: [ThemeColor secondTextColor], NSFontAttributeName:[UIFont systemFontOfSize:14]}];
|
_codeTextField.attributedPlaceholder = [[NSAttributedString alloc] initWithString:@"请输入验证码" attributes:@{NSForegroundColorAttributeName: [MEWThemeColor mewSecondTextColor], NSFontAttributeName:[UIFont systemFontOfSize:14]}];
|
||||||
}
|
}
|
||||||
return _codeTextField;
|
return _codeTextField;
|
||||||
}
|
}
|
||||||
@@ -286,7 +286,7 @@
|
|||||||
_cutdownLabel = [[UILabel alloc] init];
|
_cutdownLabel = [[UILabel alloc] init];
|
||||||
_cutdownLabel.textAlignment = NSTextAlignmentCenter;
|
_cutdownLabel.textAlignment = NSTextAlignmentCenter;
|
||||||
_cutdownLabel.font = [UIFont boldSystemFontOfSize:11];
|
_cutdownLabel.font = [UIFont boldSystemFontOfSize:11];
|
||||||
_cutdownLabel.textColor = [ThemeColor secondTextColor];
|
_cutdownLabel.textColor = [MEWThemeColor mewSecondTextColor];
|
||||||
_cutdownLabel.hidden = YES;
|
_cutdownLabel.hidden = YES;
|
||||||
}
|
}
|
||||||
return _cutdownLabel;
|
return _cutdownLabel;
|
||||||
@@ -297,7 +297,7 @@
|
|||||||
if (!_retryCodeButton) {
|
if (!_retryCodeButton) {
|
||||||
_retryCodeButton = [UIButton buttonWithType:UIButtonTypeCustom];
|
_retryCodeButton = [UIButton buttonWithType:UIButtonTypeCustom];
|
||||||
[_retryCodeButton setTitle:@"获取验证码" forState:UIControlStateNormal];
|
[_retryCodeButton setTitle:@"获取验证码" forState:UIControlStateNormal];
|
||||||
[_retryCodeButton setTitleColor:[ThemeColor colorWithHexString:@"#9552FF"] forState:UIControlStateNormal];
|
[_retryCodeButton setTitleColor:[MEWThemeColor mewColorWithHexString:@"#9552FF"] forState:UIControlStateNormal];
|
||||||
_retryCodeButton.titleLabel.font = [UIFont systemFontOfSize:11 weight:UIFontWeightMedium];
|
_retryCodeButton.titleLabel.font = [UIFont systemFontOfSize:11 weight:UIFontWeightMedium];
|
||||||
[_retryCodeButton addTarget:self action:@selector(getSmsCodeButtonAction) forControlEvents:UIControlEventTouchUpInside];
|
[_retryCodeButton addTarget:self action:@selector(getSmsCodeButtonAction) forControlEvents:UIControlEventTouchUpInside];
|
||||||
_retryCodeButton.hidden = NO;
|
_retryCodeButton.hidden = NO;
|
||||||
@@ -314,7 +314,7 @@
|
|||||||
_confirmButton.layer.cornerRadius = 52/2.f;
|
_confirmButton.layer.cornerRadius = 52/2.f;
|
||||||
[_confirmButton setImage:[UIImage imageNamed:@"mew_login_next"] forState:UIControlStateNormal];
|
[_confirmButton setImage:[UIImage imageNamed:@"mew_login_next"] forState:UIControlStateNormal];
|
||||||
_confirmButton.titleLabel.font = [UIFont fontWithName:@"PingFang-SC-Medium" size:18];
|
_confirmButton.titleLabel.font = [UIFont fontWithName:@"PingFang-SC-Medium" size:18];
|
||||||
UIImage *image = [UIImage gradientColorImageFromColors:@[[ThemeColor colorWithHexString:@"#FF60FD"], [ThemeColor colorWithHexString:@"#8974FF"],[ThemeColor colorWithHexString:@"#69EBFF"]] gradientType:GradientTypeLeftToRight imgSize:CGSizeMake(KScreenWidth - 2*36, 52)];
|
UIImage *image = [UIImage gradientColorImageFromColors:@[[MEWThemeColor mewColorWithHexString:@"#FF60FD"], [MEWThemeColor mewColorWithHexString:@"#8974FF"],[MEWThemeColor mewColorWithHexString:@"#69EBFF"]] gradientType:GradientTypeLeftToRight imgSize:CGSizeMake(KScreenWidth - 2*36, 52)];
|
||||||
_confirmButton.backgroundColor = [UIColor colorWithPatternImage:image];
|
_confirmButton.backgroundColor = [UIColor colorWithPatternImage:image];
|
||||||
[_confirmButton setTitleColor:UIColor.whiteColor forState:UIControlStateNormal];
|
[_confirmButton setTitleColor:UIColor.whiteColor forState:UIControlStateNormal];
|
||||||
[_confirmButton addTarget:self action:@selector(confirmButtonAction) forControlEvents:UIControlEventTouchUpInside];
|
[_confirmButton addTarget:self action:@selector(confirmButtonAction) forControlEvents:UIControlEventTouchUpInside];
|
||||||
|
@@ -14,9 +14,9 @@
|
|||||||
/// Tool
|
/// Tool
|
||||||
#import "ClientConfig.h"
|
#import "ClientConfig.h"
|
||||||
#import "NetImageView.h"
|
#import "NetImageView.h"
|
||||||
#import "ThemeColor.h"
|
#import "MEWThemeColor.h"
|
||||||
#import "NIMMessageUtils.h"
|
#import "NIMMessageUtils.h"
|
||||||
#import "TimeIntervalUtils.h"
|
#import "MewTimeIntervalUtils.h"
|
||||||
#import "UIView+NIM.h"
|
#import "UIView+NIM.h"
|
||||||
#import "UIView+FilletCorner.h"
|
#import "UIView+FilletCorner.h"
|
||||||
#import "YMMacro.h"
|
#import "YMMacro.h"
|
||||||
@@ -53,10 +53,10 @@
|
|||||||
|
|
||||||
/// 时间处理
|
/// 时间处理
|
||||||
if (recent.lastMessage) {
|
if (recent.lastMessage) {
|
||||||
self.timeLabel.text = [TimeIntervalUtils showTime:recent.lastMessage.timestamp showDetail:NO];
|
self.timeLabel.text = [MewTimeIntervalUtils mewShowTime:recent.lastMessage.timestamp showDetail:NO];
|
||||||
} else {
|
} else {
|
||||||
NSTimeInterval timeSecond = recent.updateTime / 1000.0;
|
NSTimeInterval timeSecond = recent.updateTime / 1000.0;
|
||||||
self.timeLabel.text = [TimeIntervalUtils showTime:timeSecond showDetail:NO];
|
self.timeLabel.text = [MewTimeIntervalUtils mewShowTime:timeSecond showDetail:NO];
|
||||||
}
|
}
|
||||||
[self.timeLabel sizeToFit];
|
[self.timeLabel sizeToFit];
|
||||||
|
|
||||||
@@ -158,7 +158,7 @@
|
|||||||
if (!_containerView) {
|
if (!_containerView) {
|
||||||
_containerView = [[UIView alloc] init];
|
_containerView = [[UIView alloc] init];
|
||||||
[_containerView setCornerWithLeftTopCorner:36 rightTopCorner:10 bottomLeftCorner:36 bottomRightCorner:10 size:CGSizeMake(KScreenWidth - 32, 72)];
|
[_containerView setCornerWithLeftTopCorner:36 rightTopCorner:10 bottomLeftCorner:36 bottomRightCorner:10 size:CGSizeMake(KScreenWidth - 32, 72)];
|
||||||
_containerView.backgroundColor = UIColorFromRGB(0x525566);
|
_containerView.backgroundColor = UIColorMewFromRGB(0x525566);
|
||||||
}
|
}
|
||||||
|
|
||||||
return _containerView;
|
return _containerView;
|
||||||
@@ -195,7 +195,7 @@
|
|||||||
_messageLabel = [[UILabel alloc] initWithFrame:CGRectZero];
|
_messageLabel = [[UILabel alloc] initWithFrame:CGRectZero];
|
||||||
_messageLabel.backgroundColor = [UIColor clearColor];
|
_messageLabel.backgroundColor = [UIColor clearColor];
|
||||||
_messageLabel.font = [UIFont systemFontOfSize:14.f];
|
_messageLabel.font = [UIFont systemFontOfSize:14.f];
|
||||||
_messageLabel.textColor = UIColorRGBAlpha(0xFFFFFF, 0.8);
|
_messageLabel.textColor = UIColorMewRGBAlpha(0xFFFFFF, 0.8);
|
||||||
_messageLabel.text = @"用户回复信息内容";
|
_messageLabel.text = @"用户回复信息内容";
|
||||||
}
|
}
|
||||||
return _messageLabel;
|
return _messageLabel;
|
||||||
|
@@ -10,8 +10,7 @@
|
|||||||
#import "YMEmptyTableViewCell.h"
|
#import "YMEmptyTableViewCell.h"
|
||||||
/// Tool
|
/// Tool
|
||||||
#import "YMMacro.h"
|
#import "YMMacro.h"
|
||||||
#import "ThemeColor.h"
|
#import "MEWThemeColor.h"
|
||||||
#import "NSArray+Safe.h"
|
|
||||||
/// Third
|
/// Third
|
||||||
#import <MJRefresh/MJRefresh.h>
|
#import <MJRefresh/MJRefresh.h>
|
||||||
///P
|
///P
|
||||||
@@ -78,12 +77,12 @@
|
|||||||
MJRefreshNormalHeader *header = [MJRefreshNormalHeader headerWithRefreshingTarget:self refreshingAction:@selector(headerRefresh)];
|
MJRefreshNormalHeader *header = [MJRefreshNormalHeader headerWithRefreshingTarget:self refreshingAction:@selector(headerRefresh)];
|
||||||
header.stateLabel.font = [UIFont systemFontOfSize:10.0];
|
header.stateLabel.font = [UIFont systemFontOfSize:10.0];
|
||||||
header.lastUpdatedTimeLabel.font = [UIFont systemFontOfSize:10.0];
|
header.lastUpdatedTimeLabel.font = [UIFont systemFontOfSize:10.0];
|
||||||
header.stateLabel.textColor = [ThemeColor secondTextColor];
|
header.stateLabel.textColor = [MEWThemeColor mewSecondTextColor];
|
||||||
header.lastUpdatedTimeLabel.textColor = [ThemeColor secondTextColor];
|
header.lastUpdatedTimeLabel.textColor = [MEWThemeColor mewSecondTextColor];
|
||||||
self.collectionTableView.mj_header = header;
|
self.collectionTableView.mj_header = header;
|
||||||
|
|
||||||
MJRefreshBackNormalFooter *footer = [MJRefreshBackNormalFooter footerWithRefreshingTarget:self refreshingAction:@selector(footerRefresh)];
|
MJRefreshBackNormalFooter *footer = [MJRefreshBackNormalFooter footerWithRefreshingTarget:self refreshingAction:@selector(footerRefresh)];
|
||||||
footer.stateLabel.textColor = [ThemeColor secondTextColor];
|
footer.stateLabel.textColor = [MEWThemeColor mewSecondTextColor];
|
||||||
footer.stateLabel.font = [UIFont systemFontOfSize:10.0];
|
footer.stateLabel.font = [UIFont systemFontOfSize:10.0];
|
||||||
self.collectionTableView.mj_footer = footer;
|
self.collectionTableView.mj_footer = footer;
|
||||||
|
|
||||||
|
@@ -13,10 +13,10 @@
|
|||||||
#import <Masonry/Masonry.h>
|
#import <Masonry/Masonry.h>
|
||||||
#import <YYText/YYText.h>
|
#import <YYText/YYText.h>
|
||||||
/// Tool
|
/// Tool
|
||||||
#import "ThemeColor.h"
|
#import "MEWThemeColor.h"
|
||||||
#import "YMMacro.h"
|
#import "YMMacro.h"
|
||||||
#import "UIImage+Utils.h"
|
#import "UIImage+Utils.h"
|
||||||
#import "YMHUDTool.h"
|
#import "MewHUDTool.h"
|
||||||
|
|
||||||
@interface MewRechargeSubView()
|
@interface MewRechargeSubView()
|
||||||
//余额
|
//余额
|
||||||
@@ -54,7 +54,7 @@
|
|||||||
- (void)rechargeButtonAction {
|
- (void)rechargeButtonAction {
|
||||||
//立即充值
|
//立即充值
|
||||||
if (self.selectModel == nil) {
|
if (self.selectModel == nil) {
|
||||||
[YMHUDTool showErrorWithMessage:@"请选择充值的钻石"];
|
[MewHUDTool showErrorWithMessage:@"请选择充值的钻石"];
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -71,7 +71,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
UIView *currentRechargeView = tap.view;
|
UIView *currentRechargeView = tap.view;
|
||||||
currentRechargeView.layer.borderColor = [ThemeColor colorWithHexString:@"#9552FF"].CGColor;
|
currentRechargeView.layer.borderColor = [MEWThemeColor mewColorWithHexString:@"#9552FF"].CGColor;
|
||||||
currentRechargeView.layer.borderWidth = 1.0;
|
currentRechargeView.layer.borderWidth = 1.0;
|
||||||
|
|
||||||
NSInteger selectIndex = tap.view.tag - 100;
|
NSInteger selectIndex = tap.view.tag - 100;
|
||||||
@@ -116,7 +116,7 @@
|
|||||||
|
|
||||||
UIView *rechargeBgView = [[UIView alloc] init];
|
UIView *rechargeBgView = [[UIView alloc] init];
|
||||||
rechargeBgView.frame = CGRectMake((i%2 * (viewWidth + marginX)) + marginLeft, i/2 * (viewHeight + marginTop), viewWidth, viewHeight);
|
rechargeBgView.frame = CGRectMake((i%2 * (viewWidth + marginX)) + marginLeft, i/2 * (viewHeight + marginTop), viewWidth, viewHeight);
|
||||||
rechargeBgView.backgroundColor = UIColorRGBAlpha(0x525566, 0.8);
|
rechargeBgView.backgroundColor = UIColorMewRGBAlpha(0x525566, 0.8);
|
||||||
rechargeBgView.layer.cornerRadius = 8.0;
|
rechargeBgView.layer.cornerRadius = 8.0;
|
||||||
rechargeBgView.layer.masksToBounds = YES;
|
rechargeBgView.layer.masksToBounds = YES;
|
||||||
rechargeBgView.tag = i + 100;
|
rechargeBgView.tag = i + 100;
|
||||||
@@ -149,7 +149,7 @@
|
|||||||
|
|
||||||
UILabel *rechargeMoneyLabel = [[UILabel alloc] initWithFrame:CGRectMake(0, CGRectGetMaxY(rechargeStackView.frame) + 13.0, viewWidth, 20)];
|
UILabel *rechargeMoneyLabel = [[UILabel alloc] initWithFrame:CGRectMake(0, CGRectGetMaxY(rechargeStackView.frame) + 13.0, viewWidth, 20)];
|
||||||
rechargeMoneyLabel.text = [NSString stringWithFormat:@"%@元",model.money];
|
rechargeMoneyLabel.text = [NSString stringWithFormat:@"%@元",model.money];
|
||||||
rechargeMoneyLabel.textColor = UIColorRGBAlpha(0xFFFFFF, 0.8);
|
rechargeMoneyLabel.textColor = UIColorMewRGBAlpha(0xFFFFFF, 0.8);
|
||||||
rechargeMoneyLabel.font = kFontRegular(14);
|
rechargeMoneyLabel.font = kFontRegular(14);
|
||||||
rechargeMoneyLabel.textAlignment = NSTextAlignmentCenter;
|
rechargeMoneyLabel.textAlignment = NSTextAlignmentCenter;
|
||||||
[rechargeBgView addSubview:rechargeMoneyLabel];
|
[rechargeBgView addSubview:rechargeMoneyLabel];
|
||||||
@@ -262,10 +262,10 @@
|
|||||||
_rechargePrivacyLabel.numberOfLines = 0;
|
_rechargePrivacyLabel.numberOfLines = 0;
|
||||||
|
|
||||||
NSMutableAttributedString *attString = [[NSMutableAttributedString alloc] initWithString:@"已阅读并同意"];
|
NSMutableAttributedString *attString = [[NSMutableAttributedString alloc] initWithString:@"已阅读并同意"];
|
||||||
attString.yy_color = [ThemeColor secondTextColor];
|
attString.yy_color = [MEWThemeColor mewSecondTextColor];
|
||||||
attString.yy_font = [UIFont systemFontOfSize:13];
|
attString.yy_font = [UIFont systemFontOfSize:13];
|
||||||
|
|
||||||
NSMutableAttributedString *rechargeAttString = [[NSMutableAttributedString alloc] initWithString:@"《用户充值协议》\n" attributes:@{NSForegroundColorAttributeName:[ThemeColor colorWithHexString:@"#5DA4F5"]}];
|
NSMutableAttributedString *rechargeAttString = [[NSMutableAttributedString alloc] initWithString:@"《用户充值协议》\n" attributes:@{NSForegroundColorAttributeName:[MEWThemeColor mewColorWithHexString:@"#5DA4F5"]}];
|
||||||
@kWeakify(self);
|
@kWeakify(self);
|
||||||
[rechargeAttString yy_setTextHighlightRange:NSMakeRange(0, rechargeAttString.length) color:nil backgroundColor:nil userInfo:nil tapAction:^(UIView * _Nonnull containerView, NSAttributedString * _Nonnull text, NSRange range, CGRect rect) {
|
[rechargeAttString yy_setTextHighlightRange:NSMakeRange(0, rechargeAttString.length) color:nil backgroundColor:nil userInfo:nil tapAction:^(UIView * _Nonnull containerView, NSAttributedString * _Nonnull text, NSRange range, CGRect rect) {
|
||||||
@kStrongify(self);
|
@kStrongify(self);
|
||||||
@@ -277,7 +277,7 @@
|
|||||||
} longPressAction:nil];
|
} longPressAction:nil];
|
||||||
|
|
||||||
NSMutableAttributedString *serviceAttString = [[NSMutableAttributedString alloc] initWithString:@"如有任何问题请咨询客服"];
|
NSMutableAttributedString *serviceAttString = [[NSMutableAttributedString alloc] initWithString:@"如有任何问题请咨询客服"];
|
||||||
serviceAttString.yy_color = [ThemeColor secondTextColor];
|
serviceAttString.yy_color = [MEWThemeColor mewSecondTextColor];
|
||||||
serviceAttString.yy_font = [UIFont systemFontOfSize:13];
|
serviceAttString.yy_font = [UIFont systemFontOfSize:13];
|
||||||
|
|
||||||
[attString appendAttributedString:rechargeAttString];
|
[attString appendAttributedString:rechargeAttString];
|
||||||
@@ -296,9 +296,9 @@
|
|||||||
_rechargeButton.titleLabel.font = kFontMedium(16);
|
_rechargeButton.titleLabel.font = kFontMedium(16);
|
||||||
_rechargeButton.layer.cornerRadius = 24;
|
_rechargeButton.layer.cornerRadius = 24;
|
||||||
_rechargeButton.layer.masksToBounds = YES;
|
_rechargeButton.layer.masksToBounds = YES;
|
||||||
UIImage *image = [UIImage gradientColorImageFromColors:@[[ThemeColor colorWithHexString:@"#FF60FD"],
|
UIImage *image = [UIImage gradientColorImageFromColors:@[[MEWThemeColor mewColorWithHexString:@"#FF60FD"],
|
||||||
[ThemeColor colorWithHexString:@"#8974FF"],
|
[MEWThemeColor mewColorWithHexString:@"#8974FF"],
|
||||||
[ThemeColor colorWithHexString:@"#69EBFF"]
|
[MEWThemeColor mewColorWithHexString:@"#69EBFF"]
|
||||||
] gradientType:GradientTypeLeftToRight imgSize:CGSizeMake(KScreenWidth - 2*40, 48)];
|
] gradientType:GradientTypeLeftToRight imgSize:CGSizeMake(KScreenWidth - 2*40, 48)];
|
||||||
_rechargeButton.backgroundColor = [UIColor colorWithPatternImage:image];
|
_rechargeButton.backgroundColor = [UIColor colorWithPatternImage:image];
|
||||||
[_rechargeButton addTarget:self action:@selector(rechargeButtonAction) forControlEvents:UIControlEventTouchUpInside];
|
[_rechargeButton addTarget:self action:@selector(rechargeButtonAction) forControlEvents:UIControlEventTouchUpInside];
|
||||||
|
@@ -12,18 +12,18 @@
|
|||||||
/// Third
|
/// Third
|
||||||
#import <Masonry/Masonry.h>
|
#import <Masonry/Masonry.h>
|
||||||
#import "YMMacro.h"
|
#import "YMMacro.h"
|
||||||
#import "YMIAPHelper.h"
|
|
||||||
#import "AccountInfoStorage.h"
|
#import "AccountInfoStorage.h"
|
||||||
#import "RechargeListModel.h"
|
#import "RechargeListModel.h"
|
||||||
/// P
|
/// P
|
||||||
#import "MineRechargeProtocol.h"
|
#import "MineRechargeProtocol.h"
|
||||||
#import "MineRechargePresenter.h"
|
#import "MineRechargePresenter.h"
|
||||||
#import "YMHUDTool.h"
|
#import "MewHUDTool.h"
|
||||||
#import "yinmeng_ios-Swift.h"
|
#import "yinmeng_ios-Swift.h"
|
||||||
#import "RechargeStorage.h"
|
#import "MEWRechargeStorage.h"
|
||||||
#import "NewEncryptTool.h"
|
#import "NewEncryptTool.h"
|
||||||
|
|
||||||
@interface MewRechargeViewController ()<MineRechargeProtocol, MewRechargeSubViewDelegate, YMIAPHelperDelegate>
|
@interface MewRechargeViewController ()<MineRechargeProtocol, MewRechargeSubViewDelegate>
|
||||||
@property (nonatomic, strong) UIImageView *rechargeBgImageView;
|
@property (nonatomic, strong) UIImageView *rechargeBgImageView;
|
||||||
@property (nonatomic, strong) UIButton *backButton;
|
@property (nonatomic, strong) UIButton *backButton;
|
||||||
@property (nonatomic, strong) MewRechargeSubView *rechageView;
|
@property (nonatomic, strong) MewRechargeSubView *rechageView;
|
||||||
@@ -44,7 +44,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
- (void)dealloc {
|
- (void)dealloc {
|
||||||
[YMIAPHelper shareHelper].delegate = nil;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#pragma mark - Life Cycle
|
#pragma mark - Life Cycle
|
||||||
@@ -52,7 +52,7 @@
|
|||||||
[super viewDidLoad];
|
[super viewDidLoad];
|
||||||
[self initView];
|
[self initView];
|
||||||
[self loadData];
|
[self loadData];
|
||||||
[YMIAPHelper shareHelper].delegate = self;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -107,7 +107,7 @@
|
|||||||
};
|
};
|
||||||
//
|
//
|
||||||
} else {
|
} else {
|
||||||
[YMHUDTool hideHUDInView:kWindow];
|
[MewHUDTool hideHUDInView:kWindow];
|
||||||
[self showErrorToast:@"充值失败。当前仅支持运行iOS15及以上系统的手机进行充值,请升级系统版本后重试。"];
|
[self showErrorToast:@"充值失败。当前仅支持运行iOS15及以上系统的手机进行充值,请升级系统版本后重试。"];
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -116,7 +116,7 @@
|
|||||||
|
|
||||||
}else{
|
}else{
|
||||||
|
|
||||||
[YMHUDTool hideHUDInView:kWindow];
|
[MewHUDTool hideHUDInView:kWindow];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -131,10 +131,10 @@
|
|||||||
if (status == MewStoreConditionResultMewPay || status == MewStoreConditionResultMewStart || status == MewStoreConditionResultMewVerifiedServer) {
|
if (status == MewStoreConditionResultMewPay || status == MewStoreConditionResultMewStart || status == MewStoreConditionResultMewVerifiedServer) {
|
||||||
|
|
||||||
}else if (status == MewStoreConditionResultMewUnowned) {
|
}else if (status == MewStoreConditionResultMewUnowned) {
|
||||||
[YMHUDTool hideHUDInView:kWindow];
|
[MewHUDTool hideHUDInView:kWindow];
|
||||||
[self showErrorToast:@"出现未知错误,请重新尝试"];
|
[self showErrorToast:@"出现未知错误,请重新尝试"];
|
||||||
}else{
|
}else{
|
||||||
[YMHUDTool hideHUDInView:kWindow];
|
[MewHUDTool hideHUDInView:kWindow];
|
||||||
[self showErrorToast:@"购买失败"];
|
[self showErrorToast:@"购买失败"];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -147,7 +147,7 @@
|
|||||||
}
|
}
|
||||||
///二次校验成功
|
///二次校验成功
|
||||||
- (void)checkReceiptSuccess:(NSString *)transcationId {
|
- (void)checkReceiptSuccess:(NSString *)transcationId {
|
||||||
[YMHUDTool hideHUDInView:kWindow];
|
[MewHUDTool hideHUDInView:kWindow];
|
||||||
if (@available(iOS 15.0, *)) {
|
if (@available(iOS 15.0, *)) {
|
||||||
MewPaymentAction *iap = [MewPaymentAction shared];
|
MewPaymentAction *iap = [MewPaymentAction shared];
|
||||||
[iap Mew_verifyBusinessAccomplishWithTransaction:[NSString stringWithFormat:@"%@",transcationId] completionHandler:^{
|
[iap Mew_verifyBusinessAccomplishWithTransaction:[NSString stringWithFormat:@"%@",transcationId] completionHandler:^{
|
||||||
@@ -157,10 +157,10 @@
|
|||||||
[self deleteRechageReciptWithTransactionIdentifier:transcationId];
|
[self deleteRechageReciptWithTransactionIdentifier:transcationId];
|
||||||
self.orderId = nil;
|
self.orderId = nil;
|
||||||
///刷新一下用户的信息
|
///刷新一下用户的信息
|
||||||
[YMHUDTool showLoading];
|
[MewHUDTool showLoading];
|
||||||
//5秒之后如果没有收到开通成功的云信消息,则请求一次用户信息
|
//5秒之后如果没有收到开通成功的云信消息,则请求一次用户信息
|
||||||
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(2.0 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
|
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(2.0 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
|
||||||
[YMHUDTool hideHUD];
|
[MewHUDTool hideHUD];
|
||||||
|
|
||||||
///刷新一下用户的信息
|
///刷新一下用户的信息
|
||||||
[self.presenter getUserWalletInfo];
|
[self.presenter getUserWalletInfo];
|
||||||
@@ -169,7 +169,7 @@
|
|||||||
}
|
}
|
||||||
///二次校验失败
|
///二次校验失败
|
||||||
- (void)checkReceiptFailWithCode:(NSInteger)code transcationId:(NSString *)transcationId{
|
- (void)checkReceiptFailWithCode:(NSInteger)code transcationId:(NSString *)transcationId{
|
||||||
[YMHUDTool hideHUDInView:kWindow];
|
[MewHUDTool hideHUDInView:kWindow];
|
||||||
if(code == 1444){
|
if(code == 1444){
|
||||||
if (@available(iOS 15.0, *)) {
|
if (@available(iOS 15.0, *)) {
|
||||||
MewPaymentAction *iap = [MewPaymentAction shared];
|
MewPaymentAction *iap = [MewPaymentAction shared];
|
||||||
@@ -183,7 +183,7 @@
|
|||||||
///删除本地保存的
|
///删除本地保存的
|
||||||
- (void)deleteRechageReciptWithTransactionIdentifier:(NSString *)transactionIdentifier {
|
- (void)deleteRechageReciptWithTransactionIdentifier:(NSString *)transactionIdentifier {
|
||||||
NSString * uid = [AccountInfoStorage instance].getUid;
|
NSString * uid = [AccountInfoStorage instance].getUid;
|
||||||
BOOL deleteSuccess = [RechargeStorage delegateTranscationId:transactionIdentifier uid:uid];
|
BOOL deleteSuccess = [MEWRechargeStorage mewDelegateTranscationId:transactionIdentifier uid:uid];
|
||||||
if (deleteSuccess) {
|
if (deleteSuccess) {
|
||||||
#warning to do 保存失败 需要埋点
|
#warning to do 保存失败 需要埋点
|
||||||
}
|
}
|
||||||
@@ -203,16 +203,16 @@
|
|||||||
[dictionary setObject:self.orderId forKey:@"orderId"];
|
[dictionary setObject:self.orderId forKey:@"orderId"];
|
||||||
}
|
}
|
||||||
if(dictionary.allKeys.count == 0)return;
|
if(dictionary.allKeys.count == 0)return;
|
||||||
NSString *reciptJson = [dictionary toJSONString];
|
NSString *reciptJson = [dictionary mewToJSONString];
|
||||||
NSString * uid = [AccountInfoStorage instance].getUid;
|
NSString * uid = [AccountInfoStorage instance].getUid;
|
||||||
BOOL saveSuccess = [RechargeStorage saveTranscationId:transactionIdentifier recipt:reciptJson uid:uid];
|
BOOL saveSuccess = [MEWRechargeStorage mewSaveTranscationId:transactionIdentifier recipt:reciptJson uid:uid];
|
||||||
if (!saveSuccess) {
|
if (!saveSuccess) {
|
||||||
#warning to do 保存失败 需要埋点
|
#warning to do 保存失败 需要埋点
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#pragma mark - MewRechargeSubViewDelegate
|
#pragma mark - MewRechargeSubViewDelegate
|
||||||
- (void)didSelectMewRechargeChargeProdId:(NSInteger )index {
|
- (void)didSelectMewRechargeChargeProdId:(NSInteger )index {
|
||||||
[YMHUDTool showLoadingInView:kWindow];
|
[MewHUDTool showLoadingInView:kWindow];
|
||||||
NSString *prodId = self.rechageView.rechargeModels[index].chargeProdId;
|
NSString *prodId = self.rechageView.rechargeModels[index].chargeProdId;
|
||||||
[self.presenter requestIAPRechargeOrderWithChargeProdId:[NSString stringWithFormat:@"%@",prodId]];
|
[self.presenter requestIAPRechargeOrderWithChargeProdId:[NSString stringWithFormat:@"%@",prodId]];
|
||||||
}
|
}
|
||||||
@@ -227,7 +227,7 @@
|
|||||||
[self.navigationController pushViewController:webVC animated:YES];
|
[self.navigationController pushViewController:webVC animated:YES];
|
||||||
}
|
}
|
||||||
|
|
||||||
#pragma mark - YMIAPHelperDelegate
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@@ -10,7 +10,7 @@
|
|||||||
#import "NetImageView.h"
|
#import "NetImageView.h"
|
||||||
/// Tool
|
/// Tool
|
||||||
#import "YMMacro.h"
|
#import "YMMacro.h"
|
||||||
#import "ThemeColor.h"
|
#import "MEWThemeColor.h"
|
||||||
/// Third
|
/// Third
|
||||||
#import <Masonry/Masonry.h>
|
#import <Masonry/Masonry.h>
|
||||||
/// Model
|
/// Model
|
||||||
@@ -51,7 +51,7 @@
|
|||||||
self.partyBgImageView.image = [UIImage imageNamed:_model.imageName];
|
self.partyBgImageView.image = [UIImage imageNamed:_model.imageName];
|
||||||
self.titleLabel.text = _model.title;
|
self.titleLabel.text = _model.title;
|
||||||
self.detailLabel.text = _model.detail;
|
self.detailLabel.text = _model.detail;
|
||||||
self.detailLabel.textColor = [ThemeColor colorWithHexString:_model.colorString];
|
self.detailLabel.textColor = [MEWThemeColor mewColorWithHexString:_model.colorString];
|
||||||
// self.lookLabel.hidden = !_model.isLook;
|
// self.lookLabel.hidden = !_model.isLook;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -126,7 +126,7 @@
|
|||||||
- (UIView *)lookBgView {
|
- (UIView *)lookBgView {
|
||||||
if (!_lookBgView) {
|
if (!_lookBgView) {
|
||||||
_lookBgView = [[UIView alloc] init];
|
_lookBgView = [[UIView alloc] init];
|
||||||
_lookBgView.backgroundColor = UIColorRGBAlpha(0xFFFFFF, 0.6);
|
_lookBgView.backgroundColor = UIColorMewRGBAlpha(0xFFFFFF, 0.6);
|
||||||
_lookBgView.layer.cornerRadius = 4;
|
_lookBgView.layer.cornerRadius = 4;
|
||||||
_lookBgView.layer.masksToBounds = YES;
|
_lookBgView.layer.masksToBounds = YES;
|
||||||
}
|
}
|
||||||
@@ -137,7 +137,7 @@
|
|||||||
if (!_lookLabel) {
|
if (!_lookLabel) {
|
||||||
_lookLabel = [[UILabel alloc] init];
|
_lookLabel = [[UILabel alloc] init];
|
||||||
_lookLabel.text = @"浏览过";
|
_lookLabel.text = @"浏览过";
|
||||||
_lookLabel.textColor = UIColorFromRGB(0x57585F);
|
_lookLabel.textColor = UIColorMewFromRGB(0x57585F);
|
||||||
_lookLabel.font = kFontRegular(10);
|
_lookLabel.font = kFontRegular(10);
|
||||||
_lookLabel.textAlignment = NSTextAlignmentCenter;
|
_lookLabel.textAlignment = NSTextAlignmentCenter;
|
||||||
}
|
}
|
||||||
@@ -148,7 +148,7 @@
|
|||||||
if (!_partyBottomLabel) {
|
if (!_partyBottomLabel) {
|
||||||
_partyBottomLabel = [[UILabel alloc] init];
|
_partyBottomLabel = [[UILabel alloc] init];
|
||||||
_partyBottomLabel.text = @"9999人派对中";
|
_partyBottomLabel.text = @"9999人派对中";
|
||||||
_partyBottomLabel.textColor = [ThemeColor colorWithHexString:@"#F0F0F0"];
|
_partyBottomLabel.textColor = [MEWThemeColor mewColorWithHexString:@"#F0F0F0"];
|
||||||
_partyBottomLabel.font = kFontRegular(11);
|
_partyBottomLabel.font = kFontRegular(11);
|
||||||
}
|
}
|
||||||
return _partyBottomLabel;
|
return _partyBottomLabel;
|
||||||
|
@@ -11,8 +11,8 @@
|
|||||||
|
|
||||||
#import "YMRoomMessageConstant.h"
|
#import "YMRoomMessageConstant.h"
|
||||||
#import "YMMacro.h"
|
#import "YMMacro.h"
|
||||||
#import "ThemeColor.h"
|
#import "MEWThemeColor.h"
|
||||||
#import "ThemeColor+Room.h"
|
#import "MEWThemeColor+MEWRoom.h"
|
||||||
#import "UIImage+Utils.h"
|
#import "UIImage+Utils.h"
|
||||||
#import <Masonry/Masonry.h>
|
#import <Masonry/Masonry.h>
|
||||||
#import <YYText/YYText.h>
|
#import <YYText/YYText.h>
|
||||||
@@ -41,7 +41,7 @@
|
|||||||
_messageInfo = messageInfo;
|
_messageInfo = messageInfo;
|
||||||
if (_messageInfo) {
|
if (_messageInfo) {
|
||||||
self.contentLabel.attributedText = _messageInfo.content;
|
self.contentLabel.attributedText = _messageInfo.content;
|
||||||
self.bubbleImageView.image = [UIImage imageWithColor:[ThemeColor messageBubbleColor]];
|
self.bubbleImageView.image = [UIImage imageWithColor:[MEWThemeColor messageBubbleColor]];
|
||||||
}
|
}
|
||||||
// self.nickerNameLabel.attributedText = _messageInfo.content;
|
// self.nickerNameLabel.attributedText = _messageInfo.content;
|
||||||
|
|
||||||
|
@@ -9,7 +9,7 @@
|
|||||||
/// Model
|
/// Model
|
||||||
#import "MicroQueueModel.h"
|
#import "MicroQueueModel.h"
|
||||||
#import "UserInfoModel.h"
|
#import "UserInfoModel.h"
|
||||||
#import "ThemeColor+Room.h"
|
#import "MEWThemeColor+MEWRoom.h"
|
||||||
|
|
||||||
@interface MewSocialMicroView()
|
@interface MewSocialMicroView()
|
||||||
/// 当前坑位
|
/// 当前坑位
|
||||||
|
@@ -11,7 +11,7 @@
|
|||||||
#import "Api+Main.h"
|
#import "Api+Main.h"
|
||||||
#import "MainProtocol.h"
|
#import "MainProtocol.h"
|
||||||
#import <NIMSDK/NIMSDK.h>
|
#import <NIMSDK/NIMSDK.h>
|
||||||
#import "RechargeStorage.h"
|
#import "MEWRechargeStorage.h"
|
||||||
|
|
||||||
@implementation MainPresenter
|
@implementation MainPresenter
|
||||||
|
|
||||||
@@ -65,7 +65,7 @@
|
|||||||
/// 获取用户信息
|
/// 获取用户信息
|
||||||
- (void)getUserInfo {
|
- (void)getUserInfo {
|
||||||
[Api getUserInfo:[self createHttpCompletion:^(BaseModel * _Nonnull data) {
|
[Api getUserInfo:[self createHttpCompletion:^(BaseModel * _Nonnull data) {
|
||||||
[[self getView] getUserInfoSuccess:[UserInfoModel modelWithDictionary:data.data]];
|
[[self getView] getUserInfoSuccess:[UserInfoModel mewModelWithDictionary:data.data]];
|
||||||
} fail:^(NSInteger code, NSString * _Nullable msg) {
|
} fail:^(NSInteger code, NSString * _Nullable msg) {
|
||||||
|
|
||||||
}] uid:[[AccountInfoStorage instance] getUid]];
|
}] uid:[[AccountInfoStorage instance] getUid]];
|
||||||
@@ -74,12 +74,12 @@
|
|||||||
/// 检查是否有未消费的内购订单
|
/// 检查是否有未消费的内购订单
|
||||||
- (void)checkTranscation {
|
- (void)checkTranscation {
|
||||||
NSString *uid = [AccountInfoStorage instance].getUid;
|
NSString *uid = [AccountInfoStorage instance].getUid;
|
||||||
NSArray *array = [RechargeStorage getAllReciptsWithUid:uid];
|
NSArray *array = [MEWRechargeStorage mewGetAllReciptsWithUid:uid];
|
||||||
if (array == nil && array.count == 0) {
|
if (array == nil && array.count == 0) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
NSString *transcationIdStr = [array toJSONString];
|
NSString *transcationIdStr = [array mewToJSONString];
|
||||||
[Api requestCheckTranscationIds:[self createHttpCompletion:^(BaseModel * _Nonnull data) {
|
[Api requestCheckTranscationIds:[self createHttpCompletion:^(BaseModel * _Nonnull data) {
|
||||||
|
|
||||||
|
|
||||||
|
@@ -7,13 +7,13 @@
|
|||||||
|
|
||||||
|
|
||||||
///Tool
|
///Tool
|
||||||
#import "YMHUDTool.h"
|
#import "MewHUDTool.h"
|
||||||
#import "ClientConfig.h"
|
#import "ClientConfig.h"
|
||||||
#import "ThemeColor.h"
|
#import "MEWThemeColor.h"
|
||||||
#import "UIImage+Utils.h"
|
#import "UIImage+Utils.h"
|
||||||
#import "YMMacro.h"
|
#import "YMMacro.h"
|
||||||
#import "AccountInfoStorage.h"
|
#import "AccountInfoStorage.h"
|
||||||
#import "NSMutableDictionary+Safe.h"
|
#import "NSMutableDictionary+MEWSafe.h"
|
||||||
/// Third
|
/// Third
|
||||||
#import <NIMSDK/NIMSDK.h>
|
#import <NIMSDK/NIMSDK.h>
|
||||||
#import <QYSDK_NIM/QYSDK.h>
|
#import <QYSDK_NIM/QYSDK.h>
|
||||||
@@ -93,7 +93,7 @@ NSString * const kNetworkReachabilityKey = @"kNetworkReachabilityKey";
|
|||||||
itemVc.title = title;
|
itemVc.title = title;
|
||||||
itemVc.tabBarItem.image = [[UIImage imageNamed:image] imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal];
|
itemVc.tabBarItem.image = [[UIImage imageNamed:image] imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal];
|
||||||
itemVc.tabBarItem.selectedImage = [[UIImage imageNamed:selectedImage] imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal];
|
itemVc.tabBarItem.selectedImage = [[UIImage imageNamed:selectedImage] imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal];
|
||||||
[itemVc.tabBarItem setTitleTextAttributes:@{NSForegroundColorAttributeName:[ThemeColor mainTextColor]} forState:UIControlStateSelected];
|
[itemVc.tabBarItem setTitleTextAttributes:@{NSForegroundColorAttributeName:[MEWThemeColor mewMainTextColor]} forState:UIControlStateSelected];
|
||||||
[itemVc.tabBarItem setTitleTextAttributes:@{NSForegroundColorAttributeName:UIColor.blackColor} forState:UIControlStateNormal];
|
[itemVc.tabBarItem setTitleTextAttributes:@{NSForegroundColorAttributeName:UIColor.blackColor} forState:UIControlStateNormal];
|
||||||
BaseNavigationController *nav = [[BaseNavigationController alloc] initWithRootViewController:itemVc];
|
BaseNavigationController *nav = [[BaseNavigationController alloc] initWithRootViewController:itemVc];
|
||||||
return nav;
|
return nav;
|
||||||
@@ -102,7 +102,7 @@ NSString * const kNetworkReachabilityKey = @"kNetworkReachabilityKey";
|
|||||||
- (void)configTheme {
|
- (void)configTheme {
|
||||||
if (@available(iOS 13.0, *)) {
|
if (@available(iOS 13.0, *)) {
|
||||||
UITabBarAppearance *appearance = [[UITabBarAppearance alloc] init];
|
UITabBarAppearance *appearance = [[UITabBarAppearance alloc] init];
|
||||||
appearance.backgroundColor = [ThemeColor colorWithHexString:@"#1D2126"];
|
appearance.backgroundColor = [MEWThemeColor mewColorWithHexString:@"#1D2126"];
|
||||||
self.tabBar.standardAppearance = appearance;
|
self.tabBar.standardAppearance = appearance;
|
||||||
if (@available(iOS 15.0, *)) {
|
if (@available(iOS 15.0, *)) {
|
||||||
self.tabBar.scrollEdgeAppearance = appearance;
|
self.tabBar.scrollEdgeAppearance = appearance;
|
||||||
@@ -114,7 +114,7 @@ NSString * const kNetworkReachabilityKey = @"kNetworkReachabilityKey";
|
|||||||
// [[UITabBar appearance] setBackgroundImage:color_image];
|
// [[UITabBar appearance] setBackgroundImage:color_image];
|
||||||
// [[UITabBar appearance] setShadowImage:[[UIImage alloc] init]];
|
// [[UITabBar appearance] setShadowImage:[[UIImage alloc] init]];
|
||||||
// if (@available(iOS 10.0, *)) {
|
// if (@available(iOS 10.0, *)) {
|
||||||
// [[UITabBar appearance] setUnselectedItemTintColor:UIColorRGBAlpha(0x333333, 0.4)];
|
// [[UITabBar appearance] setUnselectedItemTintColor:UIColorMewRGBAlpha(0x333333, 0.4)];
|
||||||
// }
|
// }
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -186,19 +186,19 @@ NSString * const kNetworkReachabilityKey = @"kNetworkReachabilityKey";
|
|||||||
|
|
||||||
|
|
||||||
- (void)showSuccessToast:(NSString *)msg {
|
- (void)showSuccessToast:(NSString *)msg {
|
||||||
[YMHUDTool showSuccessWithMessage:msg];
|
[MewHUDTool showSuccessWithMessage:msg];
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void)showErrorToast:(NSString *)msg {
|
- (void)showErrorToast:(NSString *)msg {
|
||||||
[YMHUDTool showErrorWithMessage:msg];
|
[MewHUDTool showErrorWithMessage:msg];
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void)showLoading {
|
- (void)showLoading {
|
||||||
[YMHUDTool showLoading];
|
[MewHUDTool showLoading];
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void)hideHUD {
|
- (void)hideHUD {
|
||||||
[YMHUDTool hideHUD];
|
[MewHUDTool hideHUD];
|
||||||
}
|
}
|
||||||
|
|
||||||
#pragma mark - 网络状态监听
|
#pragma mark - 网络状态监听
|
||||||
@@ -242,29 +242,29 @@ NSString * const kNetworkReachabilityKey = @"kNetworkReachabilityKey";
|
|||||||
userinfo.userId = uid;
|
userinfo.userId = uid;
|
||||||
NSMutableArray * array = [NSMutableArray array];
|
NSMutableArray * array = [NSMutableArray array];
|
||||||
NSMutableDictionary * nickDic = [NSMutableDictionary dictionary];
|
NSMutableDictionary * nickDic = [NSMutableDictionary dictionary];
|
||||||
[nickDic safeSetObject:@"real_name" forKey:@"key"];
|
[nickDic mewSafeSetObject:@"real_name" forKey:@"key"];
|
||||||
[nickDic safeSetObject:userInfo.nick forKey:@"value"];
|
[nickDic mewSafeSetObject:userInfo.nick forKey:@"value"];
|
||||||
|
|
||||||
NSMutableDictionary * phoneDic = [NSMutableDictionary dictionary];
|
NSMutableDictionary * phoneDic = [NSMutableDictionary dictionary];
|
||||||
[phoneDic safeSetObject:@"mobile_phone" forKey:@"key"];
|
[phoneDic mewSafeSetObject:@"mobile_phone" forKey:@"key"];
|
||||||
[phoneDic safeSetObject:userInfo.phone?:@"" forKey:@"value"];
|
[phoneDic mewSafeSetObject:userInfo.phone?:@"" forKey:@"value"];
|
||||||
|
|
||||||
NSMutableDictionary * accountDic = [NSMutableDictionary dictionary];
|
NSMutableDictionary * accountDic = [NSMutableDictionary dictionary];
|
||||||
[accountDic safeSetObject:@"0" forKey:@"index"];
|
[accountDic mewSafeSetObject:@"0" forKey:@"index"];
|
||||||
[accountDic safeSetObject:@"account" forKey:@"key"];
|
[accountDic mewSafeSetObject:@"account" forKey:@"key"];
|
||||||
[accountDic safeSetObject:@"ID" forKey:@"label"];
|
[accountDic mewSafeSetObject:@"ID" forKey:@"label"];
|
||||||
[accountDic safeSetObject:@(userInfo.erbanNo) forKey:@"value"];
|
[accountDic mewSafeSetObject:@(userInfo.erbanNo) forKey:@"value"];
|
||||||
|
|
||||||
NSMutableDictionary * genderDic = [NSMutableDictionary dictionary];
|
NSMutableDictionary * genderDic = [NSMutableDictionary dictionary];
|
||||||
[genderDic safeSetObject:@"1" forKey:@"index"];
|
[genderDic mewSafeSetObject:@"1" forKey:@"index"];
|
||||||
[genderDic safeSetObject:@"sex" forKey:@"key"];
|
[genderDic mewSafeSetObject:@"sex" forKey:@"key"];
|
||||||
[genderDic safeSetObject:@"性别" forKey:@"label"];
|
[genderDic mewSafeSetObject:@"性别" forKey:@"label"];
|
||||||
[genderDic safeSetObject:userInfo.gender == GenderType_Male ? @"男" : @"女" forKey:@"value"];
|
[genderDic mewSafeSetObject:userInfo.gender == GenderType_Male ? @"男" : @"女" forKey:@"value"];
|
||||||
[array addObject:nickDic];
|
[array addObject:nickDic];
|
||||||
[array addObject:phoneDic];
|
[array addObject:phoneDic];
|
||||||
[array addObject:accountDic];
|
[array addObject:accountDic];
|
||||||
[array addObject:genderDic];
|
[array addObject:genderDic];
|
||||||
userinfo.data = array.toJSONString;
|
userinfo.data = array.mewToJSONString;
|
||||||
[[QYSDK sharedSDK] setUserInfo:userinfo];
|
[[QYSDK sharedSDK] setUserInfo:userinfo];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -13,12 +13,12 @@
|
|||||||
#import "Api+Mine.h"
|
#import "Api+Mine.h"
|
||||||
#import "YYUtility.h"
|
#import "YYUtility.h"
|
||||||
#import "AccountInfoStorage.h"
|
#import "AccountInfoStorage.h"
|
||||||
#import "ThemeColor.h"
|
#import "MEWThemeColor.h"
|
||||||
#import "YMMacro.h"
|
#import "YMMacro.h"
|
||||||
#import "NewEncryptTool.h"
|
#import "NewEncryptTool.h"
|
||||||
#import "HttpRequestHelper.h"
|
#import "HttpRequestHelper.h"
|
||||||
#import "AccountModel.h"
|
#import "AccountModel.h"
|
||||||
#import "YMHUDTool.h"
|
#import "MewHUDTool.h"
|
||||||
#import "ClientConfig.h"
|
#import "ClientConfig.h"
|
||||||
/// Third
|
/// Third
|
||||||
#import <Masonry/Masonry.h>
|
#import <Masonry/Masonry.h>
|
||||||
@@ -65,7 +65,7 @@ NSString * const kCloseWebView = @"closeWebView";
|
|||||||
NSString * const kCancelAccount = @"cancelAccount";
|
NSString * const kCancelAccount = @"cancelAccount";
|
||||||
@interface YMWebViewController ()<WKNavigationDelegate, WKScriptMessageHandler>
|
@interface YMWebViewController ()<WKNavigationDelegate, WKScriptMessageHandler>
|
||||||
@property (strong, nonatomic) WKWebView *webview;
|
@property (strong, nonatomic) WKWebView *webview;
|
||||||
@property (nonatomic, strong) WKUserContentController *userContentController;
|
@property (nonatomic, strong) WKUserContentController *mew_userContentController;
|
||||||
///是否隐藏导航栏
|
///是否隐藏导航栏
|
||||||
@property (nonatomic,assign) BOOL isHiddenNav;
|
@property (nonatomic,assign) BOOL isHiddenNav;
|
||||||
|
|
||||||
@@ -150,10 +150,10 @@ NSString * const kCancelAccount = @"cancelAccount";
|
|||||||
[self.navigationController popViewControllerAnimated:YES];
|
[self.navigationController popViewControllerAnimated:YES];
|
||||||
}
|
}
|
||||||
} else if ([message.name isEqualToString:kCancelAccount]) {
|
} else if ([message.name isEqualToString:kCancelAccount]) {
|
||||||
[YMHUDTool showLoadingWithMessage:@"正在注销中,请稍等"];
|
[MewHUDTool showLoadingWithMessage:@"正在注销中,请稍等"];
|
||||||
AccountModel *model = [[AccountInfoStorage instance] accountModel];
|
AccountModel *model = [[AccountInfoStorage instance] accountModel];
|
||||||
[Api logoutCurrentAccount:^(BaseModel * _Nonnull data, NSInteger code, NSString * _Nonnull msg) {
|
[Api logoutCurrentAccount:^(BaseModel * _Nonnull data, NSInteger code, NSString * _Nonnull msg) {
|
||||||
[YMHUDTool showSuccessWithMessage:@"注销成功"];
|
[MewHUDTool showSuccessWithMessage:@"注销成功"];
|
||||||
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(2.0 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
|
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(2.0 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
|
||||||
[self.navigationController popToRootViewControllerAnimated:NO];
|
[self.navigationController popToRootViewControllerAnimated:NO];
|
||||||
[[AccountInfoStorage instance] saveAccountInfo:nil];
|
[[AccountInfoStorage instance] saveAccountInfo:nil];
|
||||||
@@ -202,7 +202,7 @@ NSString * const kCancelAccount = @"cancelAccount";
|
|||||||
[self.webview goBack];
|
[self.webview goBack];
|
||||||
} else {
|
} else {
|
||||||
[self.navigationController popViewControllerAnimated:YES];
|
[self.navigationController popViewControllerAnimated:YES];
|
||||||
[self.userContentController removeAllUserScripts];
|
[self.mew_userContentController removeAllUserScripts];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -221,18 +221,18 @@ NSString * const kCancelAccount = @"cancelAccount";
|
|||||||
NSString *realCookie = [NSString stringWithFormat:@"%@=%@",@"uid",uid];
|
NSString *realCookie = [NSString stringWithFormat:@"%@=%@",@"uid",uid];
|
||||||
|
|
||||||
WKUserScript *cookieScript = [[WKUserScript alloc] initWithSource: [NSString stringWithFormat:@"document.cookie = '%@';", realCookie] injectionTime:WKUserScriptInjectionTimeAtDocumentStart forMainFrameOnly:NO];
|
WKUserScript *cookieScript = [[WKUserScript alloc] initWithSource: [NSString stringWithFormat:@"document.cookie = '%@';", realCookie] injectionTime:WKUserScriptInjectionTimeAtDocumentStart forMainFrameOnly:NO];
|
||||||
[self.userContentController addUserScript:cookieScript];
|
[self.mew_userContentController addUserScript:cookieScript];
|
||||||
///禁止缩放
|
///禁止缩放
|
||||||
NSString *scaleJs = @"$('meta[name=description]').remove(); $('head').append( '<meta name=\"viewport\" content=\"width=device-width, initial-scale=1,user-scalable=no\">' );";
|
NSString *scaleJs = @"$('meta[name=description]').remove(); $('head').append( '<meta name=\"viewport\" content=\"width=device-width, initial-scale=1,user-scalable=no\">' );";
|
||||||
WKUserScript *scaleScript = [[WKUserScript alloc] initWithSource:scaleJs injectionTime:WKUserScriptInjectionTimeAtDocumentEnd forMainFrameOnly:NO];
|
WKUserScript *scaleScript = [[WKUserScript alloc] initWithSource:scaleJs injectionTime:WKUserScriptInjectionTimeAtDocumentEnd forMainFrameOnly:NO];
|
||||||
[self.userContentController addUserScript:scaleScript];
|
[self.mew_userContentController addUserScript:scaleScript];
|
||||||
|
|
||||||
//根据生成的WKUserScript对象,初始化WKWebViewConfiguration
|
//根据生成的WKUserScript对象,初始化WKWebViewConfiguration
|
||||||
configuration.preferences.javaScriptEnabled = YES;
|
configuration.preferences.javaScriptEnabled = YES;
|
||||||
configuration.preferences.javaScriptCanOpenWindowsAutomatically = YES;
|
configuration.preferences.javaScriptCanOpenWindowsAutomatically = YES;
|
||||||
configuration.preferences.minimumFontSize = 10;
|
configuration.preferences.minimumFontSize = 10;
|
||||||
configuration.selectionGranularity = WKSelectionGranularityCharacter;
|
configuration.selectionGranularity = WKSelectionGranularityCharacter;
|
||||||
configuration.userContentController = self.userContentController;
|
configuration.userContentController = self.mew_userContentController;
|
||||||
|
|
||||||
CGSize size = [UIScreen mainScreen].bounds.size;
|
CGSize size = [UIScreen mainScreen].bounds.size;
|
||||||
_webview = [[WKWebView alloc]initWithFrame:CGRectMake(0, 0, size.width,size.height) configuration:configuration];
|
_webview = [[WKWebView alloc]initWithFrame:CGRectMake(0, 0, size.width,size.height) configuration:configuration];
|
||||||
@@ -264,27 +264,27 @@ NSString * const kCancelAccount = @"cancelAccount";
|
|||||||
return _webview;
|
return _webview;
|
||||||
}
|
}
|
||||||
|
|
||||||
- (WKUserContentController *)userContentController{
|
- (WKUserContentController *)mew_userContentController{
|
||||||
if (!_userContentController) {
|
if (!_mew_userContentController) {
|
||||||
//自定义的WKScriptMessageHandler 是为了解决内存不释放的问题
|
//自定义的WKScriptMessageHandler 是为了解决内存不释放的问题
|
||||||
WeakWebViewScriptMessageDelegate *weakScriptMessageDelegate = [[WeakWebViewScriptMessageDelegate alloc] initWithDelegate:self];
|
WeakWebViewScriptMessageDelegate *weakScriptMessageDelegate = [[WeakWebViewScriptMessageDelegate alloc] initWithDelegate:self];
|
||||||
_userContentController = [[WKUserContentController alloc] init];
|
_mew_userContentController = [[WKUserContentController alloc] init];
|
||||||
// 获取uid
|
// 获取uid
|
||||||
[_userContentController addScriptMessageHandler:weakScriptMessageDelegate name:kJSGetUid];
|
[_mew_userContentController addScriptMessageHandler:weakScriptMessageDelegate name:kJSGetUid];
|
||||||
// 获取设备id
|
// 获取设备id
|
||||||
[_userContentController addScriptMessageHandler:weakScriptMessageDelegate name:kJSGetDeviceId];
|
[_mew_userContentController addScriptMessageHandler:weakScriptMessageDelegate name:kJSGetDeviceId];
|
||||||
// 获取Ticket
|
// 获取Ticket
|
||||||
[_userContentController addScriptMessageHandler:weakScriptMessageDelegate name:kJSGetTicket];
|
[_mew_userContentController addScriptMessageHandler:weakScriptMessageDelegate name:kJSGetTicket];
|
||||||
// 获取设备info
|
// 获取设备info
|
||||||
[_userContentController addScriptMessageHandler:weakScriptMessageDelegate name:kJSGetDeviceInfo];
|
[_mew_userContentController addScriptMessageHandler:weakScriptMessageDelegate name:kJSGetDeviceInfo];
|
||||||
// 隐藏导航栏
|
// 隐藏导航栏
|
||||||
[_userContentController addScriptMessageHandler:weakScriptMessageDelegate name:kInitShowNav];
|
[_mew_userContentController addScriptMessageHandler:weakScriptMessageDelegate name:kInitShowNav];
|
||||||
// 隐藏导航栏
|
// 隐藏导航栏
|
||||||
[_userContentController addScriptMessageHandler:weakScriptMessageDelegate name:kCloseWebView];
|
[_mew_userContentController addScriptMessageHandler:weakScriptMessageDelegate name:kCloseWebView];
|
||||||
// 注销账号
|
// 注销账号
|
||||||
[_userContentController addScriptMessageHandler:weakScriptMessageDelegate name:kCancelAccount];
|
[_mew_userContentController addScriptMessageHandler:weakScriptMessageDelegate name:kCancelAccount];
|
||||||
}
|
}
|
||||||
return _userContentController;
|
return _mew_userContentController;
|
||||||
}
|
}
|
||||||
|
|
||||||
@end
|
@end
|
||||||
|
@@ -22,7 +22,7 @@
|
|||||||
NSString * pageStr = [NSString stringWithFormat:@"%d", page];
|
NSString * pageStr = [NSString stringWithFormat:@"%d", page];
|
||||||
NSString * pageSizeStr = [NSString stringWithFormat:@"%d", pageSize];
|
NSString * pageSizeStr = [NSString stringWithFormat:@"%d", pageSize];
|
||||||
[Api getRecommendListComplection:[self createHttpCompletion:^(BaseModel * _Nonnull data) {
|
[Api getRecommendListComplection:[self createHttpCompletion:^(BaseModel * _Nonnull data) {
|
||||||
NSArray * array = [HomeRecommendRoomModel modelsWithArray:data.data];
|
NSArray * array = [HomeRecommendRoomModel mewModelsWithArray:data.data];
|
||||||
[[self getView] getHomeRecommendRoomListSuccess:array state:state];
|
[[self getView] getHomeRecommendRoomListSuccess:array state:state];
|
||||||
}fail:^(NSInteger code, NSString * _Nullable msg) {
|
}fail:^(NSInteger code, NSString * _Nullable msg) {
|
||||||
// [[self getView] getHomeRecommendRoomListFail:msg state:state];
|
// [[self getView] getHomeRecommendRoomListFail:msg state:state];
|
||||||
@@ -34,7 +34,7 @@
|
|||||||
- (void)homeRecommendRoomList {
|
- (void)homeRecommendRoomList {
|
||||||
NSString *uid = [AccountInfoStorage instance].getUid;
|
NSString *uid = [AccountInfoStorage instance].getUid;
|
||||||
[Api homeRecommendRoomListComplection:[self createHttpCompletion:^(BaseModel * _Nonnull data) {
|
[Api homeRecommendRoomListComplection:[self createHttpCompletion:^(BaseModel * _Nonnull data) {
|
||||||
NSArray * array = [HomeRecommendRoomModel modelsWithArray:data.data];
|
NSArray * array = [HomeRecommendRoomModel mewModelsWithArray:data.data];
|
||||||
[[self getView] homeRecommendRoomListSuccess:array];
|
[[self getView] homeRecommendRoomListSuccess:array];
|
||||||
// [[self getView] getHomeRecommendRoomListSuccess:array state:state];
|
// [[self getView] getHomeRecommendRoomListSuccess:array state:state];
|
||||||
}fail:^(NSInteger code, NSString * _Nullable msg) {
|
}fail:^(NSInteger code, NSString * _Nullable msg) {
|
||||||
|
@@ -6,11 +6,11 @@
|
|||||||
//
|
//
|
||||||
|
|
||||||
#import "AttachmentModel.h"
|
#import "AttachmentModel.h"
|
||||||
#import "NSObject+MJExtension.h"
|
#import "NSObject+MEWExtension.h"
|
||||||
|
|
||||||
@implementation AttachmentModel
|
@implementation AttachmentModel
|
||||||
- (NSString *)encodeAttachment {
|
- (NSString *)encodeAttachment {
|
||||||
return [self toJSONString];
|
return [self mewToJSONString];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@@ -6,7 +6,7 @@
|
|||||||
//
|
//
|
||||||
|
|
||||||
#import "CustomAttachmentDecoder.h"
|
#import "CustomAttachmentDecoder.h"
|
||||||
#import "NSObject+MJExtension.h"
|
#import "NSObject+MEWExtension.h"
|
||||||
#import "AttachmentModel.h"
|
#import "AttachmentModel.h"
|
||||||
|
|
||||||
@implementation CustomAttachmentDecoder
|
@implementation CustomAttachmentDecoder
|
||||||
|
@@ -9,7 +9,7 @@
|
|||||||
#import "Api+Login.h"
|
#import "Api+Login.h"
|
||||||
///Tool
|
///Tool
|
||||||
#import "AccountInfoStorage.h"
|
#import "AccountInfoStorage.h"
|
||||||
#import "NSMutableDictionary+Safe.h"
|
#import "NSMutableDictionary+MEWSafe.h"
|
||||||
///Api
|
///Api
|
||||||
#import "LoginFullInfoProtocol.h"
|
#import "LoginFullInfoProtocol.h"
|
||||||
///Model
|
///Model
|
||||||
@@ -56,25 +56,25 @@
|
|||||||
NSString * uid = [[AccountInfoStorage instance] getUid];
|
NSString * uid = [[AccountInfoStorage instance] getUid];
|
||||||
NSString * ticket = [[AccountInfoStorage instance] getTicket];
|
NSString * ticket = [[AccountInfoStorage instance] getTicket];
|
||||||
NSMutableDictionary * params = [NSMutableDictionary dictionary];
|
NSMutableDictionary * params = [NSMutableDictionary dictionary];
|
||||||
[params safeSetObject:avatar forKey:@"avatar"];
|
[params mewSafeSetObject:avatar forKey:@"avatar"];
|
||||||
[params safeSetObject:gender forKey:@"gender"];
|
[params mewSafeSetObject:gender forKey:@"gender"];
|
||||||
[params safeSetObject:nick forKey:@"nick"];
|
[params mewSafeSetObject:nick forKey:@"nick"];
|
||||||
[params safeSetObject:uid forKey:@"uid"];
|
[params mewSafeSetObject:uid forKey:@"uid"];
|
||||||
[params safeSetObject:ticket forKey:@"ticket"];
|
[params mewSafeSetObject:ticket forKey:@"ticket"];
|
||||||
if (inviteCode.length > 0) {
|
if (inviteCode.length > 0) {
|
||||||
[params safeSetObject:inviteCode forKey:@"inviteCode"];
|
[params mewSafeSetObject:inviteCode forKey:@"inviteCode"];
|
||||||
}
|
}
|
||||||
|
|
||||||
if (roomUid.length > 0) {
|
if (roomUid.length > 0) {
|
||||||
[params safeSetObject:roomUid forKey:@"roomUid"];
|
[params mewSafeSetObject:roomUid forKey:@"roomUid"];
|
||||||
}
|
}
|
||||||
|
|
||||||
if (shareUid.length > 0) {
|
if (shareUid.length > 0) {
|
||||||
[params safeSetObject:shareUid forKey:@"shareUid"];
|
[params mewSafeSetObject:shareUid forKey:@"shareUid"];
|
||||||
}
|
}
|
||||||
|
|
||||||
if (shareChannel.length > 0) {
|
if (shareChannel.length > 0) {
|
||||||
[params safeSetObject:shareChannel forKey:@"shareChannel"];
|
[params mewSafeSetObject:shareChannel forKey:@"shareChannel"];
|
||||||
}
|
}
|
||||||
|
|
||||||
[Api completeUserInfo:[self createHttpCompletion:^(BaseModel * _Nonnull data) {
|
[Api completeUserInfo:[self createHttpCompletion:^(BaseModel * _Nonnull data) {
|
||||||
|
@@ -26,7 +26,7 @@
|
|||||||
NSString * desPassword = [DESEncrypt encryptUseDES:password key:KeyWithType(KeyType_PasswordEncode)];
|
NSString * desPassword = [DESEncrypt encryptUseDES:password key:KeyWithType(KeyType_PasswordEncode)];
|
||||||
NSString * desPhone = [DESEncrypt encryptUseDES:phone key:KeyWithType(KeyType_PasswordEncode)];
|
NSString * desPhone = [DESEncrypt encryptUseDES:phone key:KeyWithType(KeyType_PasswordEncode)];
|
||||||
[Api loginWithPassword:[self createHttpCompletion:^(BaseModel * _Nonnull data) {
|
[Api loginWithPassword:[self createHttpCompletion:^(BaseModel * _Nonnull data) {
|
||||||
AccountModel *model = [AccountModel modelWithDictionary:data.data];
|
AccountModel *model = [AccountModel mewModelWithDictionary:data.data];
|
||||||
if (model && model.access_token.length > 0){
|
if (model && model.access_token.length > 0){
|
||||||
[[AccountInfoStorage instance] saveAccountInfo:model];
|
[[AccountInfoStorage instance] saveAccountInfo:model];
|
||||||
}
|
}
|
||||||
|
@@ -36,7 +36,7 @@
|
|||||||
|
|
||||||
- (void)thirdLoginWithApple:(NSString *)token unionId:(NSString *)unionId {
|
- (void)thirdLoginWithApple:(NSString *)token unionId:(NSString *)unionId {
|
||||||
[Api loginWithThirdPart:[self createHttpCompletion:^(BaseModel * _Nonnull data) {
|
[Api loginWithThirdPart:[self createHttpCompletion:^(BaseModel * _Nonnull data) {
|
||||||
AccountModel *model = [AccountModel modelWithDictionary:data.data];
|
AccountModel *model = [AccountModel mewModelWithDictionary:data.data];
|
||||||
if (model != nil) {
|
if (model != nil) {
|
||||||
[[AccountInfoStorage instance] saveAccountInfo:model];
|
[[AccountInfoStorage instance] saveAccountInfo:model];
|
||||||
[[self getView] loginSuccess];
|
[[self getView] loginSuccess];
|
||||||
|
@@ -41,7 +41,7 @@
|
|||||||
- (void)loginWithPhone:(NSString *)phone code:(NSString *)code {
|
- (void)loginWithPhone:(NSString *)phone code:(NSString *)code {
|
||||||
NSString *desPhone = [DESEncrypt encryptUseDES:phone key:KeyWithType(KeyType_PasswordEncode)];
|
NSString *desPhone = [DESEncrypt encryptUseDES:phone key:KeyWithType(KeyType_PasswordEncode)];
|
||||||
[Api loginWithCode:[self createHttpCompletion:^(BaseModel * _Nonnull data) {
|
[Api loginWithCode:[self createHttpCompletion:^(BaseModel * _Nonnull data) {
|
||||||
AccountModel *accountModel = [AccountModel modelWithDictionary:data.data];
|
AccountModel *accountModel = [AccountModel mewModelWithDictionary:data.data];
|
||||||
if (accountModel && accountModel.access_token.length > 0) {
|
if (accountModel && accountModel.access_token.length > 0) {
|
||||||
[[AccountInfoStorage instance] saveAccountInfo:accountModel];
|
[[AccountInfoStorage instance] saveAccountInfo:accountModel];
|
||||||
}
|
}
|
||||||
|
@@ -9,7 +9,7 @@
|
|||||||
///第三方
|
///第三方
|
||||||
#import <Masonry/Masonry.h>
|
#import <Masonry/Masonry.h>
|
||||||
///Tool
|
///Tool
|
||||||
#import "ThemeColor.h"
|
#import "MEWThemeColor.h"
|
||||||
|
|
||||||
@interface LoginForgetEditView()
|
@interface LoginForgetEditView()
|
||||||
///
|
///
|
||||||
@@ -37,7 +37,7 @@
|
|||||||
|
|
||||||
#pragma mark - private method
|
#pragma mark - private method
|
||||||
- (void)initView {
|
- (void)initView {
|
||||||
self.backgroundColor = [ThemeColor appCellBackgroundColor];
|
self.backgroundColor = [MEWThemeColor mewAppCellBackgroundColor];
|
||||||
[self addSubview:self.stackView];
|
[self addSubview:self.stackView];
|
||||||
[self addSubview:self.bottomLineView];
|
[self addSubview:self.bottomLineView];
|
||||||
|
|
||||||
@@ -89,7 +89,7 @@
|
|||||||
NSDictionary *dic = @{
|
NSDictionary *dic = @{
|
||||||
NSParagraphStyleAttributeName:style,
|
NSParagraphStyleAttributeName:style,
|
||||||
NSFontAttributeName:[UIFont systemFontOfSize:14],
|
NSFontAttributeName:[UIFont systemFontOfSize:14],
|
||||||
NSForegroundColorAttributeName:[ThemeColor secondTextColor]};
|
NSForegroundColorAttributeName:[MEWThemeColor mewSecondTextColor]};
|
||||||
if (placeholder == nil || placeholder.length == 0) {
|
if (placeholder == nil || placeholder.length == 0) {
|
||||||
placeholder = @"";
|
placeholder = @"";
|
||||||
}
|
}
|
||||||
@@ -101,7 +101,7 @@
|
|||||||
if (!_textField) {
|
if (!_textField) {
|
||||||
_textField = [[UITextField alloc] init];
|
_textField = [[UITextField alloc] init];
|
||||||
_textField.font = [UIFont systemFontOfSize:14];
|
_textField.font = [UIFont systemFontOfSize:14];
|
||||||
_textField.textColor = [ThemeColor mainTextColor];
|
_textField.textColor = [MEWThemeColor mewMainTextColor];
|
||||||
_textField.keyboardType = UIKeyboardTypeNumberPad;
|
_textField.keyboardType = UIKeyboardTypeNumberPad;
|
||||||
_textField.tintColor = UIColor.blackColor;
|
_textField.tintColor = UIColor.blackColor;
|
||||||
}
|
}
|
||||||
@@ -120,7 +120,7 @@
|
|||||||
if (!_bottomLineView) {
|
if (!_bottomLineView) {
|
||||||
_bottomLineView = [[UIView alloc] init];
|
_bottomLineView = [[UIView alloc] init];
|
||||||
_bottomLineView.backgroundColor = UIColor.grayColor;
|
_bottomLineView.backgroundColor = UIColor.grayColor;
|
||||||
// _bottomLineView.backgroundColor = [ThemeColor dividerColor];
|
// _bottomLineView.backgroundColor = [MEWThemeColor mewDividerColor];
|
||||||
}
|
}
|
||||||
return _bottomLineView;
|
return _bottomLineView;
|
||||||
}
|
}
|
||||||
@@ -130,7 +130,7 @@
|
|||||||
_authCodeButton = [UIButton buttonWithType:UIButtonTypeCustom];
|
_authCodeButton = [UIButton buttonWithType:UIButtonTypeCustom];
|
||||||
_authCodeButton.titleLabel.font = [UIFont systemFontOfSize:14];
|
_authCodeButton.titleLabel.font = [UIFont systemFontOfSize:14];
|
||||||
[_authCodeButton setTitle:@"获取验证码" forState:UIControlStateNormal];
|
[_authCodeButton setTitle:@"获取验证码" forState:UIControlStateNormal];
|
||||||
[_authCodeButton setTitleColor:[ThemeColor secondTextColor] forState:UIControlStateDisabled];
|
[_authCodeButton setTitleColor:[MEWThemeColor mewSecondTextColor] forState:UIControlStateDisabled];
|
||||||
[_authCodeButton setTitleColor:UIColor.blackColor forState:UIControlStateNormal];
|
[_authCodeButton setTitleColor:UIColor.blackColor forState:UIControlStateNormal];
|
||||||
}
|
}
|
||||||
return _authCodeButton;
|
return _authCodeButton;
|
||||||
|
@@ -9,7 +9,7 @@
|
|||||||
///Third
|
///Third
|
||||||
#import <Masonry/Masonry.h>
|
#import <Masonry/Masonry.h>
|
||||||
///Tool
|
///Tool
|
||||||
#import "ThemeColor.h"
|
#import "MEWThemeColor.h"
|
||||||
|
|
||||||
|
|
||||||
@interface LoginInputView()<UITextFieldDelegate>
|
@interface LoginInputView()<UITextFieldDelegate>
|
||||||
@@ -63,7 +63,7 @@
|
|||||||
- (void)setPlaceHolder:(NSString *)placeHolder {
|
- (void)setPlaceHolder:(NSString *)placeHolder {
|
||||||
_placeHolder = placeHolder;
|
_placeHolder = placeHolder;
|
||||||
if (_placeHolder) {
|
if (_placeHolder) {
|
||||||
self.textField.attributedPlaceholder = [[NSAttributedString alloc] initWithString:_placeHolder attributes:@{NSForegroundColorAttributeName: [ThemeColor secondTextColor], NSFontAttributeName:[UIFont systemFontOfSize:14]}];
|
self.textField.attributedPlaceholder = [[NSAttributedString alloc] initWithString:_placeHolder attributes:@{NSForegroundColorAttributeName: [MEWThemeColor mewSecondTextColor], NSFontAttributeName:[UIFont systemFontOfSize:14]}];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -89,7 +89,7 @@
|
|||||||
if (!_titleLabel) {
|
if (!_titleLabel) {
|
||||||
_titleLabel = [[UILabel alloc] init];
|
_titleLabel = [[UILabel alloc] init];
|
||||||
_titleLabel.font = [UIFont systemFontOfSize:18];
|
_titleLabel.font = [UIFont systemFontOfSize:18];
|
||||||
_titleLabel.textColor = [ThemeColor mainTextColor];
|
_titleLabel.textColor = [MEWThemeColor mewMainTextColor];
|
||||||
_titleLabel.text = @"+86";
|
_titleLabel.text = @"+86";
|
||||||
}
|
}
|
||||||
return _titleLabel;
|
return _titleLabel;
|
||||||
@@ -98,7 +98,7 @@
|
|||||||
- (UIView *)lineView {
|
- (UIView *)lineView {
|
||||||
if (!_lineView) {
|
if (!_lineView) {
|
||||||
_lineView = [[UIView alloc] init];
|
_lineView = [[UIView alloc] init];
|
||||||
_lineView.backgroundColor = [ThemeColor colorWithHexString:@"#F2F3F6"];
|
_lineView.backgroundColor = [MEWThemeColor mewColorWithHexString:@"#F2F3F6"];
|
||||||
}
|
}
|
||||||
return _lineView;
|
return _lineView;
|
||||||
}
|
}
|
||||||
@@ -107,11 +107,11 @@
|
|||||||
- (UITextField *)textField {
|
- (UITextField *)textField {
|
||||||
if (!_textField) {
|
if (!_textField) {
|
||||||
_textField = [[UITextField alloc] init];
|
_textField = [[UITextField alloc] init];
|
||||||
_textField.textColor = [ThemeColor mainTextColor];
|
_textField.textColor = [MEWThemeColor mewMainTextColor];
|
||||||
_textField.font = [UIFont systemFontOfSize:18.f];
|
_textField.font = [UIFont systemFontOfSize:18.f];
|
||||||
_textField.borderStyle = UITextBorderStyleNone;
|
_textField.borderStyle = UITextBorderStyleNone;
|
||||||
_textField.keyboardType = UIKeyboardTypeNumberPad;
|
_textField.keyboardType = UIKeyboardTypeNumberPad;
|
||||||
_textField.tintColor = [ThemeColor mainTextColor];
|
_textField.tintColor = [MEWThemeColor mewMainTextColor];
|
||||||
_textField.backgroundColor = [UIColor clearColor];
|
_textField.backgroundColor = [UIColor clearColor];
|
||||||
_textField.delegate = self;
|
_textField.delegate = self;
|
||||||
}
|
}
|
||||||
|
@@ -10,7 +10,7 @@
|
|||||||
#import <Masonry/Masonry.h>
|
#import <Masonry/Masonry.h>
|
||||||
#import <ReactiveObjC/ReactiveObjC.h>
|
#import <ReactiveObjC/ReactiveObjC.h>
|
||||||
///Tool
|
///Tool
|
||||||
#import "ThemeColor.h"
|
#import "MEWThemeColor.h"
|
||||||
#import "UIImage+Utils.h"
|
#import "UIImage+Utils.h"
|
||||||
///Model
|
///Model
|
||||||
#import "UserInfoModel.h"
|
#import "UserInfoModel.h"
|
||||||
@@ -90,7 +90,7 @@
|
|||||||
- (UIView *)containerView{
|
- (UIView *)containerView{
|
||||||
if (!_containerView) {
|
if (!_containerView) {
|
||||||
_containerView = [[UIView alloc] init];
|
_containerView = [[UIView alloc] init];
|
||||||
_containerView.backgroundColor = [ThemeColor appBackgroundColor];
|
_containerView.backgroundColor = [MEWThemeColor mewAppBackgroundColor];
|
||||||
}
|
}
|
||||||
return _containerView;
|
return _containerView;
|
||||||
}
|
}
|
||||||
@@ -106,7 +106,7 @@
|
|||||||
if (!_titleLabel) {
|
if (!_titleLabel) {
|
||||||
_titleLabel = [[UILabel alloc] init];
|
_titleLabel = [[UILabel alloc] init];
|
||||||
_titleLabel.text = @"您当前绑定的手机号为";
|
_titleLabel.text = @"您当前绑定的手机号为";
|
||||||
_titleLabel.textColor = [ThemeColor secondTextColor];
|
_titleLabel.textColor = [MEWThemeColor mewSecondTextColor];
|
||||||
_titleLabel.font = [UIFont systemFontOfSize:14.f];
|
_titleLabel.font = [UIFont systemFontOfSize:14.f];
|
||||||
_titleLabel.adjustsFontSizeToFitWidth = YES;
|
_titleLabel.adjustsFontSizeToFitWidth = YES;
|
||||||
_titleLabel.textAlignment = NSTextAlignmentCenter;
|
_titleLabel.textAlignment = NSTextAlignmentCenter;
|
||||||
@@ -117,7 +117,7 @@
|
|||||||
- (UILabel *)phoneLabel{
|
- (UILabel *)phoneLabel{
|
||||||
if (!_phoneLabel) {
|
if (!_phoneLabel) {
|
||||||
_phoneLabel = [[UILabel alloc] init];
|
_phoneLabel = [[UILabel alloc] init];
|
||||||
_phoneLabel.textColor = [ThemeColor mainTextColor];
|
_phoneLabel.textColor = [MEWThemeColor mewMainTextColor];
|
||||||
_phoneLabel.font = [UIFont boldSystemFontOfSize:18.f];
|
_phoneLabel.font = [UIFont boldSystemFontOfSize:18.f];
|
||||||
_phoneLabel.adjustsFontSizeToFitWidth = YES;
|
_phoneLabel.adjustsFontSizeToFitWidth = YES;
|
||||||
_phoneLabel.textAlignment = NSTextAlignmentCenter;
|
_phoneLabel.textAlignment = NSTextAlignmentCenter;
|
||||||
@@ -129,9 +129,9 @@
|
|||||||
if (!_changePhoneBtn) {
|
if (!_changePhoneBtn) {
|
||||||
_changePhoneBtn = [UIButton buttonWithType:UIButtonTypeCustom];
|
_changePhoneBtn = [UIButton buttonWithType:UIButtonTypeCustom];
|
||||||
[_changePhoneBtn setTitle:@"更改手机号码" forState:UIControlStateNormal];
|
[_changePhoneBtn setTitle:@"更改手机号码" forState:UIControlStateNormal];
|
||||||
[_changePhoneBtn setTitleColor:[ThemeColor confirmButtonTextColor] forState:UIControlStateNormal];
|
[_changePhoneBtn setTitleColor:[MEWThemeColor mewConfirmButtonTextColor] forState:UIControlStateNormal];
|
||||||
[_changePhoneBtn.titleLabel setFont:[UIFont fontWithName:@"PingFang-SC-Medium" size:18]];
|
[_changePhoneBtn.titleLabel setFont:[UIFont fontWithName:@"PingFang-SC-Medium" size:18]];
|
||||||
[_changePhoneBtn setBackgroundImage:[UIImage gradientColorImageFromColors:@[[ThemeColor confirmButtonGradientStartColor], [ThemeColor confirmButtonGradientEndColor]] gradientType:GradientTypeLeftToRight imgSize:CGSizeMake(10, 10)] forState:UIControlStateNormal];
|
[_changePhoneBtn setBackgroundImage:[UIImage gradientColorImageFromColors:@[[MEWThemeColor mewConfirmButtonGradientStartColor], [MEWThemeColor mewConfirmButtonGradientEndColor]] gradientType:GradientTypeLeftToRight imgSize:CGSizeMake(10, 10)] forState:UIControlStateNormal];
|
||||||
_changePhoneBtn.layer.masksToBounds = YES;
|
_changePhoneBtn.layer.masksToBounds = YES;
|
||||||
_changePhoneBtn.layer.cornerRadius = 22.5;
|
_changePhoneBtn.layer.cornerRadius = 22.5;
|
||||||
[_changePhoneBtn addTarget:self action:@selector(changePhoneBtnAction:) forControlEvents:UIControlEventTouchUpInside];
|
[_changePhoneBtn addTarget:self action:@selector(changePhoneBtnAction:) forControlEvents:UIControlEventTouchUpInside];
|
||||||
|
@@ -11,7 +11,7 @@
|
|||||||
#import <ReactiveObjC/ReactiveObjC.h>
|
#import <ReactiveObjC/ReactiveObjC.h>
|
||||||
///Tool
|
///Tool
|
||||||
#import "YMMacro.h"
|
#import "YMMacro.h"
|
||||||
#import "ThemeColor.h"
|
#import "MEWThemeColor.h"
|
||||||
|
|
||||||
//#import "NSString+Utils.h"
|
//#import "NSString+Utils.h"
|
||||||
///Tool
|
///Tool
|
||||||
@@ -158,7 +158,7 @@
|
|||||||
_titleLabel = [[UILabel alloc] init];
|
_titleLabel = [[UILabel alloc] init];
|
||||||
_titleLabel.font = [UIFont fontWithName:@"PingFang-SC-Medium" size:18];
|
_titleLabel.font = [UIFont fontWithName:@"PingFang-SC-Medium" size:18];
|
||||||
_titleLabel.text = @"绑定手机号";
|
_titleLabel.text = @"绑定手机号";
|
||||||
_titleLabel.textColor = [ThemeColor mainTextColor];
|
_titleLabel.textColor = [MEWThemeColor mewMainTextColor];
|
||||||
}
|
}
|
||||||
return _titleLabel;
|
return _titleLabel;
|
||||||
}
|
}
|
||||||
@@ -166,7 +166,7 @@
|
|||||||
- (UIView *)bgView {
|
- (UIView *)bgView {
|
||||||
if (!_bgView) {
|
if (!_bgView) {
|
||||||
_bgView = [[UIView alloc] init];
|
_bgView = [[UIView alloc] init];
|
||||||
_bgView.backgroundColor = [ThemeColor appCellBackgroundColor];
|
_bgView.backgroundColor = [MEWThemeColor mewAppCellBackgroundColor];
|
||||||
_bgView.layer.cornerRadius = 45/2;
|
_bgView.layer.cornerRadius = 45/2;
|
||||||
_bgView.layer.masksToBounds = YES;
|
_bgView.layer.masksToBounds = YES;
|
||||||
}
|
}
|
||||||
@@ -178,7 +178,7 @@
|
|||||||
_countryLabel = [[UILabel alloc] init];
|
_countryLabel = [[UILabel alloc] init];
|
||||||
_countryLabel.font = [UIFont fontWithName:@"PingFang-SC-Medium" size:15];
|
_countryLabel.font = [UIFont fontWithName:@"PingFang-SC-Medium" size:15];
|
||||||
_countryLabel.text = @"+86";
|
_countryLabel.text = @"+86";
|
||||||
_countryLabel.textColor = [ThemeColor mainTextColor];
|
_countryLabel.textColor = [MEWThemeColor mewMainTextColor];
|
||||||
_countryLabel.backgroundColor = [UIColor clearColor];
|
_countryLabel.backgroundColor = [UIColor clearColor];
|
||||||
_countryLabel.textAlignment = NSTextAlignmentCenter;
|
_countryLabel.textAlignment = NSTextAlignmentCenter;
|
||||||
}
|
}
|
||||||
@@ -190,8 +190,8 @@
|
|||||||
_phoneTextField = [[UITextField alloc] init];
|
_phoneTextField = [[UITextField alloc] init];
|
||||||
_phoneTextField.keyboardType = UIKeyboardTypeNumberPad;
|
_phoneTextField.keyboardType = UIKeyboardTypeNumberPad;
|
||||||
_phoneTextField.backgroundColor = [UIColor clearColor];
|
_phoneTextField.backgroundColor = [UIColor clearColor];
|
||||||
_phoneTextField.textColor = [ThemeColor mainTextColor];
|
_phoneTextField.textColor = [MEWThemeColor mewMainTextColor];
|
||||||
// _phoneTextField.tintColor = [ThemeColor appMainColor];
|
// _phoneTextField.tintColor = [MEWThemeColor appMainColor];
|
||||||
_phoneTextField.font = [UIFont fontWithName:@"PingFang-SC-Medium" size:15];
|
_phoneTextField.font = [UIFont fontWithName:@"PingFang-SC-Medium" size:15];
|
||||||
_phoneTextField.textAlignment = NSTextAlignmentLeft;
|
_phoneTextField.textAlignment = NSTextAlignmentLeft;
|
||||||
}
|
}
|
||||||
|
@@ -15,13 +15,13 @@
|
|||||||
#import <Masonry/Masonry.h>
|
#import <Masonry/Masonry.h>
|
||||||
#import <ReactiveObjC/ReactiveObjC.h>
|
#import <ReactiveObjC/ReactiveObjC.h>
|
||||||
///Tool
|
///Tool
|
||||||
#import "ThemeColor.h"
|
#import "MEWThemeColor.h"
|
||||||
#import "CountDownHelper.h"
|
#import "MEWCountDownHelper.h"
|
||||||
#import "YMMacro.h"
|
#import "YMMacro.h"
|
||||||
#import "UIImage+Utils.h"
|
#import "UIImage+Utils.h"
|
||||||
|
|
||||||
|
|
||||||
@interface LoginForgetPasswordViewController ()<LoginForgetPasswordProtocol, CountDownHelperDelegate>
|
@interface LoginForgetPasswordViewController ()<LoginForgetPasswordProtocol, MEWCountDownHelperDelegate>
|
||||||
@property (nonatomic, strong) UIImageView *bgImageView;
|
@property (nonatomic, strong) UIImageView *bgImageView;
|
||||||
///容器
|
///容器
|
||||||
@property (nonatomic,strong) UIStackView *stackView;
|
@property (nonatomic,strong) UIStackView *stackView;
|
||||||
@@ -46,7 +46,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
- (void)dealloc {
|
- (void)dealloc {
|
||||||
[[CountDownHelper shareHelper] stopCountDown];
|
[[MEWCountDownHelper shareHelper] mewStopCountDown];
|
||||||
}
|
}
|
||||||
|
|
||||||
- (BOOL)isHiddenNavBar {
|
- (BOOL)isHiddenNavBar {
|
||||||
@@ -63,7 +63,7 @@
|
|||||||
|
|
||||||
- (void)viewDidDisappear:(BOOL)animated {
|
- (void)viewDidDisappear:(BOOL)animated {
|
||||||
[super viewDidDisappear:animated];
|
[super viewDidDisappear:animated];
|
||||||
[[CountDownHelper shareHelper] stopCountDown];
|
[[MEWCountDownHelper shareHelper] mewStopCountDown];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -72,22 +72,22 @@
|
|||||||
- (void)phoneSmsCodeSuccess {
|
- (void)phoneSmsCodeSuccess {
|
||||||
self.codeView.authCodeButton.enabled= NO;
|
self.codeView.authCodeButton.enabled= NO;
|
||||||
[self showSuccessToast:@"验证码发送成功"];
|
[self showSuccessToast:@"验证码发送成功"];
|
||||||
[[CountDownHelper shareHelper] openCountdownWithTime:60];
|
[[MEWCountDownHelper shareHelper] mewOpenCountdownWithTime:60];
|
||||||
}
|
}
|
||||||
///重置密码成功
|
///重置密码成功
|
||||||
- (void)resetPasswrodSuccess {
|
- (void)resetPasswrodSuccess {
|
||||||
[[CountDownHelper shareHelper] stopCountDown];
|
[[MEWCountDownHelper shareHelper] mewStopCountDown];
|
||||||
[self showSuccessToast:@"重置密码成功"];
|
[self showSuccessToast:@"重置密码成功"];
|
||||||
[self.navigationController popViewControllerAnimated:YES];
|
[self.navigationController popViewControllerAnimated:YES];
|
||||||
|
|
||||||
}
|
}
|
||||||
#pragma mark - CountDownHelperDelegate
|
#pragma mark - CountDownHelperDelegate
|
||||||
///倒计时进行中
|
///倒计时进行中
|
||||||
- (void)onCountdownOpen:(int)time {
|
- (void)mewOnCountdownOpen:(int)time {
|
||||||
[self.codeView.authCodeButton setTitle:[NSString stringWithFormat:@"%ds后重试", time] forState:UIControlStateDisabled];
|
[self.codeView.authCodeButton setTitle:[NSString stringWithFormat:@"%ds后重试", time] forState:UIControlStateDisabled];
|
||||||
}
|
}
|
||||||
///倒计时结束
|
///倒计时结束
|
||||||
- (void)onCountdownFinish {
|
- (void)mewOnCountdownFinish {
|
||||||
self.codeView.authCodeButton.enabled= YES;
|
self.codeView.authCodeButton.enabled= YES;
|
||||||
[self.codeView.authCodeButton setTitle:@"重新发送" forState:UIControlStateNormal];
|
[self.codeView.authCodeButton setTitle:@"重新发送" forState:UIControlStateNormal];
|
||||||
}
|
}
|
||||||
@@ -113,7 +113,7 @@
|
|||||||
#pragma mark - Private Method
|
#pragma mark - Private Method
|
||||||
- (void)initSubViews {
|
- (void)initSubViews {
|
||||||
// self.titleLabel.text = @"忘记密码";
|
// self.titleLabel.text = @"忘记密码";
|
||||||
[CountDownHelper shareHelper].delegate = self;
|
[MEWCountDownHelper shareHelper].delegate = self;
|
||||||
[self.view addSubview:self.bgImageView];
|
[self.view addSubview:self.bgImageView];
|
||||||
[self.view addSubview:self.backButton];
|
[self.view addSubview:self.backButton];
|
||||||
[self.view addSubview:self.titleLabel];
|
[self.view addSubview:self.titleLabel];
|
||||||
@@ -226,7 +226,7 @@
|
|||||||
[_finishButton setImage:[UIImage imageNamed:@"mew_login_next"] forState:UIControlStateNormal];
|
[_finishButton setImage:[UIImage imageNamed:@"mew_login_next"] forState:UIControlStateNormal];
|
||||||
_finishButton.titleLabel.font = [UIFont fontWithName:@"PingFang-SC-Medium" size:18];
|
_finishButton.titleLabel.font = [UIFont fontWithName:@"PingFang-SC-Medium" size:18];
|
||||||
[_finishButton setTitleColor:UIColor.blackColor forState:UIControlStateNormal];
|
[_finishButton setTitleColor:UIColor.blackColor forState:UIControlStateNormal];
|
||||||
UIImage *image = [UIImage gradientColorImageFromColors:@[[ThemeColor colorWithHexString:@"#FF60FD"], [ThemeColor colorWithHexString:@"#8974FF"],[ThemeColor colorWithHexString:@"#69EBFF"]] gradientType:GradientTypeLeftToRight imgSize:CGSizeMake(KScreenWidth - 2*36, 52)];
|
UIImage *image = [UIImage gradientColorImageFromColors:@[[MEWThemeColor mewColorWithHexString:@"#FF60FD"], [MEWThemeColor mewColorWithHexString:@"#8974FF"],[MEWThemeColor mewColorWithHexString:@"#69EBFF"]] gradientType:GradientTypeLeftToRight imgSize:CGSizeMake(KScreenWidth - 2*36, 52)];
|
||||||
_finishButton.backgroundColor = [UIColor colorWithPatternImage:image];
|
_finishButton.backgroundColor = [UIColor colorWithPatternImage:image];
|
||||||
[_finishButton addTarget:self action:@selector(finishButtonAction:) forControlEvents:UIControlEventTouchUpInside];
|
[_finishButton addTarget:self action:@selector(finishButtonAction:) forControlEvents:UIControlEventTouchUpInside];
|
||||||
}
|
}
|
||||||
@@ -263,7 +263,7 @@
|
|||||||
_codeView.placeholder = @"请输入验证码";
|
_codeView.placeholder = @"请输入验证码";
|
||||||
_codeView.type = LoginForgetEditViewTypeSms;
|
_codeView.type = LoginForgetEditViewTypeSms;
|
||||||
_codeView.backgroundColor = UIColor.whiteColor;
|
_codeView.backgroundColor = UIColor.whiteColor;
|
||||||
[_codeView.authCodeButton setTitleColor:[ThemeColor colorWithHexString:@"#9552FF"] forState:UIControlStateNormal];
|
[_codeView.authCodeButton setTitleColor:[MEWThemeColor mewColorWithHexString:@"#9552FF"] forState:UIControlStateNormal];
|
||||||
_codeView.layer.cornerRadius = 52/2.f;
|
_codeView.layer.cornerRadius = 52/2.f;
|
||||||
_codeView.layer.masksToBounds = YES;
|
_codeView.layer.masksToBounds = YES;
|
||||||
[_codeView.authCodeButton addTarget:self action:@selector(authCodeButtonAction:) forControlEvents:UIControlEventTouchUpInside];
|
[_codeView.authCodeButton addTarget:self action:@selector(authCodeButtonAction:) forControlEvents:UIControlEventTouchUpInside];
|
||||||
|
@@ -10,11 +10,11 @@
|
|||||||
#import <Masonry.h>
|
#import <Masonry.h>
|
||||||
#import <ReactiveObjC/ReactiveObjC.h>
|
#import <ReactiveObjC/ReactiveObjC.h>
|
||||||
///Tool
|
///Tool
|
||||||
#import "ThemeColor.h"
|
#import "MEWThemeColor.h"
|
||||||
#import "YMMacro.h"
|
#import "YMMacro.h"
|
||||||
#import "AccountInfoStorage.h"
|
#import "AccountInfoStorage.h"
|
||||||
#import "UIImage+Utils.h"
|
#import "UIImage+Utils.h"
|
||||||
#import "YMHUDTool.h"
|
#import "MewHUDTool.h"
|
||||||
#import "NewEncryptTool.h"
|
#import "NewEncryptTool.h"
|
||||||
///Model
|
///Model
|
||||||
#import "ThirdUserInfo.h"
|
#import "ThirdUserInfo.h"
|
||||||
@@ -91,12 +91,12 @@
|
|||||||
/// 下一步
|
/// 下一步
|
||||||
- (void)nextButtonAction {
|
- (void)nextButtonAction {
|
||||||
if (self.sexString.length == 0 || [self.sexString isEqualToString:@""]) {
|
if (self.sexString.length == 0 || [self.sexString isEqualToString:@""]) {
|
||||||
[YMHUDTool showErrorWithMessage:@"请选择性别"];
|
[MewHUDTool showErrorWithMessage:@"请选择性别"];
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (self.textField.text.length == 0 || [self.textField.text isEqualToString:@""]) {
|
if (self.textField.text.length == 0 || [self.textField.text isEqualToString:@""]) {
|
||||||
[YMHUDTool showErrorWithMessage:@"请输入昵称"];
|
[MewHUDTool showErrorWithMessage:@"请输入昵称"];
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -129,7 +129,7 @@
|
|||||||
if (self.textField.text.length > 0 && self.sexString.length > 0) {
|
if (self.textField.text.length > 0 && self.sexString.length > 0) {
|
||||||
self.nextButton.enabled = YES;
|
self.nextButton.enabled = YES;
|
||||||
} else {
|
} else {
|
||||||
// [YMHUDTool showErrorWithMessage:@"请填写资料"];
|
// [MewHUDTool showErrorWithMessage:@"请填写资料"];
|
||||||
self.nextButton.enabled = NO;
|
self.nextButton.enabled = NO;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -279,7 +279,7 @@
|
|||||||
- (UITextField *)textField {
|
- (UITextField *)textField {
|
||||||
if (!_textField) {
|
if (!_textField) {
|
||||||
_textField = [[UITextField alloc] init];
|
_textField = [[UITextField alloc] init];
|
||||||
_textField.textColor = [ThemeColor mainTextColor];
|
_textField.textColor = [MEWThemeColor mewMainTextColor];
|
||||||
_textField.font = [UIFont fontWithName:@"PingFang-SC-Medium" size:15.f];
|
_textField.font = [UIFont fontWithName:@"PingFang-SC-Medium" size:15.f];
|
||||||
_textField.textAlignment = NSTextAlignmentLeft;
|
_textField.textAlignment = NSTextAlignmentLeft;
|
||||||
_textField.placeholder = @"请输入昵称";
|
_textField.placeholder = @"请输入昵称";
|
||||||
@@ -325,7 +325,7 @@
|
|||||||
_nextButton.layer.cornerRadius = 52/2.f;
|
_nextButton.layer.cornerRadius = 52/2.f;
|
||||||
[_nextButton setImage:[UIImage imageNamed:@"mew_login_next"] forState:UIControlStateNormal];
|
[_nextButton setImage:[UIImage imageNamed:@"mew_login_next"] forState:UIControlStateNormal];
|
||||||
_nextButton.titleLabel.font = [UIFont fontWithName:@"PingFang-SC-Medium" size:18];
|
_nextButton.titleLabel.font = [UIFont fontWithName:@"PingFang-SC-Medium" size:18];
|
||||||
UIImage *image = [UIImage gradientColorImageFromColors:@[[ThemeColor colorWithHexString:@"#FF60FD"], [ThemeColor colorWithHexString:@"#8974FF"],[ThemeColor colorWithHexString:@"#69EBFF"]] gradientType:GradientTypeLeftToRight imgSize:CGSizeMake(KScreenWidth - 2*36, 52)];
|
UIImage *image = [UIImage gradientColorImageFromColors:@[[MEWThemeColor mewColorWithHexString:@"#FF60FD"], [MEWThemeColor mewColorWithHexString:@"#8974FF"],[MEWThemeColor mewColorWithHexString:@"#69EBFF"]] gradientType:GradientTypeLeftToRight imgSize:CGSizeMake(KScreenWidth - 2*36, 52)];
|
||||||
_nextButton.backgroundColor = [UIColor colorWithPatternImage:image];
|
_nextButton.backgroundColor = [UIColor colorWithPatternImage:image];
|
||||||
[_nextButton addTarget:self action:@selector(nextButtonAction) forControlEvents:UIControlEventTouchUpInside];
|
[_nextButton addTarget:self action:@selector(nextButtonAction) forControlEvents:UIControlEventTouchUpInside];
|
||||||
}
|
}
|
||||||
|
@@ -10,12 +10,12 @@
|
|||||||
#import <Masonry/Masonry.h>
|
#import <Masonry/Masonry.h>
|
||||||
#import <ReactiveObjC/ReactiveObjC.h>
|
#import <ReactiveObjC/ReactiveObjC.h>
|
||||||
///Tool
|
///Tool
|
||||||
#import "ThemeColor.h"
|
#import "MEWThemeColor.h"
|
||||||
#import "YMConstant.h"
|
#import "YMConstant.h"
|
||||||
#import "YMMacro.h"
|
#import "YMMacro.h"
|
||||||
#import "UIImage+Utils.h"
|
#import "UIImage+Utils.h"
|
||||||
#import "YMHUDTool.h"
|
#import "MewHUDTool.h"
|
||||||
#import "CountDownHelper.h"
|
#import "MEWCountDownHelper.h"
|
||||||
///Model
|
///Model
|
||||||
#import "UserInfoModel.h"
|
#import "UserInfoModel.h"
|
||||||
///P
|
///P
|
||||||
@@ -25,7 +25,7 @@
|
|||||||
#import "LoginBindPhoneViewController.h"
|
#import "LoginBindPhoneViewController.h"
|
||||||
//#import "MineSettingViewController.h"
|
//#import "MineSettingViewController.h"
|
||||||
|
|
||||||
@interface LoginVerifBindPhoneViewController ()<LoginVerifBindPhoneProtocol, CountDownHelperDelegate>
|
@interface LoginVerifBindPhoneViewController ()<LoginVerifBindPhoneProtocol, MEWCountDownHelperDelegate>
|
||||||
@property (nonatomic, strong) UIView *containerView;
|
@property (nonatomic, strong) UIView *containerView;
|
||||||
|
|
||||||
@property (nonatomic, strong) UIImageView *bgImageView;
|
@property (nonatomic, strong) UIImageView *bgImageView;
|
||||||
@@ -53,7 +53,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
- (void)dealloc {
|
- (void)dealloc {
|
||||||
[[CountDownHelper shareHelper] stopCountDown];
|
[[MEWCountDownHelper shareHelper] mewStopCountDown];
|
||||||
}
|
}
|
||||||
|
|
||||||
- (LoginVerifBindPhonePresenter *)createPresenter {
|
- (LoginVerifBindPhonePresenter *)createPresenter {
|
||||||
@@ -70,12 +70,12 @@
|
|||||||
|
|
||||||
- (void)viewDidDisappear:(BOOL)animated {
|
- (void)viewDidDisappear:(BOOL)animated {
|
||||||
[super viewDidDisappear:animated];
|
[super viewDidDisappear:animated];
|
||||||
[[CountDownHelper shareHelper] stopCountDown];
|
[[MEWCountDownHelper shareHelper] mewStopCountDown];
|
||||||
}
|
}
|
||||||
|
|
||||||
#pragma mark - Private Method
|
#pragma mark - Private Method
|
||||||
- (void)initSubViews {
|
- (void)initSubViews {
|
||||||
[CountDownHelper shareHelper].delegate = self;
|
[MEWCountDownHelper shareHelper].delegate = self;
|
||||||
[self.view addSubview:self.containerView];
|
[self.view addSubview:self.containerView];
|
||||||
[self.containerView addSubview:self.bgImageView];
|
[self.containerView addSubview:self.bgImageView];
|
||||||
[self.containerView addSubview:self.backButton];
|
[self.containerView addSubview:self.backButton];
|
||||||
@@ -268,12 +268,12 @@
|
|||||||
- (void)phoneSmsCodeSuccess {
|
- (void)phoneSmsCodeSuccess {
|
||||||
self.authCodeBtn.enabled = NO;
|
self.authCodeBtn.enabled = NO;
|
||||||
[self showSuccessToast:@"验证码发送成功"];
|
[self showSuccessToast:@"验证码发送成功"];
|
||||||
[[CountDownHelper shareHelper] openCountdownWithTime:60];
|
[[MEWCountDownHelper shareHelper] mewOpenCountdownWithTime:60];
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void)checkMoblieCodeWithMoblieSuccess {
|
- (void)checkMoblieCodeWithMoblieSuccess {
|
||||||
[self showSuccessToast:@"验证成功"];
|
[self showSuccessToast:@"验证成功"];
|
||||||
[[CountDownHelper shareHelper] stopCountDown];
|
[[MEWCountDownHelper shareHelper] mewStopCountDown];
|
||||||
// LoginVerifBindPhoneViewController *vc = [[LoginVerifBindPhoneViewController alloc] init];
|
// LoginVerifBindPhoneViewController *vc = [[LoginVerifBindPhoneViewController alloc] init];
|
||||||
// vc.bindingPhoneNumType = XPBindingPhoneNumTypeEdit;
|
// vc.bindingPhoneNumType = XPBindingPhoneNumTypeEdit;
|
||||||
// vc.userInfo = self.userInfo;
|
// vc.userInfo = self.userInfo;
|
||||||
@@ -281,13 +281,13 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
- (void)bindMoblieCodeWithMoblieSuccess {
|
- (void)bindMoblieCodeWithMoblieSuccess {
|
||||||
[[CountDownHelper shareHelper] stopCountDown];
|
[[MEWCountDownHelper shareHelper] mewStopCountDown];
|
||||||
// 修改绑定信息
|
// 修改绑定信息
|
||||||
if (self.bindingPhoneNumType == XPBindingPhoneNumTypeEdit) {
|
if (self.bindingPhoneNumType == XPBindingPhoneNumTypeEdit) {
|
||||||
|
|
||||||
} else if (self.bindingPhoneNumType == XPBindingPhoneNumTypeNormal) {
|
} else if (self.bindingPhoneNumType == XPBindingPhoneNumTypeNormal) {
|
||||||
// @weakify(self);
|
// @weakify(self);
|
||||||
[YMHUDTool showSuccessWithMessage:@"绑定成功"];
|
[MewHUDTool showSuccessWithMessage:@"绑定成功"];
|
||||||
[self.navigationController popViewControllerAnimated:YES];
|
[self.navigationController popViewControllerAnimated:YES];
|
||||||
}
|
}
|
||||||
self.confirmBtn.enabled = YES; // 打开交互
|
self.confirmBtn.enabled = YES; // 打开交互
|
||||||
@@ -296,11 +296,11 @@
|
|||||||
|
|
||||||
#pragma mark - CountDownHelperDelegate
|
#pragma mark - CountDownHelperDelegate
|
||||||
///倒计时进行中
|
///倒计时进行中
|
||||||
- (void)onCountdownOpen:(int)time {
|
- (void)mewOnCountdownOpen:(int)time {
|
||||||
[self.authCodeBtn setTitle:[NSString stringWithFormat:@"%ds后重试", time] forState:UIControlStateDisabled];
|
[self.authCodeBtn setTitle:[NSString stringWithFormat:@"%ds后重试", time] forState:UIControlStateDisabled];
|
||||||
}
|
}
|
||||||
///倒计时结束
|
///倒计时结束
|
||||||
- (void)onCountdownFinish {
|
- (void)mewOnCountdownFinish {
|
||||||
self.authCodeBtn.enabled= YES;
|
self.authCodeBtn.enabled= YES;
|
||||||
[self.authCodeBtn setTitle:@"重新发送" forState:UIControlStateNormal];
|
[self.authCodeBtn setTitle:@"重新发送" forState:UIControlStateNormal];
|
||||||
}
|
}
|
||||||
@@ -309,7 +309,7 @@
|
|||||||
- (UIView *)containerView{
|
- (UIView *)containerView{
|
||||||
if (!_containerView) {
|
if (!_containerView) {
|
||||||
_containerView = [[UIView alloc] init];
|
_containerView = [[UIView alloc] init];
|
||||||
_containerView.backgroundColor = [ThemeColor appBackgroundColor];
|
_containerView.backgroundColor = [MEWThemeColor mewAppBackgroundColor];
|
||||||
}
|
}
|
||||||
return _containerView;
|
return _containerView;
|
||||||
}
|
}
|
||||||
@@ -344,7 +344,7 @@
|
|||||||
if (!_areaCodeLabel) {
|
if (!_areaCodeLabel) {
|
||||||
_areaCodeLabel = [[UILabel alloc] init];
|
_areaCodeLabel = [[UILabel alloc] init];
|
||||||
_areaCodeLabel.text = @"+86";
|
_areaCodeLabel.text = @"+86";
|
||||||
_areaCodeLabel.textColor = [ThemeColor secondTextColor];
|
_areaCodeLabel.textColor = [MEWThemeColor mewSecondTextColor];
|
||||||
_areaCodeLabel.font = [UIFont systemFontOfSize:14.f];
|
_areaCodeLabel.font = [UIFont systemFontOfSize:14.f];
|
||||||
_areaCodeLabel.adjustsFontSizeToFitWidth = YES;
|
_areaCodeLabel.adjustsFontSizeToFitWidth = YES;
|
||||||
}
|
}
|
||||||
@@ -360,7 +360,7 @@
|
|||||||
_confirmBtn.layer.cornerRadius = 52/2.f;
|
_confirmBtn.layer.cornerRadius = 52/2.f;
|
||||||
_confirmBtn.layer.masksToBounds = YES;
|
_confirmBtn.layer.masksToBounds = YES;
|
||||||
_confirmBtn.enabled = NO;
|
_confirmBtn.enabled = NO;
|
||||||
UIImage *image = [UIImage gradientColorImageFromColors:@[[ThemeColor colorWithHexString:@"#FF60FD"], [ThemeColor colorWithHexString:@"#8974FF"],[ThemeColor colorWithHexString:@"#69EBFF"]] gradientType:GradientTypeLeftToRight imgSize:CGSizeMake(KScreenWidth - 2*36, 52)];
|
UIImage *image = [UIImage gradientColorImageFromColors:@[[MEWThemeColor mewColorWithHexString:@"#FF60FD"], [MEWThemeColor mewColorWithHexString:@"#8974FF"],[MEWThemeColor mewColorWithHexString:@"#69EBFF"]] gradientType:GradientTypeLeftToRight imgSize:CGSizeMake(KScreenWidth - 2*36, 52)];
|
||||||
_confirmBtn.backgroundColor = [UIColor colorWithPatternImage:image];
|
_confirmBtn.backgroundColor = [UIColor colorWithPatternImage:image];
|
||||||
}
|
}
|
||||||
return _confirmBtn;
|
return _confirmBtn;
|
||||||
@@ -370,9 +370,9 @@
|
|||||||
if (!_authCodeBtn) {
|
if (!_authCodeBtn) {
|
||||||
_authCodeBtn = [UIButton buttonWithType:UIButtonTypeCustom];
|
_authCodeBtn = [UIButton buttonWithType:UIButtonTypeCustom];
|
||||||
[_authCodeBtn setTitle:@"获取验证码" forState:UIControlStateNormal];
|
[_authCodeBtn setTitle:@"获取验证码" forState:UIControlStateNormal];
|
||||||
[_authCodeBtn setTitleColor:[ThemeColor colorWithHexString:@"#9552FF"] forState:UIControlStateNormal];
|
[_authCodeBtn setTitleColor:[MEWThemeColor mewColorWithHexString:@"#9552FF"] forState:UIControlStateNormal];
|
||||||
// [_authCodeBtn setTitleColor:[ThemeColor appMainColor] forState:UIControlStateNormal];
|
// [_authCodeBtn setTitleColor:[MEWThemeColor appMainColor] forState:UIControlStateNormal];
|
||||||
[_authCodeBtn setTitleColor:[ThemeColor secondTextColor] forState:UIControlStateDisabled];
|
[_authCodeBtn setTitleColor:[MEWThemeColor mewSecondTextColor] forState:UIControlStateDisabled];
|
||||||
[_authCodeBtn.titleLabel setFont:[UIFont systemFontOfSize:12.f]];
|
[_authCodeBtn.titleLabel setFont:[UIFont systemFontOfSize:12.f]];
|
||||||
}
|
}
|
||||||
return _authCodeBtn;
|
return _authCodeBtn;
|
||||||
@@ -390,13 +390,13 @@
|
|||||||
- (UITextField *)phoneNumTextField {
|
- (UITextField *)phoneNumTextField {
|
||||||
if (!_phoneNumTextField) {
|
if (!_phoneNumTextField) {
|
||||||
_phoneNumTextField = [[UITextField alloc] init];
|
_phoneNumTextField = [[UITextField alloc] init];
|
||||||
_phoneNumTextField.textColor = [ThemeColor mainTextColor];
|
_phoneNumTextField.textColor = [MEWThemeColor mewMainTextColor];
|
||||||
_phoneNumTextField.font = [UIFont systemFontOfSize:14.f];
|
_phoneNumTextField.font = [UIFont systemFontOfSize:14.f];
|
||||||
_phoneNumTextField.attributedPlaceholder = [[NSAttributedString alloc] initWithString:@"输入手机号"attributes:@{NSForegroundColorAttributeName: [ThemeColor secondTextColor]}];
|
_phoneNumTextField.attributedPlaceholder = [[NSAttributedString alloc] initWithString:@"输入手机号"attributes:@{NSForegroundColorAttributeName: [MEWThemeColor mewSecondTextColor]}];
|
||||||
_phoneNumTextField.clearButtonMode = UITextFieldViewModeWhileEditing;
|
_phoneNumTextField.clearButtonMode = UITextFieldViewModeWhileEditing;
|
||||||
_phoneNumTextField.borderStyle = UITextBorderStyleNone;
|
_phoneNumTextField.borderStyle = UITextBorderStyleNone;
|
||||||
_phoneNumTextField.keyboardType = UIKeyboardTypeNumberPad;
|
_phoneNumTextField.keyboardType = UIKeyboardTypeNumberPad;
|
||||||
_phoneNumTextField.tintColor = [ThemeColor mainTextColor];
|
_phoneNumTextField.tintColor = [MEWThemeColor mewMainTextColor];
|
||||||
}
|
}
|
||||||
return _phoneNumTextField;
|
return _phoneNumTextField;
|
||||||
}
|
}
|
||||||
@@ -414,13 +414,13 @@
|
|||||||
- (UITextField *)authCodeTextField {
|
- (UITextField *)authCodeTextField {
|
||||||
if (!_authCodeTextField) {
|
if (!_authCodeTextField) {
|
||||||
_authCodeTextField = [[UITextField alloc] init];
|
_authCodeTextField = [[UITextField alloc] init];
|
||||||
_authCodeTextField.textColor = [ThemeColor mainTextColor];
|
_authCodeTextField.textColor = [MEWThemeColor mewMainTextColor];
|
||||||
_authCodeTextField.font = [UIFont systemFontOfSize:14.f];
|
_authCodeTextField.font = [UIFont systemFontOfSize:14.f];
|
||||||
_authCodeTextField.attributedPlaceholder = [[NSAttributedString alloc] initWithString:@"输入验证码"attributes:@{NSForegroundColorAttributeName: [ThemeColor secondTextColor]}];
|
_authCodeTextField.attributedPlaceholder = [[NSAttributedString alloc] initWithString:@"输入验证码"attributes:@{NSForegroundColorAttributeName: [MEWThemeColor mewSecondTextColor]}];
|
||||||
_authCodeTextField.clearButtonMode = UITextFieldViewModeWhileEditing;
|
_authCodeTextField.clearButtonMode = UITextFieldViewModeWhileEditing;
|
||||||
_authCodeTextField.borderStyle = UITextBorderStyleNone;
|
_authCodeTextField.borderStyle = UITextBorderStyleNone;
|
||||||
_authCodeTextField.keyboardType = UIKeyboardTypeNumberPad;
|
_authCodeTextField.keyboardType = UIKeyboardTypeNumberPad;
|
||||||
_authCodeTextField.tintColor = [ThemeColor mainTextColor];
|
_authCodeTextField.tintColor = [MEWThemeColor mewMainTextColor];
|
||||||
}
|
}
|
||||||
return _authCodeTextField;
|
return _authCodeTextField;
|
||||||
}
|
}
|
||||||
|
@@ -12,7 +12,7 @@
|
|||||||
#import <Masonry/Masonry.h>
|
#import <Masonry/Masonry.h>
|
||||||
#import <ReactiveObjC/ReactiveObjC.h>
|
#import <ReactiveObjC/ReactiveObjC.h>
|
||||||
///Tool
|
///Tool
|
||||||
#import "ThemeColor.h"
|
#import "MEWThemeColor.h"
|
||||||
#import "UIButton+EnlargeTouchArea.h"
|
#import "UIButton+EnlargeTouchArea.h"
|
||||||
#import "UIImage+Utils.h"
|
#import "UIImage+Utils.h"
|
||||||
#import "YMMacro.h"
|
#import "YMMacro.h"
|
||||||
@@ -60,7 +60,7 @@
|
|||||||
|
|
||||||
- (void)viewDidLoad {
|
- (void)viewDidLoad {
|
||||||
[super viewDidLoad];
|
[super viewDidLoad];
|
||||||
self.view.backgroundColor = [ThemeColor colorWithHexString:@"#14171B"];
|
self.view.backgroundColor = [MEWThemeColor mewColorWithHexString:@"#14171B"];
|
||||||
[self initSubViews];
|
[self initSubViews];
|
||||||
[self initSubViewConstraints];
|
[self initSubViewConstraints];
|
||||||
}
|
}
|
||||||
@@ -251,7 +251,7 @@
|
|||||||
_submitButton.layer.masksToBounds = YES;
|
_submitButton.layer.masksToBounds = YES;
|
||||||
_submitButton.layer.cornerRadius = 52/2;
|
_submitButton.layer.cornerRadius = 52/2;
|
||||||
_submitButton.enabled = YES;
|
_submitButton.enabled = YES;
|
||||||
UIImage *image = [UIImage gradientColorImageFromColors:@[[ThemeColor colorWithHexString:@"#FF60FD"], [ThemeColor colorWithHexString:@"#8974FF"],[ThemeColor colorWithHexString:@"#69EBFF"]] gradientType:GradientTypeLeftToRight imgSize:CGSizeMake(KScreenWidth - 2*36, 52)];
|
UIImage *image = [UIImage gradientColorImageFromColors:@[[MEWThemeColor mewColorWithHexString:@"#FF60FD"], [MEWThemeColor mewColorWithHexString:@"#8974FF"],[MEWThemeColor mewColorWithHexString:@"#69EBFF"]] gradientType:GradientTypeLeftToRight imgSize:CGSizeMake(KScreenWidth - 2*36, 52)];
|
||||||
_submitButton.backgroundColor = [UIColor colorWithPatternImage:image];
|
_submitButton.backgroundColor = [UIColor colorWithPatternImage:image];
|
||||||
[_submitButton addTarget:self action:@selector(submitButtonAction:) forControlEvents:UIControlEventTouchUpInside];
|
[_submitButton addTarget:self action:@selector(submitButtonAction:) forControlEvents:UIControlEventTouchUpInside];
|
||||||
}
|
}
|
||||||
|
@@ -5,7 +5,7 @@
|
|||||||
// Created by 触海 on 2023/11/16.
|
// Created by 触海 on 2023/11/16.
|
||||||
//
|
//
|
||||||
|
|
||||||
#import "NSObject+MJExtension.h"
|
#import "NSObject+MEWExtension.h"
|
||||||
|
|
||||||
NS_ASSUME_NONNULL_BEGIN
|
NS_ASSUME_NONNULL_BEGIN
|
||||||
|
|
||||||
|
@@ -18,7 +18,7 @@
|
|||||||
@implementation CHMessagePresenter
|
@implementation CHMessagePresenter
|
||||||
- (void)getChatLimitReceiverUid:(NSString *)receiverUid {
|
- (void)getChatLimitReceiverUid:(NSString *)receiverUid {
|
||||||
[Api getChatLimit:[self createHttpCompletion:^(BaseModel * _Nonnull data) {
|
[Api getChatLimit:[self createHttpCompletion:^(BaseModel * _Nonnull data) {
|
||||||
ChatLimitModel *chatLimit = [ChatLimitModel modelWithJSON:data.data];
|
ChatLimitModel *chatLimit = [ChatLimitModel mewModelWithJSON:data.data];
|
||||||
[[self getView] onGetLimitChat:chatLimit];
|
[[self getView] onGetLimitChat:chatLimit];
|
||||||
} showLoading:NO errorToast:NO] receiverUid:receiverUid];
|
} showLoading:NO errorToast:NO] receiverUid:receiverUid];
|
||||||
}
|
}
|
||||||
@@ -27,7 +27,7 @@
|
|||||||
/// @param uid 用户uid
|
/// @param uid 用户uid
|
||||||
- (void)getUserInfo:(NSString *)uid {
|
- (void)getUserInfo:(NSString *)uid {
|
||||||
[Api userDetailInfoCompletion:[self createHttpCompletion:^(BaseModel * _Nonnull data) {
|
[Api userDetailInfoCompletion:[self createHttpCompletion:^(BaseModel * _Nonnull data) {
|
||||||
UserInfoModel * infoModel = [UserInfoModel modelWithDictionary:data.data];
|
UserInfoModel * infoModel = [UserInfoModel mewModelWithDictionary:data.data];
|
||||||
[[self getView] onGetSessionUserInfoSuccess:infoModel];
|
[[self getView] onGetSessionUserInfoSuccess:infoModel];
|
||||||
}fail:^(NSInteger code, NSString * _Nullable msg) {
|
}fail:^(NSInteger code, NSString * _Nullable msg) {
|
||||||
[[self getView]onGetSessionUserInfoFail];
|
[[self getView]onGetSessionUserInfoFail];
|
||||||
|
@@ -10,9 +10,10 @@
|
|||||||
#import <Masonry/Masonry.h>
|
#import <Masonry/Masonry.h>
|
||||||
#import <NIMSDK/NIMSDK.h>
|
#import <NIMSDK/NIMSDK.h>
|
||||||
///Tool
|
///Tool
|
||||||
#import "ThemeColor.h"
|
|
||||||
#import "CHMessageAudioCenter.h"
|
#import "MEWThemeColor.h"
|
||||||
@interface CHMessageConentAudioView ()<NIMMediaManagerDelegate>
|
#import "MessageAudioCenter.h"
|
||||||
|
@interface MessageConentAudioView ()<NIMMediaManagerDelegate>
|
||||||
///背景
|
///背景
|
||||||
@property (nonatomic,strong) UIView * backView;
|
@property (nonatomic,strong) UIView * backView;
|
||||||
///显示语音的时长
|
///显示语音的时长
|
||||||
@@ -114,7 +115,7 @@
|
|||||||
if (!_timeLabel) {
|
if (!_timeLabel) {
|
||||||
_timeLabel = [[UILabel alloc] init];
|
_timeLabel = [[UILabel alloc] init];
|
||||||
_timeLabel.font = [UIFont systemFontOfSize:14 weight:UIFontWeightMedium];
|
_timeLabel.font = [UIFont systemFontOfSize:14 weight:UIFontWeightMedium];
|
||||||
_timeLabel.textColor = [ThemeColor mainTextColor];
|
_timeLabel.textColor = [MEWThemeColor mewMainTextColor];
|
||||||
}
|
}
|
||||||
return _timeLabel;
|
return _timeLabel;
|
||||||
}
|
}
|
||||||
|
@@ -10,7 +10,7 @@
|
|||||||
#import <Masonry/Masonry.h>
|
#import <Masonry/Masonry.h>
|
||||||
#import <NIMSDK/NIMSDK.h>
|
#import <NIMSDK/NIMSDK.h>
|
||||||
///Tool
|
///Tool
|
||||||
#import "ThemeColor.h"
|
#import "MEWThemeColor.h"
|
||||||
#import "NetImageView.h"
|
#import "NetImageView.h"
|
||||||
#import "TTPopup.h"
|
#import "TTPopup.h"
|
||||||
|
|
||||||
@@ -233,7 +233,7 @@
|
|||||||
- (UIView *)infoView {
|
- (UIView *)infoView {
|
||||||
if (!_infoView) {
|
if (!_infoView) {
|
||||||
_infoView = [[UIView alloc] init];
|
_infoView = [[UIView alloc] init];
|
||||||
_infoView.backgroundColor = [ThemeColor appCellBackgroundColor];
|
_infoView.backgroundColor = [MEWThemeColor mewAppCellBackgroundColor];
|
||||||
UITapGestureRecognizer * tap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(didTapUserRecognizer)];
|
UITapGestureRecognizer * tap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(didTapUserRecognizer)];
|
||||||
[_infoView addGestureRecognizer:tap];
|
[_infoView addGestureRecognizer:tap];
|
||||||
_infoView.hidden = YES;
|
_infoView.hidden = YES;
|
||||||
@@ -257,7 +257,7 @@
|
|||||||
if (!_nickLabel) {
|
if (!_nickLabel) {
|
||||||
_nickLabel = [[UILabel alloc] init];
|
_nickLabel = [[UILabel alloc] init];
|
||||||
_nickLabel.font = [UIFont systemFontOfSize:15];
|
_nickLabel.font = [UIFont systemFontOfSize:15];
|
||||||
_nickLabel.textColor = [ThemeColor mainTextColor];
|
_nickLabel.textColor = [MEWThemeColor mewMainTextColor];
|
||||||
}
|
}
|
||||||
return _nickLabel;
|
return _nickLabel;
|
||||||
}
|
}
|
||||||
@@ -267,7 +267,7 @@
|
|||||||
_titleLabel = [[UILabel alloc] init];
|
_titleLabel = [[UILabel alloc] init];
|
||||||
_titleLabel.font = [UIFont systemFontOfSize:14];
|
_titleLabel.font = [UIFont systemFontOfSize:14];
|
||||||
_titleLabel.text = @"个人主页";
|
_titleLabel.text = @"个人主页";
|
||||||
_titleLabel.textColor = [ThemeColor secondTextColor];
|
_titleLabel.textColor = [MEWThemeColor mewSecondTextColor];
|
||||||
}
|
}
|
||||||
return _titleLabel;
|
return _titleLabel;
|
||||||
}
|
}
|
||||||
@@ -297,9 +297,9 @@
|
|||||||
if (!_reportButton) {
|
if (!_reportButton) {
|
||||||
_reportButton = [UIButton buttonWithType:UIButtonTypeCustom];
|
_reportButton = [UIButton buttonWithType:UIButtonTypeCustom];
|
||||||
[_reportButton setTitle:@"举报" forState:UIControlStateNormal];
|
[_reportButton setTitle:@"举报" forState:UIControlStateNormal];
|
||||||
[_reportButton setTitleColor:[ThemeColor mainTextColor] forState:UIControlStateNormal];
|
[_reportButton setTitleColor:[MEWThemeColor mewMainTextColor] forState:UIControlStateNormal];
|
||||||
_reportButton.titleLabel.font = [UIFont systemFontOfSize:16 weight:UIFontWeightMedium];
|
_reportButton.titleLabel.font = [UIFont systemFontOfSize:16 weight:UIFontWeightMedium];
|
||||||
[_reportButton setBackgroundColor:[ThemeColor appCellBackgroundColor]];
|
[_reportButton setBackgroundColor:[MEWThemeColor mewAppCellBackgroundColor]];
|
||||||
[_reportButton addTarget:self action:@selector(reportButtonAction:) forControlEvents:UIControlEventTouchUpInside];
|
[_reportButton addTarget:self action:@selector(reportButtonAction:) forControlEvents:UIControlEventTouchUpInside];
|
||||||
}
|
}
|
||||||
return _reportButton;
|
return _reportButton;
|
||||||
@@ -308,7 +308,7 @@
|
|||||||
- (UIView *)lineView {
|
- (UIView *)lineView {
|
||||||
if (!_lineView) {
|
if (!_lineView) {
|
||||||
_lineView = [[UIView alloc] init];
|
_lineView = [[UIView alloc] init];
|
||||||
_lineView.backgroundColor = [ThemeColor dividerColor];
|
_lineView.backgroundColor = [MEWThemeColor mewDividerColor];
|
||||||
}
|
}
|
||||||
return _lineView;
|
return _lineView;
|
||||||
}
|
}
|
||||||
@@ -318,10 +318,10 @@
|
|||||||
_blackButton = [UIButton buttonWithType:UIButtonTypeCustom];
|
_blackButton = [UIButton buttonWithType:UIButtonTypeCustom];
|
||||||
[_blackButton setTitle:@"加入黑名单" forState:UIControlStateNormal];
|
[_blackButton setTitle:@"加入黑名单" forState:UIControlStateNormal];
|
||||||
[_blackButton setTitle:@"移除黑名单" forState:UIControlStateSelected];
|
[_blackButton setTitle:@"移除黑名单" forState:UIControlStateSelected];
|
||||||
[_blackButton setTitleColor:[ThemeColor mainTextColor] forState:UIControlStateNormal];
|
[_blackButton setTitleColor:[MEWThemeColor mewMainTextColor] forState:UIControlStateNormal];
|
||||||
[_blackButton setTitleColor:[ThemeColor mainTextColor] forState:UIControlStateSelected];
|
[_blackButton setTitleColor:[MEWThemeColor mewMainTextColor] forState:UIControlStateSelected];
|
||||||
_blackButton.titleLabel.font = [UIFont systemFontOfSize:16 weight:UIFontWeightMedium];
|
_blackButton.titleLabel.font = [UIFont systemFontOfSize:16 weight:UIFontWeightMedium];
|
||||||
[_blackButton setBackgroundColor:[ThemeColor appCellBackgroundColor]];
|
[_blackButton setBackgroundColor:[MEWThemeColor mewAppCellBackgroundColor]];
|
||||||
[_blackButton addTarget:self action:@selector(blackButtonAction:) forControlEvents:UIControlEventTouchUpInside];
|
[_blackButton addTarget:self action:@selector(blackButtonAction:) forControlEvents:UIControlEventTouchUpInside];
|
||||||
_blackButton.hidden = YES;
|
_blackButton.hidden = YES;
|
||||||
}
|
}
|
||||||
|
@@ -13,7 +13,7 @@
|
|||||||
#import "CHMessageContentImage.h"
|
#import "CHMessageContentImage.h"
|
||||||
#import "CHMessageConentAudioView.h"
|
#import "CHMessageConentAudioView.h"
|
||||||
///Tool
|
///Tool
|
||||||
#import "ThemeColor.h"
|
#import "MEWThemeColor.h"
|
||||||
#import "YMMacro.h"
|
#import "YMMacro.h"
|
||||||
#import "NewEncryptTool.h"
|
#import "NewEncryptTool.h"
|
||||||
/// Third
|
/// Third
|
||||||
@@ -312,7 +312,7 @@
|
|||||||
- (UIView *)messageBackground {
|
- (UIView *)messageBackground {
|
||||||
if (!_messageBackground) {
|
if (!_messageBackground) {
|
||||||
_messageBackground = [[UIView alloc]init];
|
_messageBackground = [[UIView alloc]init];
|
||||||
_messageBackground.backgroundColor = [ThemeColor appCellBackgroundColor];
|
_messageBackground.backgroundColor = [MEWThemeColor mewAppCellBackgroundColor];
|
||||||
_messageBackground.layer.masksToBounds = YES;
|
_messageBackground.layer.masksToBounds = YES;
|
||||||
_messageBackground.layer.cornerRadius = 8.f;
|
_messageBackground.layer.cornerRadius = 8.f;
|
||||||
}
|
}
|
||||||
|
@@ -7,7 +7,7 @@
|
|||||||
|
|
||||||
#import "CHSessionNavView.h"
|
#import "CHSessionNavView.h"
|
||||||
/// Tool
|
/// Tool
|
||||||
#import "ThemeColor.h"
|
#import "MEWThemeColor.h"
|
||||||
#import <NIMSDK/NIMSDK.h>
|
#import <NIMSDK/NIMSDK.h>
|
||||||
#import "YMMacro.h"
|
#import "YMMacro.h"
|
||||||
/// Third
|
/// Third
|
||||||
@@ -134,7 +134,7 @@
|
|||||||
if (!_nickLabel) {
|
if (!_nickLabel) {
|
||||||
_nickLabel = [[UILabel alloc] init];
|
_nickLabel = [[UILabel alloc] init];
|
||||||
_nickLabel.font = [UIFont systemFontOfSize:16 weight:UIFontWeightMedium];
|
_nickLabel.font = [UIFont systemFontOfSize:16 weight:UIFontWeightMedium];
|
||||||
_nickLabel.textColor = [ThemeColor mainTextColor];
|
_nickLabel.textColor = [MEWThemeColor mewMainTextColor];
|
||||||
_nickLabel.textAlignment = NSTextAlignmentCenter;
|
_nickLabel.textAlignment = NSTextAlignmentCenter;
|
||||||
}
|
}
|
||||||
return _nickLabel;
|
return _nickLabel;
|
||||||
@@ -147,9 +147,9 @@
|
|||||||
_likeButton.titleLabel.font = [UIFont systemFontOfSize:12 weight:UIFontWeightMedium];
|
_likeButton.titleLabel.font = [UIFont systemFontOfSize:12 weight:UIFontWeightMedium];
|
||||||
_likeButton.layer.cornerRadius = 21/2;
|
_likeButton.layer.cornerRadius = 21/2;
|
||||||
_likeButton.layer.masksToBounds = YES;
|
_likeButton.layer.masksToBounds = YES;
|
||||||
[_likeButton setTitleColor:UIColorFromRGB(0x9552FF) forState:UIControlStateNormal];
|
[_likeButton setTitleColor:UIColorMewFromRGB(0xFFDA24) forState:UIControlStateNormal];
|
||||||
_likeButton.layer.borderWidth = 0.5;
|
_likeButton.layer.borderWidth = 0.5;
|
||||||
_likeButton.layer.borderColor = UIColorFromRGB(0x9552FF).CGColor;
|
_likeButton.layer.borderColor = UIColorMewFromRGB(0xFFDA24).CGColor;
|
||||||
[_likeButton addTarget:self action:@selector(likeButtonAction:) forControlEvents:UIControlEventTouchUpInside];
|
[_likeButton addTarget:self action:@selector(likeButtonAction:) forControlEvents:UIControlEventTouchUpInside];
|
||||||
_likeButton.hidden = NO;
|
_likeButton.hidden = NO;
|
||||||
}
|
}
|
||||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user