更换类名和方法
This commit is contained in:
@@ -8,8 +8,9 @@
|
||||
#import "AppDelegate+ThirdConfig.h"
|
||||
#import <NIMSDK/NIMSDK.h>
|
||||
#import <QYSDK_NIM/QYSDK.h>
|
||||
#import "YMConstant.h"
|
||||
#import "MewCustomAttachmentDecoder.h"
|
||||
#import "MewConstant.h"
|
||||
|
||||
|
||||
@implementation AppDelegate (ThirdConfig)
|
||||
- (void)initThirdConfig {
|
||||
|
@@ -7,8 +7,8 @@
|
||||
|
||||
#import "AppDelegate.h"
|
||||
#import "AppDelegate+ThirdConfig.h"
|
||||
#import "TabbarViewController.h"
|
||||
#import "BaseNavigationController.h"
|
||||
#import "MewTabBarController.h"
|
||||
#import "MewBaseNavigationController.h"
|
||||
/// Third
|
||||
#import <IQKeyboardManager/IQKeyboardManager.h>
|
||||
#import <NIMSDK/NIMSDK.h>
|
||||
@@ -38,8 +38,8 @@
|
||||
|
||||
#pragma mark - Init Tabbar
|
||||
- (void)createTabbarController {
|
||||
TabbarViewController *tab = [[TabbarViewController alloc] init];
|
||||
BaseNavigationController *nav = [[BaseNavigationController alloc] initWithRootViewController:tab];
|
||||
MewTabBarController *tab = [[MewTabBarController alloc] init];
|
||||
MewBaseNavigationController *nav = [[MewBaseNavigationController alloc] initWithRootViewController:tab];
|
||||
self.window = [[UIWindow alloc] initWithFrame:[UIScreen mainScreen].bounds];
|
||||
if (@available(iOS 13.0, *)) {
|
||||
self.window.overrideUserInterfaceStyle = UIUserInterfaceStyleLight;
|
||||
|
@@ -6,7 +6,7 @@
|
||||
//
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
#import "HttpRequestHelper.h"
|
||||
#import "MewHttpRequestHelper.h"
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@@ -18,37 +18,39 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
completion : 网络请求完成的回调
|
||||
... : 可变参数,第一个为 __FUNCTION__ ,接下来依次为该接口的协议参数
|
||||
*/
|
||||
+ (void)makeRequest:(NSString *)route method:(HttpRequestHelperMethod)method completion:(HttpRequestHelperCompletion)completion, ...;
|
||||
+ (void)makeRequest:(NSString *)route method:(MewHttpRequestHelperMethod)method completion:(MewHttpRequestHelperCompletion)completion, ...;
|
||||
|
||||
|
||||
/// 获取用户信息
|
||||
/// @param completion 请求完成
|
||||
/// @param uid 用户id
|
||||
+ (void)getUserInfo:(HttpRequestHelperCompletion)completion uid:(NSString *)uid;
|
||||
+ (void)getUserInfo:(MewHttpRequestHelperCompletion)completion uid:(NSString *)uid;
|
||||
|
||||
/// 获取手机号的验证码
|
||||
/// @param completion 请求完成
|
||||
/// @param mobile 手机号
|
||||
/// @param type 类型 请看XPEunm中的枚举
|
||||
+ (void)mew_phoneSmsCode:(HttpRequestHelperCompletion)completion mobile:(NSString *)mobile type:(NSString *)type;
|
||||
+ (void)mew_phoneSmsCode:(MewHttpRequestHelperCompletion)completion mobile:(NSString *)mobile type:(NSString *)type;
|
||||
|
||||
|
||||
/// 批量验证
|
||||
/// @param complection 完成
|
||||
/// @param transcationIdStr 需要验证的数据
|
||||
+ (void)requestCheckTranscationIds:(HttpRequestHelperCompletion)complection
|
||||
+ (void)requestCheckTranscationIds:(MewHttpRequestHelperCompletion)complection
|
||||
transcationIdStr:(NSString *)transcationIdStr;
|
||||
|
||||
/// 补全用户资料
|
||||
/// @param complection 完成
|
||||
/// @param userInfo 需要更新的用户信息
|
||||
+ (void)completeUserInfo:(HttpRequestHelperCompletion)complection
|
||||
+ (void)mew_completeUserInfo:(MewHttpRequestHelperCompletion)complection
|
||||
userInfo:(NSDictionary *)userInfo;
|
||||
|
||||
/// 获取用户钱包余额信息
|
||||
/// @param complection 完成
|
||||
/// @param uid 用户uid
|
||||
/// @param ticket ticketg
|
||||
+ (void)mew_getUserWalletInfo:(HttpRequestHelperCompletion)complection
|
||||
|
||||
+ (void)mew_getUserWalletInfo:(MewHttpRequestHelperCompletion)complection
|
||||
uid:(NSString *)uid
|
||||
ticket:(NSString *)ticket;
|
||||
|
||||
|
@@ -9,7 +9,7 @@
|
||||
#import "NewEncryptTool.h"
|
||||
@implementation Api
|
||||
|
||||
+ (void)makeRequest:(NSString *)route method:(HttpRequestHelperMethod)method completion:(HttpRequestHelperCompletion)completion, ... {
|
||||
+ (void)makeRequest:(NSString *)route method:(MewHttpRequestHelperMethod)method completion:(MewHttpRequestHelperCompletion)completion, ... {
|
||||
va_list arg_lists;
|
||||
va_start(arg_lists, completion);
|
||||
|
||||
@@ -40,40 +40,40 @@
|
||||
};
|
||||
va_end(arg_lists);
|
||||
|
||||
[HttpRequestHelper request:route method:method params:params completion:completion];
|
||||
[MewHttpRequestHelper request:route method:method params:params completion:completion];
|
||||
}
|
||||
|
||||
/// 获取用户信息
|
||||
+ (void)getUserInfo:(HttpRequestHelperCompletion)completion uid:(NSString *)uid {
|
||||
+ (void)getUserInfo:(MewHttpRequestHelperCompletion)completion uid:(NSString *)uid {
|
||||
NSString *getUrl = [NewEncryptTool MEW_aesDecrypt:@"KEMxFkjgYfZuaj0tYsUeqQ=="];///user/get
|
||||
[self makeRequest:getUrl method:HttpRequestHelperMethodGET completion:completion, __FUNCTION__, uid, nil];
|
||||
[self makeRequest:getUrl method:MewHttpRequestHelperMethodGET completion:completion, __FUNCTION__, uid, nil];
|
||||
}
|
||||
|
||||
/// 批量验证
|
||||
/// @param complection 完成
|
||||
/// @param transcationIdStr 需要验证的数据
|
||||
+ (void)requestCheckTranscationIds:(HttpRequestHelperCompletion)complection
|
||||
+ (void)requestCheckTranscationIds:(MewHttpRequestHelperCompletion)complection
|
||||
transcationIdStr:(NSString *)transcationIdStr {
|
||||
NSString *getUrl = [NewEncryptTool MEW_aesDecrypt:@"AC1UrTdJJWq1b8dtUCnP4zFOik6EzK85rr1GEjLv2Kk="];///verify/checkIOSChargeRecord
|
||||
[self makeRequest:getUrl method:HttpRequestHelperMethodPOST completion:complection, __FUNCTION__,transcationIdStr, nil];
|
||||
[self makeRequest:getUrl method:MewHttpRequestHelperMethodPOST completion:complection, __FUNCTION__,transcationIdStr, nil];
|
||||
}
|
||||
|
||||
/// 获取手机号的验证码
|
||||
/// @param completion 请求完成
|
||||
/// @param mobile 手机号
|
||||
/// @param type 类型 请看XPEunm中的枚举
|
||||
+ (void)mew_phoneSmsCode:(HttpRequestHelperCompletion)completion mobile:(NSString *)mobile type:(NSString *)type {
|
||||
+ (void)mew_phoneSmsCode:(MewHttpRequestHelperCompletion)completion mobile:(NSString *)mobile type:(NSString *)type {
|
||||
NSString *getUrl = [NewEncryptTool MEW_aesDecrypt:@"2Hx71goXCYG6r1fVVkSHsA=="];///sms/getCode
|
||||
[self makeRequest:getUrl method:HttpRequestHelperMethodPOST completion:completion, __FUNCTION__, mobile, type, nil];
|
||||
[self makeRequest:getUrl method:MewHttpRequestHelperMethodPOST completion:completion, __FUNCTION__, mobile, type, nil];
|
||||
}
|
||||
|
||||
/// 补全用户资料
|
||||
/// @param complection 完成
|
||||
/// @param userInfo 需要更新的用户信息
|
||||
+ (void)completeUserInfo:(HttpRequestHelperCompletion)complection
|
||||
+ (void)mew_completeUserInfo:(MewHttpRequestHelperCompletion)complection
|
||||
userInfo:(NSDictionary *)userInfo {
|
||||
NSString *getUrl = [NewEncryptTool MEW_aesDecrypt:@"6A7+MXSz6a7RbsOb9Ls+mA=="];///user/v2/update
|
||||
[HttpRequestHelper request:getUrl method:HttpRequestHelperMethodPOST params:userInfo completion:complection];
|
||||
[MewHttpRequestHelper request:getUrl method:MewHttpRequestHelperMethodPOST params:userInfo completion:complection];
|
||||
}
|
||||
|
||||
|
||||
@@ -81,10 +81,10 @@
|
||||
/// @param complection 完成
|
||||
/// @param uid 用户uid
|
||||
/// @param ticket ticketg
|
||||
+ (void)mew_getUserWalletInfo:(HttpRequestHelperCompletion)complection
|
||||
+ (void)mew_getUserWalletInfo:(MewHttpRequestHelperCompletion)complection
|
||||
uid:(NSString *)uid
|
||||
ticket:(NSString *)ticket {
|
||||
NSString *getUrl = [NewEncryptTool MEW_aesDecrypt:@"7xFYk5dOEOCLb2Sfp0mwZw=="];//purse/query
|
||||
[self makeRequest:getUrl method:HttpRequestHelperMethodGET completion:complection, __FUNCTION__, uid, ticket,nil];
|
||||
[self makeRequest:getUrl method:MewHttpRequestHelperMethodGET completion:complection, __FUNCTION__, uid, ticket,nil];
|
||||
}
|
||||
@end
|
||||
|
@@ -6,7 +6,7 @@
|
||||
//
|
||||
|
||||
#import "NSObject+MEWExtension.h"
|
||||
#import "YMEnum.h"
|
||||
#import "MewEnum.h"
|
||||
|
||||
#import "UserVipInfoVo.h"
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
@@ -7,7 +7,7 @@
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
#import "BaseMvpProtocol.h"
|
||||
#import "HttpRequestHelper.h"
|
||||
#import "MewHttpRequestHelper.h"
|
||||
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
@@ -24,14 +24,14 @@ typedef void(^HttpFail)(NSInteger code, NSString * _Nullable msg);
|
||||
// 退出
|
||||
- (void)logout;
|
||||
|
||||
- (HttpRequestHelperCompletion)createHttpCompletion:(HttpSuccess _Nonnull)success;
|
||||
- (HttpRequestHelperCompletion)createHttpCompletion:(HttpSuccess _Nonnull)success showLoading:(BOOL)loading;
|
||||
- (HttpRequestHelperCompletion)createHttpCompletion:(HttpSuccess _Nonnull)success errorToast:(BOOL)toast;
|
||||
- (HttpRequestHelperCompletion)createHttpCompletion:(HttpSuccess _Nonnull)success showLoading:(BOOL)loading errorToast:(BOOL)toast;
|
||||
- (HttpRequestHelperCompletion)createHttpCompletion:(HttpSuccess _Nonnull)success fail:(HttpFail _Nullable)fail;
|
||||
- (HttpRequestHelperCompletion)createHttpCompletion:(HttpSuccess _Nonnull)success fail:(HttpFail _Nullable)fail showLoading:(BOOL)loading;
|
||||
- (HttpRequestHelperCompletion)createHttpCompletion:(HttpSuccess _Nonnull)success fail:(HttpFail _Nullable)fail errorToast:(BOOL)toast;
|
||||
- (HttpRequestHelperCompletion)createHttpCompletion:(HttpSuccess _Nonnull)success fail:(HttpFail _Nullable)fail showLoading:(BOOL)loading errorToast:(BOOL)toast;
|
||||
- (MewHttpRequestHelperCompletion)createHttpCompletion:(HttpSuccess _Nonnull)success;
|
||||
- (MewHttpRequestHelperCompletion)createHttpCompletion:(HttpSuccess _Nonnull)success mew_showLoading:(BOOL)loading;
|
||||
- (MewHttpRequestHelperCompletion)createHttpCompletion:(HttpSuccess _Nonnull)success errorToast:(BOOL)toast;
|
||||
- (MewHttpRequestHelperCompletion)createHttpCompletion:(HttpSuccess _Nonnull)success mew_showLoading:(BOOL)loading errorToast:(BOOL)toast;
|
||||
- (MewHttpRequestHelperCompletion)createHttpCompletion:(HttpSuccess _Nonnull)success fail:(HttpFail _Nullable)fail;
|
||||
- (MewHttpRequestHelperCompletion)createHttpCompletion:(HttpSuccess _Nonnull)success fail:(HttpFail _Nullable)fail mew_showLoading:(BOOL)loading;
|
||||
- (MewHttpRequestHelperCompletion)createHttpCompletion:(HttpSuccess _Nonnull)success fail:(HttpFail _Nullable)fail errorToast:(BOOL)toast;
|
||||
- (MewHttpRequestHelperCompletion)createHttpCompletion:(HttpSuccess _Nonnull)success fail:(HttpFail _Nullable)fail mew_showLoading:(BOOL)loading errorToast:(BOOL)toast;
|
||||
|
||||
|
||||
|
||||
|
@@ -7,7 +7,7 @@
|
||||
|
||||
#import "BaseMvpPresenter.h"
|
||||
#import "AccountInfoStorage.h"
|
||||
#import "ClientConfig.h"
|
||||
#import "MewClientConfig.h"
|
||||
|
||||
@interface BaseMvpPresenter()
|
||||
|
||||
@@ -30,47 +30,47 @@
|
||||
[[AccountInfoStorage instance] saveTicket:nil];
|
||||
|
||||
///关闭心跳
|
||||
[[ClientConfig shareConfig] resetHeartBratTimer];
|
||||
[[self getView] tokenInvalid];
|
||||
[[MewClientConfig shareConfig] mew_resetHeartBratTimer];
|
||||
[[self getView] mew_getTokenId];
|
||||
}
|
||||
|
||||
|
||||
|
||||
- (HttpRequestHelperCompletion)createHttpCompletion:(HttpSuccess)success {
|
||||
- (MewHttpRequestHelperCompletion)createHttpCompletion:(HttpSuccess)success {
|
||||
return [self createHttpCompletion:success fail:nil];
|
||||
}
|
||||
|
||||
- (HttpRequestHelperCompletion)createHttpCompletion:(HttpSuccess)success showLoading:(BOOL)loading {
|
||||
return [self createHttpCompletion:success fail:nil showLoading:loading];
|
||||
- (MewHttpRequestHelperCompletion)createHttpCompletion:(HttpSuccess)success mew_showLoading:(BOOL)loading {
|
||||
return [self createHttpCompletion:success fail:nil mew_showLoading:loading];
|
||||
}
|
||||
|
||||
- (HttpRequestHelperCompletion)createHttpCompletion:(HttpSuccess)success errorToast:(BOOL)toast {
|
||||
- (MewHttpRequestHelperCompletion)createHttpCompletion:(HttpSuccess)success errorToast:(BOOL)toast {
|
||||
return [self createHttpCompletion:success fail:nil errorToast:toast];
|
||||
}
|
||||
|
||||
- (HttpRequestHelperCompletion)createHttpCompletion:(HttpSuccess)success showLoading:(BOOL)loading errorToast:(BOOL)toast {
|
||||
return [self createHttpCompletion:success fail:nil showLoading:loading errorToast:toast];
|
||||
- (MewHttpRequestHelperCompletion)createHttpCompletion:(HttpSuccess)success mew_showLoading:(BOOL)loading errorToast:(BOOL)toast {
|
||||
return [self createHttpCompletion:success fail:nil mew_showLoading:loading errorToast:toast];
|
||||
}
|
||||
|
||||
- (HttpRequestHelperCompletion)createHttpCompletion:(HttpSuccess)success fail:(HttpFail)fail {
|
||||
return [self createHttpCompletion:success fail:fail showLoading:NO errorToast:YES];
|
||||
- (MewHttpRequestHelperCompletion)createHttpCompletion:(HttpSuccess)success fail:(HttpFail)fail {
|
||||
return [self createHttpCompletion:success fail:fail mew_showLoading:NO errorToast:YES];
|
||||
}
|
||||
|
||||
- (HttpRequestHelperCompletion)createHttpCompletion:(HttpSuccess)success fail:(HttpFail)fail showLoading:(BOOL)loading {
|
||||
return [self createHttpCompletion:success fail:fail showLoading:loading errorToast:YES];
|
||||
- (MewHttpRequestHelperCompletion)createHttpCompletion:(HttpSuccess)success fail:(HttpFail)fail mew_showLoading:(BOOL)loading {
|
||||
return [self createHttpCompletion:success fail:fail mew_showLoading:loading errorToast:YES];
|
||||
}
|
||||
|
||||
- (HttpRequestHelperCompletion)createHttpCompletion:(HttpSuccess)success fail:(HttpFail)fail errorToast:(BOOL)toast {
|
||||
return [self createHttpCompletion:success fail:fail showLoading:NO errorToast:toast];
|
||||
- (MewHttpRequestHelperCompletion)createHttpCompletion:(HttpSuccess)success fail:(HttpFail)fail errorToast:(BOOL)toast {
|
||||
return [self createHttpCompletion:success fail:fail mew_showLoading:NO errorToast:toast];
|
||||
}
|
||||
|
||||
- (HttpRequestHelperCompletion)createHttpCompletion:(HttpSuccess)success fail:(HttpFail)fail showLoading:(BOOL)loading errorToast:(BOOL)toast {
|
||||
- (MewHttpRequestHelperCompletion)createHttpCompletion:(HttpSuccess)success fail:(HttpFail)fail mew_showLoading:(BOOL)loading errorToast:(BOOL)toast {
|
||||
// if (loading) {
|
||||
// [self.view showAnchorLoading];
|
||||
// }
|
||||
return ^(BaseModel *data, NSInteger code, NSString * _Nullable msg) {
|
||||
if (loading && [self.view respondsToSelector:@selector(hideHUD)]) {
|
||||
[self.view hideHUD];
|
||||
if (loading && [self.view respondsToSelector:@selector(mew_hideHUD)]) {
|
||||
[self.view mew_hideHUD];
|
||||
}
|
||||
if (code == 200) {
|
||||
success(data);
|
||||
@@ -86,7 +86,7 @@
|
||||
// [[self getView] accountBanned:data];
|
||||
return;
|
||||
case 1415: // 未完善用户信息
|
||||
[[self getView] completeUserInfo];
|
||||
[[self getView] mew_completeUserInfo];
|
||||
return;
|
||||
case 3009: // 账号已注销
|
||||
[[self getView] accountCanceled:data.mewModel2dictionary];
|
||||
@@ -95,8 +95,8 @@
|
||||
break;
|
||||
}
|
||||
|
||||
if (toast && [self.view respondsToSelector:@selector(showErrorToast:)]) {
|
||||
[self.view showErrorToast:msg];
|
||||
if (toast && [self.view respondsToSelector:@selector(mew_showErrorToast:)]) {
|
||||
[self.view mew_showErrorToast:msg];
|
||||
}
|
||||
|
||||
if (fail) {
|
||||
|
@@ -6,17 +6,17 @@
|
||||
//
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
#import "BaseViewController.h"
|
||||
#import "MewBaseViewController.h"
|
||||
@class BaseModel;
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@protocol BaseMvpProtocol <NSObject, BaseViewControllerProtocol>
|
||||
@protocol BaseMvpProtocol <NSObject, MewBaseViewControllerProtocol>
|
||||
|
||||
/// 登录失效
|
||||
- (void)tokenInvalid;
|
||||
- (void)mew_getTokenId;
|
||||
/// 跳转到填写用户资料
|
||||
- (void)completeUserInfo;
|
||||
- (void)mew_completeUserInfo;
|
||||
/// 账号已注销
|
||||
- (void)accountCanceled:(NSDictionary *)data;
|
||||
|
||||
|
@@ -5,12 +5,12 @@
|
||||
// Created by 触海 on 2023/11/6.
|
||||
//
|
||||
|
||||
#import "BaseViewController.h"
|
||||
#import "MewBaseViewController.h"
|
||||
#import "BaseMvpPresenter.h"
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface MvpViewController<T> : BaseViewController
|
||||
@interface MvpViewController<T> : MewBaseViewController
|
||||
|
||||
@property (nonatomic, strong) __kindof T presenter;
|
||||
|
||||
|
@@ -7,7 +7,7 @@
|
||||
|
||||
#import "MvpViewController.h"
|
||||
#import "MewLoginViewController.h"
|
||||
#import "BaseNavigationController.h"
|
||||
#import "MewBaseNavigationController.h"
|
||||
|
||||
@interface MvpViewController()
|
||||
|
||||
@@ -36,14 +36,14 @@
|
||||
}
|
||||
|
||||
#pragma mark - BaseMvpProtocol
|
||||
- (void)tokenInvalid {
|
||||
- (void)mew_getTokenId {
|
||||
MewLoginViewController *loginVC = [[MewLoginViewController alloc] init];
|
||||
BaseNavigationController * nav = [[BaseNavigationController alloc] initWithRootViewController:loginVC];
|
||||
MewBaseNavigationController * nav = [[MewBaseNavigationController alloc] initWithRootViewController:loginVC];
|
||||
nav.modalPresentationStyle = UIModalPresentationFullScreen;
|
||||
[self.navigationController presentViewController:nav animated:YES completion:nil];
|
||||
}
|
||||
|
||||
- (void)completeUserInfo {
|
||||
- (void)mew_completeUserInfo {
|
||||
|
||||
}
|
||||
|
||||
|
@@ -1,13 +1,12 @@
|
||||
//
|
||||
// ApiHost.h
|
||||
// mew-ios
|
||||
// MewMewApiHost
|
||||
// yinmeng-ios
|
||||
//
|
||||
// Created by 触海 on 2023/11/6.
|
||||
// Created by duoban on 2023/12/5.
|
||||
//
|
||||
|
||||
#ifndef ApiHost_h
|
||||
#define ApiHost_h
|
||||
|
||||
#ifndef MewApiHost_h
|
||||
#define MewApiHost_h
|
||||
#ifdef DEBUG
|
||||
/// http://beta.h5.ymlive.fun
|
||||
#define API_HOST_H5_URL @"GoK87pcrCtMGRUiI37dI/jjoKPw7cA0hRRBRFdEmwbY="
|
||||
@@ -22,5 +21,4 @@
|
||||
#define API_HOST_URL @"https://api.ymlive.fun"
|
||||
#endif
|
||||
|
||||
|
||||
#endif /* ApiHost_h */
|
||||
#endif /* MewApiHost_h */
|
@@ -1,25 +1,24 @@
|
||||
//
|
||||
// HttpRequestHelper.h
|
||||
// mew-ios
|
||||
// MewHttpRequestHelper.h
|
||||
// yinmeng-ios
|
||||
//
|
||||
// Created by 触海 on 2023/11/6.
|
||||
// Created by duoban on 2023/12/5.
|
||||
//
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
#import "BaseModel.h"
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
typedef NS_ENUM(NSUInteger, HttpRequestHelperMethod) {
|
||||
HttpRequestHelperMethodPOST,
|
||||
HttpRequestHelperMethodGET,
|
||||
HttpRequestHelperMethodDELETE
|
||||
typedef NS_ENUM(NSUInteger, MewHttpRequestHelperMethod) {
|
||||
MewHttpRequestHelperMethodPOST,
|
||||
MewHttpRequestHelperMethodGET,
|
||||
MewHttpRequestHelperMethodDELETE
|
||||
};
|
||||
|
||||
static dispatch_once_t onceToken;
|
||||
typedef void(^HttpRequestHelperCompletion)(BaseModel* data, NSInteger code, NSString * msg);
|
||||
typedef void(^MewHttpRequestHelperCompletion)(BaseModel* data, NSInteger code, NSString * msg);
|
||||
|
||||
@interface HttpRequestHelper : NSObject
|
||||
@interface MewHttpRequestHelper : NSObject
|
||||
|
||||
/// 配置公参
|
||||
+ (NSDictionary*)configBaseParmars:(NSDictionary *)parmars;
|
||||
@@ -40,15 +39,15 @@ typedef void(^HttpRequestHelperCompletion)(BaseModel* data, NSInteger code, NSSt
|
||||
failure:(void (^)(NSInteger resCode, NSString *message))failure;
|
||||
|
||||
+ (void)request:(NSString *)url
|
||||
method:(HttpRequestHelperMethod)method
|
||||
method:(MewHttpRequestHelperMethod)method
|
||||
params:(NSDictionary *)params
|
||||
success:(void (^)(BaseModel *data))success
|
||||
failure:(void (^)(NSInteger resCode, NSString *message))failure;
|
||||
|
||||
+ (void)request:(NSString *)path
|
||||
method:(HttpRequestHelperMethod)method
|
||||
method:(MewHttpRequestHelperMethod)method
|
||||
params:(NSDictionary *)params
|
||||
completion:(HttpRequestHelperCompletion)completion;
|
||||
completion:(MewHttpRequestHelperCompletion)completion;
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
@@ -1,22 +1,23 @@
|
||||
//
|
||||
// HttpRequestHelper.m
|
||||
// mew-ios
|
||||
// MewHttpRequestHelper.m
|
||||
// yinmeng-ios
|
||||
//
|
||||
// Created by 触海 on 2023/11/6.
|
||||
// Created by duoban on 2023/12/5.
|
||||
//
|
||||
|
||||
#import "HttpRequestHelper.h"
|
||||
#import "MewHttpRequestHelper.h"
|
||||
|
||||
#import <AFNetworking.h>
|
||||
#import "ApiHost.h"
|
||||
#import "MewApiHost.h"
|
||||
|
||||
#import "YMCurrentVCStackManager.h"
|
||||
#import "MewStackManager.h"
|
||||
#import "AccountInfoStorage.h"
|
||||
|
||||
#import "YYUtility.h"
|
||||
#import "YYReachability.h"
|
||||
#import "NewEncryptTool.h"
|
||||
|
||||
@implementation HttpRequestHelper
|
||||
@implementation MewHttpRequestHelper
|
||||
|
||||
static BOOL isShowing = NO;
|
||||
|
||||
@@ -40,7 +41,7 @@ static BOOL isShowing = NO;
|
||||
return manager;
|
||||
}
|
||||
|
||||
+ (void)showNoNetAlert {
|
||||
+ (void)mew_showNoNetAlert {
|
||||
if (isShowing == NO) {
|
||||
UIAlertController *alert = [UIAlertController alertControllerWithTitle:@"温馨提示" message:@"请检查网络配置或确定设备是否联网" preferredStyle:UIAlertControllerStyleAlert];
|
||||
[alert addAction:[UIAlertAction actionWithTitle:@"取消" style:UIAlertActionStyleCancel handler:^(UIAlertAction * _Nonnull action) {
|
||||
@@ -55,7 +56,7 @@ static BOOL isShowing = NO;
|
||||
}];
|
||||
}
|
||||
}]];
|
||||
[[YMCurrentVCStackManager shareManager].getCurrentVC presentViewController:alert animated:YES completion:nil];
|
||||
[[MewStackManager shareManager].mew_getCurrentVC presentViewController:alert animated:YES completion:nil];
|
||||
isShowing = YES;
|
||||
}
|
||||
}
|
||||
@@ -66,7 +67,7 @@ static BOOL isShowing = NO;
|
||||
failure:(void (^)(NSInteger resCode, NSString *message))failure {
|
||||
if ([AFNetworkReachabilityManager sharedManager].networkReachabilityStatus == 0) {
|
||||
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0.01 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
|
||||
[self showNoNetAlert];
|
||||
[self mew_showNoNetAlert];
|
||||
failure(-1, @"请检查网络连接。");
|
||||
NSException * extrion= [NSException exceptionWithName:method reason:@"接口没有网络" userInfo:nil];
|
||||
NSLog(@"extrion - %@",extrion);
|
||||
@@ -77,12 +78,12 @@ static BOOL isShowing = NO;
|
||||
}
|
||||
|
||||
[self configHeaders];
|
||||
params = [self configBaseParmars:params];
|
||||
params = [self mew_configBaseParmars:params];
|
||||
#ifdef DEBUG
|
||||
NSLog(@"\nmethod:\n%@\nparameter:\n%@", method, params);
|
||||
#endif
|
||||
|
||||
AFHTTPSessionManager *manager = [HttpRequestHelper requestManager];
|
||||
AFHTTPSessionManager *manager = [MewHttpRequestHelper requestManager];
|
||||
[manager GET:method parameters:params headers:nil progress:nil success:^(NSURLSessionDataTask * _Nonnull task, id _Nullable responseObject) {
|
||||
BaseModel *baseModel = [BaseModel mewModelWithDictionary:responseObject];
|
||||
#ifdef DEBUG
|
||||
@@ -90,7 +91,7 @@ static BOOL isShowing = NO;
|
||||
#endif
|
||||
success(baseModel);
|
||||
} failure:^(NSURLSessionDataTask * _Nullable task, NSError * _Nonnull error) {
|
||||
[self handleNetError:error method:method failure:failure];
|
||||
[self mew_handleNetError:error method:method failure:failure];
|
||||
}];
|
||||
}
|
||||
|
||||
@@ -109,12 +110,12 @@ static BOOL isShowing = NO;
|
||||
}
|
||||
|
||||
[self configHeaders];
|
||||
params = [self configBaseParmars:params];
|
||||
params = [self mew_configBaseParmars:params];
|
||||
#ifdef DEBUG
|
||||
NSLog(@"\nmethod:\n%@\nparameter:\n%@", method, params);
|
||||
#endif
|
||||
|
||||
AFHTTPSessionManager *manager = [HttpRequestHelper requestManager];
|
||||
AFHTTPSessionManager *manager = [MewHttpRequestHelper requestManager];
|
||||
[manager POST:method parameters:params headers:nil progress:nil success:^(NSURLSessionDataTask * _Nonnull task, id _Nullable responseObject) {
|
||||
BaseModel *baseModel = [BaseModel mewModelWithDictionary:responseObject];
|
||||
#ifdef DEBUG
|
||||
@@ -122,7 +123,7 @@ static BOOL isShowing = NO;
|
||||
#endif
|
||||
success(baseModel);
|
||||
} failure:^(NSURLSessionDataTask * _Nullable task, NSError * _Nonnull error) {
|
||||
[self handleNetError:error method:method failure:failure];
|
||||
[self mew_handleNetError:error method:method failure:failure];
|
||||
}];
|
||||
}
|
||||
|
||||
@@ -141,12 +142,12 @@ static BOOL isShowing = NO;
|
||||
}
|
||||
|
||||
[self configHeaders];
|
||||
params = [self configBaseParmars:params];
|
||||
params = [self mew_configBaseParmars:params];
|
||||
#ifdef DEBUG
|
||||
NSLog(@"\nmethod:\n%@\nparameter:\n%@", method, params);
|
||||
#endif
|
||||
|
||||
AFHTTPSessionManager *manager = [HttpRequestHelper requestManager];
|
||||
AFHTTPSessionManager *manager = [MewHttpRequestHelper requestManager];
|
||||
[manager DELETE:method parameters:params headers:nil success:^(NSURLSessionDataTask * _Nonnull task, id _Nullable responseObject) {
|
||||
BaseModel *baseModel = [BaseModel mewModelWithDictionary:responseObject];
|
||||
#ifdef DEBUG
|
||||
@@ -154,25 +155,25 @@ static BOOL isShowing = NO;
|
||||
#endif
|
||||
success(baseModel);
|
||||
} failure:^(NSURLSessionDataTask * _Nullable task, NSError * _Nonnull error) {
|
||||
[self handleNetError:error method:method failure:failure];
|
||||
[self mew_handleNetError:error method:method failure:failure];
|
||||
}];
|
||||
}
|
||||
|
||||
+ (void)request:(NSString *)url
|
||||
method:(HttpRequestHelperMethod)method
|
||||
method:(MewHttpRequestHelperMethod)method
|
||||
params:(NSDictionary *)params
|
||||
success:(void (^)(BaseModel *data))success
|
||||
failure:(void (^)(NSInteger resCode, NSString *message))failure {
|
||||
switch (method) {
|
||||
case HttpRequestHelperMethodGET: {
|
||||
case MewHttpRequestHelperMethodGET: {
|
||||
[self GET:url params:params success:success failure:failure];
|
||||
}
|
||||
break;
|
||||
case HttpRequestHelperMethodPOST:{
|
||||
case MewHttpRequestHelperMethodPOST:{
|
||||
[self POST:url params:params success:success failure:failure];
|
||||
}
|
||||
break;
|
||||
case HttpRequestHelperMethodDELETE:{
|
||||
case MewHttpRequestHelperMethodDELETE:{
|
||||
[self DELETE:url params:params success:success failure:failure];
|
||||
}
|
||||
break;
|
||||
@@ -180,9 +181,9 @@ static BOOL isShowing = NO;
|
||||
}
|
||||
|
||||
+ (void)request:(NSString *)path
|
||||
method:(HttpRequestHelperMethod)method
|
||||
method:(MewHttpRequestHelperMethod)method
|
||||
params:(NSDictionary *)params
|
||||
completion:(HttpRequestHelperCompletion)completion {
|
||||
completion:(MewHttpRequestHelperCompletion)completion {
|
||||
[self request:path method:method params:params success:^(BaseModel *data) {
|
||||
if (completion) {
|
||||
completion(data, data.code, data.message);
|
||||
@@ -195,7 +196,7 @@ static BOOL isShowing = NO;
|
||||
}
|
||||
|
||||
+ (void)configHeaders {
|
||||
AFHTTPSessionManager *client = [HttpRequestHelper requestManager];
|
||||
AFHTTPSessionManager *client = [MewHttpRequestHelper requestManager];
|
||||
if ([[AccountInfoStorage instance] getUid].length > 0) {
|
||||
[client.requestSerializer setValue:[[AccountInfoStorage instance] getUid] forHTTPHeaderField:@"pub_uid"];
|
||||
} else {
|
||||
@@ -208,7 +209,7 @@ static BOOL isShowing = NO;
|
||||
}
|
||||
}
|
||||
|
||||
+ (NSDictionary*)configBaseParmars:(NSDictionary *)parmars {
|
||||
+ (NSDictionary*)mew_configBaseParmars:(NSDictionary *)parmars {
|
||||
NSDictionary *defaultBasciParame = @{
|
||||
@"os" : @"iOS",
|
||||
@"osVersion" : [YYUtility systemVersion],
|
||||
@@ -231,7 +232,7 @@ static BOOL isShowing = NO;
|
||||
return dic;
|
||||
}
|
||||
|
||||
+ (void)handleNetError:(NSError *)error method:(NSString *)method
|
||||
+ (void)mew_handleNetError:(NSError *)error method:(NSString *)method
|
||||
failure:(void (^)(NSInteger resCode, NSString *message))failure
|
||||
{
|
||||
#ifdef DEBUG
|
||||
@@ -257,5 +258,5 @@ static BOOL isShowing = NO;
|
||||
// [Bugly reportException:exception];
|
||||
}
|
||||
}
|
||||
|
||||
@end
|
||||
|
@@ -12,19 +12,19 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
@interface MewHUDTool : NSObject
|
||||
/**
|
||||
showGIFLoading使用注意:
|
||||
1.谁负责showLoading, 谁负责hideHUD
|
||||
2.showLoading是指定了加载在那个View, hideHUD时请指定hide那个view的hud
|
||||
1.谁负责mew_showLoading, 谁负责mew_hideHUD
|
||||
2.mew_showLoading是指定了加载在那个View, mew_hideHUD时请指定hide那个view的hud
|
||||
*/
|
||||
|
||||
/* 隐藏HUD */
|
||||
+ (void)hideHUD;
|
||||
+ (void)mew_hideHUD;
|
||||
|
||||
/**
|
||||
隐藏HUD, 如果view为nil, 则默认隐藏主窗口的HUD
|
||||
|
||||
@param view view
|
||||
*/
|
||||
+ (void)hideHUDInView:(nullable UIView *)view;
|
||||
+ (void)mew_hideHUDInView:(nullable UIView *)view;
|
||||
|
||||
/**
|
||||
显示成功message, 默认显示在窗口上, 2.5s后消失, 默认不拦截点击事件
|
||||
@@ -81,32 +81,32 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
/**
|
||||
在窗口上显示菊花
|
||||
*/
|
||||
+ (void)showLoading;
|
||||
+ (void)mew_showLoading;
|
||||
|
||||
/**
|
||||
在view上显示菊花
|
||||
*/
|
||||
+ (void)showLoadingInView:(nullable UIView *)view;
|
||||
+ (void)mew_showLoadingInView:(nullable UIView *)view;
|
||||
|
||||
/**
|
||||
在view上显示菊花
|
||||
*/
|
||||
+ (void)showLoadingInView:(nullable UIView *)view enabled:(BOOL)enabled;
|
||||
+ (void)mew_showLoadingInView:(nullable UIView *)view enabled:(BOOL)enabled;
|
||||
|
||||
/**
|
||||
在窗口上显示菊花+文字
|
||||
*/
|
||||
+ (void)showLoadingWithMessage:(NSString *)message;
|
||||
+ (void)mew_showLoadingWithMessage:(NSString *)message;
|
||||
|
||||
/**
|
||||
在view上显示菊花+文字
|
||||
*/
|
||||
+ (void)showLoadingWithMessage:(NSString *)message inView:(nullable UIView *)view;
|
||||
+ (void)mew_showLoadingWithMessage:(NSString *)message inView:(nullable UIView *)view;
|
||||
|
||||
/**
|
||||
在view上显示菊花+文字
|
||||
*/
|
||||
+ (void)showLoadingWithMessage:(NSString *)message inView:(nullable UIView *)view enabled:(BOOL)enabled;
|
||||
+ (void)mew_showLoadingWithMessage:(NSString *)message inView:(nullable UIView *)view enabled:(BOOL)enabled;
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
|
@@ -18,7 +18,7 @@ static NSArray * _animationImages = nil;
|
||||
|
||||
@param view view
|
||||
*/
|
||||
+ (void)hideHUDInView:(nullable UIView *)view {
|
||||
+ (void)mew_hideHUDInView:(nullable UIView *)view {
|
||||
mew_dispatch_main_sync_safe(^{
|
||||
if (view) {
|
||||
[MBProgressHUD hideHUDForView:view animated:NO];
|
||||
@@ -31,8 +31,8 @@ static NSArray * _animationImages = nil;
|
||||
|
||||
|
||||
/* 隐藏HUD */
|
||||
+ (void)hideHUD {
|
||||
[self hideHUDInView:nil];
|
||||
+ (void)mew_hideHUD {
|
||||
[self mew_hideHUDInView:nil];
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -70,7 +70,7 @@ static NSArray * _animationImages = nil;
|
||||
if (!inView) {
|
||||
inView = [UIApplication sharedApplication].keyWindow;
|
||||
}
|
||||
[self hideHUDInView:view]; // 先隐藏
|
||||
[self mew_hideHUDInView:view]; // 先隐藏
|
||||
MBProgressHUD *hud = [self normalProgressHUD:view];
|
||||
hud.userInteractionEnabled = enabled;
|
||||
hud.mode = MBProgressHUDModeText;
|
||||
@@ -119,7 +119,7 @@ static NSArray * _animationImages = nil;
|
||||
view = [UIApplication sharedApplication].keyWindow;
|
||||
}
|
||||
|
||||
[self hideHUDInView:view]; // 先隐藏
|
||||
[self mew_hideHUDInView:view]; // 先隐藏
|
||||
|
||||
mew_dispatch_main_sync_safe(^{
|
||||
MBProgressHUD *hud = [self normalProgressHUD:view];
|
||||
@@ -140,46 +140,46 @@ static NSArray * _animationImages = nil;
|
||||
/**
|
||||
* 在窗口上显示菊花
|
||||
*/
|
||||
+ (void)showLoading {
|
||||
[self showLoadingInView:[UIApplication sharedApplication].keyWindow];
|
||||
+ (void)mew_showLoading {
|
||||
[self mew_showLoadingInView:[UIApplication sharedApplication].keyWindow];
|
||||
}
|
||||
|
||||
/**
|
||||
* 在view上显示菊花
|
||||
*/
|
||||
+ (void)showLoadingInView:(nullable UIView *)view {
|
||||
[self showLoadingInView:view enabled:YES];
|
||||
+ (void)mew_showLoadingInView:(nullable UIView *)view {
|
||||
[self mew_showLoadingInView:view enabled:YES];
|
||||
}
|
||||
|
||||
/**
|
||||
* 在view上显示菊花
|
||||
*/
|
||||
+ (void)showLoadingInView:(nullable UIView *)view enabled:(BOOL)enabled {
|
||||
[self showLoadingWithMessage:@"" inView:view enabled:enabled];
|
||||
+ (void)mew_showLoadingInView:(nullable UIView *)view enabled:(BOOL)enabled {
|
||||
[self mew_showLoadingWithMessage:@"" inView:view enabled:enabled];
|
||||
}
|
||||
|
||||
/**
|
||||
* 在窗口上显示菊花+文字
|
||||
*/
|
||||
+ (void)showLoadingWithMessage:(NSString *)message {
|
||||
[self showLoadingWithMessage:message inView:[UIApplication sharedApplication].keyWindow];
|
||||
+ (void)mew_showLoadingWithMessage:(NSString *)message {
|
||||
[self mew_showLoadingWithMessage:message inView:[UIApplication sharedApplication].keyWindow];
|
||||
}
|
||||
|
||||
/**
|
||||
* 在view上显示菊花+文字
|
||||
*/
|
||||
+ (void)showLoadingWithMessage:(NSString *)message inView:(nullable UIView *)view {
|
||||
[self showLoadingWithMessage:message inView:view enabled:YES];
|
||||
+ (void)mew_showLoadingWithMessage:(NSString *)message inView:(nullable UIView *)view {
|
||||
[self mew_showLoadingWithMessage:message inView:view enabled:YES];
|
||||
}
|
||||
|
||||
/**
|
||||
* 在view上显示菊花+文字
|
||||
*/
|
||||
+ (void)showLoadingWithMessage:(NSString *)message inView:(nullable UIView *)view enabled:(BOOL)enabled {
|
||||
+ (void)mew_showLoadingWithMessage:(NSString *)message inView:(nullable UIView *)view enabled:(BOOL)enabled {
|
||||
if (!view) {
|
||||
view = [UIApplication sharedApplication].keyWindow;
|
||||
}
|
||||
[self hideHUDInView:view];
|
||||
[self mew_hideHUDInView:view];
|
||||
|
||||
mew_dispatch_main_sync_safe(^{
|
||||
MBProgressHUD *hud = [MBProgressHUD showHUDAddedTo:view animated:YES];
|
||||
|
@@ -98,7 +98,7 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@param color The color.
|
||||
*/
|
||||
+ (nullable UIImage *)imageWithColor:(UIColor *)color;
|
||||
+ (nullable UIImage *)mew_imageWithColor:(UIColor *)color;
|
||||
|
||||
/**
|
||||
Create and return a pure color image with the given color and size.
|
||||
@@ -106,7 +106,7 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
@param color The color.
|
||||
@param size New image's type.
|
||||
*/
|
||||
+ (nullable UIImage *)imageWithColor:(UIColor *)color size:(CGSize)size;
|
||||
+ (nullable UIImage *)mew_imageWithColor:(UIColor *)color size:(CGSize)size;
|
||||
|
||||
/**
|
||||
Create and return an image with custom draw code.
|
||||
@@ -116,7 +116,7 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@return The new image.
|
||||
*/
|
||||
+ (nullable UIImage *)imageWithSize:(CGSize)size drawBlock:(void (^)(CGContextRef context))drawBlock;
|
||||
+ (nullable UIImage *)mew_imageWithSize:(CGSize)size drawBlock:(void (^)(CGContextRef context))drawBlock;
|
||||
|
||||
#pragma mark - Image Info
|
||||
///=============================================================================
|
||||
|
@@ -247,11 +247,11 @@ static inline CGFloat RadiansToDegrees(CGFloat radians) {
|
||||
return pdfImage;
|
||||
}
|
||||
|
||||
+ (UIImage *)imageWithColor:(UIColor *)color {
|
||||
return [self imageWithColor:color size:CGSizeMake(1, 1)];
|
||||
+ (UIImage *)mew_imageWithColor:(UIColor *)color {
|
||||
return [self mew_imageWithColor:color size:CGSizeMake(1, 1)];
|
||||
}
|
||||
|
||||
+ (UIImage *)imageWithColor:(UIColor *)color size:(CGSize)size {
|
||||
+ (UIImage *)mew_imageWithColor:(UIColor *)color size:(CGSize)size {
|
||||
if (!color || size.width <= 0 || size.height <= 0) return nil;
|
||||
CGRect rect = CGRectMake(0.0f, 0.0f, size.width, size.height);
|
||||
UIGraphicsBeginImageContextWithOptions(rect.size, NO, 0);
|
||||
@@ -263,7 +263,7 @@ static inline CGFloat RadiansToDegrees(CGFloat radians) {
|
||||
return image;
|
||||
}
|
||||
|
||||
+ (UIImage *)imageWithSize:(CGSize)size drawBlock:(void (^)(CGContextRef context))drawBlock {
|
||||
+ (UIImage *)mew_imageWithSize:(CGSize)size drawBlock:(void (^)(CGContextRef context))drawBlock {
|
||||
if (!drawBlock) return nil;
|
||||
UIGraphicsBeginImageContextWithOptions(size, NO, 0);
|
||||
CGContextRef context = UIGraphicsGetCurrentContext();
|
||||
|
@@ -1,16 +0,0 @@
|
||||
//
|
||||
// BaseNavigationController.h
|
||||
// mew-ios
|
||||
//
|
||||
// Created by 触海 on 2023/11/6.
|
||||
//
|
||||
|
||||
#import <UIKit/UIKit.h>
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface BaseNavigationController : UINavigationController
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
@@ -1,48 +0,0 @@
|
||||
//
|
||||
// BaseViewController.h
|
||||
// mew-ios
|
||||
//
|
||||
// Created by 触海 on 2023/11/6.
|
||||
//
|
||||
|
||||
#import <UIKit/UIKit.h>
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@protocol BaseViewControllerProtocol <NSObject>
|
||||
|
||||
/*成功 toast*/
|
||||
- (void)showSuccessToast:(NSString *)msg;
|
||||
|
||||
/*失败 toast*/
|
||||
- (void)showErrorToast:(NSString *)msg;
|
||||
|
||||
/*加载 loading*/
|
||||
- (void)showLoading;
|
||||
|
||||
/*隐藏 XCHUDTool*/
|
||||
- (void)hideHUD;
|
||||
|
||||
@end
|
||||
|
||||
|
||||
@interface BaseViewController : UIViewController<BaseViewControllerProtocol>
|
||||
|
||||
// 是否隐藏导航 默认是不隐藏的
|
||||
@property(nonatomic,assign,getter=mew_isHiddenNavBar) BOOL hiddenNavBar;
|
||||
|
||||
/*显示/隐藏导航*/
|
||||
- (void)hideNavigationBar;
|
||||
|
||||
/*隐藏导航栏*/
|
||||
- (void)showNavigationBar;
|
||||
|
||||
/*显示/隐藏状态栏*/
|
||||
- (void)showStatusBar;
|
||||
|
||||
/*隐藏状态栏*/
|
||||
- (void)hideStatusBar;
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
@@ -1,22 +1,20 @@
|
||||
//
|
||||
// YMIButton.h
|
||||
// MewButton.h
|
||||
// yinmeng-ios
|
||||
//
|
||||
// Created by 触海 on 2023/11/21.
|
||||
// Created by duoban on 2023/12/5.
|
||||
//
|
||||
|
||||
#import <UIKit/UIKit.h>
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
typedef NS_ENUM(NSInteger, XPButtonImagePosition) {
|
||||
XPButtonImagePositionLeft = 0, // 图片在文字左侧
|
||||
XPButtonImagePositionRight = 1, // 图片在文字右侧
|
||||
XPButtonImagePositionTop = 2, // 图片在文字上侧
|
||||
XPButtonImagePositionBottom = 3 // 图片在文字下侧
|
||||
MewButtonImagePositionLeft = 0, // 图片在文字左侧
|
||||
MewButtonImagePositionRight = 1, // 图片在文字右侧
|
||||
MewButtonImagePositionTop = 2, // 图片在文字上侧
|
||||
MewButtonImagePositionBottom = 3 // 图片在文字下侧
|
||||
};
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
IB_DESIGNABLE
|
||||
@interface YMIButton : UIButton
|
||||
@interface MewButton : UIButton
|
||||
- (instancetype)initWithImagePosition:(XPButtonImagePosition)imagePosition;
|
||||
|
||||
#if TARGET_INTERFACE_BUILDER // storyBoard/xib中设置
|
@@ -1,14 +1,13 @@
|
||||
//
|
||||
// YMIButton.m
|
||||
// MewButton.m
|
||||
// yinmeng-ios
|
||||
//
|
||||
// Created by 触海 on 2023/11/21.
|
||||
// Created by duoban on 2023/12/5.
|
||||
//
|
||||
|
||||
#import "YMIButton.h"
|
||||
|
||||
@implementation YMIButton
|
||||
#import "MewButton.h"
|
||||
|
||||
@implementation MewButton
|
||||
- (instancetype)initWithImagePosition:(XPButtonImagePosition)imagePosition {
|
||||
if (self = [super init]) {
|
||||
self.imagePosition = imagePosition;
|
||||
@@ -33,7 +32,7 @@
|
||||
}
|
||||
|
||||
- (void)initialize {
|
||||
_imagePosition = XPButtonImagePositionLeft;
|
||||
_imagePosition = MewButtonImagePositionLeft;
|
||||
_imageTitleSpace = 0.0;
|
||||
}
|
||||
|
||||
@@ -50,19 +49,19 @@
|
||||
return imageRect;
|
||||
}
|
||||
switch (self.imagePosition) {
|
||||
case XPButtonImagePositionLeft: { // 图片在左
|
||||
case MewButtonImagePositionLeft: { // 图片在左
|
||||
imageRect = [self imageRectImageAtLeftForContentRect:contentRect imageRect:imageRect titleRect:titleRect];
|
||||
}
|
||||
break;
|
||||
case XPButtonImagePositionRight: {
|
||||
case MewButtonImagePositionRight: {
|
||||
imageRect = [self imageRectImageAtRightForContentRect:contentRect imageRect:imageRect titleRect:titleRect];
|
||||
}
|
||||
break;
|
||||
case XPButtonImagePositionTop: {
|
||||
case MewButtonImagePositionTop: {
|
||||
imageRect = [self imageRectImageAtTopForContentRect:contentRect imageRect:imageRect titleRect:titleRect];
|
||||
}
|
||||
break;
|
||||
case XPButtonImagePositionBottom: {
|
||||
case MewButtonImagePositionBottom: {
|
||||
imageRect = [self imageRectImageAtBottomForContentRect:contentRect imageRect:imageRect titleRect:titleRect];
|
||||
}
|
||||
break;
|
||||
@@ -77,19 +76,19 @@
|
||||
return titleRect;
|
||||
}
|
||||
switch (self.imagePosition) {
|
||||
case XPButtonImagePositionLeft: {
|
||||
case MewButtonImagePositionLeft: {
|
||||
titleRect = [self titleRectImageAtLeftForContentRect:contentRect titleRect:titleRect imageRect:imageRect];
|
||||
}
|
||||
break;
|
||||
case XPButtonImagePositionRight: {
|
||||
case MewButtonImagePositionRight: {
|
||||
titleRect = [self titleRectImageAtRightForContentRect:contentRect titleRect:titleRect imageRect:imageRect];
|
||||
}
|
||||
break;
|
||||
case XPButtonImagePositionTop: {
|
||||
case MewButtonImagePositionTop: {
|
||||
titleRect = [self titleRectImageAtTopForContentRect:contentRect titleRect:titleRect imageRect:imageRect];
|
||||
}
|
||||
break;
|
||||
case XPButtonImagePositionBottom: {
|
||||
case MewButtonImagePositionBottom: {
|
||||
titleRect = [self titleRectImageAtBottomForContentRect:contentRect titleRect:titleRect imageRect:imageRect];
|
||||
}
|
||||
break;
|
||||
@@ -104,12 +103,12 @@
|
||||
|
||||
CGRect myFrame = self.frame;
|
||||
switch (self.imagePosition) {
|
||||
case XPButtonImagePositionLeft:
|
||||
case XPButtonImagePositionRight: // 图片在左右时,在系统计算好的基础上宽度再加间距
|
||||
case MewButtonImagePositionLeft:
|
||||
case MewButtonImagePositionRight: // 图片在左右时,在系统计算好的基础上宽度再加间距
|
||||
myFrame.size.width = self.frame.size.width + _imageTitleSpace;
|
||||
break;
|
||||
case XPButtonImagePositionTop:
|
||||
case XPButtonImagePositionBottom: {// 图片在上下时,就不能再在系统计算的基础上增减值了,因为系统计算是基于图片在左文字在右时进行的,宽度依赖图片+文字之和,而图片在上下时,宽度应该依赖图片和文字较大的那个
|
||||
case MewButtonImagePositionTop:
|
||||
case MewButtonImagePositionBottom: {// 图片在上下时,就不能再在系统计算的基础上增减值了,因为系统计算是基于图片在左文字在右时进行的,宽度依赖图片+文字之和,而图片在上下时,宽度应该依赖图片和文字较大的那个
|
||||
CGFloat imageFitWidth = self.contentEdgeInsets.left + self.currentImage.size.width + self.contentEdgeInsets.right;
|
||||
CGFloat titleFitWidth = self.contentEdgeInsets.left + [self calculateTitleSizeForSystemTitleSize:CGSizeMake(0, 0)].width + self.contentEdgeInsets.right;
|
||||
myFrame.size.width = MAX(imageFitWidth, titleFitWidth);
|
||||
@@ -593,5 +592,4 @@
|
||||
[super setContentVerticalAlignment:contentVerticalAlignment];
|
||||
[self setNeedsLayout];
|
||||
}
|
||||
|
||||
@end
|
@@ -0,0 +1,16 @@
|
||||
//
|
||||
// MewBaseNavigationController.h
|
||||
// yinmeng-ios
|
||||
//
|
||||
// Created by duoban on 2023/12/5.
|
||||
//
|
||||
|
||||
#import <UIKit/UIKit.h>
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface MewBaseNavigationController : UINavigationController
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
@@ -1,32 +1,33 @@
|
||||
//
|
||||
// BaseNavigationController.m
|
||||
// mew-ios
|
||||
// MewBaseNavigationController.m
|
||||
// yinmeng-ios
|
||||
//
|
||||
// Created by 触海 on 2023/11/6.
|
||||
// Created by duoban on 2023/12/5.
|
||||
//
|
||||
|
||||
#import "BaseNavigationController.h"
|
||||
#import "MewBaseNavigationController.h"
|
||||
|
||||
#import "MEWThemeColor.h"
|
||||
|
||||
@interface BaseNavigationController ()<UIGestureRecognizerDelegate>
|
||||
@interface MewBaseNavigationController ()<UIGestureRecognizerDelegate>
|
||||
|
||||
@end
|
||||
|
||||
@implementation BaseNavigationController
|
||||
@implementation MewBaseNavigationController
|
||||
|
||||
- (void)viewDidLoad {
|
||||
[super viewDidLoad];
|
||||
if ([self respondsToSelector:@selector(interactivePopGestureRecognizer)]) {
|
||||
self.interactivePopGestureRecognizer.delegate = self;
|
||||
}
|
||||
[self themeConfig];
|
||||
[self mew_themeConfig];
|
||||
}
|
||||
|
||||
- (void)pushViewController:(UIViewController *)viewController animated:(BOOL)animated {
|
||||
if(self.topViewController == viewController) return;
|
||||
if (self.childViewControllers.count > 0) {
|
||||
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(mew_backClick)];
|
||||
leftBarButtonItem.tintColor = [MEWThemeColor mewMainTextColor];
|
||||
viewController.navigationItem.leftBarButtonItem = leftBarButtonItem;
|
||||
}
|
||||
@@ -35,11 +36,11 @@
|
||||
[super pushViewController:viewController animated:animated];
|
||||
}
|
||||
|
||||
- (void)backClick{
|
||||
- (void)mew_backClick{
|
||||
[self popViewControllerAnimated:YES];
|
||||
}
|
||||
|
||||
- (void)themeConfig {
|
||||
- (void)mew_themeConfig {
|
||||
self.navigationBar.shadowImage = [[UIImage alloc] init];
|
||||
self.navigationBar.barTintColor = [MEWThemeColor mewAppBackgroundColor];
|
||||
self.navigationBar.tintColor = [UIColor whiteColor];
|
||||
@@ -69,3 +70,4 @@
|
||||
|
||||
|
||||
@end
|
||||
|
48
yinmeng-ios/yinmeng-ios/Base/UI/MewBaseViewController.h
Normal file
48
yinmeng-ios/yinmeng-ios/Base/UI/MewBaseViewController.h
Normal file
@@ -0,0 +1,48 @@
|
||||
//
|
||||
// MewBaseViewController.h
|
||||
// yinmeng-ios
|
||||
//
|
||||
// Created by duoban on 2023/12/5.
|
||||
//
|
||||
|
||||
#import <UIKit/UIKit.h>
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@protocol MewBaseViewControllerProtocol <NSObject>
|
||||
|
||||
/*成功 toast*/
|
||||
- (void)mew_showSuccessToast:(NSString *)msg;
|
||||
|
||||
/*失败 toast*/
|
||||
- (void)mew_showErrorToast:(NSString *)msg;
|
||||
|
||||
/*加载 loading*/
|
||||
- (void)mew_showLoading;
|
||||
|
||||
/*隐藏 XCHUDTool*/
|
||||
- (void)mew_hideHUD;
|
||||
|
||||
@end
|
||||
|
||||
|
||||
@interface MewBaseViewController : UIViewController<MewBaseViewControllerProtocol>
|
||||
|
||||
// 是否隐藏导航 默认是不隐藏的
|
||||
@property(nonatomic,assign,getter=mew_isHiddenNavBar) BOOL hiddenNavBar;
|
||||
|
||||
/*显示/隐藏导航*/
|
||||
- (void)mew_hideNavigationBar;
|
||||
|
||||
/*隐藏导航栏*/
|
||||
- (void)mew_showNavigationBar;
|
||||
|
||||
/*显示/隐藏状态栏*/
|
||||
- (void)mew_showStatusBar;
|
||||
|
||||
/*隐藏状态栏*/
|
||||
- (void)mew_hideStatusBar;
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
@@ -1,19 +1,20 @@
|
||||
//
|
||||
// BaseViewController.m
|
||||
// mew-ios
|
||||
// MewBaseViewController.m
|
||||
// yinmeng-ios
|
||||
//
|
||||
// Created by 触海 on 2023/11/6.
|
||||
// Created by duoban on 2023/12/5.
|
||||
//
|
||||
|
||||
#import "BaseViewController.h"
|
||||
#import "MewBaseViewController.h"
|
||||
|
||||
///Tool
|
||||
#import "MewHUDTool.h"
|
||||
|
||||
@interface BaseViewController ()
|
||||
@interface MewBaseViewController ()
|
||||
|
||||
@end
|
||||
|
||||
@implementation BaseViewController
|
||||
@implementation MewBaseViewController
|
||||
|
||||
|
||||
#pragma mark - Life Cycle
|
||||
@@ -51,41 +52,40 @@
|
||||
|
||||
#pragma mark - Public Method
|
||||
/*隐藏导航条*/
|
||||
- (void)hideNavigationBar {
|
||||
- (void)mew_hideNavigationBar {
|
||||
[self.navigationController setNavigationBarHidden:YES animated:YES];
|
||||
}
|
||||
|
||||
/*显示导航条*/
|
||||
- (void)showNavigationBar {
|
||||
- (void)mew_showNavigationBar {
|
||||
[self.navigationController setNavigationBarHidden:NO];
|
||||
}
|
||||
|
||||
/*显示状态栏*/
|
||||
- (void)showStatusBar {
|
||||
- (void)mew_showStatusBar {
|
||||
[UIApplication sharedApplication].statusBarHidden = NO;
|
||||
}
|
||||
|
||||
/*隐藏状态栏*/
|
||||
- (void)hideStatusBar {
|
||||
- (void)mew_hideStatusBar {
|
||||
[UIApplication sharedApplication].statusBarHidden = YES;
|
||||
}
|
||||
|
||||
|
||||
#pragma mark - BaseViewControllerProtocol
|
||||
- (void)showSuccessToast:(NSString *)msg {
|
||||
- (void)mew_showSuccessToast:(NSString *)msg {
|
||||
[MewHUDTool showSuccessWithMessage:msg];
|
||||
}
|
||||
|
||||
- (void)showErrorToast:(NSString *)msg {
|
||||
- (void)mew_showErrorToast:(NSString *)msg {
|
||||
[MewHUDTool showErrorWithMessage:msg];
|
||||
}
|
||||
|
||||
- (void)showLoading {
|
||||
[MewHUDTool showLoading];
|
||||
- (void)mew_showLoading {
|
||||
[MewHUDTool mew_showLoading];
|
||||
}
|
||||
|
||||
- (void)hideHUD {
|
||||
[MewHUDTool hideHUD];
|
||||
- (void)mew_hideHUD {
|
||||
[MewHUDTool mew_hideHUD];
|
||||
}
|
||||
|
||||
@end
|
@@ -1,16 +1,16 @@
|
||||
//
|
||||
// YMCurrentVCStackManager.h
|
||||
// mew-ios
|
||||
// MewStackManager.h
|
||||
// yinmeng-ios
|
||||
//
|
||||
// Created by 触海 on 2023/11/6.
|
||||
// Created by duoban on 2023/12/5.
|
||||
//
|
||||
|
||||
#import <UIKit/UIKit.h>
|
||||
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface YMCurrentVCStackManager : NSObject
|
||||
|
||||
@interface MewStackManager : NSObject
|
||||
+ (instancetype)shareManager;
|
||||
|
||||
/**
|
||||
@@ -18,14 +18,14 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@return 导航控制器
|
||||
*/
|
||||
- (UINavigationController *)currentNavigationController;
|
||||
- (UINavigationController *)mew_currentNavigationController;
|
||||
|
||||
/**
|
||||
当前最顶层控制器
|
||||
|
||||
@return 当前最顶层控制器
|
||||
*/
|
||||
- (UIViewController *)getCurrentVC;
|
||||
- (UIViewController *)mew_getCurrentVC;
|
||||
|
||||
@end
|
||||
|
@@ -1,15 +1,13 @@
|
||||
//
|
||||
// YMCurrentVCStackManager.m
|
||||
// mew-ios
|
||||
// MewStackManager.m
|
||||
// yinmeng-ios
|
||||
//
|
||||
// Created by 触海 on 2023/11/6.
|
||||
// Created by duoban on 2023/12/5.
|
||||
//
|
||||
|
||||
#import "YMCurrentVCStackManager.h"
|
||||
|
||||
#import "MewStackManager.h"
|
||||
NSString * const kRoomChatPushViewKey = @"kRoomChatPushViewKey";
|
||||
@implementation YMCurrentVCStackManager
|
||||
|
||||
@implementation MewStackManager
|
||||
+ (instancetype)shareManager {
|
||||
static dispatch_once_t onceToken = 0;
|
||||
static id instance;
|
||||
@@ -20,16 +18,16 @@ NSString * const kRoomChatPushViewKey = @"kRoomChatPushViewKey";
|
||||
return instance;
|
||||
}
|
||||
|
||||
- (UIViewController *)getCurrentVC {
|
||||
- (UIViewController *)mew_getCurrentVC {
|
||||
///兼容房间内私聊的
|
||||
[[NSNotificationCenter defaultCenter] postNotificationName:kRoomChatPushViewKey object:nil];
|
||||
|
||||
UIViewController *rootViewController = [UIApplication sharedApplication].delegate.window.rootViewController;
|
||||
UIViewController *currentVC = [self getCurrentVCFrom:rootViewController];
|
||||
UIViewController *currentVC = [self mew_getCurrentVCFrom:rootViewController];
|
||||
return currentVC;
|
||||
}
|
||||
|
||||
- (UIViewController *)getCurrentVCFrom:(UIViewController *)rootVC {
|
||||
- (UIViewController *)mew_getCurrentVCFrom:(UIViewController *)rootVC {
|
||||
UIViewController *currentVC;
|
||||
if ([rootVC presentedViewController]) {
|
||||
// 视图是被presented出来的
|
||||
@@ -37,11 +35,11 @@ NSString * const kRoomChatPushViewKey = @"kRoomChatPushViewKey";
|
||||
}
|
||||
if ([rootVC isKindOfClass:[UITabBarController class]]) {
|
||||
// 根视图为UITabBarController
|
||||
currentVC = [self getCurrentVCFrom:[(UITabBarController *)rootVC selectedViewController]];
|
||||
currentVC = [self mew_getCurrentVCFrom:[(UITabBarController *)rootVC selectedViewController]];
|
||||
|
||||
} else if ([rootVC isKindOfClass:[UINavigationController class]]) {
|
||||
// 根视图为UINavigationController
|
||||
currentVC = [self getCurrentVCFrom:[(UINavigationController *)rootVC visibleViewController]];
|
||||
currentVC = [self mew_getCurrentVCFrom:[(UINavigationController *)rootVC visibleViewController]];
|
||||
|
||||
} else {
|
||||
// 根视图为非导航类
|
||||
@@ -65,7 +63,7 @@ NSString * const kRoomChatPushViewKey = @"kRoomChatPushViewKey";
|
||||
return vc;
|
||||
}
|
||||
|
||||
- (UINavigationController *)currentNavigationController {
|
||||
- (UINavigationController *)mew_currentNavigationController {
|
||||
return [self currentNC];
|
||||
}
|
||||
|
||||
@@ -118,5 +116,4 @@ NSString * const kRoomChatPushViewKey = @"kRoomChatPushViewKey";
|
||||
return nil;
|
||||
}
|
||||
}
|
||||
|
||||
@end
|
@@ -7,7 +7,7 @@
|
||||
//
|
||||
|
||||
#import "TTAlertConfig.h"
|
||||
#import "UIImage+Utils.h"
|
||||
#import "UIImage+MewUtils.h"
|
||||
#import "MEWThemeColor.h"
|
||||
|
||||
static CGFloat kAlertTitleFont = 18.f;
|
||||
@@ -50,7 +50,7 @@ static CGFloat kAlertButtonCornerRadius = 8.f;
|
||||
_cancelButtonConfig.title = @"取消";// 取消按钮
|
||||
_cancelButtonConfig.font = [UIFont systemFontOfSize:kAlertButtonFont];// 按钮字体
|
||||
_cancelButtonConfig.titleColor = [MEWThemeColor mewCancelButtonTextColor];// 字体颜色
|
||||
_cancelButtonConfig.backgroundImage = [UIImage gradientColorImageFromColors:@[[MEWThemeColor mewCancelButtonGradientStartColor], [MEWThemeColor mewCancelButtonGradientEndColor]] gradientType:GradientTypeLeftToRight imgSize:CGSizeMake(10, 10)];
|
||||
_cancelButtonConfig.backgroundImage = [UIImage mew_gradientColorImageFromColors:@[[MEWThemeColor mewCancelButtonGradientStartColor], [MEWThemeColor mewCancelButtonGradientEndColor]] gradientType:MewGradientTypeLeftToRight imgSize:CGSizeMake(10, 10)];
|
||||
_cancelButtonConfig.cornerRadius = kAlertButtonCornerRadius;// 按钮背景图
|
||||
|
||||
// confirm button
|
||||
@@ -58,7 +58,7 @@ static CGFloat kAlertButtonCornerRadius = 8.f;
|
||||
_confirmButtonConfig.title = @"确定";
|
||||
_confirmButtonConfig.font = [UIFont systemFontOfSize:kAlertButtonFont];
|
||||
_confirmButtonConfig.titleColor = [MEWThemeColor mewConfirmButtonTextColor];
|
||||
_confirmButtonConfig.backgroundImage = [UIImage gradientColorImageFromColors:@[[MEWThemeColor mewConfirmButtonGradientStartColor], [MEWThemeColor mewConfirmButtonGradientEndColor]] gradientType:GradientTypeLeftToRight imgSize:CGSizeMake(10, 10)];
|
||||
_confirmButtonConfig.backgroundImage = [UIImage mew_gradientColorImageFromColors:@[[MEWThemeColor mewConfirmButtonGradientStartColor], [MEWThemeColor mewConfirmButtonGradientEndColor]] gradientType:MewGradientTypeLeftToRight imgSize:CGSizeMake(10, 10)];
|
||||
_confirmButtonConfig.cornerRadius = kAlertButtonCornerRadius;
|
||||
|
||||
_cornerRadius = kAlertCornerRadius;// 默认圆角
|
||||
|
53
yinmeng-ios/yinmeng-ios/Base/UI/UIImage/UIImage+MewUtils.h
Normal file
53
yinmeng-ios/yinmeng-ios/Base/UI/UIImage/UIImage+MewUtils.h
Normal file
@@ -0,0 +1,53 @@
|
||||
//
|
||||
// UIImage+MewUtils.h
|
||||
// yinmeng-ios
|
||||
//
|
||||
// Created by duoban on 2023/12/5.
|
||||
//
|
||||
|
||||
#import <UIKit/UIKit.h>
|
||||
typedef NS_ENUM(NSUInteger, GradientType) {
|
||||
MewGradientTypeTopToBottom = 0,//从上到小
|
||||
MewGradientTypeLeftToRight = 1,//从左到右
|
||||
MewGradientTypeUpleftToLowright = 2,//左上到右下
|
||||
MewGradientTypeUprightToLowleft = 3,//右上到左下
|
||||
};
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface UIImage (MewUtils)
|
||||
- (UIImage *)mew_grayscaleImage;
|
||||
|
||||
- (UIImage *)mew_imageBlendInGray;
|
||||
|
||||
- (UIImage *)mew_imageWithBlendMode:(CGBlendMode)blendMode;
|
||||
|
||||
+ (UIImage *)mew_imageWithColor:(UIColor *)color;
|
||||
|
||||
+ (UIImage *)mew_imageWithColor:(UIColor *)color size:(CGSize)size;
|
||||
|
||||
+ (UIImage *)mew_fixOrientation:(UIImage *)aImage;
|
||||
|
||||
- (UIImage *)mew_imageWithColor:(UIColor *)color;
|
||||
|
||||
- (UIImage *)mew_setCornerWithRadius:(CGFloat)radius andSize:(CGSize)size;
|
||||
|
||||
//异步生成纯色圆角图片
|
||||
- (void)mew_imageWithSize:(CGSize)size radius:(CGFloat)radius backColor:(UIColor *)backColor completion:(void(^)(UIImage *image))completion;
|
||||
/**
|
||||
返回指定大小,颜色,渐变模式的渐变色图片
|
||||
*/
|
||||
+ (UIImage *)mew_gradientColorImageFromColors:(NSArray<UIColor *>*)colors gradientType:(GradientType)gradientType imgSize:(CGSize)imgSize;
|
||||
|
||||
+ (UIImage *)mew_waterImageWithImage:(UIImage *)image waterImage:(UIImage *)waterImage waterImageRect:(CGRect)rect;
|
||||
|
||||
+ (CGSize)mew_sizeWithImageOriginSize:(CGSize)originSize
|
||||
minSize:(CGSize)imageMinSize
|
||||
maxSize:(CGSize)imageMaxSize;
|
||||
|
||||
///裁剪图片
|
||||
- (UIImage *)mew_cutImage:(CGSize)newSize;
|
||||
///判断是否为gif图片
|
||||
+ (BOOL)mew_isGifWithImageData: (NSData *)data;
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
@@ -1,16 +1,14 @@
|
||||
//
|
||||
// UIImage+Utils.m
|
||||
// YYMobileFramework
|
||||
// UIImage+MewUtils.m
|
||||
// yinmeng-ios
|
||||
//
|
||||
// Created by wuwei on 14/6/20.
|
||||
// Copyright (c) 2014年 YY Inc. All rights reserved.
|
||||
// Created by duoban on 2023/12/5.
|
||||
//
|
||||
|
||||
#import "UIImage+Utils.h"
|
||||
#import "UIImage+MewUtils.h"
|
||||
#import <ImageIO/ImageIO.h>
|
||||
|
||||
@implementation UIImage (Utils)
|
||||
- (UIImage *)grayscaleImage
|
||||
@implementation UIImage (MewUtils)
|
||||
- (UIImage *)mew_grayscaleImage
|
||||
{
|
||||
CGFloat width = self.size.width;
|
||||
CGFloat height = self.size.height;
|
||||
@@ -32,15 +30,15 @@
|
||||
|
||||
CGContextDrawImage(context, CGRectMake(0, 0, width, height), self.CGImage);
|
||||
CGImageRef imageRef = CGBitmapContextCreateImage(context);
|
||||
UIImage *grayscaleImage = [UIImage imageWithCGImage:imageRef];
|
||||
UIImage *mew_grayscaleImage = [UIImage imageWithCGImage:imageRef];
|
||||
CGImageRelease(imageRef);
|
||||
CGContextRelease(context);
|
||||
|
||||
return grayscaleImage;
|
||||
return mew_grayscaleImage;
|
||||
}
|
||||
|
||||
|
||||
- (UIImage *)imageBlendInGray {
|
||||
- (UIImage *)mew_imageBlendInGray {
|
||||
|
||||
UIGraphicsBeginImageContext(self.size);
|
||||
CGRect bounds = CGRectMake(0, 0, self.size.width, self.size.height);
|
||||
@@ -56,7 +54,7 @@
|
||||
|
||||
|
||||
|
||||
- (UIImage *)imageWithBlendMode:(CGBlendMode)blendMode {
|
||||
- (UIImage *)mew_imageWithBlendMode:(CGBlendMode)blendMode {
|
||||
|
||||
UIGraphicsBeginImageContextWithOptions(self.size, NO, 0.0f);
|
||||
CGRect bounds = CGRectMake(0, 0, self.size.width, self.size.height);
|
||||
@@ -72,12 +70,12 @@
|
||||
return newImg;
|
||||
}
|
||||
|
||||
+ (UIImage *)imageWithColor:(UIColor *)color
|
||||
+ (UIImage *)mew_imageWithColor:(UIColor *)color
|
||||
{
|
||||
return [self imageWithColor:color size:CGSizeMake(1, 1)];
|
||||
return [self mew_imageWithColor:color size:CGSizeMake(1, 1)];
|
||||
}
|
||||
|
||||
+ (UIImage *)imageWithColor:(UIColor *)color size:(CGSize)size {
|
||||
+ (UIImage *)mew_imageWithColor:(UIColor *)color size:(CGSize)size {
|
||||
if (!color || size.width <= 0 || size.height <= 0) return nil;
|
||||
CGRect rect = CGRectMake(0.0f, 0.0f, size.width + 1, size.height);
|
||||
UIGraphicsBeginImageContextWithOptions(rect.size, NO, 0);
|
||||
@@ -89,7 +87,7 @@
|
||||
return image;
|
||||
}
|
||||
|
||||
+ (UIImage *)fixOrientation:(UIImage *)aImage {
|
||||
+ (UIImage *)mew_fixOrientation:(UIImage *)aImage {
|
||||
|
||||
// No-op if the orientation is already correct
|
||||
if (aImage.imageOrientation == UIImageOrientationUp)
|
||||
@@ -166,7 +164,7 @@
|
||||
return img;
|
||||
}
|
||||
|
||||
- (UIImage *)imageWithColor:(UIColor *)color {
|
||||
- (UIImage *)mew_imageWithColor:(UIColor *)color {
|
||||
CGRect rect = CGRectMake(0.0f, 0.0f, 1.0f, 1.0f);
|
||||
UIGraphicsBeginImageContext(rect.size);
|
||||
CGContextRef context = UIGraphicsGetCurrentContext();
|
||||
@@ -182,7 +180,7 @@
|
||||
}
|
||||
|
||||
//异步生成纯色圆角图片
|
||||
- (void)imageWithSize:(CGSize)size radius:(CGFloat)radius backColor:(UIColor *)backColor completion:(void(^)(UIImage *image))completion {
|
||||
- (void)mew_imageWithSize:(CGSize)size radius:(CGFloat)radius backColor:(UIColor *)backColor completion:(void(^)(UIImage *image))completion {
|
||||
// 异步绘制裁切
|
||||
dispatch_async(dispatch_get_global_queue(0, 0), ^{
|
||||
// 利用绘图建立上下文
|
||||
@@ -233,7 +231,7 @@
|
||||
return image;
|
||||
}
|
||||
|
||||
+ (UIImage *)gradientColorImageFromColors:(NSArray<UIColor *> *)colors gradientType:(GradientType)gradientType imgSize:(CGSize)imgSize{
|
||||
+ (UIImage *)mew_gradientColorImageFromColors:(NSArray<UIColor *> *)colors gradientType:(GradientType)gradientType imgSize:(CGSize)imgSize{
|
||||
|
||||
NSMutableArray *ar = [NSMutableArray array];
|
||||
for(UIColor *c in colors) {
|
||||
@@ -247,19 +245,19 @@
|
||||
CGPoint start;
|
||||
CGPoint end;
|
||||
switch (gradientType) {
|
||||
case GradientTypeTopToBottom:
|
||||
case MewGradientTypeTopToBottom:
|
||||
start = CGPointMake(0.0, 0.0);
|
||||
end = CGPointMake(0.0, imgSize.height);
|
||||
break;
|
||||
case GradientTypeLeftToRight:
|
||||
case MewGradientTypeLeftToRight:
|
||||
start = CGPointMake(0.0, 0.0);
|
||||
end = CGPointMake(imgSize.width, 0.0);
|
||||
break;
|
||||
case GradientTypeUpleftToLowright:
|
||||
case MewGradientTypeUpleftToLowright:
|
||||
start = CGPointMake(0.0, 0.0);
|
||||
end = CGPointMake(imgSize.width, imgSize.height);
|
||||
break;
|
||||
case GradientTypeUprightToLowleft:
|
||||
case MewGradientTypeUprightToLowleft:
|
||||
start = CGPointMake(imgSize.width, 0.0);
|
||||
end = CGPointMake(0.0, imgSize.height);
|
||||
break;
|
||||
@@ -276,7 +274,7 @@
|
||||
return image;
|
||||
}
|
||||
|
||||
- (UIImage *)setCornerWithRadius:(CGFloat)radius andSize:(CGSize)size {
|
||||
- (UIImage *)mew_setCornerWithRadius:(CGFloat)radius andSize:(CGSize)size {
|
||||
//开启图形上下文
|
||||
UIGraphicsBeginImageContext(size);
|
||||
//绘制圆角矩形
|
||||
@@ -299,7 +297,7 @@
|
||||
}
|
||||
|
||||
// 给图片添加图片水印
|
||||
+ (UIImage *)waterImageWithImage:(UIImage *)image waterImage:(UIImage *)waterImage waterImageRect:(CGRect)rect
|
||||
+ (UIImage *)mew_waterImageWithImage:(UIImage *)image waterImage:(UIImage *)waterImage waterImageRect:(CGRect)rect
|
||||
{
|
||||
//1.获取图片
|
||||
//2.开启上下文
|
||||
@@ -316,7 +314,7 @@
|
||||
return newImage;
|
||||
}
|
||||
|
||||
+ (CGSize)sizeWithImageOriginSize:(CGSize)originSize
|
||||
+ (CGSize)mew_sizeWithImageOriginSize:(CGSize)originSize
|
||||
minSize:(CGSize)imageMinSize
|
||||
maxSize:(CGSize)imageMaxSiz {
|
||||
CGSize size;
|
||||
@@ -356,15 +354,15 @@
|
||||
return size;
|
||||
}
|
||||
|
||||
- (UIImage *)cutImage:(CGSize)newSize{
|
||||
- (UIImage *)mew_cutImage:(CGSize)newSize{
|
||||
|
||||
CGFloat scale = newSize.height / self.size.height;
|
||||
UIImage *scaleImage = [self originImage:self scaleToSize:CGSizeMake(self.size.width*scale, self.size.height*scale)];
|
||||
UIImage *scaleImage = [self mew_originImage:self scaleToSize:CGSizeMake(self.size.width*scale, self.size.height*scale)];
|
||||
//裁剪暂时有问题
|
||||
return scaleImage;
|
||||
}
|
||||
|
||||
- (UIImage*) originImage:(UIImage *)image scaleToSize:(CGSize)size {
|
||||
- (UIImage*) mew_originImage:(UIImage *)image scaleToSize:(CGSize)size {
|
||||
|
||||
UIGraphicsBeginImageContextWithOptions(size, NO, [UIScreen mainScreen].scale);
|
||||
|
||||
@@ -377,14 +375,14 @@
|
||||
return scaledImage;
|
||||
}
|
||||
|
||||
+ (BOOL)isGifWithImageData: (NSData *)data {
|
||||
if ([[self contentTypeWithImageData:data] isEqualToString:@"gif"]) {
|
||||
+ (BOOL)mew_isGifWithImageData: (NSData *)data {
|
||||
if ([[self mew_contentTypeWithImageData:data] isEqualToString:@"gif"]) {
|
||||
return YES;
|
||||
}
|
||||
return NO;
|
||||
}
|
||||
|
||||
+ (NSString *)contentTypeWithImageData: (NSData *)data {
|
||||
+ (NSString *)mew_contentTypeWithImageData: (NSData *)data {
|
||||
|
||||
uint8_t c;
|
||||
|
@@ -1,53 +0,0 @@
|
||||
//
|
||||
// UIImage+Utils.h
|
||||
// YYMobileFramework
|
||||
//
|
||||
// Created by wuwei on 14/6/20.
|
||||
// Copyright (c) 2014年 YY Inc. All rights reserved.
|
||||
//
|
||||
|
||||
#import <UIKit/UIKit.h>
|
||||
|
||||
typedef NS_ENUM(NSUInteger, GradientType) {
|
||||
GradientTypeTopToBottom = 0,//从上到小
|
||||
GradientTypeLeftToRight = 1,//从左到右
|
||||
GradientTypeUpleftToLowright = 2,//左上到右下
|
||||
GradientTypeUprightToLowleft = 3,//右上到左下
|
||||
};
|
||||
|
||||
@interface UIImage (Utils)
|
||||
|
||||
- (UIImage *)grayscaleImage;
|
||||
|
||||
- (UIImage *)imageBlendInGray;
|
||||
|
||||
- (UIImage *)imageWithBlendMode:(CGBlendMode)blendMode;
|
||||
|
||||
+ (UIImage *)imageWithColor:(UIColor *)color;
|
||||
|
||||
+ (UIImage *)imageWithColor:(UIColor *)color size:(CGSize)size;
|
||||
|
||||
+ (UIImage *)fixOrientation:(UIImage *)aImage;
|
||||
|
||||
- (UIImage *)imageWithColor:(UIColor *)color;
|
||||
|
||||
- (UIImage *)setCornerWithRadius:(CGFloat)radius andSize:(CGSize)size;
|
||||
|
||||
//异步生成纯色圆角图片
|
||||
- (void)imageWithSize:(CGSize)size radius:(CGFloat)radius backColor:(UIColor *)backColor completion:(void(^)(UIImage *image))completion;
|
||||
/**
|
||||
返回指定大小,颜色,渐变模式的渐变色图片
|
||||
*/
|
||||
+ (UIImage *)gradientColorImageFromColors:(NSArray<UIColor *>*)colors gradientType:(GradientType)gradientType imgSize:(CGSize)imgSize;
|
||||
|
||||
+ (UIImage *)waterImageWithImage:(UIImage *)image waterImage:(UIImage *)waterImage waterImageRect:(CGRect)rect;
|
||||
|
||||
+ (CGSize)sizeWithImageOriginSize:(CGSize)originSize
|
||||
minSize:(CGSize)imageMinSize
|
||||
maxSize:(CGSize)imageMaxSize;
|
||||
|
||||
///裁剪图片
|
||||
- (UIImage *)cutImage:(CGSize)newSize;
|
||||
///判断是否为gif图片
|
||||
+ (BOOL)isGifWithImageData: (NSData *)data;
|
||||
@end
|
@@ -1,16 +1,16 @@
|
||||
//
|
||||
// UIView+FilletCorner.h
|
||||
// UIView+MewFilletCorner.h
|
||||
// yinmeng-ios
|
||||
//
|
||||
// Created by duoban on 2023/11/21.
|
||||
// Created by duoban on 2023/12/5.
|
||||
//
|
||||
|
||||
#import <UIKit/UIKit.h>
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface UIView (FilletCorner)
|
||||
- (void)setCornerWithLeftTopCorner:(CGFloat)leftTop
|
||||
@interface UIView (MewFilletCorner)
|
||||
- (void)mew_setCornerWithLeftTopCorner:(CGFloat)leftTop
|
||||
rightTopCorner:(CGFloat)rigtTop
|
||||
bottomLeftCorner:(CGFloat)bottemLeft
|
||||
bottomRightCorner:(CGFloat)bottemRight
|
@@ -1,14 +1,14 @@
|
||||
//
|
||||
// UIView+FilletCorner.m
|
||||
// UIView+MewFilletCorner.m
|
||||
// yinmeng-ios
|
||||
//
|
||||
// Created by duoban on 2023/11/21.
|
||||
// Created by duoban on 2023/12/5.
|
||||
//
|
||||
|
||||
#import "UIView+FilletCorner.h"
|
||||
#import "UIView+MewFilletCorner.h"
|
||||
|
||||
@implementation UIView (FilletCorner)
|
||||
- (void)setCornerWithLeftTopCorner:(CGFloat)leftTop
|
||||
@implementation UIView (MewFilletCorner)
|
||||
- (void)mew_setCornerWithLeftTopCorner:(CGFloat)leftTop
|
||||
rightTopCorner:(CGFloat)rigtTop
|
||||
bottomLeftCorner:(CGFloat)bottemLeft
|
||||
bottomRightCorner:(CGFloat)bottemRight
|
@@ -1,42 +0,0 @@
|
||||
//
|
||||
// UIButton+EnlargeTouchArea.h
|
||||
// yinmeng-ios
|
||||
//
|
||||
// Created by 触海 on 2023/11/22.
|
||||
//
|
||||
|
||||
#import <UIKit/UIKit.h>
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface UIButton (EnlargeTouchArea)
|
||||
@property (nonatomic, assign) NSTimeInterval yn_acceptEventInterval; // 重复点击的间隔
|
||||
|
||||
//图片frmae
|
||||
@property (strong, nonatomic) NSValue *imageFrame;
|
||||
//标题frmae
|
||||
@property (strong, nonatomic) NSValue *titleFrame;
|
||||
|
||||
/**
|
||||
通过 hitTest:withEvent: 扩大btn的点击范围
|
||||
注:填写的都是 在button 原frame 上面 扩大的对应的值
|
||||
|
||||
@param top 顶部 扩大的值
|
||||
@param right 右边 扩大的值
|
||||
@param bottom 底部 扩大的值
|
||||
@param left 左边 扩大的值
|
||||
*/
|
||||
- (void)setEnlargeEdgeWithTop:(CGFloat)top right:(CGFloat)right bottom:(CGFloat)bottom left:(CGFloat)left;
|
||||
|
||||
/**
|
||||
扩大按钮点击范围
|
||||
|
||||
@discussion setEnlargeEdgeWithTop:right:bottom:left:方法的包装
|
||||
*/
|
||||
- (void)enlargeTouchArea:(UIEdgeInsets)insets;
|
||||
|
||||
|
||||
+(UIButton *)buttonInitWithText:(NSString *)text font:(UIFont *)font textColor:(UIColor *)textColor image:(UIImage *)image bgImage:(UIImage *)bgImage;
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
@@ -0,0 +1,42 @@
|
||||
//
|
||||
// UIButton+MewEnlargeTouchArea.h
|
||||
// yinmeng-ios
|
||||
//
|
||||
// Created by duoban on 2023/12/5.
|
||||
//
|
||||
|
||||
#import <UIKit/UIKit.h>
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface UIButton (MewEnlargeTouchArea)
|
||||
@property (nonatomic, assign) NSTimeInterval mew_acceptEventInterval; // 重复点击的间隔
|
||||
|
||||
//图片frmae
|
||||
@property (strong, nonatomic) NSValue *imageFrame;
|
||||
//标题frmae
|
||||
@property (strong, nonatomic) NSValue *titleFrame;
|
||||
|
||||
/**
|
||||
通过 hitTest:withEvent: 扩大btn的点击范围
|
||||
注:填写的都是 在button 原frame 上面 扩大的对应的值
|
||||
|
||||
@param top 顶部 扩大的值
|
||||
@param right 右边 扩大的值
|
||||
@param bottom 底部 扩大的值
|
||||
@param left 左边 扩大的值
|
||||
*/
|
||||
- (void)mew_setEnlargeEdgeWithTop:(CGFloat)top right:(CGFloat)right bottom:(CGFloat)bottom left:(CGFloat)left;
|
||||
|
||||
/**
|
||||
扩大按钮点击范围
|
||||
|
||||
@discussion mew_setEnlargeEdgeWithTop:right:bottom:left:方法的包装
|
||||
*/
|
||||
- (void)mew_enlargeTouchArea:(UIEdgeInsets)insets;
|
||||
|
||||
|
||||
+(UIButton *)mew_buttonInitWithText:(NSString *)text font:(UIFont *)font textColor:(UIColor *)textColor image:(UIImage *)image bgImage:(UIImage *)bgImage;
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
@@ -1,13 +1,14 @@
|
||||
//
|
||||
// UIButton+EnlargeTouchArea.m
|
||||
// UIButton+MewEnlargeTouchArea.m
|
||||
// yinmeng-ios
|
||||
//
|
||||
// Created by 触海 on 2023/11/22.
|
||||
// Created by duoban on 2023/12/5.
|
||||
//
|
||||
|
||||
#import "UIButton+EnlargeTouchArea.h"
|
||||
#import "UIButton+MewEnlargeTouchArea.h"
|
||||
#import <objc/runtime.h>
|
||||
|
||||
|
||||
#define defaultInterval 0.0003 //默认时间间隔,不能太长,以免影响系统拍照等功能
|
||||
@interface UIButton ()
|
||||
/**
|
||||
@@ -15,9 +16,7 @@
|
||||
*/
|
||||
@property (nonatomic, assign) BOOL isIgnoreEvent;
|
||||
@end
|
||||
|
||||
@implementation UIButton (EnlargeTouchArea)
|
||||
|
||||
@implementation UIButton (MewEnlargeTouchArea)
|
||||
static const char *UIControl_acceptEventInterval = "UIControl_acceptEventInterval";
|
||||
static const char *UIControl_enventIsIgnoreEvent = "UIControl_enventIsIgnoreEvent";
|
||||
|
||||
@@ -55,12 +54,12 @@ static const char *titleFrameStr = "titleFrame";
|
||||
});
|
||||
}
|
||||
- (void)new_sendAction:(SEL)action to:(id)target forEvent:(UIEvent *)event {
|
||||
self.yn_acceptEventInterval = self.yn_acceptEventInterval == 0 ? defaultInterval : self.yn_acceptEventInterval;
|
||||
self.mew_acceptEventInterval = self.mew_acceptEventInterval == 0 ? defaultInterval : self.mew_acceptEventInterval;
|
||||
if (self.isIgnoreEvent){//默认可以响应点击事件
|
||||
return;
|
||||
}
|
||||
if (self.yn_acceptEventInterval > 0){//第一次点击,设定eventTimeInterval后,可以响应点击事件
|
||||
[self performSelector:@selector(setNoIgnoreEvent) withObject:nil afterDelay:self.yn_acceptEventInterval];
|
||||
if (self.mew_acceptEventInterval > 0){//第一次点击,设定eventTimeInterval后,可以响应点击事件
|
||||
[self performSelector:@selector(setNoIgnoreEvent) withObject:nil afterDelay:self.mew_acceptEventInterval];
|
||||
}
|
||||
self.isIgnoreEvent = YES;//设置不可以响应点击事件
|
||||
[self new_sendAction:action to:target forEvent:event];
|
||||
@@ -77,10 +76,10 @@ static const char *titleFrameStr = "titleFrame";
|
||||
objc_setAssociatedObject(self, UIControl_enventIsIgnoreEvent, @(isIgnoreEvent), OBJC_ASSOCIATION_RETAIN_NONATOMIC);
|
||||
}
|
||||
|
||||
-(void)setYn_acceptEventInterval:(NSTimeInterval)yn_acceptEventInterval{
|
||||
objc_setAssociatedObject(self, UIControl_acceptEventInterval, @(yn_acceptEventInterval), OBJC_ASSOCIATION_RETAIN_NONATOMIC);
|
||||
-(void)setmew_acceptEventInterval:(NSTimeInterval)mew_acceptEventInterval{
|
||||
objc_setAssociatedObject(self, UIControl_acceptEventInterval, @(mew_acceptEventInterval), OBJC_ASSOCIATION_RETAIN_NONATOMIC);
|
||||
}
|
||||
-(NSTimeInterval)yn_acceptEventInterval{
|
||||
-(NSTimeInterval)mew_acceptEventInterval{
|
||||
return [objc_getAssociatedObject(self, UIControl_acceptEventInterval) doubleValue];
|
||||
}
|
||||
- (void)setImageFrame:(NSValue *)imageFrame{
|
||||
@@ -120,7 +119,7 @@ static char rightNameKey;
|
||||
static char bottomNameKey;
|
||||
static char leftNameKey;
|
||||
|
||||
- (void)setEnlargeEdgeWithTop:(CGFloat)top right:(CGFloat)right bottom:(CGFloat)bottom left:(CGFloat)left
|
||||
- (void)mew_setEnlargeEdgeWithTop:(CGFloat)top right:(CGFloat)right bottom:(CGFloat)bottom left:(CGFloat)left
|
||||
{
|
||||
objc_setAssociatedObject(self, &topNameKey, [NSNumber numberWithFloat:top], OBJC_ASSOCIATION_COPY_NONATOMIC);
|
||||
objc_setAssociatedObject(self, &rightNameKey, [NSNumber numberWithFloat:right], OBJC_ASSOCIATION_COPY_NONATOMIC);
|
||||
@@ -128,9 +127,9 @@ static char leftNameKey;
|
||||
objc_setAssociatedObject(self, &leftNameKey, [NSNumber numberWithFloat:left], OBJC_ASSOCIATION_COPY_NONATOMIC);
|
||||
}
|
||||
|
||||
- (void)enlargeTouchArea:(UIEdgeInsets)insets
|
||||
- (void)mew_enlargeTouchArea:(UIEdgeInsets)insets
|
||||
{
|
||||
[self setEnlargeEdgeWithTop:insets.top
|
||||
[self mew_setEnlargeEdgeWithTop:insets.top
|
||||
right:insets.right
|
||||
bottom:insets.bottom
|
||||
left:insets.left];
|
||||
@@ -165,7 +164,7 @@ static char leftNameKey;
|
||||
}
|
||||
return CGRectContainsPoint(rect, point) ? self : nil;
|
||||
}
|
||||
+(UIButton *)buttonInitWithText:(NSString *)text font:(UIFont *)font textColor:(UIColor *)textColor image:(UIImage *)image bgImage:(UIImage *)bgImage{
|
||||
+(UIButton *)mew_buttonInitWithText:(NSString *)text font:(UIFont *)font textColor:(UIColor *)textColor image:(UIImage *)image bgImage:(UIImage *)bgImage{
|
||||
UIButton *button = [[UIButton alloc]initWithFrame:CGRectZero];
|
||||
if(text.length > 0){
|
||||
[button setTitle:text forState:UIControlStateNormal];
|
@@ -1,16 +1,15 @@
|
||||
//
|
||||
// YMConstant.h
|
||||
// mew-ios
|
||||
// MewConstant.h
|
||||
// yinmeng-ios
|
||||
//
|
||||
// Created by 触海 on 2023/11/7.
|
||||
// Created by duoban on 2023/12/5.
|
||||
//
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface YMConstant : NSObject
|
||||
|
||||
@interface MewConstant : NSObject
|
||||
typedef NS_ENUM(NSUInteger, KeyType) {
|
||||
KeyType_PasswordEncode,///密码 des 加密的
|
||||
KeyType_TRTC,///TRTC key
|
@@ -1,15 +1,13 @@
|
||||
//
|
||||
// YMConstant.m
|
||||
// mew-ios
|
||||
// MewConstant.m
|
||||
// yinmeng-ios
|
||||
//
|
||||
// Created by 触海 on 2023/11/7.
|
||||
// Created by duoban on 2023/12/5.
|
||||
//
|
||||
|
||||
#import "YMConstant.h"
|
||||
#import "MewConstant.h"
|
||||
#import "NewEncryptTool.h"
|
||||
@implementation YMConstant
|
||||
|
||||
|
||||
@implementation MewConstant
|
||||
NSString * const KeyWithType(KeyType type) {
|
||||
BOOL isRelase = NO;
|
||||
#ifdef DEBUG
|
@@ -1,13 +1,12 @@
|
||||
//
|
||||
// YMEnum.h
|
||||
// mew-ios
|
||||
// MewEnum.h
|
||||
// yinmeng-ios
|
||||
//
|
||||
// Created by 触海 on 2023/11/6.
|
||||
// Created by duoban on 2023/12/5.
|
||||
//
|
||||
|
||||
#ifndef YMEnum_h
|
||||
#define YMEnum_h
|
||||
|
||||
#ifndef MewEnum_h
|
||||
#define MewEnum_h
|
||||
typedef NS_ENUM(NSUInteger, ThirdLoginType) {
|
||||
ThirdLoginType_WeChat = 1,///微信
|
||||
ThirdLoginType_QQ = 2,///QQ
|
||||
@@ -30,5 +29,4 @@ typedef NS_ENUM(NSUInteger, GetSmsType) {
|
||||
GetSmsType_Unbind_Phone = 7, ///解绑手机
|
||||
};
|
||||
|
||||
|
||||
#endif /* YMEnum_h */
|
||||
#endif /* MewEnum_h */
|
@@ -1,12 +1,12 @@
|
||||
//
|
||||
// YMMacro.h
|
||||
// mew-ios
|
||||
// MewMacro.h
|
||||
// yinmeng-ios
|
||||
//
|
||||
// Created by 触海 on 2023/11/6.
|
||||
// Created by duoban on 2023/12/5.
|
||||
//
|
||||
|
||||
#ifndef YMMacro_h
|
||||
#define YMMacro_h
|
||||
#ifndef MewMacro_h
|
||||
#define MewMacro_h
|
||||
|
||||
//iPhoneX系列设备(刘海屏设备)
|
||||
#define iPhoneXSeries \
|
||||
@@ -50,5 +50,4 @@ isPhoneXSeries = [[UIApplication sharedApplication] delegate].window.safeAreaIns
|
||||
#define kFileImage(image) [UIImage imageWithContentsOfFile:image]
|
||||
///keyWindow
|
||||
#define kWindow [UIApplication sharedApplication].keyWindow
|
||||
|
||||
#endif /* YMMacro_h */
|
||||
#endif /* MewMacro_h */
|
@@ -1,26 +0,0 @@
|
||||
//
|
||||
// Api+Main.h
|
||||
// mew-ios
|
||||
//
|
||||
// Created by 触海 on 2023/11/8.
|
||||
//
|
||||
|
||||
#import "Api.h"
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface Api (Main)
|
||||
|
||||
/// 请求Ticket
|
||||
+ (void)requestTicket:(HttpRequestHelperCompletion)completion access_token:(NSString *)accessToken issue_type:(NSString *)issueType;
|
||||
|
||||
/// 初始化配置
|
||||
/// @param complection 完成
|
||||
+ (void)clientInitConfig:(HttpRequestHelperCompletion)complection;
|
||||
|
||||
///心跳接口,每 30 秒调用一次,用来更新用户在线状态 登录成功之后调用
|
||||
+ (void)requestClientHeartBrat:(HttpRequestHelperCompletion)completion;
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
@@ -1,34 +0,0 @@
|
||||
//
|
||||
// Api+Main.m
|
||||
// mew-ios
|
||||
//
|
||||
// Created by 触海 on 2023/11/8.
|
||||
//
|
||||
|
||||
#import "Api+Main.h"
|
||||
#import "NewEncryptTool.h"
|
||||
@implementation Api (Main)
|
||||
|
||||
/// 请求Ticket
|
||||
+ (void)requestTicket:(HttpRequestHelperCompletion)completion access_token:(NSString *)accessToken issue_type:(NSString *)issueType {
|
||||
NSString *getUrl = [NewEncryptTool MEW_aesDecrypt:@"G0vRJk+lM7aIFJdrDs1Xhg=="];///oauth/ticket
|
||||
[self makeRequest:getUrl method:HttpRequestHelperMethodPOST completion:completion, __FUNCTION__, accessToken, issueType, nil];
|
||||
}
|
||||
|
||||
/// 初始化配置
|
||||
/// @param complection 完成
|
||||
+ (void)clientInitConfig:(HttpRequestHelperCompletion)complection {
|
||||
NSString *getUrl = [NewEncryptTool MEW_aesDecrypt:@"B0VaK5AAEVj2lGQmh7fdkg=="];///client/init
|
||||
[HttpRequestHelper request:getUrl method:HttpRequestHelperMethodGET params:[NSMutableDictionary dictionary] completion:complection];
|
||||
}
|
||||
|
||||
///心跳接口,每 30 秒调用一次,用来更新用户在线状态 登录成功之后调用
|
||||
+ (void)requestClientHeartBrat:(HttpRequestHelperCompletion)completion {
|
||||
NSString *getUrl = [NewEncryptTool MEW_aesDecrypt:@"hq8XfxW9EwyMQW8i9Gu8SujFTd3xA+6qI6zbeP4xLnY="];///"client/heartbeat"
|
||||
[self makeRequest:getUrl method:HttpRequestHelperMethodPOST completion:completion, __FUNCTION__, nil];
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
@end
|
24
yinmeng-ios/yinmeng-ios/Main/ClientConfig/Api/Api+MewMain.h
Normal file
24
yinmeng-ios/yinmeng-ios/Main/ClientConfig/Api/Api+MewMain.h
Normal file
@@ -0,0 +1,24 @@
|
||||
//
|
||||
// Api+MewMain.h
|
||||
// yinmeng-ios
|
||||
//
|
||||
// Created by duoban on 2023/12/5.
|
||||
//
|
||||
|
||||
#import "Api.h"
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface Api (MewMain)
|
||||
/// 请求Ticket
|
||||
+ (void)mew_requestTicket:(MewHttpRequestHelperCompletion)completion access_token:(NSString *)accessToken issue_type:(NSString *)issueType;
|
||||
|
||||
/// 初始化配置
|
||||
/// @param complection 完成
|
||||
+ (void)mew_clientInitConfig:(MewHttpRequestHelperCompletion)complection;
|
||||
|
||||
///心跳接口,每 30 秒调用一次,用来更新用户在线状态 登录成功之后调用
|
||||
+ (void)mew_requestClientHeartBrat:(MewHttpRequestHelperCompletion)completion;
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
30
yinmeng-ios/yinmeng-ios/Main/ClientConfig/Api/Api+MewMain.m
Normal file
30
yinmeng-ios/yinmeng-ios/Main/ClientConfig/Api/Api+MewMain.m
Normal file
@@ -0,0 +1,30 @@
|
||||
//
|
||||
// Api+MewMain.m
|
||||
// yinmeng-ios
|
||||
//
|
||||
// Created by duoban on 2023/12/5.
|
||||
//
|
||||
|
||||
#import "Api+MewMain.h"
|
||||
#import "NewEncryptTool.h"
|
||||
@implementation Api (MewMain)
|
||||
/// 请求Ticket
|
||||
+ (void)mew_requestTicket:(MewHttpRequestHelperCompletion)completion access_token:(NSString *)accessToken issue_type:(NSString *)issueType {
|
||||
NSString *getUrl = [NewEncryptTool MEW_aesDecrypt:@"G0vRJk+lM7aIFJdrDs1Xhg=="];///oauth/ticket
|
||||
[self makeRequest:getUrl method:MewHttpRequestHelperMethodPOST completion:completion, __FUNCTION__, accessToken, issueType, nil];
|
||||
}
|
||||
|
||||
/// 初始化配置
|
||||
/// @param complection 完成
|
||||
+ (void)mew_clientInitConfig:(MewHttpRequestHelperCompletion)complection {
|
||||
NSString *getUrl = [NewEncryptTool MEW_aesDecrypt:@"B0VaK5AAEVj2lGQmh7fdkg=="];///client/init
|
||||
[MewHttpRequestHelper request:getUrl method:MewHttpRequestHelperMethodGET params:[NSMutableDictionary dictionary] completion:complection];
|
||||
}
|
||||
|
||||
///心跳接口,每 30 秒调用一次,用来更新用户在线状态 登录成功之后调用
|
||||
+ (void)mew_requestClientHeartBrat:(MewHttpRequestHelperCompletion)completion {
|
||||
NSString *getUrl = [NewEncryptTool MEW_aesDecrypt:@"hq8XfxW9EwyMQW8i9Gu8SujFTd3xA+6qI6zbeP4xLnY="];///"client/heartbeat"
|
||||
[self makeRequest:getUrl method:MewHttpRequestHelperMethodPOST completion:completion, __FUNCTION__, nil];
|
||||
}
|
||||
|
||||
@end
|
@@ -1,20 +1,19 @@
|
||||
//
|
||||
// ClientConfig.h
|
||||
// mew-ios
|
||||
// MewMewClientConfig.h
|
||||
// yinmeng-ios
|
||||
//
|
||||
// Created by 触海 on 2023/11/8.
|
||||
// Created by duoban on 2023/12/5.
|
||||
//
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
#import "ClientDataModel.h"
|
||||
|
||||
#import "MewClientDataModel.h"
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface ClientConfig : NSObject
|
||||
@interface MewClientConfig : NSObject
|
||||
/// iOS第三方登录是否需要绑定手机号
|
||||
@property (nonatomic,assign) BOOL iosPhoneBind;
|
||||
///配置信息
|
||||
@property (nonatomic,strong) ClientDataModel *configInfo;
|
||||
@property (nonatomic,strong) MewClientDataModel *configInfo;
|
||||
///表情---
|
||||
@property (nonatomic, copy) NSString *version;
|
||||
@property (nonatomic, copy) NSString *zipMd5;
|
||||
@@ -22,12 +21,11 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
+ (instancetype)shareConfig;
|
||||
///初始化
|
||||
- (void)clientInit;
|
||||
- (void)mew_clientInit;
|
||||
///添加心跳定时器
|
||||
- (void)addHeartBratTimer;
|
||||
- (void)mew_addHeartBratTimer;
|
||||
///重置心跳定时器
|
||||
- (void)resetHeartBratTimer;
|
||||
|
||||
- (void)mew_resetHeartBratTimer;
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
@@ -1,41 +1,41 @@
|
||||
//
|
||||
// ClientConfig.m
|
||||
// mew-ios
|
||||
// MewMewClientConfig.m
|
||||
// yinmeng-ios
|
||||
//
|
||||
// Created by 触海 on 2023/11/8.
|
||||
// Created by duoban on 2023/12/5.
|
||||
//
|
||||
|
||||
#import "ClientConfig.h"
|
||||
#import "Api+Main.h"
|
||||
#import "MewClientConfig.h"
|
||||
#import "Api+MewMain.h"
|
||||
#import "MEWTimer.h"
|
||||
#import "NSObject+MEWExtension.h"
|
||||
@interface ClientConfig()
|
||||
@interface MewClientConfig()
|
||||
///重试的次数 10次 如果你还是失败的话 那就算了 没办法了
|
||||
@property (nonatomic,assign) int retryCount;
|
||||
@end
|
||||
|
||||
@implementation ClientConfig {
|
||||
@implementation MewClientConfig
|
||||
{
|
||||
NSTimer *_timer;
|
||||
}
|
||||
|
||||
+ (instancetype)shareConfig {
|
||||
static dispatch_once_t onceToken;
|
||||
static ClientConfig * config;
|
||||
static MewClientConfig * config;
|
||||
dispatch_once(&onceToken, ^{
|
||||
config = [[ClientConfig alloc] init];
|
||||
config = [[MewClientConfig alloc] init];
|
||||
});
|
||||
return config;
|
||||
}
|
||||
|
||||
#pragma mark - Public Method
|
||||
/// 获取配置信息
|
||||
- (void)clientInit {
|
||||
[Api clientInitConfig:^(BaseModel * _Nonnull data, NSInteger code, NSString * _Nonnull msg) {
|
||||
- (void)mew_clientInit {
|
||||
[Api mew_clientInitConfig:^(BaseModel * _Nonnull data, NSInteger code, NSString * _Nonnull msg) {
|
||||
if (code == 200) {
|
||||
self.retryCount = 0;
|
||||
NSDictionary *initData = data.data;
|
||||
self.iosPhoneBind = [initData[@"iosPhoneBind"] boolValue];
|
||||
ClientDataModel *model = [ClientDataModel mewModelWithDictionary:data.data];
|
||||
MewClientDataModel *model = [MewClientDataModel mewModelWithDictionary:data.data];
|
||||
self.configInfo = model;
|
||||
// 表情
|
||||
|
||||
@@ -56,7 +56,7 @@
|
||||
} else {
|
||||
if (self.retryCount < 10) {
|
||||
self.retryCount += 1;
|
||||
[self clientInit];
|
||||
[self mew_clientInit];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -65,12 +65,12 @@
|
||||
}
|
||||
|
||||
///添加心跳定时器
|
||||
- (void)addHeartBratTimer {
|
||||
- (void)mew_addHeartBratTimer {
|
||||
if (_timer == nil) return;
|
||||
|
||||
_timer = [MEWTimer MEWScheduledTimerWithTimeInterval:30 block:^(id _Nonnull userInfo) {
|
||||
|
||||
[Api requestClientHeartBrat:^(BaseModel * _Nullable data, NSInteger code, NSString * _Nullable msg) {
|
||||
[Api mew_requestClientHeartBrat:^(BaseModel * _Nullable data, NSInteger code, NSString * _Nullable msg) {
|
||||
|
||||
}];
|
||||
|
||||
@@ -79,10 +79,9 @@
|
||||
}
|
||||
|
||||
///重置心跳定时器
|
||||
- (void)resetHeartBratTimer {
|
||||
- (void)mew_resetHeartBratTimer {
|
||||
if (_timer) {
|
||||
_timer = nil;
|
||||
}
|
||||
}
|
||||
|
||||
@end
|
@@ -1,12 +0,0 @@
|
||||
//
|
||||
// ClientDataModel.m
|
||||
// mew-ios
|
||||
//
|
||||
// Created by 触海 on 2023/11/8.
|
||||
//
|
||||
|
||||
#import "ClientDataModel.h"
|
||||
|
||||
@implementation ClientDataModel
|
||||
|
||||
@end
|
@@ -1,15 +1,15 @@
|
||||
//
|
||||
// ClientDataModel.h
|
||||
// mew-ios
|
||||
// MewClientDataModel.h
|
||||
// yinmeng-ios
|
||||
//
|
||||
// Created by 触海 on 2023/11/8.
|
||||
// Created by duoban on 2023/12/5.
|
||||
//
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface ClientDataModel : NSObject
|
||||
@interface MewClientDataModel : NSObject
|
||||
|
||||
/// 首页tag 配置
|
||||
@property (nonatomic,strong) NSArray<NSString *> *homeTabList;
|
||||
@@ -21,7 +21,6 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
@property (nonatomic, strong) NSArray<NSString *> *officialMsgUids;
|
||||
///官方账号 小秘书 红包消息
|
||||
@property (nonatomic,strong) NSArray<NSString *> *officialAccountUids;
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
@@ -0,0 +1,12 @@
|
||||
//
|
||||
// MewClientDataModel.m
|
||||
// yinmeng-ios
|
||||
//
|
||||
// Created by duoban on 2023/12/5.
|
||||
//
|
||||
|
||||
#import "MewClientDataModel.h"
|
||||
|
||||
@implementation MewClientDataModel
|
||||
|
||||
@end
|
@@ -12,21 +12,21 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
@interface Api (MewHome)
|
||||
|
||||
/// Mew 首页随机列表
|
||||
+ (void)getMewHomeFriendListCompleted:(HttpRequestHelperCompletion)completed gender:(NSString *)gender ;
|
||||
+ (void)getMewHomeFriendListCompleted:(MewHttpRequestHelperCompletion)completed gender:(NSString *)gender ;
|
||||
|
||||
/// 获取首页用户的数据
|
||||
/// - Parameters:
|
||||
/// - complection: 数据回调
|
||||
/// - gender: 用户的性别
|
||||
+ (void)getNewFriendListComplection:(HttpRequestHelperCompletion)complection gender:(NSString *)gender;
|
||||
+ (void)getNewFriendListComplection:(MewHttpRequestHelperCompletion)complection gender:(NSString *)gender;
|
||||
|
||||
|
||||
/// 上传七牛获取token
|
||||
/// @param completion 完成
|
||||
+ (void)qiniuUpLoadImage:(HttpRequestHelperCompletion)completion;
|
||||
+ (void)qiniuUpLoadImage:(MewHttpRequestHelperCompletion)completion;
|
||||
|
||||
/// 音萌商店包的上传声音秀
|
||||
+ (void)mewPublishVoiceShow:(HttpRequestHelperCompletion)completion dura:(NSString *)dura desc:(NSString *)desc gender:(NSString *)gender url:(NSString *)url;
|
||||
+ (void)mewPublishVoiceShow:(MewHttpRequestHelperCompletion)completion dura:(NSString *)dura desc:(NSString *)desc gender:(NSString *)gender url:(NSString *)url;
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
|
@@ -11,29 +11,29 @@
|
||||
@implementation Api (MewHome)
|
||||
|
||||
/// Mew 首页随机列表
|
||||
+ (void)getMewHomeFriendListCompleted:(HttpRequestHelperCompletion)completed gender:(NSString *)gender {
|
||||
+ (void)getMewHomeFriendListCompleted:(MewHttpRequestHelperCompletion)completed gender:(NSString *)gender {
|
||||
NSString *getUrl = [NewEncryptTool MEW_aesDecrypt:@"ZnqkAkDTTXWcnvwqETmxzC3fgpK+OuH3kRHkQFI0HyM="];///voiceShow/listRandom
|
||||
[self makeRequest:getUrl method:HttpRequestHelperMethodGET completion:completed, __FUNCTION__, gender, nil];
|
||||
[self makeRequest:getUrl method:MewHttpRequestHelperMethodGET completion:completed, __FUNCTION__, gender, nil];
|
||||
}
|
||||
|
||||
/// 获取新朋友列表
|
||||
+ (void)getNewFriendListComplection:(HttpRequestHelperCompletion)complection gender:(NSString *)gender {
|
||||
+ (void)getNewFriendListComplection:(MewHttpRequestHelperCompletion)complection gender:(NSString *)gender {
|
||||
NSString *getUrl = [NewEncryptTool MEW_aesDecrypt:@"snLITcKwwnlRGbuT+0t3Gw=="];///home/newFriend
|
||||
[self makeRequest:getUrl method:HttpRequestHelperMethodGET completion:complection, __FUNCTION__, gender, nil];
|
||||
[self makeRequest:getUrl method:MewHttpRequestHelperMethodGET completion:complection, __FUNCTION__, gender, nil];
|
||||
}
|
||||
|
||||
/// 上传七牛获取token
|
||||
/// @param completion 完成
|
||||
+ (void)qiniuUpLoadImage:(HttpRequestHelperCompletion)completion {
|
||||
+ (void)qiniuUpLoadImage:(MewHttpRequestHelperCompletion)completion {
|
||||
NSString *getUrl = [NewEncryptTool MEW_aesDecrypt:@"V5gbqkWkuc4Fvzj9mYj/hBeoD5CULsPTsiK8Z8GieqY="];///qiniu/upload/getUploadToken
|
||||
[self makeRequest:getUrl method:HttpRequestHelperMethodGET completion:completion, __FUNCTION__, nil];
|
||||
[self makeRequest:getUrl method:MewHttpRequestHelperMethodGET completion:completion, __FUNCTION__, nil];
|
||||
|
||||
}
|
||||
|
||||
|
||||
/// 音萌商店包的上传声音秀
|
||||
+ (void)mewPublishVoiceShow:(HttpRequestHelperCompletion)completion dura:(NSString *)dura desc:(NSString *)desc gender:(NSString *)gender url:(NSString *)url {
|
||||
[self makeRequest:@"voiceShow/publish" method:HttpRequestHelperMethodPOST completion:completion, __FUNCTION__, dura, desc, gender, url, nil];
|
||||
+ (void)mewPublishVoiceShow:(MewHttpRequestHelperCompletion)completion dura:(NSString *)dura desc:(NSString *)desc gender:(NSString *)gender url:(NSString *)url {
|
||||
[self makeRequest:@"voiceShow/publish" method:MewHttpRequestHelperMethodPOST completion:completion, __FUNCTION__, dura, desc, gender, url, nil];
|
||||
}
|
||||
|
||||
@end
|
||||
|
@@ -21,7 +21,7 @@
|
||||
#import "MewSessionViewController.h"
|
||||
#import <NIMSDK/NIMSDK.h>
|
||||
/// Tool
|
||||
#import "YMMacro.h"
|
||||
#import "MewMacro.h"
|
||||
#import "MEWThemeColor.h"
|
||||
#import "MewHUDTool.h"
|
||||
/// P
|
||||
@@ -130,7 +130,7 @@
|
||||
// 关注加载更多
|
||||
- (void)mew_moreFollownModelRefresh {
|
||||
if (self.hasNoMoreData) {
|
||||
[self showErrorToast:@"没有更多数据了"];
|
||||
[self mew_showErrorToast:@"没有更多数据了"];
|
||||
return;
|
||||
}
|
||||
self.page++;
|
||||
@@ -286,7 +286,7 @@
|
||||
/// 上传声音秀
|
||||
/// 声音路径,声音介绍
|
||||
- (void)mewPushExclusiveVoice:(NSString *)filePath voiceIntroString:(nonnull NSString *)voiceIntroString dura:(NSInteger)dura {
|
||||
[MewHUDTool showLoadingWithMessage:@"正在上传音频中请稍等"];
|
||||
[MewHUDTool mew_showLoadingWithMessage:@"正在上传音频中请稍等"];
|
||||
self.voiceString = voiceIntroString;
|
||||
self.duration = dura;
|
||||
[self.presenter mew_uploadVoice:filePath];
|
||||
|
@@ -7,7 +7,7 @@
|
||||
|
||||
#import "MewHeaderView.h"
|
||||
/// Tool
|
||||
#import "YMMacro.h"
|
||||
#import "MewMacro.h"
|
||||
#import "MEWThemeColor.h"
|
||||
#import <Masonry/Masonry.h>
|
||||
|
||||
|
@@ -9,7 +9,7 @@
|
||||
/// Third
|
||||
#import <Masonry/Masonry.h>
|
||||
/// Tool
|
||||
#import "YMMacro.h"
|
||||
#import "MewMacro.h"
|
||||
#import "MEWThemeColor.h"
|
||||
|
||||
@interface MewHomeFilterView()
|
||||
|
@@ -11,11 +11,11 @@
|
||||
/// Third
|
||||
#import <Masonry/Masonry.h>
|
||||
/// Tool
|
||||
#import "UIImage+Utils.h"
|
||||
#import "UIImage+MewUtils.h"
|
||||
#import "MEWThemeColor.h"
|
||||
#import "YMMacro.h"
|
||||
#import "MewMacro.h"
|
||||
#import "MewHUDTool.h"
|
||||
#import "YMIButton.h"
|
||||
#import "MewButton.h"
|
||||
|
||||
@interface MewPlayVoiceView()
|
||||
@property (nonatomic, strong) UIImageView *bgImageView;
|
||||
@@ -27,7 +27,7 @@
|
||||
/// 唱片机柄
|
||||
@property (nonatomic, strong) UIImageView *playVoiceImageView;
|
||||
/// 发布声音秀
|
||||
@property (nonatomic, strong) YMIButton *pushVoiceButton;
|
||||
@property (nonatomic, strong) MewButton *pushVoiceButton;
|
||||
|
||||
@property (nonatomic, strong) UIView *optionVoiceBgView;
|
||||
/// 暂停
|
||||
@@ -187,18 +187,18 @@
|
||||
return _playVoiceButton;
|
||||
}
|
||||
|
||||
- (YMIButton *)pushVoiceButton {
|
||||
- (MewButton *)pushVoiceButton {
|
||||
if (!_pushVoiceButton) {
|
||||
_pushVoiceButton = [[YMIButton alloc] initWithImagePosition:XPButtonImagePositionRight];
|
||||
_pushVoiceButton = [[MewButton alloc] initWithImagePosition:MewButtonImagePositionRight];
|
||||
[_pushVoiceButton setImage:[UIImage imageNamed:@"mew_home_push_voice"] forState:UIControlStateNormal];
|
||||
[_pushVoiceButton setTitle:@"发布声音秀" forState:UIControlStateNormal];
|
||||
_pushVoiceButton.layer.cornerRadius = 52.0/2;
|
||||
_pushVoiceButton.layer.masksToBounds = YES;
|
||||
UIImage *backgroundImage = [UIImage gradientColorImageFromColors:@[
|
||||
UIImage *backgroundImage = [UIImage mew_gradientColorImageFromColors:@[
|
||||
[MEWThemeColor mewColorWithHexString:@"#FF60FD"],
|
||||
[MEWThemeColor mewColorWithHexString:@"##8974FF"],
|
||||
[MEWThemeColor mewColorWithHexString:@"#69EBFF"]
|
||||
] gradientType:GradientTypeLeftToRight imgSize:CGSizeMake(200, 52)];
|
||||
] gradientType:MewGradientTypeLeftToRight imgSize:CGSizeMake(200, 52)];
|
||||
_pushVoiceButton.backgroundColor = [UIColor colorWithPatternImage:backgroundImage];
|
||||
[_pushVoiceButton addTarget:self action:@selector(pushVoiceButtonAction) forControlEvents:UIControlEventTouchUpInside];
|
||||
}
|
||||
|
@@ -7,9 +7,9 @@
|
||||
|
||||
#import "MewPushExclusiveVoiceView.h"
|
||||
/// Tool
|
||||
#import "YMMacro.h"
|
||||
#import "MewMacro.h"
|
||||
#import "MEWThemeColor.h"
|
||||
#import "UIImage+Utils.h"
|
||||
#import "UIImage+MewUtils.h"
|
||||
#import "YYUtility.h"
|
||||
#import "AccountInfoStorage.h"
|
||||
#import "NSArray+MewSafe.h"
|
||||
@@ -729,7 +729,7 @@ static MewPushExclusiveVoiceView *_exclusiveVoiceView = nil;
|
||||
_pushVoiceButton.titleLabel.font = kFontSemibold(16);
|
||||
_pushVoiceButton.layer.cornerRadius = 23.0;
|
||||
_pushVoiceButton.layer.masksToBounds = YES;
|
||||
UIImage *image = [UIImage gradientColorImageFromColors:@[[MEWThemeColor mewColorWithHexString:@"#FF60FD"], [MEWThemeColor mewColorWithHexString:@"#8974FF"],[MEWThemeColor mewColorWithHexString:@"#69EBFF"]] gradientType:GradientTypeLeftToRight imgSize:CGSizeMake(KScreenWidth - 4 * 28, 46)];
|
||||
UIImage *image = [UIImage mew_gradientColorImageFromColors:@[[MEWThemeColor mewColorWithHexString:@"#FF60FD"], [MEWThemeColor mewColorWithHexString:@"#8974FF"],[MEWThemeColor mewColorWithHexString:@"#69EBFF"]] gradientType:MewGradientTypeLeftToRight imgSize:CGSizeMake(KScreenWidth - 4 * 28, 46)];
|
||||
_pushVoiceButton.backgroundColor = [UIColor colorWithPatternImage:image];
|
||||
[_pushVoiceButton addTarget:self action:@selector(pushWithRecordVoice) forControlEvents:UIControlEventTouchUpInside];
|
||||
}
|
||||
|
@@ -6,7 +6,7 @@
|
||||
//
|
||||
|
||||
#import <UIKit/UIKit.h>
|
||||
#import "YMEnum.h"
|
||||
#import "MewEnum.h"
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
|
@@ -6,7 +6,7 @@
|
||||
//
|
||||
|
||||
#import "MewRightFollowVoiceCollectionCell.h"
|
||||
#import "YMMacro.h"
|
||||
#import "MewMacro.h"
|
||||
#import <Masonry/Masonry.h>
|
||||
#import "NetImageView.h"
|
||||
|
||||
|
@@ -11,7 +11,7 @@
|
||||
/// Third
|
||||
#import <Masonry/Masonry.h>
|
||||
/// Tool
|
||||
#import "YMMacro.h"
|
||||
#import "MewMacro.h"
|
||||
#import "MEWThemeColor.h"
|
||||
#import "MewFansInfoModel.h"
|
||||
#import "UserInfoModel.h"
|
||||
@@ -118,7 +118,7 @@
|
||||
self.moreFollownRefresh();
|
||||
}
|
||||
// if (self.hasNoMoreData) {
|
||||
// [self showErrorToast:@"没有更多数据了"];
|
||||
// [self mew_showErrorToast:@"没有更多数据了"];
|
||||
// return;
|
||||
// }
|
||||
// self.page++;
|
||||
|
@@ -9,7 +9,7 @@
|
||||
#import "MewPlayVoiceView.h"
|
||||
#import "MewVoiceDiscView.h"
|
||||
/// Tool
|
||||
#import "YMMacro.h"
|
||||
#import "MewMacro.h"
|
||||
#import "MewAudioPlayerManager.h"
|
||||
#import "MewHUDTool.h"
|
||||
/// Third
|
||||
|
@@ -10,7 +10,7 @@
|
||||
///Model
|
||||
#import "UserInfoModel.h"
|
||||
/// Tool
|
||||
#import "YMMacro.h"
|
||||
#import "MewMacro.h"
|
||||
#import "MEWThemeColor.h"
|
||||
#import "MewAudioPlayerManager.h"
|
||||
/// Third
|
||||
|
@@ -8,7 +8,7 @@
|
||||
#import "MewVoiceGuideView.h"
|
||||
/// Tool
|
||||
#import "MEWThemeColor.h"
|
||||
#import "YMMacro.h"
|
||||
#import "MewMacro.h"
|
||||
#import <Masonry/Masonry.h>
|
||||
|
||||
|
||||
|
@@ -5,11 +5,11 @@
|
||||
// Created by 触海 on 2023/11/7.
|
||||
//
|
||||
|
||||
#import "BaseViewController.h"
|
||||
#import "MewBaseViewController.h"
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface MewLoginNumberViewController : BaseViewController
|
||||
@interface MewLoginNumberViewController : MewBaseViewController
|
||||
|
||||
@end
|
||||
|
||||
|
@@ -12,7 +12,7 @@
|
||||
/// Third
|
||||
#import <Masonry/Masonry.h>
|
||||
/// Tool
|
||||
#import "YMMacro.h"
|
||||
#import "MewMacro.h"
|
||||
|
||||
@interface MewLoginNumberViewController ()<MewLoginPhoneViewDelegate, MewLoginPasswordViewDelegate>
|
||||
@property (nonatomic, strong) UIImageView *bgImageView;
|
||||
|
@@ -7,8 +7,8 @@
|
||||
|
||||
#import "MewLoginViewController.h"
|
||||
#import "MewLoginNumberViewController.h"
|
||||
#import "YMIButton.h"
|
||||
#import "YMWebViewController.h"
|
||||
#import "MewButton.h"
|
||||
#import "MewWebViewController.h"
|
||||
//apple
|
||||
#import <AuthenticationServices/ASAuthorizationAppleIDButton.h>
|
||||
#import <AuthenticationServices/AuthenticationServices.h>
|
||||
@@ -17,11 +17,11 @@
|
||||
#import <YYText.h>
|
||||
#import <Masonry/Masonry.h>
|
||||
///Tool
|
||||
#import "YMMacro.h"
|
||||
#import "MewMacro.h"
|
||||
#import "MEWThemeColor.h"
|
||||
#import "MewHUDTool.h"
|
||||
#import "UIImage+Utils.h"
|
||||
#import "YMConstant.h"
|
||||
#import "UIImage+MewUtils.h"
|
||||
#import "MewConstant.h"
|
||||
#import "MEWGCDHelper.h"
|
||||
#import "Base.h"
|
||||
#import "AccountInfoStorage.h"
|
||||
@@ -53,7 +53,7 @@ typedef NS_ENUM(NSUInteger, XYLoginType) {
|
||||
|
||||
//@property (nonatomic, strong) UIStackView *stackView;
|
||||
/// 苹果
|
||||
@property (nonatomic, strong) YMIButton *appleButtonView;
|
||||
@property (nonatomic, strong) MewButton *appleButtonView;
|
||||
|
||||
/** 同意勾选按钮*/
|
||||
@property (nonatomic, strong) UIButton *agreeButton;
|
||||
@@ -232,7 +232,7 @@ typedef NS_ENUM(NSUInteger, XYLoginType) {
|
||||
#pragma mark - MewLoginProtocol
|
||||
- (void)mew_loginSuccess {
|
||||
[self dismissViewControllerAnimated:YES completion:nil];
|
||||
[self showSuccessToast:@"登录成功"];
|
||||
[self mew_showSuccessToast:@"登录成功"];
|
||||
}
|
||||
|
||||
|
||||
@@ -415,12 +415,12 @@ typedef NS_ENUM(NSUInteger, XYLoginType) {
|
||||
[_loginButton setTitleColor:UIColor.whiteColor forState:UIControlStateNormal];
|
||||
_loginButton.titleLabel.font = kFontMedium(16);
|
||||
_loginButton.titleLabel.font = [UIFont fontWithName:@"PingFang-SC-Medium" size:18];
|
||||
UIImage *bgImage = [UIImage gradientColorImageFromColors:@[[MEWThemeColor mewColorWithHexString:@"#FF60FD"],
|
||||
UIImage *bgImage = [UIImage mew_gradientColorImageFromColors:@[[MEWThemeColor mewColorWithHexString:@"#FF60FD"],
|
||||
[MEWThemeColor mewColorWithHexString:@"##8974FF"],
|
||||
[MEWThemeColor mewColorWithHexString:@"#69EBFF"]] gradientType:GradientTypeLeftToRight imgSize:CGSizeMake(KScreenWidth - 80, 52)];
|
||||
[MEWThemeColor mewColorWithHexString:@"#69EBFF"]] gradientType:MewGradientTypeLeftToRight imgSize:CGSizeMake(KScreenWidth - 80, 52)];
|
||||
_loginButton.backgroundColor = [UIColor colorWithPatternImage:bgImage];
|
||||
// [_loginButton setTitleColor:ThemeColor.mewMainTextColor forState:UIControlStateNormal];
|
||||
// UIImage *image = [UIImage gradientColorImageFromColors:@[[MEWThemeColor mewConfirmButtonGradientStartColor],[MEWThemeColor mewConfirmButtonGradientEndColor]] gradientType:GradientTypeLeftToRight imgSize:CGSizeMake(KScreenWidth - 52 * 2, 45)];
|
||||
// UIImage *image = [UIImage mew_gradientColorImageFromColors:@[[MEWThemeColor mewConfirmButtonGradientStartColor],[MEWThemeColor mewConfirmButtonGradientEndColor]] gradientType:GradientTypeLeftToRight imgSize:CGSizeMake(KScreenWidth - 52 * 2, 45)];
|
||||
// [_loginButton setBackgroundImage:image forState:UIControlStateNormal];
|
||||
[_loginButton addTarget:self action:@selector(mew_loginButtonAction:) forControlEvents:UIControlEventTouchUpInside];
|
||||
}
|
||||
@@ -464,7 +464,7 @@ typedef NS_ENUM(NSUInteger, XYLoginType) {
|
||||
[userAttString yy_setTextHighlightRange:NSMakeRange(0, userAttString.length) color:nil backgroundColor:nil userInfo:nil tapAction:^(UIView * _Nonnull containerView, NSAttributedString * _Nonnull text, NSRange range, CGRect rect) {
|
||||
__strong typeof(self) strongSelf = weakSelf;
|
||||
// 跳转用户协议
|
||||
YMWebViewController * webVC = [[YMWebViewController alloc] init];
|
||||
MewWebViewController * webVC = [[MewWebViewController alloc] init];
|
||||
webVC.url = URLWithType(kUserProtocalURL);
|
||||
[strongSelf.navigationController pushViewController:webVC animated:YES];
|
||||
} longPressAction:nil];
|
||||
@@ -477,7 +477,7 @@ typedef NS_ENUM(NSUInteger, XYLoginType) {
|
||||
// @strongify(self);
|
||||
__strong typeof(self) strongSelf = weakSelf;
|
||||
// 跳转隐私政策
|
||||
YMWebViewController * webVC = [[YMWebViewController alloc] init];
|
||||
MewWebViewController * webVC = [[MewWebViewController alloc] init];
|
||||
webVC.url = URLWithType(kPrivacyURL);
|
||||
[self.navigationController pushViewController:webVC animated:YES];
|
||||
} longPressAction:nil];
|
||||
@@ -524,9 +524,9 @@ typedef NS_ENUM(NSUInteger, XYLoginType) {
|
||||
// return _stackView;
|
||||
//}
|
||||
|
||||
- (YMIButton *)appleButtonView { //手机号登录
|
||||
- (MewButton *)appleButtonView { //手机号登录
|
||||
if (!_appleButtonView) {
|
||||
_appleButtonView = [[YMIButton alloc] initWithImagePosition:XPButtonImagePositionTop];
|
||||
_appleButtonView = [[MewButton alloc] initWithImagePosition:MewButtonImagePositionTop];
|
||||
[_appleButtonView setImage: [UIImage imageNamed:@"mew_login_apple"] forState:UIControlStateNormal];
|
||||
[_appleButtonView setTitle:@"苹果登录" forState:UIControlStateNormal];
|
||||
[_appleButtonView setTitleColor:UIColor.whiteColor forState:UIControlStateNormal];
|
||||
|
@@ -12,9 +12,9 @@
|
||||
/// Tool
|
||||
#import "MEWThemeColor.h"
|
||||
#import "MewHUDTool.h"
|
||||
#import "UIImage+Utils.h"
|
||||
#import "YMConstant.h"
|
||||
#import "YMMacro.h"
|
||||
#import "UIImage+MewUtils.h"
|
||||
#import "MewConstant.h"
|
||||
#import "MewMacro.h"
|
||||
///View
|
||||
#import "MewLoginInputView.h"
|
||||
///present
|
||||
@@ -144,7 +144,7 @@
|
||||
[_nextButton setImage:[UIImage imageNamed:@"mew_login_next"] forState:UIControlStateNormal];
|
||||
_nextButton.titleLabel.font = [UIFont fontWithName:@"PingFang-SC-Medium" size:18];
|
||||
[_nextButton setTitleColor:UIColor.blackColor forState:UIControlStateNormal];
|
||||
UIImage *image = [UIImage gradientColorImageFromColors:@[[MEWThemeColor mewColorWithHexString:@"#FF60FD"], [MEWThemeColor mewColorWithHexString:@"#8974FF"],[MEWThemeColor mewColorWithHexString:@"#69EBFF"]] gradientType:GradientTypeLeftToRight imgSize:CGSizeMake(KScreenWidth - 2*36, 52)];
|
||||
UIImage *image = [UIImage mew_gradientColorImageFromColors:@[[MEWThemeColor mewColorWithHexString:@"#FF60FD"], [MEWThemeColor mewColorWithHexString:@"#8974FF"],[MEWThemeColor mewColorWithHexString:@"#69EBFF"]] gradientType:MewGradientTypeLeftToRight imgSize:CGSizeMake(KScreenWidth - 2*36, 52)];
|
||||
_nextButton.backgroundColor = [UIColor colorWithPatternImage:image];
|
||||
[_nextButton addTarget:self action:@selector(mew_nextButtonAction) forControlEvents:UIControlEventTouchUpInside];
|
||||
}
|
||||
|
@@ -15,9 +15,9 @@
|
||||
#import "MewLoginVerifCodeProtocol.h"
|
||||
/// Tool
|
||||
#import "MEWThemeColor.h"
|
||||
#import "YMMacro.h"
|
||||
#import "MewMacro.h"
|
||||
#import "MewHUDTool.h"
|
||||
#import "UIImage+Utils.h"
|
||||
#import "UIImage+MewUtils.h"
|
||||
/// View
|
||||
#import "MewLoginInputView.h"
|
||||
|
||||
@@ -314,7 +314,7 @@
|
||||
_confirmButton.layer.cornerRadius = 52/2.f;
|
||||
[_confirmButton setImage:[UIImage imageNamed:@"mew_login_next"] forState:UIControlStateNormal];
|
||||
_confirmButton.titleLabel.font = [UIFont fontWithName:@"PingFang-SC-Medium" size:18];
|
||||
UIImage *image = [UIImage gradientColorImageFromColors:@[[MEWThemeColor mewColorWithHexString:@"#FF60FD"], [MEWThemeColor mewColorWithHexString:@"#8974FF"],[MEWThemeColor mewColorWithHexString:@"#69EBFF"]] gradientType:GradientTypeLeftToRight imgSize:CGSizeMake(KScreenWidth - 2*36, 52)];
|
||||
UIImage *image = [UIImage mew_gradientColorImageFromColors:@[[MEWThemeColor mewColorWithHexString:@"#FF60FD"], [MEWThemeColor mewColorWithHexString:@"#8974FF"],[MEWThemeColor mewColorWithHexString:@"#69EBFF"]] gradientType:MewGradientTypeLeftToRight imgSize:CGSizeMake(KScreenWidth - 2*36, 52)];
|
||||
_confirmButton.backgroundColor = [UIColor colorWithPatternImage:image];
|
||||
[_confirmButton setTitleColor:UIColor.whiteColor forState:UIControlStateNormal];
|
||||
[_confirmButton addTarget:self action:@selector(mew_confirmButtonAction) forControlEvents:UIControlEventTouchUpInside];
|
||||
|
@@ -12,14 +12,14 @@
|
||||
/// View
|
||||
#import "MewNIMBadgeView.h"
|
||||
/// Tool
|
||||
#import "ClientConfig.h"
|
||||
#import "MewClientConfig.h"
|
||||
#import "NetImageView.h"
|
||||
#import "MEWThemeColor.h"
|
||||
#import "MewNIMMessageUtils.h"
|
||||
#import "MewTimeIntervalUtils.h"
|
||||
#import "UIView+NIM.h"
|
||||
#import "UIView+FilletCorner.h"
|
||||
#import "YMMacro.h"
|
||||
#import "UIView+MewFilletCorner.h"
|
||||
#import "MewMacro.h"
|
||||
#import "NewEncryptTool.h"
|
||||
@interface MewSessionListTableViewCell()
|
||||
|
||||
@@ -157,7 +157,7 @@
|
||||
- (UIView *)containerView {
|
||||
if (!_containerView) {
|
||||
_containerView = [[UIView alloc] init];
|
||||
[_containerView setCornerWithLeftTopCorner:36 rightTopCorner:10 bottomLeftCorner:36 bottomRightCorner:10 size:CGSizeMake(KScreenWidth - 32, 72)];
|
||||
[_containerView mew_setCornerWithLeftTopCorner:36 rightTopCorner:10 bottomLeftCorner:36 bottomRightCorner:10 size:CGSizeMake(KScreenWidth - 32, 72)];
|
||||
_containerView.backgroundColor = UIColorMewFromRGB(0x525566);
|
||||
}
|
||||
|
||||
|
@@ -5,11 +5,11 @@
|
||||
// Created by 触海 on 2023/11/9.
|
||||
//
|
||||
|
||||
#import "BaseViewController.h"
|
||||
#import "MewBaseViewController.h"
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface MewSessionListViewController : BaseViewController
|
||||
@interface MewSessionListViewController : MewBaseViewController
|
||||
|
||||
@end
|
||||
|
||||
|
@@ -11,8 +11,8 @@
|
||||
/// View
|
||||
#import "MewSessionListTableViewCell.h"
|
||||
/// Tool
|
||||
#import "YMMacro.h"
|
||||
#import "ClientConfig.h"
|
||||
#import "MewMacro.h"
|
||||
#import "MewClientConfig.h"
|
||||
#import <Masonry/Masonry.h>
|
||||
#import "MewSessionViewController.h"
|
||||
@interface MewSessionListViewController ()<UITableViewDelegate, UITableViewDataSource,
|
||||
@@ -74,7 +74,7 @@
|
||||
|
||||
NSMutableArray* sessionList = [NSMutableArray array];
|
||||
[allRecentSessions enumerateObjectsUsingBlock:^(NIMRecentSession * _Nonnull obj, NSUInteger idx, BOOL * _Nonnull stop) {
|
||||
if ([[ClientConfig shareConfig].configInfo.officialMsgUids containsObject:obj.session.sessionId] || [[ClientConfig shareConfig].configInfo.officialAccountUids containsObject:obj.session.sessionId]) {
|
||||
if ([[MewClientConfig shareConfig].configInfo.officialMsgUids containsObject:obj.session.sessionId] || [[MewClientConfig shareConfig].configInfo.officialAccountUids containsObject:obj.session.sessionId]) {
|
||||
return;
|
||||
}
|
||||
if (obj.session.sessionId.integerValue > 0 ) {
|
||||
@@ -110,7 +110,7 @@
|
||||
/// 增加最近会话完成
|
||||
- (void)didAddRecentSession:(NIMRecentSession *)recentSession totalUnreadCount:(NSInteger)totalUnreadCount {
|
||||
// 判断是否是官方账号
|
||||
if ([[ClientConfig shareConfig].configInfo.officialMsgUids containsObject:recentSession.session.sessionId] || [[ClientConfig shareConfig].configInfo.officialAccountUids containsObject:recentSession.session.sessionId]) {
|
||||
if ([[MewClientConfig shareConfig].configInfo.officialMsgUids containsObject:recentSession.session.sessionId] || [[MewClientConfig shareConfig].configInfo.officialAccountUids containsObject:recentSession.session.sessionId]) {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -139,7 +139,7 @@
|
||||
/// 最近会话修改完成
|
||||
- (void)didUpdateRecentSession:(NIMRecentSession *)recentSession totalUnreadCount:(NSInteger)totalUnreadCount {
|
||||
// 判断是否是官方账号
|
||||
if ([[ClientConfig shareConfig].configInfo.officialMsgUids containsObject:recentSession.session.sessionId] || [[ClientConfig shareConfig].configInfo.officialAccountUids containsObject:recentSession.session.sessionId]) {
|
||||
if ([[MewClientConfig shareConfig].configInfo.officialMsgUids containsObject:recentSession.session.sessionId] || [[MewClientConfig shareConfig].configInfo.officialAccountUids containsObject:recentSession.session.sessionId]) {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -205,7 +205,7 @@
|
||||
- (void)mew_cleanMessageButtonAction {
|
||||
NSInteger count = [NIMSDK sharedSDK].conversationManager.allUnreadCount;
|
||||
if (count == 0) {
|
||||
[self showErrorToast:@"暂无未读消息需要清理"];
|
||||
[self mew_showErrorToast:@"暂无未读消息需要清理"];
|
||||
return;
|
||||
}
|
||||
|
||||
|
@@ -9,7 +9,7 @@
|
||||
#import "MewMineCollectionTableViewCell.h"
|
||||
#import "YMEmptyTableViewCell.h"
|
||||
/// Tool
|
||||
#import "YMMacro.h"
|
||||
#import "MewMacro.h"
|
||||
#import "MEWThemeColor.h"
|
||||
/// Third
|
||||
#import <MJRefresh/MJRefresh.h>
|
||||
@@ -99,7 +99,7 @@
|
||||
// 底部加载更多
|
||||
- (void)mew_footerRefresh {
|
||||
if (self.hasNoMoreData) {
|
||||
[self showErrorToast:@"没有更多收藏记录了"];
|
||||
[self mew_showErrorToast:@"没有更多收藏记录了"];
|
||||
return;
|
||||
}
|
||||
|
||||
|
@@ -14,8 +14,8 @@
|
||||
#import <YYText/YYText.h>
|
||||
/// Tool
|
||||
#import "MEWThemeColor.h"
|
||||
#import "YMMacro.h"
|
||||
#import "UIImage+Utils.h"
|
||||
#import "MewMacro.h"
|
||||
#import "UIImage+MewUtils.h"
|
||||
#import "MewHUDTool.h"
|
||||
|
||||
@interface MewRechargeSubView()
|
||||
@@ -296,10 +296,10 @@
|
||||
_rechargeButton.titleLabel.font = kFontMedium(16);
|
||||
_rechargeButton.layer.cornerRadius = 24;
|
||||
_rechargeButton.layer.masksToBounds = YES;
|
||||
UIImage *image = [UIImage gradientColorImageFromColors:@[[MEWThemeColor mewColorWithHexString:@"#FF60FD"],
|
||||
UIImage *image = [UIImage mew_gradientColorImageFromColors:@[[MEWThemeColor mewColorWithHexString:@"#FF60FD"],
|
||||
[MEWThemeColor mewColorWithHexString:@"#8974FF"],
|
||||
[MEWThemeColor mewColorWithHexString:@"#69EBFF"]
|
||||
] gradientType:GradientTypeLeftToRight imgSize:CGSizeMake(KScreenWidth - 2*40, 48)];
|
||||
] gradientType:MewGradientTypeLeftToRight imgSize:CGSizeMake(KScreenWidth - 2*40, 48)];
|
||||
_rechargeButton.backgroundColor = [UIColor colorWithPatternImage:image];
|
||||
[_rechargeButton addTarget:self action:@selector(mew_rechargeButtonAction) forControlEvents:UIControlEventTouchUpInside];
|
||||
}
|
||||
|
@@ -8,10 +8,10 @@
|
||||
#import "MewRechargeViewController.h"
|
||||
/// View
|
||||
#import "MewRechargeSubView.h"
|
||||
#import "YMWebViewController.h"
|
||||
#import "MewWebViewController.h"
|
||||
/// Third
|
||||
#import <Masonry/Masonry.h>
|
||||
#import "YMMacro.h"
|
||||
#import "MewMacro.h"
|
||||
|
||||
#import "AccountInfoStorage.h"
|
||||
#import "MewRechargeListModel.h"
|
||||
@@ -107,8 +107,8 @@
|
||||
};
|
||||
//
|
||||
} else {
|
||||
[MewHUDTool hideHUDInView:kWindow];
|
||||
[self showErrorToast:@"充值失败。当前仅支持运行iOS15及以上系统的手机进行充值,请升级系统版本后重试。"];
|
||||
[MewHUDTool mew_hideHUDInView:kWindow];
|
||||
[self mew_showErrorToast:@"充值失败。当前仅支持运行iOS15及以上系统的手机进行充值,请升级系统版本后重试。"];
|
||||
}
|
||||
|
||||
|
||||
@@ -116,7 +116,7 @@
|
||||
|
||||
}else{
|
||||
|
||||
[MewHUDTool hideHUDInView:kWindow];
|
||||
[MewHUDTool mew_hideHUDInView:kWindow];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -131,11 +131,11 @@
|
||||
if (status == MewStoreConditionResultMewPay || status == MewStoreConditionResultMewStart || status == MewStoreConditionResultMewVerifiedServer) {
|
||||
|
||||
}else if (status == MewStoreConditionResultMewUnowned) {
|
||||
[MewHUDTool hideHUDInView:kWindow];
|
||||
[self showErrorToast:@"出现未知错误,请重新尝试"];
|
||||
[MewHUDTool mew_hideHUDInView:kWindow];
|
||||
[self mew_showErrorToast:@"出现未知错误,请重新尝试"];
|
||||
}else{
|
||||
[MewHUDTool hideHUDInView:kWindow];
|
||||
[self showErrorToast:@"购买失败"];
|
||||
[MewHUDTool mew_hideHUDInView:kWindow];
|
||||
[self mew_showErrorToast:@"购买失败"];
|
||||
}
|
||||
}
|
||||
///充值成功回调id
|
||||
@@ -147,7 +147,7 @@
|
||||
}
|
||||
///二次校验成功
|
||||
- (void)mew_checkReceiptSuccess:(NSString *)transcationId {
|
||||
[MewHUDTool hideHUDInView:kWindow];
|
||||
[MewHUDTool mew_hideHUDInView:kWindow];
|
||||
if (@available(iOS 15.0, *)) {
|
||||
MewPaymentAction *iap = [MewPaymentAction shared];
|
||||
[iap Mew_verifyBusinessAccomplishWithTransaction:[NSString stringWithFormat:@"%@",transcationId] completionHandler:^{
|
||||
@@ -157,10 +157,10 @@
|
||||
[self mew_deleteRechageReciptWithTransactionIdentifier:transcationId];
|
||||
self.orderId = nil;
|
||||
///刷新一下用户的信息
|
||||
[MewHUDTool showLoading];
|
||||
[MewHUDTool mew_showLoading];
|
||||
//5秒之后如果没有收到开通成功的云信消息,则请求一次用户信息
|
||||
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(2.0 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
|
||||
[MewHUDTool hideHUD];
|
||||
[MewHUDTool mew_hideHUD];
|
||||
|
||||
///刷新一下用户的信息
|
||||
[self.presenter mew_getUserWalletInfo];
|
||||
@@ -169,7 +169,7 @@
|
||||
}
|
||||
///二次校验失败
|
||||
- (void)mew_checkReceiptFailWithCode:(NSInteger)code transcationId:(NSString *)transcationId{
|
||||
[MewHUDTool hideHUDInView:kWindow];
|
||||
[MewHUDTool mew_hideHUDInView:kWindow];
|
||||
if(code == 1444){
|
||||
if (@available(iOS 15.0, *)) {
|
||||
MewPaymentAction *iap = [MewPaymentAction shared];
|
||||
@@ -212,14 +212,14 @@
|
||||
}
|
||||
#pragma mark - MewRechargeSubViewDelegate
|
||||
- (void)mew_didSelectMewRechargeChargeProdId:(NSInteger )index {
|
||||
[MewHUDTool showLoadingInView:kWindow];
|
||||
[MewHUDTool mew_showLoadingInView:kWindow];
|
||||
NSString *prodId = self.rechageView.rechargeModels[index].chargeProdId;
|
||||
[self.presenter mew_requestIAPRechargeOrderWithChargeProdId:[NSString stringWithFormat:@"%@",prodId]];
|
||||
}
|
||||
/// 选中用户协议
|
||||
- (void)didSelectMewRechargeProtocol {
|
||||
[self dismissViewControllerAnimated:NO completion:nil];
|
||||
YMWebViewController * webVC = [[YMWebViewController alloc] init];
|
||||
MewWebViewController * webVC = [[MewWebViewController alloc] init];
|
||||
/// mew/modules/rule/rechargeAgreement.html
|
||||
|
||||
NSString *rechageProtocol = [NewEncryptTool MEW_aesDecrypt:@"3fYQzValG55yGNx2mWnN7NvVzsWc9cmKVWuOUkwu8a9ALvqUxXRhaWrnne5rd9oR"];
|
||||
|
20
yinmeng-ios/yinmeng-ios/Main/Mew/Party/Api/Api+MewParty.h
Normal file
20
yinmeng-ios/yinmeng-ios/Main/Mew/Party/Api/Api+MewParty.h
Normal file
@@ -0,0 +1,20 @@
|
||||
//
|
||||
// Api+MewParty.h
|
||||
// yinmeng-ios
|
||||
//
|
||||
// Created by duoban on 2023/12/5.
|
||||
//
|
||||
|
||||
#import "Api.h"
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface Api (MewParty)
|
||||
|
||||
/// 请求推荐房间列表
|
||||
/// @param completion 完成
|
||||
/// @param uid 用户的uid
|
||||
+ (void)mew_partyRecommendRoomListComplection:(MewHttpRequestHelperCompletion)completion uid:(NSString *)uid;
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
19
yinmeng-ios/yinmeng-ios/Main/Mew/Party/Api/Api+MewParty.m
Normal file
19
yinmeng-ios/yinmeng-ios/Main/Mew/Party/Api/Api+MewParty.m
Normal file
@@ -0,0 +1,19 @@
|
||||
//
|
||||
// Api+MewParty.m
|
||||
// yinmeng-ios
|
||||
//
|
||||
// Created by duoban on 2023/12/5.
|
||||
//
|
||||
|
||||
#import "Api+MewParty.h"
|
||||
#import "NewEncryptTool.h"
|
||||
|
||||
@implementation Api (MewParty)
|
||||
/// 请求推荐房间列表
|
||||
/// @param completion 完成
|
||||
/// @param uid 用户的uid
|
||||
+ (void)mew_partyRecommendRoomListComplection:(MewHttpRequestHelperCompletion)completion uid:(NSString *)uid {
|
||||
NSString *getUrl = [NewEncryptTool MEW_aesDecrypt:@"QFTxN/O9DfSc+M1EAx2zzw=="];///home/tab/homeV2
|
||||
[self makeRequest:getUrl method:MewHttpRequestHelperMethodGET completion:completion, __FUNCTION__, uid, nil];
|
||||
}
|
||||
@end
|
@@ -1,21 +0,0 @@
|
||||
//
|
||||
// Api+Home.h
|
||||
// mew-ios
|
||||
//
|
||||
// Created by 触海 on 2023/11/19.
|
||||
//
|
||||
|
||||
#import "Api.h"
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface Api (Party)
|
||||
|
||||
/// 请求推荐房间列表
|
||||
/// @param completion 完成
|
||||
/// @param uid 用户的uid
|
||||
+ (void)mew_partyRecommendRoomListComplection:(HttpRequestHelperCompletion)completion uid:(NSString *)uid;
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
@@ -1,20 +0,0 @@
|
||||
//
|
||||
// Api+Home.m
|
||||
// mew-ios
|
||||
//
|
||||
// Created by 触海 on 2023/11/19.
|
||||
//
|
||||
|
||||
#import "Api+Party.h"
|
||||
#import "NewEncryptTool.h"
|
||||
@implementation Api (Party)
|
||||
|
||||
/// 请求推荐房间列表
|
||||
/// @param completion 完成
|
||||
/// @param uid 用户的uid
|
||||
+ (void)mew_partyRecommendRoomListComplection:(HttpRequestHelperCompletion)completion uid:(NSString *)uid {
|
||||
NSString *getUrl = [NewEncryptTool MEW_aesDecrypt:@"QFTxN/O9DfSc+M1EAx2zzw=="];///home/tab/homeV2
|
||||
[self makeRequest:getUrl method:HttpRequestHelperMethodGET completion:completion, __FUNCTION__, uid, nil];
|
||||
}
|
||||
|
||||
@end
|
@@ -1,17 +0,0 @@
|
||||
//
|
||||
// HomeRecommendRoomModel.m
|
||||
// mew-ios
|
||||
//
|
||||
// Created by 触海 on 2023/11/19.
|
||||
//
|
||||
|
||||
#import "HomeRecommendRoomModel.h"
|
||||
|
||||
|
||||
@implementation HomePartyMicUserModel
|
||||
|
||||
@end
|
||||
|
||||
@implementation HomeRecommendRoomModel
|
||||
|
||||
@end
|
@@ -1,16 +1,15 @@
|
||||
//
|
||||
// HomeRecommendRoomModel.h
|
||||
// mew-ios
|
||||
// MewHomeRecommendRoomModel.h
|
||||
// yinmeng-ios
|
||||
//
|
||||
// Created by 触海 on 2023/11/19.
|
||||
// Created by duoban on 2023/12/5.
|
||||
//
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
#import "YMEnum.h"
|
||||
|
||||
#import "MewEnum.h"
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface HomePartyMicUserModel : NSObject
|
||||
@interface MewHomePartyMicUserModel : NSObject
|
||||
///头像
|
||||
@property (nonatomic, copy) NSString *avatar;
|
||||
///性别
|
||||
@@ -23,7 +22,7 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
@end
|
||||
|
||||
|
||||
@interface HomeRecommendRoomModel : NSObject
|
||||
@interface MewHomeRecommendRoomModel : NSObject
|
||||
///头像
|
||||
@property (nonatomic,copy) NSString *avatar;
|
||||
///在线人数
|
||||
@@ -45,9 +44,10 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
///房主的uid
|
||||
@property (nonatomic,copy) NSString *uid;
|
||||
///麦上用户
|
||||
@property (nonatomic, strong) NSArray<HomePartyMicUserModel *> *micUsers;
|
||||
@property (nonatomic, strong) NSArray<MewHomePartyMicUserModel *> *micUsers;
|
||||
|
||||
@property (nonatomic, copy) NSString *erbanNo;
|
||||
@end
|
||||
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
@@ -0,0 +1,17 @@
|
||||
//
|
||||
// MewMewHomeRecommendRoomModel.m
|
||||
// yinmeng-ios
|
||||
//
|
||||
// Created by duoban on 2023/12/5.
|
||||
//
|
||||
|
||||
#import "MewHomeRecommendRoomModel.h"
|
||||
|
||||
|
||||
@implementation MewHomePartyMicUserModel
|
||||
|
||||
@end
|
||||
|
||||
@implementation MewHomeRecommendRoomModel
|
||||
|
||||
@end
|
@@ -7,8 +7,8 @@
|
||||
|
||||
#import "MewPartyPresenter.h"
|
||||
#import "AccountInfoStorage.h"
|
||||
#import "HomeRecommendRoomModel.h"
|
||||
#import "Api+Party.h"
|
||||
#import "MewHomeRecommendRoomModel.h"
|
||||
#import "Api+MewParty.h"
|
||||
#import "MewPartyProtocol.h"
|
||||
#import "NSArray+MewSafe.h"
|
||||
#import "NSObject+MEWExtension.h"
|
||||
@@ -18,7 +18,7 @@
|
||||
- (void)mew_partyRecommendRoomList {
|
||||
NSString *uid = [AccountInfoStorage instance].getUid;
|
||||
[Api mew_partyRecommendRoomListComplection:[self createHttpCompletion:^(BaseModel * _Nonnull data) {
|
||||
NSArray * array = [HomeRecommendRoomModel mewModelsWithArray:data.data];
|
||||
NSArray * array = [MewHomeRecommendRoomModel mewModelsWithArray:data.data];
|
||||
[[self getView] mew_partyRecommendRoomListSuccess:array];
|
||||
}fail:^(NSInteger code, NSString * _Nullable msg) {
|
||||
// [[self getView] getmew_partyRecommendRoomListFail:msg state:state];
|
||||
|
@@ -9,7 +9,7 @@
|
||||
///View
|
||||
#import "NetImageView.h"
|
||||
/// Tool
|
||||
#import "YMMacro.h"
|
||||
#import "MewMacro.h"
|
||||
#import "MEWThemeColor.h"
|
||||
/// Third
|
||||
#import <Masonry/Masonry.h>
|
||||
|
@@ -13,10 +13,10 @@
|
||||
/// Third
|
||||
#import <Masonry/Masonry.h>
|
||||
/// Tool
|
||||
#import "YMMacro.h"
|
||||
#import "MewMacro.h"
|
||||
/// Model
|
||||
#import "MewPartyModel.h"
|
||||
#import "HomeRecommendRoomModel.h"
|
||||
#import "MewHomeRecommendRoomModel.h"
|
||||
/// Presenter
|
||||
#import "MewPartyPresenter.h"
|
||||
#import "MewHomeProtocol.h"
|
||||
@@ -40,7 +40,7 @@
|
||||
@property (nonatomic, assign) CGSize itemSizes;
|
||||
@property (nonatomic, assign) CGFloat itemMargin;
|
||||
|
||||
@property (nonatomic, strong) NSArray<HomeRecommendRoomModel *> *homeRecommendModels;
|
||||
@property (nonatomic, strong) NSArray<MewHomeRecommendRoomModel *> *homeRecommendModels;
|
||||
|
||||
@end
|
||||
|
||||
|
@@ -8,7 +8,7 @@
|
||||
|
||||
///View
|
||||
#import "MewRoomViewController.h"
|
||||
#import "BaseNavigationController.h"
|
||||
#import "MewBaseNavigationController.h"
|
||||
#import "MewRoomHeaderView.h"
|
||||
#import "MewRoomRightView.h"
|
||||
#import "MewSocialStageView.h"
|
||||
@@ -27,7 +27,7 @@
|
||||
///Tool
|
||||
#import "AccountInfoStorage.h"
|
||||
#import "MEWHUDTool.h"
|
||||
#import "YMMacro.h"
|
||||
#import "MewMacro.h"
|
||||
#import "NSArray+MEWSafe.h"
|
||||
#import "MewRtcManager.h"
|
||||
///P
|
||||
@@ -192,7 +192,7 @@
|
||||
NSDictionary * spamRes = message.yidunAntiSpamRes.mewToJSONObject;
|
||||
NSDictionary * spamResExt = ((NSString *)spamRes[@"ext"]).mewToJSONObject;
|
||||
if ([spamResExt[@"antispam"][@"suggestion"] intValue] == 2) {
|
||||
[self showErrorToast:@"消息中可能含有违规信息,请停止发送类似信息!"];
|
||||
[self mew_showErrorToast:@"消息中可能含有违规信息,请停止发送类似信息!"];
|
||||
return;
|
||||
}
|
||||
}
|
||||
@@ -219,7 +219,7 @@
|
||||
+ (BOOL)openRoom:(NSString *)roomUid viewController:(UIViewController *)viewController {
|
||||
MewRoomViewController *roomVC = [[self alloc] init];
|
||||
roomVC.roomUid = roomUid;
|
||||
BaseNavigationController *baseNav = [[BaseNavigationController alloc] initWithRootViewController:roomVC];
|
||||
MewBaseNavigationController *baseNav = [[MewBaseNavigationController alloc] initWithRootViewController:roomVC];
|
||||
baseNav.modalPresentationStyle = UIModalPresentationFullScreen;
|
||||
[viewController presentViewController:baseNav animated:YES completion:nil];
|
||||
return YES;
|
||||
@@ -246,7 +246,7 @@
|
||||
|
||||
}
|
||||
|
||||
- (UINavigationController *)mew_getCurrentNavigationController {
|
||||
- (UINavigationController *)mew_getmew_currentNavigationController {
|
||||
return self.navigationController;
|
||||
}
|
||||
|
||||
@@ -266,7 +266,7 @@
|
||||
#pragma mark - MewRoomProtocol
|
||||
/// 进入房间成功
|
||||
- (void)mew_initEnterCurrentRoomSuccess:(MewRoomInfoModel *)roomInfo user:(UserInfoModel *)userInfo {
|
||||
[MewHUDTool hideHUDInView:self.navigationController.view];
|
||||
[MewHUDTool mew_hideHUDInView:self.navigationController.view];
|
||||
self.userInfo = userInfo;
|
||||
self.roomInfo = roomInfo;
|
||||
if (roomInfo.valid) {
|
||||
@@ -285,7 +285,7 @@
|
||||
[self.presenter mew_openUserRoom:title type:type roomPwd:@"" roomDesc:@"" backPic:@"" mgId:@""];
|
||||
}
|
||||
} else {
|
||||
[self showSuccessToast:@"房主已下线"];
|
||||
[self mew_showSuccessToast:@"房主已下线"];
|
||||
[self enterCurrentRoomFail:-1];
|
||||
}
|
||||
}
|
||||
@@ -301,7 +301,7 @@
|
||||
|
||||
// IM进房成功
|
||||
- (void)enterCurrentRoomSuccess:(NIMChatroom *)chatRoom {
|
||||
[MewHUDTool hideHUDInView:self.navigationController.view];
|
||||
[MewHUDTool mew_hideHUDInView:self.navigationController.view];
|
||||
[self.roomStageView mew_onRoomEntered];
|
||||
if (self.roomInfo != nil) {
|
||||
[self.presenter mew_reportUserInterRoom:[NSString stringWithFormat:@"%zd", self.roomInfo.uid]];
|
||||
@@ -313,10 +313,10 @@
|
||||
|
||||
// 进房失败
|
||||
- (void)enterCurrentRoomFail:(NSInteger)code {
|
||||
[MewHUDTool hideHUDInView:self.navigationController.view];
|
||||
[self hideHUD];
|
||||
[MewHUDTool mew_hideHUDInView:self.navigationController.view];
|
||||
[self mew_hideHUD];
|
||||
if (code == 13003) {
|
||||
[self showErrorToast:@"您已被管理员拉黑"];
|
||||
[self mew_showErrorToast:@"您已被管理员拉黑"];
|
||||
}
|
||||
|
||||
[self dismissViewControllerAnimated:YES completion:nil];
|
||||
@@ -324,7 +324,7 @@
|
||||
|
||||
/// 送礼物成功
|
||||
- (void)mew_sendRoomGiftSuccess:(MewGiftReceiveInfoModel *)receiveInfo originDic:(NSDictionary *)originDic uidCount:(NSInteger)uidCount {
|
||||
[MewHUDTool hideHUD];
|
||||
[MewHUDTool mew_hideHUD];
|
||||
|
||||
[self sendCustomMessage:receiveInfo oringinDic:originDic];
|
||||
|
||||
@@ -332,12 +332,12 @@
|
||||
|
||||
/// 送礼物失败
|
||||
- (void)mew_sendRoomGiftFailWithCode:(NSInteger)code msg:(NSString *)msg {
|
||||
[MewHUDTool hideHUD];
|
||||
[MewHUDTool mew_hideHUD];
|
||||
|
||||
if (code == 31005) {// 余额不足
|
||||
[self showErrorToast:msg];
|
||||
[self mew_showErrorToast:msg];
|
||||
} else {
|
||||
[self showErrorToast:msg];
|
||||
[self mew_showErrorToast:msg];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -448,15 +448,15 @@
|
||||
MewSocialStageView *mewStageView = (MewSocialStageView *)self.roomStageView;
|
||||
NSString *selectId = mewStageView.selectUid;
|
||||
if (selectId == [AccountInfoStorage instance].getUid) {
|
||||
[self showErrorToast:@"不能赠送礼物给自己"];
|
||||
[self mew_showErrorToast:@"不能赠送礼物给自己"];
|
||||
return;
|
||||
}
|
||||
if (mewStageView.selectUid.length == 0 || [mewStageView.selectUid isEqualToString:@""]) {
|
||||
[self showErrorToast:@"请点击麦位头像,选择送礼的人"];
|
||||
[self mew_showErrorToast:@"请点击麦位头像,选择送礼的人"];
|
||||
return;
|
||||
}
|
||||
|
||||
[MewHUDTool showLoadingWithMessage:@"赠送中..."];
|
||||
[MewHUDTool mew_showLoadingWithMessage:@"赠送中..."];
|
||||
[self.presenter mew_sendRoomGift:mewStageView.selectUid roomUid:self.roomUid];
|
||||
}
|
||||
|
||||
@@ -466,35 +466,35 @@
|
||||
UIAlertController *alert = [UIAlertController alertControllerWithTitle:@"举报内容" message:@""
|
||||
preferredStyle:UIAlertControllerStyleActionSheet];
|
||||
[alert addAction:[UIAlertAction actionWithTitle:@"色情低俗,以任何形式传播淫秽、色情、低俗擦边的内" style:UIAlertActionStyleDefault handler:^(UIAlertAction *action){
|
||||
[self showSuccessToast:@"举报成功"];
|
||||
[self mew_showSuccessToast:@"举报成功"];
|
||||
}]];
|
||||
[alert addAction:[UIAlertAction actionWithTitle:@"政治敏感,进行反党反政府或带有侮辱诋毁党和国家的内容" style:UIAlertActionStyleDefault handler:^(UIAlertAction *action){
|
||||
[self showSuccessToast:@"举报成功"];
|
||||
[self mew_showSuccessToast:@"举报成功"];
|
||||
}]];
|
||||
[alert addAction:[UIAlertAction actionWithTitle:@"垃圾广告,传播垃圾广告或违法违规广告信息" style:UIAlertActionStyleDefault handler:^(UIAlertAction *action){
|
||||
[self showSuccessToast:@"举报成功"];
|
||||
[self mew_showSuccessToast:@"举报成功"];
|
||||
}]];
|
||||
[alert addAction:[UIAlertAction actionWithTitle:@"言语攻击,恶意抹黑、诋毁或辱骂他人" style:UIAlertActionStyleDefault handler:^(UIAlertAction *action){
|
||||
[self showSuccessToast:@"举报成功"];
|
||||
[self mew_showSuccessToast:@"举报成功"];
|
||||
}]];
|
||||
[alert addAction:[UIAlertAction actionWithTitle:@"违规交易,发布线下交易或可能涉及诈骗的内容" style:UIAlertActionStyleDefault handler:^(UIAlertAction *action){
|
||||
[self showSuccessToast:@"举报成功"];
|
||||
[self mew_showSuccessToast:@"举报成功"];
|
||||
}]];
|
||||
[alert addAction:[UIAlertAction actionWithTitle:@"泄露隐私,以任何形式泄露他人隐私" style:UIAlertActionStyleDefault handler:^(UIAlertAction *action){
|
||||
[self showSuccessToast:@"举报成功"];
|
||||
[self mew_showSuccessToast:@"举报成功"];
|
||||
}]];
|
||||
[alert addAction:[UIAlertAction actionWithTitle:@"暴力恐怖,传播暴力、血腥、威胁生命健康的内容或展示枪支、刀具" style:UIAlertActionStyleDefault handler:^(UIAlertAction *action){
|
||||
[self showSuccessToast:@"举报成功"];
|
||||
[self mew_showSuccessToast:@"举报成功"];
|
||||
}]];
|
||||
[alert addAction:[UIAlertAction actionWithTitle:@"侵权盗版,侵犯他人合法版权" style:UIAlertActionStyleDefault handler:^(UIAlertAction *action){
|
||||
[self showSuccessToast:@"举报成功"];
|
||||
[self mew_showSuccessToast:@"举报成功"];
|
||||
}]];
|
||||
|
||||
[alert addAction:[UIAlertAction actionWithTitle:@"其它" style:UIAlertActionStyleDefault handler:^(UIAlertAction *action){
|
||||
[self showSuccessToast:@"举报成功"];
|
||||
[self mew_showSuccessToast:@"举报成功"];
|
||||
}]];
|
||||
[alert addAction:[UIAlertAction actionWithTitle:@"取消" style:UIAlertActionStyleCancel handler:^(UIAlertAction *action){
|
||||
// [self showSuccessToast:@"举报成功"];
|
||||
// [self mew_showSuccessToast:@"举报成功"];
|
||||
}]];
|
||||
[self presentViewController:alert animated:YES completion:nil];
|
||||
|
||||
|
@@ -6,7 +6,7 @@
|
||||
//
|
||||
|
||||
#import "MewRoomHeaderView.h"
|
||||
#import "YMMacro.h"
|
||||
#import "MewMacro.h"
|
||||
#import <Masonry/Masonry.h>
|
||||
#import "MEWThemeColor.h"
|
||||
#import "AccountInfoStorage.h"
|
||||
|
@@ -10,10 +10,10 @@
|
||||
#import "NetImageView.h"
|
||||
|
||||
#import "MewRoomMessageConstant.h"
|
||||
#import "YMMacro.h"
|
||||
#import "MewMacro.h"
|
||||
#import "MEWThemeColor.h"
|
||||
#import "MEWThemeColor.h"
|
||||
#import "UIImage+Utils.h"
|
||||
#import "UIImage+MewUtils.h"
|
||||
#import <Masonry/Masonry.h>
|
||||
#import <YYText/YYText.h>
|
||||
#import "MewMessageInfoModel.h"
|
||||
@@ -41,7 +41,7 @@
|
||||
_messageInfo = messageInfo;
|
||||
if (_messageInfo) {
|
||||
self.contentLabel.attributedText = _messageInfo.content;
|
||||
self.bubbleImageView.image = [UIImage imageWithColor:UIColorMewRGBAlpha(0xFFFFFF, 0.15)];
|
||||
self.bubbleImageView.image = [UIImage mew_imageWithColor:UIColorMewRGBAlpha(0xFFFFFF, 0.15)];
|
||||
}
|
||||
// self.nickerNameLabel.attributedText = _messageInfo.content;
|
||||
|
||||
|
@@ -7,7 +7,7 @@
|
||||
|
||||
#import "MewSocialStageView.h"
|
||||
#import "MewSocialMicroView.h"
|
||||
#import "YMMacro.h"
|
||||
#import "MewMacro.h"
|
||||
#import "MicroQueueModel.h"
|
||||
#import "UserInfoModel.h"
|
||||
#import "MEWThemeColor.h"
|
||||
|
@@ -1,20 +1,17 @@
|
||||
//
|
||||
// YMWebViewController.h
|
||||
// mew-ios
|
||||
// MewWebViewController.h
|
||||
// yinmeng-ios
|
||||
//
|
||||
// Created by 触海 on 2023/11/9.
|
||||
// Created by duoban on 2023/12/5.
|
||||
//
|
||||
|
||||
#import "BaseViewController.h"
|
||||
#import "MewBaseViewController.h"
|
||||
#import <WebKit/WebKit.h>
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface YMWebViewController : BaseViewController
|
||||
|
||||
@interface MewWebViewController : MewBaseViewController
|
||||
@property (strong, nonatomic,readonly) WKWebView *webview;
|
||||
@property (copy, nonatomic) NSString *url;
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
@@ -1,31 +1,31 @@
|
||||
//
|
||||
// YMWebViewController.m
|
||||
// mew-ios
|
||||
// MewWebViewController.m
|
||||
// yinmeng-ios
|
||||
//
|
||||
// Created by 触海 on 2023/11/9.
|
||||
// Created by duoban on 2023/12/5.
|
||||
//
|
||||
|
||||
#import "YMWebViewController.h"
|
||||
#import "MewWebViewController.h"
|
||||
#import "MewLoginViewController.h"
|
||||
#import "BaseNavigationController.h"
|
||||
#import "MewBaseNavigationController.h"
|
||||
/// Tool
|
||||
#import "ApiHost.h"
|
||||
#import "MewApiHost.h"
|
||||
#import "Api+Mine.h"
|
||||
#import "YYUtility.h"
|
||||
#import "AccountInfoStorage.h"
|
||||
#import "MEWThemeColor.h"
|
||||
#import "YMMacro.h"
|
||||
#import "MewMacro.h"
|
||||
#import "NewEncryptTool.h"
|
||||
#import "HttpRequestHelper.h"
|
||||
#import "MewHttpRequestHelper.h"
|
||||
#import "AccountModel.h"
|
||||
#import "MewHUDTool.h"
|
||||
#import "ClientConfig.h"
|
||||
#import "MewClientConfig.h"
|
||||
/// Third
|
||||
#import <Masonry/Masonry.h>
|
||||
#import <MJExtension/MJExtension.h>
|
||||
|
||||
|
||||
@interface WeakWebViewScriptMessageDelegate : NSObject<WKScriptMessageHandler>
|
||||
@interface MewWeakWebViewScriptMessageDelegate : NSObject<WKScriptMessageHandler>
|
||||
|
||||
//WKScriptMessageHandler 这个协议类专门用来处理JavaScript调用原生OC的方法
|
||||
@property (nonatomic, weak) id<WKScriptMessageHandler> scriptDelegate;
|
||||
@@ -33,7 +33,7 @@
|
||||
- (instancetype)initWithDelegate:(id<WKScriptMessageHandler>)scriptDelegate;
|
||||
|
||||
@end
|
||||
@implementation WeakWebViewScriptMessageDelegate
|
||||
@implementation MewWeakWebViewScriptMessageDelegate
|
||||
|
||||
- (instancetype)initWithDelegate:(id<WKScriptMessageHandler>)scriptDelegate {
|
||||
self = [super init];
|
||||
@@ -63,7 +63,7 @@ NSString * const kJSGetDeviceInfo = @"getDeviceInfo";
|
||||
NSString * const kInitShowNav = @"initShowNav";
|
||||
NSString * const kCloseWebView = @"closeWebView";
|
||||
NSString * const kCancelAccount = @"cancelAccount";
|
||||
@interface YMWebViewController ()<WKNavigationDelegate, WKScriptMessageHandler>
|
||||
@interface MewWebViewController ()<WKNavigationDelegate, WKScriptMessageHandler>
|
||||
@property (strong, nonatomic) WKWebView *webview;
|
||||
@property (nonatomic, strong) WKUserContentController *mew_userContentController;
|
||||
///是否隐藏导航栏
|
||||
@@ -72,7 +72,8 @@ NSString * const kCancelAccount = @"cancelAccount";
|
||||
@end
|
||||
|
||||
|
||||
@implementation YMWebViewController
|
||||
|
||||
@implementation MewWebViewController
|
||||
|
||||
- (void)viewDidLoad {
|
||||
[super viewDidLoad];
|
||||
@@ -132,7 +133,7 @@ NSString * const kCancelAccount = @"cancelAccount";
|
||||
NSLog(@"%@",error);
|
||||
}];
|
||||
} else if ([message.name isEqualToString:kJSGetDeviceInfo]) {
|
||||
NSDictionary *basicParmars = [HttpRequestHelper configBaseParmars:[[NSDictionary alloc] init]];
|
||||
NSDictionary *basicParmars = [MewHttpRequestHelper configBaseParmars:[[NSDictionary alloc] init]];
|
||||
NSString *json = [basicParmars mj_JSONString];
|
||||
NSString *js = [NSString stringWithFormat:@"getMessage(\"deviceInfo\",%@)", json];
|
||||
[self.webview evaluateJavaScript:js completionHandler:^(id _Nullable ohter, NSError * _Nullable error) {
|
||||
@@ -150,7 +151,7 @@ NSString * const kCancelAccount = @"cancelAccount";
|
||||
[self.navigationController popViewControllerAnimated:YES];
|
||||
}
|
||||
} else if ([message.name isEqualToString:kCancelAccount]) {
|
||||
[MewHUDTool showLoadingWithMessage:@"正在注销中,请稍等"];
|
||||
[MewHUDTool mew_showLoadingWithMessage:@"正在注销中,请稍等"];
|
||||
AccountModel *model = [[AccountInfoStorage instance] accountModel];
|
||||
[Api Mew_LogoutCurrentAccount:^(BaseModel * _Nonnull data, NSInteger code, NSString * _Nonnull msg) {
|
||||
[MewHUDTool showSuccessWithMessage:@"注销成功"];
|
||||
@@ -159,9 +160,9 @@ NSString * const kCancelAccount = @"cancelAccount";
|
||||
[[AccountInfoStorage instance] saveAccountInfo:nil];
|
||||
[[AccountInfoStorage instance] saveTicket:nil];
|
||||
///关闭心跳
|
||||
[[ClientConfig shareConfig] resetHeartBratTimer];
|
||||
[[MewClientConfig shareConfig] mew_resetHeartBratTimer];
|
||||
MewLoginViewController *loginVC = [[MewLoginViewController alloc] init];
|
||||
BaseNavigationController * nav = [[BaseNavigationController alloc] initWithRootViewController:loginVC];
|
||||
MewBaseNavigationController * nav = [[MewBaseNavigationController alloc] initWithRootViewController:loginVC];
|
||||
nav.modalPresentationStyle = UIModalPresentationFullScreen;
|
||||
[self.navigationController presentViewController:nav animated:YES completion:nil];
|
||||
});
|
||||
@@ -267,7 +268,7 @@ NSString * const kCancelAccount = @"cancelAccount";
|
||||
- (WKUserContentController *)mew_userContentController{
|
||||
if (!_mew_userContentController) {
|
||||
//自定义的WKScriptMessageHandler 是为了解决内存不释放的问题
|
||||
WeakWebViewScriptMessageDelegate *weakScriptMessageDelegate = [[WeakWebViewScriptMessageDelegate alloc] initWithDelegate:self];
|
||||
MewWeakWebViewScriptMessageDelegate *weakScriptMessageDelegate = [[MewWeakWebViewScriptMessageDelegate alloc] initWithDelegate:self];
|
||||
_mew_userContentController = [[WKUserContentController alloc] init];
|
||||
// 获取uid
|
||||
[_mew_userContentController addScriptMessageHandler:weakScriptMessageDelegate name:kJSGetUid];
|
@@ -12,15 +12,15 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface MainPresenter : BaseMvpPresenter<NIMLoginManagerDelegate>
|
||||
/// 获取Ticket
|
||||
- (void)autoLogin;
|
||||
- (void)mew_autoLogin;
|
||||
/// IM登录
|
||||
- (void)loginNIM;
|
||||
- (void)mew_loginNIM;
|
||||
/// 获取用户信息
|
||||
- (void)getUserInfo;
|
||||
- (void)mew_getUserInfo;
|
||||
/// 检查是否有未消费的内购订单
|
||||
- (void)checkTranscation;
|
||||
- (void)mew_checkTranscation;
|
||||
///获取版本更新
|
||||
- (void)getVersionUpdate;
|
||||
- (void)mew_getVersionUpdate;
|
||||
|
||||
@end
|
||||
|
||||
|
@@ -8,7 +8,7 @@
|
||||
#import "MainPresenter.h"
|
||||
#import "AccountInfoStorage.h"
|
||||
#import "AccountModel.h"
|
||||
#import "Api+Main.h"
|
||||
#import "Api+MewMain.h"
|
||||
#import "MainProtocol.h"
|
||||
#import <NIMSDK/NIMSDK.h>
|
||||
#import "MEWRechargeStorage.h"
|
||||
@@ -17,10 +17,10 @@
|
||||
|
||||
#pragma mark - Public Method
|
||||
/// 获取Ticket
|
||||
- (void)autoLogin {
|
||||
- (void)mew_autoLogin {
|
||||
AccountModel *accountModel = [[AccountInfoStorage instance] getCurrentAccountInfo];
|
||||
if (accountModel == nil || accountModel.uid == nil || accountModel.access_token == nil) {
|
||||
[[self getView] tokenInvalid];
|
||||
[[self getView] mew_getTokenId];
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -29,21 +29,21 @@
|
||||
}
|
||||
|
||||
// 获取ticket
|
||||
[Api requestTicket:[self createHttpCompletion:^(BaseModel * _Nonnull data) {
|
||||
[Api mew_requestTicket:[self createHttpCompletion:^(BaseModel * _Nonnull data) {
|
||||
NSArray *tickets = [data.data valueForKey:@"tickets"];
|
||||
NSString *ticket = [tickets[0] valueForKey:@"ticket"];
|
||||
[[AccountInfoStorage instance] saveTicket:ticket];
|
||||
[[self getView] autoLoginSuccess];
|
||||
[[self getView] mew_autoLoginSuccess];
|
||||
} fail:^(NSInteger code, NSString * _Nullable msg) {
|
||||
[self logout];
|
||||
}] access_token:accountModel.access_token issue_type:@"multi"];
|
||||
}
|
||||
|
||||
/// IM登录
|
||||
- (void)loginNIM {
|
||||
- (void)mew_loginNIM {
|
||||
AccountModel *accountModel = [[AccountInfoStorage instance] getCurrentAccountInfo];
|
||||
if (accountModel == nil) {
|
||||
[[self getView] tokenInvalid];
|
||||
[[self getView] mew_getTokenId];
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -63,7 +63,7 @@
|
||||
|
||||
|
||||
/// 获取用户信息
|
||||
- (void)getUserInfo {
|
||||
- (void)mew_getUserInfo {
|
||||
[Api getUserInfo:[self createHttpCompletion:^(BaseModel * _Nonnull data) {
|
||||
[[self getView] mew_getUserInfoSuccess:[UserInfoModel mewModelWithDictionary:data.data]];
|
||||
} fail:^(NSInteger code, NSString * _Nullable msg) {
|
||||
@@ -87,7 +87,7 @@
|
||||
}
|
||||
|
||||
/// 获取版本信息
|
||||
- (void)getVersionUpdate {
|
||||
- (void)mew_getVersionUpdate {
|
||||
|
||||
}
|
||||
|
||||
|
@@ -14,11 +14,11 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
@protocol MainProtocol <NSObject>
|
||||
|
||||
/// 登录成功
|
||||
- (void)autoLoginSuccess;
|
||||
- (void)mew_autoLoginSuccess;
|
||||
/// 获取用户信息成功
|
||||
- (void)mew_getUserInfoSuccess:(UserInfoModel *)userInfo;
|
||||
///获取更新版本信息成功
|
||||
//- (void)getVersionUpdate:(XPVersionUpdateModel *)versionModel;
|
||||
//- (void)mew_getVersionUpdate:(XPVersionUpdateModel *)versionModel;
|
||||
|
||||
@end
|
||||
|
||||
|
@@ -0,0 +1,16 @@
|
||||
//
|
||||
// MewTabBarController.h
|
||||
// yinmeng-ios
|
||||
//
|
||||
// Created by duoban on 2023/12/5.
|
||||
//
|
||||
|
||||
#import <UIKit/UIKit.h>
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface MewTabBarController : UITabBarController
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
@@ -1,17 +1,16 @@
|
||||
//
|
||||
// TabbarViewController.m
|
||||
// mew-ios
|
||||
// MewTabBarController.m
|
||||
// yinmeng-ios
|
||||
//
|
||||
// Created by 触海 on 2023/11/6.
|
||||
// Created by duoban on 2023/12/5.
|
||||
//
|
||||
|
||||
|
||||
///Tool
|
||||
#import "MewTabBarController.h"
|
||||
#import "MewHUDTool.h"
|
||||
#import "ClientConfig.h"
|
||||
#import "MewClientConfig.h"
|
||||
#import "MEWThemeColor.h"
|
||||
#import "UIImage+Utils.h"
|
||||
#import "YMMacro.h"
|
||||
#import "UIImage+MewUtils.h"
|
||||
#import "MewMacro.h"
|
||||
#import "AccountInfoStorage.h"
|
||||
#import "NSMutableDictionary+MEWSafe.h"
|
||||
/// Third
|
||||
@@ -19,11 +18,10 @@
|
||||
#import <QYSDK_NIM/QYSDK.h>
|
||||
#import <AFNetworkReachabilityManager.h>
|
||||
///VC
|
||||
#import "TabbarViewController.h"
|
||||
#import "BaseNavigationController.h"
|
||||
#import "BaseViewController.h"
|
||||
#import "MewBaseNavigationController.h"
|
||||
#import "MewBaseViewController.h"
|
||||
#import "MewLoginViewController.h"
|
||||
#import "MewLoginFullInfoViewController.h"
|
||||
#import "LoginFullInfoViewController.h"
|
||||
#import "MewPartyViewController.h"
|
||||
#import "MewSessionListViewController.h"
|
||||
#import "MewHomeViewController.h"
|
||||
@@ -36,7 +34,7 @@
|
||||
|
||||
NSString * const kNetworkReachabilityKey = @"kNetworkReachabilityKey";
|
||||
|
||||
@interface TabbarViewController () <
|
||||
@interface MewTabBarController() <
|
||||
BaseMvpProtocol, MainProtocol,
|
||||
NIMLoginManagerDelegate, NIMSystemNotificationManagerDelegate,
|
||||
NIMChatManagerDelegate,NIMBroadcastManagerDelegate>
|
||||
@@ -47,16 +45,15 @@ NSString * const kNetworkReachabilityKey = @"kNetworkReachabilityKey";
|
||||
|
||||
@end
|
||||
|
||||
@implementation TabbarViewController
|
||||
|
||||
|
||||
@implementation MewTabBarController
|
||||
|
||||
#pragma mark - Life Cycle
|
||||
- (void)viewDidLoad {
|
||||
[super viewDidLoad];
|
||||
[self initTabs:NO];
|
||||
[self configTheme];
|
||||
[[ClientConfig shareConfig] clientInit];
|
||||
[self mew_initTabs:NO];
|
||||
[self mew_configTheme];
|
||||
[[MewClientConfig shareConfig] mew_clientInit];
|
||||
[[NIMSDK sharedSDK].loginManager addDelegate:self];
|
||||
[[NIMSDK sharedSDK].chatManager addDelegate:self];
|
||||
[[NIMSDK sharedSDK].systemNotificationManager addDelegate:self];
|
||||
@@ -66,12 +63,12 @@ NSString * const kNetworkReachabilityKey = @"kNetworkReachabilityKey";
|
||||
|
||||
- (void)viewWillAppear:(BOOL)animated {
|
||||
[super viewWillAppear:animated];
|
||||
[self.presenter autoLogin];
|
||||
[self.presenter mew_autoLogin];
|
||||
}
|
||||
|
||||
|
||||
#pragma mark - Init Tabs
|
||||
- (void)initTabs:(BOOL)isLogin {
|
||||
- (void)mew_initTabs:(BOOL)isLogin {
|
||||
if (!isLogin) { return; }
|
||||
|
||||
NSArray *normalImageNames = @[@"mew_tabbar_home_normal",@"mew_tabbar_party_normal", @"mew_tabbar_message_normal"];
|
||||
@@ -81,25 +78,25 @@ NSString * const kNetworkReachabilityKey = @"kNetworkReachabilityKey";
|
||||
MewPartyViewController * party = [[MewPartyViewController alloc]init];
|
||||
MewSessionListViewController * me = [[MewSessionListViewController alloc]init];
|
||||
|
||||
[self createTabBarItem:home title:@"" image:normalImageNames[0] selectedImage:selectImageNames[0]];
|
||||
[self createTabBarItem:party title:@"" image:normalImageNames[1] selectedImage:selectImageNames[1]];
|
||||
[self createTabBarItem:me title:@"" image:normalImageNames[2] selectedImage:selectImageNames[2]];
|
||||
[self mew_createTabBarItem:home title:@"" image:normalImageNames[0] selectedImage:selectImageNames[0]];
|
||||
[self mew_createTabBarItem:party title:@"" image:normalImageNames[1] selectedImage:selectImageNames[1]];
|
||||
[self mew_createTabBarItem:me title:@"" image:normalImageNames[2] selectedImage:selectImageNames[2]];
|
||||
self.viewControllers = @[home,party,me];
|
||||
self.selectedIndex = 0;
|
||||
|
||||
}
|
||||
|
||||
- (BaseNavigationController *)createTabBarItem:(UIViewController *)itemVc title:(NSString *)title image:(NSString *)image selectedImage:(NSString *)selectedImage{
|
||||
- (MewBaseNavigationController *)mew_createTabBarItem:(UIViewController *)itemVc title:(NSString *)title image:(NSString *)image selectedImage:(NSString *)selectedImage{
|
||||
itemVc.title = title;
|
||||
itemVc.tabBarItem.image = [[UIImage imageNamed:image] imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal];
|
||||
itemVc.tabBarItem.selectedImage = [[UIImage imageNamed:selectedImage] imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal];
|
||||
[itemVc.tabBarItem setTitleTextAttributes:@{NSForegroundColorAttributeName:[MEWThemeColor mewMainTextColor]} forState:UIControlStateSelected];
|
||||
[itemVc.tabBarItem setTitleTextAttributes:@{NSForegroundColorAttributeName:UIColor.blackColor} forState:UIControlStateNormal];
|
||||
BaseNavigationController *nav = [[BaseNavigationController alloc] initWithRootViewController:itemVc];
|
||||
MewBaseNavigationController *nav = [[MewBaseNavigationController alloc] initWithRootViewController:itemVc];
|
||||
return nav;
|
||||
}
|
||||
|
||||
- (void)configTheme {
|
||||
- (void)mew_configTheme {
|
||||
if (@available(iOS 13.0, *)) {
|
||||
UITabBarAppearance *appearance = [[UITabBarAppearance alloc] init];
|
||||
appearance.backgroundColor = [MEWThemeColor mewColorWithHexString:@"#1D2126"];
|
||||
@@ -110,7 +107,7 @@ NSString * const kNetworkReachabilityKey = @"kNetworkReachabilityKey";
|
||||
|
||||
}
|
||||
// self.view.backgroundColor = UIColor.whiteColor;
|
||||
// UIImage *color_image = [UIImage imageWithColor:UIColor.whiteColor size:CGSizeMake(KScreenWidth, kTabBarHeight)];
|
||||
// UIImage *color_image = [UIImage mew_imageWithColor:UIColor.whiteColor size:CGSizeMake(KScreenWidth, kTabBarHeight)];
|
||||
// [[UITabBar appearance] setBackgroundImage:color_image];
|
||||
// [[UITabBar appearance] setShadowImage:[[UIImage alloc] init]];
|
||||
// if (@available(iOS 10.0, *)) {
|
||||
@@ -135,15 +132,15 @@ NSString * const kNetworkReachabilityKey = @"kNetworkReachabilityKey";
|
||||
2.获取用户信息
|
||||
3. 其实目前多余回调V层,可以在P层里自行做这个逻辑。
|
||||
*/
|
||||
- (void)autoLoginSuccess {
|
||||
[self.presenter loginNIM];
|
||||
[self.presenter getUserInfo];
|
||||
- (void)mew_autoLoginSuccess {
|
||||
[self.presenter mew_loginNIM];
|
||||
[self.presenter mew_getUserInfo];
|
||||
//登录成功之后 再验证是否有漏单的行为
|
||||
[self.presenter checkTranscation];
|
||||
[self.presenter mew_checkTranscation];
|
||||
/// 检查更新
|
||||
[self.presenter getVersionUpdate];
|
||||
[self.presenter mew_getVersionUpdate];
|
||||
///开启心跳 记录用户登录状态
|
||||
[[ClientConfig shareConfig] addHeartBratTimer];
|
||||
[[MewClientConfig shareConfig] mew_addHeartBratTimer];
|
||||
|
||||
}
|
||||
/// 获取用户信息后检查:1、是否绑定手机号;2、是否需要完善用户信息
|
||||
@@ -151,54 +148,54 @@ NSString * const kNetworkReachabilityKey = @"kNetworkReachabilityKey";
|
||||
/// 当前服务端接口是有未完善信息的全局拦截的,在BaseMvpPresent里会触发1415去完善用户信息
|
||||
- (void)mew_getUserInfoSuccess:(UserInfoModel *)userInfo {
|
||||
// 没有绑定手机号码
|
||||
if (!userInfo.isBindPhone && [ClientConfig shareConfig].iosPhoneBind) {
|
||||
[self pushBindPhoneController];
|
||||
if (!userInfo.isBindPhone && [MewClientConfig shareConfig].iosPhoneBind) {
|
||||
[self mew_pushBindPhoneController];
|
||||
}
|
||||
|
||||
if (userInfo.nick == nil || userInfo.avatar == nil) {
|
||||
[self completeUserInfo];
|
||||
[self mew_completeUserInfo];
|
||||
return;
|
||||
}
|
||||
|
||||
[self initTabs:YES];
|
||||
// [self setUserInfoToQYWithUserInfo:userInfo];
|
||||
[self mew_initTabs:YES];
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
#pragma mark - BaseMvpProtocol
|
||||
//登录失效
|
||||
- (void)tokenInvalid {
|
||||
- (void)mew_getTokenId {
|
||||
MewLoginViewController *lvc = [[MewLoginViewController alloc] init];
|
||||
BaseNavigationController * nav = [[BaseNavigationController alloc] initWithRootViewController:lvc];
|
||||
MewBaseNavigationController * nav = [[MewBaseNavigationController alloc] initWithRootViewController:lvc];
|
||||
nav.modalPresentationStyle = UIModalPresentationFullScreen;
|
||||
[self.navigationController presentViewController:nav animated:YES completion:nil];
|
||||
// XPAdImageTool.shareImageTool.isImLogin = NO;
|
||||
}
|
||||
|
||||
//补充用户信息
|
||||
- (void)completeUserInfo {
|
||||
MewLoginFullInfoViewController * bindPhoneVC = [[MewLoginFullInfoViewController alloc] init];
|
||||
BaseNavigationController * nav = [[BaseNavigationController alloc] initWithRootViewController:bindPhoneVC];
|
||||
- (void)mew_completeUserInfo {
|
||||
LoginFullInfoViewController * bindPhoneVC = [[LoginFullInfoViewController alloc] init];
|
||||
MewBaseNavigationController * nav = [[MewBaseNavigationController alloc] initWithRootViewController:bindPhoneVC];
|
||||
nav.modalPresentationStyle = UIModalPresentationFullScreen;
|
||||
[self.navigationController presentViewController:nav animated:YES completion:nil];
|
||||
}
|
||||
|
||||
|
||||
- (void)showSuccessToast:(NSString *)msg {
|
||||
- (void)mew_showSuccessToast:(NSString *)msg {
|
||||
[MewHUDTool showSuccessWithMessage:msg];
|
||||
}
|
||||
|
||||
- (void)showErrorToast:(NSString *)msg {
|
||||
- (void)mew_showErrorToast:(NSString *)msg {
|
||||
[MewHUDTool showErrorWithMessage:msg];
|
||||
}
|
||||
|
||||
- (void)showLoading {
|
||||
[MewHUDTool showLoading];
|
||||
- (void)mew_showLoading {
|
||||
[MewHUDTool mew_showLoading];
|
||||
}
|
||||
|
||||
- (void)hideHUD {
|
||||
[MewHUDTool hideHUD];
|
||||
- (void)mew_hideHUD {
|
||||
[MewHUDTool mew_hideHUD];
|
||||
}
|
||||
|
||||
#pragma mark - 网络状态监听
|
||||
@@ -217,8 +214,8 @@ NSString * const kNetworkReachabilityKey = @"kNetworkReachabilityKey";
|
||||
{
|
||||
if (self.isFirstReachability) {
|
||||
[[NSNotificationCenter defaultCenter] postNotificationName:kNetworkReachabilityKey object:nil userInfo:nil];
|
||||
[self.presenter autoLogin];
|
||||
[[ClientConfig shareConfig] clientInit];
|
||||
[self.presenter mew_autoLogin];
|
||||
[[MewClientConfig shareConfig] mew_clientInit];
|
||||
}
|
||||
self.isFirstReachability = YES;
|
||||
}
|
||||
@@ -232,41 +229,10 @@ NSString * const kNetworkReachabilityKey = @"kNetworkReachabilityKey";
|
||||
|
||||
#pragma mark - Pirvate Method
|
||||
// 去到绑定手机号码页面
|
||||
- (void)pushBindPhoneController {
|
||||
- (void)mew_pushBindPhoneController {
|
||||
|
||||
}
|
||||
// 保存用户信息到七鱼
|
||||
- (void)setUserInfoToQYWithUserInfo:(UserInfoModel *)userInfo {
|
||||
NSString * uid = [AccountInfoStorage instance].getUid;
|
||||
QYUserInfo * userinfo = [[QYUserInfo alloc] init];
|
||||
userinfo.userId = uid;
|
||||
NSMutableArray * array = [NSMutableArray array];
|
||||
NSMutableDictionary * nickDic = [NSMutableDictionary dictionary];
|
||||
[nickDic mewSafeSetObject:@"real_name" forKey:@"key"];
|
||||
[nickDic mewSafeSetObject:userInfo.nick forKey:@"value"];
|
||||
|
||||
NSMutableDictionary * phoneDic = [NSMutableDictionary dictionary];
|
||||
[phoneDic mewSafeSetObject:@"mobile_phone" forKey:@"key"];
|
||||
[phoneDic mewSafeSetObject:userInfo.phone?:@"" forKey:@"value"];
|
||||
|
||||
NSMutableDictionary * accountDic = [NSMutableDictionary dictionary];
|
||||
[accountDic mewSafeSetObject:@"0" forKey:@"index"];
|
||||
[accountDic mewSafeSetObject:@"account" forKey:@"key"];
|
||||
[accountDic mewSafeSetObject:@"ID" forKey:@"label"];
|
||||
[accountDic mewSafeSetObject:@(userInfo.erbanNo) forKey:@"value"];
|
||||
|
||||
NSMutableDictionary * genderDic = [NSMutableDictionary dictionary];
|
||||
[genderDic mewSafeSetObject:@"1" forKey:@"index"];
|
||||
[genderDic mewSafeSetObject:@"sex" forKey:@"key"];
|
||||
[genderDic mewSafeSetObject:@"性别" forKey:@"label"];
|
||||
[genderDic mewSafeSetObject:userInfo.gender == GenderType_Male ? @"男" : @"女" forKey:@"value"];
|
||||
[array addObject:nickDic];
|
||||
[array addObject:phoneDic];
|
||||
[array addObject:accountDic];
|
||||
[array addObject:genderDic];
|
||||
userinfo.data = array.mewToJSONString;
|
||||
[[QYSDK sharedSDK] setUserInfo:userinfo];
|
||||
}
|
||||
|
||||
|
||||
#pragma mark - Get
|
||||
- (MainPresenter *)presenter {
|
||||
@@ -277,5 +243,4 @@ NSString * const kNetworkReachabilityKey = @"kNetworkReachabilityKey";
|
||||
return _presenter;
|
||||
}
|
||||
|
||||
|
||||
@end
|
@@ -1,16 +0,0 @@
|
||||
//
|
||||
// TabbarViewController.h
|
||||
// mew-ios
|
||||
//
|
||||
// Created by 触海 on 2023/11/6.
|
||||
//
|
||||
|
||||
#import <UIKit/UIKit.h>
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface TabbarViewController : UITabBarController
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
@@ -15,14 +15,14 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
/// @param completion 完成
|
||||
/// @param accessToken accessToken
|
||||
/// @param token token
|
||||
+ (void)Mew_PhoneQuickLogin:(HttpRequestHelperCompletion)completion
|
||||
+ (void)Mew_PhoneQuickLogin:(MewHttpRequestHelperCompletion)completion
|
||||
accessToken:(NSString *)accessToken
|
||||
token:(NSString *)token;
|
||||
/// 手机验证码登录
|
||||
/// @param completion 完成
|
||||
/// @param phone 手机号
|
||||
/// @param code 验证码
|
||||
+ (void)Mew_LoginWithCode:(HttpRequestHelperCompletion)completion
|
||||
+ (void)Mew_LoginWithCode:(MewHttpRequestHelperCompletion)completion
|
||||
phone:(NSString *)phone
|
||||
code:(NSString *)code
|
||||
client_secret:(NSString *)client_secret
|
||||
@@ -34,7 +34,7 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
/// @param completion 完成
|
||||
/// @param phone 手机号
|
||||
/// @param password 验证码
|
||||
+ (void)Mew_LoginWithPassword:(HttpRequestHelperCompletion)completion
|
||||
+ (void)Mew_LoginWithPassword:(MewHttpRequestHelperCompletion)completion
|
||||
phone:(NSString *)phone
|
||||
password:(NSString *)password
|
||||
client_secret:(NSString *)client_secret
|
||||
@@ -47,7 +47,7 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
/// @param phone 手机号
|
||||
/// @param newPwd 新的密码
|
||||
/// @param smsCode 验证码
|
||||
+ (void)Mew_ResetPasswordWithPhone:(HttpRequestHelperCompletion)complction
|
||||
+ (void)Mew_ResetPasswordWithPhone:(MewHttpRequestHelperCompletion)complction
|
||||
phone:(NSString *)phone
|
||||
newPwd:(NSString *)newPwd
|
||||
smsCode:(NSString *)smsCode;
|
||||
@@ -58,7 +58,7 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
/// @param unionid unionid
|
||||
/// @param access_token access_token
|
||||
/// @param type 第三方登录的类型
|
||||
+ (void)Mew_LoginWithThirdPart:(HttpRequestHelperCompletion)complction
|
||||
+ (void)Mew_LoginWithThirdPart:(MewHttpRequestHelperCompletion)complction
|
||||
openid:(NSString *)openid
|
||||
unionid:(NSString *)unionid
|
||||
access_token:(NSString *)access_token
|
||||
@@ -66,14 +66,15 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
/// 随机获取一个昵称
|
||||
/// @param completion 完成
|
||||
+ (void)Mew_RandomNick:(HttpRequestHelperCompletion)completion;
|
||||
+ (void)Mew_RandomNick:(MewHttpRequestHelperCompletion)completion;
|
||||
|
||||
|
||||
/// 绑定手机号码
|
||||
/// @param complection 完成
|
||||
/// @param phone 手机号
|
||||
/// @param code 验证码
|
||||
/// @param ticket ticket
|
||||
+ (void)Mew_BindMoblieCode:(HttpRequestHelperCompletion)complection
|
||||
+ (void)Mew_BindMoblieCode:(MewHttpRequestHelperCompletion)complection
|
||||
phone:(NSString *)phone
|
||||
code:(NSString *)code
|
||||
ticket:(NSString *)ticket;
|
||||
|
@@ -6,7 +6,7 @@
|
||||
//
|
||||
|
||||
#import "BaseMvpPresenter.h"
|
||||
#import "YMEnum.h"
|
||||
#import "MewEnum.h"
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
|
@@ -6,7 +6,7 @@
|
||||
//
|
||||
|
||||
#import "BaseMvpPresenter.h"
|
||||
#import "YMEnum.h"
|
||||
#import "MewEnum.h"
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
|
@@ -1,32 +1,32 @@
|
||||
//
|
||||
// MewLoginForgetPasswordPresent.m
|
||||
// LoginForgetPasswordPresent.m
|
||||
// mew-ios
|
||||
//
|
||||
// Created by 触海 on 2023/11/9.
|
||||
//
|
||||
|
||||
#import "MewLoginForgetPasswordPresent.h"
|
||||
#import "LoginForgetPasswordPresent.h"
|
||||
///Tool
|
||||
#import "AccountInfoStorage.h"
|
||||
#import "DESEncrypt.h"
|
||||
#import "YMConstant.h"
|
||||
#import "MewConstant.h"
|
||||
///Protocol
|
||||
#import "MewLoginForgetPasswordProtocol.h"
|
||||
#import "LoginForgetPasswordProtocol.h"
|
||||
///Api
|
||||
#import "Api+Login.h"
|
||||
|
||||
|
||||
@implementation MewLoginForgetPasswordPresent
|
||||
- (id<MewLoginForgetPasswordProtocol>)getView {
|
||||
return (id<MewLoginForgetPasswordProtocol>)[super getView];
|
||||
@implementation LoginForgetPasswordPresent
|
||||
- (id<LoginForgetPasswordProtocol>)getView {
|
||||
return (id<LoginForgetPasswordProtocol>)[super getView];
|
||||
}
|
||||
|
||||
/// 获取手机的验证码
|
||||
/// @param phone 手机号
|
||||
/// @param type 类型
|
||||
- (void)mew_phoneSmsCode:(NSString *)phone type:(GetSmsType)type {
|
||||
- (void)phoneSmsCode:(NSString *)phone type:(GetSmsType)type {
|
||||
NSString * desPhone = [DESEncrypt encryptUseDES:phone key:KeyWithType(KeyType_PasswordEncode)];
|
||||
[Api mew_phoneSmsCode:[self createHttpCompletion:^(id _Nonnull data) {
|
||||
[Api phoneSmsCode:[self createHttpCompletion:^(id _Nonnull data) {
|
||||
[[self getView] mew_phoneSmsCodeSuccess];
|
||||
}] mobile:desPhone type:[NSString stringWithFormat:@"%lu", (unsigned long)type]];
|
||||
}
|
||||
@@ -35,12 +35,12 @@
|
||||
/// @param phone 手机号
|
||||
/// @param newPwd 新的密码
|
||||
/// @param smsCode 验证码
|
||||
- (void)mew_resetPassword:(NSString *)phone newPwd:(NSString *)newPwd smsCode:(NSString *)smsCode {
|
||||
- (void)resetPassword:(NSString *)phone newPwd:(NSString *)newPwd smsCode:(NSString *)smsCode {
|
||||
NSString * desPassword = [DESEncrypt encryptUseDES:newPwd key:KeyWithType(KeyType_PasswordEncode)];
|
||||
NSString * desPhone = [DESEncrypt encryptUseDES:phone key:KeyWithType(KeyType_PasswordEncode)];
|
||||
[Api Mew_ResetPasswordWithPhone:[self createHttpCompletion:^(BaseModel * _Nonnull data) {
|
||||
[[self getView] mew_resetPasswrodSuccess];
|
||||
} showLoading:YES] phone:desPhone newPwd:desPassword smsCode:smsCode];
|
||||
[Api resetPasswordWithPhone:[self createHttpCompletion:^(BaseModel * _Nonnull data) {
|
||||
[[self getView] resetPasswrodSuccess];
|
||||
} mew_showLoading:YES] phone:desPhone newPwd:desPassword smsCode:smsCode];
|
||||
}
|
||||
|
||||
@end
|
||||
|
@@ -1,40 +1,40 @@
|
||||
//
|
||||
// MewLoginFullInfoPresenter.m
|
||||
// LoginFullInfoPresenter.m
|
||||
// mew-ios
|
||||
//
|
||||
// Created by 触海 on 2023/11/6.
|
||||
//
|
||||
|
||||
#import "MewLoginFullInfoPresenter.h"
|
||||
#import "LoginFullInfoPresenter.h"
|
||||
#import "Api+Login.h"
|
||||
///Tool
|
||||
#import "AccountInfoStorage.h"
|
||||
#import "NSMutableDictionary+MEWSafe.h"
|
||||
///Api
|
||||
#import "MewLoginFullInfoProtocol.h"
|
||||
#import "LoginFullInfoProtocol.h"
|
||||
///Model
|
||||
#import "MewThirdUserInfo.h"
|
||||
#import "ThirdUserInfo.h"
|
||||
|
||||
@implementation MewLoginFullInfoPresenter
|
||||
@implementation LoginFullInfoPresenter
|
||||
|
||||
#pragma mark - Super
|
||||
- (id<MewLoginFullInfoProtocol>)getView {
|
||||
return (id<MewLoginFullInfoProtocol>)[super getView];
|
||||
- (id<LoginFullInfoProtocol>)getView {
|
||||
return (id<LoginFullInfoProtocol>)[super getView];
|
||||
}
|
||||
|
||||
#pragma mark - Public Method
|
||||
/// 获取保存的第三方的数据模型
|
||||
- (MewThirdUserInfo *)mew_getMewThirdUserInfo {
|
||||
if ([AccountInfoStorage instance].MewThirdUserInfo) {
|
||||
return [AccountInfoStorage instance].MewThirdUserInfo;
|
||||
- (ThirdUserInfo *)getThirdUserInfo {
|
||||
if ([AccountInfoStorage instance].thirdUserInfo) {
|
||||
return [AccountInfoStorage instance].thirdUserInfo;
|
||||
}
|
||||
return nil;
|
||||
}
|
||||
|
||||
/// 随机获取昵称
|
||||
- (void)mew_randomRequestNick {
|
||||
[Api Mew_RandomNick:[self createHttpCompletion:^(BaseModel * _Nonnull data) {
|
||||
[[self getView] mew_requestRandomNickSuccess:data.data];
|
||||
- (void)randomRequestNick {
|
||||
[Api randomNick:[self createHttpCompletion:^(BaseModel * _Nonnull data) {
|
||||
[[self getView] requestRandomNickSuccess:data.data];
|
||||
}]];
|
||||
}
|
||||
|
||||
@@ -46,7 +46,7 @@
|
||||
/// @param roomUid 邀请的那个房间的uid
|
||||
/// @param shareUid 邀请人的uid
|
||||
/// @param shareChannel 邀请的渠道
|
||||
- (void)mew_complectionInfoWithAvatar:(NSString *)avatar
|
||||
- (void)complectionInfoWithAvatar:(NSString *)avatar
|
||||
gender:(NSString *)gender
|
||||
nick:(NSString *)nick
|
||||
inviteCode:(NSString * __nullable)inviteCode
|
||||
@@ -77,8 +77,8 @@
|
||||
[params mewSafeSetObject:shareChannel forKey:@"shareChannel"];
|
||||
}
|
||||
|
||||
[Api completeUserInfo:[self createHttpCompletion:^(BaseModel * _Nonnull data) {
|
||||
[[self getView] mew_complementInfoSuccess];
|
||||
[Api mew_completeUserInfo:[self createHttpCompletion:^(BaseModel * _Nonnull data) {
|
||||
[[self getView] complementInfoSuccess];
|
||||
}] userInfo:params];
|
||||
}
|
||||
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user