diff --git a/yinmeng-ios/yinmeng-ios/AppDelegate/AppDelegate+ThirdConfig.m b/yinmeng-ios/yinmeng-ios/AppDelegate/AppDelegate+ThirdConfig.m index ec566ac..4250347 100644 --- a/yinmeng-ios/yinmeng-ios/AppDelegate/AppDelegate+ThirdConfig.m +++ b/yinmeng-ios/yinmeng-ios/AppDelegate/AppDelegate+ThirdConfig.m @@ -8,8 +8,9 @@ #import "AppDelegate+ThirdConfig.h" #import #import -#import "YMConstant.h" #import "MewCustomAttachmentDecoder.h" +#import "MewConstant.h" + @implementation AppDelegate (ThirdConfig) - (void)initThirdConfig { diff --git a/yinmeng-ios/yinmeng-ios/AppDelegate/AppDelegate.m b/yinmeng-ios/yinmeng-ios/AppDelegate/AppDelegate.m index 2b39ae4..663af6c 100644 --- a/yinmeng-ios/yinmeng-ios/AppDelegate/AppDelegate.m +++ b/yinmeng-ios/yinmeng-ios/AppDelegate/AppDelegate.m @@ -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 #import @@ -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; diff --git a/yinmeng-ios/yinmeng-ios/Base/MVP/Api/Api.h b/yinmeng-ios/yinmeng-ios/Base/MVP/Api/Api.h index bd4352f..a86498d 100644 --- a/yinmeng-ios/yinmeng-ios/Base/MVP/Api/Api.h +++ b/yinmeng-ios/yinmeng-ios/Base/MVP/Api/Api.h @@ -6,7 +6,7 @@ // #import -#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; diff --git a/yinmeng-ios/yinmeng-ios/Base/MVP/Api/Api.m b/yinmeng-ios/yinmeng-ios/Base/MVP/Api/Api.m index a814992..b8d51ed 100644 --- a/yinmeng-ios/yinmeng-ios/Base/MVP/Api/Api.m +++ b/yinmeng-ios/yinmeng-ios/Base/MVP/Api/Api.m @@ -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 diff --git a/yinmeng-ios/yinmeng-ios/Base/MVP/Model/UserInfoModel.h b/yinmeng-ios/yinmeng-ios/Base/MVP/Model/UserInfoModel.h index ab265c7..2c20d90 100644 --- a/yinmeng-ios/yinmeng-ios/Base/MVP/Model/UserInfoModel.h +++ b/yinmeng-ios/yinmeng-ios/Base/MVP/Model/UserInfoModel.h @@ -6,7 +6,7 @@ // #import "NSObject+MEWExtension.h" -#import "YMEnum.h" +#import "MewEnum.h" #import "UserVipInfoVo.h" NS_ASSUME_NONNULL_BEGIN diff --git a/yinmeng-ios/yinmeng-ios/Base/MVP/Presenter/BaseMvpPresenter.h b/yinmeng-ios/yinmeng-ios/Base/MVP/Presenter/BaseMvpPresenter.h index d908f48..7b0c92c 100644 --- a/yinmeng-ios/yinmeng-ios/Base/MVP/Presenter/BaseMvpPresenter.h +++ b/yinmeng-ios/yinmeng-ios/Base/MVP/Presenter/BaseMvpPresenter.h @@ -7,7 +7,7 @@ #import #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; diff --git a/yinmeng-ios/yinmeng-ios/Base/MVP/Presenter/BaseMvpPresenter.m b/yinmeng-ios/yinmeng-ios/Base/MVP/Presenter/BaseMvpPresenter.m index c777822..75c2ebc 100644 --- a/yinmeng-ios/yinmeng-ios/Base/MVP/Presenter/BaseMvpPresenter.m +++ b/yinmeng-ios/yinmeng-ios/Base/MVP/Presenter/BaseMvpPresenter.m @@ -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) { diff --git a/yinmeng-ios/yinmeng-ios/Base/MVP/Protocol/BaseMvpProtocol.h b/yinmeng-ios/yinmeng-ios/Base/MVP/Protocol/BaseMvpProtocol.h index d79212d..4b78eae 100644 --- a/yinmeng-ios/yinmeng-ios/Base/MVP/Protocol/BaseMvpProtocol.h +++ b/yinmeng-ios/yinmeng-ios/Base/MVP/Protocol/BaseMvpProtocol.h @@ -6,17 +6,17 @@ // #import -#import "BaseViewController.h" +#import "MewBaseViewController.h" @class BaseModel; NS_ASSUME_NONNULL_BEGIN -@protocol BaseMvpProtocol +@protocol BaseMvpProtocol /// 登录失效 -- (void)tokenInvalid; +- (void)mew_getTokenId; /// 跳转到填写用户资料 -- (void)completeUserInfo; +- (void)mew_completeUserInfo; /// 账号已注销 - (void)accountCanceled:(NSDictionary *)data; diff --git a/yinmeng-ios/yinmeng-ios/Base/MVP/View/MvpViewController.h b/yinmeng-ios/yinmeng-ios/Base/MVP/View/MvpViewController.h index 8919226..602558a 100644 --- a/yinmeng-ios/yinmeng-ios/Base/MVP/View/MvpViewController.h +++ b/yinmeng-ios/yinmeng-ios/Base/MVP/View/MvpViewController.h @@ -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 : BaseViewController +@interface MvpViewController : MewBaseViewController @property (nonatomic, strong) __kindof T presenter; diff --git a/yinmeng-ios/yinmeng-ios/Base/MVP/View/MvpViewController.m b/yinmeng-ios/yinmeng-ios/Base/MVP/View/MvpViewController.m index 3a27914..f3aba79 100644 --- a/yinmeng-ios/yinmeng-ios/Base/MVP/View/MvpViewController.m +++ b/yinmeng-ios/yinmeng-ios/Base/MVP/View/MvpViewController.m @@ -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 { } diff --git a/yinmeng-ios/yinmeng-ios/Base/Net/ApiHost.h b/yinmeng-ios/yinmeng-ios/Base/Net/MewApiHost.h similarity index 73% rename from yinmeng-ios/yinmeng-ios/Base/Net/ApiHost.h rename to yinmeng-ios/yinmeng-ios/Base/Net/MewApiHost.h index 820af94..9360f8f 100644 --- a/yinmeng-ios/yinmeng-ios/Base/Net/ApiHost.h +++ b/yinmeng-ios/yinmeng-ios/Base/Net/MewApiHost.h @@ -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 */ diff --git a/yinmeng-ios/yinmeng-ios/Base/Net/HttpRequestHelper.h b/yinmeng-ios/yinmeng-ios/Base/Net/MewHttpRequestHelper.h similarity index 66% rename from yinmeng-ios/yinmeng-ios/Base/Net/HttpRequestHelper.h rename to yinmeng-ios/yinmeng-ios/Base/Net/MewHttpRequestHelper.h index b8d3a42..57aa874 100644 --- a/yinmeng-ios/yinmeng-ios/Base/Net/HttpRequestHelper.h +++ b/yinmeng-ios/yinmeng-ios/Base/Net/MewHttpRequestHelper.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 #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 diff --git a/yinmeng-ios/yinmeng-ios/Base/Net/HttpRequestHelper.m b/yinmeng-ios/yinmeng-ios/Base/Net/MewHttpRequestHelper.m similarity index 86% rename from yinmeng-ios/yinmeng-ios/Base/Net/HttpRequestHelper.m rename to yinmeng-ios/yinmeng-ios/Base/Net/MewHttpRequestHelper.m index 2c9db02..28b7332 100644 --- a/yinmeng-ios/yinmeng-ios/Base/Net/HttpRequestHelper.m +++ b/yinmeng-ios/yinmeng-ios/Base/Net/MewHttpRequestHelper.m @@ -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 -#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 + diff --git a/yinmeng-ios/yinmeng-ios/Base/Tool/MewHUDTool.h b/yinmeng-ios/yinmeng-ios/Base/Tool/MewHUDTool.h index 8d538bc..8384492 100644 --- a/yinmeng-ios/yinmeng-ios/Base/Tool/MewHUDTool.h +++ b/yinmeng-ios/yinmeng-ios/Base/Tool/MewHUDTool.h @@ -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 diff --git a/yinmeng-ios/yinmeng-ios/Base/Tool/MewHUDTool.m b/yinmeng-ios/yinmeng-ios/Base/Tool/MewHUDTool.m index ef8f5a5..fb9e9bf 100644 --- a/yinmeng-ios/yinmeng-ios/Base/Tool/MewHUDTool.m +++ b/yinmeng-ios/yinmeng-ios/Base/Tool/MewHUDTool.m @@ -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]; diff --git a/yinmeng-ios/yinmeng-ios/Base/Tool/UIImage/UIImage+RW.h b/yinmeng-ios/yinmeng-ios/Base/Tool/UIImage/UIImage+RW.h index 9500943..4d2dcc2 100644 --- a/yinmeng-ios/yinmeng-ios/Base/Tool/UIImage/UIImage+RW.h +++ b/yinmeng-ios/yinmeng-ios/Base/Tool/UIImage/UIImage+RW.h @@ -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 ///============================================================================= diff --git a/yinmeng-ios/yinmeng-ios/Base/Tool/UIImage/UIImage+RW.m b/yinmeng-ios/yinmeng-ios/Base/Tool/UIImage/UIImage+RW.m index b96a140..675cf0a 100644 --- a/yinmeng-ios/yinmeng-ios/Base/Tool/UIImage/UIImage+RW.m +++ b/yinmeng-ios/yinmeng-ios/Base/Tool/UIImage/UIImage+RW.m @@ -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(); diff --git a/yinmeng-ios/yinmeng-ios/Base/UI/BaseNavigationController.h b/yinmeng-ios/yinmeng-ios/Base/UI/BaseNavigationController.h deleted file mode 100644 index c61559d..0000000 --- a/yinmeng-ios/yinmeng-ios/Base/UI/BaseNavigationController.h +++ /dev/null @@ -1,16 +0,0 @@ -// -// BaseNavigationController.h -// mew-ios -// -// Created by 触海 on 2023/11/6. -// - -#import - -NS_ASSUME_NONNULL_BEGIN - -@interface BaseNavigationController : UINavigationController - -@end - -NS_ASSUME_NONNULL_END diff --git a/yinmeng-ios/yinmeng-ios/Base/UI/BaseViewController.h b/yinmeng-ios/yinmeng-ios/Base/UI/BaseViewController.h deleted file mode 100644 index 847c77c..0000000 --- a/yinmeng-ios/yinmeng-ios/Base/UI/BaseViewController.h +++ /dev/null @@ -1,48 +0,0 @@ -// -// BaseViewController.h -// mew-ios -// -// Created by 触海 on 2023/11/6. -// - -#import - -NS_ASSUME_NONNULL_BEGIN - -@protocol BaseViewControllerProtocol - -/*成功 toast*/ -- (void)showSuccessToast:(NSString *)msg; - -/*失败 toast*/ -- (void)showErrorToast:(NSString *)msg; - -/*加载 loading*/ -- (void)showLoading; - -/*隐藏 XCHUDTool*/ -- (void)hideHUD; - -@end - - -@interface BaseViewController : UIViewController - -// 是否隐藏导航 默认是不隐藏的 -@property(nonatomic,assign,getter=mew_isHiddenNavBar) BOOL hiddenNavBar; - -/*显示/隐藏导航*/ -- (void)hideNavigationBar; - -/*隐藏导航栏*/ -- (void)showNavigationBar; - -/*显示/隐藏状态栏*/ -- (void)showStatusBar; - -/*隐藏状态栏*/ -- (void)hideStatusBar; - -@end - -NS_ASSUME_NONNULL_END diff --git a/yinmeng-ios/yinmeng-ios/Base/UI/Button/YMIButton.h b/yinmeng-ios/yinmeng-ios/Base/UI/Button/MewButton.h similarity index 64% rename from yinmeng-ios/yinmeng-ios/Base/UI/Button/YMIButton.h rename to yinmeng-ios/yinmeng-ios/Base/UI/Button/MewButton.h index 52eede9..eaeb7c8 100644 --- a/yinmeng-ios/yinmeng-ios/Base/UI/Button/YMIButton.h +++ b/yinmeng-ios/yinmeng-ios/Base/UI/Button/MewButton.h @@ -1,22 +1,20 @@ // -// YMIButton.h +// MewButton.h // yinmeng-ios // -// Created by 触海 on 2023/11/21. +// Created by duoban on 2023/12/5. // #import - -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中设置 diff --git a/yinmeng-ios/yinmeng-ios/Base/UI/Button/YMIButton.m b/yinmeng-ios/yinmeng-ios/Base/UI/Button/MewButton.m similarity index 97% rename from yinmeng-ios/yinmeng-ios/Base/UI/Button/YMIButton.m rename to yinmeng-ios/yinmeng-ios/Base/UI/Button/MewButton.m index f9585b3..93f50d9 100644 --- a/yinmeng-ios/yinmeng-ios/Base/UI/Button/YMIButton.m +++ b/yinmeng-ios/yinmeng-ios/Base/UI/Button/MewButton.m @@ -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 diff --git a/yinmeng-ios/yinmeng-ios/Base/UI/MewBaseNavigationController.h b/yinmeng-ios/yinmeng-ios/Base/UI/MewBaseNavigationController.h new file mode 100644 index 0000000..6f6f902 --- /dev/null +++ b/yinmeng-ios/yinmeng-ios/Base/UI/MewBaseNavigationController.h @@ -0,0 +1,16 @@ +// +// MewBaseNavigationController.h +// yinmeng-ios +// +// Created by duoban on 2023/12/5. +// + +#import + +NS_ASSUME_NONNULL_BEGIN + +@interface MewBaseNavigationController : UINavigationController + +@end + +NS_ASSUME_NONNULL_END diff --git a/yinmeng-ios/yinmeng-ios/Base/UI/BaseNavigationController.m b/yinmeng-ios/yinmeng-ios/Base/UI/MewBaseNavigationController.m similarity index 86% rename from yinmeng-ios/yinmeng-ios/Base/UI/BaseNavigationController.m rename to yinmeng-ios/yinmeng-ios/Base/UI/MewBaseNavigationController.m index 41c6e74..d8dec06 100644 --- a/yinmeng-ios/yinmeng-ios/Base/UI/BaseNavigationController.m +++ b/yinmeng-ios/yinmeng-ios/Base/UI/MewBaseNavigationController.m @@ -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 () +@interface MewBaseNavigationController () @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 + diff --git a/yinmeng-ios/yinmeng-ios/Base/UI/MewBaseViewController.h b/yinmeng-ios/yinmeng-ios/Base/UI/MewBaseViewController.h new file mode 100644 index 0000000..0447536 --- /dev/null +++ b/yinmeng-ios/yinmeng-ios/Base/UI/MewBaseViewController.h @@ -0,0 +1,48 @@ +// +// MewBaseViewController.h +// yinmeng-ios +// +// Created by duoban on 2023/12/5. +// + +#import + +NS_ASSUME_NONNULL_BEGIN + +@protocol MewBaseViewControllerProtocol + +/*成功 toast*/ +- (void)mew_showSuccessToast:(NSString *)msg; + +/*失败 toast*/ +- (void)mew_showErrorToast:(NSString *)msg; + +/*加载 loading*/ +- (void)mew_showLoading; + +/*隐藏 XCHUDTool*/ +- (void)mew_hideHUD; + +@end + + +@interface MewBaseViewController : UIViewController + +// 是否隐藏导航 默认是不隐藏的 +@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 diff --git a/yinmeng-ios/yinmeng-ios/Base/UI/BaseViewController.m b/yinmeng-ios/yinmeng-ios/Base/UI/MewBaseViewController.m similarity index 79% rename from yinmeng-ios/yinmeng-ios/Base/UI/BaseViewController.m rename to yinmeng-ios/yinmeng-ios/Base/UI/MewBaseViewController.m index 9c6db59..0a80b63 100644 --- a/yinmeng-ios/yinmeng-ios/Base/UI/BaseViewController.m +++ b/yinmeng-ios/yinmeng-ios/Base/UI/MewBaseViewController.m @@ -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 diff --git a/yinmeng-ios/yinmeng-ios/Base/UI/YMCurrentVCStackManager.h b/yinmeng-ios/yinmeng-ios/Base/UI/MewStackManager.h similarity index 53% rename from yinmeng-ios/yinmeng-ios/Base/UI/YMCurrentVCStackManager.h rename to yinmeng-ios/yinmeng-ios/Base/UI/MewStackManager.h index 5d4caa2..01b1ea5 100644 --- a/yinmeng-ios/yinmeng-ios/Base/UI/YMCurrentVCStackManager.h +++ b/yinmeng-ios/yinmeng-ios/Base/UI/MewStackManager.h @@ -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 + 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 diff --git a/yinmeng-ios/yinmeng-ios/Base/UI/YMCurrentVCStackManager.m b/yinmeng-ios/yinmeng-ios/Base/UI/MewStackManager.m similarity index 85% rename from yinmeng-ios/yinmeng-ios/Base/UI/YMCurrentVCStackManager.m rename to yinmeng-ios/yinmeng-ios/Base/UI/MewStackManager.m index b6ecb9a..c80b888 100644 --- a/yinmeng-ios/yinmeng-ios/Base/UI/YMCurrentVCStackManager.m +++ b/yinmeng-ios/yinmeng-ios/Base/UI/MewStackManager.m @@ -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 diff --git a/yinmeng-ios/yinmeng-ios/Base/UI/TTPopup/Config/TTAlertConfig.m b/yinmeng-ios/yinmeng-ios/Base/UI/TTPopup/Config/TTAlertConfig.m index 89fdecf..56999da 100644 --- a/yinmeng-ios/yinmeng-ios/Base/UI/TTPopup/Config/TTAlertConfig.m +++ b/yinmeng-ios/yinmeng-ios/Base/UI/TTPopup/Config/TTAlertConfig.m @@ -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;// 默认圆角 diff --git a/yinmeng-ios/yinmeng-ios/Base/UI/UIImage/UIImage+MewUtils.h b/yinmeng-ios/yinmeng-ios/Base/UI/UIImage/UIImage+MewUtils.h new file mode 100644 index 0000000..8e9988c --- /dev/null +++ b/yinmeng-ios/yinmeng-ios/Base/UI/UIImage/UIImage+MewUtils.h @@ -0,0 +1,53 @@ +// +// UIImage+MewUtils.h +// yinmeng-ios +// +// Created by duoban on 2023/12/5. +// + +#import +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*)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 diff --git a/yinmeng-ios/yinmeng-ios/Base/UI/UIImage/UIImage+Utils.m b/yinmeng-ios/yinmeng-ios/Base/UI/UIImage/UIImage+MewUtils.m similarity index 88% rename from yinmeng-ios/yinmeng-ios/Base/UI/UIImage/UIImage+Utils.m rename to yinmeng-ios/yinmeng-ios/Base/UI/UIImage/UIImage+MewUtils.m index a9677c0..208b0fa 100644 --- a/yinmeng-ios/yinmeng-ios/Base/UI/UIImage/UIImage+Utils.m +++ b/yinmeng-ios/yinmeng-ios/Base/UI/UIImage/UIImage+MewUtils.m @@ -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 - -@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 *)colors gradientType:(GradientType)gradientType imgSize:(CGSize)imgSize{ ++ (UIImage *)mew_gradientColorImageFromColors:(NSArray *)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; diff --git a/yinmeng-ios/yinmeng-ios/Base/UI/UIImage/UIImage+Utils.h b/yinmeng-ios/yinmeng-ios/Base/UI/UIImage/UIImage+Utils.h deleted file mode 100644 index ffc5a91..0000000 --- a/yinmeng-ios/yinmeng-ios/Base/UI/UIImage/UIImage+Utils.h +++ /dev/null @@ -1,53 +0,0 @@ -// -// UIImage+Utils.h -// YYMobileFramework -// -// Created by wuwei on 14/6/20. -// Copyright (c) 2014年 YY Inc. All rights reserved. -// - -#import - -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*)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 diff --git a/yinmeng-ios/yinmeng-ios/Base/UI/UIImage/UIView+FilletCorner.h b/yinmeng-ios/yinmeng-ios/Base/UI/UIImage/UIView+MewFilletCorner.h similarity index 66% rename from yinmeng-ios/yinmeng-ios/Base/UI/UIImage/UIView+FilletCorner.h rename to yinmeng-ios/yinmeng-ios/Base/UI/UIImage/UIView+MewFilletCorner.h index 348c2d3..4242cb1 100644 --- a/yinmeng-ios/yinmeng-ios/Base/UI/UIImage/UIView+FilletCorner.h +++ b/yinmeng-ios/yinmeng-ios/Base/UI/UIImage/UIView+MewFilletCorner.h @@ -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 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 diff --git a/yinmeng-ios/yinmeng-ios/Base/UI/UIImage/UIView+FilletCorner.m b/yinmeng-ios/yinmeng-ios/Base/UI/UIImage/UIView+MewFilletCorner.m similarity index 88% rename from yinmeng-ios/yinmeng-ios/Base/UI/UIImage/UIView+FilletCorner.m rename to yinmeng-ios/yinmeng-ios/Base/UI/UIImage/UIView+MewFilletCorner.m index 802d49d..34a40d4 100644 --- a/yinmeng-ios/yinmeng-ios/Base/UI/UIImage/UIView+FilletCorner.m +++ b/yinmeng-ios/yinmeng-ios/Base/UI/UIImage/UIView+MewFilletCorner.m @@ -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 diff --git a/yinmeng-ios/yinmeng-ios/Base/UIButton/UIButton+EnlargeTouchArea.h b/yinmeng-ios/yinmeng-ios/Base/UIButton/UIButton+EnlargeTouchArea.h deleted file mode 100644 index 65e05b5..0000000 --- a/yinmeng-ios/yinmeng-ios/Base/UIButton/UIButton+EnlargeTouchArea.h +++ /dev/null @@ -1,42 +0,0 @@ -// -// UIButton+EnlargeTouchArea.h -// yinmeng-ios -// -// Created by 触海 on 2023/11/22. -// - -#import - -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 diff --git a/yinmeng-ios/yinmeng-ios/Base/UIButton/UIButton+MewEnlargeTouchArea.h b/yinmeng-ios/yinmeng-ios/Base/UIButton/UIButton+MewEnlargeTouchArea.h new file mode 100644 index 0000000..266286a --- /dev/null +++ b/yinmeng-ios/yinmeng-ios/Base/UIButton/UIButton+MewEnlargeTouchArea.h @@ -0,0 +1,42 @@ +// +// UIButton+MewEnlargeTouchArea.h +// yinmeng-ios +// +// Created by duoban on 2023/12/5. +// + +#import + +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 diff --git a/yinmeng-ios/yinmeng-ios/Base/UIButton/UIButton+EnlargeTouchArea.m b/yinmeng-ios/yinmeng-ios/Base/UIButton/UIButton+MewEnlargeTouchArea.m similarity index 86% rename from yinmeng-ios/yinmeng-ios/Base/UIButton/UIButton+EnlargeTouchArea.m rename to yinmeng-ios/yinmeng-ios/Base/UIButton/UIButton+MewEnlargeTouchArea.m index 6fc3301..8688432 100644 --- a/yinmeng-ios/yinmeng-ios/Base/UIButton/UIButton+EnlargeTouchArea.m +++ b/yinmeng-ios/yinmeng-ios/Base/UIButton/UIButton+MewEnlargeTouchArea.m @@ -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 + #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]; diff --git a/yinmeng-ios/yinmeng-ios/Global/YMConstant.h b/yinmeng-ios/yinmeng-ios/Global/MewConstant.h similarity index 83% rename from yinmeng-ios/yinmeng-ios/Global/YMConstant.h rename to yinmeng-ios/yinmeng-ios/Global/MewConstant.h index 58d35cd..4bb71a5 100644 --- a/yinmeng-ios/yinmeng-ios/Global/YMConstant.h +++ b/yinmeng-ios/yinmeng-ios/Global/MewConstant.h @@ -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 NS_ASSUME_NONNULL_BEGIN -@interface YMConstant : NSObject - +@interface MewConstant : NSObject typedef NS_ENUM(NSUInteger, KeyType) { KeyType_PasswordEncode,///密码 des 加密的 KeyType_TRTC,///TRTC key diff --git a/yinmeng-ios/yinmeng-ios/Global/YMConstant.m b/yinmeng-ios/yinmeng-ios/Global/MewConstant.m similarity index 94% rename from yinmeng-ios/yinmeng-ios/Global/YMConstant.m rename to yinmeng-ios/yinmeng-ios/Global/MewConstant.m index d4c0c67..31f0fc5 100644 --- a/yinmeng-ios/yinmeng-ios/Global/YMConstant.m +++ b/yinmeng-ios/yinmeng-ios/Global/MewConstant.m @@ -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 diff --git a/yinmeng-ios/yinmeng-ios/Global/YMEnum.h b/yinmeng-ios/yinmeng-ios/Global/MewEnum.h similarity index 86% rename from yinmeng-ios/yinmeng-ios/Global/YMEnum.h rename to yinmeng-ios/yinmeng-ios/Global/MewEnum.h index ef32c1b..bb5003e 100644 --- a/yinmeng-ios/yinmeng-ios/Global/YMEnum.h +++ b/yinmeng-ios/yinmeng-ios/Global/MewEnum.h @@ -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 */ diff --git a/yinmeng-ios/yinmeng-ios/Global/YMMacro.h b/yinmeng-ios/yinmeng-ios/Global/MewMacro.h similarity index 93% rename from yinmeng-ios/yinmeng-ios/Global/YMMacro.h rename to yinmeng-ios/yinmeng-ios/Global/MewMacro.h index 23b580f..62728c2 100644 --- a/yinmeng-ios/yinmeng-ios/Global/YMMacro.h +++ b/yinmeng-ios/yinmeng-ios/Global/MewMacro.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 */ diff --git a/yinmeng-ios/yinmeng-ios/Main/ClientConfig/Api/Api+Main.h b/yinmeng-ios/yinmeng-ios/Main/ClientConfig/Api/Api+Main.h deleted file mode 100644 index 22d1eb0..0000000 --- a/yinmeng-ios/yinmeng-ios/Main/ClientConfig/Api/Api+Main.h +++ /dev/null @@ -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 diff --git a/yinmeng-ios/yinmeng-ios/Main/ClientConfig/Api/Api+Main.m b/yinmeng-ios/yinmeng-ios/Main/ClientConfig/Api/Api+Main.m deleted file mode 100644 index 9141792..0000000 --- a/yinmeng-ios/yinmeng-ios/Main/ClientConfig/Api/Api+Main.m +++ /dev/null @@ -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 diff --git a/yinmeng-ios/yinmeng-ios/Main/ClientConfig/Api/Api+MewMain.h b/yinmeng-ios/yinmeng-ios/Main/ClientConfig/Api/Api+MewMain.h new file mode 100644 index 0000000..387ffc5 --- /dev/null +++ b/yinmeng-ios/yinmeng-ios/Main/ClientConfig/Api/Api+MewMain.h @@ -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 diff --git a/yinmeng-ios/yinmeng-ios/Main/ClientConfig/Api/Api+MewMain.m b/yinmeng-ios/yinmeng-ios/Main/ClientConfig/Api/Api+MewMain.m new file mode 100644 index 0000000..3977b02 --- /dev/null +++ b/yinmeng-ios/yinmeng-ios/Main/ClientConfig/Api/Api+MewMain.m @@ -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 diff --git a/yinmeng-ios/yinmeng-ios/Main/ClientConfig/ClientConfig.h b/yinmeng-ios/yinmeng-ios/Main/ClientConfig/MewClientConfig.h similarity index 60% rename from yinmeng-ios/yinmeng-ios/Main/ClientConfig/ClientConfig.h rename to yinmeng-ios/yinmeng-ios/Main/ClientConfig/MewClientConfig.h index 45579fc..c13ee1c 100644 --- a/yinmeng-ios/yinmeng-ios/Main/ClientConfig/ClientConfig.h +++ b/yinmeng-ios/yinmeng-ios/Main/ClientConfig/MewClientConfig.h @@ -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 -#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 diff --git a/yinmeng-ios/yinmeng-ios/Main/ClientConfig/ClientConfig.m b/yinmeng-ios/yinmeng-ios/Main/ClientConfig/MewClientConfig.m similarity index 72% rename from yinmeng-ios/yinmeng-ios/Main/ClientConfig/ClientConfig.m rename to yinmeng-ios/yinmeng-ios/Main/ClientConfig/MewClientConfig.m index fe0618d..0252762 100644 --- a/yinmeng-ios/yinmeng-ios/Main/ClientConfig/ClientConfig.m +++ b/yinmeng-ios/yinmeng-ios/Main/ClientConfig/MewClientConfig.m @@ -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 diff --git a/yinmeng-ios/yinmeng-ios/Main/ClientConfig/Model/ClientDataModel.m b/yinmeng-ios/yinmeng-ios/Main/ClientConfig/Model/ClientDataModel.m deleted file mode 100644 index d7e5d69..0000000 --- a/yinmeng-ios/yinmeng-ios/Main/ClientConfig/Model/ClientDataModel.m +++ /dev/null @@ -1,12 +0,0 @@ -// -// ClientDataModel.m -// mew-ios -// -// Created by 触海 on 2023/11/8. -// - -#import "ClientDataModel.h" - -@implementation ClientDataModel - -@end diff --git a/yinmeng-ios/yinmeng-ios/Main/ClientConfig/Model/ClientDataModel.h b/yinmeng-ios/yinmeng-ios/Main/ClientConfig/Model/MewClientDataModel.h similarity index 82% rename from yinmeng-ios/yinmeng-ios/Main/ClientConfig/Model/ClientDataModel.h rename to yinmeng-ios/yinmeng-ios/Main/ClientConfig/Model/MewClientDataModel.h index 5ce52b3..0775c6c 100644 --- a/yinmeng-ios/yinmeng-ios/Main/ClientConfig/Model/ClientDataModel.h +++ b/yinmeng-ios/yinmeng-ios/Main/ClientConfig/Model/MewClientDataModel.h @@ -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 NS_ASSUME_NONNULL_BEGIN -@interface ClientDataModel : NSObject +@interface MewClientDataModel : NSObject /// 首页tag 配置 @property (nonatomic,strong) NSArray *homeTabList; @@ -21,7 +21,6 @@ NS_ASSUME_NONNULL_BEGIN @property (nonatomic, strong) NSArray *officialMsgUids; ///官方账号 小秘书 红包消息 @property (nonatomic,strong) NSArray *officialAccountUids; - @end NS_ASSUME_NONNULL_END diff --git a/yinmeng-ios/yinmeng-ios/Main/ClientConfig/Model/MewClientDataModel.m b/yinmeng-ios/yinmeng-ios/Main/ClientConfig/Model/MewClientDataModel.m new file mode 100644 index 0000000..62673f5 --- /dev/null +++ b/yinmeng-ios/yinmeng-ios/Main/ClientConfig/Model/MewClientDataModel.m @@ -0,0 +1,12 @@ +// +// MewClientDataModel.m +// yinmeng-ios +// +// Created by duoban on 2023/12/5. +// + +#import "MewClientDataModel.h" + +@implementation MewClientDataModel + +@end diff --git a/yinmeng-ios/yinmeng-ios/Main/Mew/Home/Api/Api+MewHome.h b/yinmeng-ios/yinmeng-ios/Main/Mew/Home/Api/Api+MewHome.h index 36439bb..bfc3854 100644 --- a/yinmeng-ios/yinmeng-ios/Main/Mew/Home/Api/Api+MewHome.h +++ b/yinmeng-ios/yinmeng-ios/Main/Mew/Home/Api/Api+MewHome.h @@ -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 diff --git a/yinmeng-ios/yinmeng-ios/Main/Mew/Home/Api/Api+MewHome.m b/yinmeng-ios/yinmeng-ios/Main/Mew/Home/Api/Api+MewHome.m index c5b1eef..a5de7a6 100644 --- a/yinmeng-ios/yinmeng-ios/Main/Mew/Home/Api/Api+MewHome.m +++ b/yinmeng-ios/yinmeng-ios/Main/Mew/Home/Api/Api+MewHome.m @@ -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 diff --git a/yinmeng-ios/yinmeng-ios/Main/Mew/Home/View/MewHomeViewController.m b/yinmeng-ios/yinmeng-ios/Main/Mew/Home/View/MewHomeViewController.m index d07c8e7..9b6a5be 100644 --- a/yinmeng-ios/yinmeng-ios/Main/Mew/Home/View/MewHomeViewController.m +++ b/yinmeng-ios/yinmeng-ios/Main/Mew/Home/View/MewHomeViewController.m @@ -21,7 +21,7 @@ #import "MewSessionViewController.h" #import /// 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]; diff --git a/yinmeng-ios/yinmeng-ios/Main/Mew/Home/View/SubView/MewHeaderView.m b/yinmeng-ios/yinmeng-ios/Main/Mew/Home/View/SubView/MewHeaderView.m index d1fb54a..c82d9cd 100644 --- a/yinmeng-ios/yinmeng-ios/Main/Mew/Home/View/SubView/MewHeaderView.m +++ b/yinmeng-ios/yinmeng-ios/Main/Mew/Home/View/SubView/MewHeaderView.m @@ -7,7 +7,7 @@ #import "MewHeaderView.h" /// Tool -#import "YMMacro.h" +#import "MewMacro.h" #import "MEWThemeColor.h" #import diff --git a/yinmeng-ios/yinmeng-ios/Main/Mew/Home/View/SubView/MewHomeFilterView.m b/yinmeng-ios/yinmeng-ios/Main/Mew/Home/View/SubView/MewHomeFilterView.m index c81c097..f501917 100644 --- a/yinmeng-ios/yinmeng-ios/Main/Mew/Home/View/SubView/MewHomeFilterView.m +++ b/yinmeng-ios/yinmeng-ios/Main/Mew/Home/View/SubView/MewHomeFilterView.m @@ -9,7 +9,7 @@ /// Third #import /// Tool -#import "YMMacro.h" +#import "MewMacro.h" #import "MEWThemeColor.h" @interface MewHomeFilterView() diff --git a/yinmeng-ios/yinmeng-ios/Main/Mew/Home/View/SubView/MewPlayVoiceView.m b/yinmeng-ios/yinmeng-ios/Main/Mew/Home/View/SubView/MewPlayVoiceView.m index 52f064d..b5287cf 100644 --- a/yinmeng-ios/yinmeng-ios/Main/Mew/Home/View/SubView/MewPlayVoiceView.m +++ b/yinmeng-ios/yinmeng-ios/Main/Mew/Home/View/SubView/MewPlayVoiceView.m @@ -11,11 +11,11 @@ /// Third #import /// 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]; } diff --git a/yinmeng-ios/yinmeng-ios/Main/Mew/Home/View/SubView/MewPushExclusiveVoiceView.m b/yinmeng-ios/yinmeng-ios/Main/Mew/Home/View/SubView/MewPushExclusiveVoiceView.m index ad050a6..ddbc3d6 100644 --- a/yinmeng-ios/yinmeng-ios/Main/Mew/Home/View/SubView/MewPushExclusiveVoiceView.m +++ b/yinmeng-ios/yinmeng-ios/Main/Mew/Home/View/SubView/MewPushExclusiveVoiceView.m @@ -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]; } diff --git a/yinmeng-ios/yinmeng-ios/Main/Mew/Home/View/SubView/MewRightFollowVoiceCollectionCell.h b/yinmeng-ios/yinmeng-ios/Main/Mew/Home/View/SubView/MewRightFollowVoiceCollectionCell.h index edd009c..30de312 100644 --- a/yinmeng-ios/yinmeng-ios/Main/Mew/Home/View/SubView/MewRightFollowVoiceCollectionCell.h +++ b/yinmeng-ios/yinmeng-ios/Main/Mew/Home/View/SubView/MewRightFollowVoiceCollectionCell.h @@ -6,7 +6,7 @@ // #import -#import "YMEnum.h" +#import "MewEnum.h" NS_ASSUME_NONNULL_BEGIN diff --git a/yinmeng-ios/yinmeng-ios/Main/Mew/Home/View/SubView/MewRightFollowVoiceCollectionCell.m b/yinmeng-ios/yinmeng-ios/Main/Mew/Home/View/SubView/MewRightFollowVoiceCollectionCell.m index 166a603..c20d294 100644 --- a/yinmeng-ios/yinmeng-ios/Main/Mew/Home/View/SubView/MewRightFollowVoiceCollectionCell.m +++ b/yinmeng-ios/yinmeng-ios/Main/Mew/Home/View/SubView/MewRightFollowVoiceCollectionCell.m @@ -6,7 +6,7 @@ // #import "MewRightFollowVoiceCollectionCell.h" -#import "YMMacro.h" +#import "MewMacro.h" #import #import "NetImageView.h" diff --git a/yinmeng-ios/yinmeng-ios/Main/Mew/Home/View/SubView/MewRightFollowVoiceView.m b/yinmeng-ios/yinmeng-ios/Main/Mew/Home/View/SubView/MewRightFollowVoiceView.m index a841ff4..a5d1f35 100644 --- a/yinmeng-ios/yinmeng-ios/Main/Mew/Home/View/SubView/MewRightFollowVoiceView.m +++ b/yinmeng-ios/yinmeng-ios/Main/Mew/Home/View/SubView/MewRightFollowVoiceView.m @@ -11,7 +11,7 @@ /// Third #import /// 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++; diff --git a/yinmeng-ios/yinmeng-ios/Main/Mew/Home/View/SubView/MewShowVoiceView.m b/yinmeng-ios/yinmeng-ios/Main/Mew/Home/View/SubView/MewShowVoiceView.m index 441944a..5360a54 100644 --- a/yinmeng-ios/yinmeng-ios/Main/Mew/Home/View/SubView/MewShowVoiceView.m +++ b/yinmeng-ios/yinmeng-ios/Main/Mew/Home/View/SubView/MewShowVoiceView.m @@ -9,7 +9,7 @@ #import "MewPlayVoiceView.h" #import "MewVoiceDiscView.h" /// Tool -#import "YMMacro.h" +#import "MewMacro.h" #import "MewAudioPlayerManager.h" #import "MewHUDTool.h" /// Third diff --git a/yinmeng-ios/yinmeng-ios/Main/Mew/Home/View/SubView/MewUserIntroductionView.m b/yinmeng-ios/yinmeng-ios/Main/Mew/Home/View/SubView/MewUserIntroductionView.m index 9236468..aaeea33 100644 --- a/yinmeng-ios/yinmeng-ios/Main/Mew/Home/View/SubView/MewUserIntroductionView.m +++ b/yinmeng-ios/yinmeng-ios/Main/Mew/Home/View/SubView/MewUserIntroductionView.m @@ -10,7 +10,7 @@ ///Model #import "UserInfoModel.h" /// Tool -#import "YMMacro.h" +#import "MewMacro.h" #import "MEWThemeColor.h" #import "MewAudioPlayerManager.h" /// Third diff --git a/yinmeng-ios/yinmeng-ios/Main/Mew/Home/View/SubView/MewVoiceGuideView.m b/yinmeng-ios/yinmeng-ios/Main/Mew/Home/View/SubView/MewVoiceGuideView.m index ee8f57b..3afdf13 100644 --- a/yinmeng-ios/yinmeng-ios/Main/Mew/Home/View/SubView/MewVoiceGuideView.m +++ b/yinmeng-ios/yinmeng-ios/Main/Mew/Home/View/SubView/MewVoiceGuideView.m @@ -8,7 +8,7 @@ #import "MewVoiceGuideView.h" /// Tool #import "MEWThemeColor.h" -#import "YMMacro.h" +#import "MewMacro.h" #import diff --git a/yinmeng-ios/yinmeng-ios/Main/Mew/Login/View/MewLoginNumberViewController.h b/yinmeng-ios/yinmeng-ios/Main/Mew/Login/View/MewLoginNumberViewController.h index f5f2fd9..cafc31e 100644 --- a/yinmeng-ios/yinmeng-ios/Main/Mew/Login/View/MewLoginNumberViewController.h +++ b/yinmeng-ios/yinmeng-ios/Main/Mew/Login/View/MewLoginNumberViewController.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 diff --git a/yinmeng-ios/yinmeng-ios/Main/Mew/Login/View/MewLoginNumberViewController.m b/yinmeng-ios/yinmeng-ios/Main/Mew/Login/View/MewLoginNumberViewController.m index b3ac85f..c4fbb4b 100644 --- a/yinmeng-ios/yinmeng-ios/Main/Mew/Login/View/MewLoginNumberViewController.m +++ b/yinmeng-ios/yinmeng-ios/Main/Mew/Login/View/MewLoginNumberViewController.m @@ -12,7 +12,7 @@ /// Third #import /// Tool -#import "YMMacro.h" +#import "MewMacro.h" @interface MewLoginNumberViewController () @property (nonatomic, strong) UIImageView *bgImageView; diff --git a/yinmeng-ios/yinmeng-ios/Main/Mew/Login/View/MewLoginViewController.m b/yinmeng-ios/yinmeng-ios/Main/Mew/Login/View/MewLoginViewController.m index c24b8ef..d524f10 100644 --- a/yinmeng-ios/yinmeng-ios/Main/Mew/Login/View/MewLoginViewController.m +++ b/yinmeng-ios/yinmeng-ios/Main/Mew/Login/View/MewLoginViewController.m @@ -7,8 +7,8 @@ #import "MewLoginViewController.h" #import "MewLoginNumberViewController.h" -#import "YMIButton.h" -#import "YMWebViewController.h" +#import "MewButton.h" +#import "MewWebViewController.h" //apple #import #import @@ -17,11 +17,11 @@ #import #import ///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]; diff --git a/yinmeng-ios/yinmeng-ios/Main/Mew/Login/View/SubView/MewLoginPasswordView.m b/yinmeng-ios/yinmeng-ios/Main/Mew/Login/View/SubView/MewLoginPasswordView.m index 6fc3674..ddc9b12 100644 --- a/yinmeng-ios/yinmeng-ios/Main/Mew/Login/View/SubView/MewLoginPasswordView.m +++ b/yinmeng-ios/yinmeng-ios/Main/Mew/Login/View/SubView/MewLoginPasswordView.m @@ -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]; } diff --git a/yinmeng-ios/yinmeng-ios/Main/Mew/Login/View/SubView/MewLoginPhoneView.m b/yinmeng-ios/yinmeng-ios/Main/Mew/Login/View/SubView/MewLoginPhoneView.m index 258be79..b9616de 100644 --- a/yinmeng-ios/yinmeng-ios/Main/Mew/Login/View/SubView/MewLoginPhoneView.m +++ b/yinmeng-ios/yinmeng-ios/Main/Mew/Login/View/SubView/MewLoginPhoneView.m @@ -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]; diff --git a/yinmeng-ios/yinmeng-ios/Main/Mew/Message/View/SessionList/MewSessionListTableViewCell.m b/yinmeng-ios/yinmeng-ios/Main/Mew/Message/View/SessionList/MewSessionListTableViewCell.m index cf351e6..f092e2c 100644 --- a/yinmeng-ios/yinmeng-ios/Main/Mew/Message/View/SessionList/MewSessionListTableViewCell.m +++ b/yinmeng-ios/yinmeng-ios/Main/Mew/Message/View/SessionList/MewSessionListTableViewCell.m @@ -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); } diff --git a/yinmeng-ios/yinmeng-ios/Main/Mew/Message/View/SessionList/MewSessionListViewController.h b/yinmeng-ios/yinmeng-ios/Main/Mew/Message/View/SessionList/MewSessionListViewController.h index 84beddb..c25986f 100644 --- a/yinmeng-ios/yinmeng-ios/Main/Mew/Message/View/SessionList/MewSessionListViewController.h +++ b/yinmeng-ios/yinmeng-ios/Main/Mew/Message/View/SessionList/MewSessionListViewController.h @@ -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 diff --git a/yinmeng-ios/yinmeng-ios/Main/Mew/Message/View/SessionList/MewSessionListViewController.m b/yinmeng-ios/yinmeng-ios/Main/Mew/Message/View/SessionList/MewSessionListViewController.m index be0af84..542ac7a 100644 --- a/yinmeng-ios/yinmeng-ios/Main/Mew/Message/View/SessionList/MewSessionListViewController.m +++ b/yinmeng-ios/yinmeng-ios/Main/Mew/Message/View/SessionList/MewSessionListViewController.m @@ -11,8 +11,8 @@ /// View #import "MewSessionListTableViewCell.h" /// Tool -#import "YMMacro.h" -#import "ClientConfig.h" +#import "MewMacro.h" +#import "MewClientConfig.h" #import #import "MewSessionViewController.h" @interface MewSessionListViewController () 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; } diff --git a/yinmeng-ios/yinmeng-ios/Main/Mew/Mine/View/MewMineCollectionViewController.m b/yinmeng-ios/yinmeng-ios/Main/Mew/Mine/View/MewMineCollectionViewController.m index 0ea8bd4..b0a9f53 100644 --- a/yinmeng-ios/yinmeng-ios/Main/Mew/Mine/View/MewMineCollectionViewController.m +++ b/yinmeng-ios/yinmeng-ios/Main/Mew/Mine/View/MewMineCollectionViewController.m @@ -9,7 +9,7 @@ #import "MewMineCollectionTableViewCell.h" #import "YMEmptyTableViewCell.h" /// Tool -#import "YMMacro.h" +#import "MewMacro.h" #import "MEWThemeColor.h" /// Third #import @@ -99,7 +99,7 @@ // 底部加载更多 - (void)mew_footerRefresh { if (self.hasNoMoreData) { - [self showErrorToast:@"没有更多收藏记录了"]; + [self mew_showErrorToast:@"没有更多收藏记录了"]; return; } diff --git a/yinmeng-ios/yinmeng-ios/Main/Mew/Mine/View/MewRechargeSubView.m b/yinmeng-ios/yinmeng-ios/Main/Mew/Mine/View/MewRechargeSubView.m index 1b0f53c..30d9777 100644 --- a/yinmeng-ios/yinmeng-ios/Main/Mew/Mine/View/MewRechargeSubView.m +++ b/yinmeng-ios/yinmeng-ios/Main/Mew/Mine/View/MewRechargeSubView.m @@ -14,8 +14,8 @@ #import /// 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]; } diff --git a/yinmeng-ios/yinmeng-ios/Main/Mew/Mine/View/MewRechargeViewController.m b/yinmeng-ios/yinmeng-ios/Main/Mew/Mine/View/MewRechargeViewController.m index cb49004..1a63f64 100644 --- a/yinmeng-ios/yinmeng-ios/Main/Mew/Mine/View/MewRechargeViewController.m +++ b/yinmeng-ios/yinmeng-ios/Main/Mew/Mine/View/MewRechargeViewController.m @@ -8,10 +8,10 @@ #import "MewRechargeViewController.h" /// View #import "MewRechargeSubView.h" -#import "YMWebViewController.h" +#import "MewWebViewController.h" /// Third #import -#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"]; diff --git a/yinmeng-ios/yinmeng-ios/Main/Mew/Party/Api/Api+MewParty.h b/yinmeng-ios/yinmeng-ios/Main/Mew/Party/Api/Api+MewParty.h new file mode 100644 index 0000000..827c4ba --- /dev/null +++ b/yinmeng-ios/yinmeng-ios/Main/Mew/Party/Api/Api+MewParty.h @@ -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 diff --git a/yinmeng-ios/yinmeng-ios/Main/Mew/Party/Api/Api+MewParty.m b/yinmeng-ios/yinmeng-ios/Main/Mew/Party/Api/Api+MewParty.m new file mode 100644 index 0000000..94e315a --- /dev/null +++ b/yinmeng-ios/yinmeng-ios/Main/Mew/Party/Api/Api+MewParty.m @@ -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 diff --git a/yinmeng-ios/yinmeng-ios/Main/Mew/Party/Api/Api+Party.h b/yinmeng-ios/yinmeng-ios/Main/Mew/Party/Api/Api+Party.h deleted file mode 100644 index 3d5a88d..0000000 --- a/yinmeng-ios/yinmeng-ios/Main/Mew/Party/Api/Api+Party.h +++ /dev/null @@ -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 diff --git a/yinmeng-ios/yinmeng-ios/Main/Mew/Party/Api/Api+Party.m b/yinmeng-ios/yinmeng-ios/Main/Mew/Party/Api/Api+Party.m deleted file mode 100644 index c7be5a0..0000000 --- a/yinmeng-ios/yinmeng-ios/Main/Mew/Party/Api/Api+Party.m +++ /dev/null @@ -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 diff --git a/yinmeng-ios/yinmeng-ios/Main/Mew/Party/Model/HomeRecommendRoomModel.m b/yinmeng-ios/yinmeng-ios/Main/Mew/Party/Model/HomeRecommendRoomModel.m deleted file mode 100644 index 4325a49..0000000 --- a/yinmeng-ios/yinmeng-ios/Main/Mew/Party/Model/HomeRecommendRoomModel.m +++ /dev/null @@ -1,17 +0,0 @@ -// -// HomeRecommendRoomModel.m -// mew-ios -// -// Created by 触海 on 2023/11/19. -// - -#import "HomeRecommendRoomModel.h" - - -@implementation HomePartyMicUserModel - -@end - -@implementation HomeRecommendRoomModel - -@end diff --git a/yinmeng-ios/yinmeng-ios/Main/Mew/Party/Model/HomeRecommendRoomModel.h b/yinmeng-ios/yinmeng-ios/Main/Mew/Party/Model/MewHomeRecommendRoomModel.h similarity index 78% rename from yinmeng-ios/yinmeng-ios/Main/Mew/Party/Model/HomeRecommendRoomModel.h rename to yinmeng-ios/yinmeng-ios/Main/Mew/Party/Model/MewHomeRecommendRoomModel.h index 30a8cbf..9403e2b 100644 --- a/yinmeng-ios/yinmeng-ios/Main/Mew/Party/Model/HomeRecommendRoomModel.h +++ b/yinmeng-ios/yinmeng-ios/Main/Mew/Party/Model/MewHomeRecommendRoomModel.h @@ -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 -#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 *micUsers; +@property (nonatomic, strong) NSArray *micUsers; @property (nonatomic, copy) NSString *erbanNo; @end + NS_ASSUME_NONNULL_END diff --git a/yinmeng-ios/yinmeng-ios/Main/Mew/Party/Model/MewHomeRecommendRoomModel.m b/yinmeng-ios/yinmeng-ios/Main/Mew/Party/Model/MewHomeRecommendRoomModel.m new file mode 100644 index 0000000..a160bd6 --- /dev/null +++ b/yinmeng-ios/yinmeng-ios/Main/Mew/Party/Model/MewHomeRecommendRoomModel.m @@ -0,0 +1,17 @@ +// +// MewMewHomeRecommendRoomModel.m +// yinmeng-ios +// +// Created by duoban on 2023/12/5. +// + +#import "MewHomeRecommendRoomModel.h" + + +@implementation MewHomePartyMicUserModel + +@end + +@implementation MewHomeRecommendRoomModel + +@end diff --git a/yinmeng-ios/yinmeng-ios/Main/Mew/Party/Presenter/MewPartyPresenter.m b/yinmeng-ios/yinmeng-ios/Main/Mew/Party/Presenter/MewPartyPresenter.m index 2e3a879..a3f9461 100644 --- a/yinmeng-ios/yinmeng-ios/Main/Mew/Party/Presenter/MewPartyPresenter.m +++ b/yinmeng-ios/yinmeng-ios/Main/Mew/Party/Presenter/MewPartyPresenter.m @@ -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]; diff --git a/yinmeng-ios/yinmeng-ios/Main/Mew/Party/View/MewPartyListCollectionViewCell.m b/yinmeng-ios/yinmeng-ios/Main/Mew/Party/View/MewPartyListCollectionViewCell.m index 2bc7d02..d7fc1ac 100644 --- a/yinmeng-ios/yinmeng-ios/Main/Mew/Party/View/MewPartyListCollectionViewCell.m +++ b/yinmeng-ios/yinmeng-ios/Main/Mew/Party/View/MewPartyListCollectionViewCell.m @@ -9,7 +9,7 @@ ///View #import "NetImageView.h" /// Tool -#import "YMMacro.h" +#import "MewMacro.h" #import "MEWThemeColor.h" /// Third #import diff --git a/yinmeng-ios/yinmeng-ios/Main/Mew/Party/View/MewPartyViewController.m b/yinmeng-ios/yinmeng-ios/Main/Mew/Party/View/MewPartyViewController.m index 02eb62a..5ffd71b 100644 --- a/yinmeng-ios/yinmeng-ios/Main/Mew/Party/View/MewPartyViewController.m +++ b/yinmeng-ios/yinmeng-ios/Main/Mew/Party/View/MewPartyViewController.m @@ -13,10 +13,10 @@ /// Third #import /// 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 *homeRecommendModels; +@property (nonatomic, strong) NSArray *homeRecommendModels; @end diff --git a/yinmeng-ios/yinmeng-ios/Main/Mew/Room/View/MewRoomViewController.m b/yinmeng-ios/yinmeng-ios/Main/Mew/Room/View/MewRoomViewController.m index 02f2678..893c472 100644 --- a/yinmeng-ios/yinmeng-ios/Main/Mew/Room/View/MewRoomViewController.m +++ b/yinmeng-ios/yinmeng-ios/Main/Mew/Room/View/MewRoomViewController.m @@ -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]; diff --git a/yinmeng-ios/yinmeng-ios/Main/Mew/Room/View/RoomHeaderView/MewRoomHeaderView.m b/yinmeng-ios/yinmeng-ios/Main/Mew/Room/View/RoomHeaderView/MewRoomHeaderView.m index 4758bf7..2629c77 100644 --- a/yinmeng-ios/yinmeng-ios/Main/Mew/Room/View/RoomHeaderView/MewRoomHeaderView.m +++ b/yinmeng-ios/yinmeng-ios/Main/Mew/Room/View/RoomHeaderView/MewRoomHeaderView.m @@ -6,7 +6,7 @@ // #import "MewRoomHeaderView.h" -#import "YMMacro.h" +#import "MewMacro.h" #import #import "MEWThemeColor.h" #import "AccountInfoStorage.h" diff --git a/yinmeng-ios/yinmeng-ios/Main/Mew/Room/View/RoomMessageView/MewRoomMessageTableCell.m b/yinmeng-ios/yinmeng-ios/Main/Mew/Room/View/RoomMessageView/MewRoomMessageTableCell.m index d3365ec..a8b621b 100644 --- a/yinmeng-ios/yinmeng-ios/Main/Mew/Room/View/RoomMessageView/MewRoomMessageTableCell.m +++ b/yinmeng-ios/yinmeng-ios/Main/Mew/Room/View/RoomMessageView/MewRoomMessageTableCell.m @@ -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 #import #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; diff --git a/yinmeng-ios/yinmeng-ios/Main/Mew/Room/View/RoomStageView/MewSocialStageView.m b/yinmeng-ios/yinmeng-ios/Main/Mew/Room/View/RoomStageView/MewSocialStageView.m index c9a8df3..1360670 100644 --- a/yinmeng-ios/yinmeng-ios/Main/Mew/Room/View/RoomStageView/MewSocialStageView.m +++ b/yinmeng-ios/yinmeng-ios/Main/Mew/Room/View/RoomStageView/MewSocialStageView.m @@ -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" diff --git a/yinmeng-ios/yinmeng-ios/Main/YMWebViewController.h b/yinmeng-ios/yinmeng-ios/Main/MewWebViewController.h similarity index 53% rename from yinmeng-ios/yinmeng-ios/Main/YMWebViewController.h rename to yinmeng-ios/yinmeng-ios/Main/MewWebViewController.h index 7dadcf5..13e6969 100644 --- a/yinmeng-ios/yinmeng-ios/Main/YMWebViewController.h +++ b/yinmeng-ios/yinmeng-ios/Main/MewWebViewController.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 - 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 diff --git a/yinmeng-ios/yinmeng-ios/Main/YMWebViewController.m b/yinmeng-ios/yinmeng-ios/Main/MewWebViewController.m similarity index 91% rename from yinmeng-ios/yinmeng-ios/Main/YMWebViewController.m rename to yinmeng-ios/yinmeng-ios/Main/MewWebViewController.m index cb6f7da..20525b1 100644 --- a/yinmeng-ios/yinmeng-ios/Main/YMWebViewController.m +++ b/yinmeng-ios/yinmeng-ios/Main/MewWebViewController.m @@ -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 #import -@interface WeakWebViewScriptMessageDelegate : NSObject +@interface MewWeakWebViewScriptMessageDelegate : NSObject //WKScriptMessageHandler 这个协议类专门用来处理JavaScript调用原生OC的方法 @property (nonatomic, weak) id scriptDelegate; @@ -33,7 +33,7 @@ - (instancetype)initWithDelegate:(id)scriptDelegate; @end -@implementation WeakWebViewScriptMessageDelegate +@implementation MewWeakWebViewScriptMessageDelegate - (instancetype)initWithDelegate:(id)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 () +@interface MewWebViewController () @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]; diff --git a/yinmeng-ios/yinmeng-ios/Main/Tabbar/Presenter/MainPresenter.h b/yinmeng-ios/yinmeng-ios/Main/Tabbar/Presenter/MainPresenter.h index 405d28c..b681d3d 100644 --- a/yinmeng-ios/yinmeng-ios/Main/Tabbar/Presenter/MainPresenter.h +++ b/yinmeng-ios/yinmeng-ios/Main/Tabbar/Presenter/MainPresenter.h @@ -12,15 +12,15 @@ NS_ASSUME_NONNULL_BEGIN @interface MainPresenter : BaseMvpPresenter /// 获取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 diff --git a/yinmeng-ios/yinmeng-ios/Main/Tabbar/Presenter/MainPresenter.m b/yinmeng-ios/yinmeng-ios/Main/Tabbar/Presenter/MainPresenter.m index fd9b08a..f71e0e4 100644 --- a/yinmeng-ios/yinmeng-ios/Main/Tabbar/Presenter/MainPresenter.m +++ b/yinmeng-ios/yinmeng-ios/Main/Tabbar/Presenter/MainPresenter.m @@ -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 #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 { } diff --git a/yinmeng-ios/yinmeng-ios/Main/Tabbar/Protocol/MainProtocol.h b/yinmeng-ios/yinmeng-ios/Main/Tabbar/Protocol/MainProtocol.h index 6cebf07..3acffa3 100644 --- a/yinmeng-ios/yinmeng-ios/Main/Tabbar/Protocol/MainProtocol.h +++ b/yinmeng-ios/yinmeng-ios/Main/Tabbar/Protocol/MainProtocol.h @@ -14,11 +14,11 @@ NS_ASSUME_NONNULL_BEGIN @protocol MainProtocol /// 登录成功 -- (void)autoLoginSuccess; +- (void)mew_autoLoginSuccess; /// 获取用户信息成功 - (void)mew_getUserInfoSuccess:(UserInfoModel *)userInfo; ///获取更新版本信息成功 -//- (void)getVersionUpdate:(XPVersionUpdateModel *)versionModel; +//- (void)mew_getVersionUpdate:(XPVersionUpdateModel *)versionModel; @end diff --git a/yinmeng-ios/yinmeng-ios/Main/Tabbar/View/MewTabBarController.h b/yinmeng-ios/yinmeng-ios/Main/Tabbar/View/MewTabBarController.h new file mode 100644 index 0000000..dd7fe68 --- /dev/null +++ b/yinmeng-ios/yinmeng-ios/Main/Tabbar/View/MewTabBarController.h @@ -0,0 +1,16 @@ +// +// MewTabBarController.h +// yinmeng-ios +// +// Created by duoban on 2023/12/5. +// + +#import + +NS_ASSUME_NONNULL_BEGIN + +@interface MewTabBarController : UITabBarController + +@end + +NS_ASSUME_NONNULL_END diff --git a/yinmeng-ios/yinmeng-ios/Main/Tabbar/View/TabbarViewController.m b/yinmeng-ios/yinmeng-ios/Main/Tabbar/View/MewTabBarController.m similarity index 60% rename from yinmeng-ios/yinmeng-ios/Main/Tabbar/View/TabbarViewController.m rename to yinmeng-ios/yinmeng-ios/Main/Tabbar/View/MewTabBarController.m index 95166ed..44879bd 100644 --- a/yinmeng-ios/yinmeng-ios/Main/Tabbar/View/TabbarViewController.m +++ b/yinmeng-ios/yinmeng-ios/Main/Tabbar/View/MewTabBarController.m @@ -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 #import ///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 diff --git a/yinmeng-ios/yinmeng-ios/Main/Tabbar/View/TabbarViewController.h b/yinmeng-ios/yinmeng-ios/Main/Tabbar/View/TabbarViewController.h deleted file mode 100644 index 25e440c..0000000 --- a/yinmeng-ios/yinmeng-ios/Main/Tabbar/View/TabbarViewController.h +++ /dev/null @@ -1,16 +0,0 @@ -// -// TabbarViewController.h -// mew-ios -// -// Created by 触海 on 2023/11/6. -// - -#import - -NS_ASSUME_NONNULL_BEGIN - -@interface TabbarViewController : UITabBarController - -@end - -NS_ASSUME_NONNULL_END diff --git a/yinmeng-ios/yinmeng-ios/Main/YinMeng/Login/Api/Api+Login.h b/yinmeng-ios/yinmeng-ios/Main/YinMeng/Login/Api/Api+Login.h index 393f61f..80178d9 100644 --- a/yinmeng-ios/yinmeng-ios/Main/YinMeng/Login/Api/Api+Login.h +++ b/yinmeng-ios/yinmeng-ios/Main/YinMeng/Login/Api/Api+Login.h @@ -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; diff --git a/yinmeng-ios/yinmeng-ios/Main/YinMeng/Login/Presenter/LoginPresenter.h b/yinmeng-ios/yinmeng-ios/Main/YinMeng/Login/Presenter/LoginPresenter.h index 99abb97..b09601b 100644 --- a/yinmeng-ios/yinmeng-ios/Main/YinMeng/Login/Presenter/LoginPresenter.h +++ b/yinmeng-ios/yinmeng-ios/Main/YinMeng/Login/Presenter/LoginPresenter.h @@ -6,7 +6,7 @@ // #import "BaseMvpPresenter.h" -#import "YMEnum.h" +#import "MewEnum.h" NS_ASSUME_NONNULL_BEGIN diff --git a/yinmeng-ios/yinmeng-ios/Main/YinMeng/Login/Presenter/MewLoginForgetPasswordPresent.h b/yinmeng-ios/yinmeng-ios/Main/YinMeng/Login/Presenter/MewLoginForgetPasswordPresent.h index 3acdbe7..4f77c87 100644 --- a/yinmeng-ios/yinmeng-ios/Main/YinMeng/Login/Presenter/MewLoginForgetPasswordPresent.h +++ b/yinmeng-ios/yinmeng-ios/Main/YinMeng/Login/Presenter/MewLoginForgetPasswordPresent.h @@ -6,7 +6,7 @@ // #import "BaseMvpPresenter.h" -#import "YMEnum.h" +#import "MewEnum.h" NS_ASSUME_NONNULL_BEGIN diff --git a/yinmeng-ios/yinmeng-ios/Main/YinMeng/Login/Presenter/MewLoginForgetPasswordPresent.m b/yinmeng-ios/yinmeng-ios/Main/YinMeng/Login/Presenter/MewLoginForgetPasswordPresent.m index 6cf69a9..3054b74 100644 --- a/yinmeng-ios/yinmeng-ios/Main/YinMeng/Login/Presenter/MewLoginForgetPasswordPresent.m +++ b/yinmeng-ios/yinmeng-ios/Main/YinMeng/Login/Presenter/MewLoginForgetPasswordPresent.m @@ -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)getView { - return (id)[super getView]; +@implementation LoginForgetPasswordPresent +- (id)getView { + return (id)[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 diff --git a/yinmeng-ios/yinmeng-ios/Main/YinMeng/Login/Presenter/MewLoginFullInfoPresenter.m b/yinmeng-ios/yinmeng-ios/Main/YinMeng/Login/Presenter/MewLoginFullInfoPresenter.m index 55f9a56..7c4e746 100644 --- a/yinmeng-ios/yinmeng-ios/Main/YinMeng/Login/Presenter/MewLoginFullInfoPresenter.m +++ b/yinmeng-ios/yinmeng-ios/Main/YinMeng/Login/Presenter/MewLoginFullInfoPresenter.m @@ -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)getView { - return (id)[super getView]; +- (id)getView { + return (id)[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]; } diff --git a/yinmeng-ios/yinmeng-ios/Main/YinMeng/Login/Presenter/MewLoginPasswordPresent.m b/yinmeng-ios/yinmeng-ios/Main/YinMeng/Login/Presenter/MewLoginPasswordPresent.m index 8545d6f..700ab5a 100644 --- a/yinmeng-ios/yinmeng-ios/Main/YinMeng/Login/Presenter/MewLoginPasswordPresent.m +++ b/yinmeng-ios/yinmeng-ios/Main/YinMeng/Login/Presenter/MewLoginPasswordPresent.m @@ -10,7 +10,7 @@ ///Tool #import "AccountInfoStorage.h" #import "DESEncrypt.h" -#import "YMConstant.h" +#import "MewConstant.h" ///Model #import "AccountModel.h" ///Protocol @@ -33,6 +33,6 @@ [[self getView] mew_phoneAndPasswordLoginSuccess]; } fail:^(NSInteger code, NSString * _Nullable msg) { [[self getView] mew_phoneAndPasswordLoginFail:msg]; - } showLoading:YES] phone:desPhone password:desPassword client_secret:@"uyzjdhds" version:@"1" client_id:@"erban-client" grant_type:@"password"]; + } mew_showLoading:YES] phone:desPhone password:desPassword client_secret:@"uyzjdhds" version:@"1" client_id:@"erban-client" grant_type:@"password"]; } @end diff --git a/yinmeng-ios/yinmeng-ios/Main/YinMeng/Login/Presenter/MewLoginPresenter.m b/yinmeng-ios/yinmeng-ios/Main/YinMeng/Login/Presenter/MewLoginPresenter.m index 2e41f7b..069f72f 100644 --- a/yinmeng-ios/yinmeng-ios/Main/YinMeng/Login/Presenter/MewLoginPresenter.m +++ b/yinmeng-ios/yinmeng-ios/Main/YinMeng/Login/Presenter/MewLoginPresenter.m @@ -40,7 +40,7 @@ } fail:^(NSInteger code, NSString * _Nullable msg) { - } showLoading:YES] openid:token unionid:unionId access_token:token type:@"5"]; + } mew_showLoading:YES] openid:token unionid:unionId access_token:token type:@"5"]; } diff --git a/yinmeng-ios/yinmeng-ios/Main/YinMeng/Login/Presenter/MewLoginVerifBindPhonePresenter.h b/yinmeng-ios/yinmeng-ios/Main/YinMeng/Login/Presenter/MewLoginVerifBindPhonePresenter.h index ce67dd9..758c43f 100644 --- a/yinmeng-ios/yinmeng-ios/Main/YinMeng/Login/Presenter/MewLoginVerifBindPhonePresenter.h +++ b/yinmeng-ios/yinmeng-ios/Main/YinMeng/Login/Presenter/MewLoginVerifBindPhonePresenter.h @@ -6,7 +6,7 @@ // #import "MainPresenter.h" -#import "YMEnum.h" +#import "MewEnum.h" NS_ASSUME_NONNULL_BEGIN diff --git a/yinmeng-ios/yinmeng-ios/Main/YinMeng/Login/Presenter/MewLoginVerifBindPhonePresenter.m b/yinmeng-ios/yinmeng-ios/Main/YinMeng/Login/Presenter/MewLoginVerifBindPhonePresenter.m index e658f8c..a4728e2 100644 --- a/yinmeng-ios/yinmeng-ios/Main/YinMeng/Login/Presenter/MewLoginVerifBindPhonePresenter.m +++ b/yinmeng-ios/yinmeng-ios/Main/YinMeng/Login/Presenter/MewLoginVerifBindPhonePresenter.m @@ -10,7 +10,7 @@ ///Tool #import "AccountInfoStorage.h" #import "DESEncrypt.h" -#import "YMConstant.h" +#import "MewConstant.h" ///P #import "MewLoginVerifBindPhoneProtocol.h" diff --git a/yinmeng-ios/yinmeng-ios/Main/YinMeng/Login/Presenter/MewLoginVerifCodePresent.h b/yinmeng-ios/yinmeng-ios/Main/YinMeng/Login/Presenter/MewLoginVerifCodePresent.h index 40df63d..099e7eb 100644 --- a/yinmeng-ios/yinmeng-ios/Main/YinMeng/Login/Presenter/MewLoginVerifCodePresent.h +++ b/yinmeng-ios/yinmeng-ios/Main/YinMeng/Login/Presenter/MewLoginVerifCodePresent.h @@ -6,7 +6,7 @@ // #import "BaseMvpPresenter.h" -#import "YMEnum.h" +#import "MewEnum.h" NS_ASSUME_NONNULL_BEGIN diff --git a/yinmeng-ios/yinmeng-ios/Main/YinMeng/Login/Presenter/MewLoginVerifCodePresent.m b/yinmeng-ios/yinmeng-ios/Main/YinMeng/Login/Presenter/MewLoginVerifCodePresent.m index 019170c..43475a3 100644 --- a/yinmeng-ios/yinmeng-ios/Main/YinMeng/Login/Presenter/MewLoginVerifCodePresent.m +++ b/yinmeng-ios/yinmeng-ios/Main/YinMeng/Login/Presenter/MewLoginVerifCodePresent.m @@ -10,7 +10,7 @@ #import "AccountInfoStorage.h" #import "Api+Login.h" #import "DESEncrypt.h" -#import "YMConstant.h" +#import "MewConstant.h" ///Protocol #import "MewLoginVerifCodeProtocol.h" ///Model @@ -47,7 +47,7 @@ } [[self getView] mew_loginWithPhoneSuccess]; - } showLoading:YES] phone:desPhone code:code client_secret:@"uyzjdhds" version:@"1" client_id:@"erban-client" grant_type:@"password"]; + } mew_showLoading:YES] phone:desPhone code:code client_secret:@"uyzjdhds" version:@"1" client_id:@"erban-client" grant_type:@"password"]; } @@ -59,7 +59,7 @@ NSString * desPhone = [DESEncrypt encryptUseDES:phone key:KeyWithType(KeyType_PasswordEncode)]; [Api Mew_BindMoblieCode:[self createHttpCompletion:^(BaseModel * _Nonnull data) { [[self getView] mew_bindWithPhoneSuccess]; - } showLoading:YES] phone:desPhone code:code ticket:ticket]; + } mew_showLoading:YES] phone:desPhone code:code ticket:ticket]; } diff --git a/yinmeng-ios/yinmeng-ios/Main/YinMeng/Login/Presenter/MineLoginPasswordPresenter.m b/yinmeng-ios/yinmeng-ios/Main/YinMeng/Login/Presenter/MineLoginPasswordPresenter.m index 0292006..9e162f6 100644 --- a/yinmeng-ios/yinmeng-ios/Main/YinMeng/Login/Presenter/MineLoginPasswordPresenter.m +++ b/yinmeng-ios/yinmeng-ios/Main/YinMeng/Login/Presenter/MineLoginPasswordPresenter.m @@ -8,7 +8,7 @@ #import "MineLoginPasswordPresenter.h" #import "Api+Mine.h" #import "DESEncrypt.h" -#import "YMConstant.h" +#import "MewConstant.h" #import "MineLoginPasswordProtocol.h" @implementation MineLoginPasswordPresenter @@ -20,9 +20,11 @@ - (void)mew_setLoginPassword:(NSString *)phone newPwd:(NSString *)newPwd { NSString * desNewPwd = [DESEncrypt encryptUseDES:newPwd key:KeyWithType(KeyType_PasswordEncode)]; NSString * desPhone = [DESEncrypt encryptUseDES:phone key:KeyWithType(KeyType_PasswordEncode)]; + [Api Mew_SetLoingPassword:[self createHttpCompletion:^(BaseModel * _Nonnull data) { - [[self getView] mew_setLoginPasswordSuccess]; - } showLoading:YES] phone:desPhone newPwd:desNewPwd]; + [[self getView] setLoginPasswordSuccess]; + } mew_showLoading:YES] phone:desPhone newPwd:desNewPwd]; + } diff --git a/yinmeng-ios/yinmeng-ios/Main/YinMeng/Login/View/LoginBindPhoneResultViewController.h b/yinmeng-ios/yinmeng-ios/Main/YinMeng/Login/View/LoginBindPhoneResultViewController.h new file mode 100644 index 0000000..e092932 --- /dev/null +++ b/yinmeng-ios/yinmeng-ios/Main/YinMeng/Login/View/LoginBindPhoneResultViewController.h @@ -0,0 +1,16 @@ +// +// LoginBindPhoneResultViewController.h +// yinmeng-ios +// +// Created by 触海 on 2023/11/22. +// + +#import "MewBaseViewController.h" +@class UserInfoModel; +NS_ASSUME_NONNULL_BEGIN + +@interface LoginBindPhoneResultViewController : MewBaseViewController +@property (nonatomic, strong) UserInfoModel *userInfo; +@end + +NS_ASSUME_NONNULL_END diff --git a/yinmeng-ios/yinmeng-ios/Main/YinMeng/Login/View/LoginBindPhoneResultViewController.m b/yinmeng-ios/yinmeng-ios/Main/YinMeng/Login/View/LoginBindPhoneResultViewController.m index 1ed6f3d..abd6dfa 100644 --- a/yinmeng-ios/yinmeng-ios/Main/YinMeng/Login/View/LoginBindPhoneResultViewController.m +++ b/yinmeng-ios/yinmeng-ios/Main/YinMeng/Login/View/LoginBindPhoneResultViewController.m @@ -11,7 +11,7 @@ #import ///Tool #import "MEWThemeColor.h" -#import "UIImage+Utils.h" +#import "UIImage+MewUtils.h" ///Model #import "UserInfoModel.h" @@ -131,7 +131,7 @@ [_changePhoneBtn setTitle:@"更改手机号码" forState:UIControlStateNormal]; [_changePhoneBtn setTitleColor:[MEWThemeColor mewConfirmButtonTextColor] forState:UIControlStateNormal]; [_changePhoneBtn.titleLabel setFont:[UIFont fontWithName:@"PingFang-SC-Medium" size:18]]; - [_changePhoneBtn setBackgroundImage:[UIImage gradientColorImageFromColors:@[[MEWThemeColor mewConfirmButtonGradientStartColor], [MEWThemeColor mewConfirmButtonGradientEndColor]] gradientType:GradientTypeLeftToRight imgSize:CGSizeMake(10, 10)] forState:UIControlStateNormal]; + [_changePhoneBtn setBackgroundImage:[UIImage mew_gradientColorImageFromColors:@[[MEWThemeColor mewConfirmButtonGradientStartColor], [MEWThemeColor mewConfirmButtonGradientEndColor]] gradientType:MewGradientTypeLeftToRight imgSize:CGSizeMake(10, 10)] forState:UIControlStateNormal]; _changePhoneBtn.layer.masksToBounds = YES; _changePhoneBtn.layer.cornerRadius = 22.5; [_changePhoneBtn addTarget:self action:@selector(changePhoneBtnAction:) forControlEvents:UIControlEventTouchUpInside]; diff --git a/yinmeng-ios/yinmeng-ios/Main/YinMeng/Login/View/MewLoginBindPhoneViewController.m b/yinmeng-ios/yinmeng-ios/Main/YinMeng/Login/View/MewLoginBindPhoneViewController.m index 9f59444..efe8a95 100644 --- a/yinmeng-ios/yinmeng-ios/Main/YinMeng/Login/View/MewLoginBindPhoneViewController.m +++ b/yinmeng-ios/yinmeng-ios/Main/YinMeng/Login/View/MewLoginBindPhoneViewController.m @@ -1,25 +1,25 @@ // -// MewLoginBindPhoneViewController.m +// LoginBindPhoneViewController.m // yinmeng-ios // // Created by 触海 on 2023/11/22. // -#import "MewLoginBindPhoneViewController.h" +#import "LoginBindPhoneViewController.h" ///Third #import #import ///Tool -#import "YMMacro.h" +#import "MewMacro.h" #import "MEWThemeColor.h" //#import "NSString+Utils.h" ///Tool -#import "MewLoginBindPhonePresent.h" +#import "LoginBindPhonePresent.h" ///VC //#import "LoginVerifCodeViewController.h" -@interface MewLoginBindPhoneViewController () +@interface LoginBindPhoneViewController () ///提示Label @property (nonatomic, strong) UILabel *titleLabel; /// 手机号输入框背景 @@ -34,13 +34,13 @@ @property (nonatomic,strong) UIButton *backButton; @end -@implementation MewLoginBindPhoneViewController +@implementation LoginBindPhoneViewController - (BOOL)mew_isHiddenNavBar { return YES; } #pragma mark - life cycle -- (MewLoginBindPhonePresent *)createPresenter { - return [[MewLoginBindPhonePresent alloc] init]; +- (LoginBindPhonePresent *)createPresenter { + return [[LoginBindPhonePresent alloc] init]; } - (void)viewDidLoad { @@ -50,7 +50,7 @@ } - (void)viewDidAppear:(BOOL)animated { - [self showErrorToast:@"第三方登录需绑定手机号喔~"]; + [self mew_showErrorToast:@"第三方登录需绑定手机号喔~"]; } - (void)setUpUI { @@ -115,6 +115,33 @@ self.loginBtn.enabled = [enable boolValue]; }]; + +// [[[[self.loginBtn rac_signalForControlEvents:UIControlEventTouchUpInside] doNext:^(id x) { +// @strongify(self) +// self.loginBtn.enabled = NO; +// }] flattenMap:^id (id value) { +// return [RACSignal createSignal:^RACDisposable *(id subscriber) { +// if (!self.phoneTextField.text.isPhoneNumber) { +// [self mew_showErrorToast:@"手机格式不正确"]; +// [subscriber sendNext:@(NO)]; +// }else { +// [subscriber sendNext:@(YES)]; +// } +// [subscriber sendCompleted]; +// return nil; +// }]; +// }] subscribeNext:^(NSNumber *signedIn) { +// @strongify(self) +// self.loginBtn.enabled = YES; +// BOOL success = [signedIn boolValue]; +// if (success) { +// //跳转去验证码页面 +// LoginVerifCodeViewController *codeVC = [[LoginVerifCodeViewController alloc] init]; +// codeVC.phone = self.phoneTextField.text; +// codeVC.type = VerifCodeType_BindPhone; +// [self.navigationController pushViewController:codeVC animated:YES]; +// } +// }]; } #pragma mark - Event Response @@ -186,7 +213,7 @@ _backButton = [UIButton buttonWithType:UIButtonTypeCustom]; [_backButton setImage:[UIImage imageNamed:@"common_nav_back"] forState:UIControlStateNormal]; [_backButton setImage:[UIImage imageNamed:@"common_nav_back"] forState:UIControlStateSelected]; -// [_backButton setEnlargeEdgeWithTop:15 right:15 bottom:15 left:15]; +// [_backButton mew_setEnlargeEdgeWithTop:15 right:15 bottom:15 left:15]; [_backButton addTarget:self action:@selector(mew_backButtonAction:) forControlEvents:UIControlEventTouchUpInside]; } return _backButton; diff --git a/yinmeng-ios/yinmeng-ios/Main/YinMeng/Login/View/MewLoginForgetPasswordViewController.m b/yinmeng-ios/yinmeng-ios/Main/YinMeng/Login/View/MewLoginForgetPasswordViewController.m index 7b680e0..018fcbe 100644 --- a/yinmeng-ios/yinmeng-ios/Main/YinMeng/Login/View/MewLoginForgetPasswordViewController.m +++ b/yinmeng-ios/yinmeng-ios/Main/YinMeng/Login/View/MewLoginForgetPasswordViewController.m @@ -17,8 +17,8 @@ ///Tool #import "MEWThemeColor.h" #import "MEWCountDownHelper.h" -#import "YMMacro.h" -#import "UIImage+Utils.h" +#import "MewMacro.h" +#import "UIImage+MewUtils.h" @interface MewLoginForgetPasswordViewController () @@ -71,13 +71,13 @@ ///请求手机号的验证码成功 - (void)mew_phoneSmsCodeSuccess { self.codeView.authCodeButton.enabled= NO; - [self showSuccessToast:@"验证码发送成功"]; + [self mew_showSuccessToast:@"验证码发送成功"]; [[MEWCountDownHelper shareHelper] mewOpenCountdownWithTime:60]; } ///重置密码成功 - (void)mew_resetPasswrodSuccess { [[MEWCountDownHelper shareHelper] mewStopCountDown]; - [self showSuccessToast:@"重置密码成功"]; + [self mew_showSuccessToast:@"重置密码成功"]; [self.navigationController popViewControllerAnimated:YES]; } @@ -98,7 +98,7 @@ - (void)mew_authCodeButtonAction:(UIButton *)sender { if (self.phoneView.textField.text.length != 11) { - [self showErrorToast:@"请输入正确的手机号码"]; + [self mew_showErrorToast:@"请输入正确的手机号码"]; } else { [self.presenter mew_phoneSmsCode:self.phoneView.textField.text type:GetSmsType_Reset_Password]; } @@ -202,7 +202,7 @@ [_finishButton setImage:[UIImage imageNamed:@"mew_login_next"] forState:UIControlStateNormal]; _finishButton.titleLabel.font = [UIFont fontWithName:@"PingFang-SC-Medium" size:18]; [_finishButton 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)]; _finishButton.backgroundColor = [UIColor colorWithPatternImage:image]; [_finishButton addTarget:self action:@selector(mew_finishButtonAction:) forControlEvents:UIControlEventTouchUpInside]; } diff --git a/yinmeng-ios/yinmeng-ios/Main/YinMeng/Login/View/MewLoginFullInfoViewController.m b/yinmeng-ios/yinmeng-ios/Main/YinMeng/Login/View/MewLoginFullInfoViewController.m index 7effe3b..f71dc0b 100644 --- a/yinmeng-ios/yinmeng-ios/Main/YinMeng/Login/View/MewLoginFullInfoViewController.m +++ b/yinmeng-ios/yinmeng-ios/Main/YinMeng/Login/View/MewLoginFullInfoViewController.m @@ -11,9 +11,9 @@ #import ///Tool #import "MEWThemeColor.h" -#import "YMMacro.h" +#import "MewMacro.h" #import "AccountInfoStorage.h" -#import "UIImage+Utils.h" +#import "UIImage+MewUtils.h" #import "MewHUDTool.h" #import "NewEncryptTool.h" ///Model @@ -313,7 +313,7 @@ _nextButton.layer.cornerRadius = 52/2.f; [_nextButton setImage:[UIImage imageNamed:@"mew_login_next"] forState:UIControlStateNormal]; _nextButton.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)]; _nextButton.backgroundColor = [UIColor colorWithPatternImage:image]; [_nextButton addTarget:self action:@selector(mew_nextButtonAction) forControlEvents:UIControlEventTouchUpInside]; } diff --git a/yinmeng-ios/yinmeng-ios/Main/YinMeng/Login/View/MewLoginVerifBindPhoneViewController.m b/yinmeng-ios/yinmeng-ios/Main/YinMeng/Login/View/MewLoginVerifBindPhoneViewController.m index cae3682..0a9706b 100644 --- a/yinmeng-ios/yinmeng-ios/Main/YinMeng/Login/View/MewLoginVerifBindPhoneViewController.m +++ b/yinmeng-ios/yinmeng-ios/Main/YinMeng/Login/View/MewLoginVerifBindPhoneViewController.m @@ -11,9 +11,9 @@ #import ///Tool #import "MEWThemeColor.h" -#import "YMConstant.h" -#import "YMMacro.h" -#import "UIImage+Utils.h" +#import "MewConstant.h" +#import "MewMacro.h" +#import "UIImage+MewUtils.h" #import "MewHUDTool.h" #import "MEWCountDownHelper.h" ///Model @@ -193,10 +193,10 @@ [[[self.authCodeBtn rac_signalForControlEvents:UIControlEventTouchUpInside] filter:^BOOL(__kindof UIControl * _Nullable value) { // 获取验证码 if (self.phoneNumTextField.text.length == 0) { - [self showErrorToast:@"手机号码不能为空"]; + [self mew_showErrorToast:@"手机号码不能为空"]; return NO; }else if (self.phoneNumTextField.text.length < 11) { - [self showErrorToast:@"请输入正确手机号码"]; + [self mew_showErrorToast:@"请输入正确手机号码"]; return NO; }else { return YES; @@ -212,10 +212,10 @@ @strongify(self) // 确认绑定手机号 if (self.phoneNumTextField.text.length == 0) { - [self showErrorToast:@"手机号码不能为空"]; + [self mew_showErrorToast:@"手机号码不能为空"]; return NO; }else if (self.authCodeTextField.text.length == 0) { - [self showErrorToast:@"验证码不能为空"]; + [self mew_showErrorToast:@"验证码不能为空"]; return NO; }else { return YES; @@ -241,12 +241,13 @@ #pragma mark - MewLoginVerifBindPhoneProtocol - (void)mew_phoneSmsCodeSuccess { self.authCodeBtn.enabled = NO; - [self showSuccessToast:@"验证码发送成功"]; + [self mew_showSuccessToast:@"验证码发送成功"]; [[MEWCountDownHelper shareHelper] mewOpenCountdownWithTime:60]; } + - (void)mew_checkMoblieCodeWithMoblieSuccess { - [self showSuccessToast:@"验证成功"]; + [self mew_showSuccessToast:@"验证成功"]; [[MEWCountDownHelper shareHelper] mewStopCountDown]; } @@ -330,7 +331,7 @@ _confirmBtn.layer.cornerRadius = 52/2.f; _confirmBtn.layer.masksToBounds = YES; _confirmBtn.enabled = NO; - 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)]; _confirmBtn.backgroundColor = [UIColor colorWithPatternImage:image]; } return _confirmBtn; diff --git a/yinmeng-ios/yinmeng-ios/Main/YinMeng/Login/View/MewMineLoginPasswordViewController.m b/yinmeng-ios/yinmeng-ios/Main/YinMeng/Login/View/MewMineLoginPasswordViewController.m index 7b5b0f5..9b2cc7a 100644 --- a/yinmeng-ios/yinmeng-ios/Main/YinMeng/Login/View/MewMineLoginPasswordViewController.m +++ b/yinmeng-ios/yinmeng-ios/Main/YinMeng/Login/View/MewMineLoginPasswordViewController.m @@ -13,9 +13,9 @@ #import ///Tool #import "MEWThemeColor.h" -#import "UIButton+EnlargeTouchArea.h" -#import "UIImage+Utils.h" -#import "YMMacro.h" +#import "UIButton+MewEnlargeTouchArea.h" +#import "UIImage+MewUtils.h" +#import "MewMacro.h" ///Model #import "UserInfoModel.h" ///P @@ -115,14 +115,15 @@ }]; } -#pragma mark - MineMewLoginPasswordProtocol + +#pragma mark - XPMineLoginPasswordProtocol - (void)mew_setLoginPasswordSuccess { - [self showSuccessToast:@"设置成功"]; + [self mew_showSuccessToast:@"设置成功"]; [self.navigationController popViewControllerAnimated:YES]; } - (void)mew_modifyLoginPasswordSuccess { - [self showSuccessToast:@"修改成功"]; + [self mew_showSuccessToast:@"修改成功"]; [self.navigationController popViewControllerAnimated:YES]; } @@ -135,7 +136,7 @@ - (void)mew_submitButtonAction:(UIButton *)sender { if (![self.newsPwdView.contentTextField.text isEqualToString:self.checkPwdView.contentTextField.text]) { - [self showErrorToast:@"两次输入的新密码不一致哦"]; + [self mew_showErrorToast:@"两次输入的新密码不一致哦"]; return; } if (self.isModifiPwd) { @@ -248,7 +249,7 @@ _submitButton.layer.masksToBounds = YES; _submitButton.layer.cornerRadius = 52/2; _submitButton.enabled = YES; - 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)]; _submitButton.backgroundColor = [UIColor colorWithPatternImage:image]; [_submitButton addTarget:self action:@selector(mew_submitButtonAction:) forControlEvents:UIControlEventTouchUpInside]; } @@ -258,7 +259,7 @@ - (UIButton *)forgetButton { if (!_forgetButton) { _forgetButton = [UIButton buttonWithType:UIButtonTypeCustom]; - [_forgetButton setEnlargeEdgeWithTop:5 right:5 bottom:5 left:5]; + [_forgetButton mew_setEnlargeEdgeWithTop:5 right:5 bottom:5 left:5]; [_forgetButton setTitleColor:UIColor.whiteColor forState:UIControlStateNormal]; [_forgetButton setTitle:@"忘记密码?" forState:UIControlStateNormal]; _forgetButton.titleLabel.font = [UIFont systemFontOfSize:13]; diff --git a/yinmeng-ios/yinmeng-ios/Main/YinMeng/Message/Api/Api+Message.h b/yinmeng-ios/yinmeng-ios/Main/YinMeng/Message/Api/Api+Message.h index 4200b6f..e7af8b0 100644 --- a/yinmeng-ios/yinmeng-ios/Main/YinMeng/Message/Api/Api+Message.h +++ b/yinmeng-ios/yinmeng-ios/Main/YinMeng/Message/Api/Api+Message.h @@ -10,7 +10,7 @@ NS_ASSUME_NONNULL_BEGIN @interface Api (Message) -+ (void)Mew_GetChatLimit:(HttpRequestHelperCompletion)complection receiverUid:(NSString *)receiverUid; ++ (void)Mew_GetChatLimit:(MewHttpRequestHelperCompletion)complection receiverUid:(NSString *)receiverUid; @end NS_ASSUME_NONNULL_END diff --git a/yinmeng-ios/yinmeng-ios/Main/YinMeng/Message/Api/Api+Message.m b/yinmeng-ios/yinmeng-ios/Main/YinMeng/Message/Api/Api+Message.m index 9cd8d4c..1566ca3 100644 --- a/yinmeng-ios/yinmeng-ios/Main/YinMeng/Message/Api/Api+Message.m +++ b/yinmeng-ios/yinmeng-ios/Main/YinMeng/Message/Api/Api+Message.m @@ -8,9 +8,9 @@ #import "Api+Message.h" #import "NewEncryptTool.h" @implementation Api (Message) -+ (void)Mew_GetChatLimit:(HttpRequestHelperCompletion)complection receiverUid:(NSString *)receiverUid { ++ (void)Mew_GetChatLimit:(MewHttpRequestHelperCompletion)complection receiverUid:(NSString *)receiverUid { NSString *getUrl = [NewEncryptTool MEW_aesDecrypt:@"ml84Zo9PhMJ69iyUKDccSccouVGFyLv2OiwzJUi0qGI="];///privateChat/limit - [self makeRequest:getUrl method:HttpRequestHelperMethodGET completion:complection, __FUNCTION__, receiverUid,nil]; + [self makeRequest:getUrl method:MewHttpRequestHelperMethodGET completion:complection, __FUNCTION__, receiverUid,nil]; } diff --git a/yinmeng-ios/yinmeng-ios/Main/YinMeng/Message/Presenter/MewMessagePresenter.m b/yinmeng-ios/yinmeng-ios/Main/YinMeng/Message/Presenter/MewMessagePresenter.m index 2eb2705..d9704a1 100644 --- a/yinmeng-ios/yinmeng-ios/Main/YinMeng/Message/Presenter/MewMessagePresenter.m +++ b/yinmeng-ios/yinmeng-ios/Main/YinMeng/Message/Presenter/MewMessagePresenter.m @@ -20,7 +20,7 @@ [Api Mew_GetChatLimit:[self createHttpCompletion:^(BaseModel * _Nonnull data) { MewChatLimitModel *chatLimit = [MewChatLimitModel mewModelWithJSON:data.data]; [[self getView] mew_onGetLimitChat:chatLimit]; - } showLoading:NO errorToast:NO] receiverUid:receiverUid]; + } mew_showLoading:NO errorToast:NO] receiverUid:receiverUid]; } /// 获取用户信息 @@ -52,7 +52,7 @@ [Api Mew_AttentionCompletion:[self createHttpCompletion:^(BaseModel * _Nonnull data) { [[self getView] mew_attentionUserSuccess:targetUid]; [[NSNotificationCenter defaultCenter]postNotificationName:@"kAttentionUserNotification" object:nil]; - } showLoading:YES] uid:uid likedUid:targetUid ticket:ticket type:type]; + } mew_showLoading:YES] uid:uid likedUid:targetUid ticket:ticket type:type]; } diff --git a/yinmeng-ios/yinmeng-ios/Main/YinMeng/Message/View/Session/Content/MewMessageContentImage.m b/yinmeng-ios/yinmeng-ios/Main/YinMeng/Message/View/Session/Content/MewMessageContentImage.m index 737c5c6..9a00888 100644 --- a/yinmeng-ios/yinmeng-ios/Main/YinMeng/Message/View/Session/Content/MewMessageContentImage.m +++ b/yinmeng-ios/yinmeng-ios/Main/YinMeng/Message/View/Session/Content/MewMessageContentImage.m @@ -9,7 +9,7 @@ #import "NetImageView.h" #import #import -#import "UIImage+Utils.h" +#import "UIImage+MewUtils.h" #define MESSAGE_IMAGE_MAX_SIZE (CONTENT_WIDTH_MAX) #define MESSAGE_IMAGE_Min_SIZE (CONTENT_WIDTH_MAX -100) @@ -48,7 +48,7 @@ UIImage *image = [UIImage imageWithContentsOfFile:imageObject.thumbPath]; imageSize = image ? image.size : CGSizeZero; } - CGSize contentSize = [UIImage sizeWithImageOriginSize:imageSize + CGSize contentSize = [UIImage mew_sizeWithImageOriginSize:imageSize minSize:CGSizeMake(attachmentImageMinWidth, attachmentImageMinHeight) maxSize:CGSizeMake(attachmemtImageMaxWidth, attachmentImageMaxHeight)]; return contentSize.height + MESSAGE_PADDING * 2 + CONTENT_PADDING_V_TOTAL; @@ -68,7 +68,7 @@ UIImage *image = [UIImage imageWithContentsOfFile:imageObject.thumbPath]; imageSize = image ? image.size : CGSizeZero; } - CGSize contentSize = [UIImage sizeWithImageOriginSize:imageSize + CGSize contentSize = [UIImage mew_sizeWithImageOriginSize:imageSize minSize:CGSizeMake(attachmentImageMinWidth, attachmentImageMinHeight) maxSize:CGSizeMake(attachmemtImageMaxWidth, attachmentImageMaxHeight)]; diff --git a/yinmeng-ios/yinmeng-ios/Main/YinMeng/Message/View/Session/Content/MewMessageContentProtocol.h b/yinmeng-ios/yinmeng-ios/Main/YinMeng/Message/View/Session/Content/MewMessageContentProtocol.h index 9793e6a..5b04921 100644 --- a/yinmeng-ios/yinmeng-ios/Main/YinMeng/Message/View/Session/Content/MewMessageContentProtocol.h +++ b/yinmeng-ios/yinmeng-ios/Main/YinMeng/Message/View/Session/Content/MewMessageContentProtocol.h @@ -6,7 +6,7 @@ // #import -#import "YMMacro.h" +#import "MewMacro.h" @class NIMMessage; #define AVATAR_SIZE 45 diff --git a/yinmeng-ios/yinmeng-ios/Main/YinMeng/Message/View/Session/MewNIMMessageMaker.m b/yinmeng-ios/yinmeng-ios/Main/YinMeng/Message/View/Session/MewNIMMessageMaker.m index 02e7e37..db0a761 100644 --- a/yinmeng-ios/yinmeng-ios/Main/YinMeng/Message/View/Session/MewNIMMessageMaker.m +++ b/yinmeng-ios/yinmeng-ios/Main/YinMeng/Message/View/Session/MewNIMMessageMaker.m @@ -6,7 +6,7 @@ // #import "MewNIMMessageMaker.h" -#import "YMConstant.h" +#import "MewConstant.h" @implementation MewNIMMessageMaker diff --git a/yinmeng-ios/yinmeng-ios/Main/YinMeng/Message/View/Session/MewSessionInfoViewController.h b/yinmeng-ios/yinmeng-ios/Main/YinMeng/Message/View/Session/MewSessionInfoViewController.h index 12309b4..9cf61d3 100644 --- a/yinmeng-ios/yinmeng-ios/Main/YinMeng/Message/View/Session/MewSessionInfoViewController.h +++ b/yinmeng-ios/yinmeng-ios/Main/YinMeng/Message/View/Session/MewSessionInfoViewController.h @@ -5,11 +5,11 @@ // Created by 触海 on 2023/11/25. // -#import "BaseViewController.h" +#import "MewBaseViewController.h" NS_ASSUME_NONNULL_BEGIN -@interface MewSessionInfoViewController : BaseViewController +@interface MewSessionInfoViewController : MewBaseViewController ///用户的id @property (nonatomic,copy) NSString *userId; @end diff --git a/yinmeng-ios/yinmeng-ios/Main/YinMeng/Message/View/Session/MewSessionInfoViewController.m b/yinmeng-ios/yinmeng-ios/Main/YinMeng/Message/View/Session/MewSessionInfoViewController.m index 81149d3..5d4b7ee 100644 --- a/yinmeng-ios/yinmeng-ios/Main/YinMeng/Message/View/Session/MewSessionInfoViewController.m +++ b/yinmeng-ios/yinmeng-ios/Main/YinMeng/Message/View/Session/MewSessionInfoViewController.m @@ -15,7 +15,7 @@ #import "TTPopup.h" ///View -#import "YMWebViewController.h" +#import "MewWebViewController.h" @interface MewSessionInfoViewController () @@ -59,7 +59,7 @@ self.avatarImageView.imageUrl = user.userInfo.avatarUrl; self.nickLabel.text = user.userInfo.nickName; } else { - [self showErrorToast:@"用户信息请求失败,请重试"]; + [self mew_showErrorToast:@"用户信息请求失败,请重试"]; [self.navigationController popViewControllerAnimated:YES]; } }]; @@ -150,20 +150,20 @@ if (isInBlack) { [[NIMSDK sharedSDK].userManager removeFromBlackBlackList:self.userId completion:^(NSError * _Nullable error) { if (error == nil) { - [self showErrorToast:@"已经成功将对方移除黑名单"]; + [self mew_showErrorToast:@"已经成功将对方移除黑名单"]; self.blackButton.selected = NO; } else { - [self showErrorToast:error.description]; + [self mew_showErrorToast:error.description]; } }]; } else { [[NIMSDK sharedSDK].userManager addToBlackList:self.userId completion:^(NSError * _Nullable error) { if (error == nil) { - [self showErrorToast:@"已经成功将对方加入黑名单"]; + [self mew_showErrorToast:@"已经成功将对方加入黑名单"]; self.blackButton.selected = YES; } else { - [self showErrorToast:error.description]; + [self mew_showErrorToast:error.description]; } }]; } @@ -177,35 +177,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]; diff --git a/yinmeng-ios/yinmeng-ios/Main/YinMeng/Message/View/Session/MewSessionMessageCell.m b/yinmeng-ios/yinmeng-ios/Main/YinMeng/Message/View/Session/MewSessionMessageCell.m index be1e286..bdac12a 100644 --- a/yinmeng-ios/yinmeng-ios/Main/YinMeng/Message/View/Session/MewSessionMessageCell.m +++ b/yinmeng-ios/yinmeng-ios/Main/YinMeng/Message/View/Session/MewSessionMessageCell.m @@ -14,7 +14,7 @@ #import "MewMessageConentAudioView.h" ///Tool #import "MEWThemeColor.h" -#import "YMMacro.h" +#import "MewMacro.h" #import "NewEncryptTool.h" /// Third #import diff --git a/yinmeng-ios/yinmeng-ios/Main/YinMeng/Message/View/Session/MewSessionNavView.m b/yinmeng-ios/yinmeng-ios/Main/YinMeng/Message/View/Session/MewSessionNavView.m index 66cc2c0..ef89db9 100644 --- a/yinmeng-ios/yinmeng-ios/Main/YinMeng/Message/View/Session/MewSessionNavView.m +++ b/yinmeng-ios/yinmeng-ios/Main/YinMeng/Message/View/Session/MewSessionNavView.m @@ -9,7 +9,7 @@ /// Tool #import "MEWThemeColor.h" #import -#import "YMMacro.h" +#import "MewMacro.h" /// Third #import diff --git a/yinmeng-ios/yinmeng-ios/Main/YinMeng/Message/View/Session/MewSessionToolbarView.m b/yinmeng-ios/yinmeng-ios/Main/YinMeng/Message/View/Session/MewSessionToolbarView.m index 45e0e4f..952febd 100644 --- a/yinmeng-ios/yinmeng-ios/Main/YinMeng/Message/View/Session/MewSessionToolbarView.m +++ b/yinmeng-ios/yinmeng-ios/Main/YinMeng/Message/View/Session/MewSessionToolbarView.m @@ -11,7 +11,7 @@ #import ///Tool #import "MEWThemeColor.h" -#import "YMMacro.h" +#import "MewMacro.h" #import "NSArray+MewSafe.h" ///Model #import "MewMessageMenuModel.h" diff --git a/yinmeng-ios/yinmeng-ios/Main/YinMeng/Message/View/Session/MewSessionViewController.m b/yinmeng-ios/yinmeng-ios/Main/YinMeng/Message/View/Session/MewSessionViewController.m index 0899fe9..aa941e5 100644 --- a/yinmeng-ios/yinmeng-ios/Main/YinMeng/Message/View/Session/MewSessionViewController.m +++ b/yinmeng-ios/yinmeng-ios/Main/YinMeng/Message/View/Session/MewSessionViewController.m @@ -10,11 +10,11 @@ #import "MewSessionNavView.h" #import "MewSessionMessageCell.h" /// Tool -#import "YMMacro.h" +#import "MewMacro.h" #import "MEWThemeColor.h" #import "NSArray+MewSafe.h" #import "UITableView+NIMScrollToBottom.h" -#import "ClientConfig.h" +#import "MewClientConfig.h" #import "NSObject+MEWExtension.h" /// Third #import @@ -115,8 +115,8 @@ #pragma mark - MewSessionMessageCellDelegate(cell点击事件回调) // cell点击用户头像回调 - (void)mew_didTapAvatarWithUid:(NSString *)uid { - if ([[ClientConfig shareConfig].configInfo.officialMsgUids containsObject:self.session.sessionId] - || [[ClientConfig shareConfig].configInfo.officialAccountUids containsObject:self.session.sessionId]) { + if ([[MewClientConfig shareConfig].configInfo.officialMsgUids containsObject:self.session.sessionId] + || [[MewClientConfig shareConfig].configInfo.officialAccountUids containsObject:self.session.sessionId]) { //过滤官方账号 return; } @@ -166,8 +166,8 @@ // 获取粉丝喜欢成功 - (void)mew_getFansLikeSuccess:(BOOL)isLike { - if ([[ClientConfig shareConfig].configInfo.officialMsgUids containsObject:self.session.sessionId] - || [[ClientConfig shareConfig].configInfo.officialAccountUids containsObject:self.session.sessionId]) { + if ([[MewClientConfig shareConfig].configInfo.officialMsgUids containsObject:self.session.sessionId] + || [[MewClientConfig shareConfig].configInfo.officialAccountUids containsObject:self.session.sessionId]) { //是否是官方账号 self.sessionNavView.isLike = YES; } else { diff --git a/yinmeng-ios/yinmeng-ios/Main/YinMeng/Mine/Model/Friend/MewFansInfoModel.h b/yinmeng-ios/yinmeng-ios/Main/YinMeng/Mine/Model/Friend/MewFansInfoModel.h index 583b904..669e2c5 100644 --- a/yinmeng-ios/yinmeng-ios/Main/YinMeng/Mine/Model/Friend/MewFansInfoModel.h +++ b/yinmeng-ios/yinmeng-ios/Main/YinMeng/Mine/Model/Friend/MewFansInfoModel.h @@ -6,7 +6,7 @@ // #import -#import "YMEnum.h" +#import "MewEnum.h" NS_ASSUME_NONNULL_BEGIN diff --git a/yinmeng-ios/yinmeng-ios/Main/YinMeng/Mine/Presenter/MewMineRechargePresenter.m b/yinmeng-ios/yinmeng-ios/Main/YinMeng/Mine/Presenter/MewMineRechargePresenter.m index 3f99404..37d47c9 100644 --- a/yinmeng-ios/yinmeng-ios/Main/YinMeng/Mine/Presenter/MewMineRechargePresenter.m +++ b/yinmeng-ios/yinmeng-ios/Main/YinMeng/Mine/Presenter/MewMineRechargePresenter.m @@ -52,7 +52,7 @@ [[self getView] mew_requestIAPRechargeOrderSuccess:orderId chargeProdId:chargeProdId uuid:mew_uuid]; } fail:^(NSInteger code, NSString * _Nullable msg) { if(code != 50000){ - [[self getView]showErrorToast:msg]; + [[self getView]mew_showErrorToast:msg]; } [[self getView] mew_requestIAPRechargeOrderFail]; }] chargeProdId:chargeProdId uid:uid ticket:ticket deviceInfo:deviceInfo clientIp:clientIp]; @@ -68,7 +68,7 @@ [[self getView] mew_checkReceiptSuccess:transcationId]; }fail:^(NSInteger code, NSString * _Nullable msg) { [[self getView]mew_checkReceiptFailWithCode:code transcationId:transcationId]; - } showLoading:NO errorToast:errorToast] chooseEnv:@"true" chargeRecordId:orderId transcationId:transcationId uid:uid ticket:ticket]; + } mew_showLoading:NO errorToast:errorToast] chooseEnv:@"true" chargeRecordId:orderId transcationId:transcationId uid:uid ticket:ticket]; } /// 充值成功二次验证 @@ -80,7 +80,7 @@ NSString * ticket = [AccountInfoStorage instance].getTicket; [Api Mew_CheckReceipt:[self createHttpCompletion:^(BaseModel * _Nonnull data) { [[self getView] mew_checkReceiptSuccess:transcationId]; - } showLoading:YES] receipt:receipt chooseEnv:@"true" chargeRecordId:orderId transcationId:transcationId uid:uid ticket:ticket]; + } mew_showLoading:YES] receipt:receipt chooseEnv:@"true" chargeRecordId:orderId transcationId:transcationId uid:uid ticket:ticket]; } diff --git a/yinmeng-ios/yinmeng-ios/Main/YinMeng/Mine/Protocol/MineRechargeProtocol.h b/yinmeng-ios/yinmeng-ios/Main/YinMeng/Mine/Protocol/MineRechargeProtocol.h index d69400c..07cc217 100644 --- a/yinmeng-ios/yinmeng-ios/Main/YinMeng/Mine/Protocol/MineRechargeProtocol.h +++ b/yinmeng-ios/yinmeng-ios/Main/YinMeng/Mine/Protocol/MineRechargeProtocol.h @@ -23,7 +23,7 @@ NS_ASSUME_NONNULL_BEGIN ///二次校验成功 - (void)mew_checkReceiptSuccess:(NSString *)transcationId; ///批量验证凭据成功 -- (void)checkTranscationIdsSuccess; +- (void)mew_checkTranscationIdsSuccess; ///二次校验失败 - (void)mew_checkReceiptFailWithCode:(NSInteger)code transcationId:(NSString *)transcationId; @end diff --git a/yinmeng-ios/yinmeng-ios/Main/YinMeng/Mine/View/CollectRoom/MewMineCollectRoomViewController.m b/yinmeng-ios/yinmeng-ios/Main/YinMeng/Mine/View/CollectRoom/MewMineCollectRoomViewController.m index 0f6e47a..d3b66ac 100644 --- a/yinmeng-ios/yinmeng-ios/Main/YinMeng/Mine/View/CollectRoom/MewMineCollectRoomViewController.m +++ b/yinmeng-ios/yinmeng-ios/Main/YinMeng/Mine/View/CollectRoom/MewMineCollectRoomViewController.m @@ -130,7 +130,7 @@ - (void)mew_footerRefresh { if (self.hasNoMoreData) { - [self showErrorToast:@"没有更多收藏记录了"]; + [self mew_showErrorToast:@"没有更多收藏记录了"]; return; } self.page++; diff --git a/yinmeng-ios/yinmeng-ios/Main/YinMeng/Mine/View/Setting/Cell/MewMineCollectionTableViewCell.m b/yinmeng-ios/yinmeng-ios/Main/YinMeng/Mine/View/Setting/Cell/MewMineCollectionTableViewCell.m index 47702fa..f5cf4e4 100644 --- a/yinmeng-ios/yinmeng-ios/Main/YinMeng/Mine/View/Setting/Cell/MewMineCollectionTableViewCell.m +++ b/yinmeng-ios/yinmeng-ios/Main/YinMeng/Mine/View/Setting/Cell/MewMineCollectionTableViewCell.m @@ -9,7 +9,7 @@ #import "NetImageView.h" #import "MewMineCollectRoomModel.h" #import -#import "YMMacro.h" +#import "MewMacro.h" #import "MEWThemeColor.h" @interface MewMineCollectionTableViewCell() diff --git a/yinmeng-ios/yinmeng-ios/Main/YinMeng/Mine/View/Setting/Cell/MewMineSettingTableViewCell.m b/yinmeng-ios/yinmeng-ios/Main/YinMeng/Mine/View/Setting/Cell/MewMineSettingTableViewCell.m index a322dcc..e85e148 100644 --- a/yinmeng-ios/yinmeng-ios/Main/YinMeng/Mine/View/Setting/Cell/MewMineSettingTableViewCell.m +++ b/yinmeng-ios/yinmeng-ios/Main/YinMeng/Mine/View/Setting/Cell/MewMineSettingTableViewCell.m @@ -12,7 +12,7 @@ #import ///Tool #import "MEWThemeColor.h" -#import "YMMacro.h" +#import "MewMacro.h" @interface MewMineSettingTableViewCell() ///容器 diff --git a/yinmeng-ios/yinmeng-ios/Main/YinMeng/Mine/View/Setting/MewMineSettingViewController.m b/yinmeng-ios/yinmeng-ios/Main/YinMeng/Mine/View/Setting/MewMineSettingViewController.m index 9361103..7202a3b 100644 --- a/yinmeng-ios/yinmeng-ios/Main/YinMeng/Mine/View/Setting/MewMineSettingViewController.m +++ b/yinmeng-ios/yinmeng-ios/Main/YinMeng/Mine/View/Setting/MewMineSettingViewController.m @@ -5,11 +5,14 @@ // Created by 触海 on 2023/11/9. // + #import "MewMineSettingViewController.h" -#import "YMWebViewController.h" #import "MewMineAboutUsViewController.h" #import "MewLoginVerifBindPhoneViewController.h" #import "MewMineLoginPasswordViewController.h" + +#import "MewWebViewController.h" +#import "MineLoginPasswordViewController.h" // Presenter #import "MewMineSettingProtocol.h" #import "MewMineSettingPresenter.h" @@ -22,8 +25,8 @@ ///Tool #import "NSArray+MewSafe.h" #import "MEWThemeColor.h" -#import "YMMacro.h" -#import "UIImage+Utils.h" +#import "MewMacro.h" +#import "UIImage+MewUtils.h" #import "MewHUDTool.h" #import "MewHtmlUrl.h" @@ -143,7 +146,7 @@ // 注销账号 case MewMineSettingItemType_Cancel_Account: { - YMWebViewController *controller = [[YMWebViewController alloc] init]; + MewWebViewController *controller = [[MewWebViewController alloc] init]; controller.url = URLWithType(kCancelAccout); [self.navigationController pushViewController:controller animated:NO]; @@ -153,7 +156,7 @@ } - (void)pushWebViewWIthUrl:(NSString *)url { - YMWebViewController * webVC = [[YMWebViewController alloc] init]; + MewWebViewController * webVC = [[MewWebViewController alloc] init]; webVC.url = url; [self.navigationController pushViewController:webVC animated:YES]; } @@ -231,7 +234,7 @@ _logoutButton.layer.cornerRadius = 50/2; _logoutButton.titleLabel.font = [UIFont systemFontOfSize:16]; [_logoutButton setTitleColor:UIColor.whiteColor forState:UIControlStateNormal]; - UIImage *image = [UIImage gradientColorImageFromColors:@[[MEWThemeColor mewColorWithHexString:@"#FF60FD"], [MEWThemeColor mewColorWithHexString:@"#8974FF"], [MEWThemeColor mewColorWithHexString:@"#69EBFF"]] gradientType:GradientTypeLeftToRight imgSize:CGSizeMake(KScreenWidth - 2 * 40, 48)]; + UIImage *image = [UIImage mew_gradientColorImageFromColors:@[[MEWThemeColor mewColorWithHexString:@"#FF60FD"], [MEWThemeColor mewColorWithHexString:@"#8974FF"], [MEWThemeColor mewColorWithHexString:@"#69EBFF"]] gradientType:MewGradientTypeLeftToRight imgSize:CGSizeMake(KScreenWidth - 2 * 40, 48)]; _logoutButton.backgroundColor = [UIColor colorWithPatternImage:image]; [_logoutButton setTitle:@"退出账号" forState:UIControlStateNormal]; [_logoutButton addTarget:self action:@selector(logoutButtonAction:) forControlEvents:UIControlEventTouchUpInside]; diff --git a/yinmeng-ios/yinmeng-ios/Main/YinMeng/Mine/View/SubView/MewMineModifPayPwdView.m b/yinmeng-ios/yinmeng-ios/Main/YinMeng/Mine/View/SubView/MewMineModifPayPwdView.m index eeb3977..a946d11 100644 --- a/yinmeng-ios/yinmeng-ios/Main/YinMeng/Mine/View/SubView/MewMineModifPayPwdView.m +++ b/yinmeng-ios/yinmeng-ios/Main/YinMeng/Mine/View/SubView/MewMineModifPayPwdView.m @@ -10,7 +10,7 @@ #import ///Tool #import "MEWThemeColor.h" -#import "UIButton+EnlargeTouchArea.h" +#import "UIButton+MewEnlargeTouchArea.h" @interface MewMineModifPayPwdView() @@ -103,7 +103,7 @@ - (UIButton *)commandButton { if (!_commandButton) { _commandButton = [UIButton buttonWithType:UIButtonTypeCustom]; - [_commandButton setEnlargeEdgeWithTop:20 right:20 bottom:20 left:20]; + [_commandButton mew_setEnlargeEdgeWithTop:20 right:20 bottom:20 left:20]; [_commandButton addTarget:self action:@selector(onClickHiddenBtn:) forControlEvents:UIControlEventTouchUpInside]; [_commandButton setImage:[UIImage imageNamed:@"mine_setting_modif_pay_pwd_hidden"] forState:UIControlStateNormal]; [_commandButton setImage:[UIImage imageNamed:@"mine_setting_modif_pay_pwd_show"] forState:UIControlStateSelected]; diff --git a/yinmeng-ios/yinmeng-ios/Main/YinMeng/ModuleKit/MewGiftView/Api/Api+Gift.h b/yinmeng-ios/yinmeng-ios/Main/YinMeng/ModuleKit/MewGiftView/Api/Api+Gift.h index 5a5a11b..c43fe7a 100644 --- a/yinmeng-ios/yinmeng-ios/Main/YinMeng/ModuleKit/MewGiftView/Api/Api+Gift.h +++ b/yinmeng-ios/yinmeng-ios/Main/YinMeng/ModuleKit/MewGiftView/Api/Api+Gift.h @@ -22,7 +22,7 @@ NS_ASSUME_NONNULL_BEGIN /// @param roomUid 房间的ID /// @param msg 喊话的 /// @param uid 用户的id -+ (void)Mew_RequestSendGift:(HttpRequestHelperCompletion)complection ++ (void)Mew_RequestSendGift:(MewHttpRequestHelperCompletion)complection targetUids:(NSString *)targetUids giftNum:(NSString *)giftNum sendType:(NSString *)sendType diff --git a/yinmeng-ios/yinmeng-ios/Main/YinMeng/ModuleKit/MewGiftView/Api/Api+Gift.m b/yinmeng-ios/yinmeng-ios/Main/YinMeng/ModuleKit/MewGiftView/Api/Api+Gift.m index c525983..d7eb930 100644 --- a/yinmeng-ios/yinmeng-ios/Main/YinMeng/ModuleKit/MewGiftView/Api/Api+Gift.m +++ b/yinmeng-ios/yinmeng-ios/Main/YinMeng/ModuleKit/MewGiftView/Api/Api+Gift.m @@ -19,7 +19,7 @@ /// @param roomUid 房间的ID /// @param msg 喊话的 /// @param uid 用户的id -+ (void)Mew_RequestSendGift:(HttpRequestHelperCompletion)complection ++ (void)Mew_RequestSendGift:(MewHttpRequestHelperCompletion)complection targetUids:(NSString *)targetUids giftNum:(NSString *)giftNum sendType:(NSString *)sendType @@ -31,6 +31,6 @@ uid:(NSString *)uid { NSString *getUrl = [NewEncryptTool MEW_aesDecrypt:@"gIV0xamx+afcRMN4yGb5jw=="];//gift/sendV4 NSString *method = getUrl; - [self makeRequest:method method:HttpRequestHelperMethodPOST completion:complection, __FUNCTION__, targetUids, giftNum, sendType, giftId, giftSource, giftType, roomUid, msg, uid, nil]; + [self makeRequest:method method:MewHttpRequestHelperMethodPOST completion:complection, __FUNCTION__, targetUids, giftNum, sendType, giftId, giftSource, giftType, roomUid, msg, uid, nil]; } @end diff --git a/yinmeng-ios/yinmeng-ios/Main/YinMeng/RTC/Impl/MewTRTCRtcImpl.m b/yinmeng-ios/yinmeng-ios/Main/YinMeng/RTC/Impl/MewTRTCRtcImpl.m index df1c6ba..e6fb4e7 100644 --- a/yinmeng-ios/yinmeng-ios/Main/YinMeng/RTC/Impl/MewTRTCRtcImpl.m +++ b/yinmeng-ios/yinmeng-ios/Main/YinMeng/RTC/Impl/MewTRTCRtcImpl.m @@ -9,7 +9,7 @@ #import #import "AccountInfoStorage.h" ///Tool -#import "YMConstant.h" +#import "MewConstant.h" @interface MewTRTCRtcImpl() diff --git a/yinmeng-ios/yinmeng-ios/Main/YinMeng/Room/Api/Api+Room.h b/yinmeng-ios/yinmeng-ios/Main/YinMeng/Room/Api/Api+Room.h index 9c74f79..583505a 100644 --- a/yinmeng-ios/yinmeng-ios/Main/YinMeng/Room/Api/Api+Room.h +++ b/yinmeng-ios/yinmeng-ios/Main/YinMeng/Room/Api/Api+Room.h @@ -15,7 +15,7 @@ NS_ASSUME_NONNULL_BEGIN /// @param complection 完成 /// @param uid 用户的uid /// @param intoUid 自己的Uid 判断当前进房用户是否是平台超管 判断进房用户是否开启青少年 -+ (void)Mew_GetRoomInformation:(HttpRequestHelperCompletion)complection ++ (void)Mew_GetRoomInformation:(MewHttpRequestHelperCompletion)complection uid:(NSString *)uid intoUid:(NSString *)intoUid; @@ -29,7 +29,7 @@ NS_ASSUME_NONNULL_BEGIN /// @param uid 用户的uid /// @param ticket 用户的ticket /// @param mgId 小游戏的id -+ (void)Mew_OpenRoom:(HttpRequestHelperCompletion)complection ++ (void)Mew_OpenRoom:(MewHttpRequestHelperCompletion)complection title:(NSString *)title type:(RoomType)type roomPwd:(NSString *)roomPwd @@ -47,7 +47,7 @@ NS_ASSUME_NONNULL_BEGIN /// @param roomId 房间的id /// @param position 坑位的序号 /// @param ticket ticket -+ (void)Mew_RoomMicUpMic:(HttpRequestHelperCompletion)complection ++ (void)Mew_RoomMicUpMic:(MewHttpRequestHelperCompletion)complection micUid:(NSString *)micUid roomId:(NSString *)roomId position:(NSString *)position @@ -59,7 +59,7 @@ NS_ASSUME_NONNULL_BEGIN /// @param roomId 房间的id /// @param position 坑位的序号 /// @param ticket ticket -+ (void)Mew_RoomMicDownMic:(HttpRequestHelperCompletion)complection ++ (void)Mew_RoomMicDownMic:(MewHttpRequestHelperCompletion)complection micUid:(NSString *)micUid roomId:(NSString *)roomId position:(NSString *)position @@ -71,7 +71,7 @@ NS_ASSUME_NONNULL_BEGIN /// @param uid uid /// @param type 1 收藏 2 取消收藏 3:批量取消收藏 /// @param roomUids 批量删除的房间uid,用逗号隔开 -+ (void)Mew_CollectRoom:(HttpRequestHelperCompletion)completion ++ (void)Mew_CollectRoom:(MewHttpRequestHelperCompletion)completion roomUid:(NSString *)roomUid uid:(NSString *)uid type:(NSString *)type @@ -82,14 +82,14 @@ NS_ASSUME_NONNULL_BEGIN /// @param uid 用户uid /// @param roomUid 房间uid /// @param ticket ticket -+ (void)Mew_RequestReportUserInterRoom:(HttpRequestHelperCompletion)completion uid:(NSString *)uid roomUid:(NSString *)roomUid ticket:(NSString *)ticket; ++ (void)Mew_RequestReportUserInterRoom:(MewHttpRequestHelperCompletion)completion uid:(NSString *)uid roomUid:(NSString *)roomUid ticket:(NSString *)ticket; /// 上报用户退房 /// @param completion 完成 /// @param uid 用户uid /// @param roomUid 房间uid /// @param ticket ticket -+ (void)Mew_RequestReportUserOutRoom:(HttpRequestHelperCompletion)completion uid:(NSString *)uid roomUid:(NSString *)roomUid ticket:(NSString *)ticket; ++ (void)Mew_RequestReportUserOutRoom:(MewHttpRequestHelperCompletion)completion uid:(NSString *)uid roomUid:(NSString *)roomUid ticket:(NSString *)ticket; @end diff --git a/yinmeng-ios/yinmeng-ios/Main/YinMeng/Room/Api/Api+Room.m b/yinmeng-ios/yinmeng-ios/Main/YinMeng/Room/Api/Api+Room.m index c48111b..828daca 100644 --- a/yinmeng-ios/yinmeng-ios/Main/YinMeng/Room/Api/Api+Room.m +++ b/yinmeng-ios/yinmeng-ios/Main/YinMeng/Room/Api/Api+Room.m @@ -13,9 +13,9 @@ /// @param complection 完成 /// @param uid 用户的uid /// @param intoUid 自己的Uid 判断当前进房用户是否是平台超管 判断进房用户是否开启青少年 -+ (void)Mew_GetRoomInformation:(HttpRequestHelperCompletion)complection uid:(NSString *)uid intoUid:(NSString *)intoUid { ++ (void)Mew_GetRoomInformation:(MewHttpRequestHelperCompletion)complection uid:(NSString *)uid intoUid:(NSString *)intoUid { NSString *getUrl = [NewEncryptTool MEW_aesDecrypt:@"gs8/IEqGWXCD7Cn4Hs11dw=="];///room/get - [self makeRequest:getUrl method:HttpRequestHelperMethodGET completion:complection, __FUNCTION__, uid, intoUid, nil]; + [self makeRequest:getUrl method:MewHttpRequestHelperMethodGET completion:complection, __FUNCTION__, uid, intoUid, nil]; } /// 开启房间 @@ -28,7 +28,7 @@ /// @param uid 用户的uid /// @param ticket 用户的ticket /// @param mgId 小游戏的id -+ (void)Mew_OpenRoom:(HttpRequestHelperCompletion)complection ++ (void)Mew_OpenRoom:(MewHttpRequestHelperCompletion)complection title:(NSString *)title type:(RoomType)type roomPwd:(NSString *)roomPwd @@ -38,7 +38,7 @@ ticket:(NSString *)ticket mgId:(NSString *)mgId { NSString *getUrl = [NewEncryptTool MEW_aesDecrypt:@"/Q7ygAZSSdH/vm0uhYbwIw=="];///room/open - [Api makeRequest:getUrl method:HttpRequestHelperMethodPOST completion:complection, __FUNCTION__, title, @(type), roomPwd, roomDesc, backPic, uid, ticket, mgId,nil]; + [Api makeRequest:getUrl method:MewHttpRequestHelperMethodPOST completion:complection, __FUNCTION__, title, @(type), roomPwd, roomDesc, backPic, uid, ticket, mgId,nil]; } @@ -48,9 +48,9 @@ /// @param roomId 房间的id /// @param position 坑位的序号 /// @param ticket ticket -+ (void)Mew_RoomMicUpMic:(HttpRequestHelperCompletion)complection micUid:(NSString *)micUid roomId:(NSString *)roomId position:(NSString *)position ticket:(NSString *)ticket { ++ (void)Mew_RoomMicUpMic:(MewHttpRequestHelperCompletion)complection micUid:(NSString *)micUid roomId:(NSString *)roomId position:(NSString *)position ticket:(NSString *)ticket { NSString *getUrl = [NewEncryptTool MEW_aesDecrypt:@"8gpgcXMk36xfvm6d+muZng=="];///room/mic/upmic - [self makeRequest:getUrl method:HttpRequestHelperMethodPOST completion:complection, __FUNCTION__, micUid, roomId, position, ticket, nil]; + [self makeRequest:getUrl method:MewHttpRequestHelperMethodPOST completion:complection, __FUNCTION__, micUid, roomId, position, ticket, nil]; } /// 房间下麦 @@ -59,9 +59,9 @@ /// @param roomId 房间的id /// @param position 坑位的序号 /// @param ticket ticket -+ (void)Mew_RoomMicDownMic:(HttpRequestHelperCompletion)complection micUid:(NSString *)micUid roomId:(NSString *)roomId position:(NSString *)position ticket:(NSString *)ticket { ++ (void)Mew_RoomMicDownMic:(MewHttpRequestHelperCompletion)complection micUid:(NSString *)micUid roomId:(NSString *)roomId position:(NSString *)position ticket:(NSString *)ticket { NSString *getUrl = [NewEncryptTool MEW_aesDecrypt:@"yLlyaDpUfo8seQvUf2xVE1pDQw0kPWhe5imJar+ZYGs="];//room/mic/downmic - [Api makeRequest:getUrl method:HttpRequestHelperMethodPOST completion:complection, __FUNCTION__, micUid, roomId, position, ticket, nil]; + [Api makeRequest:getUrl method:MewHttpRequestHelperMethodPOST completion:complection, __FUNCTION__, micUid, roomId, position, ticket, nil]; } /// 收藏房间 @@ -70,9 +70,9 @@ /// @param uid uid /// @param type 1 收藏 2 取消收藏 3:批量取消收藏 /// @param roomUids 批量删除的房间uid,用逗号隔开 -+ (void)Mew_CollectRoom:(HttpRequestHelperCompletion)completion roomUid:(NSString *)roomUid uid:(NSString *)uid type:(NSString *)type roomUids:(NSString *)roomUids { ++ (void)Mew_CollectRoom:(MewHttpRequestHelperCompletion)completion roomUid:(NSString *)roomUid uid:(NSString *)uid type:(NSString *)type roomUids:(NSString *)roomUids { NSString *getUrl = [NewEncryptTool MEW_aesDecrypt:@"GQiHXUlHz3kGtxBxaDpYOg=="];///fans/fansRoom - [Api makeRequest:getUrl method:HttpRequestHelperMethodPOST completion:completion, __FUNCTION__, roomUid, uid, type, roomUids, nil]; + [Api makeRequest:getUrl method:MewHttpRequestHelperMethodPOST completion:completion, __FUNCTION__, roomUid, uid, type, roomUids, nil]; } @@ -81,9 +81,9 @@ /// @param uid 用户uid /// @param roomUid 房间uid /// @param ticket ticket -+ (void)Mew_RequestReportUserInterRoom:(HttpRequestHelperCompletion)completion uid:(NSString *)uid roomUid:(NSString *)roomUid ticket:(NSString *)ticket { ++ (void)Mew_RequestReportUserInterRoom:(MewHttpRequestHelperCompletion)completion uid:(NSString *)uid roomUid:(NSString *)roomUid ticket:(NSString *)ticket { NSString *getUrl = [NewEncryptTool MEW_aesDecrypt:@"+RPS7HavWT0Wo413/I2TLA=="];///userroom/inV2 - [self makeRequest:getUrl method:HttpRequestHelperMethodPOST completion:completion, __FUNCTION__, uid, roomUid, ticket, nil]; + [self makeRequest:getUrl method:MewHttpRequestHelperMethodPOST completion:completion, __FUNCTION__, uid, roomUid, ticket, nil]; } @@ -92,9 +92,9 @@ /// @param uid 用户uid /// @param roomUid 房间uid /// @param ticket ticket -+ (void)Mew_RequestReportUserOutRoom:(HttpRequestHelperCompletion)completion uid:(NSString *)uid roomUid:(NSString *)roomUid ticket:(NSString *)ticket { ++ (void)Mew_RequestReportUserOutRoom:(MewHttpRequestHelperCompletion)completion uid:(NSString *)uid roomUid:(NSString *)roomUid ticket:(NSString *)ticket { NSString *getUrl = [NewEncryptTool MEW_aesDecrypt:@"eGme6ANFUqQGdpX/DtfRrg=="];///userroom/outV2 - [self makeRequest:getUrl method:HttpRequestHelperMethodPOST completion:completion, __FUNCTION__, uid, roomUid, ticket, nil]; + [self makeRequest:getUrl method:MewHttpRequestHelperMethodPOST completion:completion, __FUNCTION__, uid, roomUid, ticket, nil]; } @end diff --git a/yinmeng-ios/yinmeng-ios/Main/YinMeng/Room/View/AnimationView/MewRoomAnimationGroup.m b/yinmeng-ios/yinmeng-ios/Main/YinMeng/Room/View/AnimationView/MewRoomAnimationGroup.m index b82da3e..ac1b0fa 100644 --- a/yinmeng-ios/yinmeng-ios/Main/YinMeng/Room/View/AnimationView/MewRoomAnimationGroup.m +++ b/yinmeng-ios/yinmeng-ios/Main/YinMeng/Room/View/AnimationView/MewRoomAnimationGroup.m @@ -6,7 +6,7 @@ // #import "MewRoomAnimationGroup.h" -#import "YMMacro.h" +#import "MewMacro.h" @implementation MewRoomAnimationGroup diff --git a/yinmeng-ios/yinmeng-ios/Main/YinMeng/Room/View/AnimationView/MewRoomAnimationView.m b/yinmeng-ios/yinmeng-ios/Main/YinMeng/Room/View/AnimationView/MewRoomAnimationView.m index f59546f..25723f8 100644 --- a/yinmeng-ios/yinmeng-ios/Main/YinMeng/Room/View/AnimationView/MewRoomAnimationView.m +++ b/yinmeng-ios/yinmeng-ios/Main/YinMeng/Room/View/AnimationView/MewRoomAnimationView.m @@ -23,7 +23,7 @@ /// Tool #import "MewGiftStorage.h" #import "MewRoomAnimationGroup.h" -#import "YMMacro.h" +#import "MewMacro.h" @interface MewRoomAnimationView() ///最底层的 diff --git a/yinmeng-ios/yinmeng-ios/Main/YinMeng/Room/View/MenuContainerView/MewRoomSendTextView.m b/yinmeng-ios/yinmeng-ios/Main/YinMeng/Room/View/MenuContainerView/MewRoomSendTextView.m index 0d39574..b985f5e 100644 --- a/yinmeng-ios/yinmeng-ios/Main/YinMeng/Room/View/MenuContainerView/MewRoomSendTextView.m +++ b/yinmeng-ios/yinmeng-ios/Main/YinMeng/Room/View/MenuContainerView/MewRoomSendTextView.m @@ -8,11 +8,11 @@ #import "MewRoomSendTextView.h" /// Tool #import "MEWThemeColor.h" -#import "UIImage+Utils.h" -#import "YMMacro.h" +#import "UIImage+MewUtils.h" +#import "MewMacro.h" #import "AccountInfoStorage.h" #import "NSArray+MEWSafe.h" -#import "YMConstant.h" +#import "MewConstant.h" /// Third #import #import @@ -232,7 +232,7 @@ [_sendButton setTitle:@"发送" forState:UIControlStateNormal]; _sendButton.titleLabel.textColor = [MEWThemeColor mewMainTextColor]; _sendButton.titleLabel.font = [UIFont systemFontOfSize:15]; - [_sendButton setBackgroundImage:[UIImage imageWithColor:[MEWThemeColor mewColorWithHexString:@"#9552FF"] ] forState:UIControlStateNormal]; + [_sendButton setBackgroundImage:[UIImage mew_imageWithColor:[MEWThemeColor mewColorWithHexString:@"#9552FF"] ] forState:UIControlStateNormal]; _sendButton.enabled = NO; _sendButton.layer.cornerRadius = 5.0; _sendButton.layer.masksToBounds = YES; diff --git a/yinmeng-ios/yinmeng-ios/Main/YinMeng/Room/View/MessageContainerView/MewRoomMessageContainerView.m b/yinmeng-ios/yinmeng-ios/Main/YinMeng/Room/View/MessageContainerView/MewRoomMessageContainerView.m index e2de81b..56b51d0 100644 --- a/yinmeng-ios/yinmeng-ios/Main/YinMeng/Room/View/MessageContainerView/MewRoomMessageContainerView.m +++ b/yinmeng-ios/yinmeng-ios/Main/YinMeng/Room/View/MessageContainerView/MewRoomMessageContainerView.m @@ -18,7 +18,7 @@ #import "MewRoomMessageParser.h" #import "MewRoomMessageConstant.h" #import "MewRoomMessageFilter.h" -#import "ClientConfig.h" +#import "MewClientConfig.h" #import "AccountInfoStorage.h" #import "MEWThemeColor.h" /// Third @@ -94,7 +94,7 @@ [[NIMSDK sharedSDK].chatroomManager fetchMessageHistory:roomId option:option result:^(NSError * _Nullable error, NSArray * _Nullable messages) { if (messages.count) { //如果拉取的数量等于请求的数量,说明这个时间点以后的消息数量大于等于需要拉取的数量,直接拉取最新的50条 - if (messages.count == [ClientConfig shareConfig].configInfo.roomMessageCount) { + if (messages.count == [MewClientConfig shareConfig].configInfo.roomMessageCount) { NIMHistoryMessageSearchOption *option = [self mew_configWithHistoryMessageOption]; option.order = NIMMessageSearchOrderDesc; [[NIMSDK sharedSDK].chatroomManager fetchMessageHistory:roomId option:option result:^(NSError * _Nullable error, NSArray * _Nullable messages) { @@ -116,7 +116,7 @@ #pragma mark - Private Method - (NIMHistoryMessageSearchOption *)mew_configWithHistoryMessageOption{ NIMHistoryMessageSearchOption *option = [[NIMHistoryMessageSearchOption alloc] init]; - option.limit = [ClientConfig shareConfig].configInfo.roomMessageCount; + option.limit = [MewClientConfig shareConfig].configInfo.roomMessageCount; option.messageTypes = @[@(NIMMessageTypeText)]; return option; } diff --git a/yinmeng-ios/yinmeng-ios/Main/YinMeng/Room/View/MessageContainerView/MewRoomMessageHeaderView.m b/yinmeng-ios/yinmeng-ios/Main/YinMeng/Room/View/MessageContainerView/MewRoomMessageHeaderView.m index 2b58439..b060a69 100644 --- a/yinmeng-ios/yinmeng-ios/Main/YinMeng/Room/View/MessageContainerView/MewRoomMessageHeaderView.m +++ b/yinmeng-ios/yinmeng-ios/Main/YinMeng/Room/View/MessageContainerView/MewRoomMessageHeaderView.m @@ -11,7 +11,7 @@ ///Tool #import "MEWThemeColor.h" #import "MewRoomMessageConstant.h" -#import "YMMacro.h" +#import "MewMacro.h" @interface MewRoomMessageHeaderView () ///背景 diff --git a/yinmeng-ios/yinmeng-ios/Main/YinMeng/Room/View/MessageContainerView/Model/MewMessageRemoteExtModel.h b/yinmeng-ios/yinmeng-ios/Main/YinMeng/Room/View/MessageContainerView/Model/MewMessageRemoteExtModel.h index 48e8dfc..932cb37 100644 --- a/yinmeng-ios/yinmeng-ios/Main/YinMeng/Room/View/MessageContainerView/Model/MewMessageRemoteExtModel.h +++ b/yinmeng-ios/yinmeng-ios/Main/YinMeng/Room/View/MessageContainerView/Model/MewMessageRemoteExtModel.h @@ -6,7 +6,7 @@ // #import "NSObject+MEWExtension.h" -#import "YMEnum.h" +#import "MewEnum.h" NS_ASSUME_NONNULL_BEGIN diff --git a/yinmeng-ios/yinmeng-ios/Main/YinMeng/Room/View/MessageContainerView/Tool/MewRoomMessageConstant.h b/yinmeng-ios/yinmeng-ios/Main/YinMeng/Room/View/MessageContainerView/Tool/MewRoomMessageConstant.h index 13d0ba2..bdbd23c 100644 --- a/yinmeng-ios/yinmeng-ios/Main/YinMeng/Room/View/MessageContainerView/Tool/MewRoomMessageConstant.h +++ b/yinmeng-ios/yinmeng-ios/Main/YinMeng/Room/View/MessageContainerView/Tool/MewRoomMessageConstant.h @@ -5,7 +5,7 @@ // Created by 触海 on 2023/11/7. // -#import "YMMacro.h" +#import "MewMacro.h" #ifndef MewRoomMessageConstant_h #define MewRoomMessageConstant_h diff --git a/yinmeng-ios/yinmeng-ios/Main/YinMeng/Room/View/MewRoomHostDelegate.h b/yinmeng-ios/yinmeng-ios/Main/YinMeng/Room/View/MewRoomHostDelegate.h index 5fdf738..dd84e48 100644 --- a/yinmeng-ios/yinmeng-ios/Main/YinMeng/Room/View/MewRoomHostDelegate.h +++ b/yinmeng-ios/yinmeng-ios/Main/YinMeng/Room/View/MewRoomHostDelegate.h @@ -22,7 +22,7 @@ NS_ASSUME_NONNULL_BEGIN - (void)mew_exitCurrentRoom; /// 获取当前的导航控制器 -- (UINavigationController *)mew_getCurrentNavigationController; +- (UINavigationController *)mew_getmew_currentNavigationController; @end diff --git a/yinmeng-ios/yinmeng-ios/Main/YinMeng/Room/View/StageView/MicroView/MicroView.m b/yinmeng-ios/yinmeng-ios/Main/YinMeng/Room/View/StageView/MicroView/MicroView.m index 079acec..c4ecc8f 100644 --- a/yinmeng-ios/yinmeng-ios/Main/YinMeng/Room/View/StageView/MicroView/MicroView.m +++ b/yinmeng-ios/yinmeng-ios/Main/YinMeng/Room/View/StageView/MicroView/MicroView.m @@ -12,7 +12,7 @@ #import "MicroQueueModel.h" /// Tool #import "MEWThemeColor.h" -#import "YMMacro.h" +#import "MewMacro.h" /// Third #import diff --git a/yinmeng-ios/yinmeng-ios/Main/YinMeng/Room/View/StageView/Model/MicroExtModel.h b/yinmeng-ios/yinmeng-ios/Main/YinMeng/Room/View/StageView/Model/MicroExtModel.h index 608fb3d..6619522 100644 --- a/yinmeng-ios/yinmeng-ios/Main/YinMeng/Room/View/StageView/Model/MicroExtModel.h +++ b/yinmeng-ios/yinmeng-ios/Main/YinMeng/Room/View/StageView/Model/MicroExtModel.h @@ -6,7 +6,7 @@ // #import -#import "YMEnum.h" +#import "MewEnum.h" NS_ASSUME_NONNULL_BEGIN