From 7736274b7c6ab158735cbe4cb0b2434e7e37e1ec Mon Sep 17 00:00:00 2001 From: liyuhua <15626451870@163.com> Date: Mon, 4 Dec 2023 10:55:49 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=94=B9=E7=B1=BB=E5=90=8D=E5=92=8C?= =?UTF-8?q?=E6=96=B9=E6=B3=95=E5=90=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- yinmeng-ios/yinmeng-ios/Base/Base.h | 2 +- .../yinmeng-ios/Base/MVP/Model/AccountModel.h | 2 +- .../yinmeng-ios/Base/MVP/Model/BaseModel.h | 2 +- .../Base/MVP/Model/UserInfoModel.h | 2 +- .../Base/MVP/Presenter/BaseMvpPresenter.m | 2 +- .../yinmeng-ios/Base/Net/HttpRequestHelper.m | 12 +- .../Base/Tool/CountDown/CountDownHelper.h | 32 ---- .../Base/Tool/CountDown/CountDownHelper.m | 68 --------- .../Base/Tool/CountDown/MEWCountDownHelper.h | 29 ++++ .../Base/Tool/CountDown/MEWCountDownHelper.m | 65 +++++++++ .../File/{UploadFile.h => MEWUploadFile.h} | 16 +- .../File/{UploadFile.m => MEWUploadFile.m} | 26 ++-- .../Base/Tool/GCDHelper/GCDHelper.h | 11 -- .../Base/Tool/GCDHelper/GCDHelper.m | 16 -- .../Base/Tool/GCDHelper/MEWGCDHelper.h | 10 ++ .../Base/Tool/GCDHelper/MEWGCDHelper.m | 16 ++ .../Base/Tool/IAPHelper/MEWRechargeStorage.h | 29 ++++ ...RechargeStorage.m => MEWRechargeStorage.m} | 30 ++-- .../Base/Tool/IAPHelper/RechargeStorage.h | 31 ---- .../Base/Tool/IAPHelper/YMIAPHelper.h | 38 ----- .../Base/Tool/IAPHelper/YMIAPHelper.m | 96 ------------ .../Base/Tool/{YMHUDTool.h => MewHUDTool.h} | 10 +- .../Base/Tool/{YMHUDTool.m => MewHUDTool.m} | 24 ++- ...+MJExtension.h => NSObject+MEWExtension.h} | 26 ++-- ...+MJExtension.m => NSObject+MEWExtension.m} | 37 +++-- .../Base/Tool/Safe/NSArray+MewSafe.h | 16 ++ .../{NSArray+Safe.m => NSArray+MewSafe.m} | 14 +- .../yinmeng-ios/Base/Tool/Safe/NSArray+Safe.h | 16 -- .../Tool/Safe/NSMutableDictionary+MEWSafe.h | 16 ++ .../Tool/Safe/NSMutableDictionary+MEWSafe.m | 15 ++ .../Base/Tool/Safe/NSMutableDictionary+Safe.h | 16 -- .../Base/Tool/Safe/NSMutableDictionary+Safe.m | 16 -- .../Base/Tool/Security/DESEncrypt.m | 6 +- .../Tool/Security/{Base64.h => MEWBase64.h} | 10 +- .../Tool/Security/{Base64.m => MEWBase64.m} | 17 +-- .../Base/Tool/ThemeColor/MEWThemeColor.h | 59 ++++++++ .../Base/Tool/ThemeColor/MEWThemeColor.m | 135 +++++++++++++++++ .../Base/Tool/ThemeColor/ThemeColor.h | 59 -------- .../Base/Tool/ThemeColor/ThemeColor.m | 137 ------------------ .../Tool/TimeInterval/MewTimeIntervalUtils.h | 17 +++ ...IntervalUtils.m => MewTimeIntervalUtils.m} | 21 ++- .../Tool/TimeInterval/TimeIntervalUtils.h | 19 --- .../yinmeng-ios/Base/Tool/Timer/MEWTimer.h | 21 +++ .../Tool/Timer/{YMWeakTimer.m => MEWTimer.m} | 29 ++-- .../yinmeng-ios/Base/Tool/Timer/YMWeakTimer.h | 24 --- .../Base/Tool/YYUtility/YYUtility+Carrier.m | 88 ----------- .../Base/Tool/YYUtility/YYUtility+Device.m | 4 +- .../Base/UI/BaseNavigationController.m | 14 +- .../yinmeng-ios/Base/UI/BaseViewController.m | 10 +- .../Base/UI/EmptyView/YMEmptyTableViewCell.m | 4 +- .../UI/TTPopup/Config/TTActionSheetConfig.m | 4 +- .../Base/UI/TTPopup/Config/TTAlertConfig.m | 20 +-- .../Base/UI/TTPopup/View/TTActionSheetView.m | 6 +- .../Base/UI/TTPopup/View/TTAlertView.m | 14 +- yinmeng-ios/yinmeng-ios/Global/YMEnum.h | 2 +- .../Main/ClientConfig/ClientConfig.m | 6 +- .../Mew/Home/Presenter/MewHomePresenter.m | 20 +-- .../Mew/Home/View/MewHomeViewController.m | 16 +- .../Mew/Home/View/SubView/MewHeaderView.m | 10 +- .../Mew/Home/View/SubView/MewPlayVoiceView.m | 14 +- .../View/SubView/MewPushExclusiveVoiceView.m | 48 +++--- .../View/SubView/MewRightFollowVoiceView.m | 12 +- .../Mew/Home/View/SubView/MewShowVoiceView.m | 2 +- .../View/SubView/MewUserIntroductionView.m | 22 +-- .../Mew/Home/View/SubView/MewVoiceGuideView.m | 6 +- .../Mew/Home/View/SubView/YMHomeFilterView.m | 6 +- .../Mew/Login/View/MewLoginViewController.m | 34 ++--- .../Login/View/SubView/MewLoginPasswordView.m | 16 +- .../Login/View/SubView/MewLoginPhoneView.m | 24 +-- .../SessionList/MewSessionListTableViewCell.m | 12 +- .../View/MewMineCollectionViewController.m | 9 +- .../Main/Mew/Mine/View/MewRechargeSubView.m | 24 +-- .../Mew/Mine/View/MewRechargeViewController.m | 38 ++--- .../View/MewPartyListCollectionViewCell.m | 10 +- .../RoomMessageView/MewRoomMessageTableCell.m | 6 +- .../RoomMicroView/MewSocialMicroView.m | 2 +- .../Main/Tabbar/Presenter/MainPresenter.m | 8 +- .../Main/Tabbar/View/TabbarViewController.m | 46 +++--- .../yinmeng-ios/Main/YMWebViewController.m | 40 ++--- .../YinMeng/Home/Presenter/YMHomePresenter.m | 4 +- .../Main/YinMeng/IM/Model/AttachmentModel.m | 4 +- .../YinMeng/IM/Tool/CustomAttachmentDecoder.m | 2 +- .../Login/Presenter/LoginFullInfoPresenter.m | 20 +-- .../Login/Presenter/LoginPasswordPresent.m | 2 +- .../YinMeng/Login/Presenter/LoginPresenter.m | 2 +- .../Login/Presenter/LoginVerifCodePresent.m | 2 +- .../View/CustomView/LoginForgetEditView.m | 12 +- .../Login/View/CustomView/LoginInputView.m | 12 +- .../View/LoginBindPhoneResultViewController.m | 12 +- .../Login/View/LoginBindPhoneViewController.m | 12 +- .../View/LoginForgetPasswordViewController.m | 24 +-- .../Login/View/LoginFullInfoViewController.m | 14 +- .../View/LoginVerifBindPhoneViewController.m | 50 +++---- .../View/MineLoginPasswordViewController.m | 6 +- .../YinMeng/Message/Model/ChatLimitModel.h | 2 +- .../Message/Presenter/CHMessagePresenter.m | 4 +- .../View/Session/CHMessageConentAudioView.m | 9 +- .../Session/CHSessionInfoViewController.m | 20 +-- .../View/Session/CHSessionMessageCell.m | 4 +- .../Message/View/Session/CHSessionNavView.m | 8 +- .../View/Session/CHSessionToolbarView.m | 28 ++-- .../Session/Content/CHMessageContentText.m | 9 +- .../Content/CHMessageContentUnSupportView.m | 4 +- .../View/Session/SessionViewController.m | 34 +++-- .../Mine/Model/Recharge/RechargeListModel.h | 2 +- .../Mine/Model/Recharge/WalletInfoModel.h | 2 +- .../Mine/Presenter/MineRechargePresenter.m | 8 +- .../Presenter/YMMineCollectRoomPresenter.m | 2 +- .../Mine/Presenter/YMMineSettingPresenter.m | 2 +- .../CollectRoom/Cell/YMMineCollectRoomCell.m | 6 +- .../YMMineCollectRoomViewController.m | 12 +- .../Setting/Cell/YMMineSettingTableViewCell.m | 4 +- .../Setting/YMMineAboutUsViewController.m | 8 +- .../Setting/YMMineSettingViewController.m | 18 +-- .../Mine/View/SubView/MineModifPayPwdView.m | 12 +- .../SendGiftView/Model/GiftReceiveInfoModel.h | 2 +- .../SendGiftView/Presenter/YMGiftStorage.m | 10 +- .../YinMeng/Room/Presenter/YMRoomPresenter.m | 16 +- .../AnimationView/YMRoomAnimationHitView.m | 4 +- .../AnimationView/YMRoomGiftAnimationParser.m | 97 +++++++++++++ .../YinMeng/Room/View/MEWThemeColor+MEWRoom.h | 63 ++++++++ .../YinMeng/Room/View/MEWThemeColor+MEWRoom.m | 112 ++++++++++++++ .../CHRoomMessageHeaderView.m | 15 +- .../Model/YMMessageRemoteExtModel.h | 2 +- .../View/YMNetImageYYLabel.m | 6 +- .../Room/View/StageView/MicroView/MicroView.m | 14 +- .../View/StageView/Model/MicroQueueModel.h | 2 +- .../View/StageView/Model/MicroStateModel.h | 2 +- .../Main/YinMeng/Room/View/ThemeColor+Room.h | 35 ----- .../Main/YinMeng/Room/View/ThemeColor+Room.m | 61 -------- 130 files changed, 1308 insertions(+), 1401 deletions(-) delete mode 100644 yinmeng-ios/yinmeng-ios/Base/Tool/CountDown/CountDownHelper.h delete mode 100644 yinmeng-ios/yinmeng-ios/Base/Tool/CountDown/CountDownHelper.m create mode 100644 yinmeng-ios/yinmeng-ios/Base/Tool/CountDown/MEWCountDownHelper.h create mode 100644 yinmeng-ios/yinmeng-ios/Base/Tool/CountDown/MEWCountDownHelper.m rename yinmeng-ios/yinmeng-ios/Base/Tool/File/{UploadFile.h => MEWUploadFile.h} (53%) rename yinmeng-ios/yinmeng-ios/Base/Tool/File/{UploadFile.m => MEWUploadFile.m} (62%) delete mode 100644 yinmeng-ios/yinmeng-ios/Base/Tool/GCDHelper/GCDHelper.h delete mode 100644 yinmeng-ios/yinmeng-ios/Base/Tool/GCDHelper/GCDHelper.m create mode 100644 yinmeng-ios/yinmeng-ios/Base/Tool/GCDHelper/MEWGCDHelper.h create mode 100644 yinmeng-ios/yinmeng-ios/Base/Tool/GCDHelper/MEWGCDHelper.m create mode 100644 yinmeng-ios/yinmeng-ios/Base/Tool/IAPHelper/MEWRechargeStorage.h rename yinmeng-ios/yinmeng-ios/Base/Tool/IAPHelper/{RechargeStorage.m => MEWRechargeStorage.m} (71%) delete mode 100644 yinmeng-ios/yinmeng-ios/Base/Tool/IAPHelper/RechargeStorage.h delete mode 100644 yinmeng-ios/yinmeng-ios/Base/Tool/IAPHelper/YMIAPHelper.h delete mode 100644 yinmeng-ios/yinmeng-ios/Base/Tool/IAPHelper/YMIAPHelper.m rename yinmeng-ios/yinmeng-ios/Base/Tool/{YMHUDTool.h => MewHUDTool.h} (94%) rename yinmeng-ios/yinmeng-ios/Base/Tool/{YMHUDTool.m => MewHUDTool.m} (95%) rename yinmeng-ios/yinmeng-ios/Base/Tool/{NSObject+MJExtension.h => NSObject+MEWExtension.h} (55%) rename yinmeng-ios/yinmeng-ios/Base/Tool/{NSObject+MJExtension.m => NSObject+MEWExtension.m} (56%) create mode 100644 yinmeng-ios/yinmeng-ios/Base/Tool/Safe/NSArray+MewSafe.h rename yinmeng-ios/yinmeng-ios/Base/Tool/Safe/{NSArray+Safe.m => NSArray+MewSafe.m} (53%) delete mode 100644 yinmeng-ios/yinmeng-ios/Base/Tool/Safe/NSArray+Safe.h create mode 100644 yinmeng-ios/yinmeng-ios/Base/Tool/Safe/NSMutableDictionary+MEWSafe.h create mode 100644 yinmeng-ios/yinmeng-ios/Base/Tool/Safe/NSMutableDictionary+MEWSafe.m delete mode 100644 yinmeng-ios/yinmeng-ios/Base/Tool/Safe/NSMutableDictionary+Safe.h delete mode 100644 yinmeng-ios/yinmeng-ios/Base/Tool/Safe/NSMutableDictionary+Safe.m rename yinmeng-ios/yinmeng-ios/Base/Tool/Security/{Base64.h => MEWBase64.h} (63%) rename yinmeng-ios/yinmeng-ios/Base/Tool/Security/{Base64.m => MEWBase64.m} (96%) create mode 100644 yinmeng-ios/yinmeng-ios/Base/Tool/ThemeColor/MEWThemeColor.h create mode 100644 yinmeng-ios/yinmeng-ios/Base/Tool/ThemeColor/MEWThemeColor.m delete mode 100644 yinmeng-ios/yinmeng-ios/Base/Tool/ThemeColor/ThemeColor.h delete mode 100644 yinmeng-ios/yinmeng-ios/Base/Tool/ThemeColor/ThemeColor.m create mode 100644 yinmeng-ios/yinmeng-ios/Base/Tool/TimeInterval/MewTimeIntervalUtils.h rename yinmeng-ios/yinmeng-ios/Base/Tool/TimeInterval/{TimeIntervalUtils.m => MewTimeIntervalUtils.m} (85%) delete mode 100644 yinmeng-ios/yinmeng-ios/Base/Tool/TimeInterval/TimeIntervalUtils.h create mode 100644 yinmeng-ios/yinmeng-ios/Base/Tool/Timer/MEWTimer.h rename yinmeng-ios/yinmeng-ios/Base/Tool/Timer/{YMWeakTimer.m => MEWTimer.m} (56%) delete mode 100644 yinmeng-ios/yinmeng-ios/Base/Tool/Timer/YMWeakTimer.h delete mode 100644 yinmeng-ios/yinmeng-ios/Base/Tool/YYUtility/YYUtility+Carrier.m create mode 100644 yinmeng-ios/yinmeng-ios/Main/YinMeng/Room/View/AnimationView/YMRoomGiftAnimationParser.m create mode 100644 yinmeng-ios/yinmeng-ios/Main/YinMeng/Room/View/MEWThemeColor+MEWRoom.h create mode 100644 yinmeng-ios/yinmeng-ios/Main/YinMeng/Room/View/MEWThemeColor+MEWRoom.m delete mode 100644 yinmeng-ios/yinmeng-ios/Main/YinMeng/Room/View/ThemeColor+Room.h delete mode 100644 yinmeng-ios/yinmeng-ios/Main/YinMeng/Room/View/ThemeColor+Room.m diff --git a/yinmeng-ios/yinmeng-ios/Base/Base.h b/yinmeng-ios/yinmeng-ios/Base/Base.h index 4ebdfb8..17ba557 100644 --- a/yinmeng-ios/yinmeng-ios/Base/Base.h +++ b/yinmeng-ios/yinmeng-ios/Base/Base.h @@ -20,7 +20,7 @@ ({BOOL isEnterprise = NO;\ if (@available(iOS 11.0, *)) {\ NSString *bundleID = [[[NSBundle mainBundle] infoDictionary] objectForKey:@"CFBundleIdentifier"];\ - isEnterprise = [bundleID isEqualToString:@"com.yinyou.enterprise.ios"];\ + isEnterprise = [bundleID isEqualToString:@"linyudan.yinmeng-ios"];\ }\ (isEnterprise);}) diff --git a/yinmeng-ios/yinmeng-ios/Base/MVP/Model/AccountModel.h b/yinmeng-ios/yinmeng-ios/Base/MVP/Model/AccountModel.h index 7372132..28a40bc 100644 --- a/yinmeng-ios/yinmeng-ios/Base/MVP/Model/AccountModel.h +++ b/yinmeng-ios/yinmeng-ios/Base/MVP/Model/AccountModel.h @@ -5,7 +5,7 @@ // Created by 触海 on 2023/11/6. // -#import "NSObject+MJExtension.h" +#import "NSObject+MEWExtension.h" NS_ASSUME_NONNULL_BEGIN diff --git a/yinmeng-ios/yinmeng-ios/Base/MVP/Model/BaseModel.h b/yinmeng-ios/yinmeng-ios/Base/MVP/Model/BaseModel.h index b1e6890..b488cc5 100644 --- a/yinmeng-ios/yinmeng-ios/Base/MVP/Model/BaseModel.h +++ b/yinmeng-ios/yinmeng-ios/Base/MVP/Model/BaseModel.h @@ -5,7 +5,7 @@ // Created by 触海 on 2023/11/6. // -#import "NSObject+MJExtension.h" +#import "NSObject+MEWExtension.h" NS_ASSUME_NONNULL_BEGIN diff --git a/yinmeng-ios/yinmeng-ios/Base/MVP/Model/UserInfoModel.h b/yinmeng-ios/yinmeng-ios/Base/MVP/Model/UserInfoModel.h index 26005af..ab265c7 100644 --- a/yinmeng-ios/yinmeng-ios/Base/MVP/Model/UserInfoModel.h +++ b/yinmeng-ios/yinmeng-ios/Base/MVP/Model/UserInfoModel.h @@ -5,7 +5,7 @@ // Created by 触海 on 2023/11/6. // -#import "NSObject+MJExtension.h" +#import "NSObject+MEWExtension.h" #import "YMEnum.h" #import "UserVipInfoVo.h" diff --git a/yinmeng-ios/yinmeng-ios/Base/MVP/Presenter/BaseMvpPresenter.m b/yinmeng-ios/yinmeng-ios/Base/MVP/Presenter/BaseMvpPresenter.m index e85eb42..c777822 100644 --- a/yinmeng-ios/yinmeng-ios/Base/MVP/Presenter/BaseMvpPresenter.m +++ b/yinmeng-ios/yinmeng-ios/Base/MVP/Presenter/BaseMvpPresenter.m @@ -89,7 +89,7 @@ [[self getView] completeUserInfo]; return; case 3009: // 账号已注销 - [[self getView] accountCanceled:data.model2dictionary]; + [[self getView] accountCanceled:data.mewModel2dictionary]; return; default: break; diff --git a/yinmeng-ios/yinmeng-ios/Base/Net/HttpRequestHelper.m b/yinmeng-ios/yinmeng-ios/Base/Net/HttpRequestHelper.m index de45d1b..0035e0d 100644 --- a/yinmeng-ios/yinmeng-ios/Base/Net/HttpRequestHelper.m +++ b/yinmeng-ios/yinmeng-ios/Base/Net/HttpRequestHelper.m @@ -84,9 +84,9 @@ static BOOL isShowing = NO; AFHTTPSessionManager *manager = [HttpRequestHelper requestManager]; [manager GET:method parameters:params headers:nil progress:nil success:^(NSURLSessionDataTask * _Nonnull task, id _Nullable responseObject) { - BaseModel *baseModel = [BaseModel modelWithDictionary:responseObject]; + BaseModel *baseModel = [BaseModel mewModelWithDictionary:responseObject]; #ifdef DEBUG - NSLog(@"\n%@", [baseModel toJSONString]); + NSLog(@"\n%@", [baseModel mewToJSONString]); #endif success(baseModel); } failure:^(NSURLSessionDataTask * _Nullable task, NSError * _Nonnull error) { @@ -116,9 +116,9 @@ static BOOL isShowing = NO; AFHTTPSessionManager *manager = [HttpRequestHelper requestManager]; [manager POST:method parameters:params headers:nil progress:nil success:^(NSURLSessionDataTask * _Nonnull task, id _Nullable responseObject) { - BaseModel *baseModel = [BaseModel modelWithDictionary:responseObject]; + BaseModel *baseModel = [BaseModel mewModelWithDictionary:responseObject]; #ifdef DEBUG - NSLog(@"\n%@", [baseModel toJSONString]); + NSLog(@"\n%@", [baseModel mewToJSONString]); #endif success(baseModel); } failure:^(NSURLSessionDataTask * _Nullable task, NSError * _Nonnull error) { @@ -148,9 +148,9 @@ static BOOL isShowing = NO; AFHTTPSessionManager *manager = [HttpRequestHelper requestManager]; [manager DELETE:method parameters:params headers:nil success:^(NSURLSessionDataTask * _Nonnull task, id _Nullable responseObject) { - BaseModel *baseModel = [BaseModel modelWithDictionary:responseObject]; + BaseModel *baseModel = [BaseModel mewModelWithDictionary:responseObject]; #ifdef DEBUG - NSLog(@"\n%@", [baseModel toJSONString]); + NSLog(@"\n%@", [baseModel mewToJSONString]); #endif success(baseModel); } failure:^(NSURLSessionDataTask * _Nullable task, NSError * _Nonnull error) { diff --git a/yinmeng-ios/yinmeng-ios/Base/Tool/CountDown/CountDownHelper.h b/yinmeng-ios/yinmeng-ios/Base/Tool/CountDown/CountDownHelper.h deleted file mode 100644 index 4456013..0000000 --- a/yinmeng-ios/yinmeng-ios/Base/Tool/CountDown/CountDownHelper.h +++ /dev/null @@ -1,32 +0,0 @@ -// -// CountDownHelper.h -// mew-ios -// -// Created by 触海 on 2023/11/9. -// - -#import - -NS_ASSUME_NONNULL_BEGIN - -@protocol CountDownHelperDelegate -@optional -///倒计时结束 -- (void)onCountdownFinish; -///倒计时进行 -- (void)onCountdownOpen:(int)time; - -@end - - -@interface CountDownHelper : NSObject -+ (instancetype)shareHelper; -// 停止倒计时 -- (void)stopCountDown; -///开始倒计时 -- (void)openCountdownWithTime:(int)totalTime; -///代理 -@property (nonatomic,assign) id delegate; -@end - -NS_ASSUME_NONNULL_END diff --git a/yinmeng-ios/yinmeng-ios/Base/Tool/CountDown/CountDownHelper.m b/yinmeng-ios/yinmeng-ios/Base/Tool/CountDown/CountDownHelper.m deleted file mode 100644 index 2bf2225..0000000 --- a/yinmeng-ios/yinmeng-ios/Base/Tool/CountDown/CountDownHelper.m +++ /dev/null @@ -1,68 +0,0 @@ -// -// CountDownHelper.m -// mew-ios -// -// Created by 触海 on 2023/11/9. -// - -#import "CountDownHelper.h" - -@interface CountDownHelper () -@property (strong, nonatomic) dispatch_source_t timer; -@end - -@implementation CountDownHelper - -+ (instancetype)shareHelper { - static dispatch_once_t onceToken; - static CountDownHelper * helper = nil; - dispatch_once(&onceToken, ^{ - helper = [[CountDownHelper alloc] init]; - }); - return helper; -} - -// 停止倒计时 -- (void)stopCountDown { - if (self.timer != nil) { - dispatch_source_cancel(self.timer); - self.timer = nil; - } -} - -// 开始倒计时 -- (void)openCountdownWithTime:(int)totalTime{ - if (time <= 0) { - return; - } - __block int time = totalTime; //倒计时时间 - if (self.timer != nil) { - dispatch_source_cancel(self.timer); - } - dispatch_queue_t queue = dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0); - self.timer = dispatch_source_create(DISPATCH_SOURCE_TYPE_TIMER, 0, 0, queue); - dispatch_source_set_timer(self.timer,dispatch_walltime(NULL, 0),1.0*NSEC_PER_SEC, 0); //每秒执行 - __weak typeof(self) weakself = self; - dispatch_source_set_event_handler(self.timer, ^{ - __strong typeof(weakself) self = weakself; - if(time <= 0){ //倒计时结束,关闭 - dispatch_source_cancel(self.timer); - dispatch_async(dispatch_get_main_queue(), ^{ - if (self.delegate && [self.delegate respondsToSelector:@selector(onCountdownFinish)]) { - [self.delegate onCountdownFinish]; - } - }); - }else{ - time--; - dispatch_async(dispatch_get_main_queue(), ^{ - //设置按钮显示读秒效果 - if (self.delegate && [self.delegate respondsToSelector:@selector(onCountdownOpen:)]) { - [self.delegate onCountdownOpen:time]; - } - }); - - } - }); - dispatch_resume(self.timer); -} -@end diff --git a/yinmeng-ios/yinmeng-ios/Base/Tool/CountDown/MEWCountDownHelper.h b/yinmeng-ios/yinmeng-ios/Base/Tool/CountDown/MEWCountDownHelper.h new file mode 100644 index 0000000..97845e5 --- /dev/null +++ b/yinmeng-ios/yinmeng-ios/Base/Tool/CountDown/MEWCountDownHelper.h @@ -0,0 +1,29 @@ +// +// MEWCountDownHelper.h +// yinmeng-ios +// +// Created by duoban on 2023/12/1. +// + +#import + +NS_ASSUME_NONNULL_BEGIN +@protocol MEWCountDownHelperDelegate +@optional +///倒计时结束 +- (void)mewOnCountdownFinish; +///倒计时进行 +- (void)mewOnCountdownOpen:(int)time; + +@end +@interface MEWCountDownHelper : NSObject ++ (instancetype)shareHelper; +// 停止倒计时 +- (void)mewStopCountDown; +///开始倒计时 +- (void)mewOpenCountdownWithTime:(int)totalTime; +///代理 +@property (nonatomic,assign) id delegate; +@end + +NS_ASSUME_NONNULL_END diff --git a/yinmeng-ios/yinmeng-ios/Base/Tool/CountDown/MEWCountDownHelper.m b/yinmeng-ios/yinmeng-ios/Base/Tool/CountDown/MEWCountDownHelper.m new file mode 100644 index 0000000..0303ac3 --- /dev/null +++ b/yinmeng-ios/yinmeng-ios/Base/Tool/CountDown/MEWCountDownHelper.m @@ -0,0 +1,65 @@ +// +// MEWCountDownHelper.m +// yinmeng-ios +// +// Created by duoban on 2023/12/1. +// + +#import "MEWCountDownHelper.h" +@interface MEWCountDownHelper() +@property (strong, nonatomic) dispatch_source_t mew_timer; +@end +@implementation MEWCountDownHelper ++ (instancetype)shareHelper { + static dispatch_once_t onceToken; + static MEWCountDownHelper * helper = nil; + dispatch_once(&onceToken, ^{ + helper = [[MEWCountDownHelper alloc] init]; + }); + return helper; +} + +// 停止倒计时 +- (void)mewStopCountDown { + if (self.mew_timer != nil) { + dispatch_source_cancel(self.mew_timer); + self.mew_timer = nil; + } +} + +// 开始倒计时 +- (void)mewOpenCountdownWithTime:(int)totalTime{ + if (time <= 0) { + return; + } + __block int time = totalTime; //倒计时时间 + if (self.mew_timer != nil) { + dispatch_source_cancel(self.mew_timer); + } + dispatch_queue_t queue = dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0); + self.mew_timer = dispatch_source_create(DISPATCH_SOURCE_TYPE_TIMER, 0, 0, queue); + dispatch_source_set_timer(self.mew_timer,dispatch_walltime(NULL, 0),1.0*NSEC_PER_SEC, 0); //每秒执行 + __weak typeof(self) weakself = self; + dispatch_source_set_event_handler(self.mew_timer, ^{ + __strong typeof(weakself) self = weakself; + if(time <= 0){ //倒计时结束,关闭 + dispatch_source_cancel(self.mew_timer); + dispatch_async(dispatch_get_main_queue(), ^{ + if (self.delegate && [self.delegate respondsToSelector:@selector(mewOnCountdownFinish)]) { + [self.delegate mewOnCountdownFinish]; + } + }); + }else{ + time--; + dispatch_async(dispatch_get_main_queue(), ^{ + //设置按钮显示读秒效果 + if (self.delegate && [self.delegate respondsToSelector:@selector(mewOnCountdownOpen:)]) { + [self.delegate mewOnCountdownOpen:time]; + } + }); + + } + }); + dispatch_resume(self.mew_timer); +} +@end diff --git a/yinmeng-ios/yinmeng-ios/Base/Tool/File/UploadFile.h b/yinmeng-ios/yinmeng-ios/Base/Tool/File/MEWUploadFile.h similarity index 53% rename from yinmeng-ios/yinmeng-ios/Base/Tool/File/UploadFile.h rename to yinmeng-ios/yinmeng-ios/Base/Tool/File/MEWUploadFile.h index 6fe0f7f..1ea28c5 100644 --- a/yinmeng-ios/yinmeng-ios/Base/Tool/File/UploadFile.h +++ b/yinmeng-ios/yinmeng-ios/Base/Tool/File/MEWUploadFile.h @@ -1,28 +1,26 @@ // -// UploadFile.h -// mew-ios +// MEWUploadFile.h +// yinmeng-ios // -// Created by 触海 on 2023/11/15. +// Created by duoban on 2023/12/1. // #import NS_ASSUME_NONNULL_BEGIN -@interface UploadFile : NSObject - +@interface MEWUploadFile : NSObject /// 上传一个文件 /// @param filePath 文件地址 /// @param fileName 文件的名字 /// @param token token /// @param success 成功 /// @param failure 失败 -+ (void)uploadFile:(NSString *)filePath ++ (void)mewUploadFile:(NSString *)filePath named:(NSString *)fileName token:(NSString *)token - success:(void (^)(NSString *key, NSDictionary *resp))success - failure:(void (^)(NSNumber *resCode, NSString *message))failure; - + success:(void (^)(NSString *key, NSDictionary *res))success + failure:(void (^)(NSNumber *code, NSString *message))failure; @end diff --git a/yinmeng-ios/yinmeng-ios/Base/Tool/File/UploadFile.m b/yinmeng-ios/yinmeng-ios/Base/Tool/File/MEWUploadFile.m similarity index 62% rename from yinmeng-ios/yinmeng-ios/Base/Tool/File/UploadFile.m rename to yinmeng-ios/yinmeng-ios/Base/Tool/File/MEWUploadFile.m index 61dbf3b..de22d9e 100644 --- a/yinmeng-ios/yinmeng-ios/Base/Tool/File/UploadFile.m +++ b/yinmeng-ios/yinmeng-ios/Base/Tool/File/MEWUploadFile.m @@ -1,38 +1,34 @@ // -// UploadFile.m -// mew-ios +// MEWUploadFile.m +// yinmeng-ios // -// Created by 触海 on 2023/11/15. +// Created by duoban on 2023/12/1. // -#import "UploadFile.h" +#import "MEWUploadFile.h" #import - -@implementation UploadFile - +@implementation MEWUploadFile /// 上传一个文件 /// @param filePath 文件地址 /// @param fileName 文件的名字 /// @param token token /// @param success 成功 /// @param failure 失败 -+ (void)uploadFile:(NSString *)filePath ++ (void)mewUploadFile:(NSString *)filePath named:(NSString *)fileName token:(NSString *)token - success:(void (^)(NSString *key, NSDictionary *resp))success - failure:(void (^)(NSNumber *resCode, NSString *message))failure { + success:(void (^)(NSString *key, NSDictionary *res))success + failure:(void (^)(NSNumber *code, NSString *message))failure{ QNConfiguration *config = [QNConfiguration build:^(QNConfigurationBuilder *builder) { builder.zone = [QNFixedZone zone2]; }]; QNUploadManager *upManager = [[QNUploadManager alloc] initWithConfiguration:config]; - [upManager putFile:filePath key:fileName token:token complete:^(QNResponseInfo *info, NSString *key, NSDictionary *resp) { - if (resp) { - success(key, resp); + [upManager putFile:filePath key:fileName token:token complete:^(QNResponseInfo *info, NSString *key, NSDictionary *res) { + if (res) { + success(key, res); } else { failure(@(info.statusCode), info.error.localizedDescription); } } option:nil]; - } - @end diff --git a/yinmeng-ios/yinmeng-ios/Base/Tool/GCDHelper/GCDHelper.h b/yinmeng-ios/yinmeng-ios/Base/Tool/GCDHelper/GCDHelper.h deleted file mode 100644 index 151c52f..0000000 --- a/yinmeng-ios/yinmeng-ios/Base/Tool/GCDHelper/GCDHelper.h +++ /dev/null @@ -1,11 +0,0 @@ -// -// GCDHelper.h -// YYMobileFramework -// -// Created by wuwei on 14/7/18. -// Copyright (c) 2014年 YY Inc. All rights reserved. -// - -#import - -void dispatch_main_sync_safe(dispatch_block_t block); diff --git a/yinmeng-ios/yinmeng-ios/Base/Tool/GCDHelper/GCDHelper.m b/yinmeng-ios/yinmeng-ios/Base/Tool/GCDHelper/GCDHelper.m deleted file mode 100644 index f4fc1a5..0000000 --- a/yinmeng-ios/yinmeng-ios/Base/Tool/GCDHelper/GCDHelper.m +++ /dev/null @@ -1,16 +0,0 @@ -// -// GCDHelper.m -// YYMobileFramework -// -// Created by wuwei on 14/7/18. -// Copyright (c) 2014年 YY Inc. All rights reserved. -// - -#import "GCDHelper.h" -void dispatch_main_sync_safe(dispatch_block_t block) { - if ([NSThread isMainThread]) { - block(); - }else { - dispatch_sync(dispatch_get_main_queue(), block); - } -} diff --git a/yinmeng-ios/yinmeng-ios/Base/Tool/GCDHelper/MEWGCDHelper.h b/yinmeng-ios/yinmeng-ios/Base/Tool/GCDHelper/MEWGCDHelper.h new file mode 100644 index 0000000..f506423 --- /dev/null +++ b/yinmeng-ios/yinmeng-ios/Base/Tool/GCDHelper/MEWGCDHelper.h @@ -0,0 +1,10 @@ +// +// MEWGCDHelper.h +// yinmeng-ios +// +// Created by duoban on 2023/12/1. +// + +#import + +void mew_dispatch_main_sync_safe(dispatch_block_t block); diff --git a/yinmeng-ios/yinmeng-ios/Base/Tool/GCDHelper/MEWGCDHelper.m b/yinmeng-ios/yinmeng-ios/Base/Tool/GCDHelper/MEWGCDHelper.m new file mode 100644 index 0000000..38549ea --- /dev/null +++ b/yinmeng-ios/yinmeng-ios/Base/Tool/GCDHelper/MEWGCDHelper.m @@ -0,0 +1,16 @@ +// +// MEWGCDHelper.m +// yinmeng-ios +// +// Created by duoban on 2023/12/1. +// + +#import "MEWGCDHelper.h" + +void mew_dispatch_main_sync_safe(dispatch_block_t block) { + if ([NSThread isMainThread]) { + block(); + }else { + dispatch_sync(dispatch_get_main_queue(), block); + } +} diff --git a/yinmeng-ios/yinmeng-ios/Base/Tool/IAPHelper/MEWRechargeStorage.h b/yinmeng-ios/yinmeng-ios/Base/Tool/IAPHelper/MEWRechargeStorage.h new file mode 100644 index 0000000..a9e137d --- /dev/null +++ b/yinmeng-ios/yinmeng-ios/Base/Tool/IAPHelper/MEWRechargeStorage.h @@ -0,0 +1,29 @@ +// +// MEWRechargeStorage.h +// yinmeng-ios +// +// Created by duoban on 2023/12/1. +// + +#import + +NS_ASSUME_NONNULL_BEGIN + +@interface MEWRechargeStorage : NSObject +/// 根据商品id保存凭证 ++ (BOOL)mewSaveTranscationId:(NSString *)transcationId + recipt:(NSString *)recipt + uid:(NSString *)uid; + +/// 获取所有凭证 ++ (NSArray *)mewGetAllReciptsWithUid:(NSString *)uid; + +/// 根据订单删除凭证 ++ (BOOL)mewDelegateTranscationId:(NSString *)transcationId + uid:(NSString *)uid; + +/// 删除所有凭证 ++ (void)mewDelegateAllTranscationIdsWithUid:(NSString *)uid; +@end + +NS_ASSUME_NONNULL_END diff --git a/yinmeng-ios/yinmeng-ios/Base/Tool/IAPHelper/RechargeStorage.m b/yinmeng-ios/yinmeng-ios/Base/Tool/IAPHelper/MEWRechargeStorage.m similarity index 71% rename from yinmeng-ios/yinmeng-ios/Base/Tool/IAPHelper/RechargeStorage.m rename to yinmeng-ios/yinmeng-ios/Base/Tool/IAPHelper/MEWRechargeStorage.m index 6383e4c..e02e6d3 100644 --- a/yinmeng-ios/yinmeng-ios/Base/Tool/IAPHelper/RechargeStorage.m +++ b/yinmeng-ios/yinmeng-ios/Base/Tool/IAPHelper/MEWRechargeStorage.m @@ -1,31 +1,30 @@ // -// RechargeStorage.m -// mew-ios +// MEWRechargeStorage.m +// yinmeng-ios // -// Created by 触海 on 2023/11/8. +// Created by duoban on 2023/12/1. // -#import "RechargeStorage.h" +#import "MEWRechargeStorage.h" #import -#define kappStoreKey @"kappStoreKey" - -@implementation RechargeStorage +#define kMewAppStoreKey @"kMewAppStoreKey" +@implementation MEWRechargeStorage /// 根据商品id保存凭证 -+ (BOOL)saveTranscationId:(NSString *)transcationId ++ (BOOL)mewSaveTranscationId:(NSString *)transcationId recipt:(NSString *)recipt uid:(NSString *)uid { - NSString * key = [NSString stringWithFormat:@"%@_%@", kappStoreKey, uid]; + NSString * key = [NSString stringWithFormat:@"%@_%@", kMewAppStoreKey, uid]; return [SSKeychain setPassword:recipt forService:key account:transcationId error:nil]; } /// 获取所有凭证 -+ (NSArray *)getAllReciptsWithUid:(NSString *)uid { ++ (NSArray *)mewGetAllReciptsWithUid:(NSString *)uid { NSArray *transcationIds = [SSKeychain allAccounts]; NSMutableArray *temArr = [NSMutableArray array]; [transcationIds enumerateObjectsUsingBlock:^(id _Nonnull obj, NSUInteger idx, BOOL * _Nonnull stop) { if ([obj[@"svce"] isKindOfClass:[NSString class]]) { - NSString * key = [NSString stringWithFormat:@"%@_%@", kappStoreKey, uid]; + NSString * key = [NSString stringWithFormat:@"%@_%@", kMewAppStoreKey, uid]; if ([obj[@"svce"] isEqualToString:key]) { NSString *recipt = [SSKeychain passwordForService:key account:obj[@"acct"] error:nil]; NSData *data = [recipt dataUsingEncoding:NSUTF8StringEncoding]; @@ -38,17 +37,17 @@ } /// 根据订单删除凭证 -+ (BOOL)delegateTranscationId:(NSString *)transcationId uid:(NSString *)uid { - NSString * key = [NSString stringWithFormat:@"%@_%@", kappStoreKey, uid]; ++ (BOOL)mewDelegateTranscationId:(NSString *)transcationId uid:(NSString *)uid { + NSString * key = [NSString stringWithFormat:@"%@_%@", kMewAppStoreKey, uid]; return [SSKeychain deletePasswordForService:key account:transcationId error:nil]; } /// 删除所有凭证 -+ (void)delegateAllTranscationIdsWithUid:(NSString *)uid { ++ (void)mewDelegateAllTranscationIdsWithUid:(NSString *)uid { NSArray *transcationIds = [SSKeychain allAccounts]; [transcationIds enumerateObjectsUsingBlock:^(id _Nonnull obj, NSUInteger idx, BOOL * _Nonnull stop) { if ([obj[@"svce"] isKindOfClass:[NSString class]]) { - NSString * key = [NSString stringWithFormat:@"%@_%@", kappStoreKey, uid]; + NSString * key = [NSString stringWithFormat:@"%@_%@", kMewAppStoreKey, uid]; if ([obj[@"svce"] isEqualToString:key]) { [SSKeychain deletePasswordForService:key account:obj[@"acct"]]; } @@ -56,5 +55,4 @@ }]; } - @end diff --git a/yinmeng-ios/yinmeng-ios/Base/Tool/IAPHelper/RechargeStorage.h b/yinmeng-ios/yinmeng-ios/Base/Tool/IAPHelper/RechargeStorage.h deleted file mode 100644 index b237b34..0000000 --- a/yinmeng-ios/yinmeng-ios/Base/Tool/IAPHelper/RechargeStorage.h +++ /dev/null @@ -1,31 +0,0 @@ -// -// RechargeStorage.h -// mew-ios -// -// Created by 触海 on 2023/11/8. -// - -#import - -NS_ASSUME_NONNULL_BEGIN - -@interface RechargeStorage : NSObject - -/// 根据商品id保存凭证 -+ (BOOL)saveTranscationId:(NSString *)transcationId - recipt:(NSString *)recipt - uid:(NSString *)uid; - -/// 获取所有凭证 -+ (NSArray *)getAllReciptsWithUid:(NSString *)uid; - -/// 根据订单删除凭证 -+ (BOOL)delegateTranscationId:(NSString *)transcationId - uid:(NSString *)uid; - -/// 删除所有凭证 -+ (void)delegateAllTranscationIdsWithUid:(NSString *)uid; - -@end - -NS_ASSUME_NONNULL_END diff --git a/yinmeng-ios/yinmeng-ios/Base/Tool/IAPHelper/YMIAPHelper.h b/yinmeng-ios/yinmeng-ios/Base/Tool/IAPHelper/YMIAPHelper.h deleted file mode 100644 index a8f0c67..0000000 --- a/yinmeng-ios/yinmeng-ios/Base/Tool/IAPHelper/YMIAPHelper.h +++ /dev/null @@ -1,38 +0,0 @@ -// -// YMIAPHelper.h -// mew-ios -// -// Created by 触海 on 2023/11/8. -// - -#import - -NS_ASSUME_NONNULL_BEGIN - -typedef NS_ENUM(NSInteger ,PaymentStatus) { - PaymentStatus_Purchasing = 1,//付款中 - PaymentStatus_Purchased, //付款操作已经完成 - PaymentStatus_Failed, //付款操作失败 - PaymentStatus_Deferred, //未知状态 -}; - -@protocol YMIAPHelperDelegate -@optional -///当前充值的状态 -- (void)rechargeProcessStatus:(PaymentStatus)status; - -///充值成功回调id -- (void)rechargeSuccess:(NSString *)transactionIdentifier; -@end - -@interface YMIAPHelper : NSObject - -+ (instancetype)shareHelper; -///代理 -@property (nonatomic,weak) id delegate; -///购买商品 -- (void)buyAppProductWithAppProductId:(NSString *)appProductId; -@end - - -NS_ASSUME_NONNULL_END diff --git a/yinmeng-ios/yinmeng-ios/Base/Tool/IAPHelper/YMIAPHelper.m b/yinmeng-ios/yinmeng-ios/Base/Tool/IAPHelper/YMIAPHelper.m deleted file mode 100644 index 13bd3b2..0000000 --- a/yinmeng-ios/yinmeng-ios/Base/Tool/IAPHelper/YMIAPHelper.m +++ /dev/null @@ -1,96 +0,0 @@ -// -// YMIAPHelper.m -// mew-ios -// -// Created by 触海 on 2023/11/8. -// - -#import "YMIAPHelper.h" -#import -#import - -@implementation YMIAPHelper -+ (instancetype)shareHelper { - static dispatch_once_t onceToken; - static YMIAPHelper * helper; - dispatch_once(&onceToken, ^{ - helper = [[YMIAPHelper alloc] init]; - }); - return helper; -} - - -- (void)buyAppProductWithAppProductId:(NSString *)appProductId { - NSSet* dataSet = [[NSSet alloc] initWithObjects:appProductId, nil]; - [IAPShare sharedHelper].iap = [[IAPHelper alloc] initWithProductIdentifiers:dataSet]; - [[IAPShare sharedHelper].iap requestProductsWithCompletion:^(SKProductsRequest *request, SKProductsResponse *response) { - if (response != nil && response.products.count) { - ///有这个内购的产品 - } else if (!response.products.count) { - ///请求内购产品失败,无产品数量 -#warning to do 此处埋点一个 没有内购产品 - if (self.delegate && [self.delegate respondsToSelector:@selector(rechargeProcessStatus:)]) { - [self.delegate rechargeProcessStatus:PaymentStatus_Failed]; - } - return; - } else if (!response) { -#warning to do 此处埋点一个 请求内购没有响应 - ///请求内购产品失败,内购无响应 - if (self.delegate && [self.delegate respondsToSelector:@selector(rechargeProcessStatus:)]) { - [self.delegate rechargeProcessStatus:PaymentStatus_Failed]; - } - return; - } else { -#warning to do 此处埋点一个 异常 发起付款失败 - ///异常 发起付款失败 - if (self.delegate && [self.delegate respondsToSelector:@selector(rechargeProcessStatus:)]) { - [self.delegate rechargeProcessStatus:PaymentStatus_Failed]; - } - return; - } - if (response.products.firstObject) { - [[IAPShare sharedHelper].iap buyProduct:response.products.firstObject onCompletion:^(SKPaymentTransaction *transcation) { - NSLog(@"%@",transcation.error.description); - switch(transcation.transactionState) { - case SKPaymentTransactionStatePurchased: { - NSLog(@"付款完成状态, 要做出相关的处理"); - [[SKPaymentQueue defaultQueue] finishTransaction:transcation]; - if (self.delegate && [self.delegate respondsToSelector:@selector(rechargeProcessStatus:)]) { - [self.delegate rechargeProcessStatus:PaymentStatus_Purchased]; - } - - if (self.delegate && [self.delegate respondsToSelector:@selector(rechargeSuccess:)]) { - [self.delegate rechargeSuccess:transcation.transactionIdentifier]; - } - //同步返回购买成功后,需要请求服务器二次校验 - } - break; - case SKPaymentTransactionStateFailed: { - [[SKPaymentQueue defaultQueue] finishTransaction:transcation]; - if (self.delegate && [self.delegate respondsToSelector:@selector(rechargeProcessStatus:)]) { - [self.delegate rechargeProcessStatus:PaymentStatus_Failed]; - } - } - break; - case SKPaymentTransactionStatePurchasing: { - NSLog(@"正在购买中"); - if (self.delegate && [self.delegate respondsToSelector:@selector(rechargeProcessStatus:)]) { - [self.delegate rechargeProcessStatus:PaymentStatus_Purchasing]; - } - } - break; - default: { - [[SKPaymentQueue defaultQueue] finishTransaction:transcation]; - if (self.delegate && [self.delegate respondsToSelector:@selector(rechargeProcessStatus:)]) { - [self.delegate rechargeProcessStatus:PaymentStatus_Deferred]; - } - NSLog(@"其它"); - } - } - }]; - } - }]; -} - - -@end diff --git a/yinmeng-ios/yinmeng-ios/Base/Tool/YMHUDTool.h b/yinmeng-ios/yinmeng-ios/Base/Tool/MewHUDTool.h similarity index 94% rename from yinmeng-ios/yinmeng-ios/Base/Tool/YMHUDTool.h rename to yinmeng-ios/yinmeng-ios/Base/Tool/MewHUDTool.h index 852f3cf..8d538bc 100644 --- a/yinmeng-ios/yinmeng-ios/Base/Tool/YMHUDTool.h +++ b/yinmeng-ios/yinmeng-ios/Base/Tool/MewHUDTool.h @@ -1,15 +1,15 @@ // -// YMHUDTool.h -// mew-ios +// MewHUDTool.h +// yinmeng-ios // -// Created by 触海 on 2023/11/6. +// Created by duoban on 2023/12/1. // +#import #import - NS_ASSUME_NONNULL_BEGIN -@interface YMHUDTool : NSObject +@interface MewHUDTool : NSObject /** showGIFLoading使用注意: 1.谁负责showLoading, 谁负责hideHUD diff --git a/yinmeng-ios/yinmeng-ios/Base/Tool/YMHUDTool.m b/yinmeng-ios/yinmeng-ios/Base/Tool/MewHUDTool.m similarity index 95% rename from yinmeng-ios/yinmeng-ios/Base/Tool/YMHUDTool.m rename to yinmeng-ios/yinmeng-ios/Base/Tool/MewHUDTool.m index 2f26db8..ef8f5a5 100644 --- a/yinmeng-ios/yinmeng-ios/Base/Tool/YMHUDTool.m +++ b/yinmeng-ios/yinmeng-ios/Base/Tool/MewHUDTool.m @@ -1,20 +1,16 @@ // -// YMHUDTool.m -// mew-ios +// MewHUDTool.m +// yinmeng-ios // -// Created by 触海 on 2023/11/6. +// Created by duoban on 2023/12/1. // -#import "YMHUDTool.h" +#import "MewHUDTool.h" #import -#import "GCDHelper.h" +#import "MEWGCDHelper.h" #define kDelayTime 2.5 -@interface YMHUDTool() -@end - -@implementation YMHUDTool - +@implementation MewHUDTool static NSArray * _animationImages = nil; /** @@ -23,7 +19,7 @@ static NSArray * _animationImages = nil; @param view view */ + (void)hideHUDInView:(nullable UIView *)view { - dispatch_main_sync_safe(^{ + mew_dispatch_main_sync_safe(^{ if (view) { [MBProgressHUD hideHUDForView:view animated:NO]; [MBProgressHUD hideHUDForView:[UIApplication sharedApplication].keyWindow animated:NO]; @@ -70,7 +66,7 @@ static NSArray * _animationImages = nil; if (message.length == 0) { return; } __block UIView *inView = view; - dispatch_main_sync_safe(^{ + mew_dispatch_main_sync_safe(^{ if (!inView) { inView = [UIApplication sharedApplication].keyWindow; } @@ -125,7 +121,7 @@ static NSArray * _animationImages = nil; [self hideHUDInView:view]; // 先隐藏 - dispatch_main_sync_safe(^{ + mew_dispatch_main_sync_safe(^{ MBProgressHUD *hud = [self normalProgressHUD:view]; hud.userInteractionEnabled = enabled; hud.mode = MBProgressHUDModeText; @@ -185,7 +181,7 @@ static NSArray * _animationImages = nil; } [self hideHUDInView:view]; - dispatch_main_sync_safe(^{ + mew_dispatch_main_sync_safe(^{ MBProgressHUD *hud = [MBProgressHUD showHUDAddedTo:view animated:YES]; hud.userInteractionEnabled = enabled; hud.bezelView.color = [[UIColor whiteColor] colorWithAlphaComponent:0.8]; diff --git a/yinmeng-ios/yinmeng-ios/Base/Tool/NSObject+MJExtension.h b/yinmeng-ios/yinmeng-ios/Base/Tool/NSObject+MEWExtension.h similarity index 55% rename from yinmeng-ios/yinmeng-ios/Base/Tool/NSObject+MJExtension.h rename to yinmeng-ios/yinmeng-ios/Base/Tool/NSObject+MEWExtension.h index 61a4d64..79d0a0e 100644 --- a/yinmeng-ios/yinmeng-ios/Base/Tool/NSObject+MJExtension.h +++ b/yinmeng-ios/yinmeng-ios/Base/Tool/NSObject+MEWExtension.h @@ -1,43 +1,41 @@ // -// NSObject+MJExtension.h -// mew-ios +// NSObject+MEWExtension.h +// yinmeng-ios // -// Created by 触海 on 2023/11/6. +// Created by duoban on 2023/12/1. // #import NS_ASSUME_NONNULL_BEGIN -@interface NSObject (MJExtension) - +@interface NSObject (MEWExtension) /// 依据数组初始化一个实例数组 /// @param json json 数据 -+ (NSArray *)modelsWithArray:(id)json; ++ (NSArray *)mewModelsWithArray:(id)json; /// 依据字典初始化一个实例 /// @param dictionary 字典 -+ (instancetype)modelWithDictionary:(NSDictionary *)dictionary; ++ (instancetype)mewModelWithDictionary:(NSDictionary *)dictionary; /// 依据JSON对象初始化一个实例 /// @param json json 数据 -+ (instancetype)modelWithJSON:(id)json; ++ (instancetype)mewModelWithJSON:(id)json; ///model 转字典 -- (NSDictionary *)model2dictionary; +- (NSDictionary *)mewModel2dictionary; ///转 json string -- (NSString *)toJSONString; +- (NSString *)mewToJSONString; ///转 json object -- (id)toJSONObject; +- (id)mewToJSONObject; ///扩展方法 按需索取 重写即可 ///如果一个模型中 包含一个数组 数组中是另一个模型 -+ (NSDictionary *)objectClassInArray; ++ (NSDictionary *)mewObjectClassInArray; ///如果一个模型中需要字段映射的话 比如id -> ID name -> other.name -+ (NSDictionary *)replacedKeyFromPropertyName; - ++ (NSDictionary *)mewReplacedKeyFromPropertyName; @end NS_ASSUME_NONNULL_END diff --git a/yinmeng-ios/yinmeng-ios/Base/Tool/NSObject+MJExtension.m b/yinmeng-ios/yinmeng-ios/Base/Tool/NSObject+MEWExtension.m similarity index 56% rename from yinmeng-ios/yinmeng-ios/Base/Tool/NSObject+MJExtension.m rename to yinmeng-ios/yinmeng-ios/Base/Tool/NSObject+MEWExtension.m index 8a4a6a9..29a6a91 100644 --- a/yinmeng-ios/yinmeng-ios/Base/Tool/NSObject+MJExtension.m +++ b/yinmeng-ios/yinmeng-ios/Base/Tool/NSObject+MEWExtension.m @@ -1,64 +1,61 @@ // -// NSObject+MJExtension.m -// mew-ios +// NSObject+MEWExtension.m +// yinmeng-ios // -// Created by 触海 on 2023/11/6. +// Created by duoban on 2023/12/1. // -#import "NSObject+MJExtension.h" +#import "NSObject+MEWExtension.h" #import - -@implementation NSObject (MJExtension) - +@implementation NSObject (MEWExtension) /// 依据数组初始化一个实例数组 /// @param json json 数据 -+ (NSArray *)modelsWithArray:(id)json { ++ (NSArray *)mewModelsWithArray:(id)json { return [self mj_objectArrayWithKeyValuesArray:json]; } /// 依据字典初始化一个实例 /// @param dictionary 字典 -+ (instancetype)modelWithDictionary:(NSDictionary *)dictionary { ++ (instancetype)mewModelWithDictionary:(NSDictionary *)dictionary { return [self mj_objectWithKeyValues:dictionary]; } /// 依据JSON对象初始化一个实例 /// @param json json 数据 -+ (instancetype)modelWithJSON:(id)json { ++ (instancetype)mewModelWithJSON:(id)json { return [self mj_objectWithKeyValues:json]; } ///model 转字典 -- (NSDictionary *)model2dictionary { +- (NSDictionary *)mewModel2dictionary { return [[self mj_keyValues] copy]; } -- (NSString *)toJSONString { +- (NSString *)mewToJSONString { return [self mj_JSONString]; } -- (id)toJSONObject { +- (id)mewToJSONObject { return [self mj_JSONObject]; } ///如果模型中包含数组的话 -+ (NSDictionary *)mj_objectClassInArray { - return [self objectClassInArray]; ++ (NSDictionary *)mj_mewObjectClassInArray { + return [self mewObjectClassInArray]; } ///模型中需要映射 重写整个方法 -+ (NSDictionary *)mj_replacedKeyFromPropertyName { - return [self replacedKeyFromPropertyName]; ++ (NSDictionary *)mj_mewReplacedKeyFromPropertyName { + return [self mewReplacedKeyFromPropertyName]; } ///扩展方法 按需索取 重写即可 ///如果一个模型中 包含一个数组 数组中是另一个模型 -+ (NSDictionary *)objectClassInArray { ++ (NSDictionary *)mewObjectClassInArray { return @{}; } ///如果一个模型中需要字段映射的话 比如id -> ID name -> other.name -+ (NSDictionary *)replacedKeyFromPropertyName { ++ (NSDictionary *)mewReplacedKeyFromPropertyName { return @{}; } - @end diff --git a/yinmeng-ios/yinmeng-ios/Base/Tool/Safe/NSArray+MewSafe.h b/yinmeng-ios/yinmeng-ios/Base/Tool/Safe/NSArray+MewSafe.h new file mode 100644 index 0000000..9ea106d --- /dev/null +++ b/yinmeng-ios/yinmeng-ios/Base/Tool/Safe/NSArray+MewSafe.h @@ -0,0 +1,16 @@ +// +// NSArray+MewSafe.h +// yinmeng-ios +// +// Created by duoban on 2023/12/1. +// + +#import + +NS_ASSUME_NONNULL_BEGIN + +@interface NSArray (MewSafe) +-(id)mewSafeObjectAtIndex:(NSUInteger)index; +@end + +NS_ASSUME_NONNULL_END diff --git a/yinmeng-ios/yinmeng-ios/Base/Tool/Safe/NSArray+Safe.m b/yinmeng-ios/yinmeng-ios/Base/Tool/Safe/NSArray+MewSafe.m similarity index 53% rename from yinmeng-ios/yinmeng-ios/Base/Tool/Safe/NSArray+Safe.m rename to yinmeng-ios/yinmeng-ios/Base/Tool/Safe/NSArray+MewSafe.m index 071bda0..4ce275f 100644 --- a/yinmeng-ios/yinmeng-ios/Base/Tool/Safe/NSArray+Safe.m +++ b/yinmeng-ios/yinmeng-ios/Base/Tool/Safe/NSArray+MewSafe.m @@ -1,15 +1,14 @@ // -// NSArray+Safe.m -// mew-ios +// NSArray+MewSafe.m +// yinmeng-ios // -// Created by 触海 on 2023/11/9. +// Created by duoban on 2023/12/1. // -#import "NSArray+Safe.h" +#import "NSArray+MewSafe.h" -@implementation NSArray (Safe) - --(id)safeObjectAtIndex1:(NSUInteger)index{ +@implementation NSArray (MewSafe) +-(id)mewSafeObjectAtIndex:(NSUInteger)index{ if ([self isKindOfClass:[NSArray class]]){ if (self.count){ if (self.count>index){ @@ -20,5 +19,4 @@ return nil; } - @end diff --git a/yinmeng-ios/yinmeng-ios/Base/Tool/Safe/NSArray+Safe.h b/yinmeng-ios/yinmeng-ios/Base/Tool/Safe/NSArray+Safe.h deleted file mode 100644 index c681f62..0000000 --- a/yinmeng-ios/yinmeng-ios/Base/Tool/Safe/NSArray+Safe.h +++ /dev/null @@ -1,16 +0,0 @@ -// -// NSArray+Safe.h -// mew-ios -// -// Created by 触海 on 2023/11/9. -// - -#import - -NS_ASSUME_NONNULL_BEGIN - -@interface NSArray (Safe) --(id)safeObjectAtIndex1:(NSUInteger)index; -@end - -NS_ASSUME_NONNULL_END diff --git a/yinmeng-ios/yinmeng-ios/Base/Tool/Safe/NSMutableDictionary+MEWSafe.h b/yinmeng-ios/yinmeng-ios/Base/Tool/Safe/NSMutableDictionary+MEWSafe.h new file mode 100644 index 0000000..70367ef --- /dev/null +++ b/yinmeng-ios/yinmeng-ios/Base/Tool/Safe/NSMutableDictionary+MEWSafe.h @@ -0,0 +1,16 @@ +// +// NSMutableDictionary+MEWSafe.h +// yinmeng-ios +// +// Created by duoban on 2023/12/1. +// + +#import + +NS_ASSUME_NONNULL_BEGIN + +@interface NSMutableDictionary (MEWSafe) +- (void)mewSafeSetObject:(id)anObject forKey:(id )aKey; +@end + +NS_ASSUME_NONNULL_END diff --git a/yinmeng-ios/yinmeng-ios/Base/Tool/Safe/NSMutableDictionary+MEWSafe.m b/yinmeng-ios/yinmeng-ios/Base/Tool/Safe/NSMutableDictionary+MEWSafe.m new file mode 100644 index 0000000..83c812a --- /dev/null +++ b/yinmeng-ios/yinmeng-ios/Base/Tool/Safe/NSMutableDictionary+MEWSafe.m @@ -0,0 +1,15 @@ +// +// NSMutableDictionary+MEWSafe.m +// yinmeng-ios +// +// Created by duoban on 2023/12/1. +// + +#import "NSMutableDictionary+MEWSafe.h" + +@implementation NSMutableDictionary (MEWSafe) +- (void)mewSafeSetObject:(id)anObject forKey:(id )aKey { + if (anObject == nil || aKey == nil) return; + [self setObject:anObject forKey:aKey]; +} +@end diff --git a/yinmeng-ios/yinmeng-ios/Base/Tool/Safe/NSMutableDictionary+Safe.h b/yinmeng-ios/yinmeng-ios/Base/Tool/Safe/NSMutableDictionary+Safe.h deleted file mode 100644 index e7a248b..0000000 --- a/yinmeng-ios/yinmeng-ios/Base/Tool/Safe/NSMutableDictionary+Safe.h +++ /dev/null @@ -1,16 +0,0 @@ -// -// NSMutableDictionary+Safe.h -// mew-ios -// -// Created by 触海 on 2023/11/8. -// - -#import - -NS_ASSUME_NONNULL_BEGIN - -@interface NSMutableDictionary (Safe) -- (void)safeSetObject:(id)anObject forKey:(id )aKey; -@end - -NS_ASSUME_NONNULL_END diff --git a/yinmeng-ios/yinmeng-ios/Base/Tool/Safe/NSMutableDictionary+Safe.m b/yinmeng-ios/yinmeng-ios/Base/Tool/Safe/NSMutableDictionary+Safe.m deleted file mode 100644 index 18f9558..0000000 --- a/yinmeng-ios/yinmeng-ios/Base/Tool/Safe/NSMutableDictionary+Safe.m +++ /dev/null @@ -1,16 +0,0 @@ -// -// NSMutableDictionary+Safe.m -// mew-ios -// -// Created by 触海 on 2023/11/8. -// - -#import "NSMutableDictionary+Safe.h" - -@implementation NSMutableDictionary (Safe) - -- (void)safeSetObject:(id)anObject forKey:(id )aKey { - if (anObject == nil || aKey == nil) return; - [self setObject:anObject forKey:aKey]; -} -@end diff --git a/yinmeng-ios/yinmeng-ios/Base/Tool/Security/DESEncrypt.m b/yinmeng-ios/yinmeng-ios/Base/Tool/Security/DESEncrypt.m index f561e3a..ec6f288 100644 --- a/yinmeng-ios/yinmeng-ios/Base/Tool/Security/DESEncrypt.m +++ b/yinmeng-ios/yinmeng-ios/Base/Tool/Security/DESEncrypt.m @@ -7,7 +7,7 @@ #import "DESEncrypt.h" #import -#import "Base64.h" +#import "MEWBase64.h" @implementation DESEncrypt : NSObject @@ -31,7 +31,7 @@ const Byte iv[] = {1,2,3,4,5,6,7,8}; &numBytesEncrypted); if (cryptStatus == kCCSuccess) { NSData *data = [NSData dataWithBytes:buffer length:(NSUInteger)numBytesEncrypted]; - ciphertext = [Base64 encode:data]; + ciphertext = [MEWBase64 encode:data]; } return ciphertext; } @@ -40,7 +40,7 @@ const Byte iv[] = {1,2,3,4,5,6,7,8}; +(NSString *)decryptUseDES:(NSString *)cipherText key:(NSString *)key { NSString *plaintext = nil; - NSData *cipherdata = [Base64 decode:cipherText]; + NSData *cipherdata = [MEWBase64 decode:cipherText]; unsigned char buffer[200000]; memset(buffer, 0, sizeof(char)); size_t numBytesDecrypted = 0; diff --git a/yinmeng-ios/yinmeng-ios/Base/Tool/Security/Base64.h b/yinmeng-ios/yinmeng-ios/Base/Tool/Security/MEWBase64.h similarity index 63% rename from yinmeng-ios/yinmeng-ios/Base/Tool/Security/Base64.h rename to yinmeng-ios/yinmeng-ios/Base/Tool/Security/MEWBase64.h index 3137de6..e64c7e3 100644 --- a/yinmeng-ios/yinmeng-ios/Base/Tool/Security/Base64.h +++ b/yinmeng-ios/yinmeng-ios/Base/Tool/Security/MEWBase64.h @@ -1,19 +1,17 @@ // -// Base64.h -// mew-ios +// MEWBase64.h +// yinmeng-ios // -// Created by 触海 on 2023/11/8. +// Created by duoban on 2023/12/1. // #import NS_ASSUME_NONNULL_BEGIN -@interface Base64 : NSObject - +@interface MEWBase64 : NSObject +(NSString *)encode:(NSData *)data; +(NSData *)decode:(NSString *)dataString; - @end NS_ASSUME_NONNULL_END diff --git a/yinmeng-ios/yinmeng-ios/Base/Tool/Security/Base64.m b/yinmeng-ios/yinmeng-ios/Base/Tool/Security/MEWBase64.m similarity index 96% rename from yinmeng-ios/yinmeng-ios/Base/Tool/Security/Base64.m rename to yinmeng-ios/yinmeng-ios/Base/Tool/Security/MEWBase64.m index b08c418..8e2229e 100644 --- a/yinmeng-ios/yinmeng-ios/Base/Tool/Security/Base64.m +++ b/yinmeng-ios/yinmeng-ios/Base/Tool/Security/MEWBase64.m @@ -1,20 +1,16 @@ // -// Base64.m -// mew-ios +// MEWBase64.m +// yinmeng-ios // -// Created by 触海 on 2023/11/8. +// Created by duoban on 2023/12/1. // -#import "Base64.h" - -@interface Base64() +#import "MEWBase64.h" +@interface MEWBase64() +(int)char2Int:(char)c; @end - -@implementation Base64 - static const char encodingTable[] = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"; - +@implementation MEWBase64 +(NSString *)encode:(NSData *)data { if (data.length == 0) @@ -128,5 +124,4 @@ static const char encodingTable[] = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopq } } - @end diff --git a/yinmeng-ios/yinmeng-ios/Base/Tool/ThemeColor/MEWThemeColor.h b/yinmeng-ios/yinmeng-ios/Base/Tool/ThemeColor/MEWThemeColor.h new file mode 100644 index 0000000..4cbe1a5 --- /dev/null +++ b/yinmeng-ios/yinmeng-ios/Base/Tool/ThemeColor/MEWThemeColor.h @@ -0,0 +1,59 @@ +// +// MEWMEWThemeColor.h +// yinmeng-ios +// +// Created by duoban on 2023/12/1. +// + +#import +#import + +NS_ASSUME_NONNULL_BEGIN +#define UIColorMewFromRGB(rgbValue) [UIColor colorWithRed:((float)((rgbValue & 0xFF0000) >> 16))/255.0 green:((float)((rgbValue & 0xFF00) >> 8))/255.0 blue:((float)(rgbValue & 0xFF))/255.0 alpha:1.0] + +#define UIColorMewRGBAlpha(rgbValue,a) [UIColor colorWithRed:((float)((rgbValue & 0xFF0000) >> 16))/255.0 green:((float)((rgbValue & 0xFF00) >> 8))/255.0 blue:((float)(rgbValue & 0xFF))/255.0 alpha:(a)] + +@interface MEWThemeColor : NSObject +/// view的背景色 0xF3F5FA ++ (UIColor *)mewAppBackgroundColor; +/// cell的背景色 0xFFFFFF ++ (UIColor *)mewAppCellBackgroundColor; +///正文颜色 0x333333 ++ (UIColor *)mewMainTextColor; +/// 二级文字颜色 0x666666 ++ (UIColor *)mewSecondTextColor; +///分割线的颜色 0xE8E8E8 ++ (UIColor *)mewDividerColor; + +/* ------弹窗相关颜色 START------ */ ++ (UIColor *)mewAlertBackgroundColor; ++ (UIColor *)mewAlertTitleColor; ++ (UIColor *)mewAlertMessageColor; ++ (UIColor *)mewActionSeparatorColor; +/* ------弹窗相关颜色 END------ */ + +/* ------Button 相关颜色 START------ */ +/// button 可用 渐变色的开始 0xFFA936 ++ (UIColor *)mewConfirmButtonGradientStartColor; +/// button 可用 渐变色的开始 0xFFCB47 ++ (UIColor *)mewConfirmButtonGradientEndColor; +/// 确定的按钮文字颜色 #FFFFFF ++ (UIColor *)mewConfirmButtonTextColor; +/// 取消按钮 渐变色的开始 0xF7DDBF ++ (UIColor *)mewCancelButtonGradientStartColor; +/// 取消按钮 渐变色的结束 0xF7E8C4 ++ (UIColor *)mewCancelButtonGradientEndColor; +/// 取消的按钮文字颜色 0xFFA936 ++ (UIColor *)mewCancelButtonTextColor; +/// 取消按钮单一普通背景色 0xFFCE4E ++ (UIColor *)mewCancelButtonNormalBgColor; +/// 按钮不可点击背景色 0xD2D5D7 ++ (UIColor *)mewDisableButtonColor; +/// 按钮不可点击文字颜色 0xF9F9F9 ++ (UIColor *)mewDisableButtonTextColor; +/* ------Button 相关颜色 END------ */ + ++ (UIColor *)mewColorWithHexString:(NSString *)hexString; +@end + +NS_ASSUME_NONNULL_END diff --git a/yinmeng-ios/yinmeng-ios/Base/Tool/ThemeColor/MEWThemeColor.m b/yinmeng-ios/yinmeng-ios/Base/Tool/ThemeColor/MEWThemeColor.m new file mode 100644 index 0000000..f611ec6 --- /dev/null +++ b/yinmeng-ios/yinmeng-ios/Base/Tool/ThemeColor/MEWThemeColor.m @@ -0,0 +1,135 @@ +// +// MEWThemeColor.m +// yinmeng-ios +// +// Created by duoban on 2023/12/1. +// + +#import "MEWThemeColor.h" + +@implementation MEWThemeColor +/// view的背景色 0xF3F5FA ++ (UIColor *)mewAppBackgroundColor { + return UIColorMewFromRGB(0xF8F8FB); +} +/// cell的背景色 0xFFFFFF ++ (UIColor *)mewAppCellBackgroundColor { + return UIColorMewFromRGB(0xFFFFFF); +} +///正文颜色 0x333333 ++ (UIColor *)mewMainTextColor { + return UIColorMewFromRGB(0x282828); +} +/// 二级文字颜色 0x666666 ++ (UIColor *)mewSecondTextColor { + return UIColorMewFromRGB(0x878B9C); +} + +///分割线的颜色 0xE8E8E8 ++ (UIColor *)mewDividerColor { + return UIColorMewFromRGB(0xE8E8E8); +} + + +/* ------弹窗相关颜色 START------ */ ++ (UIColor *)mewAlertBackgroundColor { + return UIColorMewFromRGB(0xFFFFFF); +} + ++ (UIColor *)mewAlertTitleColor { + return UIColorMewFromRGB(0x333333); +} ++ (UIColor *)mewAlertMessageColor { + return UIColorMewFromRGB(0x333333); +} ++ (UIColor *)mewActionSeparatorColor { + return UIColorMewFromRGB(0xF0F0F0); +} +/* ------弹窗相关颜色 END------ */ + + +/* ------Button 相关颜色 START------ */ +/// button 可用 渐变色的开始 0xFFA936 ++ (UIColor *)mewConfirmButtonGradientStartColor { + return UIColorMewFromRGB(0xFFE710); +} +/// button 可用 渐变色的开始 0xFFCB47 ++ (UIColor *)mewConfirmButtonGradientEndColor { + return UIColorMewFromRGB(0xFFE710); +} +/// 确定的按钮文字颜色 #FFFFFF ++ (UIColor *)mewConfirmButtonTextColor { + return UIColorMewFromRGB(0x282828); +} +/// 取消按钮 渐变色的开始 0xF7DDBF ++ (UIColor *)mewCancelButtonGradientStartColor { + return UIColorMewFromRGB(0xFFFACF); +} +/// 取消按钮 渐变色的结束 0xF7E8C4 ++ (UIColor *)mewCancelButtonGradientEndColor { + return UIColorMewFromRGB(0xFFFACF); +} +/// 取消的按钮文字颜色 0xFFA936 ++ (UIColor *)mewCancelButtonTextColor { + return UIColorMewFromRGB(0x282828); +} +/// 取消按钮单一普通背景色 0xFFCE4E ++ (UIColor *)mewCancelButtonNormalBgColor { + return UIColorMewFromRGB(0xFFFACF); +} +/// 按钮不可点击背景色 0xD2D5D7 ++ (UIColor *)mewDisableButtonColor { + return UIColorMewFromRGB(0xF2F3F6); +} +/// 按钮不可点击文字颜色 0xF9F9F9 ++ (UIColor *)mewDisableButtonTextColor { + return UIColorMewFromRGB(0x878B9C); +} +/* ------Button 相关颜色 END------ */ + ++ (UIColor *)mewColorWithHexString: (NSString *) hexString { + if (hexString.length == 0) { + return [UIColor blackColor]; + } + NSString *colorString = [[hexString stringByReplacingOccurrencesOfString: @"#" withString: @""] uppercaseString]; + CGFloat alpha, red, blue, green; + switch ([colorString length]) { + case 3: // #RGB + alpha = 1.0f; + red = [self mewColorComponentFrom: colorString start: 0 length: 1]; + green = [self mewColorComponentFrom: colorString start: 1 length: 1]; + blue = [self mewColorComponentFrom: colorString start: 2 length: 1]; + break; + case 4: // #ARGB + alpha = [self mewColorComponentFrom: colorString start: 0 length: 1]; + red = [self mewColorComponentFrom: colorString start: 1 length: 1]; + green = [self mewColorComponentFrom: colorString start: 2 length: 1]; + blue = [self mewColorComponentFrom: colorString start: 3 length: 1]; + break; + case 6: // #RRGGBB + alpha = 1.0f; + red = [self mewColorComponentFrom: colorString start: 0 length: 2]; + green = [self mewColorComponentFrom: colorString start: 2 length: 2]; + blue = [self mewColorComponentFrom: colorString start: 4 length: 2]; + break; + case 8: // #AARRGGBB + alpha = [self mewColorComponentFrom: colorString start: 0 length: 2]; + red = [self mewColorComponentFrom: colorString start: 2 length: 2]; + green = [self mewColorComponentFrom: colorString start: 4 length: 2]; + blue = [self mewColorComponentFrom: colorString start: 6 length: 2]; + break; + default: + [NSException raise:@"Invalid color value" format: @"Color value %@ is invalid. It should be a hex value of the form #RBG, #ARGB, #RRGGBB, or #AARRGGBB", hexString]; + break; + } + return [UIColor colorWithRed: red green: green blue: blue alpha: alpha]; +} + ++ (CGFloat) mewColorComponentFrom: (NSString *) string start: (NSUInteger) start length: (NSUInteger) length { + NSString *substring = [string substringWithRange: NSMakeRange(start, length)]; + NSString *fullHex = length == 2 ? substring : [NSString stringWithFormat: @"%@%@", substring, substring]; + unsigned hexComponent; + [[NSScanner scannerWithString: fullHex] scanHexInt: &hexComponent]; + return hexComponent / 255.0; +} +@end diff --git a/yinmeng-ios/yinmeng-ios/Base/Tool/ThemeColor/ThemeColor.h b/yinmeng-ios/yinmeng-ios/Base/Tool/ThemeColor/ThemeColor.h deleted file mode 100644 index 9533adb..0000000 --- a/yinmeng-ios/yinmeng-ios/Base/Tool/ThemeColor/ThemeColor.h +++ /dev/null @@ -1,59 +0,0 @@ -// -// ThemeColor.h -// mew-ios -// -// Created by 触海 on 2023/11/6. -// - -#import - -#define UIColorFromRGB(rgbValue) [UIColor colorWithRed:((float)((rgbValue & 0xFF0000) >> 16))/255.0 green:((float)((rgbValue & 0xFF00) >> 8))/255.0 blue:((float)(rgbValue & 0xFF))/255.0 alpha:1.0] - -#define UIColorRGBAlpha(rgbValue,a) [UIColor colorWithRed:((float)((rgbValue & 0xFF0000) >> 16))/255.0 green:((float)((rgbValue & 0xFF00) >> 8))/255.0 blue:((float)(rgbValue & 0xFF))/255.0 alpha:(a)] - -NS_ASSUME_NONNULL_BEGIN - -@interface ThemeColor : NSObject -/// view的背景色 0xF3F5FA -+ (UIColor *)appBackgroundColor; -/// cell的背景色 0xFFFFFF -+ (UIColor *)appCellBackgroundColor; -///正文颜色 0x333333 -+ (UIColor *)mainTextColor; -/// 二级文字颜色 0x666666 -+ (UIColor *)secondTextColor; -///分割线的颜色 0xE8E8E8 -+ (UIColor *)dividerColor; - -/* ------弹窗相关颜色 START------ */ -+ (UIColor *)alertBackgroundColor; -+ (UIColor *)alertTitleColor; -+ (UIColor *)alertMessageColor; -+ (UIColor *)actionSeparatorColor; -/* ------弹窗相关颜色 END------ */ - -/* ------Button 相关颜色 START------ */ -/// button 可用 渐变色的开始 0xFFA936 -+ (UIColor *)confirmButtonGradientStartColor; -/// button 可用 渐变色的开始 0xFFCB47 -+ (UIColor *)confirmButtonGradientEndColor; -/// 确定的按钮文字颜色 #FFFFFF -+ (UIColor *)confirmButtonTextColor; -/// 取消按钮 渐变色的开始 0xF7DDBF -+ (UIColor *)cancelButtonGradientStartColor; -/// 取消按钮 渐变色的结束 0xF7E8C4 -+ (UIColor *)cancelButtonGradientEndColor; -/// 取消的按钮文字颜色 0xFFA936 -+ (UIColor *)cancelButtonTextColor; -/// 取消按钮单一普通背景色 0xFFCE4E -+ (UIColor *)cancelButtonNormalBgColor; -/// 按钮不可点击背景色 0xD2D5D7 -+ (UIColor *)disableButtonColor; -/// 按钮不可点击文字颜色 0xF9F9F9 -+ (UIColor *)disableButtonTextColor; -/* ------Button 相关颜色 END------ */ - -+ (UIColor *)colorWithHexString:(NSString *)hexString; -@end - -NS_ASSUME_NONNULL_END diff --git a/yinmeng-ios/yinmeng-ios/Base/Tool/ThemeColor/ThemeColor.m b/yinmeng-ios/yinmeng-ios/Base/Tool/ThemeColor/ThemeColor.m deleted file mode 100644 index 061c06a..0000000 --- a/yinmeng-ios/yinmeng-ios/Base/Tool/ThemeColor/ThemeColor.m +++ /dev/null @@ -1,137 +0,0 @@ -// -// ThemeColor.m -// mew-ios -// -// Created by 触海 on 2023/11/6. -// - -#import "ThemeColor.h" - -@implementation ThemeColor - -/// view的背景色 0xF3F5FA -+ (UIColor *)appBackgroundColor { - return UIColorFromRGB(0xF8F8FB); -} -/// cell的背景色 0xFFFFFF -+ (UIColor *)appCellBackgroundColor { - return UIColorFromRGB(0xFFFFFF); -} -///正文颜色 0x333333 -+ (UIColor *)mainTextColor { - return UIColorFromRGB(0x282828); -} -/// 二级文字颜色 0x666666 -+ (UIColor *)secondTextColor { - return UIColorFromRGB(0x878B9C); -} - -///分割线的颜色 0xE8E8E8 -+ (UIColor *)dividerColor { - return UIColorFromRGB(0xE8E8E8); -} - - -/* ------弹窗相关颜色 START------ */ -+ (UIColor *)alertBackgroundColor { - return UIColorFromRGB(0xFFFFFF); -} - -+ (UIColor *)alertTitleColor { - return UIColorFromRGB(0x333333); -} -+ (UIColor *)alertMessageColor { - return UIColorFromRGB(0x333333); -} -+ (UIColor *)actionSeparatorColor { - return UIColorFromRGB(0xF0F0F0); -} -/* ------弹窗相关颜色 END------ */ - - -/* ------Button 相关颜色 START------ */ -/// button 可用 渐变色的开始 0xFFA936 -+ (UIColor *)confirmButtonGradientStartColor { - return UIColorFromRGB(0xFFE710); -} -/// button 可用 渐变色的开始 0xFFCB47 -+ (UIColor *)confirmButtonGradientEndColor { - return UIColorFromRGB(0xFFE710); -} -/// 确定的按钮文字颜色 #FFFFFF -+ (UIColor *)confirmButtonTextColor { - return UIColorFromRGB(0x282828); -} -/// 取消按钮 渐变色的开始 0xF7DDBF -+ (UIColor *)cancelButtonGradientStartColor { - return UIColorFromRGB(0xFFFACF); -} -/// 取消按钮 渐变色的结束 0xF7E8C4 -+ (UIColor *)cancelButtonGradientEndColor { - return UIColorFromRGB(0xFFFACF); -} -/// 取消的按钮文字颜色 0xFFA936 -+ (UIColor *)cancelButtonTextColor { - return UIColorFromRGB(0x282828); -} -/// 取消按钮单一普通背景色 0xFFCE4E -+ (UIColor *)cancelButtonNormalBgColor { - return UIColorFromRGB(0xFFFACF); -} -/// 按钮不可点击背景色 0xD2D5D7 -+ (UIColor *)disableButtonColor { - return UIColorFromRGB(0xF2F3F6); -} -/// 按钮不可点击文字颜色 0xF9F9F9 -+ (UIColor *)disableButtonTextColor { - return UIColorFromRGB(0x878B9C); -} -/* ------Button 相关颜色 END------ */ - -+ (UIColor *)colorWithHexString: (NSString *) hexString { - if (hexString.length == 0) { - return [UIColor blackColor]; - } - NSString *colorString = [[hexString stringByReplacingOccurrencesOfString: @"#" withString: @""] uppercaseString]; - CGFloat alpha, red, blue, green; - switch ([colorString length]) { - case 3: // #RGB - alpha = 1.0f; - red = [self colorComponentFrom: colorString start: 0 length: 1]; - green = [self colorComponentFrom: colorString start: 1 length: 1]; - blue = [self colorComponentFrom: colorString start: 2 length: 1]; - break; - case 4: // #ARGB - alpha = [self colorComponentFrom: colorString start: 0 length: 1]; - red = [self colorComponentFrom: colorString start: 1 length: 1]; - green = [self colorComponentFrom: colorString start: 2 length: 1]; - blue = [self colorComponentFrom: colorString start: 3 length: 1]; - break; - case 6: // #RRGGBB - alpha = 1.0f; - red = [self colorComponentFrom: colorString start: 0 length: 2]; - green = [self colorComponentFrom: colorString start: 2 length: 2]; - blue = [self colorComponentFrom: colorString start: 4 length: 2]; - break; - case 8: // #AARRGGBB - alpha = [self colorComponentFrom: colorString start: 0 length: 2]; - red = [self colorComponentFrom: colorString start: 2 length: 2]; - green = [self colorComponentFrom: colorString start: 4 length: 2]; - blue = [self colorComponentFrom: colorString start: 6 length: 2]; - break; - default: - [NSException raise:@"Invalid color value" format: @"Color value %@ is invalid. It should be a hex value of the form #RBG, #ARGB, #RRGGBB, or #AARRGGBB", hexString]; - break; - } - return [UIColor colorWithRed: red green: green blue: blue alpha: alpha]; -} - -+ (CGFloat) colorComponentFrom: (NSString *) string start: (NSUInteger) start length: (NSUInteger) length { - NSString *substring = [string substringWithRange: NSMakeRange(start, length)]; - NSString *fullHex = length == 2 ? substring : [NSString stringWithFormat: @"%@%@", substring, substring]; - unsigned hexComponent; - [[NSScanner scannerWithString: fullHex] scanHexInt: &hexComponent]; - return hexComponent / 255.0; -} - -@end diff --git a/yinmeng-ios/yinmeng-ios/Base/Tool/TimeInterval/MewTimeIntervalUtils.h b/yinmeng-ios/yinmeng-ios/Base/Tool/TimeInterval/MewTimeIntervalUtils.h new file mode 100644 index 0000000..52843fb --- /dev/null +++ b/yinmeng-ios/yinmeng-ios/Base/Tool/TimeInterval/MewTimeIntervalUtils.h @@ -0,0 +1,17 @@ +// +// MewMewTimeIntervalUtils.h +// yinmeng-ios +// +// Created by duoban on 2023/12/1. +// + +#import + +NS_ASSUME_NONNULL_BEGIN + +@interface MewTimeIntervalUtils : NSObject +/// 时间戳转换成字符串 ++ (NSString*)mewShowTime:(NSTimeInterval) msglastTime showDetail:(BOOL)showDetail; +@end + +NS_ASSUME_NONNULL_END diff --git a/yinmeng-ios/yinmeng-ios/Base/Tool/TimeInterval/TimeIntervalUtils.m b/yinmeng-ios/yinmeng-ios/Base/Tool/TimeInterval/MewTimeIntervalUtils.m similarity index 85% rename from yinmeng-ios/yinmeng-ios/Base/Tool/TimeInterval/TimeIntervalUtils.m rename to yinmeng-ios/yinmeng-ios/Base/Tool/TimeInterval/MewTimeIntervalUtils.m index 12285fe..daf0059 100644 --- a/yinmeng-ios/yinmeng-ios/Base/Tool/TimeInterval/TimeIntervalUtils.m +++ b/yinmeng-ios/yinmeng-ios/Base/Tool/TimeInterval/MewTimeIntervalUtils.m @@ -1,16 +1,15 @@ // -// TimeIntervalUtils.m -// mew-ios +// MewTimeIntervalUtils.m +// yinmeng-ios // -// Created by 触海 on 2023/11/10. +// Created by duoban on 2023/12/1. // -#import "TimeIntervalUtils.h" - -@implementation TimeIntervalUtils +#import "MewTimeIntervalUtils.h" +@implementation MewTimeIntervalUtils /// 时间戳转换成字符串 -+ (NSString*)showTime:(NSTimeInterval) msglastTime showDetail:(BOOL)showDetail { ++ (NSString*)mewShowTime:(NSTimeInterval) msglastTime showDetail:(BOOL)showDetail { //今天的时间 NSDate * nowDate = [NSDate date]; NSDate * msgDate = [NSDate dateWithTimeIntervalSince1970:msglastTime]; @@ -22,7 +21,7 @@ NSInteger hour = msgDateComponents.hour; double OnedayTimeIntervalValue = 24*60*60; //一天的秒数 - result = [self getPeriodOfTime:hour withMinute:msgDateComponents.minute]; + result = [self mewGetPeriodOfTime:hour withMinute:msgDateComponents.minute]; if (hour > 12) { hour = hour - 12; @@ -44,7 +43,7 @@ } else if([nowDate timeIntervalSinceDate:msgDate] < 7 * OnedayTimeIntervalValue)//一周内 { - NSString *weekDay = [self weekdayStr:msgDateComponents.weekday]; + NSString *weekDay = [self mewWeekdayStr:msgDateComponents.weekday]; result = showDetail? [weekDay stringByAppendingFormat:@"%@ %zd:%02d",result,hour,(int)msgDateComponents.minute] : weekDay; } else//显示日期 @@ -56,7 +55,7 @@ } #pragma mark - Private -+ (NSString *)getPeriodOfTime:(NSInteger)time withMinute:(NSInteger)minute { ++ (NSString *)mewGetPeriodOfTime:(NSInteger)time withMinute:(NSInteger)minute { NSInteger totalMin = time *60 + minute; NSString *showPeriodOfTime = @""; if (totalMin > 0 && totalMin <= 5 * 60) @@ -78,7 +77,7 @@ return showPeriodOfTime; } -+ (NSString*)weekdayStr:(NSInteger)dayOfWeek { ++ (NSString*)mewWeekdayStr:(NSInteger)dayOfWeek { static NSDictionary *daysOfWeekDict = nil; daysOfWeekDict = @{@(1):@"星期日", @(2):@"星期一", diff --git a/yinmeng-ios/yinmeng-ios/Base/Tool/TimeInterval/TimeIntervalUtils.h b/yinmeng-ios/yinmeng-ios/Base/Tool/TimeInterval/TimeIntervalUtils.h deleted file mode 100644 index 9365bee..0000000 --- a/yinmeng-ios/yinmeng-ios/Base/Tool/TimeInterval/TimeIntervalUtils.h +++ /dev/null @@ -1,19 +0,0 @@ -// -// TimeIntervalUtils.h -// mew-ios -// -// Created by 触海 on 2023/11/10. -// - -#import - -NS_ASSUME_NONNULL_BEGIN - -@interface TimeIntervalUtils : NSObject - -/// 时间戳转换成字符串 -+ (NSString*)showTime:(NSTimeInterval) msglastTime showDetail:(BOOL)showDetail; - -@end - -NS_ASSUME_NONNULL_END diff --git a/yinmeng-ios/yinmeng-ios/Base/Tool/Timer/MEWTimer.h b/yinmeng-ios/yinmeng-ios/Base/Tool/Timer/MEWTimer.h new file mode 100644 index 0000000..54b22e6 --- /dev/null +++ b/yinmeng-ios/yinmeng-ios/Base/Tool/Timer/MEWTimer.h @@ -0,0 +1,21 @@ +// +// MEWTimer.h +// yinmeng-ios +// +// Created by duoban on 2023/12/1. +// + +#import +typedef void(^MEWTimerHandler) (id _Nullable userInfo); +NS_ASSUME_NONNULL_BEGIN +@interface MEWTimerTarget : NSObject + +@end + +@interface MEWTimer : NSObject ++ (NSTimer *)MEWScheduledTimerWithTimeInterval:(NSTimeInterval)interval block:(MEWTimerHandler)block userInfo:(id)userInfo repeats:(BOOL)repeats; + ++ (NSTimer *)MEWScheduledTimerWithTimeInterval:(NSTimeInterval)interval target:(id)aTarget selector:(SEL)aSelector userInfo:(id)userInfo repeats:(BOOL)repeats; +@end + +NS_ASSUME_NONNULL_END diff --git a/yinmeng-ios/yinmeng-ios/Base/Tool/Timer/YMWeakTimer.m b/yinmeng-ios/yinmeng-ios/Base/Tool/Timer/MEWTimer.m similarity index 56% rename from yinmeng-ios/yinmeng-ios/Base/Tool/Timer/YMWeakTimer.m rename to yinmeng-ios/yinmeng-ios/Base/Tool/Timer/MEWTimer.m index 3743c49..9f82cca 100644 --- a/yinmeng-ios/yinmeng-ios/Base/Tool/Timer/YMWeakTimer.m +++ b/yinmeng-ios/yinmeng-ios/Base/Tool/Timer/MEWTimer.m @@ -1,20 +1,17 @@ // -// YMWeakTimer.m -// mew-ios +// MEWTimer.m +// yinmeng-ios // -// Created by 触海 on 2023/11/8. +// Created by duoban on 2023/12/1. // -#import "YMWeakTimer.h" - -#pragma mark - YMWeakTimerTarget -@interface YMWeakTimerTarget() +#import "MEWTimer.h" +@interface MEWTimerTarget() @property (nonatomic, weak) id target; @property (nonatomic, weak) NSTimer* timer; @property (nonatomic, assign) SEL selector; @end - -@implementation YMWeakTimerTarget +@implementation MEWTimerTarget - (void) fire:(NSTimer *)timer { if(self.target) { #pragma clang diagnostic push @@ -29,26 +26,26 @@ #pragma mark - YMWeakTimer -@implementation YMWeakTimer +@implementation MEWTimer -+ (NSTimer *)scheduledTimerWithTimeInterval:(NSTimeInterval)interval target:(id)aTarget selector:(SEL)aSelector userInfo:(id)userInfo repeats:(BOOL)repeats{ - YMWeakTimerTarget* timerTarget = [[YMWeakTimerTarget alloc] init]; ++ (NSTimer *)MEWScheduledTimerWithTimeInterval:(NSTimeInterval)interval target:(id)aTarget selector:(SEL)aSelector userInfo:(id)userInfo repeats:(BOOL)repeats{ + MEWTimerTarget* timerTarget = [[MEWTimerTarget alloc] init]; timerTarget.target = aTarget; timerTarget.selector = aSelector; timerTarget.timer = [NSTimer scheduledTimerWithTimeInterval:interval target:timerTarget selector:@selector(fire:) userInfo:userInfo repeats:repeats]; return timerTarget.timer; } -+ (NSTimer *)scheduledTimerWithTimeInterval:(NSTimeInterval)interval block:(YMWeakTimerHandler)block userInfo:(id)userInfo repeats:(BOOL)repeats{ ++ (NSTimer *)MEWScheduledTimerWithTimeInterval:(NSTimeInterval)interval block:(MEWTimerHandler)block userInfo:(id)userInfo repeats:(BOOL)repeats{ NSMutableArray *userInfoArray = [NSMutableArray arrayWithObject:[block copy]]; if (userInfo != nil) { [userInfoArray addObject:userInfo]; } - return [self scheduledTimerWithTimeInterval:interval target:self selector:@selector(timerBlockInvoke:) userInfo:[userInfoArray copy] repeats:repeats]; + return [self MEWScheduledTimerWithTimeInterval:interval target:self selector:@selector(MEWSTimerBlockInvoke:) userInfo:[userInfoArray copy] repeats:repeats]; } -+ (void)timerBlockInvoke:(NSArray*)userInfo { - YMWeakTimerHandler block = userInfo[0]; ++ (void)MEWSTimerBlockInvoke:(NSArray*)userInfo { + MEWTimerHandler block = userInfo[0]; id info = nil; if (userInfo.count == 2) { info = userInfo[1]; diff --git a/yinmeng-ios/yinmeng-ios/Base/Tool/Timer/YMWeakTimer.h b/yinmeng-ios/yinmeng-ios/Base/Tool/Timer/YMWeakTimer.h deleted file mode 100644 index 677cb23..0000000 --- a/yinmeng-ios/yinmeng-ios/Base/Tool/Timer/YMWeakTimer.h +++ /dev/null @@ -1,24 +0,0 @@ -// -// YMWeakTimer.h -// mew-ios -// -// Created by 触海 on 2023/11/8. -// - -#import - -NS_ASSUME_NONNULL_BEGIN -typedef void(^YMWeakTimerHandler) (id userInfo); - -@interface YMWeakTimerTarget : NSObject - -@end - -@interface YMWeakTimer : NSObject -+ (NSTimer *)scheduledTimerWithTimeInterval:(NSTimeInterval)interval block:(YMWeakTimerHandler)block userInfo:(id)userInfo repeats:(BOOL)repeats; - -+ (NSTimer *)scheduledTimerWithTimeInterval:(NSTimeInterval)interval target:(id)aTarget selector:(SEL)aSelector userInfo:(id)userInfo repeats:(BOOL)repeats; - -@end - -NS_ASSUME_NONNULL_END diff --git a/yinmeng-ios/yinmeng-ios/Base/Tool/YYUtility/YYUtility+Carrier.m b/yinmeng-ios/yinmeng-ios/Base/Tool/YYUtility/YYUtility+Carrier.m deleted file mode 100644 index 7e4f1c7..0000000 --- a/yinmeng-ios/yinmeng-ios/Base/Tool/YYUtility/YYUtility+Carrier.m +++ /dev/null @@ -1,88 +0,0 @@ -// -// YYUtility+Carrier.m -// YYFoundation -// -// Created by wuwei on 14-5-30. -// Copyright (c) 2014年 YY Inc. All rights reserved. -// - -#import "YYUtility.h" -#import -#import -#import "CarrierIdentifier.h" - -/* - * The most update-to-date list of MNC&MCC is fetched - * from the website below: http://www.mcc-mnc.com - */ -// MCCs -static NSString * const kMobileCountryCode_China = @"460"; // 中国 - -// MNCs -static NSSet * kMobileNetworkCodes_ChinaMobile; // 移动 -static NSSet * kMobileNetworkCodes_ChinaUnicom; // 联通 -static NSSet * kMobileNetworkCodes_ChinaTelecom; // 电信 - -@implementation YYUtility (Carrier) - -+ (void)load -{ - if (self == [YYUtility self]) { - kMobileNetworkCodes_ChinaMobile = [NSSet setWithObjects:@"00", @"02", @"07", nil]; // 中国移动 - kMobileNetworkCodes_ChinaUnicom = [NSSet setWithObjects:@"01", @"06", nil]; // 中国联通 - kMobileNetworkCodes_ChinaTelecom = [NSSet setWithObjects:@"03", @"05", nil]; // 中国电信 - } -} - -+ (NSString *)carrierName -{ - return [self carrier].carrierName; -} - -+ (NSInteger)carrierIdentifier -{ - return [self identifierOfCarrier:[self carrier]]; -} - -+ (CTCarrier *)carrier -{ - return [[CTTelephonyNetworkInfo alloc] init].subscriberCellularProvider; -} - -+ (NSInteger)identifierOfCarrier:(CTCarrier *)carrier -{ - CarrierIdentifier identifier = CarrierIdentifier_Unknown; - do { - if (carrier.mobileCountryCode == nil || carrier.mobileNetworkCode == nil) - { - identifier = CarrierIdentifier_Unknown; - break; - } - - if ([carrier.mobileCountryCode isEqualToString:kMobileCountryCode_China]) - { - if ([kMobileNetworkCodes_ChinaMobile containsObject:carrier.mobileNetworkCode]) - { - identifier = CarrierIdentifier_ChinaMobile; - break; - } - else if ([kMobileNetworkCodes_ChinaUnicom containsObject:carrier.mobileNetworkCode]) - { - identifier = CarrierIdentifier_ChinaUnicom; - break; - } - else if ([kMobileNetworkCodes_ChinaTelecom containsObject:carrier.mobileNetworkCode]) - { - identifier = CarrierIdentifier_ChinaTelecom; - break; - } - } - - identifier = CarrierIdentifier_Otherwise; - - } while (0); - - return identifier; -} - -@end diff --git a/yinmeng-ios/yinmeng-ios/Base/Tool/YYUtility/YYUtility+Device.m b/yinmeng-ios/yinmeng-ios/Base/Tool/YYUtility/YYUtility+Device.m index c94c2ba..bffcbd8 100644 --- a/yinmeng-ios/yinmeng-ios/Base/Tool/YYUtility/YYUtility+Device.m +++ b/yinmeng-ios/yinmeng-ios/Base/Tool/YYUtility/YYUtility+Device.m @@ -22,7 +22,7 @@ #import #import #import "SSKeychain.h" -#import "GCDHelper.h" +#import "MEWGCDHelper.h" #if !defined(IFT_ETHER) @@ -135,7 +135,7 @@ { [AVCaptureDevice requestAccessForMediaType:AVMediaTypeVideo completionHandler:^(BOOL granted) { - dispatch_main_sync_safe(^{ + mew_dispatch_main_sync_safe(^{ if (granted) { available(); diff --git a/yinmeng-ios/yinmeng-ios/Base/UI/BaseNavigationController.m b/yinmeng-ios/yinmeng-ios/Base/UI/BaseNavigationController.m index 7bccac3..41c6e74 100644 --- a/yinmeng-ios/yinmeng-ios/Base/UI/BaseNavigationController.m +++ b/yinmeng-ios/yinmeng-ios/Base/UI/BaseNavigationController.m @@ -6,7 +6,7 @@ // #import "BaseNavigationController.h" -#import "ThemeColor.h" +#import "MEWThemeColor.h" @interface BaseNavigationController () @@ -27,7 +27,7 @@ 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)]; - leftBarButtonItem.tintColor = [ThemeColor mainTextColor]; + leftBarButtonItem.tintColor = [MEWThemeColor mewMainTextColor]; viewController.navigationItem.leftBarButtonItem = leftBarButtonItem; } viewController.navigationItem.backBarButtonItem = [[UIBarButtonItem alloc] initWithTitle:@"" style:UIBarButtonItemStylePlain target:nil action:nil]; @@ -41,21 +41,21 @@ - (void)themeConfig { self.navigationBar.shadowImage = [[UIImage alloc] init]; - self.navigationBar.barTintColor = [ThemeColor appBackgroundColor]; + self.navigationBar.barTintColor = [MEWThemeColor mewAppBackgroundColor]; self.navigationBar.tintColor = [UIColor whiteColor]; self.navigationBar.translucent = NO; - self.view.backgroundColor = [ThemeColor appBackgroundColor]; + self.view.backgroundColor = [MEWThemeColor mewAppBackgroundColor]; [self.navigationBar setTitleTextAttributes:@{ NSFontAttributeName:[UIFont systemFontOfSize:18 weight:UIFontWeightMedium], - NSForegroundColorAttributeName:[ThemeColor mainTextColor] + NSForegroundColorAttributeName:[MEWThemeColor mewMainTextColor] }]; /// scrollEdgeAppearance 属性iOS15 强制适用于 所有导航器 如果为nil 则使用 standardAppearance属性中的设置,并修改为使用透明背景 @fengshuo if (@available(iOS 15.0, *)) { UINavigationBarAppearance *appearance = [UINavigationBarAppearance new]; appearance.titleTextAttributes = @{NSFontAttributeName:[UIFont systemFontOfSize:18 weight:UIFontWeightMedium], - NSForegroundColorAttributeName:[ThemeColor mainTextColor]}; - appearance.backgroundColor = [ThemeColor appCellBackgroundColor]; + NSForegroundColorAttributeName:[MEWThemeColor mewMainTextColor]}; + appearance.backgroundColor = [MEWThemeColor mewAppCellBackgroundColor]; self.navigationBar.standardAppearance = appearance; self.navigationBar.scrollEdgeAppearance = appearance; } diff --git a/yinmeng-ios/yinmeng-ios/Base/UI/BaseViewController.m b/yinmeng-ios/yinmeng-ios/Base/UI/BaseViewController.m index d8fee46..e60abbf 100644 --- a/yinmeng-ios/yinmeng-ios/Base/UI/BaseViewController.m +++ b/yinmeng-ios/yinmeng-ios/Base/UI/BaseViewController.m @@ -7,7 +7,7 @@ #import "BaseViewController.h" ///Tool -#import "YMHUDTool.h" +#import "MewHUDTool.h" @interface BaseViewController () @@ -73,19 +73,19 @@ #pragma mark - BaseViewControllerProtocol - (void)showSuccessToast:(NSString *)msg { - [YMHUDTool showSuccessWithMessage:msg]; + [MewHUDTool showSuccessWithMessage:msg]; } - (void)showErrorToast:(NSString *)msg { - [YMHUDTool showErrorWithMessage:msg]; + [MewHUDTool showErrorWithMessage:msg]; } - (void)showLoading { - [YMHUDTool showLoading]; + [MewHUDTool showLoading]; } - (void)hideHUD { - [YMHUDTool hideHUD]; + [MewHUDTool hideHUD]; } @end diff --git a/yinmeng-ios/yinmeng-ios/Base/UI/EmptyView/YMEmptyTableViewCell.m b/yinmeng-ios/yinmeng-ios/Base/UI/EmptyView/YMEmptyTableViewCell.m index 2bdf692..5853ffb 100644 --- a/yinmeng-ios/yinmeng-ios/Base/UI/EmptyView/YMEmptyTableViewCell.m +++ b/yinmeng-ios/yinmeng-ios/Base/UI/EmptyView/YMEmptyTableViewCell.m @@ -9,7 +9,7 @@ ///Third #import ///Tool -#import "ThemeColor.h" +#import "MEWThemeColor.h" #import "UIImageConstant.h" @interface YMEmptyTableViewCell() @@ -75,7 +75,7 @@ _titleLabel.numberOfLines = 2; _titleLabel.font = [UIFont systemFontOfSize:16]; _titleLabel.textAlignment = NSTextAlignmentCenter; - _titleLabel.textColor = [ThemeColor secondTextColor]; + _titleLabel.textColor = [MEWThemeColor mewSecondTextColor]; } return _titleLabel; } diff --git a/yinmeng-ios/yinmeng-ios/Base/UI/TTPopup/Config/TTActionSheetConfig.m b/yinmeng-ios/yinmeng-ios/Base/UI/TTPopup/Config/TTActionSheetConfig.m index 7505103..0236a24 100644 --- a/yinmeng-ios/yinmeng-ios/Base/UI/TTPopup/Config/TTActionSheetConfig.m +++ b/yinmeng-ios/yinmeng-ios/Base/UI/TTPopup/Config/TTActionSheetConfig.m @@ -6,7 +6,7 @@ // #import "TTActionSheetConfig.h" -#import "ThemeColor.h" +#import "MEWThemeColor.h" @implementation TTActionSheetConfig @@ -24,7 +24,7 @@ + (TTActionSheetConfig *)normalTitle:(NSString *)title selectColorType:(TTItemSelectType)type clickAction:(TTActionSheetClickAction)clickAction { - UIColor *color = type == TTItemSelectHighLight ? [ThemeColor alertTitleColor] : [ThemeColor alertTitleColor]; + UIColor *color = type == TTItemSelectHighLight ? [MEWThemeColor mewAlertTitleColor] : [MEWThemeColor mewAlertTitleColor]; TTActionSheetConfig *config = [self actionWithTitle:title color:color handler:clickAction]; config.type = type; 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 a13a322..89fdecf 100644 --- a/yinmeng-ios/yinmeng-ios/Base/UI/TTPopup/Config/TTAlertConfig.m +++ b/yinmeng-ios/yinmeng-ios/Base/UI/TTPopup/Config/TTAlertConfig.m @@ -8,13 +8,13 @@ #import "TTAlertConfig.h" #import "UIImage+Utils.h" -#import "ThemeColor.h" +#import "MEWThemeColor.h" static CGFloat kAlertTitleFont = 18.f; static CGFloat kAlertButtonFont = 15.f; static CGFloat kAlertMessageFont = 15.f; static CGFloat kAlertCornerRadius = 12.f; -static CGFloat kAlertBackgroundColorAlpha = 0.3; +static CGFloat kmewAlertBackgroundColorAlpha = 0.3; static CGFloat kAlertMessageFontLineSpace = -1; static CGFloat kAlertButtonCornerRadius = 8.f; @@ -24,7 +24,7 @@ static CGFloat kAlertButtonCornerRadius = 8.f; self = [super init]; if (self) { - _backgroundColor = [ThemeColor alertBackgroundColor]; + _backgroundColor = [MEWThemeColor mewAlertBackgroundColor]; //背景颜色 kAlertTitleFont = 16.f; @@ -36,12 +36,12 @@ static CGFloat kAlertButtonCornerRadius = 8.f; // title _title = @"";// 标题 _titleFont = [UIFont fontWithName:@"PingFangSC-Medium" size:kAlertTitleFont];// 字体 - _titleColor = [ThemeColor alertTitleColor];// 颜色 + _titleColor = [MEWThemeColor mewAlertTitleColor];// 颜色 // message _message = @""; _messageFont = [UIFont systemFontOfSize:kAlertMessageFont];// 内容 - _messageColor = [ThemeColor alertMessageColor];// 颜色 + _messageColor = [MEWThemeColor mewAlertMessageColor];// 颜色 _messageLineSpacing = kAlertMessageFontLineSpace;// 字体行间距 _messageAttributedConfig = @[];// 自定义富文本样式 @@ -49,23 +49,23 @@ static CGFloat kAlertButtonCornerRadius = 8.f; _cancelButtonConfig = [[TTAlertButtonConfig alloc] init]; _cancelButtonConfig.title = @"取消";// 取消按钮 _cancelButtonConfig.font = [UIFont systemFontOfSize:kAlertButtonFont];// 按钮字体 - _cancelButtonConfig.titleColor = [ThemeColor cancelButtonTextColor];// 字体颜色 - _cancelButtonConfig.backgroundImage = [UIImage gradientColorImageFromColors:@[[ThemeColor cancelButtonGradientStartColor], [ThemeColor cancelButtonGradientEndColor]] gradientType:GradientTypeLeftToRight imgSize:CGSizeMake(10, 10)]; + _cancelButtonConfig.titleColor = [MEWThemeColor mewCancelButtonTextColor];// 字体颜色 + _cancelButtonConfig.backgroundImage = [UIImage gradientColorImageFromColors:@[[MEWThemeColor mewCancelButtonGradientStartColor], [MEWThemeColor mewCancelButtonGradientEndColor]] gradientType:GradientTypeLeftToRight imgSize:CGSizeMake(10, 10)]; _cancelButtonConfig.cornerRadius = kAlertButtonCornerRadius;// 按钮背景图 // confirm button _confirmButtonConfig = [[TTAlertButtonConfig alloc] init]; _confirmButtonConfig.title = @"确定"; _confirmButtonConfig.font = [UIFont systemFontOfSize:kAlertButtonFont]; - _confirmButtonConfig.titleColor = [ThemeColor confirmButtonTextColor]; - _confirmButtonConfig.backgroundImage = [UIImage gradientColorImageFromColors:@[[ThemeColor confirmButtonGradientStartColor], [ThemeColor confirmButtonGradientEndColor]] gradientType:GradientTypeLeftToRight imgSize:CGSizeMake(10, 10)]; + _confirmButtonConfig.titleColor = [MEWThemeColor mewConfirmButtonTextColor]; + _confirmButtonConfig.backgroundImage = [UIImage gradientColorImageFromColors:@[[MEWThemeColor mewConfirmButtonGradientStartColor], [MEWThemeColor mewConfirmButtonGradientEndColor]] gradientType:GradientTypeLeftToRight imgSize:CGSizeMake(10, 10)]; _confirmButtonConfig.cornerRadius = kAlertButtonCornerRadius; _cornerRadius = kAlertCornerRadius;// 默认圆角 _shouldDismissOnBackgroundTouch = YES;// 点击蒙层是否消失 // mask default 0.3 black - _maskBackgroundAlpha = kAlertBackgroundColorAlpha; // alert 背景色 + _maskBackgroundAlpha = kmewAlertBackgroundColorAlpha; // alert 背景色 _disableAutoDismissWhenClickButton = NO; } return self; diff --git a/yinmeng-ios/yinmeng-ios/Base/UI/TTPopup/View/TTActionSheetView.m b/yinmeng-ios/yinmeng-ios/Base/UI/TTPopup/View/TTActionSheetView.m index 84119c8..4b1eb00 100644 --- a/yinmeng-ios/yinmeng-ios/Base/UI/TTPopup/View/TTActionSheetView.m +++ b/yinmeng-ios/yinmeng-ios/Base/UI/TTPopup/View/TTActionSheetView.m @@ -8,7 +8,7 @@ #import "TTActionSheetView.h" #import "TTActionSheetConfig.h" -#import "ThemeColor.h" +#import "MEWThemeColor.h" #import static CGFloat const kSheetViewCellHeight = 51.f; @@ -104,7 +104,7 @@ static NSString *const kSheetViewCellConst = @"kSheetViewCellConst"; _tableView = [[UITableView alloc] initWithFrame:CGRectZero style:UITableViewStylePlain]; _tableView.delegate = self; _tableView.dataSource = self; - _tableView.separatorColor = [ThemeColor actionSeparatorColor]; + _tableView.separatorColor = [MEWThemeColor mewActionSeparatorColor]; _tableView.separatorStyle = UITableViewCellSeparatorStyleSingleLine; _tableView.rowHeight = kSheetViewCellHeight; _tableView.tableFooterView = [[UIView alloc] init]; @@ -122,7 +122,7 @@ static NSString *const kSheetViewCellConst = @"kSheetViewCellConst"; _cancelButton = [UIButton buttonWithType:UIButtonTypeCustom]; [_cancelButton setTitle:@"取消" forState:UIControlStateNormal]; [_cancelButton setBackgroundColor:UIColor.whiteColor]; - [_cancelButton setTitleColor:[ThemeColor alertMessageColor] forState:UIControlStateNormal]; + [_cancelButton setTitleColor:[MEWThemeColor mewAlertMessageColor] forState:UIControlStateNormal]; [_cancelButton.titleLabel setFont:[UIFont systemFontOfSize:16]]; _cancelButton.layer.cornerRadius = kSheetViewCornerRadius; _cancelButton.layer.masksToBounds = YES; diff --git a/yinmeng-ios/yinmeng-ios/Base/UI/TTPopup/View/TTAlertView.m b/yinmeng-ios/yinmeng-ios/Base/UI/TTPopup/View/TTAlertView.m index 1875381..939eb11 100644 --- a/yinmeng-ios/yinmeng-ios/Base/UI/TTPopup/View/TTAlertView.m +++ b/yinmeng-ios/yinmeng-ios/Base/UI/TTPopup/View/TTAlertView.m @@ -8,7 +8,7 @@ #import "TTAlertView.h" #import "TTAlertConfig.h" -#import "ThemeColor.h" +#import "MEWThemeColor.h" #import static CGFloat const kMargin = 25.f; @@ -180,9 +180,9 @@ static CGFloat const kBtnHeight = 38.f; _messageLabel.text = config.message; } - _cancelButton.layer.borderColor = [ThemeColor dividerColor].CGColor; + _cancelButton.layer.borderColor = [MEWThemeColor mewDividerColor].CGColor; _cancelButton.layer.borderWidth = 2.f; - _confirmButton.layer.borderColor = [ThemeColor dividerColor].CGColor; + _confirmButton.layer.borderColor = [MEWThemeColor mewDividerColor].CGColor; _confirmButton.layer.borderWidth = 2.f; } @@ -190,15 +190,15 @@ static CGFloat const kBtnHeight = 38.f; _isConfigBoard = isConfigBoard; if (isConfigBoard) { //需要边框 - _cancelButton.layer.borderColor = [ThemeColor dividerColor].CGColor; + _cancelButton.layer.borderColor = [MEWThemeColor mewDividerColor].CGColor; _cancelButton.layer.borderWidth = 2.f; - _confirmButton.layer.borderColor = [ThemeColor dividerColor].CGColor; + _confirmButton.layer.borderColor = [MEWThemeColor mewDividerColor].CGColor; _confirmButton.layer.borderWidth = 2.f; }else { //不需要边框 - _cancelButton.layer.borderColor = [ThemeColor dividerColor].CGColor; + _cancelButton.layer.borderColor = [MEWThemeColor mewDividerColor].CGColor; _cancelButton.layer.borderWidth = 0; - _confirmButton.layer.borderColor = [ThemeColor dividerColor].CGColor; + _confirmButton.layer.borderColor = [MEWThemeColor mewDividerColor].CGColor; _confirmButton.layer.borderWidth = 0; } } diff --git a/yinmeng-ios/yinmeng-ios/Global/YMEnum.h b/yinmeng-ios/yinmeng-ios/Global/YMEnum.h index e97cad4..ef32c1b 100644 --- a/yinmeng-ios/yinmeng-ios/Global/YMEnum.h +++ b/yinmeng-ios/yinmeng-ios/Global/YMEnum.h @@ -25,7 +25,7 @@ typedef NS_ENUM(NSUInteger, GetSmsType) { GetSmsType_Login = 2,///登录 GetSmsType_Reset_Password = 3,///重设密码 GetSmsType_Bind_Phone = 4, ///绑定手机 - GetSmsType_Bind_ZF = 5,///绑定支付宝 + GetSmsType_Bind_ZF = 5, GetSmsType_Reset_ZF = 6,///重设支付密码 GetSmsType_Unbind_Phone = 7, ///解绑手机 }; diff --git a/yinmeng-ios/yinmeng-ios/Main/ClientConfig/ClientConfig.m b/yinmeng-ios/yinmeng-ios/Main/ClientConfig/ClientConfig.m index 99e32c1..314c1d5 100644 --- a/yinmeng-ios/yinmeng-ios/Main/ClientConfig/ClientConfig.m +++ b/yinmeng-ios/yinmeng-ios/Main/ClientConfig/ClientConfig.m @@ -7,7 +7,7 @@ #import "ClientConfig.h" #import "Api+Main.h" -#import "YMWeakTimer.h" +#import "MEWTimer.h" @interface ClientConfig() ///重试的次数 10次 如果你还是失败的话 那就算了 没办法了 @@ -35,7 +35,7 @@ self.retryCount = 0; NSDictionary *initData = data.data; self.iosPhoneBind = [initData[@"iosPhoneBind"] boolValue]; - ClientDataModel *model = [ClientDataModel modelWithDictionary:data.data]; + ClientDataModel *model = [ClientDataModel mewModelWithDictionary:data.data]; self.configInfo = model; // 表情 @@ -68,7 +68,7 @@ - (void)addHeartBratTimer { if (_timer == nil) return; - _timer = [YMWeakTimer scheduledTimerWithTimeInterval:30 block:^(id _Nonnull userInfo) { + _timer = [MEWTimer MEWScheduledTimerWithTimeInterval:30 block:^(id _Nonnull userInfo) { [Api requestClientHeartBrat:^(BaseModel * _Nullable data, NSInteger code, NSString * _Nullable msg) { diff --git a/yinmeng-ios/yinmeng-ios/Main/Mew/Home/Presenter/MewHomePresenter.m b/yinmeng-ios/yinmeng-ios/Main/Mew/Home/Presenter/MewHomePresenter.m index 3b421fc..11e4249 100644 --- a/yinmeng-ios/yinmeng-ios/Main/Mew/Home/Presenter/MewHomePresenter.m +++ b/yinmeng-ios/yinmeng-ios/Main/Mew/Home/Presenter/MewHomePresenter.m @@ -8,7 +8,7 @@ #import "MewHomePresenter.h" #import "Api+MewHome.h" #import "Api+Mine.h" -#import "UploadFile.h" +#import "MEWUploadFile.h" #import "UserInfoModel.h" #import "FansInfoModel.h" /// Protocol @@ -22,8 +22,8 @@ /// Mew 获取好友列表 - (void)getMewHomeFriendListWithGender:(NSString *)gender { [Api getMewHomeFriendListCompleted:[self createHttpCompletion:^(BaseModel * _Nonnull data) { - NSArray *array = [UserInfoModel modelsWithArray:data.data[@"randomList"]]; - UserInfoModel *mineModel = [UserInfoModel modelWithDictionary:data.data[@"me"]]; + NSArray *array = [UserInfoModel mewModelsWithArray:data.data[@"randomList"]]; + UserInfoModel *mineModel = [UserInfoModel mewModelWithDictionary:data.data[@"me"]]; [[self getView] getMewHomeFriendListSuccesss:array selfMine:mineModel]; } fail:^(NSInteger code, NSString * _Nullable msg) { @@ -33,7 +33,7 @@ /// 获取新朋友 - (void)getNewFriendListWithGender:(NSString *)gender { [Api getNewFriendListComplection:[self createHttpCompletion:^(BaseModel * _Nonnull data) { - NSArray *array = [UserInfoModel modelsWithArray:data]; + NSArray *array = [UserInfoModel mewModelsWithArray:data]; [[self getView] getNewFriendListSuccess:array]; } fail:^(NSInteger code, NSString * _Nullable msg) { [[self getView] getNewFriendListFail]; @@ -47,10 +47,10 @@ [Api qiniuUpLoadImage:[self createHttpCompletion:^(BaseModel * _Nonnull data) { NSString *key = data.data[@"key"]; NSString *token = data.data[@"token"]; - [UploadFile uploadFile:filePath named:key token:token success:^(NSString * _Nonnull key, NSDictionary * _Nonnull resp) { - NSString *url = resp[@"path"]; + [MEWUploadFile mewUploadFile:filePath named:key token:token success:^(NSString * _Nonnull key, NSDictionary * _Nonnull res) { + NSString *url = res[@"path"]; [[self getView] uploadVoiceFileToThirdSuccess:url]; - } failure:^(NSNumber * _Nonnull resCode, NSString * _Nonnull message) { + } failure:^(NSNumber * _Nonnull code, NSString * _Nonnull message) { [[self getView] uploadVoiceFileFail:message]; }]; @@ -100,7 +100,7 @@ /// 获取用户信息 - (void)getUserInfoWithUid:(NSString *)uid { [Api getUserInfo:[self createHttpCompletion:^(BaseModel * _Nonnull data) { - UserInfoModel *userInfo = [UserInfoModel modelWithDictionary:data.data]; + UserInfoModel *userInfo = [UserInfoModel mewModelWithDictionary:data.data]; [[self getView] getUserInfoSuccess:userInfo]; } fail:^(NSInteger code, NSString * _Nullable msg) { @@ -110,7 +110,7 @@ /// 获取用户详细信息 - (void)getUserDetailInfoWithUid:(NSString *)uid { [Api userDetailInfoCompletion:[self createHttpCompletion:^(BaseModel * _Nonnull data) { - UserInfoModel *infoModel = [UserInfoModel modelWithDictionary:data.data]; + UserInfoModel *infoModel = [UserInfoModel mewModelWithDictionary:data.data]; [[self getView] getUserDetailInfoSuccess:infoModel]; }] uid:uid page:@"1" pageSize:@"20"]; @@ -124,7 +124,7 @@ NSString * pageStr = [NSString stringWithFormat:@"%d", page]; NSString * pageSizeStr = [NSString stringWithFormat:@"%d", pageSize]; [Api getattentionListCompletion:[self createHttpCompletion:^(BaseModel * _Nonnull data) { - NSArray * array = [UserInfoModel modelsWithArray:data.data]; + NSArray * array = [UserInfoModel mewModelsWithArray:data.data]; [[self getView] getUserAttentionListSuccess:array state:state]; }fail:^(NSInteger code, NSString * _Nullable msg) { // [[self getView] getUserAttentionListFail:state]; 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 3a55390..7bfb069 100644 --- a/yinmeng-ios/yinmeng-ios/Main/Mew/Home/View/MewHomeViewController.m +++ b/yinmeng-ios/yinmeng-ios/Main/Mew/Home/View/MewHomeViewController.m @@ -22,8 +22,8 @@ #import /// Tool #import "YMMacro.h" -#import "ThemeColor.h" -#import "YMHUDTool.h" +#import "MEWThemeColor.h" +#import "MewHUDTool.h" /// P #import "MewHomePresenter.h" #import "MewHomeProtocol.h" @@ -146,7 +146,7 @@ // 关注 || 取消关注成功 - (void)attentionUserSuccess:(BOOL)status { - [YMHUDTool showSuccessWithMessage: status ? @"关注成功" : @"取消关注成功"]; + [MewHUDTool showSuccessWithMessage: status ? @"关注成功" : @"取消关注成功"]; [self.userIntroductionView updateAttentionState:status]; } @@ -169,13 +169,13 @@ /// 上传mew声音秀成功 - (void)mewPublishVoiceShowSuccess { - [YMHUDTool showSuccessWithMessage:@"上传音频成功"]; + [MewHUDTool showSuccessWithMessage:@"上传音频成功"]; [MewPushExclusiveVoiceView removeExclusiveViewFromSuperView]; } /// 上传声音秀失败 - (void)uploadVoiceFileFail:(NSString *)message { - [YMHUDTool showSuccessWithMessage:@"上传音频失败,请重新上传"]; + [MewHUDTool showSuccessWithMessage:@"上传音频失败,请重新上传"]; } @@ -286,7 +286,7 @@ /// 上传声音秀 /// 声音路径,声音介绍 - (void)mewPushExclusiveVoice:(NSString *)filePath voiceIntroString:(nonnull NSString *)voiceIntroString dura:(NSInteger)dura { - [YMHUDTool showLoadingWithMessage:@"正在上传音频中请稍等"]; + [MewHUDTool showLoadingWithMessage:@"正在上传音频中请稍等"]; self.voiceString = voiceIntroString; self.duration = dura; [self.presenter uploadVoice:filePath]; @@ -430,7 +430,7 @@ - (UIView *)rightBgVoiceView { if (!_rightBgVoiceView) { _rightBgVoiceView = [[UIView alloc] init]; - _rightBgVoiceView.backgroundColor = [ThemeColor colorWithHexString:@"#1D1F33"]; + _rightBgVoiceView.backgroundColor = [MEWThemeColor mewColorWithHexString:@"#1D1F33"]; } return _rightBgVoiceView; } @@ -450,7 +450,7 @@ - (MewRightFollowVoiceView *)rightFollowVoiceView { if (!_rightFollowVoiceView) { _rightFollowVoiceView = [[MewRightFollowVoiceView alloc] init]; - _rightFollowVoiceView.backgroundColor = [ThemeColor colorWithHexString:@"#050505"]; + _rightFollowVoiceView.backgroundColor = [MEWThemeColor mewColorWithHexString:@"#050505"]; _rightFollowVoiceView.hidden = YES; _rightFollowVoiceView.delegate = self; __weak typeof(self) weakSelf = self; 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 add9878..110dc66 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 @@ -8,7 +8,7 @@ #import "MewHeaderView.h" /// Tool #import "YMMacro.h" -#import "ThemeColor.h" +#import "MEWThemeColor.h" #import @interface MewHeaderView() @@ -117,11 +117,11 @@ // _filterButton.frame = CGRectMake(24, _voiceBgImageView.frame.size.height + 10.0, 61, 27); [_filterButton setImage:[UIImage imageNamed:@"mew_home_header_voice_filter"] forState:UIControlStateNormal]; [_filterButton setTitle:@"筛选" forState:UIControlStateNormal]; - [_filterButton setTitleColor:[ThemeColor colorWithHexString:@"#E1E4E6"] forState:UIControlStateNormal]; + [_filterButton setTitleColor:[MEWThemeColor mewColorWithHexString:@"#E1E4E6"] forState:UIControlStateNormal]; _filterButton.titleLabel.font = kFontMedium(12); _filterButton.layer.cornerRadius = 14; _filterButton.layer.masksToBounds = YES; - _filterButton.backgroundColor = [ThemeColor colorWithHexString:@"#1D1E1F"]; + _filterButton.backgroundColor = [MEWThemeColor mewColorWithHexString:@"#1D1E1F"]; _filterButton.selected = NO; [_filterButton addTarget:self action:@selector(filterButtonAction:) forControlEvents:UIControlEventTouchUpInside]; } @@ -134,11 +134,11 @@ // _reviewLoadButton.frame = CGRectMake(CGRectGetMaxX(_filterButton.frame) + 20, CGRectGetMinY(_filterButton.frame), 76, 27); [_reviewLoadButton setImage:[UIImage imageNamed:@"mew_home_header_renew_voice"] forState:UIControlStateNormal]; [_reviewLoadButton setTitle:@"换一换" forState:UIControlStateNormal]; - [_reviewLoadButton setTitleColor:[ThemeColor colorWithHexString:@"#E1E4E6"] forState:UIControlStateNormal]; + [_reviewLoadButton setTitleColor:[MEWThemeColor mewColorWithHexString:@"#E1E4E6"] forState:UIControlStateNormal]; _reviewLoadButton.titleLabel.font = kFontMedium(12); _reviewLoadButton.layer.cornerRadius = 14; _reviewLoadButton.layer.masksToBounds = YES; - _reviewLoadButton.backgroundColor = [ThemeColor colorWithHexString:@"#1D1E1F"]; + _reviewLoadButton.backgroundColor = [MEWThemeColor mewColorWithHexString:@"#1D1E1F"]; [_reviewLoadButton addTarget:self action:@selector(reviewLoadButtonAction) forControlEvents:UIControlEventTouchUpInside]; } 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 2215ffc..26aee8a 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 @@ -12,9 +12,9 @@ #import /// Tool #import "UIImage+Utils.h" -#import "ThemeColor.h" +#import "MEWThemeColor.h" #import "YMMacro.h" -#import "YMHUDTool.h" +#import "MewHUDTool.h" #import "YMIButton.h" @interface MewPlayVoiceView() @@ -69,7 +69,7 @@ - (void)stopVoiceButtonAction:(UIButton *)sender { // 判断当前是否有用户在唱片上 if (!self.discVoiceView.isUserOnDisc) { - [YMHUDTool showErrorWithMessage:@"请添加声音到唱片才能播放"]; + [MewHUDTool showErrorWithMessage:@"请添加声音到唱片才能播放"]; return; } @@ -84,7 +84,7 @@ - (void)renewPlayVoiceButtonAction { // 判断当前是否有用户在唱片上 if (!self.discVoiceView.isUserOnDisc) { - [YMHUDTool showErrorWithMessage:@"请添加声音到唱片才能播放"]; + [MewHUDTool showErrorWithMessage:@"请添加声音到唱片才能播放"]; return; } @@ -195,9 +195,9 @@ _pushVoiceButton.layer.cornerRadius = 52.0/2; _pushVoiceButton.layer.masksToBounds = YES; UIImage *backgroundImage = [UIImage gradientColorImageFromColors:@[ - [ThemeColor colorWithHexString:@"#FF60FD"], - [ThemeColor colorWithHexString:@"##8974FF"], - [ThemeColor colorWithHexString:@"#69EBFF"] + [MEWThemeColor mewColorWithHexString:@"#FF60FD"], + [MEWThemeColor mewColorWithHexString:@"##8974FF"], + [MEWThemeColor mewColorWithHexString:@"#69EBFF"] ] gradientType:GradientTypeLeftToRight 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 fe21365..38dfe79 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 @@ -8,12 +8,12 @@ #import "MewPushExclusiveVoiceView.h" /// Tool #import "YMMacro.h" -#import "ThemeColor.h" +#import "MEWThemeColor.h" #import "UIImage+Utils.h" #import "YYUtility.h" #import "AccountInfoStorage.h" -#import "NSArray+Safe.h" -#import "YMHUDTool.h" +#import "NSArray+MewSafe.h" +#import "MewHUDTool.h" /// Third #import #import @@ -121,7 +121,7 @@ static MewPushExclusiveVoiceView *_exclusiveVoiceView = nil; if (self) { // self.recordVoiceState = RecordVoiceState_Record_Normal; - self.backgroundColor = UIColorRGBAlpha(0x000000, 0.5); + self.backgroundColor = UIColorMewRGBAlpha(0x000000, 0.5); self.voiceButtonArrays = [NSMutableArray array]; self.voiceTitleArrays = @[@"无效果", @"恐怖", @"成熟", @"萝莉"]; self.voiceImageArrays = @[@"mew_home_change_voice_defalut",@"mew_home_change_voice_horror",@"mew_home_change_voice_mature",@"mew_home_change_voice_girl"]; @@ -183,12 +183,12 @@ static MewPushExclusiveVoiceView *_exclusiveVoiceView = nil; /// 播放录制声音 - (void)playWithRecordVoice:(UIButton *)sender { if (self.recordVoiceState == RecordVoiceState_Record_Normal) { - [YMHUDTool showErrorWithMessage:@"请先录制声音"]; + [MewHUDTool showErrorWithMessage:@"请先录制声音"]; return; } if (self.recordVoiceState == RecordVoiceState_Record_Start) { - [YMHUDTool showErrorWithMessage:@"正在录制声音,请先结束录制"]; + [MewHUDTool showErrorWithMessage:@"正在录制声音,请先结束录制"]; return; } @@ -199,13 +199,13 @@ static MewPushExclusiveVoiceView *_exclusiveVoiceView = nil; /// 重新播放录制声音 - (void)renewPlayWithRecordVoice { if (self.recordVoiceState == RecordVoiceState_Record_Normal) { - [YMHUDTool showErrorWithMessage:@"请先录制声音"]; + [MewHUDTool showErrorWithMessage:@"请先录制声音"]; return; } if (self.isPlayVoice) { - [YMHUDTool showErrorWithMessage:@"正在播放声音,请先结束播放"]; + [MewHUDTool showErrorWithMessage:@"正在播放声音,请先结束播放"]; return; } @@ -217,7 +217,7 @@ static MewPushExclusiveVoiceView *_exclusiveVoiceView = nil; /// 发布声音 - (void)pushWithRecordVoice { if (self.totalFilePath.length == 0 || self.totalFilePath == nil) { - [YMHUDTool showErrorWithMessage:@"请先录制声音"]; + [MewHUDTool showErrorWithMessage:@"请先录制声音"]; return; } @@ -252,7 +252,7 @@ static MewPushExclusiveVoiceView *_exclusiveVoiceView = nil; - (void)startRecord { [YYUtility checkMicPrivacy:^(BOOL succeed) { if (!succeed) { - [YMHUDTool showErrorWithMessage:@"无麦克风权限,请到设置中打开麦克风权限"]; + [MewHUDTool showErrorWithMessage:@"无麦克风权限,请到设置中打开麦克风权限"]; return; } @@ -278,7 +278,7 @@ static MewPushExclusiveVoiceView *_exclusiveVoiceView = nil; } else { self.recordVoiceState = RecordVoiceState_Record_Normal; [self deleteAudioFile]; - [YMHUDTool showErrorWithMessage:@"录制的语音至少3s"]; + [MewHUDTool showErrorWithMessage:@"录制的语音至少3s"]; } } @@ -359,7 +359,7 @@ static MewPushExclusiveVoiceView *_exclusiveVoiceView = nil; } self.longTapColorView.hidden = NO; - self.longTapColorView.backgroundColor = [ThemeColor colorWithHexString:isRecord ? @"#FF43B1" : @"#43F4FF"]; + self.longTapColorView.backgroundColor = [MEWThemeColor mewColorWithHexString:isRecord ? @"#FF43B1" : @"#43F4FF"]; } /// 初始化录音对象 @@ -386,7 +386,7 @@ static MewPushExclusiveVoiceView *_exclusiveVoiceView = nil; self.fileName = [NSString stringWithFormat:@"voiceShow_%@_%@.wav", [AccountInfoStorage instance].getUid, date]; NSFileManager *fileMgr = [[NSFileManager alloc] init]; //创建文件管理器 - NSString *filePath = [[NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES) safeObjectAtIndex1:0] stringByAppendingPathComponent:@"voiceShow"]; + NSString *filePath = [[NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES) mewSafeObjectAtIndex:0] stringByAppendingPathComponent:@"voiceShow"]; self.totalFilePath = [filePath stringByAppendingPathComponent:self.fileName]; if (![fileMgr fileExistsAtPath:filePath]) { //如果不存在,则说明是第一次运行这个程序,那么建立这个文件夹 @@ -401,11 +401,11 @@ static MewPushExclusiveVoiceView *_exclusiveVoiceView = nil; [self.audioRecorder updateMeters]; NSLog(@"%f",[self.audioRecorder peakPowerForChannel:0]); if(!self.audioRecorder) { - [YMHUDTool showErrorWithMessage:@"录制失败,请重试"]; + [MewHUDTool showErrorWithMessage:@"录制失败,请重试"]; return; } if(![self.audioRecorder prepareToRecord]) { - [YMHUDTool showErrorWithMessage:@"录制失败,请重试"]; + [MewHUDTool showErrorWithMessage:@"录制失败,请重试"]; return; } BOOL status = [self.audioRecorder record]; @@ -529,7 +529,7 @@ static MewPushExclusiveVoiceView *_exclusiveVoiceView = nil; CGFloat imageWidth = 60; CGFloat marginX = (KScreenWidth - 48 - 20.0 - 4 * imageWidth)/5; UIButton *muteButton = [[UIButton alloc] init]; - muteButton.backgroundColor = [ThemeColor colorWithHexString:@"#444F75"]; + muteButton.backgroundColor = [MEWThemeColor mewColorWithHexString:@"#444F75"]; [muteButton setImage:[UIImage imageNamed:@"mew_home_change_voice_bg"] forState:UIControlStateSelected]; [muteButton setImage:[UIImage imageNamed:@"mew_home_change_voice_nomarl"] forState:UIControlStateNormal]; muteButton.layer.cornerRadius = 8; @@ -554,7 +554,7 @@ static MewPushExclusiveVoiceView *_exclusiveVoiceView = nil; UILabel *muteLabel = [[UILabel alloc] init]; muteLabel.text = self.voiceTitleArrays[i]; muteLabel.font = kFontRegular(12); - muteLabel.textColor = [ThemeColor colorWithHexString:@"#F0F0F0"]; + muteLabel.textColor = [MEWThemeColor mewColorWithHexString:@"#F0F0F0"]; [self.voiceView addSubview:muteLabel]; [muteLabel mas_makeConstraints:^(MASConstraintMaker *make) { make.top.equalTo(muteImageView.mas_bottom).offset(5.0); @@ -584,7 +584,7 @@ static MewPushExclusiveVoiceView *_exclusiveVoiceView = nil; - (UIView *)whiteBgView { if (!_whiteBgView) { _whiteBgView = [[UIView alloc] init]; - _whiteBgView.backgroundColor = [ThemeColor colorWithHexString:@"#525566"];; + _whiteBgView.backgroundColor = [MEWThemeColor mewColorWithHexString:@"#525566"];; _whiteBgView.layer.cornerRadius = 15.0; _whiteBgView.layer.masksToBounds = YES; } @@ -633,7 +633,7 @@ static MewPushExclusiveVoiceView *_exclusiveVoiceView = nil; - (UIView *)longTapView { if (!_longTapView) { _longTapView = [[UIView alloc] init]; - _longTapView.backgroundColor = [ThemeColor colorWithHexString:@"#9552FF"]; + _longTapView.backgroundColor = [MEWThemeColor mewColorWithHexString:@"#9552FF"]; _longTapView.layer.cornerRadius = 24.0; _longTapView.layer.masksToBounds = YES; //长按 @@ -665,7 +665,7 @@ static MewPushExclusiveVoiceView *_exclusiveVoiceView = nil; - (UIView *)longTapColorView { if (!_longTapColorView) { _longTapColorView = [[UIView alloc] init]; - _longTapColorView.backgroundColor = [ThemeColor colorWithHexString:@"#43F4FF"]; + _longTapColorView.backgroundColor = [MEWThemeColor mewColorWithHexString:@"#43F4FF"]; _longTapColorView.layer.cornerRadius = 6.0/2.0; _longTapColorView.layer.masksToBounds = YES; } @@ -695,7 +695,7 @@ static MewPushExclusiveVoiceView *_exclusiveVoiceView = nil; - (UIView *)textBgView { if (!_textBgView) { _textBgView = [[UIView alloc] init]; - _textBgView.backgroundColor = [ThemeColor colorWithHexString:@"#DCDDE0"]; + _textBgView.backgroundColor = [MEWThemeColor mewColorWithHexString:@"#DCDDE0"]; _textBgView.layer.cornerRadius = 11.0; _textBgView.layer.masksToBounds = YES; } @@ -706,7 +706,7 @@ static MewPushExclusiveVoiceView *_exclusiveVoiceView = nil; _textView = [[UITextView alloc] init]; _textView.delegate = self; _textView.font = kFontRegular(13); - _textView.textColor = [ThemeColor colorWithHexString:@"#7D8499"]; + _textView.textColor = [MEWThemeColor mewColorWithHexString:@"#7D8499"]; _textView.backgroundColor = UIColor.clearColor; } return _textView; @@ -715,7 +715,7 @@ static MewPushExclusiveVoiceView *_exclusiveVoiceView = nil; if (!_placeholdLabel) { _placeholdLabel = [[UILabel alloc] init]; _placeholdLabel.text = @"说点什么..."; - _placeholdLabel.textColor = [ThemeColor colorWithHexString:@"#7D8499"]; + _placeholdLabel.textColor = [MEWThemeColor mewColorWithHexString:@"#7D8499"]; _placeholdLabel.font = kFontRegular(13); } return _placeholdLabel; @@ -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:@[[ThemeColor colorWithHexString:@"#FF60FD"], [ThemeColor colorWithHexString:@"#8974FF"],[ThemeColor colorWithHexString:@"#69EBFF"]] gradientType:GradientTypeLeftToRight imgSize:CGSizeMake(KScreenWidth - 4 * 28, 46)]; + UIImage *image = [UIImage gradientColorImageFromColors:@[[MEWThemeColor mewColorWithHexString:@"#FF60FD"], [MEWThemeColor mewColorWithHexString:@"#8974FF"],[MEWThemeColor mewColorWithHexString:@"#69EBFF"]] gradientType:GradientTypeLeftToRight imgSize:CGSizeMake(KScreenWidth - 4 * 28, 46)]; _pushVoiceButton.backgroundColor = [UIColor colorWithPatternImage:image]; [_pushVoiceButton addTarget:self action:@selector(pushWithRecordVoice) forControlEvents:UIControlEventTouchUpInside]; } 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 9de9fe3..afaadeb 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 @@ -12,10 +12,10 @@ #import /// Tool #import "YMMacro.h" -#import "ThemeColor.h" +#import "MEWThemeColor.h" #import "FansInfoModel.h" #import "UserInfoModel.h" -#import "NSArray+Safe.h" +#import "NSArray+MewSafe.h" @interface MewRightFollowVoiceView() @@ -53,7 +53,7 @@ - (__kindof UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath { MewRightFollowVoiceCollectionCell *cell = [collectionView dequeueReusableCellWithReuseIdentifier:NSStringFromClass([MewRightFollowVoiceCollectionCell class]) forIndexPath:indexPath]; - UserInfoModel *model = [self.fansListModel safeObjectAtIndex1:indexPath.row]; + UserInfoModel *model = [self.fansListModel mewSafeObjectAtIndex:indexPath.row]; cell.avater = model.avatar; cell.nick = model.nick; cell.sex = model.gender; @@ -92,12 +92,12 @@ MJRefreshNormalHeader *header = [MJRefreshNormalHeader headerWithRefreshingTarget:self refreshingAction:@selector(headerRefresh)]; header.stateLabel.font = [UIFont systemFontOfSize:10.0]; header.lastUpdatedTimeLabel.font = [UIFont systemFontOfSize:10.0]; - header.stateLabel.textColor = [ThemeColor secondTextColor]; - header.lastUpdatedTimeLabel.textColor = [ThemeColor secondTextColor]; + header.stateLabel.textColor = [MEWThemeColor mewSecondTextColor]; + header.lastUpdatedTimeLabel.textColor = [MEWThemeColor mewSecondTextColor]; self.followCollectionView.mj_header = header; MJRefreshBackNormalFooter *footer = [MJRefreshBackNormalFooter footerWithRefreshingTarget:self refreshingAction:@selector(footerRefresh)]; - footer.stateLabel.textColor = [ThemeColor secondTextColor]; + footer.stateLabel.textColor = [MEWThemeColor mewSecondTextColor]; footer.stateLabel.font = [UIFont systemFontOfSize:10.0]; self.followCollectionView.mj_footer = footer; 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 dd43296..f2b0d5b 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 @@ -11,7 +11,7 @@ /// Tool #import "YMMacro.h" #import "AudioPlayerManager.h" -#import "YMHUDTool.h" +#import "MewHUDTool.h" /// Third #import /// Model 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 20a85f4..ac2a7d8 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 @@ -11,7 +11,7 @@ #import "UserInfoModel.h" /// Tool #import "YMMacro.h" -#import "ThemeColor.h" +#import "MEWThemeColor.h" #import "AudioPlayerManager.h" /// Third #import @@ -117,7 +117,7 @@ static MewUserIntroductionView *_userIntroductionView = nil; - (instancetype)initWithFrame:(CGRect)frame { self = [super initWithFrame:frame]; if (self) { - self.backgroundColor = UIColorRGBAlpha(0x000000, 0.4); + self.backgroundColor = UIColorMewRGBAlpha(0x000000, 0.4); UITapGestureRecognizer *tap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(didSelectBgViewTapGesture:)]; [self addGestureRecognizer:tap]; [self initView]; @@ -372,7 +372,7 @@ static MewUserIntroductionView *_userIntroductionView = nil; - (UIView *)whiteBgView { if (!_whiteBgView) { _whiteBgView = [[UIView alloc] init]; - _whiteBgView.backgroundColor = [ThemeColor colorWithHexString:@"#525566"]; + _whiteBgView.backgroundColor = [MEWThemeColor mewColorWithHexString:@"#525566"]; _whiteBgView.layer.cornerRadius = 16; _whiteBgView.layer.masksToBounds = YES; } @@ -449,10 +449,10 @@ static MewUserIntroductionView *_userIntroductionView = nil; _starSignLabel.text = @"天蝎座"; _starSignLabel.textAlignment = NSTextAlignmentCenter; _starSignLabel.font = kFontRegular(10); - _starSignLabel.textColor = [ThemeColor colorWithHexString:@"#9168FA"]; + _starSignLabel.textColor = [MEWThemeColor mewColorWithHexString:@"#9168FA"]; _starSignLabel.layer.cornerRadius = 9.0; _starSignLabel.layer.masksToBounds = YES; - _starSignLabel.backgroundColor = [ThemeColor colorWithHexString:@"#E9E1FF"]; + _starSignLabel.backgroundColor = [MEWThemeColor mewColorWithHexString:@"#E9E1FF"]; } return _starSignLabel; } @@ -462,7 +462,7 @@ static MewUserIntroductionView *_userIntroductionView = nil; - (UIView *)voiceIntroductionView { if (!_voiceIntroductionView) { _voiceIntroductionView = [[UIView alloc] init]; - _voiceIntroductionView.backgroundColor = [ThemeColor colorWithHexString:@"#DCDDE0"]; + _voiceIntroductionView.backgroundColor = [MEWThemeColor mewColorWithHexString:@"#DCDDE0"]; _voiceIntroductionView.layer.cornerRadius = 11.0; _voiceIntroductionView.layer.masksToBounds = YES; } @@ -474,7 +474,7 @@ static MewUserIntroductionView *_userIntroductionView = nil; _voiceTitleLabel = [[UILabel alloc] init]; _voiceTitleLabel.text = @"这是一段用户签名,这是一段用户签名,这是一段用户签名~"; _voiceTitleLabel.font = kFontRegular(13); - _voiceTitleLabel.textColor = [ThemeColor colorWithHexString:@"#1F1B4F"]; + _voiceTitleLabel.textColor = [MEWThemeColor mewColorWithHexString:@"#1F1B4F"]; _voiceTitleLabel.numberOfLines = 0; } return _voiceTitleLabel; @@ -512,7 +512,7 @@ static MewUserIntroductionView *_userIntroductionView = nil; _voiceTimeLabel = [[UILabel alloc] init]; _voiceTimeLabel.text = @"30”"; _voiceTimeLabel.font = kFontMedium(14); - _voiceTimeLabel.textColor = [ThemeColor colorWithHexString:@"#1F1B4F"]; + _voiceTimeLabel.textColor = [MEWThemeColor mewColorWithHexString:@"#1F1B4F"]; } return _voiceTimeLabel; } @@ -520,7 +520,7 @@ static MewUserIntroductionView *_userIntroductionView = nil; - (UIView *)horLineView { if (!_horLineView) { _horLineView = [[UIView alloc] init]; - _horLineView.backgroundColor = UIColorRGBAlpha(0xFFFFFF, 0.2); + _horLineView.backgroundColor = UIColorMewRGBAlpha(0xFFFFFF, 0.2); } return _horLineView; @@ -529,7 +529,7 @@ static MewUserIntroductionView *_userIntroductionView = nil; - (UIView *)verLineView1 { if (!_verLineView1) { _verLineView1 = [[UIView alloc] init]; - _verLineView1.backgroundColor = UIColorRGBAlpha(0xFFFFFF, 0.2); + _verLineView1.backgroundColor = UIColorMewRGBAlpha(0xFFFFFF, 0.2); } return _verLineView1; } @@ -539,7 +539,7 @@ static MewUserIntroductionView *_userIntroductionView = nil; - (UIView *)verLineView2 { if (!_verLineView2) { _verLineView2 = [[UIView alloc] init]; - _verLineView2.backgroundColor = UIColorRGBAlpha(0xFFFFFF, 0.2); + _verLineView2.backgroundColor = UIColorMewRGBAlpha(0xFFFFFF, 0.2); } return _verLineView2; } 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 3dd3c41..5b1a435 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 @@ -7,7 +7,7 @@ #import "MewVoiceGuideView.h" /// Tool -#import "ThemeColor.h" +#import "MEWThemeColor.h" #import "YMMacro.h" #import @@ -47,7 +47,7 @@ static MewVoiceGuideView *_guideView = nil; - (instancetype)initWithFrame:(CGRect)frame { self = [super initWithFrame:frame]; if (self) { - self.backgroundColor = UIColorRGBAlpha(0x000000, 0.4); + self.backgroundColor = UIColorMewRGBAlpha(0x000000, 0.4); UITapGestureRecognizer *tap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(viewWithTapGesture:)]; [self addGestureRecognizer:tap]; [self initView]; @@ -125,7 +125,7 @@ static MewVoiceGuideView *_guideView = nil; - (UIView *)guideBgView { if (!_guideBgView) { _guideBgView = [[UIView alloc] init]; - _guideBgView.backgroundColor = [ThemeColor colorWithHexString:@"#6A60FF"]; + _guideBgView.backgroundColor = [MEWThemeColor mewColorWithHexString:@"#6A60FF"]; } return _guideBgView; } diff --git a/yinmeng-ios/yinmeng-ios/Main/Mew/Home/View/SubView/YMHomeFilterView.m b/yinmeng-ios/yinmeng-ios/Main/Mew/Home/View/SubView/YMHomeFilterView.m index 5f609a4..086e345 100644 --- a/yinmeng-ios/yinmeng-ios/Main/Mew/Home/View/SubView/YMHomeFilterView.m +++ b/yinmeng-ios/yinmeng-ios/Main/Mew/Home/View/SubView/YMHomeFilterView.m @@ -10,7 +10,7 @@ #import /// Tool #import "YMMacro.h" -#import "ThemeColor.h" +#import "MEWThemeColor.h" @interface YMHomeFilterView() @property (nonatomic, copy) NSArray *datas; @@ -71,7 +71,7 @@ static NSInteger targetIndex = 0; CGFloat margin = (107 - 3 * 28 - 2 * 6.0)/2; for (int i = 0; i < self.datas.count; i++) { UIView *colorBgView = [[UIView alloc] init]; - colorBgView.backgroundColor = i==targetIndex ? [ThemeColor colorWithHexString:@"#DCDDE0"] : UIColor.clearColor; + colorBgView.backgroundColor = i==targetIndex ? [MEWThemeColor mewColorWithHexString:@"#DCDDE0"] : UIColor.clearColor; colorBgView.tag = i; colorBgView.layer.cornerRadius = 6; colorBgView.layer.masksToBounds = YES; @@ -88,7 +88,7 @@ static NSInteger targetIndex = 0; UILabel *titleLabel = [[UILabel alloc] init]; titleLabel.text = self.datas[i]; - titleLabel.textColor = [ThemeColor colorWithHexString:@"#1F1B4F"]; + titleLabel.textColor = [MEWThemeColor mewColorWithHexString:@"#1F1B4F"]; titleLabel.font = kFontMedium(12); titleLabel.textAlignment = NSTextAlignmentCenter; [colorBgView addSubview:titleLabel]; 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 a106d5e..ac268fe 100644 --- a/yinmeng-ios/yinmeng-ios/Main/Mew/Login/View/MewLoginViewController.m +++ b/yinmeng-ios/yinmeng-ios/Main/Mew/Login/View/MewLoginViewController.m @@ -18,11 +18,11 @@ #import ///Tool #import "YMMacro.h" -#import "ThemeColor.h" -#import "YMHUDTool.h" +#import "MEWThemeColor.h" +#import "MewHUDTool.h" #import "UIImage+Utils.h" #import "YMConstant.h" -#import "GCDHelper.h" +#import "MEWGCDHelper.h" #import "Base.h" #import "AccountInfoStorage.h" #import "Api+Login.h" @@ -117,12 +117,6 @@ typedef NS_ENUM(NSUInteger, XYLoginType) { [self.view addSubview:self.otherLoginTitleLabel]; [self.view addSubview:self.appleButtonView]; -// [self.stackView addArrangedSubview:self.qqButtonView]; -// [self.stackView addArrangedSubview:self.phoneButtonView]; -//// [self.stackView addArrangedSubview:self.wxButtonView]; -//#if __IPHONE_OS_VERSION_MAX_ALLOWED >= 130000 -// [self.stackView addArrangedSubview:self.appleButton]; -//#endif } @@ -266,7 +260,7 @@ typedef NS_ENUM(NSUInteger, XYLoginType) { #pragma mark - Event Response - (void)loginButtonAction:(UIButton *)sender { if (!self.agreeButton.isSelected) { - [YMHUDTool showErrorWithMessage:@"请勾选协议"]; + [MewHUDTool showErrorWithMessage:@"请勾选协议"]; return; } @@ -295,7 +289,7 @@ typedef NS_ENUM(NSUInteger, XYLoginType) { /// 苹果登录 - (void)loginWithApple { if (!self.agreeButton.isSelected) { - [YMHUDTool showErrorWithMessage:@"请勾选协议"]; + [MewHUDTool showErrorWithMessage:@"请勾选协议"]; return; } @@ -334,7 +328,7 @@ typedef NS_ENUM(NSUInteger, XYLoginType) { /// 手机 || 密码登录 || Apple //- (void)didClickRecognizer:(UITapGestureRecognizer *)tap { // if (!self.agreeButton.isSelected) { -// [YMHUDTool showErrorWithMessage:@"请勾选协议"]; +// [MewHUDTool showErrorWithMessage:@"请勾选协议"]; // return; // } // @@ -371,7 +365,7 @@ typedef NS_ENUM(NSUInteger, XYLoginType) { } [AccountInfoStorage instance].thirdUserInfo = userInfo; - [YMHUDTool showLoadingWithMessage:@"正在登录中"]; + [MewHUDTool showLoadingWithMessage:@"正在登录中"]; [self.presenter thirdLoginWithApple:identityToken unionId:userID]; // [Api loginWithThirdPart:^(BaseModel * _Nonnull data, NSInteger code, NSString * _Nonnull msg) { // @@ -441,12 +435,12 @@ typedef NS_ENUM(NSUInteger, XYLoginType) { [_loginButton setTitleColor:UIColor.whiteColor forState:UIControlStateNormal]; _loginButton.titleLabel.font = kFontMedium(16); _loginButton.titleLabel.font = [UIFont fontWithName:@"PingFang-SC-Medium" size:18]; - UIImage *bgImage = [UIImage gradientColorImageFromColors:@[[ThemeColor colorWithHexString:@"#FF60FD"], - [ThemeColor colorWithHexString:@"##8974FF"], - [ThemeColor colorWithHexString:@"#69EBFF"]] gradientType:GradientTypeLeftToRight imgSize:CGSizeMake(KScreenWidth - 80, 52)]; + UIImage *bgImage = [UIImage gradientColorImageFromColors:@[[MEWThemeColor mewColorWithHexString:@"#FF60FD"], + [MEWThemeColor mewColorWithHexString:@"##8974FF"], + [MEWThemeColor mewColorWithHexString:@"#69EBFF"]] gradientType:GradientTypeLeftToRight imgSize:CGSizeMake(KScreenWidth - 80, 52)]; _loginButton.backgroundColor = [UIColor colorWithPatternImage:bgImage]; -// [_loginButton setTitleColor:ThemeColor.mainTextColor forState:UIControlStateNormal]; -// UIImage *image = [UIImage gradientColorImageFromColors:@[[ThemeColor confirmButtonGradientStartColor],[ThemeColor confirmButtonGradientEndColor]] gradientType:GradientTypeLeftToRight imgSize:CGSizeMake(KScreenWidth - 52 * 2, 45)]; +// [_loginButton setTitleColor:ThemeColor.mewMainTextColor forState:UIControlStateNormal]; +// UIImage *image = [UIImage gradientColorImageFromColors:@[[MEWThemeColor mewConfirmButtonGradientStartColor],[MEWThemeColor mewConfirmButtonGradientEndColor]] gradientType:GradientTypeLeftToRight imgSize:CGSizeMake(KScreenWidth - 52 * 2, 45)]; // [_loginButton setBackgroundImage:image forState:UIControlStateNormal]; [_loginButton addTarget:self action:@selector(loginButtonAction:) forControlEvents:UIControlEventTouchUpInside]; } @@ -483,7 +477,7 @@ typedef NS_ENUM(NSUInteger, XYLoginType) { - (NSMutableAttributedString *)privacyAttributedStr{ NSMutableAttributedString *attString = [[NSMutableAttributedString alloc] initWithString:@"同意"]; - attString.yy_color = UIColorRGBAlpha(0xFFFFFF, 0.8); + attString.yy_color = UIColorMewRGBAlpha(0xFFFFFF, 0.8); NSString *userString = @"《用户服务协议》"; NSMutableAttributedString *userAttString = [[NSMutableAttributedString alloc] initWithString:userString attributes:@{NSForegroundColorAttributeName:UIColor.whiteColor}]; __weak typeof(self) weakSelf = self; @@ -496,7 +490,7 @@ typedef NS_ENUM(NSUInteger, XYLoginType) { } longPressAction:nil]; NSMutableAttributedString *andString = [[NSMutableAttributedString alloc] initWithString:@"和"]; - andString.yy_color = UIColorRGBAlpha(0xFFFFFF, 0.8); + andString.yy_color = UIColorMewRGBAlpha(0xFFFFFF, 0.8); NSString *protocolString = @"《隐私政策》"; NSMutableAttributedString *privateString = [[NSMutableAttributedString alloc] initWithString:protocolString attributes:@{NSForegroundColorAttributeName:UIColor.whiteColor}]; [privateString yy_setTextHighlightRange:NSMakeRange(0, privateString.length) color:nil backgroundColor:nil userInfo:nil tapAction:^(UIView * _Nonnull containerView, NSAttributedString * _Nonnull text, NSRange range, CGRect rect) { 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 51f09c8..dac0302 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 @@ -10,8 +10,8 @@ #import #import /// Tool -#import "ThemeColor.h" -#import "YMHUDTool.h" +#import "MEWThemeColor.h" +#import "MewHUDTool.h" #import "UIImage+Utils.h" #import "YMConstant.h" #import "YMMacro.h" @@ -53,7 +53,7 @@ #pragma mark - LoginPasswordProtocol - (void)phoneAndPasswordLoginSuccess { - [YMHUDTool showSuccessWithMessage:@"登录成功"]; + [MewHUDTool showSuccessWithMessage:@"登录成功"]; if (self.delegate) { [self.delegate loginWithPasswordScuccess]; } @@ -61,7 +61,7 @@ } - (void)phoneAndPasswordLoginFail:(NSString *)error { - [YMHUDTool showErrorWithMessage:error]; + [MewHUDTool showErrorWithMessage:error]; } @@ -69,12 +69,12 @@ /// 登录 - (void)nextButtonAction { if (self.phoneView.textField.text.length == 0 || [self.phoneView.textField.text isEqualToString:@""]) { - [YMHUDTool showErrorWithMessage:@"请输入账号"]; + [MewHUDTool showErrorWithMessage:@"请输入账号"]; return; } if (self.codeView.textField.text.length == 0 || [self.codeView.textField.text isEqualToString:@""]) { - [YMHUDTool showErrorWithMessage:@"请输入密码"]; + [MewHUDTool showErrorWithMessage:@"请输入密码"]; return; } @@ -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:@[[ThemeColor colorWithHexString:@"#FF60FD"], [ThemeColor colorWithHexString:@"#8974FF"],[ThemeColor colorWithHexString:@"#69EBFF"]] gradientType:GradientTypeLeftToRight imgSize:CGSizeMake(KScreenWidth - 2*36, 52)]; + UIImage *image = [UIImage gradientColorImageFromColors:@[[MEWThemeColor mewColorWithHexString:@"#FF60FD"], [MEWThemeColor mewColorWithHexString:@"#8974FF"],[MEWThemeColor mewColorWithHexString:@"#69EBFF"]] gradientType:GradientTypeLeftToRight imgSize:CGSizeMake(KScreenWidth - 2*36, 52)]; _nextButton.backgroundColor = [UIColor colorWithPatternImage:image]; [_nextButton addTarget:self action:@selector(nextButtonAction) forControlEvents:UIControlEventTouchUpInside]; } @@ -157,7 +157,7 @@ if (!_forgetPasswordButton) { _forgetPasswordButton = [UIButton buttonWithType:UIButtonTypeCustom]; [_forgetPasswordButton setTitle:@"忘记密码?" forState:UIControlStateNormal]; - [_forgetPasswordButton setTitleColor:UIColorRGBAlpha(0xFFFFFF, 0.8) forState:UIControlStateNormal]; + [_forgetPasswordButton setTitleColor:UIColorMewRGBAlpha(0xFFFFFF, 0.8) forState:UIControlStateNormal]; _forgetPasswordButton.titleLabel.font = [UIFont fontWithName:@"PingFang-SC-Regular" size:14]; // _forgetPasswordButton.hidden = NO; [_forgetPasswordButton addTarget:self action:@selector(forgetPasswordButtonAction) 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 bb8e383..0c65001 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 @@ -14,9 +14,9 @@ ///Protocole #import "LoginVerifCodeProtocol.h" /// Tool -#import "ThemeColor.h" +#import "MEWThemeColor.h" #import "YMMacro.h" -#import "YMHUDTool.h" +#import "MewHUDTool.h" #import "UIImage+Utils.h" /// View #import "LoginInputView.h" @@ -67,14 +67,14 @@ #pragma mark - LoginVerifCodeProtocol /// 获取验证码成功 - (void)phoneSmsCodeSuccess { - [YMHUDTool showErrorWithMessage:[NSString stringWithFormat:@"验证码已发送\n+86 %@", self.phone]]; + [MewHUDTool showErrorWithMessage:[NSString stringWithFormat:@"验证码已发送\n+86 %@", self.phone]]; /// 开启定时器 [self openCountdownWithTime:60]; } /// 登录成功 - (void)loginWithPhoneSuccess { - [YMHUDTool showSuccessWithMessage:@"登录成功"]; + [MewHUDTool showSuccessWithMessage:@"登录成功"]; [self stopCountDown]; if (self.delegate) { [self.delegate loginWithPhoneSuccess]; @@ -92,7 +92,7 @@ /// 获取验证码 - (void)getSmsCodeButtonAction { if (self.phone.length < 11 || self.phone == nil) { - [YMHUDTool showErrorWithMessage:@"请输入手机号码"]; + [MewHUDTool showErrorWithMessage:@"请输入手机号码"]; return; } @@ -247,7 +247,7 @@ - (LoginInputView *)phoneInputView { if (!_phoneInputView) { _phoneInputView = [[LoginInputView alloc] init]; - _phoneInputView.backgroundColor = [ThemeColor colorWithHexString:@"#F8F8FB"]; + _phoneInputView.backgroundColor = [MEWThemeColor mewColorWithHexString:@"#F8F8FB"]; _phoneInputView.layer.cornerRadius = 51.0/2; _phoneInputView.layer.masksToBounds = YES; _phoneInputView.maxLength = 11; @@ -270,13 +270,13 @@ - (UITextField *)codeTextField { if (!_codeTextField) { _codeTextField = [[UITextField alloc] init]; - _codeTextField.textColor = [ThemeColor mainTextColor]; + _codeTextField.textColor = [MEWThemeColor mewMainTextColor]; _codeTextField.font = [UIFont systemFontOfSize:18.f]; _codeTextField.keyboardType = UIKeyboardTypeNumberPad; - _codeTextField.tintColor = [ThemeColor mainTextColor]; + _codeTextField.tintColor = [MEWThemeColor mewMainTextColor]; _codeTextField.backgroundColor = [UIColor clearColor]; [_codeTextField addTarget:self action:@selector(textFieldDidChange:) forControlEvents:UIControlEventEditingChanged]; - _codeTextField.attributedPlaceholder = [[NSAttributedString alloc] initWithString:@"请输入验证码" attributes:@{NSForegroundColorAttributeName: [ThemeColor secondTextColor], NSFontAttributeName:[UIFont systemFontOfSize:14]}]; + _codeTextField.attributedPlaceholder = [[NSAttributedString alloc] initWithString:@"请输入验证码" attributes:@{NSForegroundColorAttributeName: [MEWThemeColor mewSecondTextColor], NSFontAttributeName:[UIFont systemFontOfSize:14]}]; } return _codeTextField; } @@ -286,7 +286,7 @@ _cutdownLabel = [[UILabel alloc] init]; _cutdownLabel.textAlignment = NSTextAlignmentCenter; _cutdownLabel.font = [UIFont boldSystemFontOfSize:11]; - _cutdownLabel.textColor = [ThemeColor secondTextColor]; + _cutdownLabel.textColor = [MEWThemeColor mewSecondTextColor]; _cutdownLabel.hidden = YES; } return _cutdownLabel; @@ -297,7 +297,7 @@ if (!_retryCodeButton) { _retryCodeButton = [UIButton buttonWithType:UIButtonTypeCustom]; [_retryCodeButton setTitle:@"获取验证码" forState:UIControlStateNormal]; - [_retryCodeButton setTitleColor:[ThemeColor colorWithHexString:@"#9552FF"] forState:UIControlStateNormal]; + [_retryCodeButton setTitleColor:[MEWThemeColor mewColorWithHexString:@"#9552FF"] forState:UIControlStateNormal]; _retryCodeButton.titleLabel.font = [UIFont systemFontOfSize:11 weight:UIFontWeightMedium]; [_retryCodeButton addTarget:self action:@selector(getSmsCodeButtonAction) forControlEvents:UIControlEventTouchUpInside]; _retryCodeButton.hidden = NO; @@ -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:@[[ThemeColor colorWithHexString:@"#FF60FD"], [ThemeColor colorWithHexString:@"#8974FF"],[ThemeColor colorWithHexString:@"#69EBFF"]] gradientType:GradientTypeLeftToRight imgSize:CGSizeMake(KScreenWidth - 2*36, 52)]; + UIImage *image = [UIImage gradientColorImageFromColors:@[[MEWThemeColor mewColorWithHexString:@"#FF60FD"], [MEWThemeColor mewColorWithHexString:@"#8974FF"],[MEWThemeColor mewColorWithHexString:@"#69EBFF"]] gradientType:GradientTypeLeftToRight imgSize:CGSizeMake(KScreenWidth - 2*36, 52)]; _confirmButton.backgroundColor = [UIColor colorWithPatternImage:image]; [_confirmButton setTitleColor:UIColor.whiteColor forState:UIControlStateNormal]; [_confirmButton addTarget:self action:@selector(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 ab84fab..cdc6540 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 @@ -14,9 +14,9 @@ /// Tool #import "ClientConfig.h" #import "NetImageView.h" -#import "ThemeColor.h" +#import "MEWThemeColor.h" #import "NIMMessageUtils.h" -#import "TimeIntervalUtils.h" +#import "MewTimeIntervalUtils.h" #import "UIView+NIM.h" #import "UIView+FilletCorner.h" #import "YMMacro.h" @@ -53,10 +53,10 @@ /// 时间处理 if (recent.lastMessage) { - self.timeLabel.text = [TimeIntervalUtils showTime:recent.lastMessage.timestamp showDetail:NO]; + self.timeLabel.text = [MewTimeIntervalUtils mewShowTime:recent.lastMessage.timestamp showDetail:NO]; } else { NSTimeInterval timeSecond = recent.updateTime / 1000.0; - self.timeLabel.text = [TimeIntervalUtils showTime:timeSecond showDetail:NO]; + self.timeLabel.text = [MewTimeIntervalUtils mewShowTime:timeSecond showDetail:NO]; } [self.timeLabel sizeToFit]; @@ -158,7 +158,7 @@ if (!_containerView) { _containerView = [[UIView alloc] init]; [_containerView setCornerWithLeftTopCorner:36 rightTopCorner:10 bottomLeftCorner:36 bottomRightCorner:10 size:CGSizeMake(KScreenWidth - 32, 72)]; - _containerView.backgroundColor = UIColorFromRGB(0x525566); + _containerView.backgroundColor = UIColorMewFromRGB(0x525566); } return _containerView; @@ -195,7 +195,7 @@ _messageLabel = [[UILabel alloc] initWithFrame:CGRectZero]; _messageLabel.backgroundColor = [UIColor clearColor]; _messageLabel.font = [UIFont systemFontOfSize:14.f]; - _messageLabel.textColor = UIColorRGBAlpha(0xFFFFFF, 0.8); + _messageLabel.textColor = UIColorMewRGBAlpha(0xFFFFFF, 0.8); _messageLabel.text = @"用户回复信息内容"; } return _messageLabel; 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 62a9afd..6088ae1 100644 --- a/yinmeng-ios/yinmeng-ios/Main/Mew/Mine/View/MewMineCollectionViewController.m +++ b/yinmeng-ios/yinmeng-ios/Main/Mew/Mine/View/MewMineCollectionViewController.m @@ -10,8 +10,7 @@ #import "YMEmptyTableViewCell.h" /// Tool #import "YMMacro.h" -#import "ThemeColor.h" -#import "NSArray+Safe.h" +#import "MEWThemeColor.h" /// Third #import ///P @@ -78,12 +77,12 @@ MJRefreshNormalHeader *header = [MJRefreshNormalHeader headerWithRefreshingTarget:self refreshingAction:@selector(headerRefresh)]; header.stateLabel.font = [UIFont systemFontOfSize:10.0]; header.lastUpdatedTimeLabel.font = [UIFont systemFontOfSize:10.0]; - header.stateLabel.textColor = [ThemeColor secondTextColor]; - header.lastUpdatedTimeLabel.textColor = [ThemeColor secondTextColor]; + header.stateLabel.textColor = [MEWThemeColor mewSecondTextColor]; + header.lastUpdatedTimeLabel.textColor = [MEWThemeColor mewSecondTextColor]; self.collectionTableView.mj_header = header; MJRefreshBackNormalFooter *footer = [MJRefreshBackNormalFooter footerWithRefreshingTarget:self refreshingAction:@selector(footerRefresh)]; - footer.stateLabel.textColor = [ThemeColor secondTextColor]; + footer.stateLabel.textColor = [MEWThemeColor mewSecondTextColor]; footer.stateLabel.font = [UIFont systemFontOfSize:10.0]; self.collectionTableView.mj_footer = footer; 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 7afab60..035abbf 100644 --- a/yinmeng-ios/yinmeng-ios/Main/Mew/Mine/View/MewRechargeSubView.m +++ b/yinmeng-ios/yinmeng-ios/Main/Mew/Mine/View/MewRechargeSubView.m @@ -13,10 +13,10 @@ #import #import /// Tool -#import "ThemeColor.h" +#import "MEWThemeColor.h" #import "YMMacro.h" #import "UIImage+Utils.h" -#import "YMHUDTool.h" +#import "MewHUDTool.h" @interface MewRechargeSubView() //余额 @@ -54,7 +54,7 @@ - (void)rechargeButtonAction { //立即充值 if (self.selectModel == nil) { - [YMHUDTool showErrorWithMessage:@"请选择充值的钻石"]; + [MewHUDTool showErrorWithMessage:@"请选择充值的钻石"]; return; } @@ -71,7 +71,7 @@ } UIView *currentRechargeView = tap.view; - currentRechargeView.layer.borderColor = [ThemeColor colorWithHexString:@"#9552FF"].CGColor; + currentRechargeView.layer.borderColor = [MEWThemeColor mewColorWithHexString:@"#9552FF"].CGColor; currentRechargeView.layer.borderWidth = 1.0; NSInteger selectIndex = tap.view.tag - 100; @@ -116,7 +116,7 @@ UIView *rechargeBgView = [[UIView alloc] init]; rechargeBgView.frame = CGRectMake((i%2 * (viewWidth + marginX)) + marginLeft, i/2 * (viewHeight + marginTop), viewWidth, viewHeight); - rechargeBgView.backgroundColor = UIColorRGBAlpha(0x525566, 0.8); + rechargeBgView.backgroundColor = UIColorMewRGBAlpha(0x525566, 0.8); rechargeBgView.layer.cornerRadius = 8.0; rechargeBgView.layer.masksToBounds = YES; rechargeBgView.tag = i + 100; @@ -149,7 +149,7 @@ UILabel *rechargeMoneyLabel = [[UILabel alloc] initWithFrame:CGRectMake(0, CGRectGetMaxY(rechargeStackView.frame) + 13.0, viewWidth, 20)]; rechargeMoneyLabel.text = [NSString stringWithFormat:@"%@元",model.money]; - rechargeMoneyLabel.textColor = UIColorRGBAlpha(0xFFFFFF, 0.8); + rechargeMoneyLabel.textColor = UIColorMewRGBAlpha(0xFFFFFF, 0.8); rechargeMoneyLabel.font = kFontRegular(14); rechargeMoneyLabel.textAlignment = NSTextAlignmentCenter; [rechargeBgView addSubview:rechargeMoneyLabel]; @@ -262,10 +262,10 @@ _rechargePrivacyLabel.numberOfLines = 0; NSMutableAttributedString *attString = [[NSMutableAttributedString alloc] initWithString:@"已阅读并同意"]; - attString.yy_color = [ThemeColor secondTextColor]; + attString.yy_color = [MEWThemeColor mewSecondTextColor]; attString.yy_font = [UIFont systemFontOfSize:13]; - NSMutableAttributedString *rechargeAttString = [[NSMutableAttributedString alloc] initWithString:@"《用户充值协议》\n" attributes:@{NSForegroundColorAttributeName:[ThemeColor colorWithHexString:@"#5DA4F5"]}]; + NSMutableAttributedString *rechargeAttString = [[NSMutableAttributedString alloc] initWithString:@"《用户充值协议》\n" attributes:@{NSForegroundColorAttributeName:[MEWThemeColor mewColorWithHexString:@"#5DA4F5"]}]; @kWeakify(self); [rechargeAttString yy_setTextHighlightRange:NSMakeRange(0, rechargeAttString.length) color:nil backgroundColor:nil userInfo:nil tapAction:^(UIView * _Nonnull containerView, NSAttributedString * _Nonnull text, NSRange range, CGRect rect) { @kStrongify(self); @@ -277,7 +277,7 @@ } longPressAction:nil]; NSMutableAttributedString *serviceAttString = [[NSMutableAttributedString alloc] initWithString:@"如有任何问题请咨询客服"]; - serviceAttString.yy_color = [ThemeColor secondTextColor]; + serviceAttString.yy_color = [MEWThemeColor mewSecondTextColor]; serviceAttString.yy_font = [UIFont systemFontOfSize:13]; [attString appendAttributedString:rechargeAttString]; @@ -296,9 +296,9 @@ _rechargeButton.titleLabel.font = kFontMedium(16); _rechargeButton.layer.cornerRadius = 24; _rechargeButton.layer.masksToBounds = YES; - UIImage *image = [UIImage gradientColorImageFromColors:@[[ThemeColor colorWithHexString:@"#FF60FD"], - [ThemeColor colorWithHexString:@"#8974FF"], - [ThemeColor colorWithHexString:@"#69EBFF"] + UIImage *image = [UIImage gradientColorImageFromColors:@[[MEWThemeColor mewColorWithHexString:@"#FF60FD"], + [MEWThemeColor mewColorWithHexString:@"#8974FF"], + [MEWThemeColor mewColorWithHexString:@"#69EBFF"] ] gradientType:GradientTypeLeftToRight imgSize:CGSizeMake(KScreenWidth - 2*40, 48)]; _rechargeButton.backgroundColor = [UIColor colorWithPatternImage:image]; [_rechargeButton addTarget:self action:@selector(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 565c701..3807b67 100644 --- a/yinmeng-ios/yinmeng-ios/Main/Mew/Mine/View/MewRechargeViewController.m +++ b/yinmeng-ios/yinmeng-ios/Main/Mew/Mine/View/MewRechargeViewController.m @@ -12,18 +12,18 @@ /// Third #import #import "YMMacro.h" -#import "YMIAPHelper.h" + #import "AccountInfoStorage.h" #import "RechargeListModel.h" /// P #import "MineRechargeProtocol.h" #import "MineRechargePresenter.h" -#import "YMHUDTool.h" +#import "MewHUDTool.h" #import "yinmeng_ios-Swift.h" -#import "RechargeStorage.h" +#import "MEWRechargeStorage.h" #import "NewEncryptTool.h" -@interface MewRechargeViewController () +@interface MewRechargeViewController () @property (nonatomic, strong) UIImageView *rechargeBgImageView; @property (nonatomic, strong) UIButton *backButton; @property (nonatomic, strong) MewRechargeSubView *rechageView; @@ -44,7 +44,7 @@ } - (void)dealloc { - [YMIAPHelper shareHelper].delegate = nil; + } #pragma mark - Life Cycle @@ -52,7 +52,7 @@ [super viewDidLoad]; [self initView]; [self loadData]; - [YMIAPHelper shareHelper].delegate = self; + } @@ -107,7 +107,7 @@ }; // } else { - [YMHUDTool hideHUDInView:kWindow]; + [MewHUDTool hideHUDInView:kWindow]; [self showErrorToast:@"充值失败。当前仅支持运行iOS15及以上系统的手机进行充值,请升级系统版本后重试。"]; } @@ -116,7 +116,7 @@ }else{ - [YMHUDTool hideHUDInView:kWindow]; + [MewHUDTool hideHUDInView:kWindow]; } } @@ -131,10 +131,10 @@ if (status == MewStoreConditionResultMewPay || status == MewStoreConditionResultMewStart || status == MewStoreConditionResultMewVerifiedServer) { }else if (status == MewStoreConditionResultMewUnowned) { - [YMHUDTool hideHUDInView:kWindow]; + [MewHUDTool hideHUDInView:kWindow]; [self showErrorToast:@"出现未知错误,请重新尝试"]; }else{ - [YMHUDTool hideHUDInView:kWindow]; + [MewHUDTool hideHUDInView:kWindow]; [self showErrorToast:@"购买失败"]; } } @@ -147,7 +147,7 @@ } ///二次校验成功 - (void)checkReceiptSuccess:(NSString *)transcationId { - [YMHUDTool hideHUDInView:kWindow]; + [MewHUDTool hideHUDInView:kWindow]; if (@available(iOS 15.0, *)) { MewPaymentAction *iap = [MewPaymentAction shared]; [iap Mew_verifyBusinessAccomplishWithTransaction:[NSString stringWithFormat:@"%@",transcationId] completionHandler:^{ @@ -157,10 +157,10 @@ [self deleteRechageReciptWithTransactionIdentifier:transcationId]; self.orderId = nil; ///刷新一下用户的信息 - [YMHUDTool showLoading]; + [MewHUDTool showLoading]; //5秒之后如果没有收到开通成功的云信消息,则请求一次用户信息 dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(2.0 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{ - [YMHUDTool hideHUD]; + [MewHUDTool hideHUD]; ///刷新一下用户的信息 [self.presenter getUserWalletInfo]; @@ -169,7 +169,7 @@ } ///二次校验失败 - (void)checkReceiptFailWithCode:(NSInteger)code transcationId:(NSString *)transcationId{ - [YMHUDTool hideHUDInView:kWindow]; + [MewHUDTool hideHUDInView:kWindow]; if(code == 1444){ if (@available(iOS 15.0, *)) { MewPaymentAction *iap = [MewPaymentAction shared]; @@ -183,7 +183,7 @@ ///删除本地保存的 - (void)deleteRechageReciptWithTransactionIdentifier:(NSString *)transactionIdentifier { NSString * uid = [AccountInfoStorage instance].getUid; - BOOL deleteSuccess = [RechargeStorage delegateTranscationId:transactionIdentifier uid:uid]; + BOOL deleteSuccess = [MEWRechargeStorage mewDelegateTranscationId:transactionIdentifier uid:uid]; if (deleteSuccess) { #warning to do 保存失败 需要埋点 } @@ -203,16 +203,16 @@ [dictionary setObject:self.orderId forKey:@"orderId"]; } if(dictionary.allKeys.count == 0)return; - NSString *reciptJson = [dictionary toJSONString]; + NSString *reciptJson = [dictionary mewToJSONString]; NSString * uid = [AccountInfoStorage instance].getUid; - BOOL saveSuccess = [RechargeStorage saveTranscationId:transactionIdentifier recipt:reciptJson uid:uid]; + BOOL saveSuccess = [MEWRechargeStorage mewSaveTranscationId:transactionIdentifier recipt:reciptJson uid:uid]; if (!saveSuccess) { #warning to do 保存失败 需要埋点 } } #pragma mark - MewRechargeSubViewDelegate - (void)didSelectMewRechargeChargeProdId:(NSInteger )index { - [YMHUDTool showLoadingInView:kWindow]; + [MewHUDTool showLoadingInView:kWindow]; NSString *prodId = self.rechageView.rechargeModels[index].chargeProdId; [self.presenter requestIAPRechargeOrderWithChargeProdId:[NSString stringWithFormat:@"%@",prodId]]; } @@ -227,7 +227,7 @@ [self.navigationController pushViewController:webVC animated:YES]; } -#pragma mark - YMIAPHelperDelegate + 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 bfcb3c7..a5040d5 100644 --- a/yinmeng-ios/yinmeng-ios/Main/Mew/Party/View/MewPartyListCollectionViewCell.m +++ b/yinmeng-ios/yinmeng-ios/Main/Mew/Party/View/MewPartyListCollectionViewCell.m @@ -10,7 +10,7 @@ #import "NetImageView.h" /// Tool #import "YMMacro.h" -#import "ThemeColor.h" +#import "MEWThemeColor.h" /// Third #import /// Model @@ -51,7 +51,7 @@ self.partyBgImageView.image = [UIImage imageNamed:_model.imageName]; self.titleLabel.text = _model.title; self.detailLabel.text = _model.detail; - self.detailLabel.textColor = [ThemeColor colorWithHexString:_model.colorString]; + self.detailLabel.textColor = [MEWThemeColor mewColorWithHexString:_model.colorString]; // self.lookLabel.hidden = !_model.isLook; } @@ -126,7 +126,7 @@ - (UIView *)lookBgView { if (!_lookBgView) { _lookBgView = [[UIView alloc] init]; - _lookBgView.backgroundColor = UIColorRGBAlpha(0xFFFFFF, 0.6); + _lookBgView.backgroundColor = UIColorMewRGBAlpha(0xFFFFFF, 0.6); _lookBgView.layer.cornerRadius = 4; _lookBgView.layer.masksToBounds = YES; } @@ -137,7 +137,7 @@ if (!_lookLabel) { _lookLabel = [[UILabel alloc] init]; _lookLabel.text = @"浏览过"; - _lookLabel.textColor = UIColorFromRGB(0x57585F); + _lookLabel.textColor = UIColorMewFromRGB(0x57585F); _lookLabel.font = kFontRegular(10); _lookLabel.textAlignment = NSTextAlignmentCenter; } @@ -148,7 +148,7 @@ if (!_partyBottomLabel) { _partyBottomLabel = [[UILabel alloc] init]; _partyBottomLabel.text = @"9999人派对中"; - _partyBottomLabel.textColor = [ThemeColor colorWithHexString:@"#F0F0F0"]; + _partyBottomLabel.textColor = [MEWThemeColor mewColorWithHexString:@"#F0F0F0"]; _partyBottomLabel.font = kFontRegular(11); } return _partyBottomLabel; 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 e87767b..8142fd9 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 @@ -11,8 +11,8 @@ #import "YMRoomMessageConstant.h" #import "YMMacro.h" -#import "ThemeColor.h" -#import "ThemeColor+Room.h" +#import "MEWThemeColor.h" +#import "MEWThemeColor+MEWRoom.h" #import "UIImage+Utils.h" #import #import @@ -41,7 +41,7 @@ _messageInfo = messageInfo; if (_messageInfo) { self.contentLabel.attributedText = _messageInfo.content; - self.bubbleImageView.image = [UIImage imageWithColor:[ThemeColor messageBubbleColor]]; + self.bubbleImageView.image = [UIImage imageWithColor:[MEWThemeColor messageBubbleColor]]; } // self.nickerNameLabel.attributedText = _messageInfo.content; diff --git a/yinmeng-ios/yinmeng-ios/Main/Mew/Room/View/RoomStageView/RoomMicroView/MewSocialMicroView.m b/yinmeng-ios/yinmeng-ios/Main/Mew/Room/View/RoomStageView/RoomMicroView/MewSocialMicroView.m index 554bd0c..db659a5 100644 --- a/yinmeng-ios/yinmeng-ios/Main/Mew/Room/View/RoomStageView/RoomMicroView/MewSocialMicroView.m +++ b/yinmeng-ios/yinmeng-ios/Main/Mew/Room/View/RoomStageView/RoomMicroView/MewSocialMicroView.m @@ -9,7 +9,7 @@ /// Model #import "MicroQueueModel.h" #import "UserInfoModel.h" -#import "ThemeColor+Room.h" +#import "MEWThemeColor+MEWRoom.h" @interface MewSocialMicroView() /// 当前坑位 diff --git a/yinmeng-ios/yinmeng-ios/Main/Tabbar/Presenter/MainPresenter.m b/yinmeng-ios/yinmeng-ios/Main/Tabbar/Presenter/MainPresenter.m index 98626bb..83da30b 100644 --- a/yinmeng-ios/yinmeng-ios/Main/Tabbar/Presenter/MainPresenter.m +++ b/yinmeng-ios/yinmeng-ios/Main/Tabbar/Presenter/MainPresenter.m @@ -11,7 +11,7 @@ #import "Api+Main.h" #import "MainProtocol.h" #import -#import "RechargeStorage.h" +#import "MEWRechargeStorage.h" @implementation MainPresenter @@ -65,7 +65,7 @@ /// 获取用户信息 - (void)getUserInfo { [Api getUserInfo:[self createHttpCompletion:^(BaseModel * _Nonnull data) { - [[self getView] getUserInfoSuccess:[UserInfoModel modelWithDictionary:data.data]]; + [[self getView] getUserInfoSuccess:[UserInfoModel mewModelWithDictionary:data.data]]; } fail:^(NSInteger code, NSString * _Nullable msg) { }] uid:[[AccountInfoStorage instance] getUid]]; @@ -74,12 +74,12 @@ /// 检查是否有未消费的内购订单 - (void)checkTranscation { NSString *uid = [AccountInfoStorage instance].getUid; - NSArray *array = [RechargeStorage getAllReciptsWithUid:uid]; + NSArray *array = [MEWRechargeStorage mewGetAllReciptsWithUid:uid]; if (array == nil && array.count == 0) { return; } - NSString *transcationIdStr = [array toJSONString]; + NSString *transcationIdStr = [array mewToJSONString]; [Api requestCheckTranscationIds:[self createHttpCompletion:^(BaseModel * _Nonnull data) { diff --git a/yinmeng-ios/yinmeng-ios/Main/Tabbar/View/TabbarViewController.m b/yinmeng-ios/yinmeng-ios/Main/Tabbar/View/TabbarViewController.m index 49af00e..df567ac 100644 --- a/yinmeng-ios/yinmeng-ios/Main/Tabbar/View/TabbarViewController.m +++ b/yinmeng-ios/yinmeng-ios/Main/Tabbar/View/TabbarViewController.m @@ -7,13 +7,13 @@ ///Tool -#import "YMHUDTool.h" +#import "MewHUDTool.h" #import "ClientConfig.h" -#import "ThemeColor.h" +#import "MEWThemeColor.h" #import "UIImage+Utils.h" #import "YMMacro.h" #import "AccountInfoStorage.h" -#import "NSMutableDictionary+Safe.h" +#import "NSMutableDictionary+MEWSafe.h" /// Third #import #import @@ -93,7 +93,7 @@ NSString * const kNetworkReachabilityKey = @"kNetworkReachabilityKey"; itemVc.title = title; itemVc.tabBarItem.image = [[UIImage imageNamed:image] imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal]; itemVc.tabBarItem.selectedImage = [[UIImage imageNamed:selectedImage] imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal]; - [itemVc.tabBarItem setTitleTextAttributes:@{NSForegroundColorAttributeName:[ThemeColor mainTextColor]} forState:UIControlStateSelected]; + [itemVc.tabBarItem setTitleTextAttributes:@{NSForegroundColorAttributeName:[MEWThemeColor mewMainTextColor]} forState:UIControlStateSelected]; [itemVc.tabBarItem setTitleTextAttributes:@{NSForegroundColorAttributeName:UIColor.blackColor} forState:UIControlStateNormal]; BaseNavigationController *nav = [[BaseNavigationController alloc] initWithRootViewController:itemVc]; return nav; @@ -102,7 +102,7 @@ NSString * const kNetworkReachabilityKey = @"kNetworkReachabilityKey"; - (void)configTheme { if (@available(iOS 13.0, *)) { UITabBarAppearance *appearance = [[UITabBarAppearance alloc] init]; - appearance.backgroundColor = [ThemeColor colorWithHexString:@"#1D2126"]; + appearance.backgroundColor = [MEWThemeColor mewColorWithHexString:@"#1D2126"]; self.tabBar.standardAppearance = appearance; if (@available(iOS 15.0, *)) { self.tabBar.scrollEdgeAppearance = appearance; @@ -114,7 +114,7 @@ NSString * const kNetworkReachabilityKey = @"kNetworkReachabilityKey"; // [[UITabBar appearance] setBackgroundImage:color_image]; // [[UITabBar appearance] setShadowImage:[[UIImage alloc] init]]; // if (@available(iOS 10.0, *)) { -// [[UITabBar appearance] setUnselectedItemTintColor:UIColorRGBAlpha(0x333333, 0.4)]; +// [[UITabBar appearance] setUnselectedItemTintColor:UIColorMewRGBAlpha(0x333333, 0.4)]; // } } @@ -186,19 +186,19 @@ NSString * const kNetworkReachabilityKey = @"kNetworkReachabilityKey"; - (void)showSuccessToast:(NSString *)msg { - [YMHUDTool showSuccessWithMessage:msg]; + [MewHUDTool showSuccessWithMessage:msg]; } - (void)showErrorToast:(NSString *)msg { - [YMHUDTool showErrorWithMessage:msg]; + [MewHUDTool showErrorWithMessage:msg]; } - (void)showLoading { - [YMHUDTool showLoading]; + [MewHUDTool showLoading]; } - (void)hideHUD { - [YMHUDTool hideHUD]; + [MewHUDTool hideHUD]; } #pragma mark - 网络状态监听 @@ -242,29 +242,29 @@ NSString * const kNetworkReachabilityKey = @"kNetworkReachabilityKey"; userinfo.userId = uid; NSMutableArray * array = [NSMutableArray array]; NSMutableDictionary * nickDic = [NSMutableDictionary dictionary]; - [nickDic safeSetObject:@"real_name" forKey:@"key"]; - [nickDic safeSetObject:userInfo.nick forKey:@"value"]; + [nickDic mewSafeSetObject:@"real_name" forKey:@"key"]; + [nickDic mewSafeSetObject:userInfo.nick forKey:@"value"]; NSMutableDictionary * phoneDic = [NSMutableDictionary dictionary]; - [phoneDic safeSetObject:@"mobile_phone" forKey:@"key"]; - [phoneDic safeSetObject:userInfo.phone?:@"" forKey:@"value"]; + [phoneDic mewSafeSetObject:@"mobile_phone" forKey:@"key"]; + [phoneDic mewSafeSetObject:userInfo.phone?:@"" forKey:@"value"]; NSMutableDictionary * accountDic = [NSMutableDictionary dictionary]; - [accountDic safeSetObject:@"0" forKey:@"index"]; - [accountDic safeSetObject:@"account" forKey:@"key"]; - [accountDic safeSetObject:@"ID" forKey:@"label"]; - [accountDic safeSetObject:@(userInfo.erbanNo) forKey:@"value"]; + [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 safeSetObject:@"1" forKey:@"index"]; - [genderDic safeSetObject:@"sex" forKey:@"key"]; - [genderDic safeSetObject:@"性别" forKey:@"label"]; - [genderDic safeSetObject:userInfo.gender == GenderType_Male ? @"男" : @"女" forKey:@"value"]; + [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.toJSONString; + userinfo.data = array.mewToJSONString; [[QYSDK sharedSDK] setUserInfo:userinfo]; } diff --git a/yinmeng-ios/yinmeng-ios/Main/YMWebViewController.m b/yinmeng-ios/yinmeng-ios/Main/YMWebViewController.m index 52f7c35..18b2b43 100644 --- a/yinmeng-ios/yinmeng-ios/Main/YMWebViewController.m +++ b/yinmeng-ios/yinmeng-ios/Main/YMWebViewController.m @@ -13,12 +13,12 @@ #import "Api+Mine.h" #import "YYUtility.h" #import "AccountInfoStorage.h" -#import "ThemeColor.h" +#import "MEWThemeColor.h" #import "YMMacro.h" #import "NewEncryptTool.h" #import "HttpRequestHelper.h" #import "AccountModel.h" -#import "YMHUDTool.h" +#import "MewHUDTool.h" #import "ClientConfig.h" /// Third #import @@ -65,7 +65,7 @@ NSString * const kCloseWebView = @"closeWebView"; NSString * const kCancelAccount = @"cancelAccount"; @interface YMWebViewController () @property (strong, nonatomic) WKWebView *webview; -@property (nonatomic, strong) WKUserContentController *userContentController; +@property (nonatomic, strong) WKUserContentController *mew_userContentController; ///是否隐藏导航栏 @property (nonatomic,assign) BOOL isHiddenNav; @@ -150,10 +150,10 @@ NSString * const kCancelAccount = @"cancelAccount"; [self.navigationController popViewControllerAnimated:YES]; } } else if ([message.name isEqualToString:kCancelAccount]) { - [YMHUDTool showLoadingWithMessage:@"正在注销中,请稍等"]; + [MewHUDTool showLoadingWithMessage:@"正在注销中,请稍等"]; AccountModel *model = [[AccountInfoStorage instance] accountModel]; [Api logoutCurrentAccount:^(BaseModel * _Nonnull data, NSInteger code, NSString * _Nonnull msg) { - [YMHUDTool showSuccessWithMessage:@"注销成功"]; + [MewHUDTool showSuccessWithMessage:@"注销成功"]; dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(2.0 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{ [self.navigationController popToRootViewControllerAnimated:NO]; [[AccountInfoStorage instance] saveAccountInfo:nil]; @@ -202,7 +202,7 @@ NSString * const kCancelAccount = @"cancelAccount"; [self.webview goBack]; } else { [self.navigationController popViewControllerAnimated:YES]; - [self.userContentController removeAllUserScripts]; + [self.mew_userContentController removeAllUserScripts]; } } @@ -221,18 +221,18 @@ NSString * const kCancelAccount = @"cancelAccount"; NSString *realCookie = [NSString stringWithFormat:@"%@=%@",@"uid",uid]; WKUserScript *cookieScript = [[WKUserScript alloc] initWithSource: [NSString stringWithFormat:@"document.cookie = '%@';", realCookie] injectionTime:WKUserScriptInjectionTimeAtDocumentStart forMainFrameOnly:NO]; - [self.userContentController addUserScript:cookieScript]; + [self.mew_userContentController addUserScript:cookieScript]; ///禁止缩放 NSString *scaleJs = @"$('meta[name=description]').remove(); $('head').append( '' );"; WKUserScript *scaleScript = [[WKUserScript alloc] initWithSource:scaleJs injectionTime:WKUserScriptInjectionTimeAtDocumentEnd forMainFrameOnly:NO]; - [self.userContentController addUserScript:scaleScript]; + [self.mew_userContentController addUserScript:scaleScript]; //根据生成的WKUserScript对象,初始化WKWebViewConfiguration configuration.preferences.javaScriptEnabled = YES; configuration.preferences.javaScriptCanOpenWindowsAutomatically = YES; configuration.preferences.minimumFontSize = 10; configuration.selectionGranularity = WKSelectionGranularityCharacter; - configuration.userContentController = self.userContentController; + configuration.userContentController = self.mew_userContentController; CGSize size = [UIScreen mainScreen].bounds.size; _webview = [[WKWebView alloc]initWithFrame:CGRectMake(0, 0, size.width,size.height) configuration:configuration]; @@ -264,27 +264,27 @@ NSString * const kCancelAccount = @"cancelAccount"; return _webview; } -- (WKUserContentController *)userContentController{ - if (!_userContentController) { +- (WKUserContentController *)mew_userContentController{ + if (!_mew_userContentController) { //自定义的WKScriptMessageHandler 是为了解决内存不释放的问题 WeakWebViewScriptMessageDelegate *weakScriptMessageDelegate = [[WeakWebViewScriptMessageDelegate alloc] initWithDelegate:self]; - _userContentController = [[WKUserContentController alloc] init]; + _mew_userContentController = [[WKUserContentController alloc] init]; // 获取uid - [_userContentController addScriptMessageHandler:weakScriptMessageDelegate name:kJSGetUid]; + [_mew_userContentController addScriptMessageHandler:weakScriptMessageDelegate name:kJSGetUid]; // 获取设备id - [_userContentController addScriptMessageHandler:weakScriptMessageDelegate name:kJSGetDeviceId]; + [_mew_userContentController addScriptMessageHandler:weakScriptMessageDelegate name:kJSGetDeviceId]; // 获取Ticket - [_userContentController addScriptMessageHandler:weakScriptMessageDelegate name:kJSGetTicket]; + [_mew_userContentController addScriptMessageHandler:weakScriptMessageDelegate name:kJSGetTicket]; // 获取设备info - [_userContentController addScriptMessageHandler:weakScriptMessageDelegate name:kJSGetDeviceInfo]; + [_mew_userContentController addScriptMessageHandler:weakScriptMessageDelegate name:kJSGetDeviceInfo]; // 隐藏导航栏 - [_userContentController addScriptMessageHandler:weakScriptMessageDelegate name:kInitShowNav]; + [_mew_userContentController addScriptMessageHandler:weakScriptMessageDelegate name:kInitShowNav]; // 隐藏导航栏 - [_userContentController addScriptMessageHandler:weakScriptMessageDelegate name:kCloseWebView]; + [_mew_userContentController addScriptMessageHandler:weakScriptMessageDelegate name:kCloseWebView]; // 注销账号 - [_userContentController addScriptMessageHandler:weakScriptMessageDelegate name:kCancelAccount]; + [_mew_userContentController addScriptMessageHandler:weakScriptMessageDelegate name:kCancelAccount]; } - return _userContentController; + return _mew_userContentController; } @end diff --git a/yinmeng-ios/yinmeng-ios/Main/YinMeng/Home/Presenter/YMHomePresenter.m b/yinmeng-ios/yinmeng-ios/Main/YinMeng/Home/Presenter/YMHomePresenter.m index f1bcb79..86b7aa6 100644 --- a/yinmeng-ios/yinmeng-ios/Main/YinMeng/Home/Presenter/YMHomePresenter.m +++ b/yinmeng-ios/yinmeng-ios/Main/YinMeng/Home/Presenter/YMHomePresenter.m @@ -22,7 +22,7 @@ NSString * pageStr = [NSString stringWithFormat:@"%d", page]; NSString * pageSizeStr = [NSString stringWithFormat:@"%d", pageSize]; [Api getRecommendListComplection:[self createHttpCompletion:^(BaseModel * _Nonnull data) { - NSArray * array = [HomeRecommendRoomModel modelsWithArray:data.data]; + NSArray * array = [HomeRecommendRoomModel mewModelsWithArray:data.data]; [[self getView] getHomeRecommendRoomListSuccess:array state:state]; }fail:^(NSInteger code, NSString * _Nullable msg) { // [[self getView] getHomeRecommendRoomListFail:msg state:state]; @@ -34,7 +34,7 @@ - (void)homeRecommendRoomList { NSString *uid = [AccountInfoStorage instance].getUid; [Api homeRecommendRoomListComplection:[self createHttpCompletion:^(BaseModel * _Nonnull data) { - NSArray * array = [HomeRecommendRoomModel modelsWithArray:data.data]; + NSArray * array = [HomeRecommendRoomModel mewModelsWithArray:data.data]; [[self getView] homeRecommendRoomListSuccess:array]; // [[self getView] getHomeRecommendRoomListSuccess:array state:state]; }fail:^(NSInteger code, NSString * _Nullable msg) { diff --git a/yinmeng-ios/yinmeng-ios/Main/YinMeng/IM/Model/AttachmentModel.m b/yinmeng-ios/yinmeng-ios/Main/YinMeng/IM/Model/AttachmentModel.m index 70b1eec..ba907dd 100644 --- a/yinmeng-ios/yinmeng-ios/Main/YinMeng/IM/Model/AttachmentModel.m +++ b/yinmeng-ios/yinmeng-ios/Main/YinMeng/IM/Model/AttachmentModel.m @@ -6,11 +6,11 @@ // #import "AttachmentModel.h" -#import "NSObject+MJExtension.h" +#import "NSObject+MEWExtension.h" @implementation AttachmentModel - (NSString *)encodeAttachment { - return [self toJSONString]; + return [self mewToJSONString]; } diff --git a/yinmeng-ios/yinmeng-ios/Main/YinMeng/IM/Tool/CustomAttachmentDecoder.m b/yinmeng-ios/yinmeng-ios/Main/YinMeng/IM/Tool/CustomAttachmentDecoder.m index ec38e5f..67ad371 100644 --- a/yinmeng-ios/yinmeng-ios/Main/YinMeng/IM/Tool/CustomAttachmentDecoder.m +++ b/yinmeng-ios/yinmeng-ios/Main/YinMeng/IM/Tool/CustomAttachmentDecoder.m @@ -6,7 +6,7 @@ // #import "CustomAttachmentDecoder.h" -#import "NSObject+MJExtension.h" +#import "NSObject+MEWExtension.h" #import "AttachmentModel.h" @implementation CustomAttachmentDecoder diff --git a/yinmeng-ios/yinmeng-ios/Main/YinMeng/Login/Presenter/LoginFullInfoPresenter.m b/yinmeng-ios/yinmeng-ios/Main/YinMeng/Login/Presenter/LoginFullInfoPresenter.m index 5571358..8aa6441 100644 --- a/yinmeng-ios/yinmeng-ios/Main/YinMeng/Login/Presenter/LoginFullInfoPresenter.m +++ b/yinmeng-ios/yinmeng-ios/Main/YinMeng/Login/Presenter/LoginFullInfoPresenter.m @@ -9,7 +9,7 @@ #import "Api+Login.h" ///Tool #import "AccountInfoStorage.h" -#import "NSMutableDictionary+Safe.h" +#import "NSMutableDictionary+MEWSafe.h" ///Api #import "LoginFullInfoProtocol.h" ///Model @@ -56,25 +56,25 @@ NSString * uid = [[AccountInfoStorage instance] getUid]; NSString * ticket = [[AccountInfoStorage instance] getTicket]; NSMutableDictionary * params = [NSMutableDictionary dictionary]; - [params safeSetObject:avatar forKey:@"avatar"]; - [params safeSetObject:gender forKey:@"gender"]; - [params safeSetObject:nick forKey:@"nick"]; - [params safeSetObject:uid forKey:@"uid"]; - [params safeSetObject:ticket forKey:@"ticket"]; + [params mewSafeSetObject:avatar forKey:@"avatar"]; + [params mewSafeSetObject:gender forKey:@"gender"]; + [params mewSafeSetObject:nick forKey:@"nick"]; + [params mewSafeSetObject:uid forKey:@"uid"]; + [params mewSafeSetObject:ticket forKey:@"ticket"]; if (inviteCode.length > 0) { - [params safeSetObject:inviteCode forKey:@"inviteCode"]; + [params mewSafeSetObject:inviteCode forKey:@"inviteCode"]; } if (roomUid.length > 0) { - [params safeSetObject:roomUid forKey:@"roomUid"]; + [params mewSafeSetObject:roomUid forKey:@"roomUid"]; } if (shareUid.length > 0) { - [params safeSetObject:shareUid forKey:@"shareUid"]; + [params mewSafeSetObject:shareUid forKey:@"shareUid"]; } if (shareChannel.length > 0) { - [params safeSetObject:shareChannel forKey:@"shareChannel"]; + [params mewSafeSetObject:shareChannel forKey:@"shareChannel"]; } [Api completeUserInfo:[self createHttpCompletion:^(BaseModel * _Nonnull data) { diff --git a/yinmeng-ios/yinmeng-ios/Main/YinMeng/Login/Presenter/LoginPasswordPresent.m b/yinmeng-ios/yinmeng-ios/Main/YinMeng/Login/Presenter/LoginPasswordPresent.m index 5396b5d..ba9bfb5 100644 --- a/yinmeng-ios/yinmeng-ios/Main/YinMeng/Login/Presenter/LoginPasswordPresent.m +++ b/yinmeng-ios/yinmeng-ios/Main/YinMeng/Login/Presenter/LoginPasswordPresent.m @@ -26,7 +26,7 @@ NSString * desPassword = [DESEncrypt encryptUseDES:password key:KeyWithType(KeyType_PasswordEncode)]; NSString * desPhone = [DESEncrypt encryptUseDES:phone key:KeyWithType(KeyType_PasswordEncode)]; [Api loginWithPassword:[self createHttpCompletion:^(BaseModel * _Nonnull data) { - AccountModel *model = [AccountModel modelWithDictionary:data.data]; + AccountModel *model = [AccountModel mewModelWithDictionary:data.data]; if (model && model.access_token.length > 0){ [[AccountInfoStorage instance] saveAccountInfo:model]; } diff --git a/yinmeng-ios/yinmeng-ios/Main/YinMeng/Login/Presenter/LoginPresenter.m b/yinmeng-ios/yinmeng-ios/Main/YinMeng/Login/Presenter/LoginPresenter.m index d0445c6..06d162f 100644 --- a/yinmeng-ios/yinmeng-ios/Main/YinMeng/Login/Presenter/LoginPresenter.m +++ b/yinmeng-ios/yinmeng-ios/Main/YinMeng/Login/Presenter/LoginPresenter.m @@ -36,7 +36,7 @@ - (void)thirdLoginWithApple:(NSString *)token unionId:(NSString *)unionId { [Api loginWithThirdPart:[self createHttpCompletion:^(BaseModel * _Nonnull data) { - AccountModel *model = [AccountModel modelWithDictionary:data.data]; + AccountModel *model = [AccountModel mewModelWithDictionary:data.data]; if (model != nil) { [[AccountInfoStorage instance] saveAccountInfo:model]; [[self getView] loginSuccess]; diff --git a/yinmeng-ios/yinmeng-ios/Main/YinMeng/Login/Presenter/LoginVerifCodePresent.m b/yinmeng-ios/yinmeng-ios/Main/YinMeng/Login/Presenter/LoginVerifCodePresent.m index e1c7ac1..500ccc9 100644 --- a/yinmeng-ios/yinmeng-ios/Main/YinMeng/Login/Presenter/LoginVerifCodePresent.m +++ b/yinmeng-ios/yinmeng-ios/Main/YinMeng/Login/Presenter/LoginVerifCodePresent.m @@ -41,7 +41,7 @@ - (void)loginWithPhone:(NSString *)phone code:(NSString *)code { NSString *desPhone = [DESEncrypt encryptUseDES:phone key:KeyWithType(KeyType_PasswordEncode)]; [Api loginWithCode:[self createHttpCompletion:^(BaseModel * _Nonnull data) { - AccountModel *accountModel = [AccountModel modelWithDictionary:data.data]; + AccountModel *accountModel = [AccountModel mewModelWithDictionary:data.data]; if (accountModel && accountModel.access_token.length > 0) { [[AccountInfoStorage instance] saveAccountInfo:accountModel]; } diff --git a/yinmeng-ios/yinmeng-ios/Main/YinMeng/Login/View/CustomView/LoginForgetEditView.m b/yinmeng-ios/yinmeng-ios/Main/YinMeng/Login/View/CustomView/LoginForgetEditView.m index 6bad526..c80b7ba 100644 --- a/yinmeng-ios/yinmeng-ios/Main/YinMeng/Login/View/CustomView/LoginForgetEditView.m +++ b/yinmeng-ios/yinmeng-ios/Main/YinMeng/Login/View/CustomView/LoginForgetEditView.m @@ -9,7 +9,7 @@ ///第三方 #import ///Tool -#import "ThemeColor.h" +#import "MEWThemeColor.h" @interface LoginForgetEditView() /// @@ -37,7 +37,7 @@ #pragma mark - private method - (void)initView { - self.backgroundColor = [ThemeColor appCellBackgroundColor]; + self.backgroundColor = [MEWThemeColor mewAppCellBackgroundColor]; [self addSubview:self.stackView]; [self addSubview:self.bottomLineView]; @@ -89,7 +89,7 @@ NSDictionary *dic = @{ NSParagraphStyleAttributeName:style, NSFontAttributeName:[UIFont systemFontOfSize:14], - NSForegroundColorAttributeName:[ThemeColor secondTextColor]}; + NSForegroundColorAttributeName:[MEWThemeColor mewSecondTextColor]}; if (placeholder == nil || placeholder.length == 0) { placeholder = @""; } @@ -101,7 +101,7 @@ if (!_textField) { _textField = [[UITextField alloc] init]; _textField.font = [UIFont systemFontOfSize:14]; - _textField.textColor = [ThemeColor mainTextColor]; + _textField.textColor = [MEWThemeColor mewMainTextColor]; _textField.keyboardType = UIKeyboardTypeNumberPad; _textField.tintColor = UIColor.blackColor; } @@ -120,7 +120,7 @@ if (!_bottomLineView) { _bottomLineView = [[UIView alloc] init]; _bottomLineView.backgroundColor = UIColor.grayColor; -// _bottomLineView.backgroundColor = [ThemeColor dividerColor]; +// _bottomLineView.backgroundColor = [MEWThemeColor mewDividerColor]; } return _bottomLineView; } @@ -130,7 +130,7 @@ _authCodeButton = [UIButton buttonWithType:UIButtonTypeCustom]; _authCodeButton.titleLabel.font = [UIFont systemFontOfSize:14]; [_authCodeButton setTitle:@"获取验证码" forState:UIControlStateNormal]; - [_authCodeButton setTitleColor:[ThemeColor secondTextColor] forState:UIControlStateDisabled]; + [_authCodeButton setTitleColor:[MEWThemeColor mewSecondTextColor] forState:UIControlStateDisabled]; [_authCodeButton setTitleColor:UIColor.blackColor forState:UIControlStateNormal]; } return _authCodeButton; diff --git a/yinmeng-ios/yinmeng-ios/Main/YinMeng/Login/View/CustomView/LoginInputView.m b/yinmeng-ios/yinmeng-ios/Main/YinMeng/Login/View/CustomView/LoginInputView.m index 46f21af..8cc5045 100644 --- a/yinmeng-ios/yinmeng-ios/Main/YinMeng/Login/View/CustomView/LoginInputView.m +++ b/yinmeng-ios/yinmeng-ios/Main/YinMeng/Login/View/CustomView/LoginInputView.m @@ -9,7 +9,7 @@ ///Third #import ///Tool -#import "ThemeColor.h" +#import "MEWThemeColor.h" @interface LoginInputView() @@ -63,7 +63,7 @@ - (void)setPlaceHolder:(NSString *)placeHolder { _placeHolder = placeHolder; if (_placeHolder) { - self.textField.attributedPlaceholder = [[NSAttributedString alloc] initWithString:_placeHolder attributes:@{NSForegroundColorAttributeName: [ThemeColor secondTextColor], NSFontAttributeName:[UIFont systemFontOfSize:14]}]; + self.textField.attributedPlaceholder = [[NSAttributedString alloc] initWithString:_placeHolder attributes:@{NSForegroundColorAttributeName: [MEWThemeColor mewSecondTextColor], NSFontAttributeName:[UIFont systemFontOfSize:14]}]; } } @@ -89,7 +89,7 @@ if (!_titleLabel) { _titleLabel = [[UILabel alloc] init]; _titleLabel.font = [UIFont systemFontOfSize:18]; - _titleLabel.textColor = [ThemeColor mainTextColor]; + _titleLabel.textColor = [MEWThemeColor mewMainTextColor]; _titleLabel.text = @"+86"; } return _titleLabel; @@ -98,7 +98,7 @@ - (UIView *)lineView { if (!_lineView) { _lineView = [[UIView alloc] init]; - _lineView.backgroundColor = [ThemeColor colorWithHexString:@"#F2F3F6"]; + _lineView.backgroundColor = [MEWThemeColor mewColorWithHexString:@"#F2F3F6"]; } return _lineView; } @@ -107,11 +107,11 @@ - (UITextField *)textField { if (!_textField) { _textField = [[UITextField alloc] init]; - _textField.textColor = [ThemeColor mainTextColor]; + _textField.textColor = [MEWThemeColor mewMainTextColor]; _textField.font = [UIFont systemFontOfSize:18.f]; _textField.borderStyle = UITextBorderStyleNone; _textField.keyboardType = UIKeyboardTypeNumberPad; - _textField.tintColor = [ThemeColor mainTextColor]; + _textField.tintColor = [MEWThemeColor mewMainTextColor]; _textField.backgroundColor = [UIColor clearColor]; _textField.delegate = self; } 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 c6a06a5..26f003c 100644 --- a/yinmeng-ios/yinmeng-ios/Main/YinMeng/Login/View/LoginBindPhoneResultViewController.m +++ b/yinmeng-ios/yinmeng-ios/Main/YinMeng/Login/View/LoginBindPhoneResultViewController.m @@ -10,7 +10,7 @@ #import #import ///Tool -#import "ThemeColor.h" +#import "MEWThemeColor.h" #import "UIImage+Utils.h" ///Model #import "UserInfoModel.h" @@ -90,7 +90,7 @@ - (UIView *)containerView{ if (!_containerView) { _containerView = [[UIView alloc] init]; - _containerView.backgroundColor = [ThemeColor appBackgroundColor]; + _containerView.backgroundColor = [MEWThemeColor mewAppBackgroundColor]; } return _containerView; } @@ -106,7 +106,7 @@ if (!_titleLabel) { _titleLabel = [[UILabel alloc] init]; _titleLabel.text = @"您当前绑定的手机号为"; - _titleLabel.textColor = [ThemeColor secondTextColor]; + _titleLabel.textColor = [MEWThemeColor mewSecondTextColor]; _titleLabel.font = [UIFont systemFontOfSize:14.f]; _titleLabel.adjustsFontSizeToFitWidth = YES; _titleLabel.textAlignment = NSTextAlignmentCenter; @@ -117,7 +117,7 @@ - (UILabel *)phoneLabel{ if (!_phoneLabel) { _phoneLabel = [[UILabel alloc] init]; - _phoneLabel.textColor = [ThemeColor mainTextColor]; + _phoneLabel.textColor = [MEWThemeColor mewMainTextColor]; _phoneLabel.font = [UIFont boldSystemFontOfSize:18.f]; _phoneLabel.adjustsFontSizeToFitWidth = YES; _phoneLabel.textAlignment = NSTextAlignmentCenter; @@ -129,9 +129,9 @@ if (!_changePhoneBtn) { _changePhoneBtn = [UIButton buttonWithType:UIButtonTypeCustom]; [_changePhoneBtn setTitle:@"更改手机号码" forState:UIControlStateNormal]; - [_changePhoneBtn setTitleColor:[ThemeColor confirmButtonTextColor] forState:UIControlStateNormal]; + [_changePhoneBtn setTitleColor:[MEWThemeColor mewConfirmButtonTextColor] forState:UIControlStateNormal]; [_changePhoneBtn.titleLabel setFont:[UIFont fontWithName:@"PingFang-SC-Medium" size:18]]; - [_changePhoneBtn setBackgroundImage:[UIImage gradientColorImageFromColors:@[[ThemeColor confirmButtonGradientStartColor], [ThemeColor confirmButtonGradientEndColor]] gradientType:GradientTypeLeftToRight imgSize:CGSizeMake(10, 10)] forState:UIControlStateNormal]; + [_changePhoneBtn setBackgroundImage:[UIImage gradientColorImageFromColors:@[[MEWThemeColor mewConfirmButtonGradientStartColor], [MEWThemeColor mewConfirmButtonGradientEndColor]] gradientType:GradientTypeLeftToRight imgSize:CGSizeMake(10, 10)] forState:UIControlStateNormal]; _changePhoneBtn.layer.masksToBounds = YES; _changePhoneBtn.layer.cornerRadius = 22.5; [_changePhoneBtn addTarget:self action:@selector(changePhoneBtnAction:) forControlEvents:UIControlEventTouchUpInside]; diff --git a/yinmeng-ios/yinmeng-ios/Main/YinMeng/Login/View/LoginBindPhoneViewController.m b/yinmeng-ios/yinmeng-ios/Main/YinMeng/Login/View/LoginBindPhoneViewController.m index 86f65db..3d2f5ff 100644 --- a/yinmeng-ios/yinmeng-ios/Main/YinMeng/Login/View/LoginBindPhoneViewController.m +++ b/yinmeng-ios/yinmeng-ios/Main/YinMeng/Login/View/LoginBindPhoneViewController.m @@ -11,7 +11,7 @@ #import ///Tool #import "YMMacro.h" -#import "ThemeColor.h" +#import "MEWThemeColor.h" //#import "NSString+Utils.h" ///Tool @@ -158,7 +158,7 @@ _titleLabel = [[UILabel alloc] init]; _titleLabel.font = [UIFont fontWithName:@"PingFang-SC-Medium" size:18]; _titleLabel.text = @"绑定手机号"; - _titleLabel.textColor = [ThemeColor mainTextColor]; + _titleLabel.textColor = [MEWThemeColor mewMainTextColor]; } return _titleLabel; } @@ -166,7 +166,7 @@ - (UIView *)bgView { if (!_bgView) { _bgView = [[UIView alloc] init]; - _bgView.backgroundColor = [ThemeColor appCellBackgroundColor]; + _bgView.backgroundColor = [MEWThemeColor mewAppCellBackgroundColor]; _bgView.layer.cornerRadius = 45/2; _bgView.layer.masksToBounds = YES; } @@ -178,7 +178,7 @@ _countryLabel = [[UILabel alloc] init]; _countryLabel.font = [UIFont fontWithName:@"PingFang-SC-Medium" size:15]; _countryLabel.text = @"+86"; - _countryLabel.textColor = [ThemeColor mainTextColor]; + _countryLabel.textColor = [MEWThemeColor mewMainTextColor]; _countryLabel.backgroundColor = [UIColor clearColor]; _countryLabel.textAlignment = NSTextAlignmentCenter; } @@ -190,8 +190,8 @@ _phoneTextField = [[UITextField alloc] init]; _phoneTextField.keyboardType = UIKeyboardTypeNumberPad; _phoneTextField.backgroundColor = [UIColor clearColor]; - _phoneTextField.textColor = [ThemeColor mainTextColor]; -// _phoneTextField.tintColor = [ThemeColor appMainColor]; + _phoneTextField.textColor = [MEWThemeColor mewMainTextColor]; +// _phoneTextField.tintColor = [MEWThemeColor appMainColor]; _phoneTextField.font = [UIFont fontWithName:@"PingFang-SC-Medium" size:15]; _phoneTextField.textAlignment = NSTextAlignmentLeft; } diff --git a/yinmeng-ios/yinmeng-ios/Main/YinMeng/Login/View/LoginForgetPasswordViewController.m b/yinmeng-ios/yinmeng-ios/Main/YinMeng/Login/View/LoginForgetPasswordViewController.m index 37954ae..5edabf9 100644 --- a/yinmeng-ios/yinmeng-ios/Main/YinMeng/Login/View/LoginForgetPasswordViewController.m +++ b/yinmeng-ios/yinmeng-ios/Main/YinMeng/Login/View/LoginForgetPasswordViewController.m @@ -15,13 +15,13 @@ #import #import ///Tool -#import "ThemeColor.h" -#import "CountDownHelper.h" +#import "MEWThemeColor.h" +#import "MEWCountDownHelper.h" #import "YMMacro.h" #import "UIImage+Utils.h" -@interface LoginForgetPasswordViewController () +@interface LoginForgetPasswordViewController () @property (nonatomic, strong) UIImageView *bgImageView; ///容器 @property (nonatomic,strong) UIStackView *stackView; @@ -46,7 +46,7 @@ } - (void)dealloc { - [[CountDownHelper shareHelper] stopCountDown]; + [[MEWCountDownHelper shareHelper] mewStopCountDown]; } - (BOOL)isHiddenNavBar { @@ -63,7 +63,7 @@ - (void)viewDidDisappear:(BOOL)animated { [super viewDidDisappear:animated]; - [[CountDownHelper shareHelper] stopCountDown]; + [[MEWCountDownHelper shareHelper] mewStopCountDown]; } @@ -72,22 +72,22 @@ - (void)phoneSmsCodeSuccess { self.codeView.authCodeButton.enabled= NO; [self showSuccessToast:@"验证码发送成功"]; - [[CountDownHelper shareHelper] openCountdownWithTime:60]; + [[MEWCountDownHelper shareHelper] mewOpenCountdownWithTime:60]; } ///重置密码成功 - (void)resetPasswrodSuccess { - [[CountDownHelper shareHelper] stopCountDown]; + [[MEWCountDownHelper shareHelper] mewStopCountDown]; [self showSuccessToast:@"重置密码成功"]; [self.navigationController popViewControllerAnimated:YES]; } #pragma mark - CountDownHelperDelegate ///倒计时进行中 -- (void)onCountdownOpen:(int)time { +- (void)mewOnCountdownOpen:(int)time { [self.codeView.authCodeButton setTitle:[NSString stringWithFormat:@"%ds后重试", time] forState:UIControlStateDisabled]; } ///倒计时结束 -- (void)onCountdownFinish { +- (void)mewOnCountdownFinish { self.codeView.authCodeButton.enabled= YES; [self.codeView.authCodeButton setTitle:@"重新发送" forState:UIControlStateNormal]; } @@ -113,7 +113,7 @@ #pragma mark - Private Method - (void)initSubViews { // self.titleLabel.text = @"忘记密码"; - [CountDownHelper shareHelper].delegate = self; + [MEWCountDownHelper shareHelper].delegate = self; [self.view addSubview:self.bgImageView]; [self.view addSubview:self.backButton]; [self.view addSubview:self.titleLabel]; @@ -226,7 +226,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:@[[ThemeColor colorWithHexString:@"#FF60FD"], [ThemeColor colorWithHexString:@"#8974FF"],[ThemeColor colorWithHexString:@"#69EBFF"]] gradientType:GradientTypeLeftToRight imgSize:CGSizeMake(KScreenWidth - 2*36, 52)]; + UIImage *image = [UIImage gradientColorImageFromColors:@[[MEWThemeColor mewColorWithHexString:@"#FF60FD"], [MEWThemeColor mewColorWithHexString:@"#8974FF"],[MEWThemeColor mewColorWithHexString:@"#69EBFF"]] gradientType:GradientTypeLeftToRight imgSize:CGSizeMake(KScreenWidth - 2*36, 52)]; _finishButton.backgroundColor = [UIColor colorWithPatternImage:image]; [_finishButton addTarget:self action:@selector(finishButtonAction:) forControlEvents:UIControlEventTouchUpInside]; } @@ -263,7 +263,7 @@ _codeView.placeholder = @"请输入验证码"; _codeView.type = LoginForgetEditViewTypeSms; _codeView.backgroundColor = UIColor.whiteColor; - [_codeView.authCodeButton setTitleColor:[ThemeColor colorWithHexString:@"#9552FF"] forState:UIControlStateNormal]; + [_codeView.authCodeButton setTitleColor:[MEWThemeColor mewColorWithHexString:@"#9552FF"] forState:UIControlStateNormal]; _codeView.layer.cornerRadius = 52/2.f; _codeView.layer.masksToBounds = YES; [_codeView.authCodeButton addTarget:self action:@selector(authCodeButtonAction:) forControlEvents:UIControlEventTouchUpInside]; diff --git a/yinmeng-ios/yinmeng-ios/Main/YinMeng/Login/View/LoginFullInfoViewController.m b/yinmeng-ios/yinmeng-ios/Main/YinMeng/Login/View/LoginFullInfoViewController.m index fe96726..b918b11 100644 --- a/yinmeng-ios/yinmeng-ios/Main/YinMeng/Login/View/LoginFullInfoViewController.m +++ b/yinmeng-ios/yinmeng-ios/Main/YinMeng/Login/View/LoginFullInfoViewController.m @@ -10,11 +10,11 @@ #import #import ///Tool -#import "ThemeColor.h" +#import "MEWThemeColor.h" #import "YMMacro.h" #import "AccountInfoStorage.h" #import "UIImage+Utils.h" -#import "YMHUDTool.h" +#import "MewHUDTool.h" #import "NewEncryptTool.h" ///Model #import "ThirdUserInfo.h" @@ -91,12 +91,12 @@ /// 下一步 - (void)nextButtonAction { if (self.sexString.length == 0 || [self.sexString isEqualToString:@""]) { - [YMHUDTool showErrorWithMessage:@"请选择性别"]; + [MewHUDTool showErrorWithMessage:@"请选择性别"]; return; } if (self.textField.text.length == 0 || [self.textField.text isEqualToString:@""]) { - [YMHUDTool showErrorWithMessage:@"请输入昵称"]; + [MewHUDTool showErrorWithMessage:@"请输入昵称"]; return; } @@ -129,7 +129,7 @@ if (self.textField.text.length > 0 && self.sexString.length > 0) { self.nextButton.enabled = YES; } else { -// [YMHUDTool showErrorWithMessage:@"请填写资料"]; +// [MewHUDTool showErrorWithMessage:@"请填写资料"]; self.nextButton.enabled = NO; } } @@ -279,7 +279,7 @@ - (UITextField *)textField { if (!_textField) { _textField = [[UITextField alloc] init]; - _textField.textColor = [ThemeColor mainTextColor]; + _textField.textColor = [MEWThemeColor mewMainTextColor]; _textField.font = [UIFont fontWithName:@"PingFang-SC-Medium" size:15.f]; _textField.textAlignment = NSTextAlignmentLeft; _textField.placeholder = @"请输入昵称"; @@ -325,7 +325,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:@[[ThemeColor colorWithHexString:@"#FF60FD"], [ThemeColor colorWithHexString:@"#8974FF"],[ThemeColor colorWithHexString:@"#69EBFF"]] gradientType:GradientTypeLeftToRight imgSize:CGSizeMake(KScreenWidth - 2*36, 52)]; + UIImage *image = [UIImage gradientColorImageFromColors:@[[MEWThemeColor mewColorWithHexString:@"#FF60FD"], [MEWThemeColor mewColorWithHexString:@"#8974FF"],[MEWThemeColor mewColorWithHexString:@"#69EBFF"]] gradientType:GradientTypeLeftToRight imgSize:CGSizeMake(KScreenWidth - 2*36, 52)]; _nextButton.backgroundColor = [UIColor colorWithPatternImage:image]; [_nextButton addTarget:self action:@selector(nextButtonAction) forControlEvents:UIControlEventTouchUpInside]; } diff --git a/yinmeng-ios/yinmeng-ios/Main/YinMeng/Login/View/LoginVerifBindPhoneViewController.m b/yinmeng-ios/yinmeng-ios/Main/YinMeng/Login/View/LoginVerifBindPhoneViewController.m index 882b508..6e93fbf 100644 --- a/yinmeng-ios/yinmeng-ios/Main/YinMeng/Login/View/LoginVerifBindPhoneViewController.m +++ b/yinmeng-ios/yinmeng-ios/Main/YinMeng/Login/View/LoginVerifBindPhoneViewController.m @@ -10,12 +10,12 @@ #import #import ///Tool -#import "ThemeColor.h" +#import "MEWThemeColor.h" #import "YMConstant.h" #import "YMMacro.h" #import "UIImage+Utils.h" -#import "YMHUDTool.h" -#import "CountDownHelper.h" +#import "MewHUDTool.h" +#import "MEWCountDownHelper.h" ///Model #import "UserInfoModel.h" ///P @@ -25,7 +25,7 @@ #import "LoginBindPhoneViewController.h" //#import "MineSettingViewController.h" -@interface LoginVerifBindPhoneViewController () +@interface LoginVerifBindPhoneViewController () @property (nonatomic, strong) UIView *containerView; @property (nonatomic, strong) UIImageView *bgImageView; @@ -53,7 +53,7 @@ } - (void)dealloc { - [[CountDownHelper shareHelper] stopCountDown]; + [[MEWCountDownHelper shareHelper] mewStopCountDown]; } - (LoginVerifBindPhonePresenter *)createPresenter { @@ -70,12 +70,12 @@ - (void)viewDidDisappear:(BOOL)animated { [super viewDidDisappear:animated]; - [[CountDownHelper shareHelper] stopCountDown]; + [[MEWCountDownHelper shareHelper] mewStopCountDown]; } #pragma mark - Private Method - (void)initSubViews { - [CountDownHelper shareHelper].delegate = self; + [MEWCountDownHelper shareHelper].delegate = self; [self.view addSubview:self.containerView]; [self.containerView addSubview:self.bgImageView]; [self.containerView addSubview:self.backButton]; @@ -268,12 +268,12 @@ - (void)phoneSmsCodeSuccess { self.authCodeBtn.enabled = NO; [self showSuccessToast:@"验证码发送成功"]; - [[CountDownHelper shareHelper] openCountdownWithTime:60]; + [[MEWCountDownHelper shareHelper] mewOpenCountdownWithTime:60]; } - (void)checkMoblieCodeWithMoblieSuccess { [self showSuccessToast:@"验证成功"]; - [[CountDownHelper shareHelper] stopCountDown]; + [[MEWCountDownHelper shareHelper] mewStopCountDown]; // LoginVerifBindPhoneViewController *vc = [[LoginVerifBindPhoneViewController alloc] init]; // vc.bindingPhoneNumType = XPBindingPhoneNumTypeEdit; // vc.userInfo = self.userInfo; @@ -281,13 +281,13 @@ } - (void)bindMoblieCodeWithMoblieSuccess { - [[CountDownHelper shareHelper] stopCountDown]; + [[MEWCountDownHelper shareHelper] mewStopCountDown]; // 修改绑定信息 if (self.bindingPhoneNumType == XPBindingPhoneNumTypeEdit) { } else if (self.bindingPhoneNumType == XPBindingPhoneNumTypeNormal) { // @weakify(self); - [YMHUDTool showSuccessWithMessage:@"绑定成功"]; + [MewHUDTool showSuccessWithMessage:@"绑定成功"]; [self.navigationController popViewControllerAnimated:YES]; } self.confirmBtn.enabled = YES; // 打开交互 @@ -296,11 +296,11 @@ #pragma mark - CountDownHelperDelegate ///倒计时进行中 -- (void)onCountdownOpen:(int)time { +- (void)mewOnCountdownOpen:(int)time { [self.authCodeBtn setTitle:[NSString stringWithFormat:@"%ds后重试", time] forState:UIControlStateDisabled]; } ///倒计时结束 -- (void)onCountdownFinish { +- (void)mewOnCountdownFinish { self.authCodeBtn.enabled= YES; [self.authCodeBtn setTitle:@"重新发送" forState:UIControlStateNormal]; } @@ -309,7 +309,7 @@ - (UIView *)containerView{ if (!_containerView) { _containerView = [[UIView alloc] init]; - _containerView.backgroundColor = [ThemeColor appBackgroundColor]; + _containerView.backgroundColor = [MEWThemeColor mewAppBackgroundColor]; } return _containerView; } @@ -344,7 +344,7 @@ if (!_areaCodeLabel) { _areaCodeLabel = [[UILabel alloc] init]; _areaCodeLabel.text = @"+86"; - _areaCodeLabel.textColor = [ThemeColor secondTextColor]; + _areaCodeLabel.textColor = [MEWThemeColor mewSecondTextColor]; _areaCodeLabel.font = [UIFont systemFontOfSize:14.f]; _areaCodeLabel.adjustsFontSizeToFitWidth = YES; } @@ -360,7 +360,7 @@ _confirmBtn.layer.cornerRadius = 52/2.f; _confirmBtn.layer.masksToBounds = YES; _confirmBtn.enabled = NO; - UIImage *image = [UIImage gradientColorImageFromColors:@[[ThemeColor colorWithHexString:@"#FF60FD"], [ThemeColor colorWithHexString:@"#8974FF"],[ThemeColor colorWithHexString:@"#69EBFF"]] gradientType:GradientTypeLeftToRight imgSize:CGSizeMake(KScreenWidth - 2*36, 52)]; + UIImage *image = [UIImage gradientColorImageFromColors:@[[MEWThemeColor mewColorWithHexString:@"#FF60FD"], [MEWThemeColor mewColorWithHexString:@"#8974FF"],[MEWThemeColor mewColorWithHexString:@"#69EBFF"]] gradientType:GradientTypeLeftToRight imgSize:CGSizeMake(KScreenWidth - 2*36, 52)]; _confirmBtn.backgroundColor = [UIColor colorWithPatternImage:image]; } return _confirmBtn; @@ -370,9 +370,9 @@ if (!_authCodeBtn) { _authCodeBtn = [UIButton buttonWithType:UIButtonTypeCustom]; [_authCodeBtn setTitle:@"获取验证码" forState:UIControlStateNormal]; - [_authCodeBtn setTitleColor:[ThemeColor colorWithHexString:@"#9552FF"] forState:UIControlStateNormal]; -// [_authCodeBtn setTitleColor:[ThemeColor appMainColor] forState:UIControlStateNormal]; - [_authCodeBtn setTitleColor:[ThemeColor secondTextColor] forState:UIControlStateDisabled]; + [_authCodeBtn setTitleColor:[MEWThemeColor mewColorWithHexString:@"#9552FF"] forState:UIControlStateNormal]; +// [_authCodeBtn setTitleColor:[MEWThemeColor appMainColor] forState:UIControlStateNormal]; + [_authCodeBtn setTitleColor:[MEWThemeColor mewSecondTextColor] forState:UIControlStateDisabled]; [_authCodeBtn.titleLabel setFont:[UIFont systemFontOfSize:12.f]]; } return _authCodeBtn; @@ -390,13 +390,13 @@ - (UITextField *)phoneNumTextField { if (!_phoneNumTextField) { _phoneNumTextField = [[UITextField alloc] init]; - _phoneNumTextField.textColor = [ThemeColor mainTextColor]; + _phoneNumTextField.textColor = [MEWThemeColor mewMainTextColor]; _phoneNumTextField.font = [UIFont systemFontOfSize:14.f]; - _phoneNumTextField.attributedPlaceholder = [[NSAttributedString alloc] initWithString:@"输入手机号"attributes:@{NSForegroundColorAttributeName: [ThemeColor secondTextColor]}]; + _phoneNumTextField.attributedPlaceholder = [[NSAttributedString alloc] initWithString:@"输入手机号"attributes:@{NSForegroundColorAttributeName: [MEWThemeColor mewSecondTextColor]}]; _phoneNumTextField.clearButtonMode = UITextFieldViewModeWhileEditing; _phoneNumTextField.borderStyle = UITextBorderStyleNone; _phoneNumTextField.keyboardType = UIKeyboardTypeNumberPad; - _phoneNumTextField.tintColor = [ThemeColor mainTextColor]; + _phoneNumTextField.tintColor = [MEWThemeColor mewMainTextColor]; } return _phoneNumTextField; } @@ -414,13 +414,13 @@ - (UITextField *)authCodeTextField { if (!_authCodeTextField) { _authCodeTextField = [[UITextField alloc] init]; - _authCodeTextField.textColor = [ThemeColor mainTextColor]; + _authCodeTextField.textColor = [MEWThemeColor mewMainTextColor]; _authCodeTextField.font = [UIFont systemFontOfSize:14.f]; - _authCodeTextField.attributedPlaceholder = [[NSAttributedString alloc] initWithString:@"输入验证码"attributes:@{NSForegroundColorAttributeName: [ThemeColor secondTextColor]}]; + _authCodeTextField.attributedPlaceholder = [[NSAttributedString alloc] initWithString:@"输入验证码"attributes:@{NSForegroundColorAttributeName: [MEWThemeColor mewSecondTextColor]}]; _authCodeTextField.clearButtonMode = UITextFieldViewModeWhileEditing; _authCodeTextField.borderStyle = UITextBorderStyleNone; _authCodeTextField.keyboardType = UIKeyboardTypeNumberPad; - _authCodeTextField.tintColor = [ThemeColor mainTextColor]; + _authCodeTextField.tintColor = [MEWThemeColor mewMainTextColor]; } return _authCodeTextField; } diff --git a/yinmeng-ios/yinmeng-ios/Main/YinMeng/Login/View/MineLoginPasswordViewController.m b/yinmeng-ios/yinmeng-ios/Main/YinMeng/Login/View/MineLoginPasswordViewController.m index 23258a3..d6dce9d 100644 --- a/yinmeng-ios/yinmeng-ios/Main/YinMeng/Login/View/MineLoginPasswordViewController.m +++ b/yinmeng-ios/yinmeng-ios/Main/YinMeng/Login/View/MineLoginPasswordViewController.m @@ -12,7 +12,7 @@ #import #import ///Tool -#import "ThemeColor.h" +#import "MEWThemeColor.h" #import "UIButton+EnlargeTouchArea.h" #import "UIImage+Utils.h" #import "YMMacro.h" @@ -60,7 +60,7 @@ - (void)viewDidLoad { [super viewDidLoad]; - self.view.backgroundColor = [ThemeColor colorWithHexString:@"#14171B"]; + self.view.backgroundColor = [MEWThemeColor mewColorWithHexString:@"#14171B"]; [self initSubViews]; [self initSubViewConstraints]; } @@ -251,7 +251,7 @@ _submitButton.layer.masksToBounds = YES; _submitButton.layer.cornerRadius = 52/2; _submitButton.enabled = YES; - UIImage *image = [UIImage gradientColorImageFromColors:@[[ThemeColor colorWithHexString:@"#FF60FD"], [ThemeColor colorWithHexString:@"#8974FF"],[ThemeColor colorWithHexString:@"#69EBFF"]] gradientType:GradientTypeLeftToRight imgSize:CGSizeMake(KScreenWidth - 2*36, 52)]; + UIImage *image = [UIImage gradientColorImageFromColors:@[[MEWThemeColor mewColorWithHexString:@"#FF60FD"], [MEWThemeColor mewColorWithHexString:@"#8974FF"],[MEWThemeColor mewColorWithHexString:@"#69EBFF"]] gradientType:GradientTypeLeftToRight imgSize:CGSizeMake(KScreenWidth - 2*36, 52)]; _submitButton.backgroundColor = [UIColor colorWithPatternImage:image]; [_submitButton addTarget:self action:@selector(submitButtonAction:) forControlEvents:UIControlEventTouchUpInside]; } diff --git a/yinmeng-ios/yinmeng-ios/Main/YinMeng/Message/Model/ChatLimitModel.h b/yinmeng-ios/yinmeng-ios/Main/YinMeng/Message/Model/ChatLimitModel.h index 9b26cb7..c592076 100644 --- a/yinmeng-ios/yinmeng-ios/Main/YinMeng/Message/Model/ChatLimitModel.h +++ b/yinmeng-ios/yinmeng-ios/Main/YinMeng/Message/Model/ChatLimitModel.h @@ -5,7 +5,7 @@ // Created by 触海 on 2023/11/16. // -#import "NSObject+MJExtension.h" +#import "NSObject+MEWExtension.h" NS_ASSUME_NONNULL_BEGIN diff --git a/yinmeng-ios/yinmeng-ios/Main/YinMeng/Message/Presenter/CHMessagePresenter.m b/yinmeng-ios/yinmeng-ios/Main/YinMeng/Message/Presenter/CHMessagePresenter.m index ff582af..596283a 100644 --- a/yinmeng-ios/yinmeng-ios/Main/YinMeng/Message/Presenter/CHMessagePresenter.m +++ b/yinmeng-ios/yinmeng-ios/Main/YinMeng/Message/Presenter/CHMessagePresenter.m @@ -18,7 +18,7 @@ @implementation CHMessagePresenter - (void)getChatLimitReceiverUid:(NSString *)receiverUid { [Api getChatLimit:[self createHttpCompletion:^(BaseModel * _Nonnull data) { - ChatLimitModel *chatLimit = [ChatLimitModel modelWithJSON:data.data]; + ChatLimitModel *chatLimit = [ChatLimitModel mewModelWithJSON:data.data]; [[self getView] onGetLimitChat:chatLimit]; } showLoading:NO errorToast:NO] receiverUid:receiverUid]; } @@ -27,7 +27,7 @@ /// @param uid 用户uid - (void)getUserInfo:(NSString *)uid { [Api userDetailInfoCompletion:[self createHttpCompletion:^(BaseModel * _Nonnull data) { - UserInfoModel * infoModel = [UserInfoModel modelWithDictionary:data.data]; + UserInfoModel * infoModel = [UserInfoModel mewModelWithDictionary:data.data]; [[self getView] onGetSessionUserInfoSuccess:infoModel]; }fail:^(NSInteger code, NSString * _Nullable msg) { [[self getView]onGetSessionUserInfoFail]; diff --git a/yinmeng-ios/yinmeng-ios/Main/YinMeng/Message/View/Session/CHMessageConentAudioView.m b/yinmeng-ios/yinmeng-ios/Main/YinMeng/Message/View/Session/CHMessageConentAudioView.m index 02629cc..6c3840e 100644 --- a/yinmeng-ios/yinmeng-ios/Main/YinMeng/Message/View/Session/CHMessageConentAudioView.m +++ b/yinmeng-ios/yinmeng-ios/Main/YinMeng/Message/View/Session/CHMessageConentAudioView.m @@ -10,9 +10,10 @@ #import #import ///Tool -#import "ThemeColor.h" -#import "CHMessageAudioCenter.h" -@interface CHMessageConentAudioView () + +#import "MEWThemeColor.h" +#import "MessageAudioCenter.h" +@interface MessageConentAudioView () ///背景 @property (nonatomic,strong) UIView * backView; ///显示语音的时长 @@ -114,7 +115,7 @@ if (!_timeLabel) { _timeLabel = [[UILabel alloc] init]; _timeLabel.font = [UIFont systemFontOfSize:14 weight:UIFontWeightMedium]; - _timeLabel.textColor = [ThemeColor mainTextColor]; + _timeLabel.textColor = [MEWThemeColor mewMainTextColor]; } return _timeLabel; } diff --git a/yinmeng-ios/yinmeng-ios/Main/YinMeng/Message/View/Session/CHSessionInfoViewController.m b/yinmeng-ios/yinmeng-ios/Main/YinMeng/Message/View/Session/CHSessionInfoViewController.m index c1a442a..0ab72fe 100644 --- a/yinmeng-ios/yinmeng-ios/Main/YinMeng/Message/View/Session/CHSessionInfoViewController.m +++ b/yinmeng-ios/yinmeng-ios/Main/YinMeng/Message/View/Session/CHSessionInfoViewController.m @@ -10,7 +10,7 @@ #import #import ///Tool -#import "ThemeColor.h" +#import "MEWThemeColor.h" #import "NetImageView.h" #import "TTPopup.h" @@ -233,7 +233,7 @@ - (UIView *)infoView { if (!_infoView) { _infoView = [[UIView alloc] init]; - _infoView.backgroundColor = [ThemeColor appCellBackgroundColor]; + _infoView.backgroundColor = [MEWThemeColor mewAppCellBackgroundColor]; UITapGestureRecognizer * tap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(didTapUserRecognizer)]; [_infoView addGestureRecognizer:tap]; _infoView.hidden = YES; @@ -257,7 +257,7 @@ if (!_nickLabel) { _nickLabel = [[UILabel alloc] init]; _nickLabel.font = [UIFont systemFontOfSize:15]; - _nickLabel.textColor = [ThemeColor mainTextColor]; + _nickLabel.textColor = [MEWThemeColor mewMainTextColor]; } return _nickLabel; } @@ -267,7 +267,7 @@ _titleLabel = [[UILabel alloc] init]; _titleLabel.font = [UIFont systemFontOfSize:14]; _titleLabel.text = @"个人主页"; - _titleLabel.textColor = [ThemeColor secondTextColor]; + _titleLabel.textColor = [MEWThemeColor mewSecondTextColor]; } return _titleLabel; } @@ -297,9 +297,9 @@ if (!_reportButton) { _reportButton = [UIButton buttonWithType:UIButtonTypeCustom]; [_reportButton setTitle:@"举报" forState:UIControlStateNormal]; - [_reportButton setTitleColor:[ThemeColor mainTextColor] forState:UIControlStateNormal]; + [_reportButton setTitleColor:[MEWThemeColor mewMainTextColor] forState:UIControlStateNormal]; _reportButton.titleLabel.font = [UIFont systemFontOfSize:16 weight:UIFontWeightMedium]; - [_reportButton setBackgroundColor:[ThemeColor appCellBackgroundColor]]; + [_reportButton setBackgroundColor:[MEWThemeColor mewAppCellBackgroundColor]]; [_reportButton addTarget:self action:@selector(reportButtonAction:) forControlEvents:UIControlEventTouchUpInside]; } return _reportButton; @@ -308,7 +308,7 @@ - (UIView *)lineView { if (!_lineView) { _lineView = [[UIView alloc] init]; - _lineView.backgroundColor = [ThemeColor dividerColor]; + _lineView.backgroundColor = [MEWThemeColor mewDividerColor]; } return _lineView; } @@ -318,10 +318,10 @@ _blackButton = [UIButton buttonWithType:UIButtonTypeCustom]; [_blackButton setTitle:@"加入黑名单" forState:UIControlStateNormal]; [_blackButton setTitle:@"移除黑名单" forState:UIControlStateSelected]; - [_blackButton setTitleColor:[ThemeColor mainTextColor] forState:UIControlStateNormal]; - [_blackButton setTitleColor:[ThemeColor mainTextColor] forState:UIControlStateSelected]; + [_blackButton setTitleColor:[MEWThemeColor mewMainTextColor] forState:UIControlStateNormal]; + [_blackButton setTitleColor:[MEWThemeColor mewMainTextColor] forState:UIControlStateSelected]; _blackButton.titleLabel.font = [UIFont systemFontOfSize:16 weight:UIFontWeightMedium]; - [_blackButton setBackgroundColor:[ThemeColor appCellBackgroundColor]]; + [_blackButton setBackgroundColor:[MEWThemeColor mewAppCellBackgroundColor]]; [_blackButton addTarget:self action:@selector(blackButtonAction:) forControlEvents:UIControlEventTouchUpInside]; _blackButton.hidden = YES; } diff --git a/yinmeng-ios/yinmeng-ios/Main/YinMeng/Message/View/Session/CHSessionMessageCell.m b/yinmeng-ios/yinmeng-ios/Main/YinMeng/Message/View/Session/CHSessionMessageCell.m index 421c253..a16cb0f 100644 --- a/yinmeng-ios/yinmeng-ios/Main/YinMeng/Message/View/Session/CHSessionMessageCell.m +++ b/yinmeng-ios/yinmeng-ios/Main/YinMeng/Message/View/Session/CHSessionMessageCell.m @@ -13,7 +13,7 @@ #import "CHMessageContentImage.h" #import "CHMessageConentAudioView.h" ///Tool -#import "ThemeColor.h" +#import "MEWThemeColor.h" #import "YMMacro.h" #import "NewEncryptTool.h" /// Third @@ -312,7 +312,7 @@ - (UIView *)messageBackground { if (!_messageBackground) { _messageBackground = [[UIView alloc]init]; - _messageBackground.backgroundColor = [ThemeColor appCellBackgroundColor]; + _messageBackground.backgroundColor = [MEWThemeColor mewAppCellBackgroundColor]; _messageBackground.layer.masksToBounds = YES; _messageBackground.layer.cornerRadius = 8.f; } diff --git a/yinmeng-ios/yinmeng-ios/Main/YinMeng/Message/View/Session/CHSessionNavView.m b/yinmeng-ios/yinmeng-ios/Main/YinMeng/Message/View/Session/CHSessionNavView.m index daddc30..f94908a 100644 --- a/yinmeng-ios/yinmeng-ios/Main/YinMeng/Message/View/Session/CHSessionNavView.m +++ b/yinmeng-ios/yinmeng-ios/Main/YinMeng/Message/View/Session/CHSessionNavView.m @@ -7,7 +7,7 @@ #import "CHSessionNavView.h" /// Tool -#import "ThemeColor.h" +#import "MEWThemeColor.h" #import #import "YMMacro.h" /// Third @@ -134,7 +134,7 @@ if (!_nickLabel) { _nickLabel = [[UILabel alloc] init]; _nickLabel.font = [UIFont systemFontOfSize:16 weight:UIFontWeightMedium]; - _nickLabel.textColor = [ThemeColor mainTextColor]; + _nickLabel.textColor = [MEWThemeColor mewMainTextColor]; _nickLabel.textAlignment = NSTextAlignmentCenter; } return _nickLabel; @@ -147,9 +147,9 @@ _likeButton.titleLabel.font = [UIFont systemFontOfSize:12 weight:UIFontWeightMedium]; _likeButton.layer.cornerRadius = 21/2; _likeButton.layer.masksToBounds = YES; - [_likeButton setTitleColor:UIColorFromRGB(0x9552FF) forState:UIControlStateNormal]; + [_likeButton setTitleColor:UIColorMewFromRGB(0xFFDA24) forState:UIControlStateNormal]; _likeButton.layer.borderWidth = 0.5; - _likeButton.layer.borderColor = UIColorFromRGB(0x9552FF).CGColor; + _likeButton.layer.borderColor = UIColorMewFromRGB(0xFFDA24).CGColor; [_likeButton addTarget:self action:@selector(likeButtonAction:) forControlEvents:UIControlEventTouchUpInside]; _likeButton.hidden = NO; } diff --git a/yinmeng-ios/yinmeng-ios/Main/YinMeng/Message/View/Session/CHSessionToolbarView.m b/yinmeng-ios/yinmeng-ios/Main/YinMeng/Message/View/Session/CHSessionToolbarView.m index c8e3cef..a8f74e2 100644 --- a/yinmeng-ios/yinmeng-ios/Main/YinMeng/Message/View/Session/CHSessionToolbarView.m +++ b/yinmeng-ios/yinmeng-ios/Main/YinMeng/Message/View/Session/CHSessionToolbarView.m @@ -10,9 +10,9 @@ #import #import ///Tool -#import "ThemeColor.h" +#import "MEWThemeColor.h" #import "YMMacro.h" -#import "NSArray+Safe.h" +#import "NSArray+MewSafe.h" ///Model #import "MessageMenuModel.h" ///View @@ -90,7 +90,7 @@ } - (void)initSubViews { - self.backgroundColor = [ThemeColor appCellBackgroundColor]; + self.backgroundColor = [MEWThemeColor mewAppCellBackgroundColor]; [self addSubview:self.stackView]; [self.stackView addArrangedSubview:self.toolStackView]; @@ -154,8 +154,8 @@ } - (__kindof UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath { - CHMessageToolMenuCollectionViewCell * cell = [collectionView dequeueReusableCellWithReuseIdentifier:NSStringFromClass([CHMessageToolMenuCollectionViewCell class]) forIndexPath:indexPath]; - MessageMenuModel * model = [self.menuList safeObjectAtIndex1:indexPath.row]; + MessageToolMenuCollectionViewCell * cell = [collectionView dequeueReusableCellWithReuseIdentifier:NSStringFromClass([MessageToolMenuCollectionViewCell class]) forIndexPath:indexPath]; + MessageMenuModel * model = [self.menuList mewSafeObjectAtIndex:indexPath.row]; cell.imageName = model.imageName; return cell; } @@ -163,7 +163,7 @@ - (void)collectionView:(UICollectionView *)collectionView didSelectItemAtIndexPath:(NSIndexPath *)indexPath { [collectionView deselectItemAtIndexPath:indexPath animated:YES]; if (self.menuList.count > 0) { - MessageMenuModel * model = [self.menuList safeObjectAtIndex1:indexPath.row]; + MessageMenuModel * model = [self.menuList mewSafeObjectAtIndex:indexPath.row]; if (self.delegate && [self.delegate respondsToSelector:@selector(didSelectMenuItem:)]) { [self.delegate didSelectMenuItem:model]; } @@ -331,10 +331,10 @@ self.userInteractionEnabled = !sendDisabled; if (sendDisabled) { self.inputView.text = @""; - NSAttributedString * attribute = [[NSAttributedString alloc] initWithString:_model == 2 ? @"互相关注成为好友可发起聊天" : @"暂时无法私聊" attributes:@{NSFontAttributeName : [UIFont systemFontOfSize:15], NSForegroundColorAttributeName : [ThemeColor secondTextColor]}]; + NSAttributedString * attribute = [[NSAttributedString alloc] initWithString:_model == 2 ? @"互相关注成为好友可发起聊天" : @"暂时无法私聊" attributes:@{NSFontAttributeName : [UIFont systemFontOfSize:15], NSForegroundColorAttributeName : [MEWThemeColor mewSecondTextColor]}]; self.inputView.attributedPlaceholder = attribute; } else { - NSAttributedString * attribute = [[NSAttributedString alloc] initWithString:@"请输入消息" attributes:@{NSFontAttributeName : [UIFont systemFontOfSize:15], NSForegroundColorAttributeName : [ThemeColor secondTextColor]}]; + NSAttributedString * attribute = [[NSAttributedString alloc] initWithString:@"请输入消息" attributes:@{NSFontAttributeName : [UIFont systemFontOfSize:15], NSForegroundColorAttributeName : [MEWThemeColor mewSecondTextColor]}]; self.inputView.attributedPlaceholder = attribute; } } @@ -385,7 +385,7 @@ - (UIView *)inputBackView { if (!_inputBackView) { _inputBackView = [[UIView alloc] init]; - _inputBackView.backgroundColor = UIColorFromRGB(0xF1F1FA); + _inputBackView.backgroundColor = UIColorMewFromRGB(0xF1F1FA); _inputBackView.layer.masksToBounds = YES; _inputBackView.layer.cornerRadius = 4; } @@ -395,11 +395,11 @@ - (UITextField *)inputView{ if (!_inputView) { _inputView = [[UITextField alloc] init]; - NSAttributedString * attribute = [[NSAttributedString alloc] initWithString:@"请输入消息" attributes:@{NSFontAttributeName : [UIFont systemFontOfSize:15], NSForegroundColorAttributeName : [ThemeColor secondTextColor]}]; + NSAttributedString * attribute = [[NSAttributedString alloc] initWithString:@"请输入消息" attributes:@{NSFontAttributeName : [UIFont systemFontOfSize:15], NSForegroundColorAttributeName : [MEWThemeColor mewSecondTextColor]}]; _inputView.attributedPlaceholder = attribute; _inputView.borderStyle = UITextBorderStyleNone; - _inputView.tintColor = UIColorFromRGB(0xFFE710); - _inputView.textColor = [ThemeColor mainTextColor]; + _inputView.tintColor = UIColorMewFromRGB(0xFFE710); + _inputView.textColor = [MEWThemeColor mewMainTextColor]; _inputView.font = [UIFont systemFontOfSize:12.f]; _inputView.delegate = self; _inputView.autocorrectionType = UITextAutocorrectionTypeNo; @@ -413,11 +413,11 @@ _audioButton = [UIButton buttonWithType:UIButtonTypeCustom]; [_audioButton setTitle:@"按住说话" forState:UIControlStateNormal]; [_audioButton setTitle:@"松开结束" forState:UIControlStateSelected]; - [_audioButton setTitleColor:[ThemeColor mainTextColor] forState:UIControlStateNormal]; + [_audioButton setTitleColor:[MEWThemeColor mewMainTextColor] forState:UIControlStateNormal]; _audioButton.titleLabel.font = [UIFont systemFontOfSize:14 weight:UIFontWeightMedium]; _audioButton.layer.masksToBounds = YES; _audioButton.layer.cornerRadius = 4; - _audioButton.backgroundColor = UIColorFromRGB(0xF1F1FA); + _audioButton.backgroundColor = UIColorMewFromRGB(0xF1F1FA); _audioButton.hidden = YES; } return _audioButton; diff --git a/yinmeng-ios/yinmeng-ios/Main/YinMeng/Message/View/Session/Content/CHMessageContentText.m b/yinmeng-ios/yinmeng-ios/Main/YinMeng/Message/View/Session/Content/CHMessageContentText.m index f8c83ea..5ad7ee6 100644 --- a/yinmeng-ios/yinmeng-ios/Main/YinMeng/Message/View/Session/Content/CHMessageContentText.m +++ b/yinmeng-ios/yinmeng-ios/Main/YinMeng/Message/View/Session/Content/CHMessageContentText.m @@ -6,8 +6,11 @@ // #import "CHMessageContentText.h" -#import "ThemeColor.h" -#import "NSObject+MJExtension.h" + +#import "MessageContentText.h" +#import "MEWThemeColor.h" +#import "NSObject+MEWExtension.h" + #import #import @@ -71,7 +74,7 @@ if (!_messageText) { _messageText = [[UILabel alloc]initWithFrame:CGRectZero]; _messageText.preferredMaxLayoutWidth = CONTENT_WIDTH_MAX - MESSAGE_TEXT_PADDING * 2; - _messageText.textColor = ThemeColor.mainTextColor; + _messageText.textColor = MEWThemeColor.mewMainTextColor; _messageText.numberOfLines = 0; } return _messageText; diff --git a/yinmeng-ios/yinmeng-ios/Main/YinMeng/Message/View/Session/Content/CHMessageContentUnSupportView.m b/yinmeng-ios/yinmeng-ios/Main/YinMeng/Message/View/Session/Content/CHMessageContentUnSupportView.m index 559f509..d148ddd 100644 --- a/yinmeng-ios/yinmeng-ios/Main/YinMeng/Message/View/Session/Content/CHMessageContentUnSupportView.m +++ b/yinmeng-ios/yinmeng-ios/Main/YinMeng/Message/View/Session/Content/CHMessageContentUnSupportView.m @@ -11,7 +11,7 @@ #import #import ///Tool -#import "ThemeColor.h" +#import "MEWThemeColor.h" #define MESSAGE_TEXT_PADDING 10 @@ -59,7 +59,7 @@ if (!_unSupportLabel) { _unSupportLabel = [[UILabel alloc]initWithFrame:CGRectZero]; _unSupportLabel.preferredMaxLayoutWidth = CONTENT_WIDTH_MAX - MESSAGE_TEXT_PADDING * 2; - _unSupportLabel.textColor = ThemeColor.mainTextColor; + _unSupportLabel.textColor = MEWThemeColor.mewMainTextColor; _unSupportLabel.text = @"暂不支持此种类型消息"; _unSupportLabel.textAlignment = NSTextAlignmentCenter; _unSupportLabel.font = [UIFont systemFontOfSize:13]; diff --git a/yinmeng-ios/yinmeng-ios/Main/YinMeng/Message/View/Session/SessionViewController.m b/yinmeng-ios/yinmeng-ios/Main/YinMeng/Message/View/Session/SessionViewController.m index 6c611d5..b986ea8 100644 --- a/yinmeng-ios/yinmeng-ios/Main/YinMeng/Message/View/Session/SessionViewController.m +++ b/yinmeng-ios/yinmeng-ios/Main/YinMeng/Message/View/Session/SessionViewController.m @@ -11,11 +11,11 @@ #import "CHSessionMessageCell.h" /// Tool #import "YMMacro.h" -#import "ThemeColor.h" -#import "NSArray+Safe.h" +#import "MEWThemeColor.h" +#import "NSArray+MewSafe.h" #import "UITableView+NIMScrollToBottom.h" #import "ClientConfig.h" -#import "NSObject+MJExtension.h" +#import "NSObject+MEWExtension.h" /// Third #import #import @@ -218,8 +218,8 @@ } if (message.yidunAntiSpamRes) { - NSDictionary *spamRes = message.yidunAntiSpamRes.toJSONObject; - NSDictionary *spamResExt = ((NSString *)spamRes[@"ext"]).toJSONObject; + NSDictionary *spamRes = message.yidunAntiSpamRes.mewToJSONObject; + NSDictionary *spamResExt = ((NSString *)spamRes[@"ext"]).mewToJSONObject; if ([spamResExt[@"antispam"][@"suggestion"] intValue] == 2) { NSDictionary *dic = @{@"suggestion":@"2"}; message.localExt = dic; @@ -262,7 +262,7 @@ } - (nonnull UITableViewCell *)tableView:(nonnull UITableView *)tableView cellForRowAtIndexPath:(nonnull NSIndexPath *)indexPath { - NIMMessage * message = [self.messages safeObjectAtIndex1:indexPath.row]; + NIMMessage * message = [self.messages mewSafeObjectAtIndex:indexPath.row]; NSString * identifier = [CHSessionMessageCell cellContent:message]; ///从复用池中获取所需要的cell CHSessionMessageCell * cell = [tableView dequeueReusableCellWithIdentifier:identifier]; @@ -274,13 +274,15 @@ } cell.delegate = self; cell.selectionStyle = 0; - [cell renderWithMessage:[self.messages safeObjectAtIndex1:indexPath.row]]; + [cell renderWithMessage:[self.messages mewSafeObjectAtIndex:indexPath.row]]; return cell; } - (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath { - NIMMessage *msg = [self.messages safeObjectAtIndex1:indexPath.row]; + + NIMMessage *msg = [self.messages mewSafeObjectAtIndex:indexPath.row]; return [CHSessionMessageCell measureHeight:msg]; + } @@ -290,8 +292,8 @@ MJRefreshNormalHeader *header = [MJRefreshNormalHeader headerWithRefreshingTarget:self refreshingAction:@selector(headerRefresh)]; header.stateLabel.font = [UIFont systemFontOfSize:10.0]; header.lastUpdatedTimeLabel.font = [UIFont systemFontOfSize:10.0]; - header.stateLabel.textColor = [ThemeColor secondTextColor]; - header.lastUpdatedTimeLabel.textColor = [ThemeColor secondTextColor]; + header.stateLabel.textColor = [MEWThemeColor mewSecondTextColor]; + header.lastUpdatedTimeLabel.textColor = [MEWThemeColor mewSecondTextColor]; self.sessionTableView.mj_header = header; [self headerRefresh]; [self initData]; @@ -304,7 +306,7 @@ [self.sessionTableView.mj_header endRefreshing]; if (error == nil && messages.count > 0) { for (int i = ((int)messages.count - 1); i > 0; i--) { - NIMMessage *message = [messages safeObjectAtIndex1:i]; + NIMMessage *message = [messages mewSafeObjectAtIndex:i]; [self.messages insertObject:message atIndex:0]; } } @@ -402,7 +404,7 @@ UIWindow * currentWindow; for (int i = 0; i < [UIApplication sharedApplication].windows.count; i++) { - UIWindow * window = [[UIApplication sharedApplication].windows safeObjectAtIndex1:i]; + UIWindow * window = [[UIApplication sharedApplication].windows mewSafeObjectAtIndex:i]; if(window.tag == 1000) { currentWindow = window; break; @@ -419,9 +421,9 @@ imagePickerVc.modalPresentationStyle = UIModalPresentationOverFullScreen; imagePickerVc.allowPickingVideo = NO; imagePickerVc.allowTakeVideo = NO; - imagePickerVc.naviBgColor = [ThemeColor appCellBackgroundColor]; - imagePickerVc.naviTitleColor = [ThemeColor mainTextColor]; - imagePickerVc.barItemTextColor = [ThemeColor mainTextColor]; + imagePickerVc.naviBgColor = [MEWThemeColor mewAppCellBackgroundColor]; + imagePickerVc.naviTitleColor = [MEWThemeColor mewMainTextColor]; + imagePickerVc.barItemTextColor = [MEWThemeColor mewMainTextColor]; [self presentViewController:imagePickerVc animated:YES completion:nil]; } break; @@ -461,7 +463,7 @@ _sessionTableView = [[UITableView alloc] init]; _sessionTableView.delegate = self; _sessionTableView.dataSource = self; - _sessionTableView.backgroundColor = UIColorFromRGB(0xF8F8FB); + _sessionTableView.backgroundColor = UIColorMewFromRGB(0xF8F8FB); _sessionTableView.separatorStyle = UITableViewCellSeparatorStyleNone; _sessionTableView.showsVerticalScrollIndicator = NO; [_sessionTableView registerClass:[CHSessionMessageCell class] forCellReuseIdentifier:NSStringFromClass([CHSessionMessageCell class])]; diff --git a/yinmeng-ios/yinmeng-ios/Main/YinMeng/Mine/Model/Recharge/RechargeListModel.h b/yinmeng-ios/yinmeng-ios/Main/YinMeng/Mine/Model/Recharge/RechargeListModel.h index 98a94dd..67e7688 100644 --- a/yinmeng-ios/yinmeng-ios/Main/YinMeng/Mine/Model/Recharge/RechargeListModel.h +++ b/yinmeng-ios/yinmeng-ios/Main/YinMeng/Mine/Model/Recharge/RechargeListModel.h @@ -5,7 +5,7 @@ // Created by 触海 on 2023/11/17. // -#import "NSObject+MJExtension.h" +#import "NSObject+MEWExtension.h" NS_ASSUME_NONNULL_BEGIN diff --git a/yinmeng-ios/yinmeng-ios/Main/YinMeng/Mine/Model/Recharge/WalletInfoModel.h b/yinmeng-ios/yinmeng-ios/Main/YinMeng/Mine/Model/Recharge/WalletInfoModel.h index 098c9ec..ad8ec5f 100644 --- a/yinmeng-ios/yinmeng-ios/Main/YinMeng/Mine/Model/Recharge/WalletInfoModel.h +++ b/yinmeng-ios/yinmeng-ios/Main/YinMeng/Mine/Model/Recharge/WalletInfoModel.h @@ -5,7 +5,7 @@ // Created by 触海 on 2023/11/17. // -#import "NSObject+MJExtension.h" +#import "NSObject+MEWExtension.h" NS_ASSUME_NONNULL_BEGIN diff --git a/yinmeng-ios/yinmeng-ios/Main/YinMeng/Mine/Presenter/MineRechargePresenter.m b/yinmeng-ios/yinmeng-ios/Main/YinMeng/Mine/Presenter/MineRechargePresenter.m index e49ba34..7cb132a 100644 --- a/yinmeng-ios/yinmeng-ios/Main/YinMeng/Mine/Presenter/MineRechargePresenter.m +++ b/yinmeng-ios/yinmeng-ios/Main/YinMeng/Mine/Presenter/MineRechargePresenter.m @@ -9,7 +9,7 @@ /// Tool #import "AccountInfoStorage.h" #import "YYUtility.h" -#import "NSObject+MJExtension.h" +#import "NSObject+MEWExtension.h" ///Api #import "Api+Mine.h" #import "RechargeListModel.h" @@ -24,7 +24,7 @@ NSString * uid = [AccountInfoStorage instance].getUid; NSString * ticket = [AccountInfoStorage instance].getTicket; [Api getUserWalletInfo:[self createHttpCompletion:^(BaseModel * _Nonnull data) { - WalletInfoModel * model = [WalletInfoModel modelWithDictionary:data.data]; + WalletInfoModel * model = [WalletInfoModel mewModelWithDictionary:data.data]; [[self getView] getUserWalletInfo:model]; }] uid:uid ticket:ticket]; } @@ -34,7 +34,7 @@ /// @param channel 目前是8 - (void)requestRechargeListWithChannel:(NSString *)channel { [Api getRechargeList:[self createHttpCompletion:^(BaseModel * _Nonnull data) { - NSArray * array = [RechargeListModel modelsWithArray:data.data]; + NSArray * array = [RechargeListModel mewModelsWithArray:data.data]; [[self getView] requestRechargeListSucccess:array]; }] channelType:channel]; } @@ -87,7 +87,7 @@ /// 批量验证内购掉单 /// @param transcations 凭据的数组 - (void)checkTranscationIds:(NSArray *)transcations { - NSString * transcationIdStr = [transcations toJSONString]; + NSString * transcationIdStr = [transcations mewToJSONString]; [Api requestCheckTranscationIds:[self createHttpCompletion:^(BaseModel * _Nonnull data) { [[self getView] checkTranscationIdsSuccess]; }] transcationIdStr:transcationIdStr]; diff --git a/yinmeng-ios/yinmeng-ios/Main/YinMeng/Mine/Presenter/YMMineCollectRoomPresenter.m b/yinmeng-ios/yinmeng-ios/Main/YinMeng/Mine/Presenter/YMMineCollectRoomPresenter.m index de24843..3420274 100644 --- a/yinmeng-ios/yinmeng-ios/Main/YinMeng/Mine/Presenter/YMMineCollectRoomPresenter.m +++ b/yinmeng-ios/yinmeng-ios/Main/YinMeng/Mine/Presenter/YMMineCollectRoomPresenter.m @@ -20,7 +20,7 @@ - (void)getCollectRoomList:(int)page pageSize:(int)pageSize state:(int)state type:(NSString *)type { NSString * uid = [AccountInfoStorage instance].getUid; [Api requestMineCollectRoomList:[self createHttpCompletion:^(BaseModel * _Nonnull data) { - NSArray *array = [MineCollectRoomModel modelsWithArray:data.data[@"fansRoomList"]]; + NSArray * array = [MineCollectRoomModel mewModelsWithArray:data.data[@"fansRoomList"]]; [[self getView] onGetCollectRoomListSuccess:array state:state]; } fail:^(NSInteger code, NSString * _Nullable msg) { [[self getView] getCollectRoomListFail:state]; diff --git a/yinmeng-ios/yinmeng-ios/Main/YinMeng/Mine/Presenter/YMMineSettingPresenter.m b/yinmeng-ios/yinmeng-ios/Main/YinMeng/Mine/Presenter/YMMineSettingPresenter.m index 1028b93..37cebad 100644 --- a/yinmeng-ios/yinmeng-ios/Main/YinMeng/Mine/Presenter/YMMineSettingPresenter.m +++ b/yinmeng-ios/yinmeng-ios/Main/YinMeng/Mine/Presenter/YMMineSettingPresenter.m @@ -52,7 +52,7 @@ - (void)getUserInfo { NSString *uid = [[AccountInfoStorage instance] getUid]; [Api getUserInfo:[self createHttpCompletion:^(BaseModel * _Nonnull data) { - UserInfoModel *userInfo = [UserInfoModel modelWithDictionary:data.data]; + UserInfoModel *userInfo = [UserInfoModel mewModelWithDictionary:data.data]; [[self getView] onGetUserInfoSuccess:userInfo]; }] uid:uid]; } diff --git a/yinmeng-ios/yinmeng-ios/Main/YinMeng/Mine/View/CollectRoom/Cell/YMMineCollectRoomCell.m b/yinmeng-ios/yinmeng-ios/Main/YinMeng/Mine/View/CollectRoom/Cell/YMMineCollectRoomCell.m index 6ca6534..c33d328 100644 --- a/yinmeng-ios/yinmeng-ios/Main/YinMeng/Mine/View/CollectRoom/Cell/YMMineCollectRoomCell.m +++ b/yinmeng-ios/yinmeng-ios/Main/YinMeng/Mine/View/CollectRoom/Cell/YMMineCollectRoomCell.m @@ -12,7 +12,7 @@ #import "MineCollectRoomModel.h" /// Tool #import "NetImageView.h" -#import "ThemeColor.h" +#import "MEWThemeColor.h" @interface YMMineCollectRoomCell() ///显示头像 @@ -91,7 +91,7 @@ if (!_nickLabel) { _nickLabel = [[UILabel alloc] init]; _nickLabel.font = [UIFont systemFontOfSize:14]; - _nickLabel.textColor = [ThemeColor mainTextColor]; + _nickLabel.textColor = [MEWThemeColor mewMainTextColor]; } return _nickLabel; } @@ -99,7 +99,7 @@ - (UIView *)devideView { if (!_devideView) { _devideView = [[UIView alloc] init]; - _devideView.backgroundColor = UIColorFromRGB(0xEAEAF1); + _devideView.backgroundColor = UIColorMewFromRGB(0xEAEAF1); } return _devideView; } diff --git a/yinmeng-ios/yinmeng-ios/Main/YinMeng/Mine/View/CollectRoom/YMMineCollectRoomViewController.m b/yinmeng-ios/yinmeng-ios/Main/YinMeng/Mine/View/CollectRoom/YMMineCollectRoomViewController.m index 2a4c0af..02683a5 100644 --- a/yinmeng-ios/yinmeng-ios/Main/YinMeng/Mine/View/CollectRoom/YMMineCollectRoomViewController.m +++ b/yinmeng-ios/yinmeng-ios/Main/YinMeng/Mine/View/CollectRoom/YMMineCollectRoomViewController.m @@ -10,8 +10,8 @@ #import #import ///Tool -#import "ThemeColor.h" -#import "NSArray+Safe.h" +#import "MEWThemeColor.h" +#import "NSArray+MewSafe.h" ///P #import "YMMineCollectRoomPresenter.h" #import "YMMineCollectRoomProtocol.h" @@ -80,7 +80,7 @@ - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { if (self.datasource.count > 0) { YMMineCollectRoomCell *cell = [tableView dequeueReusableCellWithIdentifier:NSStringFromClass([YMMineCollectRoomCell class])]; - cell.roomInfo = [self.datasource safeObjectAtIndex1:indexPath.row]; + cell.roomInfo = [self.datasource mewSafeObjectAtIndex:indexPath.row]; return cell; } @@ -110,12 +110,12 @@ MJRefreshNormalHeader *header = [MJRefreshNormalHeader headerWithRefreshingTarget:self refreshingAction:@selector(headerRefresh)]; header.stateLabel.font = [UIFont systemFontOfSize:10.0]; header.lastUpdatedTimeLabel.font = [UIFont systemFontOfSize:10.0]; - header.stateLabel.textColor = [ThemeColor secondTextColor]; - header.lastUpdatedTimeLabel.textColor = [ThemeColor secondTextColor]; + header.stateLabel.textColor = [MEWThemeColor mewSecondTextColor]; + header.lastUpdatedTimeLabel.textColor = [MEWThemeColor mewSecondTextColor]; self.tableView.mj_header = header; MJRefreshBackNormalFooter *footer = [MJRefreshBackNormalFooter footerWithRefreshingTarget:self refreshingAction:@selector(footerRefresh)]; - footer.stateLabel.textColor = [ThemeColor secondTextColor]; + footer.stateLabel.textColor = [MEWThemeColor mewSecondTextColor]; footer.stateLabel.font = [UIFont systemFontOfSize:10.0]; self.tableView.mj_footer = footer; diff --git a/yinmeng-ios/yinmeng-ios/Main/YinMeng/Mine/View/Setting/Cell/YMMineSettingTableViewCell.m b/yinmeng-ios/yinmeng-ios/Main/YinMeng/Mine/View/Setting/Cell/YMMineSettingTableViewCell.m index f5b3f8a..ce29530 100644 --- a/yinmeng-ios/yinmeng-ios/Main/YinMeng/Mine/View/Setting/Cell/YMMineSettingTableViewCell.m +++ b/yinmeng-ios/yinmeng-ios/Main/YinMeng/Mine/View/Setting/Cell/YMMineSettingTableViewCell.m @@ -11,7 +11,7 @@ /// Third #import ///Tool -#import "ThemeColor.h" +#import "MEWThemeColor.h" #import "YMMacro.h" @interface YMMineSettingTableViewCell() @@ -88,7 +88,7 @@ if (!_subTitleLabel) { _subTitleLabel = [[UILabel alloc] init]; _subTitleLabel.font = [UIFont systemFontOfSize:12]; - _subTitleLabel.textColor = UIColorRGBAlpha(0xFFFFFF, 0.8); + _subTitleLabel.textColor = UIColorMewRGBAlpha(0xFFFFFF, 0.8); _subTitleLabel.textAlignment = NSTextAlignmentRight; } return _subTitleLabel; diff --git a/yinmeng-ios/yinmeng-ios/Main/YinMeng/Mine/View/Setting/YMMineAboutUsViewController.m b/yinmeng-ios/yinmeng-ios/Main/YinMeng/Mine/View/Setting/YMMineAboutUsViewController.m index ad9a735..be00358 100644 --- a/yinmeng-ios/yinmeng-ios/Main/YinMeng/Mine/View/Setting/YMMineAboutUsViewController.m +++ b/yinmeng-ios/yinmeng-ios/Main/YinMeng/Mine/View/Setting/YMMineAboutUsViewController.m @@ -11,7 +11,7 @@ #import /// Tool #import "YMMacro.h" -#import "ThemeColor.h" +#import "MEWThemeColor.h" #import "Base.h" #import "YYUtility.h" #import "MewHtmlUrl.h" @@ -39,7 +39,7 @@ - (void)viewDidLoad { [super viewDidLoad]; self.title = [NSString stringWithFormat:@"关于%@",@"我们"]; - self.view.backgroundColor = [ThemeColor colorWithHexString:@"#14171B"]; + self.view.backgroundColor = [MEWThemeColor mewColorWithHexString:@"#14171B"]; [self initSubViews]; [self makeConstriants]; } @@ -132,7 +132,7 @@ if (!_versionLabel) { _versionLabel = [[UILabel alloc] init]; _versionLabel.font = [UIFont systemFontOfSize:12]; - _versionLabel.textColor = UIColorRGBAlpha(0xFFFFFF, 0.8); + _versionLabel.textColor = UIColorMewRGBAlpha(0xFFFFFF, 0.8); _versionLabel.text = [NSString stringWithFormat:@"V%@",[YYUtility appVersion]]; } return _versionLabel; @@ -151,7 +151,7 @@ - (UIView *)privacyView { if(!_privacyView) { _privacyView = [[UIView alloc] init]; - _privacyView.backgroundColor = [ThemeColor colorWithHexString:@"#5E6175"]; + _privacyView.backgroundColor = [MEWThemeColor mewColorWithHexString:@"#5E6175"]; UITapGestureRecognizer *tap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(pushPrivacyView:)]; [_privacyView addGestureRecognizer:tap]; } diff --git a/yinmeng-ios/yinmeng-ios/Main/YinMeng/Mine/View/Setting/YMMineSettingViewController.m b/yinmeng-ios/yinmeng-ios/Main/YinMeng/Mine/View/Setting/YMMineSettingViewController.m index dd8ed26..03481e2 100644 --- a/yinmeng-ios/yinmeng-ios/Main/YinMeng/Mine/View/Setting/YMMineSettingViewController.m +++ b/yinmeng-ios/yinmeng-ios/Main/YinMeng/Mine/View/Setting/YMMineSettingViewController.m @@ -20,11 +20,11 @@ ///Third #import ///Tool -#import "NSArray+Safe.h" -#import "ThemeColor.h" +#import "NSArray+MewSafe.h" +#import "MEWThemeColor.h" #import "YMMacro.h" #import "UIImage+Utils.h" -#import "YMHUDTool.h" +#import "MewHUDTool.h" #import "MewHtmlUrl.h" @interface YMMineSettingViewController () @@ -56,7 +56,7 @@ #pragma mark - Life Cycle - (void)viewDidLoad { [super viewDidLoad]; - self.view.backgroundColor = [ThemeColor colorWithHexString:@"#14171B"]; + self.view.backgroundColor = [MEWThemeColor mewColorWithHexString:@"#14171B"]; [self initSubViews]; [self.presenter getMineSettingDataSourceWith:self.userInfo]; } @@ -92,12 +92,12 @@ } - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { YMMineSettingTableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:NSStringFromClass([YMMineSettingTableViewCell class])]; - cell.itemModel = [self.models safeObjectAtIndex1:indexPath.row]; + cell.itemModel = [self.models mewSafeObjectAtIndex:indexPath.row]; return cell; } - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath { - YMMineSettingItemModel * model = [self.models safeObjectAtIndex1:indexPath.row]; + YMMineSettingItemModel * model = [self.models mewSafeObjectAtIndex:indexPath.row]; [self pushViewControllerWithType:model.type]; } @@ -111,7 +111,7 @@ LoginVerifBindPhoneViewController *controller = [[LoginVerifBindPhoneViewController alloc] init]; [self.navigationController pushViewController:controller animated:NO]; } else { - [YMHUDTool showErrorWithMessage:@"您已绑定手机号码"]; + [MewHUDTool showErrorWithMessage:@"您已绑定手机号码"]; } } break; @@ -226,12 +226,12 @@ if (!_logoutButton) { _logoutButton = [UIButton buttonWithType:UIButtonTypeCustom]; _logoutButton.frame = CGRectMake(40, 40, KScreenWidth - 40 * 2, 50); - _logoutButton.backgroundColor = [ThemeColor appCellBackgroundColor]; + _logoutButton.backgroundColor = [MEWThemeColor mewAppCellBackgroundColor]; _logoutButton.layer.masksToBounds = YES; _logoutButton.layer.cornerRadius = 50/2; _logoutButton.titleLabel.font = [UIFont systemFontOfSize:16]; [_logoutButton setTitleColor:UIColor.whiteColor forState:UIControlStateNormal]; - UIImage *image = [UIImage gradientColorImageFromColors:@[[ThemeColor colorWithHexString:@"#FF60FD"], [ThemeColor colorWithHexString:@"#8974FF"], [ThemeColor colorWithHexString:@"#69EBFF"]] gradientType:GradientTypeLeftToRight imgSize:CGSizeMake(KScreenWidth - 2 * 40, 48)]; + UIImage *image = [UIImage gradientColorImageFromColors:@[[MEWThemeColor mewColorWithHexString:@"#FF60FD"], [MEWThemeColor mewColorWithHexString:@"#8974FF"], [MEWThemeColor mewColorWithHexString:@"#69EBFF"]] gradientType:GradientTypeLeftToRight 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/MineModifPayPwdView.m b/yinmeng-ios/yinmeng-ios/Main/YinMeng/Mine/View/SubView/MineModifPayPwdView.m index 5aa9e2f..c4b338d 100644 --- a/yinmeng-ios/yinmeng-ios/Main/YinMeng/Mine/View/SubView/MineModifPayPwdView.m +++ b/yinmeng-ios/yinmeng-ios/Main/YinMeng/Mine/View/SubView/MineModifPayPwdView.m @@ -9,7 +9,7 @@ ///Third #import ///Tool -#import "ThemeColor.h" +#import "MEWThemeColor.h" #import "UIButton+EnlargeTouchArea.h" @interface MineModifPayPwdView() @@ -43,7 +43,7 @@ #pragma mark - Private Method - (void)initSubViews { - self.backgroundColor = [ThemeColor appCellBackgroundColor]; + self.backgroundColor = [MEWThemeColor mewAppCellBackgroundColor]; [self addSubview:self.contentTextField]; [self addSubview:self.commandButton]; [self addSubview:self.partLineView]; @@ -76,14 +76,14 @@ #pragma mark - Getters And Setters - (void)setPlaceholder:(NSString *)placeholder { _placeholder = placeholder; - self.contentTextField.attributedPlaceholder = [[NSAttributedString alloc] initWithString:placeholder attributes:@{NSFontAttributeName : self.contentTextField.font, NSForegroundColorAttributeName : [ThemeColor secondTextColor]}]; + self.contentTextField.attributedPlaceholder = [[NSAttributedString alloc] initWithString:placeholder attributes:@{NSFontAttributeName : self.contentTextField.font, NSForegroundColorAttributeName : [MEWThemeColor mewSecondTextColor]}]; } - (UIView *)partLineView { if (!_partLineView) { _partLineView = [[UIView alloc] init]; - _partLineView.backgroundColor = [ThemeColor dividerColor]; + _partLineView.backgroundColor = [MEWThemeColor mewDividerColor]; _partLineView.hidden = YES; } return _partLineView; @@ -94,8 +94,8 @@ _contentTextField = [[UITextField alloc] init]; _contentTextField.secureTextEntry = YES; _contentTextField.font = [UIFont systemFontOfSize:13]; - _contentTextField.textColor = [ThemeColor mainTextColor]; -// _contentTextField.tintColor = [ThemeColor appMainColor]; + _contentTextField.textColor = [MEWThemeColor mewMainTextColor]; +// _contentTextField.tintColor = [MEWThemeColor appMainColor]; } return _contentTextField; } diff --git a/yinmeng-ios/yinmeng-ios/Main/YinMeng/ModuleKit/SendGiftView/Model/GiftReceiveInfoModel.h b/yinmeng-ios/yinmeng-ios/Main/YinMeng/ModuleKit/SendGiftView/Model/GiftReceiveInfoModel.h index d7ae755..0e243e4 100644 --- a/yinmeng-ios/yinmeng-ios/Main/YinMeng/ModuleKit/SendGiftView/Model/GiftReceiveInfoModel.h +++ b/yinmeng-ios/yinmeng-ios/Main/YinMeng/ModuleKit/SendGiftView/Model/GiftReceiveInfoModel.h @@ -5,7 +5,7 @@ // Created by 触海 on 2023/11/21. // -#import "NSObject+MJExtension.h" +#import "NSObject+MEWExtension.h" #import "GiftInfoModel.h" NS_ASSUME_NONNULL_BEGIN diff --git a/yinmeng-ios/yinmeng-ios/Main/YinMeng/ModuleKit/SendGiftView/Presenter/YMGiftStorage.m b/yinmeng-ios/yinmeng-ios/Main/YinMeng/ModuleKit/SendGiftView/Presenter/YMGiftStorage.m index 15ad83e..1b0ae68 100644 --- a/yinmeng-ios/yinmeng-ios/Main/YinMeng/ModuleKit/SendGiftView/Presenter/YMGiftStorage.m +++ b/yinmeng-ios/yinmeng-ios/Main/YinMeng/ModuleKit/SendGiftView/Presenter/YMGiftStorage.m @@ -7,8 +7,8 @@ #import "YMGiftStorage.h" #import "GiftInfoModel.h" -#import "NSObject+MJExtension.h" -#import "NSArray+Safe.h" +#import "NSObject+MEWExtension.h" +#import "NSArray+MewSafe.h" @interface YMGiftStorage() ///key:房间id value:房间对应的礼物列表 @@ -98,9 +98,9 @@ [fileManager createDirectoryAtPath:giftDirPath withIntermediateDirectories:YES attributes:nil error:nil]; } for (int i = 0; i< array.count; i++) { - GiftInfoModel * giftInfoModel = [array safeObjectAtIndex1:i]; + GiftInfoModel * giftInfoModel = [array mewSafeObjectAtIndex:i]; NSString *giftPath = [giftDirPath stringByAppendingPathComponent:[NSString stringWithFormat:@"%ld", giftInfoModel.giftId]]; - [NSKeyedArchiver archiveRootObject:giftInfoModel.model2dictionary toFile:giftPath]; + [NSKeyedArchiver archiveRootObject:giftInfoModel.mewModel2dictionary toFile:giftPath]; } self.isWriteToFile = YES; } @@ -117,7 +117,7 @@ if (existed) { NSString *aPath = [pathFile stringByAppendingPathComponent:giftId]; NSDictionary * dic = [NSKeyedUnarchiver unarchiveObjectWithFile:aPath]; - giftInfo = [GiftInfoModel modelWithDictionary:dic]; + giftInfo = [GiftInfoModel mewModelWithDictionary:dic]; } return giftInfo; } diff --git a/yinmeng-ios/yinmeng-ios/Main/YinMeng/Room/Presenter/YMRoomPresenter.m b/yinmeng-ios/yinmeng-ios/Main/YinMeng/Room/Presenter/YMRoomPresenter.m index dc70c74..7160dd2 100644 --- a/yinmeng-ios/yinmeng-ios/Main/YinMeng/Room/Presenter/YMRoomPresenter.m +++ b/yinmeng-ios/yinmeng-ios/Main/YinMeng/Room/Presenter/YMRoomPresenter.m @@ -39,7 +39,7 @@ /// 获取用户信息 [Api getUserInfo:[self createHttpCompletion:^(BaseModel * _Nonnull data) { - UserInfoModel *userInfo = [UserInfoModel modelWithJSON:data.data]; + UserInfoModel *userInfo = [UserInfoModel mewModelWithJSON:data.data]; [user sendNext:userInfo]; [user sendCompleted]; } fail:^(NSInteger code, NSString * _Nullable msg) { @@ -47,8 +47,8 @@ }] uid:uid]; /// 获取房间信息 - [Api getRoomInformation:[self createHttpCompletion:^(BaseModel * _Nonnull data) { - RoomInfoModel *roomInfo = [RoomInfoModel modelWithJSON:data.data]; + [Api getRoomInfo:[self createHttpCompletion:^(BaseModel * _Nonnull data) { + RoomInfoModel *roomInfo = [RoomInfoModel mewModelWithJSON:data.data]; [room sendNext:roomInfo]; [room sendCompleted]; } fail:^(NSInteger code, NSString * _Nullable msg) { @@ -64,8 +64,8 @@ extModel.erbanNo = userInfo.erbanNo; extModel.vipIcon = userInfo.userVipInfoVO.vipIcon; extModel.gender = userInfo.gender; - NSMutableDictionary *ext = [NSMutableDictionary dictionaryWithObject:extModel.model2dictionary forKey:[NSString stringWithFormat:@"%ld", userInfo.uid]]; - request.roomExt = [ext toJSONString]; + NSMutableDictionary *ext = [NSMutableDictionary dictionaryWithObject:extModel.mewModel2dictionary forKey:[NSString stringWithFormat:@"%ld", userInfo.uid]]; + request.roomExt = [ext mewToJSONString]; /// 云信进房 [[NIMSDK sharedSDK].chatroomManager enterChatroom:request completion:^(NSError * _Nullable error, NIMChatroom * _Nullable chatroom, NIMChatroomMember * _Nullable me) { if (error) { @@ -118,8 +118,8 @@ } [Api openRoom:[self createHttpCompletion:^(BaseModel * _Nonnull data) { - RoomInfoModel *roomInfo = [RoomInfoModel modelWithJSON:data.data]; - [[self getView] openCurrentRoomSuccess:roomInfo]; + RoomInfoModel *roomInfo = [RoomInfoModel mewModelWithJSON:data.data]; + [[self getView] openRoomSuccess:roomInfo]; } fail:^(NSInteger code, NSString * _Nullable msg) { [[self getView] enterCurrentRoomFail:code]; }] title:title type:type roomPwd:roomPwd roomDesc:roomDesc backPic:backPic uid:uid ticket:ticket mgId:mgId]; @@ -167,7 +167,7 @@ NSString *roomSendType = @"3"; [Api requestSendGift:[self createHttpCompletion:^(BaseModel * _Nonnull data) { - GiftReceiveInfoModel *receive = [GiftReceiveInfoModel modelWithJSON:data.data]; + GiftReceiveInfoModel *receive = [GiftReceiveInfoModel mewModelWithJSON:data.data]; receive.sourceType = giftSource; receive.roomSendGiftType = roomSendType; diff --git a/yinmeng-ios/yinmeng-ios/Main/YinMeng/Room/View/AnimationView/YMRoomAnimationHitView.m b/yinmeng-ios/yinmeng-ios/Main/YinMeng/Room/View/AnimationView/YMRoomAnimationHitView.m index 739f728..2f1eead 100644 --- a/yinmeng-ios/yinmeng-ios/Main/YinMeng/Room/View/AnimationView/YMRoomAnimationHitView.m +++ b/yinmeng-ios/yinmeng-ios/Main/YinMeng/Room/View/AnimationView/YMRoomAnimationHitView.m @@ -6,13 +6,13 @@ // #import "YMRoomAnimationHitView.h" -#import "NSArray+Safe.h" +#import "NSArray+MewSafe.h" @implementation YMRoomAnimationHitView - (UIView *)hitTest:(CGPoint)point withEvent:(UIEvent *)event { for (NSInteger i = (self.subviews.count - 1) ; i >= 0 ; i--) { - UIView * subView = [self.subviews safeObjectAtIndex1:i]; + UIView * subView = [self.subviews mewSafeObjectAtIndex:i]; if (subView.subviews.count <= 0) { continue; } diff --git a/yinmeng-ios/yinmeng-ios/Main/YinMeng/Room/View/AnimationView/YMRoomGiftAnimationParser.m b/yinmeng-ios/yinmeng-ios/Main/YinMeng/Room/View/AnimationView/YMRoomGiftAnimationParser.m new file mode 100644 index 0000000..2384b90 --- /dev/null +++ b/yinmeng-ios/yinmeng-ios/Main/YinMeng/Room/View/AnimationView/YMRoomGiftAnimationParser.m @@ -0,0 +1,97 @@ +// +// YMRoomGiftAnimationParser.m +// yinmeng-ios +// +// Created by 触海 on 2023/11/21. +// + +#import "YMRoomGiftAnimationParser.h" +#import +#import +#import +#import "MEWGCDHelper.h" + +@implementation YMRoomGiftAnimationParser + +static NSOperationQueue *parseQueue; + ++ (void)load { + parseQueue = [NSOperationQueue new]; + parseQueue.maxConcurrentOperationCount = 8; +} + +- (void)parseWithURL:(nonnull NSString *)URL + completionBlock:(void ( ^ _Nonnull )(NSString * _Nullable videoUrl))completionBlock + failureBlock:(void ( ^ _Nullable)(NSError * _Nullable error))failureBlock { + [self parseWithURLRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:URL] cachePolicy:NSURLRequestReturnCacheDataElseLoad timeoutInterval:20.0] + completionBlock:completionBlock + failureBlock:failureBlock]; +} + +- (void)parseWithURLRequest:(NSURLRequest *)URLRequest completionBlock:(void (^)(NSString * _Nullable))completionBlock failureBlock:(void (^)(NSError * _Nullable))failureBlock { + if (URLRequest.URL == nil) { + if (failureBlock) { + [[NSOperationQueue mainQueue] addOperationWithBlock:^{ + failureBlock([NSError errorWithDomain:@"vapParser" code:411 userInfo:@{NSLocalizedDescriptionKey: @"URL cannot be nil."}]); + }]; + } + return; + } + if ([[NSFileManager defaultManager] fileExistsAtPath:[self cacheDirectory:[self cacheKey:URLRequest.URL]]]) { + if (completionBlock) { + [[NSOperationQueue mainQueue] addOperationWithBlock:^{ + completionBlock([self cacheDirectory:[self cacheKey:URLRequest.URL]]); + }]; + } + return; + } + [[[AFHTTPSessionManager manager] downloadTaskWithRequest:URLRequest progress:^(NSProgress * _Nonnull downloadProgress) { + } destination:^NSURL * _Nonnull(NSURL * _Nonnull targetPath, NSURLResponse * _Nonnull response) { + return [NSURL fileURLWithPath:[self cacheDirectory:[self cacheKey:URLRequest.URL]]]; + } completionHandler:^(NSURLResponse * _Nonnull response, NSURL * _Nullable filePath, NSError * _Nullable error) { + if (!error) { + [[NSOperationQueue mainQueue] addOperationWithBlock:^{ + NSString *str; + if ([filePath.absoluteString hasPrefix:@"file:///"]) { + str = [filePath.absoluteString stringByReplacingOccurrencesOfString:@"file://" withString:@""]; + } else { + str = filePath.absoluteString; + } + completionBlock(str); + }]; + } else { + [[NSOperationQueue mainQueue] addOperationWithBlock:^{ + completionBlock(nil); + }]; + } + }] resume]; +} + +- (void)clearCache:(nonnull NSString *)cacheKey { + NSString *cacheDir = [self cacheDirectory:cacheKey]; + [[NSFileManager defaultManager] removeItemAtPath:cacheDir error:NULL]; +} + +- (nonnull NSString *)cacheKey:(NSURL *)URL { + return [self MD5String:URL.absoluteString]; +} + +- (nullable NSString *)cacheDirectory:(NSString *)cacheKey { + NSString *cacheDir = [NSSearchPathForDirectoriesInDomains(NSCachesDirectory, NSUserDomainMask, YES) firstObject]; + return [cacheDir stringByAppendingFormat:@"/%@.mp4", cacheKey]; +} + +- (NSString *)MD5String:(NSString *)str { + const char *cstr = [str UTF8String]; + unsigned char result[16]; + CC_MD5(cstr, (CC_LONG)strlen(cstr), result); + return [NSString stringWithFormat: + @"%02X%02X%02X%02X%02X%02X%02X%02X%02X%02X%02X%02X%02X%02X%02X%02X", + result[0], result[1], result[2], result[3], + result[4], result[5], result[6], result[7], + result[8], result[9], result[10], result[11], + result[12], result[13], result[14], result[15] + ]; +} + +@end diff --git a/yinmeng-ios/yinmeng-ios/Main/YinMeng/Room/View/MEWThemeColor+MEWRoom.h b/yinmeng-ios/yinmeng-ios/Main/YinMeng/Room/View/MEWThemeColor+MEWRoom.h new file mode 100644 index 0000000..9474f6e --- /dev/null +++ b/yinmeng-ios/yinmeng-ios/Main/YinMeng/Room/View/MEWThemeColor+MEWRoom.h @@ -0,0 +1,63 @@ +// +// MEWThemeColor+MEWRoom.h +// yinmeng-ios +// +// Created by duoban on 2023/12/1. +// + +#import "MEWThemeColor.h" + +NS_ASSUME_NONNULL_BEGIN + +@interface MEWThemeColor (MEWRoom) +///房主昵称的颜色 0xFFFFFF ++ (UIColor *)roomOwnerNickColor; + ++ (UIColor *)roomOnLineIdenColor; + +///男用户的坑位的背景色 ++ (UIColor *)positionMaleNickBackColor; +///女用户的坑位的背景色 ++ (UIColor *)positionFemaleNickBackColor; +/// 没有用户的 坑位的背景色 ++ (UIColor *)positionNormalNickBackColor; +///老板位 坑位开始背景色 ++ (UIColor *)positionBossBackStartColor; +///老板位 坑位结束背景色 ++ (UIColor *)positionBossBackEndColor; +///坑位的昵称的颜色 0xFFFFFF ++ (UIColor *)positionNickColor; +// ------公屏相关颜色 Start------ / +///公屏默认背景的颜色 ++ (UIColor *)messageBubbleColor; +///公屏文字的颜色 ++ (UIColor *)messageTextColor; +///公屏名字的颜色 ++ (UIColor *)messageNickColor; +///默认的文字的颜色 ++ (UIColor *)messageDefaultTextColor; +///获取公屏提示 颜色 #FFFFFE 0.5 ++ (UIColor *)messageViewTipColor; +// ------公屏相关颜色 END------ / + +// ------房间内礼物 Start------ / +///礼物广播显示 个数的颜色 #FEF563 ++ (UIColor *)giftBroadcastNumberColor; +///礼物广播 显示的名字的颜色 #2F0060 ++ (UIColor *)giftBroadcastNickColor; +// ------房间内礼物 End------ / + +/// 糖果树记录钻石的颜色 ++ (UIColor *)candyTreeDiamondColor; +/// 糖果树名字的颜色 ++ (UIColor *)candyTreeNickColor; +/// 糖果树的分割线颜色 ++ (UIColor *)candyTreemewDividerColor; + +///动画礼物个数的颜色 0xFFF226 ++ (UIColor *)animationGiftNumberColor; +///更多menu文字颜色 0xFFFFFF ++ (UIColor *)roomMoreMenuTextColor; +@end + +NS_ASSUME_NONNULL_END diff --git a/yinmeng-ios/yinmeng-ios/Main/YinMeng/Room/View/MEWThemeColor+MEWRoom.m b/yinmeng-ios/yinmeng-ios/Main/YinMeng/Room/View/MEWThemeColor+MEWRoom.m new file mode 100644 index 0000000..49062df --- /dev/null +++ b/yinmeng-ios/yinmeng-ios/Main/YinMeng/Room/View/MEWThemeColor+MEWRoom.m @@ -0,0 +1,112 @@ +// +// MEWThemeColor+MEWRoom.m +// yinmeng-ios +// +// Created by duoban on 2023/12/1. +// + +#import "MEWThemeColor+MEWRoom.h" + +@implementation MEWThemeColor (MEWRoom) +#pragma mark -房间内相关的颜色 +///房主昵称的颜色 0xFFFFFF ++ (UIColor *)roomOwnerNickColor { + return UIColorMewFromRGB(0xFFFFFF); +} + ++ (UIColor *)roomOnLineIdenColor { + return UIColorMewFromRGB(0x3EFED7); +} + +///男用户的坑位的背景色 ++ (UIColor *)positionMaleNickBackColor { + return UIColorMewFromRGB(0x3EBBFE); +} + +///女用户的坑位的背景色 ++ (UIColor *)positionFemaleNickBackColor { + return UIColorMewFromRGB(0xFF5E83); +} + +///坑位的昵称的颜色 0xFFFFFF ++ (UIColor *)positionNickColor { + return UIColorMewFromRGB(0xFFFFFF); +} + + +/// 没有用户的 坑位的背景色 ++ (UIColor *)positionNormalNickBackColor { + return [UIColor colorWithWhite:1 alpha:0.2]; +} + +///老板位 坑位开始背景色 ++ (UIColor *)positionBossBackStartColor { + return UIColorMewFromRGB(0xEFCC95); +} + +///老板位 坑位结束背景色 ++ (UIColor *)positionBossBackEndColor { + return UIColorMewFromRGB(0xF1B54D); +} +// ------公屏相关颜色 Start------ / + +///公屏默认背景的颜色 ++ (UIColor *)messageBubbleColor { + return UIColorMewRGBAlpha(0xFFFFFF, 0.15); +} +///公屏文字的颜色 ++ (UIColor *)messageTextColor { + return [UIColor whiteColor]; +} +///公屏名字的颜色 ++ (UIColor *)messageNickColor { + return UIColorMewFromRGB(0xFFD98C); +} +///默认的文字的颜色 ++ (UIColor *)messageDefaultTextColor { + return [UIColor colorWithWhite:1 alpha:0.5]; +} + +///获取公屏提示 颜色 #FFFFFE 0.5 ++ (UIColor *)messageViewTipColor{ + return UIColorMewRGBAlpha(0xfffffe, 0.5); +} + +// ------公屏相关颜色 END------ / + +///礼物广播 显示的名字的颜色 #2F0060 ++ (UIColor *)giftBroadcastNickColor { + return UIColorMewFromRGB(0xFFFFFF); +} + +///礼物广播显示 个数的颜色 #FEF563 ++ (UIColor *)giftBroadcastNumberColor { + return UIColorMewFromRGB(0xFEF563); +} + + +/// 糖果树记录钻石的颜色 ++ (UIColor *)candyTreeDiamondColor { + return UIColorMewFromRGB(0x1194F5); +} + +/// 糖果树的分割线颜色 ++ (UIColor *)candyTreemewDividerColor { + return UIColorMewFromRGB(0xEDEDED); +} + +/// 糖果树名字的颜色 ++ (UIColor *)candyTreeNickColor { + return UIColorMewFromRGB(0x333333); +} + +///动画礼物个数的颜色 0xFFF226 ++ (UIColor *)animationGiftNumberColor { + return UIColorMewFromRGB(0xFFF226); +} + +///更多menu文字颜色 0xFFFFFF ++ (UIColor *)roomMoreMenuTextColor { + return UIColorMewFromRGB(0xFFFFFF); +} +@end diff --git a/yinmeng-ios/yinmeng-ios/Main/YinMeng/Room/View/MessageContainerView/CHRoomMessageHeaderView.m b/yinmeng-ios/yinmeng-ios/Main/YinMeng/Room/View/MessageContainerView/CHRoomMessageHeaderView.m index 4f45dbd..f143078 100644 --- a/yinmeng-ios/yinmeng-ios/Main/YinMeng/Room/View/MessageContainerView/CHRoomMessageHeaderView.m +++ b/yinmeng-ios/yinmeng-ios/Main/YinMeng/Room/View/MessageContainerView/CHRoomMessageHeaderView.m @@ -9,7 +9,7 @@ ///Third #import ///Tool -#import "ThemeColor+Room.h" +#import "MEWThemeColor+MEWRoom.h" #import "YMRoomMessageConstant.h" #import "YMMacro.h" @@ -71,12 +71,13 @@ } } -- (UIView *)bubbleBgView { - if (!_bubbleBgView) { - _bubbleBgView = [[UIView alloc] init]; - _bubbleBgView.backgroundColor = [ThemeColor messageBubbleColor]; - _bubbleBgView.layer.masksToBounds = YES; - _bubbleBgView.layer.cornerRadius = kRoomMessageBubbleCornerRadius; + +- (UIView *)bubbleView { + if (!_bubbleView) { + _bubbleView = [[UIView alloc] init]; + _bubbleView.backgroundColor = [MEWThemeColor messageBubbleColor]; + _bubbleView.layer.masksToBounds = YES; + _bubbleView.layer.cornerRadius = kRoomMessageBubbleCornerRadius; } return _bubbleBgView; } diff --git a/yinmeng-ios/yinmeng-ios/Main/YinMeng/Room/View/MessageContainerView/Model/YMMessageRemoteExtModel.h b/yinmeng-ios/yinmeng-ios/Main/YinMeng/Room/View/MessageContainerView/Model/YMMessageRemoteExtModel.h index 78e9e95..fd34711 100644 --- a/yinmeng-ios/yinmeng-ios/Main/YinMeng/Room/View/MessageContainerView/Model/YMMessageRemoteExtModel.h +++ b/yinmeng-ios/yinmeng-ios/Main/YinMeng/Room/View/MessageContainerView/Model/YMMessageRemoteExtModel.h @@ -5,7 +5,7 @@ // Created by 触海 on 2023/11/7. // -#import "NSObject+MJExtension.h" +#import "NSObject+MEWExtension.h" #import "YMEnum.h" NS_ASSUME_NONNULL_BEGIN diff --git a/yinmeng-ios/yinmeng-ios/Main/YinMeng/Room/View/MessageContainerView/View/YMNetImageYYLabel.m b/yinmeng-ios/yinmeng-ios/Main/YinMeng/Room/View/MessageContainerView/View/YMNetImageYYLabel.m index 01f94ec..7c7c506 100644 --- a/yinmeng-ios/yinmeng-ios/Main/YinMeng/Room/View/MessageContainerView/View/YMNetImageYYLabel.m +++ b/yinmeng-ios/yinmeng-ios/Main/YinMeng/Room/View/MessageContainerView/View/YMNetImageYYLabel.m @@ -7,7 +7,7 @@ #import "YMNetImageYYLabel.h" #import "YMRoomMessageConstant.h" -#import "NSArray+Safe.h" +#import "NSArray+MewSafe.h" #import "NetImageView.h" @implementation YMNetImageYYLabel @@ -18,10 +18,10 @@ YYTextLayout * layout = [YYTextLayout layoutWithContainerSize:maxSize text:attributedText]; for (int i = 0; i< layout.attachments.count; i++) { - YYTextAttachment * attachment = [layout.attachments safeObjectAtIndex1:i]; + YYTextAttachment * attachment = [layout.attachments mewSafeObjectAtIndex:i]; if (!attachment || ![attachment.content isKindOfClass:[NetImageView class]]) continue; NetImageView* imageView = attachment.content; - NSValue * value = [layout.attachmentRanges safeObjectAtIndex1:i]; + NSValue * value = [layout.attachmentRanges mewSafeObjectAtIndex:i]; NSRange range = value.rangeValue; if (!imageView.imageUrl) continue; 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 26bdc99..0d9990e 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 @@ -11,7 +11,7 @@ #import "RoomInfoModel.h" #import "MicroQueueModel.h" /// Tool -#import "ThemeColor+Room.h" +#import "MEWThemeColor+MEWRoom.h" #import "YMMacro.h" /// Third #import @@ -104,10 +104,10 @@ if(userInfo) { self.avatarImageView.imageUrl = userInfo.avatar; - [self.postionLabel setBackgroundColor:userInfo.gender == GenderType_Male ? [ThemeColor positionMaleNickBackColor] : [ThemeColor positionFemaleNickBackColor]]; + [self.postionLabel setBackgroundColor:userInfo.gender == GenderType_Male ? [MEWThemeColor positionMaleNickBackColor] : [MEWThemeColor positionFemaleNickBackColor]]; self.nickLabel.text = userInfo.nick.length > 5 ? [NSString stringWithFormat:@"%@…",[userInfo.nick substringToIndex:5]] : userInfo.nick; - self.nickLabel.textColor = userInfo.micNickColor.length > 0 ? [ThemeColor colorWithHexString: userInfo.micNickColor] : [ThemeColor positionNickColor]; + self.nickLabel.textColor = userInfo.micNickColor.length > 0 ? [MEWThemeColor mewColorWithHexString: userInfo.micNickColor] : [MEWThemeColor positionNickColor]; if (self.microModel.microState.position == -1) { self.sexImageView.hidden = NO; @@ -116,9 +116,9 @@ } } else { - self.nickLabel.textColor = [ThemeColor positionNickColor]; + self.nickLabel.textColor = [MEWThemeColor positionNickColor]; self.avatarImageView.image = nil; - [self.postionLabel setBackgroundColor: [ThemeColor positionNormalNickBackColor]]; + [self.postionLabel setBackgroundColor: [MEWThemeColor positionNormalNickBackColor]]; if (self.microModel.microState.position == -1) { self.nickLabel.hidden = YES; self.postionLabel.hidden = YES; @@ -198,7 +198,7 @@ if (!_nickLabel) { _nickLabel = [[UILabel alloc] init]; _nickLabel.font = [UIFont systemFontOfSize:11]; - _nickLabel.textColor = [ThemeColor positionNickColor]; + _nickLabel.textColor = [MEWThemeColor positionNickColor]; _nickLabel.textAlignment = NSTextAlignmentCenter; } return _nickLabel; @@ -223,7 +223,7 @@ _postionLabel.textColor = [UIColor colorWithWhite:1 alpha:1]; _postionLabel.layer.masksToBounds = YES; _postionLabel.layer.cornerRadius = 7; - [_postionLabel setBackgroundColor:[ThemeColor positionNormalNickBackColor]]; + [_postionLabel setBackgroundColor:[MEWThemeColor positionNormalNickBackColor]]; } return _postionLabel; } diff --git a/yinmeng-ios/yinmeng-ios/Main/YinMeng/Room/View/StageView/Model/MicroQueueModel.h b/yinmeng-ios/yinmeng-ios/Main/YinMeng/Room/View/StageView/Model/MicroQueueModel.h index 777c0a0..7128880 100644 --- a/yinmeng-ios/yinmeng-ios/Main/YinMeng/Room/View/StageView/Model/MicroQueueModel.h +++ b/yinmeng-ios/yinmeng-ios/Main/YinMeng/Room/View/StageView/Model/MicroQueueModel.h @@ -5,7 +5,7 @@ // Created by 触海 on 2023/11/13. // -#import "NSObject+MJExtension.h" +#import "NSObject+MEWExtension.h" #import "MicroStateModel.h" @class UserInfoModel; diff --git a/yinmeng-ios/yinmeng-ios/Main/YinMeng/Room/View/StageView/Model/MicroStateModel.h b/yinmeng-ios/yinmeng-ios/Main/YinMeng/Room/View/StageView/Model/MicroStateModel.h index 5a118fc..4e8a942 100644 --- a/yinmeng-ios/yinmeng-ios/Main/YinMeng/Room/View/StageView/Model/MicroStateModel.h +++ b/yinmeng-ios/yinmeng-ios/Main/YinMeng/Room/View/StageView/Model/MicroStateModel.h @@ -5,7 +5,7 @@ // Created by 触海 on 2023/11/13. // -#import "NSObject+MJExtension.h" +#import "NSObject+MEWExtension.h" NS_ASSUME_NONNULL_BEGIN diff --git a/yinmeng-ios/yinmeng-ios/Main/YinMeng/Room/View/ThemeColor+Room.h b/yinmeng-ios/yinmeng-ios/Main/YinMeng/Room/View/ThemeColor+Room.h deleted file mode 100644 index 4d84374..0000000 --- a/yinmeng-ios/yinmeng-ios/Main/YinMeng/Room/View/ThemeColor+Room.h +++ /dev/null @@ -1,35 +0,0 @@ -// -// ThemeColor+Room.h -// mew-ios -// -// Created by 触海 on 2023/11/14. -// - -#import "ThemeColor.h" - -NS_ASSUME_NONNULL_BEGIN - -@interface ThemeColor (Room) -///房主昵称的颜色 0xFFFFFF -+ (UIColor *)roomOwnerNickColor; - -+ (UIColor *)roomOnLineIdenColor; - -///男用户的坑位的背景色 -+ (UIColor *)positionMaleNickBackColor; -///女用户的坑位的背景色 -+ (UIColor *)positionFemaleNickBackColor; -/// 没有用户的 坑位的背景色 -+ (UIColor *)positionNormalNickBackColor; -///坑位的昵称的颜色 0xFFFFFF -+ (UIColor *)positionNickColor; -// ------公屏相关颜色 Start------ / -///公屏默认背景的颜色 -+ (UIColor *)messageBubbleColor; -///公屏文字的颜色 -+ (UIColor *)messageTextColor; -///默认的文字的颜色 -+ (UIColor *)messageDefaultTextColor; -@end - -NS_ASSUME_NONNULL_END diff --git a/yinmeng-ios/yinmeng-ios/Main/YinMeng/Room/View/ThemeColor+Room.m b/yinmeng-ios/yinmeng-ios/Main/YinMeng/Room/View/ThemeColor+Room.m deleted file mode 100644 index 5720a71..0000000 --- a/yinmeng-ios/yinmeng-ios/Main/YinMeng/Room/View/ThemeColor+Room.m +++ /dev/null @@ -1,61 +0,0 @@ -// -// ThemeColor+Room.m -// mew-ios -// -// Created by 触海 on 2023/11/14. -// - -#import "ThemeColor+Room.h" - -@implementation ThemeColor (Room) - -#pragma mark -房间内相关的颜色 -///房主昵称的颜色 0xFFFFFF -+ (UIColor *)roomOwnerNickColor { - return UIColorFromRGB(0xFFFFFF); -} - -+ (UIColor *)roomOnLineIdenColor { - return UIColorFromRGB(0x3EFED7); -} - -///男用户的坑位的背景色 -+ (UIColor *)positionMaleNickBackColor { - return UIColorFromRGB(0x3EBBFE); -} - -///女用户的坑位的背景色 -+ (UIColor *)positionFemaleNickBackColor { - return UIColorFromRGB(0xFF5E83); -} - -///坑位的昵称的颜色 0xFFFFFF -+ (UIColor *)positionNickColor { - return UIColorFromRGB(0xFFFFFF); -} - - -/// 没有用户的 坑位的背景色 -+ (UIColor *)positionNormalNickBackColor { - return [UIColor colorWithWhite:1 alpha:0.2]; -} - -// ------公屏相关颜色 Start------ / - -///公屏默认背景的颜色 -+ (UIColor *)messageBubbleColor { - return UIColorRGBAlpha(0xFFFFFF, 0.15); -} -///公屏文字的颜色 -+ (UIColor *)messageTextColor { - return [UIColor whiteColor]; -} - -///默认的文字的颜色 -+ (UIColor *)messageDefaultTextColor { - return [UIColor colorWithWhite:1 alpha:0.5]; -} - - - -@end