更换类名和方法

This commit is contained in:
liyuhua
2023-12-05 15:49:24 +08:00
parent 9c38bd3008
commit f2ae6e4637
102 changed files with 841 additions and 749 deletions

View File

@@ -29,7 +29,7 @@ NS_ASSUME_NONNULL_BEGIN
@interface BaseViewController : UIViewController<BaseViewControllerProtocol>
// 是否隐藏导航 默认是不隐藏的
@property(nonatomic,assign,getter=isHiddenNavBar) BOOL hiddenNavBar;
@property(nonatomic,assign,getter=mew_isHiddenNavBar) BOOL hiddenNavBar;
/*显示/隐藏导航*/
- (void)hideNavigationBar;

View File

@@ -31,7 +31,7 @@
[UIApplication sharedApplication].statusBarStyle = UIStatusBarStyleDefault;
}
//
[self.navigationController setNavigationBarHidden:self.isHiddenNavBar animated:animated];
[self.navigationController setNavigationBarHidden:self.mew_isHiddenNavBar animated:animated];
//iOS15 线
if (@available(iOS 15.0, *)) {
[self.navigationController.navigationBar.subviews enumerateObjectsUsingBlock:^(UIView *view, NSUInteger idx, BOOL *stop) {

View File

@@ -22,21 +22,21 @@
#pragma mark - Init
- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier {
if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
[self initSubViews];
[self initSubViewConstraints];
[self mew_initSubViews];
[self mew_initSubViewConstraints];
}
return self;
}
#pragma mark - Private Method
- (void)initSubViews {
- (void)mew_initSubViews {
self.backgroundColor = [UIColor clearColor];
self.selectionStyle = UITableViewCellSelectionStyleNone;
[self.contentView addSubview:self.emptyImageView];
[self.contentView addSubview:self.titleLabel];
}
- (void)initSubViewConstraints {
- (void)mew_initSubViewConstraints {
[self.emptyImageView mas_makeConstraints:^(MASConstraintMaker *make) {
make.centerX.mas_equalTo(self.contentView);
make.top.mas_equalTo(self.contentView).offset(250);

View File

@@ -37,13 +37,13 @@ static NSString *const kSheetViewCellConst = @"kSheetViewCellConst";
if (self) {
_items = items;
_needCancel = needCancel;
[self initViews];
[self mew_initViews];
[self initConstraints];
}
return self;
}
- (void)initViews {
- (void)mew_initViews {
[self addSubview:self.tableView];
[self addSubview:self.cancelButton];
}

View File

@@ -31,13 +31,13 @@ static CGFloat const kBtnHeight = 38.f;
- (instancetype)initWithFrame:(CGRect)frame {
self = [super initWithFrame:frame];
if (self) {
[self initViews];
[self mew_initViews];
[self initConstraints];
}
return self;
}
- (void)initViews {
- (void)mew_initViews {
[self addSubview:self.titleLabel];
[self addSubview:self.messageLabel];
[self addSubview:self.stackView];
@@ -74,7 +74,7 @@ static CGFloat const kBtnHeight = 38.f;
}
#pragma mark - Button Events
- (void)onClickConfirmButtonAction:(UIButton *)confirmButton {
- (void)onClickmew_confirmButtonAction:(UIButton *)confirmButton {
!_confirmAction ?: _confirmAction();
!_dismissAction ?: _dismissAction();
}
@@ -232,7 +232,7 @@ static CGFloat const kBtnHeight = 38.f;
- (UIButton *)confirmButton {
if (!_confirmButton) {
_confirmButton = [UIButton buttonWithType:UIButtonTypeCustom];
[_confirmButton addTarget:self action:@selector(onClickConfirmButtonAction:) forControlEvents:UIControlEventTouchUpInside];
[_confirmButton addTarget:self action:@selector(onClickmew_confirmButtonAction:) forControlEvents:UIControlEventTouchUpInside];
}
return _confirmButton;
}

View File

@@ -1,26 +0,0 @@
//
// AudioPlayerManager.h
// mew-ios
//
// Created by 触海 on 2023/11/18.
//
#import <Foundation/Foundation.h>
@class AVAudioPlayer;
NS_ASSUME_NONNULL_BEGIN
@interface AudioPlayerManager : NSObject
+ (instancetype)shared;
/// 远程播放音频
- (void)playAudioWithUrlString:(NSString *)urlString;
/// 停止播放音频
- (void)stopAudio;
@property (nonatomic, strong, readonly) AVAudioPlayer *player;
@end
NS_ASSUME_NONNULL_END

View File

@@ -0,0 +1,22 @@
//
// MewAudioPlayerManager.h
// yinmeng-ios
//
// Created by duoban on 2023/12/5.
//
#import <Foundation/Foundation.h>
@class AVAudioPlayer;
NS_ASSUME_NONNULL_BEGIN
@interface MewAudioPlayerManager : NSObject
+ (instancetype)shared;
/// 远程播放音频
- (void)mewPlayAudioWithUrlString:(NSString *)urlString;
/// 停止播放音频
- (void)mewStopAudio;
@property (nonatomic, strong, readonly) AVAudioPlayer *mew_player;
@end
NS_ASSUME_NONNULL_END

View File

@@ -1,22 +1,19 @@
//
// AudioPlayerManager.m
// mew-ios
// MewAudioPlayerManager.m
// yinmeng-ios
//
// Created by on 2023/11/18.
// Created by duoban on 2023/12/5.
//
#import "AudioPlayerManager.h"
#import "MewAudioPlayerManager.h"
#import <AFNetworking.h>
#import <AVFoundation/AVFoundation.h>
@interface AudioPlayerManager()
@interface MewAudioPlayerManager()
///
@property (nonatomic, strong) AVAudioPlayer *player;
@property (nonatomic, strong) AVAudioPlayer *mew_player;
@end
@implementation AudioPlayerManager
static AudioPlayerManager *_instance = nil;
@implementation MewAudioPlayerManager
static MewAudioPlayerManager *_instance = nil;
#pragma mark - Public Method
+ (instancetype)shared {
static dispatch_once_t onceToken;
@@ -28,7 +25,7 @@ static AudioPlayerManager *_instance = nil;
return _instance;
}
- (void)playAudioWithUrlString:(NSString *)urlString {
- (void)mewPlayAudioWithUrlString:(NSString *)urlString {
if ([urlString containsString:@"http"]) {
//
[self setAudioWithUrl:urlString];
@@ -38,10 +35,10 @@ static AudioPlayerManager *_instance = nil;
}
}
- (void)stopAudio {
if (self.player) {
[self.player stop];
self.player = nil;
- (void)mewStopAudio {
if (self.mew_player) {
[self.mew_player stop];
self.mew_player = nil;
}
}
@@ -49,15 +46,15 @@ static AudioPlayerManager *_instance = nil;
///
- (void)setAvAudioPlayerWithUrl:(NSString *)url {
//
[self stopAudio];
[self mewStopAudio];
[[AVAudioSession sharedInstance] setCategory:AVAudioSessionCategoryPlayback withOptions:AVAudioSessionCategoryOptionAllowBluetooth error:nil];
NSError *error = nil;
self.player = [[AVAudioPlayer alloc] initWithContentsOfURL:[NSURL URLWithString:url] error:&error];
self.player.volume = 1;
self.player.numberOfLoops = -1;
[self.player prepareToPlay];
[self.player play];
self.mew_player = [[AVAudioPlayer alloc] initWithContentsOfURL:[NSURL URLWithString:url] error:&error];
self.mew_player.volume = 1;
self.mew_player.numberOfLoops = -1;
[self.mew_player prepareToPlay];
[self.mew_player play];
}
/// url

View File

@@ -11,32 +11,32 @@ NS_ASSUME_NONNULL_BEGIN
@interface MewHomePresenter : BaseMvpPresenter
- (void)getNewFriendListWithGender:(NSString *)gender;
- (void)mew_getNewFriendListWithGender:(NSString *)gender;
// 发布声音
- (void)uploadVoice:(NSString *)filePath;
- (void)mew_uploadVoice:(NSString *)filePath;
/// 关注用户/取消该关注
/// - Parameters:
/// - targetUid: 目标用户的uid
/// - state: 是否关注 yes 关注 no 取消关注
- (void)attentionUser:(NSString *)targetUid state:(BOOL)state;
- (void)mew_attentionUser:(NSString *)targetUid state:(BOOL)state;
/// 获取两个人的关注状态
- (void)getUserAttentionState:(NSString *)targetUid;
- (void)mew_getUserAttentionState:(NSString *)targetUid;
/// 获取用户信息
- (void)getUserInfoWithUid:(NSString *)uid;
- (void)mew_getUserInfoWithUid:(NSString *)uid;
/// 获取用户详细信息
- (void)getUserDetailInfoWithUid:(NSString *)uid;
- (void)mew_getUserDetailInfoWithUid:(NSString *)uid;
/// Mew 获取好友列表
- (void)getMewHomeFriendListWithGender:(NSString *)gender;
- (void)mew_getMewHomeFriendListWithGender:(NSString *)gender;
/// 用户关注列表
/// @param page 当前的页数
/// @param pageSize 一页多少个
- (void)getUserAttentionList:(int)page pageSize:(int)pageSize state:(int)state;
- (void)mew_getUserAttentionList:(int)page pageSize:(int)pageSize state:(int)state;
/// 音萌商店包的上传声音秀
- (void)mewPublishVoiceShowDura:(NSString *)dura desc:(NSString *)desc gender:(NSString *)gender url:(NSString *)url;

View File

@@ -20,38 +20,38 @@
@implementation MewHomePresenter
/// Mew
- (void)getMewHomeFriendListWithGender:(NSString *)gender {
- (void)mew_getMewHomeFriendListWithGender:(NSString *)gender {
[Api getMewHomeFriendListCompleted:[self createHttpCompletion:^(BaseModel * _Nonnull data) {
NSArray *array = [UserInfoModel mewModelsWithArray:data.data[@"randomList"]];
UserInfoModel *mineModel = [UserInfoModel mewModelWithDictionary:data.data[@"me"]];
[[self getView] getMewHomeFriendListSuccesss:array selfMine:mineModel];
[[self getView] mew_getMewHomeFriendListSuccesss:array selfMine:mineModel];
} fail:^(NSInteger code, NSString * _Nullable msg) {
}] gender:gender];
}
///
- (void)getNewFriendListWithGender:(NSString *)gender {
- (void)mew_getNewFriendListWithGender:(NSString *)gender {
[Api getNewFriendListComplection:[self createHttpCompletion:^(BaseModel * _Nonnull data) {
NSArray *array = [UserInfoModel mewModelsWithArray:data];
[[self getView] getNewFriendListSuccess:array];
[[self getView] mew_getNewFriendListSuccess:array];
} fail:^(NSInteger code, NSString * _Nullable msg) {
[[self getView] getNewFriendListFail];
[[self getView] mew_getNewFriendListFail];
}] gender:gender];
}
///
- (void)uploadVoice:(NSString *)filePath {
- (void)mew_uploadVoice:(NSString *)filePath {
[Api qiniuUpLoadImage:[self createHttpCompletion:^(BaseModel * _Nonnull data) {
NSString *key = data.data[@"key"];
NSString *token = data.data[@"token"];
[MEWUploadFile mewUploadFile:filePath named:key token:token success:^(NSString * _Nonnull key, NSDictionary * _Nonnull res) {
NSString *url = res[@"path"];
[[self getView] uploadVoiceFileToThirdSuccess:url];
[[self getView] mew_uploadVoiceFileToThirdSuccess:url];
} failure:^(NSNumber * _Nonnull code, NSString * _Nonnull message) {
[[self getView] uploadVoiceFileFail:message];
[[self getView] mew_uploadVoiceFileFail:message];
}];
@@ -66,10 +66,10 @@
/// - Parameters:
/// - targetUid: uid
/// - state: yes no
- (void)attentionUser:(NSString *)targetUid state:(BOOL)state {
- (void)mew_attentionUser:(NSString *)targetUid state:(BOOL)state {
// if (state) {
[self initiateAttentionUser:targetUid state:state];
[self initiatemew_attentionUser:targetUid state:state];
// return;
// }
@@ -78,7 +78,7 @@
// config.title = @"提示";
// config.message = @"确定取消关注该用户吗?";
// [TTPopup alertWithConfig:config confirmHandler:^{
// [self initiateAttentionUser:targetUid state:state];
// [self initiatemew_attentionUser:targetUid state:state];
// } cancelHandler:^{
//
// }];
@@ -87,31 +87,31 @@
}
///
- (void)getUserAttentionState:(NSString *)targetUid {
- (void)mew_getUserAttentionState:(NSString *)targetUid {
NSString *uid = [[AccountInfoStorage instance] getUid];
[Api attentionStatusCompletion:[self createHttpCompletion:^(BaseModel * _Nonnull data) {
BOOL isLike = ((NSNumber *)data.data).boolValue;
[[self getView] getUserAttentionSuccess:isLike];
[[self getView] mew_getUserAttentionSuccess:isLike];
}] uid:uid isLikeUid:targetUid];
}
///
- (void)getUserInfoWithUid:(NSString *)uid {
- (void)mew_getUserInfoWithUid:(NSString *)uid {
[Api getUserInfo:[self createHttpCompletion:^(BaseModel * _Nonnull data) {
UserInfoModel *userInfo = [UserInfoModel mewModelWithDictionary:data.data];
[[self getView] getUserInfoSuccess:userInfo];
[[self getView] mew_getUserInfoSuccess:userInfo];
} fail:^(NSInteger code, NSString * _Nullable msg) {
}] uid:uid];
}
///
- (void)getUserDetailInfoWithUid:(NSString *)uid {
- (void)mew_getUserDetailInfoWithUid:(NSString *)uid {
[Api userDetailInfoCompletion:[self createHttpCompletion:^(BaseModel * _Nonnull data) {
UserInfoModel *infoModel = [UserInfoModel mewModelWithDictionary:data.data];
[[self getView] getUserDetailInfoSuccess:infoModel];
[[self getView] mew_getUserDetailInfoSuccess:infoModel];
}] uid:uid page:@"1" pageSize:@"20"];
}
@@ -119,15 +119,15 @@
///
/// @param page
/// @param pageSize
- (void)getUserAttentionList:(int)page pageSize:(int)pageSize state:(int)state{
- (void)mew_getUserAttentionList:(int)page pageSize:(int)pageSize state:(int)state{
NSString * uid= [AccountInfoStorage instance].getUid;
NSString * pageStr = [NSString stringWithFormat:@"%d", page];
NSString * pageSizeStr = [NSString stringWithFormat:@"%d", pageSize];
[Api getattentionListCompletion:[self createHttpCompletion:^(BaseModel * _Nonnull data) {
NSArray * array = [UserInfoModel mewModelsWithArray:data.data];
[[self getView] getUserAttentionListSuccess:array state:state];
[[self getView] mew_getUserAttentionListSuccess:array state:state];
}fail:^(NSInteger code, NSString * _Nullable msg) {
// [[self getView] getUserAttentionListFail:state];
// [[self getView] mew_getUserAttentionListFail:state];
}] uid:uid pageNo:pageStr pageSize:pageSizeStr];
}
@@ -144,7 +144,7 @@
}
#pragma mark - Private Method
- (void)initiateAttentionUser:(NSString *)targetUid state:(BOOL)state {
- (void)initiatemew_attentionUser:(NSString *)targetUid state:(BOOL)state {
NSString *uid = [[AccountInfoStorage instance] getUid];
NSString *ticket = [[AccountInfoStorage instance] getTicket];
NSString *type = state ? @"1" : @"2";

View File

@@ -13,32 +13,32 @@ NS_ASSUME_NONNULL_BEGIN
@protocol MewHomeProtocol <NSObject>
/// 获取发现好友列表成功
- (void)getNewFriendListSuccess:(NSArray *)array;
- (void)mew_getNewFriendListSuccess:(NSArray *)array;
/// 获取发现好友列表失败
- (void)getNewFriendListFail;
- (void)mew_getNewFriendListFail;
/// 上传声音成功
- (void)uploadVoiceFileToThirdSuccess:(NSString *)fileUrl;
- (void)mew_uploadVoiceFileToThirdSuccess:(NSString *)fileUrl;
/// 上传声音秀失败
/// @param message 失败消息
- (void)uploadVoiceFileFail:(NSString *)message;
- (void)mew_uploadVoiceFileFail:(NSString *)message;
/// 获取用户信息
- (void)getUserInfoSuccess:(UserInfoModel *)userInfo;;
- (void)mew_getUserInfoSuccess:(UserInfoModel *)userInfo;;
/// 获取用户详细信息
- (void)getUserDetailInfoSuccess:(UserInfoModel *)userInfo;;
- (void)mew_getUserDetailInfoSuccess:(UserInfoModel *)userInfo;;
/// 关注用户成功
- (void)mew_attentionUserSuccess:(BOOL)status;
/// 关注用户失败
- (void)attentionUserFail;
- (void)mew_attentionUserFail;
/// 获取两个人的关注成功
- (void)getUserAttentionSuccess:(BOOL)status;
- (void)mew_getUserAttentionSuccess:(BOOL)status;
/// Mew 获取好友列表成功
- (void)getMewHomeFriendListSuccesss:(NSArray *)array selfMine:(UserInfoModel *)selfMineModel;
- (void)mew_getMewHomeFriendListSuccesss:(NSArray *)array selfMine:(UserInfoModel *)selfMineModel;
///获取用户关注列表
- (void)getUserAttentionListSuccess:(NSArray *)array state:(int)state;
- (void)mew_getUserAttentionListSuccess:(NSArray *)array state:(int)state;
- (void)mewPublishVoiceShowSuccess;
@end

View File

@@ -13,7 +13,7 @@
#import "MewRightFollowVoiceView.h"
#import "MewPushExclusiveVoiceView.h"
#import "MewUserIntroductionView.h"
#import "YMHomeFilterView.h"
#import "MewHomeFilterView.h"
#import "MewVoiceGuideView.h"
#import "YMMineSettingViewController.h"
#import "MewMineCollectionViewController.h"
@@ -58,7 +58,7 @@
///
@property (nonatomic, strong) UIView *currentLayerView;
/// view
@property (nonatomic, strong) YMHomeFilterView *filterView;
@property (nonatomic, strong) MewHomeFilterView *filterView;
///
@property (nonatomic, strong) NSArray<UserInfoModel *> *userInfoModels;
@@ -84,7 +84,7 @@
@implementation MewHomeViewController
- (BOOL)isHiddenNavBar {
- (BOOL)mew_isHiddenNavBar {
return YES;
}
@@ -97,12 +97,12 @@
[super viewDidLoad];
// [IQKeyboardManager sharedManager].enable = YES;
// [[IQKeyboardManager sharedManager] setKeyboardDistanceFromTextField:10.0];
[self initView];
[self initGuideView];
[self mew_initView];
[self mew_initGuideView];
//
self.filterString = nil;
self.fansListModels = [NSMutableArray array];
[self loadFollownModelRefresh];
[self mew_loadFollownModelRefresh];
}
- (void)viewWillAppear:(BOOL)animated {
@@ -110,36 +110,36 @@
}
#pragma mark - Load Data ()
- (void)loadHomeDataWithGender:(NSString *)gender {
[self.presenter getMewHomeFriendListWithGender:gender];
- (void)mew_loadHomeDataWithGender:(NSString *)gender {
[self.presenter mew_getMewHomeFriendListWithGender:gender];
}
- (void)setFilterString:(NSString *)filterString {
_filterString = filterString;
[self.showVoiceView reloadDataWithNormal];
[self loadHomeDataWithGender:_filterString];
[self mew_loadHomeDataWithGender:_filterString];
}
//
- (void)loadFollownModelRefresh {
- (void)mew_loadFollownModelRefresh {
self.page = 1;
[self.presenter getUserAttentionList:self.page pageSize:20 state:0];
[self.presenter mew_getUserAttentionList:self.page pageSize:20 state:0];
}
//
- (void)moreFollownModelRefresh {
- (void)mew_moreFollownModelRefresh {
if (self.hasNoMoreData) {
[self showErrorToast:@"没有更多数据了"];
return;
}
self.page++;
[self.presenter getUserAttentionList:self.page pageSize:20 state:1];
[self.presenter mew_getUserAttentionList:self.page pageSize:20 state:1];
}
#pragma mark - MewHomeProtocol
///
- (void)getUserDetailInfoSuccess:(UserInfoModel *)userInfo {
- (void)mew_getUserDetailInfoSuccess:(UserInfoModel *)userInfo {
NSLog(@"userInfo: %@",userInfo);
// [self.userIntroductionView setCurrentUserModel:userInfo];
}
@@ -151,13 +151,13 @@
}
//
- (void)getUserAttentionSuccess:(BOOL)status {
- (void)mew_getUserAttentionSuccess:(BOOL)status {
[self.userIntroductionView updateAttentionState:status];
}
///
- (void)uploadVoiceFileToThirdSuccess:(NSString *)fileUrl {
- (void)mew_uploadVoiceFileToThirdSuccess:(NSString *)fileUrl {
if (self.voiceString.length == 0 || self.voiceString == nil || [self.voiceString isEqualToString:@""]) {
self.voiceString = @"这个人很懒还没有签名";
@@ -174,19 +174,19 @@
}
///
- (void)uploadVoiceFileFail:(NSString *)message {
- (void)mew_uploadVoiceFileFail:(NSString *)message {
[MewHUDTool showSuccessWithMessage:@"上传音频失败,请重新上传"];
}
- (void)getMewHomeFriendListSuccesss:(NSArray *)array selfMine:(nonnull UserInfoModel *)selfMineModel {
- (void)mew_getMewHomeFriendListSuccesss:(NSArray *)array selfMine:(nonnull UserInfoModel *)selfMineModel {
self.userInfoModels = array;
self.showVoiceView.userInfoArrays = self.userInfoModels;
self.selfMineModel = selfMineModel;
}
///
- (void)getUserAttentionListSuccess:(NSArray *)array state:(int)state {
- (void)mew_getUserAttentionListSuccess:(NSArray *)array state:(int)state {
if (state == 0) {
[self.fansListModels removeAllObjects];
[self.rightFollowVoiceView.followCollectionView.mj_header endRefreshing];
@@ -208,9 +208,9 @@
#pragma mark - MewHeaderViewDelegate
///
/// - Parameter target: 0 - 1- 2-
- (void)didSelectWithMewHeaderViewTarget:(NSInteger)target {
- (void)mew_didSelectWithMewHeaderViewTarget:(NSInteger)target {
if (target == 0) { //
self.filterView = [[YMHomeFilterView alloc] initWithPoint:CGPointMake(24, CGRectGetMaxY(self.headerView.frame) - 15.0) completed:^(NSInteger index) {
self.filterView = [[MewHomeFilterView alloc] initWithPoint:CGPointMake(24, CGRectGetMaxY(self.headerView.frame) - 15.0) completed:^(NSInteger index) {
if (index == 0) {
//
self.filterString = nil;
@@ -227,7 +227,7 @@
} else if (target == 1) { //
//
[self.presenter getMewHomeFriendListWithGender:self.filterString];
[self.presenter mew_getMewHomeFriendListWithGender:self.filterString];
} else { //
MewUserIntroductionView *view = [MewUserIntroductionView showUserIntroductionViewWithType:UserIntroductionView_SelfMine delegate: self];
@@ -240,31 +240,31 @@
#pragma mark - MewShowVoiceViewDelegate ()
///
- (void)didSelectMewShowVoiceViewWithTargetIndex:(NSInteger)index {
[self pushUserInfoView:UserIntroductionView_OtherUser userInfo:self.userInfoModels[index]];
- (void)mew_didSelectMewShowVoiceViewWithTargetIndex:(NSInteger)index {
[self mew_pushUserInfoView:UserIntroductionView_OtherUser userInfo:self.userInfoModels[index]];
}
///
- (void)didSelectPushVoiceClouseEvent {
[self pushVoiceClouseEvent];
- (void)mew_didSelectmew_pushVoiceClouseEvent {
[self mew_pushVoiceClouseEvent];
}
#pragma mark - MewUserIntroductionViewDelegate
/// optionType: 0 - 1 - 2-
- (void)userIntrodctionViewWithUserOption:(NSInteger)optionType {
- (void)mew_userIntrodctionViewWithUserOption:(NSInteger)optionType {
if (optionType == 2) { //
NIMSession *session = [NIMSession session:self.targetUid type:NIMSessionTypeP2P];
MewSessionViewController *vc = [[MewSessionViewController alloc] initWithSession:session];
[self.navigationController pushViewController:vc animated:YES];
} else {
[self.presenter attentionUser:self.targetUid state:optionType == 1];
[self.presenter mew_attentionUser:self.targetUid state:optionType == 1];
}
}
/// selfOptionType: 0 - 1- 2-
- (void)userIntroductionWithSelfOption:(NSInteger)selfOptionType {
- (void)mew_userIntroductionWithSelfOption:(NSInteger)selfOptionType {
if (selfOptionType == 0) {
//
MewRechargeViewController *rechargeController = [[MewRechargeViewController alloc] init];
@@ -289,19 +289,19 @@
[MewHUDTool showLoadingWithMessage:@"正在上传音频中请稍等"];
self.voiceString = voiceIntroString;
self.duration = dura;
[self.presenter uploadVoice:filePath];
[self.presenter mew_uploadVoice:filePath];
}
#pragma mark - MewRightFollowVoiceViewDelegate
- (void)didSelectRightFollowVoiceUser:(UserInfoModel *)userInfo {
[self pushUserInfoView:UserIntroductionView_OtherUser userInfo:userInfo];
- (void)mew_didSelectRightFollowVoiceUser:(UserInfoModel *)userInfo {
[self mew_pushUserInfoView:UserIntroductionView_OtherUser userInfo:userInfo];
}
#pragma mark - Action Event
///
- (void)showRightButtonAction:(UIButton *)sender {
- (void)mew_showRightButtonAction:(UIButton *)sender {
sender.selected = !sender.selected;
//frame
@@ -314,20 +314,20 @@
self.rightFollowVoiceView.hidden = !sender.selected;
if (!self.rightFollowVoiceView.hidden) {
[self updateBounderRect:self.rightFollowVoiceView];
[self mew_updateBounderRect:self.rightFollowVoiceView];
} else {
[self updateBounderRect:self.rightBgVoiceView];
[self mew_updateBounderRect:self.rightBgVoiceView];
}
}
///
- (void)pushVoiceClouseEvent {
- (void)mew_pushVoiceClouseEvent {
self.pushExcelusiveVoiceView = [MewPushExclusiveVoiceView showPushExclusiveVoiceView];
self.pushExcelusiveVoiceView.delegate = self;
}
#pragma mark - Private Method
- (void)pushUserInfoView:(UserIntroductionType)type userInfo:(UserInfoModel *)userInfo {
- (void)mew_pushUserInfoView:(UserIntroductionType)type userInfo:(UserInfoModel *)userInfo {
MewUserIntroductionView *view = [MewUserIntroductionView showUserIntroductionViewWithType:type delegate:self];
self.userIntroductionView = view;
[view setCurrentUserModel:userInfo];
@@ -335,16 +335,16 @@
// if (self.userInfoModels.count > index) {
self.targetUid = [NSString stringWithFormat:@"%ld",userInfo.uid];
//
[self.presenter getUserDetailInfoWithUid:self.targetUid];
[self.presenter mew_getUserDetailInfoWithUid:self.targetUid];
//
[self.presenter getUserAttentionState:self.targetUid];
[self.presenter mew_getUserAttentionState:self.targetUid];
// }
}
#pragma mark - Init
//
- (void)initGuideView {
- (void)mew_initGuideView {
BOOL isShowGuide = [[NSUserDefaults standardUserDefaults] boolForKey:@"mew_home_guide"];
if (isShowGuide) return;
@@ -354,7 +354,7 @@
[self.view addSubview:guideView];
}
- (void)initView {
- (void)mew_initView {
[self.view addSubview:self.containerBgImageView];
[self.view addSubview:self.containerScrollView];
[self.containerScrollView addSubview:self.headerView];
@@ -363,9 +363,9 @@
[self.containerScrollView insertSubview:self.rightBgVoiceView aboveSubview:self.showVoiceView];
[self.rightBgVoiceView addSubview:self.showRightButton];
[self.containerScrollView insertSubview:self.rightFollowVoiceView aboveSubview:self.showVoiceView];
[self initLayoutView];
[self mew_mew_initLayoutView];
}
- (void)initLayoutView {
- (void)mew_mew_initLayoutView {
self.containerBgImageView.frame = self.view.frame;
self.containerScrollView.frame = self.view.frame;
self.headerView.frame = CGRectMake(0, (kStatusBarHeight + 25.0) * kScreenScale, KScreenWidth, self.headerView.height);
@@ -376,11 +376,11 @@
self.showRightButton.frame = CGRectMake((self.rightBgVoiceView.frame.size.width - 24)/2.0, (self.rightBgVoiceView.frame.size.height - 24)/2.0, 24, 24);
self.containerScrollView.contentSize = CGSizeMake(KScreenWidth, CGRectGetMaxY(self.showVoiceView.frame));
[self updateBounderRect:self.rightBgVoiceView];
[self mew_updateBounderRect:self.rightBgVoiceView];
}
- (void)updateBounderRect:(UIView *)view {
- (void)mew_updateBounderRect:(UIView *)view {
if (![view isMemberOfClass:[self.currentLayerView class]]) {
self.currentLayerView.layer.mask = nil;
}
@@ -440,7 +440,7 @@
if (!_showRightButton) {
_showRightButton = [[UIButton alloc] init];
_showRightButton.selected = NO;
[_showRightButton addTarget:self action:@selector(showRightButtonAction:) forControlEvents:UIControlEventTouchUpInside];
[_showRightButton addTarget:self action:@selector(mew_showRightButtonAction:) forControlEvents:UIControlEventTouchUpInside];
[_showRightButton setImage:[UIImage imageNamed:@"mew_home_play_voice_more_left"] forState:UIControlStateNormal];
[_showRightButton setImage:[UIImage imageNamed:@"mew_home_play_voice_more_right"] forState:UIControlStateSelected];
}
@@ -456,12 +456,12 @@
__weak typeof(self) weakSelf = self;
_rightFollowVoiceView.loadFollownRefresh = ^{
//
[weakSelf loadFollownModelRefresh];
[weakSelf mew_loadFollownModelRefresh];
};
_rightFollowVoiceView.moreFollownRefresh = ^{
//
[weakSelf moreFollownModelRefresh];
[weakSelf mew_moreFollownModelRefresh];
};
}

View File

@@ -12,7 +12,7 @@ NS_ASSUME_NONNULL_BEGIN
/// 选中的是哪个事件
/// - Parameter target: 0 - 过滤 1-换一换 2-个人中心 3-移除过滤view
- (void)didSelectWithMewHeaderViewTarget:(NSInteger)target;
- (void)mew_didSelectWithMewHeaderViewTarget:(NSInteger)target;
@end

View File

@@ -39,7 +39,7 @@
self.voiceBgViewHeight = 100;
// (KScreenWidth - 48) * tupiandegao / tupiandewidth;
[self initView];
[self mew_initView];
// self.height = CGRectGetMaxY(self.personCenterButton.frame) + 10.0;
}
return self;
@@ -56,26 +56,26 @@
- (void)filterButtonAction:(UIButton *)sender {
sender.selected = !sender.selected;
if (self.delegate) {
[self.delegate didSelectWithMewHeaderViewTarget:sender.selected ? 0 : 3];
[self.delegate mew_didSelectWithMewHeaderViewTarget:sender.selected ? 0 : 3];
}
}
///
- (void)reviewLoadButtonAction {
if (self.delegate) {
[self.delegate didSelectWithMewHeaderViewTarget:1];
[self.delegate mew_didSelectWithMewHeaderViewTarget:1];
}
}
///
- (void)personCenterButtonAction {
if (self.delegate) {
[self.delegate didSelectWithMewHeaderViewTarget:2];
[self.delegate mew_didSelectWithMewHeaderViewTarget:2];
}
}
#pragma mark - Init
- (void)initView {
- (void)mew_initView {
[self addSubview:self.voiceBgImageView];
[self addSubview:self.filterButton];
[self addSubview:self.personCenterBgImageView];

View File

@@ -0,0 +1,16 @@
//
// MewHomeFilterView.h
// yinmeng-ios
//
// Created by duoban on 2023/12/5.
//
#import <UIKit/UIKit.h>
NS_ASSUME_NONNULL_BEGIN
typedef void(^mew_selectFilterClouseEvent)(NSInteger index);
@interface MewHomeFilterView : UIView
- (instancetype)initWithPoint:(CGPoint)point completed:(mew_selectFilterClouseEvent)completed;
@end
NS_ASSUME_NONNULL_END

View File

@@ -0,0 +1,137 @@
//
// MewHomeFilterView.m
// yinmeng-ios
//
// Created by duoban on 2023/12/5.
//
#import "MewHomeFilterView.h"
/// Third
#import <Masonry/Masonry.h>
/// Tool
#import "YMMacro.h"
#import "MEWThemeColor.h"
@interface MewHomeFilterView()
@property (nonatomic, copy) NSArray *datas;
@property (nonatomic, strong) NSMutableArray<UIView *> *colorViewArrays;
@property (nonatomic, strong) UIView *whiteBgView;
@property (nonatomic, copy) mew_selectFilterClouseEvent finishClouseEvent;
@end
static NSInteger targetIndex = 0;
@implementation MewHomeFilterView
{
CGPoint _point;
}
- (instancetype)initWithPoint:(CGPoint)point completed:(nonnull mew_selectFilterClouseEvent)completed{
self = [super initWithFrame:CGRectZero];
if (self) {
_point = point;
self.frame = CGRectMake(point.x, point.y, 64, 107);
self.backgroundColor = UIColor.clearColor;
self.datas = @[@"全部", @"男声", @"女声"];
[self mew_initView];
self.finishClouseEvent = completed;
}
return self;
}
#pragma mark - Action Event
- (void)mew_didSelectColorViewTapGesutre:(UITapGestureRecognizer *)tap {
NSInteger viewTag = tap.view.tag;
targetIndex = viewTag;
[self removeViewFromSuper];
self.finishClouseEvent(targetIndex);
}
#pragma mark - Private Method
- (void)mew_changeColorViewStyle {
for (UIView *colorView in self.colorViewArrays) {
colorView.backgroundColor = UIColor.clearColor;
}
self.colorViewArrays[targetIndex].backgroundColor = UIColor.blueColor;
}
- (void)removeViewFromSuper {
[self removeFromSuperview];
}
#pragma mark - Init
- (void)mew_initView {
[self addSubview:self.whiteBgView];
[self mew_initWithDataView];
}
- (void)mew_initWithDataView {
CGFloat width = 56;
CGFloat height = 28;
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 ? [MEWThemeColor mewColorWithHexString:@"#DCDDE0"] : UIColor.clearColor;
colorBgView.tag = i;
colorBgView.layer.cornerRadius = 6;
colorBgView.layer.masksToBounds = YES;
UITapGestureRecognizer *tap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(mew_didSelectColorViewTapGesutre:)];
[colorBgView addGestureRecognizer:tap];
[self.whiteBgView addSubview:colorBgView];
[self.colorViewArrays addObject:colorBgView];
[colorBgView mas_makeConstraints:^(MASConstraintMaker *make) {
make.width.mas_equalTo(width);
make.height.mas_equalTo(height);
make.centerX.equalTo(self);
make.top.equalTo(self.whiteBgView).offset((height + margin) * i + 6);
}];
UILabel *titleLabel = [[UILabel alloc] init];
titleLabel.text = self.datas[i];
titleLabel.textColor = [MEWThemeColor mewColorWithHexString:@"#1F1B4F"];
titleLabel.font = kFontMedium(12);
titleLabel.textAlignment = NSTextAlignmentCenter;
[colorBgView addSubview:titleLabel];
[titleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
make.edges.equalTo(colorBgView);
}];
}
}
#pragma mark -
- (void)drawTriangle {
CGContextRef context = UIGraphicsGetCurrentContext();
CGContextBeginPath(context);
CGContextMoveToPoint(context, 10, 0);
CGContextAddLineToPoint(context, 5, 5);
CGContextAddLineToPoint(context, 15, 5);
CGContextClosePath(context);
[UIColor.whiteColor setFill];
[UIColor.whiteColor setStroke];
CGContextDrawPath(context, kCGPathFillStroke);
}
#pragma mark - Get
- (UIView *)whiteBgView {
if (!_whiteBgView) {
_whiteBgView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, self.frame.size.width, self.frame.size.height)];
_whiteBgView.backgroundColor = UIColor.whiteColor;
_whiteBgView.layer.cornerRadius = 8;
_whiteBgView.layer.masksToBounds = YES;
}
return _whiteBgView;
}
- (NSMutableArray *)colorViewArrays {
if (!_colorViewArrays) {
_colorViewArrays = [NSMutableArray array];
}
return _colorViewArrays;
}
@end

View File

@@ -102,12 +102,12 @@
- (instancetype)initWithFrame:(CGRect)frame {
self = [super initWithFrame:frame];
if (self) {
[self initViews];
[self mew_initViews];
}
return self;
}
- (void)initViews {
- (void)mew_initViews {
[self addSubview:self.bgImageView];
[self addSubview:self.discVoiceView];
[self addSubview:self.playVoiceImageView];
@@ -117,11 +117,11 @@
[self addSubview:self.optionVoiceBgView];
[self.optionVoiceBgView addSubview:self.stopVoiceButton];
[self.optionVoiceBgView addSubview:self.renewPlayVoiceButton];
[self initLayout];
[self mew_initLayout];
[self layoutIfNeeded];
}
- (void)initLayout {
- (void)mew_initLayout {
//
CGSize machineSize = [UIImage imageNamed:@"mew_home_voice_machine_stop"].size;
//

View File

@@ -125,8 +125,8 @@ static MewPushExclusiveVoiceView *_exclusiveVoiceView = nil;
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"];
[self initView];
[self initLayout];
[self mew_initView];
[self mew_initLayout];
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(keyboardWillShow:) name:UIKeyboardWillShowNotification object:nil];
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(keyboardWillHide:) name:UIKeyboardWillHideNotification object:nil];
@@ -415,7 +415,7 @@ static MewPushExclusiveVoiceView *_exclusiveVoiceView = nil;
}
#pragma mark - Init View
- (void)initView {
- (void)mew_initView {
[self addSubview:self.whiteBgView];
[self.whiteBgView addSubview:self.titleLabel];
[self.whiteBgView addSubview:self.closeButton];
@@ -438,7 +438,7 @@ static MewPushExclusiveVoiceView *_exclusiveVoiceView = nil;
[self.whiteBgView addSubview:self.pushVoiceButton];
}
- (void)initLayout {
- (void)mew_initLayout {
[self.whiteBgView mas_makeConstraints:^(MASConstraintMaker *make) {
make.center.equalTo(self);
make.width.mas_equalTo(KScreenWidth - 56);

View File

@@ -27,7 +27,7 @@
{
self = [super initWithFrame:frame];
if (self) {
[self initView];
[self mew_initView];
}
return self;
}
@@ -48,14 +48,14 @@
}
#pragma mark - Init View
- (void)initView {
- (void)mew_initView {
[self.contentView addSubview:self.avaterImageView];
[self.contentView addSubview:self.nickNameLabel];
[self.contentView addSubview:self.sexImageView];
[self initLayout];
[self mew_initLayout];
}
- (void)initLayout {
- (void)mew_initLayout {
[self.avaterImageView mas_makeConstraints:^(MASConstraintMaker *make) {
make.top.centerX.equalTo(self.contentView);
make.width.height.mas_equalTo(48);

View File

@@ -12,7 +12,7 @@
NS_ASSUME_NONNULL_BEGIN
@protocol MewRightFollowVoiceViewDelegate <NSObject>
- (void)didSelectRightFollowVoiceUser:(UserInfoModel *)userInfo;
- (void)mew_didSelectRightFollowVoiceUser:(UserInfoModel *)userInfo;
@end
typedef void(^follownRefresh)(void);

View File

@@ -34,8 +34,8 @@
- (instancetype)initWithFrame:(CGRect)frame {
self = [super initWithFrame:frame];
if (self) {
[self initView];
[self initHeaderAndFooterRrfresh];
[self mew_initView];
[self mew_initHeaderAndFooterRrfresh];
}
return self;
}
@@ -63,19 +63,19 @@
- (void)collectionView:(UICollectionView *)collectionView didSelectItemAtIndexPath:(NSIndexPath *)indexPath {
if (self.delegate) {
[self.delegate didSelectRightFollowVoiceUser:self.fansListModel[indexPath.row]];
[self.delegate mew_didSelectRightFollowVoiceUser:self.fansListModel[indexPath.row]];
}
}
#pragma mark - Init View
- (void)initView {
- (void)mew_initView {
[self addSubview:self.followLabel];
[self addSubview:self.followCollectionView];
[self initLayout];
[self mew_initLayout];
}
- (void)initLayout {
- (void)mew_initLayout {
[self.followLabel mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.right.equalTo(self);
make.top.mas_equalTo(20);
@@ -88,32 +88,32 @@
}
#pragma mark -
- (void)initHeaderAndFooterRrfresh {
MJRefreshNormalHeader *header = [MJRefreshNormalHeader headerWithRefreshingTarget:self refreshingAction:@selector(headerRefresh)];
- (void)mew_initHeaderAndFooterRrfresh {
MJRefreshNormalHeader *header = [MJRefreshNormalHeader headerWithRefreshingTarget:self refreshingAction:@selector(mew_headerRefresh)];
header.stateLabel.font = [UIFont systemFontOfSize:10.0];
header.lastUpdatedTimeLabel.font = [UIFont systemFontOfSize:10.0];
header.stateLabel.textColor = [MEWThemeColor mewSecondTextColor];
header.lastUpdatedTimeLabel.textColor = [MEWThemeColor mewSecondTextColor];
self.followCollectionView.mj_header = header;
MJRefreshBackNormalFooter *footer = [MJRefreshBackNormalFooter footerWithRefreshingTarget:self refreshingAction:@selector(footerRefresh)];
MJRefreshBackNormalFooter *footer = [MJRefreshBackNormalFooter footerWithRefreshingTarget:self refreshingAction:@selector(mew_footerRefresh)];
footer.stateLabel.textColor = [MEWThemeColor mewSecondTextColor];
footer.stateLabel.font = [UIFont systemFontOfSize:10.0];
self.followCollectionView.mj_footer = footer;
[self headerRefresh];
[self mew_headerRefresh];
}
#pragma mark - fangfa
- (void)headerRefresh {
- (void)mew_headerRefresh {
if (self.loadFollownRefresh) {
self.loadFollownRefresh();
}
// self.page = 1;
// [self.presenter getUserAttentionList:self.page pageSize:20 state:0];
// [self.presenter mew_getUserAttentionList:self.page pageSize:20 state:0];
}
- (void)footerRefresh {
- (void)mew_footerRefresh {
if (self.moreFollownRefresh) {
self.moreFollownRefresh();
}
@@ -122,7 +122,7 @@
// return;
// }
// self.page++;
// [self.presenter getUserAttentionList:self.page pageSize:20 state:1];
// [self.presenter mew_getUserAttentionList:self.page pageSize:20 state:1];
}

View File

@@ -13,10 +13,10 @@ NS_ASSUME_NONNULL_BEGIN
/// 选中
/// - Parameter target: index
- (void)didSelectMewShowVoiceViewWithTargetIndex:(NSInteger)index;
- (void)mew_didSelectMewShowVoiceViewWithTargetIndex:(NSInteger)index;
/// 发布声音秀
- (void)didSelectPushVoiceClouseEvent;
- (void)mew_didSelectmew_pushVoiceClouseEvent;
@end
@interface MewShowVoiceView : UIView

View File

@@ -10,7 +10,7 @@
#import "MewVoiceDiscView.h"
/// Tool
#import "YMMacro.h"
#import "AudioPlayerManager.h"
#import "MewAudioPlayerManager.h"
#import "MewHUDTool.h"
/// Third
#import <Masonry/Masonry.h>
@@ -46,7 +46,7 @@
if (self) {
self.discViewArrays = [NSMutableArray array];
self.discLabelArrays = [NSMutableArray array];
[self initView];
[self mew_initView];
}
return self;
}
@@ -58,7 +58,7 @@
///
- (void)reloadDataWithNormal {
[[AudioPlayerManager shared] stopAudio];
[[MewAudioPlayerManager shared] mewStopAudio];
[self.playVoiceView updatePlayVoiceViewAnimation:NO];
self.playVoiceView.discVoiceView.avaterUrl = @"";
}
@@ -66,7 +66,7 @@
#pragma mark - Action Event
- (void)userViewTapGesture:(UITapGestureRecognizer *)tap {
if (self.delegate) {
[self.delegate didSelectMewShowVoiceViewWithTargetIndex:tap.view.tag];
[self.delegate mew_didSelectMewShowVoiceViewWithTargetIndex:tap.view.tag];
}
NSLog(@"用户点击");
}
@@ -94,7 +94,7 @@
NSLog(@"移动到播放的唱片中");
self.currentPlayUserModel = self.userInfoArrays[index];
self.playVoiceView.discVoiceView.avaterUrl = self.currentPlayUserModel.avatar;
[[AudioPlayerManager shared] playAudioWithUrlString:self.currentPlayUserModel.userVoice];
[[MewAudioPlayerManager shared] mewPlayAudioWithUrlString:self.currentPlayUserModel.userVoice];
[self.playVoiceView updatePlayVoiceViewAnimation:YES];
}
longTap.view.center = self.location;
@@ -108,25 +108,25 @@
- (void)didSelectMewPlayVoiceViewWithTarget:(NSInteger)target {
if (target == 1) {
//
if (AudioPlayerManager.shared.player == nil) {
[[AudioPlayerManager shared] playAudioWithUrlString:self.currentPlayUserModel.userVoice];
if (MewAudioPlayerManager.shared.mew_player == nil) {
[[MewAudioPlayerManager shared] mewPlayAudioWithUrlString:self.currentPlayUserModel.userVoice];
} else {
[[AudioPlayerManager shared] stopAudio];
[[MewAudioPlayerManager shared] mewStopAudio];
}
} else if (target == 2) {
//
[[AudioPlayerManager shared] playAudioWithUrlString:self.currentPlayUserModel.userVoice];
[[MewAudioPlayerManager shared] mewPlayAudioWithUrlString:self.currentPlayUserModel.userVoice];
} else {
//
if (self.delegate) {
[self.delegate didSelectPushVoiceClouseEvent];
[self.delegate mew_didSelectmew_pushVoiceClouseEvent];
}
}
}
#pragma mark - Init
- (void)initView {
- (void)mew_initView {
UIImage *bgImage = [UIImage imageNamed:@"mew_home_play_voice_bg"];
CGFloat imageHeight = ((KScreenWidth - 28) * bgImage.size.height)/bgImage.size.width;
self.bgImageView.frame = CGRectMake(0, self.frame.origin.y, KScreenWidth - 28, imageHeight);

View File

@@ -19,11 +19,11 @@ typedef enum : NSUInteger {
@optional
/// 好友的操作(关注 || 聊天)
/// - Parameter optionType: 0 - 取消关注 1 - 关注 2-聊天
- (void)userIntrodctionViewWithUserOption:(NSInteger)optionType;
- (void)mew_userIntrodctionViewWithUserOption:(NSInteger)optionType;
/// 本人个人的操作
/// - Parameter selfOptionType: 0 - 钻石充值 1-我的收藏 2-设置
- (void)userIntroductionWithSelfOption:(NSInteger)selfOptionType;
- (void)mew_userIntroductionWithSelfOption:(NSInteger)selfOptionType;
@end
@interface MewUserIntroductionView : UIView

View File

@@ -12,7 +12,7 @@
/// Tool
#import "YMMacro.h"
#import "MEWThemeColor.h"
#import "AudioPlayerManager.h"
#import "MewAudioPlayerManager.h"
/// Third
#import <Masonry/Masonry.h>
@@ -120,7 +120,7 @@ static MewUserIntroductionView *_userIntroductionView = nil;
self.backgroundColor = UIColorMewRGBAlpha(0x000000, 0.4);
UITapGestureRecognizer *tap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(didSelectBgViewTapGesture:)];
[self addGestureRecognizer:tap];
[self initView];
[self mew_initView];
}
return self;
}
@@ -141,7 +141,7 @@ static MewUserIntroductionView *_userIntroductionView = nil;
NSInteger index = sender.selected ? 1 : 0;
if (self.delegate) {
[self.delegate userIntrodctionViewWithUserOption:index];
[self.delegate mew_userIntrodctionViewWithUserOption:index];
}
}
@@ -149,7 +149,7 @@ static MewUserIntroductionView *_userIntroductionView = nil;
- (void)chatFriendActionEvent {
[self removeViewFromSuperView];
if (self.delegate) {
[self.delegate userIntrodctionViewWithUserOption:2];
[self.delegate mew_userIntrodctionViewWithUserOption:2];
}
}
@@ -157,21 +157,21 @@ static MewUserIntroductionView *_userIntroductionView = nil;
- (void)rechageMoneyActionEvent {
[self removeViewFromSuperView];
if (self.delegate) {
[self.delegate userIntroductionWithSelfOption:0];
[self.delegate mew_userIntroductionWithSelfOption:0];
}
}
///
- (void)mineCollectionActionEvent {
[self removeViewFromSuperView];
if (self.delegate) {
[self.delegate userIntroductionWithSelfOption:1];
[self.delegate mew_userIntroductionWithSelfOption:1];
}
}
///
- (void)settingActionEvent {
[self removeViewFromSuperView];
if (self.delegate) {
[self.delegate userIntroductionWithSelfOption:2];
[self.delegate mew_userIntroductionWithSelfOption:2];
}
}
@@ -179,16 +179,16 @@ static MewUserIntroductionView *_userIntroductionView = nil;
sender.selected = !sender.selected;
if (sender.selected) {
//
[[AudioPlayerManager shared] playAudioWithUrlString:self.currentUserInfo.userVoice];
[[MewAudioPlayerManager shared] mewPlayAudioWithUrlString:self.currentUserInfo.userVoice];
} else {
//
[[AudioPlayerManager shared] stopAudio];
[[MewAudioPlayerManager shared] mewStopAudio];
}
}
#pragma mark - Private Method
- (void)removeViewFromSuperView {
[[AudioPlayerManager shared] stopAudio];
[[MewAudioPlayerManager shared] mewStopAudio];
if (!_userIntroductionView) return;
[_userIntroductionView removeFromSuperview];
@@ -213,7 +213,7 @@ static MewUserIntroductionView *_userIntroductionView = nil;
}
#pragma mark - Init View
- (void)initView {
- (void)mew_initView {
[self addSubview:self.whiteBgView];
///
[self addSubview:self.iconBgWhiteView];
@@ -239,10 +239,10 @@ static MewUserIntroductionView *_userIntroductionView = nil;
[self.whiteBgView addSubview:self.mineCollectButton];
[self.whiteBgView addSubview:self.settingButton];
[self initLayout];
[self mew_initLayout];
}
- (void)initLayout {
- (void)mew_initLayout {
[self.whiteBgView mas_makeConstraints:^(MASConstraintMaker *make) {
make.center.equalTo(self);
make.width.mas_equalTo(KScreenWidth - 72);

View File

@@ -28,7 +28,7 @@
self = [super initWithFrame:frame];
if (self) {
self.isUserOnDisc = NO;
[self initView];
[self mew_initView];
}
return self;
}
@@ -92,14 +92,14 @@
}
#pragma mark - Init View
- (void)initView {
- (void)mew_initView {
[self addSubview:self.discImageView];
[self addSubview:self.bgWhiteView];
[self addSubview:self.avaterImageView];
[self initLayout];
[self mew_initLayout];
}
- (void)initLayout {
- (void)mew_initLayout {
[self.discImageView mas_makeConstraints:^(MASConstraintMaker *make) {
make.top.left.width.equalTo(self);
make.height.mas_equalTo(self.mas_width);

View File

@@ -50,7 +50,7 @@ static MewVoiceGuideView *_guideView = nil;
self.backgroundColor = UIColorMewRGBAlpha(0x000000, 0.4);
UITapGestureRecognizer *tap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(viewWithTapGesture:)];
[self addGestureRecognizer:tap];
[self initView];
[self mew_initView];
}
return self;
}
@@ -66,15 +66,15 @@ static MewVoiceGuideView *_guideView = nil;
}
#pragma mark - Init View
- (void)initView {
- (void)mew_initView {
[self addSubview:self.guideHandImageView];
[self addSubview:self.guideBubbleImageView];
[self addSubview:self.guideBgView];
[self addSubview:self.guideTitleLabel];
[self initLayout];
[self mew_initLayout];
}
- (void)initLayout {
- (void)mew_initLayout {
[self.guideHandImageView mas_makeConstraints:^(MASConstraintMaker *make) {
make.bottom.equalTo(self).offset(-226 * kScreenScale);
make.left.equalTo(self).offset(64);

View File

@@ -1,19 +0,0 @@
//
// YMHomeFilterView.h
// mew-ios
//
// Created by 触海 on 2023/11/13.
//
#import <UIKit/UIKit.h>
NS_ASSUME_NONNULL_BEGIN
typedef void(^selectFilterClouseEvent)(NSInteger index);
@interface YMHomeFilterView : UIView
- (instancetype)initWithPoint:(CGPoint)point completed:(selectFilterClouseEvent)completed;
@end
NS_ASSUME_NONNULL_END

View File

@@ -1,136 +0,0 @@
//
// YMHomeFilterView.m
// mew-ios
//
// Created by on 2023/11/13.
//
#import "YMHomeFilterView.h"
/// Third
#import <Masonry/Masonry.h>
/// Tool
#import "YMMacro.h"
#import "MEWThemeColor.h"
@interface YMHomeFilterView()
@property (nonatomic, copy) NSArray *datas;
@property (nonatomic, strong) NSMutableArray<UIView *> *colorViewArrays;
@property (nonatomic, strong) UIView *whiteBgView;
@property (nonatomic, copy) selectFilterClouseEvent finishClouseEvent;
@end
static NSInteger targetIndex = 0;
@implementation YMHomeFilterView {
CGPoint _point;
}
- (instancetype)initWithPoint:(CGPoint)point completed:(nonnull selectFilterClouseEvent)completed{
self = [super initWithFrame:CGRectZero];
if (self) {
_point = point;
self.frame = CGRectMake(point.x, point.y, 64, 107);
self.backgroundColor = UIColor.clearColor;
self.datas = @[@"全部", @"男声", @"女声"];
[self initView];
self.finishClouseEvent = completed;
}
return self;
}
#pragma mark - Action Event
- (void)didSelectColorViewTapGesutre:(UITapGestureRecognizer *)tap {
NSInteger viewTag = tap.view.tag;
targetIndex = viewTag;
[self removeViewFromSuper];
self.finishClouseEvent(targetIndex);
}
#pragma mark - Private Method
- (void)changeColorViewStyle {
for (UIView *colorView in self.colorViewArrays) {
colorView.backgroundColor = UIColor.clearColor;
}
self.colorViewArrays[targetIndex].backgroundColor = UIColor.blueColor;
}
- (void)removeViewFromSuper {
[self removeFromSuperview];
}
#pragma mark - Init
- (void)initView {
[self addSubview:self.whiteBgView];
[self initWithDataView];
}
- (void)initWithDataView {
CGFloat width = 56;
CGFloat height = 28;
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 ? [MEWThemeColor mewColorWithHexString:@"#DCDDE0"] : UIColor.clearColor;
colorBgView.tag = i;
colorBgView.layer.cornerRadius = 6;
colorBgView.layer.masksToBounds = YES;
UITapGestureRecognizer *tap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(didSelectColorViewTapGesutre:)];
[colorBgView addGestureRecognizer:tap];
[self.whiteBgView addSubview:colorBgView];
[self.colorViewArrays addObject:colorBgView];
[colorBgView mas_makeConstraints:^(MASConstraintMaker *make) {
make.width.mas_equalTo(width);
make.height.mas_equalTo(height);
make.centerX.equalTo(self);
make.top.equalTo(self.whiteBgView).offset((height + margin) * i + 6);
}];
UILabel *titleLabel = [[UILabel alloc] init];
titleLabel.text = self.datas[i];
titleLabel.textColor = [MEWThemeColor mewColorWithHexString:@"#1F1B4F"];
titleLabel.font = kFontMedium(12);
titleLabel.textAlignment = NSTextAlignmentCenter;
[colorBgView addSubview:titleLabel];
[titleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
make.edges.equalTo(colorBgView);
}];
}
}
#pragma mark -
- (void)drawTriangle {
CGContextRef context = UIGraphicsGetCurrentContext();
CGContextBeginPath(context);
CGContextMoveToPoint(context, 10, 0);
CGContextAddLineToPoint(context, 5, 5);
CGContextAddLineToPoint(context, 15, 5);
CGContextClosePath(context);
[UIColor.whiteColor setFill];
[UIColor.whiteColor setStroke];
CGContextDrawPath(context, kCGPathFillStroke);
}
#pragma mark - Get
- (UIView *)whiteBgView {
if (!_whiteBgView) {
_whiteBgView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, self.frame.size.width, self.frame.size.height)];
_whiteBgView.backgroundColor = UIColor.whiteColor;
_whiteBgView.layer.cornerRadius = 8;
_whiteBgView.layer.masksToBounds = YES;
}
return _whiteBgView;
}
- (NSMutableArray *)colorViewArrays {
if (!_colorViewArrays) {
_colorViewArrays = [NSMutableArray array];
}
return _colorViewArrays;
}
@end

View File

@@ -37,28 +37,28 @@
@implementation MewLoginNumberViewController
- (BOOL)isHiddenNavBar {
- (BOOL)mew_isHiddenNavBar {
return YES;
}
#pragma mark - Life Cycle
- (void)viewDidLoad {
[super viewDidLoad];
[self initSubView];
[self mew_initSubView];
self.phoneSelect = YES;
}
#pragma mark - MewLoginPhoneViewDelegate
///
- (void)loginWithPhoneSuccess {
[self disMissWithVC];
- (void)mew_loginWithPhoneSuccess {
[self mew_disMissWithVC];
}
#pragma mark - MewLoginPasswordViewDelegate
///
- (void)loginWithPasswordScuccess {
[self disMissWithVC];
- (void)mew_loginWithPasswordScuccess {
[self mew_disMissWithVC];
}
///
- (void)forgetPassword {
@@ -68,26 +68,26 @@
#pragma mark - Action Event
//
- (void)backButtonAction {
- (void)mew_backButtonAction {
[self.navigationController popViewControllerAnimated:NO];
}
//
- (void)phoneButtonAction {
- (void)mew_phoneButtonAction {
if (!self.isPhoneSelect) {
self.phoneSelect = !self.isPhoneSelect;
}
}
//
- (void)passwordButtonAction {
- (void)mew_passwordButtonAction {
if(self.isPhoneSelect) {
self.phoneSelect = !self.isPhoneSelect;
}
}
#pragma mark - Private Method
- (void)disMissWithVC {
- (void)mew_disMissWithVC {
UIViewController *vc = self.presentingViewController;
while (vc.presentingViewController) {
vc = vc.presentingViewController;
@@ -98,7 +98,7 @@
#pragma mark - Init View
- (void)initSubView {
- (void)mew_initSubView {
[self.view addSubview:self.bgImageView];
[self.view addSubview:self.backButton];
[self.view addSubview:self.phoneButton];
@@ -106,10 +106,10 @@
[self.view addSubview:self.lineView];
[self.view addSubview:self.phoneLoginView];
[self.view addSubview:self.passwordLoginView];
[self initSubViewConstraints];
[self mew_initSubViewConstraints];
}
- (void)initSubViewConstraints {
- (void)mew_initSubViewConstraints {
[self.bgImageView mas_makeConstraints:^(MASConstraintMaker *make) {
make.edges.equalTo(self.view);
}];
@@ -178,7 +178,7 @@
if (!_backButton) {
_backButton = [[UIButton alloc] init];
[_backButton setImage:[UIImage imageNamed:@"mew_common_back_white_left"] forState:UIControlStateNormal];
[_backButton addTarget:self action:@selector(backButtonAction) forControlEvents:UIControlEventTouchUpInside];
[_backButton addTarget:self action:@selector(mew_backButtonAction) forControlEvents:UIControlEventTouchUpInside];
}
return _backButton;
}
@@ -189,7 +189,7 @@
[_phoneButton setTitle:@"手机号登录" forState:UIControlStateNormal];
[_phoneButton setTitleColor:UIColor.whiteColor forState:UIControlStateNormal];
_phoneButton.titleLabel.font = kFontSemibold(16);
[_phoneButton addTarget:self action:@selector(phoneButtonAction) forControlEvents:UIControlEventTouchUpInside];
[_phoneButton addTarget:self action:@selector(mew_phoneButtonAction) forControlEvents:UIControlEventTouchUpInside];
}
return _phoneButton;
}
@@ -200,7 +200,7 @@
[_passwordButton setTitle:@"账号登录" forState:UIControlStateNormal];
[_passwordButton setTitleColor:UIColor.whiteColor forState:UIControlStateNormal];
_phoneButton.titleLabel.font = kFontSemibold(16);
[_passwordButton addTarget:self action:@selector(passwordButtonAction) forControlEvents:UIControlEventTouchUpInside];
[_passwordButton addTarget:self action:@selector(mew_passwordButtonAction) forControlEvents:UIControlEventTouchUpInside];
}
return _passwordButton;
}

View File

@@ -83,23 +83,22 @@ typedef NS_ENUM(NSUInteger, XYLoginType) {
#pragma mark - Life Cycle
- (void)viewDidLoad {
[super viewDidLoad];
[self initView];
[self setUpConstraints];
// [self setEvents];
// [self loginAnimation];
[self mew_initView];
[self mew_setUpConstraints];
}
- (void)viewWillAppear:(BOOL)animated {
[super viewWillAppear:animated];
[self setConfigPrivacyAlertView];
}
- (BOOL)isHiddenNavBar {
- (BOOL)mew_isHiddenNavBar {
return YES;
}
#pragma mark - Init View
- (void)initView {
- (void)mew_initView {
[self.view addSubview:self.bgImageView];
[self.view addSubview:self.helloBgImageView];
[self.view addSubview:self.helloTitleLabel];
@@ -120,7 +119,7 @@ typedef NS_ENUM(NSUInteger, XYLoginType) {
}
- (void)setUpConstraints {
- (void)mew_setUpConstraints {
CGFloat kscale = 363.0 / 375.0;
[self.bgImageView mas_makeConstraints:^(MASConstraintMaker *make) {
make.edges.equalTo(self.view);
@@ -211,7 +210,7 @@ typedef NS_ENUM(NSUInteger, XYLoginType) {
}
- (void)setViewHidden {
- (void)mew_setViewHidden {
if (@available(iOS 13.0, *)) {
self.leftLineView.hidden = NO;
@@ -226,39 +225,19 @@ typedef NS_ENUM(NSUInteger, XYLoginType) {
}
}
//- (void)setEvents {
//
// UITapGestureRecognizer *phoneTap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(didClickRecognizer:)];
// [self.appleButtonView addGestureRecognizer:phoneTap];
// UITapGestureRecognizer * appleTap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(didClickRecognizer:)];
// [self.appleButton addGestureRecognizer:appleTap];
//}
- (void)setConfigPrivacyAlertView {
// NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
// NSString *isShow = [defaults objectForKey:kYinyouPrivateKey];
//
// if (!isShow && isShow.length <= 0) {
// UserPrivacyView * alertView = [[UserPrivacyView alloc] init];
// alertView.controller = self;
// TTPopupService * config = [[TTPopupService alloc] init];
// config.shouldDismissOnBackgroundTouch = NO;
// config.contentView = alertView;
// [TTPopup popupWithConfig:config];
// };
}
#pragma mark - LoginProtocol
- (void)loginSuccess {
- (void)mew_loginSuccess {
[self dismissViewControllerAnimated:YES completion:nil];
[self showSuccessToast:@"登录成功"];
}
#pragma mark - Event Response
- (void)loginButtonAction:(UIButton *)sender {
- (void)mew_loginButtonAction:(UIButton *)sender {
if (!self.agreeButton.isSelected) {
[MewHUDTool showErrorWithMessage:@"请勾选协议"];
return;
@@ -268,7 +247,7 @@ typedef NS_ENUM(NSUInteger, XYLoginType) {
[self.navigationController pushViewController:controller animated:NO];
}
///
- (void)agreeButtonAction:(UIButton *)sender {
- (void)mew_agreeButtonAction:(UIButton *)sender {
self.agreeButton.selected = !self.agreeButton.selected;
if (self.agreeButton.isSelected) {
NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
@@ -287,7 +266,7 @@ typedef NS_ENUM(NSUInteger, XYLoginType) {
}
///
- (void)loginWithApple {
- (void)mew_loginWithApple {
if (!self.agreeButton.isSelected) {
[MewHUDTool showErrorWithMessage:@"请勾选协议"];
return;
@@ -366,7 +345,7 @@ typedef NS_ENUM(NSUInteger, XYLoginType) {
[AccountInfoStorage instance].thirdUserInfo = userInfo;
[MewHUDTool showLoadingWithMessage:@"正在登录中"];
[self.presenter thirdLoginWithApple:identityToken unionId:userID];
[self.presenter thirdmew_loginWithApple:identityToken unionId:userID];
// [Api loginWithThirdPart:^(BaseModel * _Nonnull data, NSInteger code, NSString * _Nonnull msg) {
//
//
@@ -442,7 +421,7 @@ typedef NS_ENUM(NSUInteger, XYLoginType) {
// [_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];
[_loginButton addTarget:self action:@selector(mew_loginButtonAction:) forControlEvents:UIControlEventTouchUpInside];
}
return _loginButton;
}
@@ -452,7 +431,7 @@ typedef NS_ENUM(NSUInteger, XYLoginType) {
_agreeButton = [UIButton buttonWithType:UIButtonTypeCustom];
[_agreeButton setImage:[UIImage imageNamed:@"mew_login_agree_normal"] forState:UIControlStateNormal];
[_agreeButton setImage:[UIImage imageNamed:@"mew_login_agree_sel"] forState:UIControlStateSelected];
[_agreeButton addTarget:self action:@selector(agreeButtonAction:) forControlEvents:UIControlEventTouchUpInside];
[_agreeButton addTarget:self action:@selector(mew_agreeButtonAction:) forControlEvents:UIControlEventTouchUpInside];
// _agreeButton.backgroundColor = UIColor.blueColor;
NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
NSString *hadAgree = [defaults objectForKey:kHadAgreePrivacy];
@@ -552,7 +531,7 @@ typedef NS_ENUM(NSUInteger, XYLoginType) {
[_appleButtonView setTitleColor:UIColor.whiteColor forState:UIControlStateNormal];
_appleButtonView.titleLabel.font = kFontRegular(12);
_appleButtonView.imageTitleSpace = 5.0;
[_appleButtonView addTarget:self action:@selector(loginWithApple) forControlEvents:UIControlEventTouchUpInside];
[_appleButtonView addTarget:self action:@selector(mew_loginWithApple) forControlEvents:UIControlEventTouchUpInside];
}
return _appleButtonView;
}

View File

@@ -10,7 +10,7 @@
NS_ASSUME_NONNULL_BEGIN
@protocol MewLoginPasswordViewDelegate <NSObject>
/// 密码登录成功
- (void)loginWithPasswordScuccess;
- (void)mew_loginWithPasswordScuccess;
/// 忘记密码
- (void)forgetPassword;
@end

View File

@@ -44,30 +44,30 @@
- (instancetype)initWithFrame:(CGRect)frame {
self = [super initWithFrame: frame];
if (self) {
[self initSubViews];
[self initSubViewConstraints];
[self mew_initSubViews];
[self mew_initSubViewConstraints];
}
return self;
}
#pragma mark - LoginPasswordProtocol
- (void)phoneAndPasswordLoginSuccess {
- (void)mew_phoneAndPasswordLoginSuccess {
[MewHUDTool showSuccessWithMessage:@"登录成功"];
if (self.delegate) {
[self.delegate loginWithPasswordScuccess];
[self.delegate mew_loginWithPasswordScuccess];
}
}
- (void)phoneAndPasswordLoginFail:(NSString *)error {
- (void)mew_phoneAndPasswordLoginFail:(NSString *)error {
[MewHUDTool showErrorWithMessage:error];
}
#pragma mark - Action Event
///
- (void)nextButtonAction {
- (void)mew_nextButtonAction {
if (self.phoneView.textField.text.length == 0 || [self.phoneView.textField.text isEqualToString:@""]) {
[MewHUDTool showErrorWithMessage:@"请输入账号"];
return;
@@ -83,7 +83,7 @@
}
///
- (void)forgetPasswordButtonAction {
- (void)mew_forgetPasswordButtonAction {
if (self.delegate) {
[self.delegate forgetPassword];
}
@@ -92,7 +92,7 @@
#pragma mark - Init View
- (void)initSubViews {
- (void)mew_initSubViews {
// self.view.backgroundColor = [UIColor whiteColor];
[self addSubview:self.phoneView];
[self addSubview:self.codeView];
@@ -100,7 +100,7 @@
[self addSubview:self.nextButton];
}
- (void)initSubViewConstraints {
- (void)mew_initSubViewConstraints {
CGFloat kscale = 363.0 / 375.0;
[self.phoneView mas_makeConstraints:^(MASConstraintMaker *make) {
make.top.mas_equalTo(self);
@@ -128,7 +128,7 @@
}];
}
- (void)initEvents {
- (void)mew_initEvents {
RAC(self.nextButton, enabled) = [[RACSignal combineLatest:@[self.phoneView.textField.rac_textSignal, self.codeView.textField.rac_textSignal] reduce:^id _Nonnull(NSString *phone, NSString* password){
return @((phone.length > 0) && password.length >= 6);
}] takeUntil:self.rac_willDeallocSignal];
@@ -146,7 +146,7 @@
[_nextButton setTitleColor:UIColor.blackColor forState:UIControlStateNormal];
UIImage *image = [UIImage gradientColorImageFromColors:@[[MEWThemeColor mewColorWithHexString:@"#FF60FD"], [MEWThemeColor mewColorWithHexString:@"#8974FF"],[MEWThemeColor mewColorWithHexString:@"#69EBFF"]] gradientType:GradientTypeLeftToRight imgSize:CGSizeMake(KScreenWidth - 2*36, 52)];
_nextButton.backgroundColor = [UIColor colorWithPatternImage:image];
[_nextButton addTarget:self action:@selector(nextButtonAction) forControlEvents:UIControlEventTouchUpInside];
[_nextButton addTarget:self action:@selector(mew_nextButtonAction) forControlEvents:UIControlEventTouchUpInside];
}
return _nextButton;
}
@@ -160,7 +160,7 @@
[_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];
[_forgetPasswordButton addTarget:self action:@selector(mew_forgetPasswordButtonAction) forControlEvents:UIControlEventTouchUpInside];
}
return _forgetPasswordButton;
}

View File

@@ -9,7 +9,7 @@
NS_ASSUME_NONNULL_BEGIN
@protocol MewLoginPhoneViewDelegate <NSObject>
- (void)loginWithPhoneSuccess;
- (void)mew_loginWithPhoneSuccess;
@end
@interface MewLoginPhoneView : UIView

View File

@@ -51,38 +51,38 @@
- (instancetype)initWithFrame:(CGRect)frame {
self = [super initWithFrame:frame];
if (self) {
[self initSubViews];
[self initSubViewConstraints];
[self initEvents];
[self mew_initSubViews];
[self mew_initSubViewConstraints];
[self mew_initEvents];
}
return self;
}
///
- (void)dealloc {
[self stopCountDown];
[self mew_stopCountDown];
}
#pragma mark - LoginVerifCodeProtocol
///
- (void)phoneSmsCodeSuccess {
- (void)mew_phoneSmsCodeSuccess {
[MewHUDTool showErrorWithMessage:[NSString stringWithFormat:@"验证码已发送\n+86 %@", self.phone]];
///
[self openCountdownWithTime:60];
[self mew_openCountdownWithTime:60];
}
///
- (void)loginWithPhoneSuccess {
- (void)mew_loginWithPhoneSuccess {
[MewHUDTool showSuccessWithMessage:@"登录成功"];
[self stopCountDown];
[self mew_stopCountDown];
if (self.delegate) {
[self.delegate loginWithPhoneSuccess];
[self.delegate mew_loginWithPhoneSuccess];
}
}
///
- (void)bindWithPhoneSuccess {
- (void)mew_bindWithPhoneSuccess {
}
@@ -90,7 +90,7 @@
#pragma mark - Action Event
///
- (void)getSmsCodeButtonAction {
- (void)mew_getSmsCodeButtonAction {
if (self.phone.length < 11 || self.phone == nil) {
[MewHUDTool showErrorWithMessage:@"请输入手机号码"];
return;
@@ -108,13 +108,13 @@
}
///
- (void)confirmButtonAction {
- (void)mew_confirmButtonAction {
[self.present loginWithPhone:self.phone code:self.codeTextField.text];
}
#pragma mark - Private Method
///
- (void)openCountdownWithTime:(int)totalTime {
- (void)mew_openCountdownWithTime:(int)totalTime {
if (time <= 0) {
return;
}
@@ -131,13 +131,13 @@
if(time <= 0){ //
dispatch_source_cancel(self.timer);
dispatch_async(dispatch_get_main_queue(), ^{
[self onCountdownFinish];
[self mew_onCountdownFinish];
});
}else{
time--;
dispatch_async(dispatch_get_main_queue(), ^{
//
[self onCountdownOpen:time];
[self mew_onCountdownOpen:time];
});
}
@@ -146,20 +146,20 @@
}
///
- (void)onCountdownOpen:(int)time {
- (void)mew_onCountdownOpen:(int)time {
self.cutdownLabel.hidden = NO;
self.retryCodeButton.hidden = YES;
self.cutdownLabel.text = [NSString stringWithFormat:@"%d %@", time, @"s"];
}
///
- (void)onCountdownFinish {
- (void)mew_onCountdownFinish {
self.retryCodeButton.hidden = NO;
self.cutdownLabel.hidden = YES;
}
//
- (void)stopCountDown {
- (void)mew_stopCountDown {
if (self.timer != nil) {
dispatch_source_cancel(self.timer);
self.timer = nil;
@@ -167,7 +167,7 @@
}
#pragma mark - Init View
- (void)initSubViews {
- (void)mew_initSubViews {
[self addSubview:self.phoneInputView];
[self addSubview:self.codeView];
// [self.codeView addSubview:self.codeStackView];
@@ -177,7 +177,7 @@
[self addSubview:self.confirmButton];
}
- (void)initSubViewConstraints {
- (void)mew_initSubViewConstraints {
CGFloat kscale = 363.0 / 375.0;
[self.phoneInputView mas_makeConstraints:^(MASConstraintMaker *make) {
make.top.equalTo(self);
@@ -214,7 +214,7 @@
}];
}
- (void)initEvents {
- (void)mew_initEvents {
@weakify(self);
// [self.phoneInputView.textField.rac_textSignal map:^id _Nullable(NSString * _Nullable value) {
@@ -299,7 +299,7 @@
[_retryCodeButton setTitle:@"获取验证码" 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 addTarget:self action:@selector(mew_getSmsCodeButtonAction) forControlEvents:UIControlEventTouchUpInside];
_retryCodeButton.hidden = NO;
}
return _retryCodeButton;
@@ -317,7 +317,7 @@
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];
[_confirmButton addTarget:self action:@selector(mew_confirmButtonAction) forControlEvents:UIControlEventTouchUpInside];
}
return _confirmButton;
}

View File

@@ -13,7 +13,7 @@ NS_ASSUME_NONNULL_BEGIN
@interface MewSessionListTableViewCell : UITableViewCell
@property(nonatomic,strong) NIMRecentSession *session;
- (void)renderWithSession:(NIMRecentSession*)recent;
- (void)mew_renderWithSession:(NIMRecentSession*)recent;
@end

View File

@@ -42,7 +42,7 @@
@implementation MewSessionListTableViewCell
#pragma mark - Public Method
- (void)renderWithSession:(NIMRecentSession *)recent {
- (void)mew_renderWithSession:(NIMRecentSession *)recent {
_session = recent;
NIMUser *user = [[NIMSDK sharedSDK].userManager userInfo:recent.session.sessionId];
self.avatarImageView.imageUrl = (user.userInfo.avatarUrl == nil || user.userInfo.avatarUrl.length == 0) ? [NewEncryptTool MEW_aesDecrypt:@"xdPnNelVD/RTlTKFqgSrESDPcNF6Diqb8sLg+HEvxpvjDdTLom1euQUOAOppjx15"] : user.userInfo.avatarUrl;
@@ -79,8 +79,8 @@
if (self) {
self.backgroundColor = UIColor.whiteColor;
self.selectionStyle = UITableViewCellSelectionStyleNone;
[self initView];
[self initLayout];
[self mew_initView];
[self mew_initLayout];
}
return self;
}
@@ -94,7 +94,7 @@
#pragma mark - Init View
- (void)initView {
- (void)mew_initView {
self.backgroundColor = [UIColor clearColor];
self.contentView.backgroundColor = [UIColor clearColor];
[self.contentView addSubview:self.containerView];
@@ -106,7 +106,7 @@
// [self.containerView addSubview:self.divider];
}
- (void)initLayout {
- (void)mew_initLayout {
[self.containerView mas_makeConstraints:^(MASConstraintMaker *make) {
make.top.mas_equalTo(10);

View File

@@ -43,7 +43,7 @@
[[NIMSDK sharedSDK].loginManager removeDelegate:self];
}
- (BOOL)isHiddenNavBar {
- (BOOL)mew_isHiddenNavBar {
return YES;
}
@@ -54,18 +54,18 @@
[[NIMSDK sharedSDK].loginManager addDelegate:self];
///
[[NIMSDKConfig sharedConfig] setShouldSyncStickTopSessionInfos:YES];
[self initViews];
[self mew_initViews];
}
- (void)viewWillAppear:(BOOL)animated {
[super viewWillAppear: animated];
[self loadSessionData];
[self mew_loadSessionData];
}
#pragma mark - Load Data
///
- (void)loadSessionData {
- (void)mew_loadSessionData {
NSArray<NIMRecentSession *> *allRecentSessions = [[NIMSDK sharedSDK].conversationManager.allRecentSessions mutableCopy];
__block int unreadCount = 0;
NSArray *getList ;
@@ -96,14 +96,14 @@
#pragma mark - NIMLoginManagerDelegate
- (void)onLogin:(NIMLoginStep)step {
if (step == NIMLoginStepSyncOK) {
[self loadSessionData];
[self mew_loadSessionData];
}
}
#pragma mark - NIMConversationManagerDelegate
///
- (void)didLoadAllRecentSessionCompletion {
[self loadSessionData];
[self mew_loadSessionData];
[self.sessionListView reloadData];
}
@@ -187,7 +187,7 @@
- (nonnull UITableViewCell *)tableView:(nonnull UITableView *)tableView cellForRowAtIndexPath:(nonnull NSIndexPath *)indexPath {
MewSessionListTableViewCell * cell = [tableView dequeueReusableCellWithIdentifier:NSStringFromClass([MewSessionListTableViewCell class])];
[cell renderWithSession:self.recentSessions[indexPath.row]];
[cell mew_renderWithSession:self.recentSessions[indexPath.row]];
return cell;
}
@@ -202,7 +202,7 @@
#pragma mark - Action Event
///
- (void)cleanMessageButtonAction {
- (void)mew_cleanMessageButtonAction {
NSInteger count = [NIMSDK sharedSDK].conversationManager.allUnreadCount;
if (count == 0) {
[self showErrorToast:@"暂无未读消息需要清理"];
@@ -259,16 +259,16 @@
}
#pragma mark - Init
- (void)initViews {
- (void)mew_initViews {
[self.view addSubview:self.sessionBgView];
[self.view addSubview:self.headerView];
[self.headerView addSubview:self.titleLabel];
[self.headerView addSubview:self.cleanMessageButton];
[self.view addSubview:self.sessionListView];
[self initLayout];
[self mew_initLayout];
}
- (void)initLayout {
- (void)mew_initLayout {
[self.sessionBgView mas_makeConstraints:^(MASConstraintMaker *make) {
make.edges.equalTo(self.view);
}];
@@ -313,7 +313,7 @@
if (!_cleanMessageButton) {
_cleanMessageButton = [[UIButton alloc] init];
[_cleanMessageButton setBackgroundImage:kImage(@"mew_session_list_clean") forState:UIControlStateNormal];
[_cleanMessageButton addTarget:self action:@selector(cleanMessageButtonAction) forControlEvents:UIControlEventTouchUpInside];
[_cleanMessageButton addTarget:self action:@selector(mew_cleanMessageButtonAction) forControlEvents:UIControlEventTouchUpInside];
}
return _cleanMessageButton;
}

View File

@@ -45,12 +45,12 @@
[super viewDidLoad];
self.view.backgroundColor = UIColor.whiteColor;
self.title = @"我的收藏";
[self initView];
[self initHeaderAndFooterRrfresh];
[self mew_initView];
[self mew_initHeaderAndFooterRrfresh];
}
#pragma mark - Init
- (void)initView {
- (void)mew_initView {
[self.view addSubview:self.collectionTableView];
}
@@ -74,30 +74,30 @@
}
#pragma mark -
- (void)initHeaderAndFooterRrfresh {
MJRefreshNormalHeader *header = [MJRefreshNormalHeader headerWithRefreshingTarget:self refreshingAction:@selector(headerRefresh)];
- (void)mew_initHeaderAndFooterRrfresh {
MJRefreshNormalHeader *header = [MJRefreshNormalHeader headerWithRefreshingTarget:self refreshingAction:@selector(mew_headerRefresh)];
header.stateLabel.font = [UIFont systemFontOfSize:10.0];
header.lastUpdatedTimeLabel.font = [UIFont systemFontOfSize:10.0];
header.stateLabel.textColor = [MEWThemeColor mewSecondTextColor];
header.lastUpdatedTimeLabel.textColor = [MEWThemeColor mewSecondTextColor];
self.collectionTableView.mj_header = header;
MJRefreshBackNormalFooter *footer = [MJRefreshBackNormalFooter footerWithRefreshingTarget:self refreshingAction:@selector(footerRefresh)];
MJRefreshBackNormalFooter *footer = [MJRefreshBackNormalFooter footerWithRefreshingTarget:self refreshingAction:@selector(mew_footerRefresh)];
footer.stateLabel.textColor = [MEWThemeColor mewSecondTextColor];
footer.stateLabel.font = [UIFont systemFontOfSize:10.0];
self.collectionTableView.mj_footer = footer;
[self headerRefresh];
[self mew_headerRefresh];
}
///
- (void)headerRefresh {
- (void)mew_headerRefresh {
self.page = 1;
[self.presenter getCollectRoomList:self.page pageSize:20 state:0 type:@"1"];
}
//
- (void)footerRefresh {
- (void)mew_footerRefresh {
if (self.hasNoMoreData) {
[self showErrorToast:@"没有更多收藏记录了"];
return;
@@ -110,7 +110,7 @@
#pragma mark - YMMineCollectRoomProtocol
//
- (void)onGetCollectRoomListSuccess:(NSArray *)array state:(int)state {
- (void)mew_fonGetCollectRoomListSuccess:(NSArray *)array state:(int)state {
if (state == 0) {
[self.collectionModels removeAllObjects];
[self.collectionTableView.mj_header endRefreshing];
@@ -127,7 +127,7 @@
}
//
- (void)getCollectRoomListFail:(int)state {
- (void)mew_getCollectRoomListFail:(int)state {
if (state == 0) {
[self.collectionTableView.mj_header endRefreshing];
} else {

View File

@@ -12,7 +12,7 @@ NS_ASSUME_NONNULL_BEGIN
@protocol MewRechargeSubViewDelegate <NSObject>
- (void)didSelectMewRechargeChargeProdId:(NSInteger)index;
- (void)mew_didSelectMewRechargeChargeProdId:(NSInteger)index;
- (void)didSelectMewRechargeProtocol;

View File

@@ -43,7 +43,7 @@
- (instancetype)initWithFrame:(CGRect)frame {
self = [super initWithFrame:frame];
if (self) {
[self initView];
[self mew_initView];
}
return self;
}
@@ -51,7 +51,7 @@
#pragma mark - Action Event
- (void)rechargeButtonAction {
- (void)mew_rechargeButtonAction {
//
if (self.selectModel == nil) {
[MewHUDTool showErrorWithMessage:@"请选择充值的钻石"];
@@ -60,11 +60,11 @@
if (self.delegate) {
[self.delegate didSelectMewRechargeChargeProdId:self.index];
[self.delegate mew_didSelectMewRechargeChargeProdId:self.index];
}
}
- (void)didRechargeButtonAction:(UITapGestureRecognizer *)tap {
- (void)mew_didmew_rechargeButtonAction:(UITapGestureRecognizer *)tap {
for (UIView *rechargeView in self.rechargeBgViewArrays) {
rechargeView.layer.borderColor = UIColor.clearColor.CGColor;
rechargeView.layer.borderWidth = 0.0;
@@ -89,11 +89,11 @@
- (void)setRechargeModels:(NSArray<RechargeListModel *> *)rechargeModels {
_rechargeModels = rechargeModels;
[self initRechargeViewWithModels:_rechargeModels];
[self mew_initRechargeViewWithModels:_rechargeModels];
}
#pragma mark - Init
- (void)initView {
- (void)mew_initView {
[self addSubview:self.balanceBgImageView];
[self addSubview:self.balanceStackView];
[self.balanceStackView addArrangedSubview:self.balanceImageView];
@@ -102,10 +102,10 @@
[self addSubview:self.rechargeView];
[self addSubview:self.rechargePrivacyLabel];
[self addSubview:self.rechargeButton];
[self initLayout];
[self mew_initLayout];
}
- (void)initRechargeViewWithModels:(NSArray<RechargeListModel *> *)rechargeModel {
- (void)mew_initRechargeViewWithModels:(NSArray<RechargeListModel *> *)rechargeModel {
CGFloat viewWidth = 144.0;
CGFloat viewHeight = 83;
CGFloat marginX = 23.0;
@@ -120,7 +120,7 @@
rechargeBgView.layer.cornerRadius = 8.0;
rechargeBgView.layer.masksToBounds = YES;
rechargeBgView.tag = i + 100;
UITapGestureRecognizer *tap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(didRechargeButtonAction:)];
UITapGestureRecognizer *tap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(mew_didmew_rechargeButtonAction:)];
[rechargeBgView addGestureRecognizer:tap];
[self.rechargeBgViewArrays addObject:rechargeBgView];
[self.rechargeView addSubview:rechargeBgView];
@@ -162,7 +162,7 @@
}
- (void)initLayout {
- (void)mew_initLayout {
[self.balanceBgImageView mas_makeConstraints:^(MASConstraintMaker *make) {
make.width.mas_equalTo(KScreenWidth - 2*19);
make.height.mas_equalTo(124*kScreenScale);
@@ -301,7 +301,7 @@
[MEWThemeColor mewColorWithHexString:@"#69EBFF"]
] gradientType:GradientTypeLeftToRight imgSize:CGSizeMake(KScreenWidth - 2*40, 48)];
_rechargeButton.backgroundColor = [UIColor colorWithPatternImage:image];
[_rechargeButton addTarget:self action:@selector(rechargeButtonAction) forControlEvents:UIControlEventTouchUpInside];
[_rechargeButton addTarget:self action:@selector(mew_rechargeButtonAction) forControlEvents:UIControlEventTouchUpInside];
}
return _rechargeButton;
}

View File

@@ -34,7 +34,7 @@
@implementation MewRechargeViewController
- (BOOL)isHiddenNavBar {
- (BOOL)mew_isHiddenNavBar {
return YES;
}
@@ -50,15 +50,15 @@
#pragma mark - Life Cycle
- (void)viewDidLoad {
[super viewDidLoad];
[self initView];
[self loadData];
[self mew_initView];
[self mew_loadData];
}
#pragma mark - Load Data
- (void)loadData {
- (void)mew_loadData {
[self.presenter requestRechargeListWithChannel:@"8"];
[self.presenter getUserWalletInfo];
}
@@ -73,7 +73,7 @@
}
- (void)requestIAPRechargeOrderSuccess:(NSString *)orderId chargeProdId:(NSString *)chargeProdId uuid:(nonnull NSString *)uuid{
- (void)mew_requestIAPRechargeOrderSuccess:(NSString *)orderId chargeProdId:(NSString *)chargeProdId uuid:(nonnull NSString *)uuid{
if (orderId.length > 0) {
self.orderId = orderId;
@@ -86,13 +86,13 @@
iap.Mew_ConditionBlock = ^(enum MewStoreConditionResult state, NSDictionary<NSString *,id> * _Nullable result) {
@kStrongify(self);
[self rechargeNewProcessStatus:state];
[self mew_rechargeNewProcessStatus:state];
switch (state) {
case MewStoreConditionResultMewVerifiedServer:
{
NSString *transactionId = result[@"transactionId"];
[self rechargeSuccess:transactionId];
[self mew_rechargeSuccess:transactionId];
}
break;
@@ -120,12 +120,12 @@
}
}
- (void)requestIAPRechargeOrderFail {
- (void)mew_requestIAPRechargeOrderFail {
}
///
- (void)rechargeNewProcessStatus:(MewStoreConditionResult)status {
- (void)mew_rechargeNewProcessStatus:(MewStoreConditionResult)status {
if (status == MewStoreConditionResultMewPay || status == MewStoreConditionResultMewStart || status == MewStoreConditionResultMewVerifiedServer) {
@@ -139,14 +139,14 @@
}
}
///id
- (void)rechargeSuccess:(NSString *)transactionIdentifier {
- (void)mew_rechargeSuccess:(NSString *)transactionIdentifier {
///
[self saveRechageReciptWithTransactionIdentifier:transactionIdentifier];
[self mew_saveRechageReciptWithTransactionIdentifier:transactionIdentifier];
///
[self.presenter checkReceiptWithOrderId:self.orderId transcationId:transactionIdentifier errorToast:YES];
}
///
- (void)checkReceiptSuccess:(NSString *)transcationId {
- (void)mew_checkReceiptSuccess:(NSString *)transcationId {
[MewHUDTool hideHUDInView:kWindow];
if (@available(iOS 15.0, *)) {
MewPaymentAction *iap = [MewPaymentAction shared];
@@ -154,7 +154,7 @@
}];
}
[self deleteRechageReciptWithTransactionIdentifier:transcationId];
[self mew_deleteRechageReciptWithTransactionIdentifier:transcationId];
self.orderId = nil;
///
[MewHUDTool showLoading];
@@ -168,7 +168,7 @@
});
}
///
- (void)checkReceiptFailWithCode:(NSInteger)code transcationId:(NSString *)transcationId{
- (void)mew_checkReceiptFailWithCode:(NSInteger)code transcationId:(NSString *)transcationId{
[MewHUDTool hideHUDInView:kWindow];
if(code == 1444){
if (@available(iOS 15.0, *)) {
@@ -177,11 +177,11 @@
}];
}
[self deleteRechageReciptWithTransactionIdentifier:transcationId];
[self mew_deleteRechageReciptWithTransactionIdentifier:transcationId];
}
}
///
- (void)deleteRechageReciptWithTransactionIdentifier:(NSString *)transactionIdentifier {
- (void)mew_deleteRechageReciptWithTransactionIdentifier:(NSString *)transactionIdentifier {
NSString * uid = [AccountInfoStorage instance].getUid;
BOOL deleteSuccess = [MEWRechargeStorage mewDelegateTranscationId:transactionIdentifier uid:uid];
if (deleteSuccess) {
@@ -189,7 +189,7 @@
}
}
///
- (void)saveRechageReciptWithTransactionIdentifier:(NSString *)transactionIdentifier {
- (void)mew_saveRechageReciptWithTransactionIdentifier:(NSString *)transactionIdentifier {
NSData *receipt = [NSData dataWithContentsOfURL:[[NSBundle mainBundle] appStoreReceiptURL]];
NSString *encodeStr = [receipt base64EncodedStringWithOptions:NSDataBase64EncodingEndLineWithLineFeed];
NSMutableDictionary *dictionary = [NSMutableDictionary dictionary];
@@ -211,7 +211,7 @@
}
}
#pragma mark - MewRechargeSubViewDelegate
- (void)didSelectMewRechargeChargeProdId:(NSInteger )index {
- (void)mew_didSelectMewRechargeChargeProdId:(NSInteger )index {
[MewHUDTool showLoadingInView:kWindow];
NSString *prodId = self.rechageView.rechargeModels[index].chargeProdId;
[self.presenter requestIAPRechargeOrderWithChargeProdId:[NSString stringWithFormat:@"%@",prodId]];
@@ -232,19 +232,19 @@
#pragma mark - Action Event
- (void)backButtonAction {
- (void)mew_backButtonAction {
[self.navigationController popViewControllerAnimated:NO];
}
#pragma mark - Init
- (void)initView {
- (void)mew_initView {
[self.view addSubview:self.rechargeBgImageView];
[self.view addSubview:self.backButton];
[self.view addSubview:self.rechageView];
[self initLayout];
[self mew_initLayout];
}
- (void)initLayout {
- (void)mew_initLayout {
[self.rechargeBgImageView mas_makeConstraints:^(MASConstraintMaker *make) {
make.edges.equalTo(self.view);
}];
@@ -273,7 +273,7 @@
if (!_backButton) {
_backButton = [[UIButton alloc] init];
[_backButton setImage:[UIImage imageNamed:@"mew_common_back_white_left"] forState:UIControlStateNormal];
[_backButton addTarget:self action:@selector(backButtonAction) forControlEvents:UIControlEventTouchUpInside];
[_backButton addTarget:self action:@selector(mew_backButtonAction) forControlEvents:UIControlEventTouchUpInside];
}
return _backButton;
}

View File

@@ -38,8 +38,8 @@
self.layer.cornerRadius = 10.0;
self.layer.masksToBounds = YES;
self.backgroundColor = UIColor.clearColor;
[self initView];
[self initLayout];
[self mew_mew_initView];
[self mew_mew_initLayout];
}
return self;
}
@@ -55,8 +55,8 @@
// self.lookLabel.hidden = !_model.isLook;
}
#pragma mark - InitView
- (void)initView {
#pragma mark - mew_initView
- (void)mew_mew_initView {
[self.contentView addSubview:self.partyBgImageView];
[self.contentView addSubview:self.titleLabel];
[self.contentView addSubview:self.detailLabel];
@@ -65,7 +65,7 @@
[self.contentView addSubview:self.partyBottomLabel];
}
- (void)initLayout {
- (void)mew_mew_initLayout {
[self.partyBgImageView mas_makeConstraints:^(MASConstraintMaker *make) {
make.edges.equalTo(self.contentView);
}];

View File

@@ -18,10 +18,10 @@
#import "MewPartyModel.h"
#import "HomeRecommendRoomModel.h"
/// Presenter
#import "MewPartyPresenter.h"
#import "MewHomeProtocol.h"
#import "YMHomePresenter.h"
#import "YMHomeProtocol.h"
@interface MewPartyViewController ()<UICollectionViewDelegate, UICollectionViewDataSource, MewHomeProtocol>
@interface MewPartyViewController ()<UICollectionViewDelegate, UICollectionViewDataSource, YMHomeProtocol>
@property (nonatomic, strong) UIImageView *contentBgImageView;
//
@@ -45,12 +45,12 @@
@implementation MewPartyViewController
- (BOOL)isHiddenNavBar {
- (BOOL)mew_isHiddenNavBar {
return YES;
}
- (MewPartyPresenter *)createPresenter {
return [[MewPartyPresenter alloc] init];
- (YMHomePresenter *)createPresenter {
return [[YMHomePresenter alloc] init];
}
#pragma mark - Life Cycle
@@ -63,18 +63,19 @@
CGSize imageSize = [UIImage imageNamed:self.collectModels[0].imageName].size;
CGFloat itemHeight = (itemWidth * imageSize.height)/imageSize.width;
self.itemSizes = CGSizeMake(itemWidth, itemHeight);
[self initView];
[self loadData];
[self mew_initView];
[self mew_loadData];
}
#pragma mark - Load Data
- (void)loadData {
[self.presenter mew_partyRecommendRoomList];
- (void)mew_loadData {
[self.presenter homeRecommendRoomList];
}
#pragma mark - MewHomeProtocol
- (void)mew_partyRecommendRoomListSuccess:(NSArray *)list {
#pragma mark - YMHomeProtocol
- (void)mew_homeRecommendRoomListSuccess:(NSArray *)list {
self.homeRecommendModels = list;
[self.partyCollectionView reloadData];
}
@@ -93,27 +94,28 @@
- (void)collectionView:(UICollectionView *)collectionView didSelectItemAtIndexPath:(NSIndexPath *)indexPath {
if (indexPath.row >= self.homeRecommendModels.count) { return; }
NSString *roomId = self.homeRecommendModels[indexPath.row].roomUid;
[MewRoomViewController openRoom:roomId viewController:self];
}
- (void)gotoWithMineCollection:(UITapGestureRecognizer *)tap {
- (void)mew_gotoWithMineCollection:(UITapGestureRecognizer *)tap {
MewMineCollectionViewController *controller = [[MewMineCollectionViewController alloc] init];
[self.navigationController pushViewController:controller animated:NO];
}
#pragma mark - Init
- (void)initView {
- (void)mew_initView {
[self.view addSubview:self.contentBgImageView];
[self.view addSubview:self.partyBgImageView];
[self.view addSubview:self.collectBgImageView];
[self.collectBgImageView addSubview:self.mineCollectImageView];
[self.collectBgImageView addSubview:self.mineCollectLabel];
[self.view addSubview:self.partyCollectionView];
[self initLayout];
[self mew_initLayout];
}
- (void)initLayout {
- (void)mew_initLayout {
[self.contentBgImageView mas_makeConstraints:^(MASConstraintMaker *make) {
make.edges.equalTo(self.view);
}];
@@ -170,7 +172,7 @@
_collectBgImageView = [[UIImageView alloc] init];
_collectBgImageView.image = [UIImage imageNamed:@"mew_party_collection_bg"];
_collectBgImageView.userInteractionEnabled = YES;
UITapGestureRecognizer *tap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(gotoWithMineCollection:)];
UITapGestureRecognizer *tap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(mew_gotoWithMineCollection:)];
[_collectBgImageView addGestureRecognizer:tap];
}
return _collectBgImageView;

View File

@@ -71,7 +71,7 @@
return [[MewRoomPresenter alloc] init];
}
- (BOOL)isHiddenNavBar {
- (BOOL)mew_isHiddenNavBar {
return YES;
}
@@ -79,7 +79,7 @@
#pragma mark - Life Cycle
- (void)viewDidLoad {
[super viewDidLoad];
[self initView];
[self mew_initView];
self.emojiArrays = @[@"mew_room_emoji_deyi",@"mew_room_emoji_happy",@"mew_room_emoji_sex",@"mew_room_emoji_suprise"];
self.playEmojiArrays = [NSMutableArray array];
self.isPlayEmojiAnimation = NO;
@@ -501,7 +501,7 @@
}
#pragma mark - Init
- (void)initView {
- (void)mew_initView {
[self.view addSubview:self.roomBgImageView];
[self.view addSubview:self.roomHeaderView];
[self.view addSubview:self.roomStageView];
@@ -509,10 +509,10 @@
[self.view addSubview:self.roomMessageView];
[self.view insertSubview:self.emojiImageView aboveSubview:self.roomRightView];
[self.view addSubview:self.roomAnimationView];
[self initLayout];
[self mew_initLayout];
}
- (void)initLayout {
- (void)mew_initLayout {
[self.roomBgImageView mas_makeConstraints:^(MASConstraintMaker *make) {
make.edges.equalTo(self.view);
}];

View File

@@ -13,7 +13,7 @@ NS_ASSUME_NONNULL_BEGIN
/// index : 1 - 退出房间 2-举报房间
typedef void(^selectFilterClouse)(NSInteger index);
@interface MewRoomHeaderFilterView : UIView
+ (void)showMewRoomHeadrFilterViewOrigin:(CGPoint)origin selectFilterClouseEvent:(selectFilterClouse)selectFilterClouseEvent;
+ (void)showMewRoomHeadrFilterViewOrigin:(CGPoint)origin mew_selectFilterClouseEvent:(selectFilterClouse)mew_selectFilterClouseEvent;
@end

View File

@@ -29,10 +29,10 @@
static MewRoomHeaderFilterView *_filterView = nil;
#pragma mark - Public Method
+ (void)showMewRoomHeadrFilterViewOrigin:(CGPoint)origin selectFilterClouseEvent:(selectFilterClouse)selectFilterClouseEvent {
+ (void)showMewRoomHeadrFilterViewOrigin:(CGPoint)origin mew_selectFilterClouseEvent:(selectFilterClouse)mew_selectFilterClouseEvent {
if (!_filterView) {
_filterView = [[MewRoomHeaderFilterView alloc] initWithFrame:CGRectMake(origin.x, origin.y, 97, 38)];
_filterView.completed = selectFilterClouseEvent;
_filterView.completed = mew_selectFilterClouseEvent;
} else {
[_filterView removeViewFromSuper];
}
@@ -51,19 +51,19 @@ static MewRoomHeaderFilterView *_filterView = nil;
self.backgroundColor = UIColor.whiteColor;
self.layer.cornerRadius = 6;
self.layer.masksToBounds = YES;
[self initView];
[self mew_initView];
}
return self;
}
- (void)initView {
- (void)mew_initView {
[self addSubview:self.exitButton];
[self addSubview:self.reportButton];
[self addSubview:self.lineView];
[self initLayout];
[self mew_initLayout];
}
- (void)initLayout {
- (void)mew_initLayout {
[self.exitButton mas_makeConstraints:^(MASConstraintMaker *make) {
make.width.height.mas_equalTo(20);
make.left.mas_equalTo(14);
@@ -156,7 +156,7 @@ static MewRoomHeaderFilterView *_filterView = nil;
self = [super init];
if (self) {
_hostDelegate = delegate;
[self initView];
[self mew_initView];
}
return self;
}
@@ -202,7 +202,7 @@ static MewRoomHeaderFilterView *_filterView = nil;
// 退
- (void)filterButtonAction:(UIButton *)sender {
[MewRoomHeaderFilterView showMewRoomHeadrFilterViewOrigin:CGPointMake(KScreenWidth - 97 - 20, CGRectGetMaxY(self.frame)) selectFilterClouseEvent:^(NSInteger index) {
[MewRoomHeaderFilterView showMewRoomHeadrFilterViewOrigin:CGPointMake(KScreenWidth - 97 - 20, CGRectGetMaxY(self.frame)) mew_selectFilterClouseEvent:^(NSInteger index) {
if (self.delegate) {
[self.delegate didSelectMewRoomHeaderViewTarget:index];
}
@@ -210,14 +210,14 @@ static MewRoomHeaderFilterView *_filterView = nil;
}
#pragma mark - Init View
- (void)initView {
- (void)mew_initView {
[self addSubview:self.roomTitleLabel];
[self addSubview:self.roomCollectButton];
[self addSubview:self.filterButton];
[self initLayout];
[self mew_initLayout];
}
- (void)initLayout {
- (void)mew_initLayout {
[self.roomTitleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
make.centerY.equalTo(self);
make.left.mas_equalTo(20);

View File

@@ -31,7 +31,7 @@
- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier {
self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
if (self) {
[self initView];
[self mew_initView];
}
return self;
}
@@ -55,15 +55,15 @@
}
#pragma mark - Init
- (void)initView {
- (void)mew_initView {
self.selectionStyle = UITableViewCellSelectionStyleNone;
self.backgroundColor = [UIColor clearColor];
[self.contentView addSubview:self.bubbleImageView];
[self.contentView addSubview:self.contentLabel];
[self initLayout];
[self mew_initLayout];
}
- (void)initLayout {
- (void)mew_initLayout {
[self.bubbleImageView mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.top.bottom.mas_equalTo(self.contentView);
// make.bottom.mas_equalTo(self.contentView);

View File

@@ -24,7 +24,7 @@
{
self = [super initWithFrame:frame];
if (self) {
[self initView];
[self mew_initView];
}
return self;
}
@@ -53,14 +53,14 @@
}
#pragma mark - Init View
- (void)initView {
- (void)mew_initView {
[self addSubview:self.chatButton];
[self addSubview:self.emojiButton];
[self addSubview:self.giftButton];
[self initLayout];
[self mew_initLayout];
}
- (void)initLayout {
- (void)mew_initLayout {
[self.giftButton mas_makeConstraints:^(MASConstraintMaker *make) {
make.top.centerX.equalTo(self);
make.width.height.mas_equalTo(60);

View File

@@ -65,7 +65,7 @@
///
- (void)getUserInfo {
[Api getUserInfo:[self createHttpCompletion:^(BaseModel * _Nonnull data) {
[[self getView] getUserInfoSuccess:[UserInfoModel mewModelWithDictionary:data.data]];
[[self getView] mew_getUserInfoSuccess:[UserInfoModel mewModelWithDictionary:data.data]];
} fail:^(NSInteger code, NSString * _Nullable msg) {
}] uid:[[AccountInfoStorage instance] getUid]];

View File

@@ -16,7 +16,7 @@ NS_ASSUME_NONNULL_BEGIN
/// 登录成功
- (void)autoLoginSuccess;
/// 获取用户信息成功
- (void)getUserInfoSuccess:(UserInfoModel *)userInfo;
- (void)mew_getUserInfoSuccess:(UserInfoModel *)userInfo;
///获取更新版本信息成功
//- (void)getVersionUpdate:(XPVersionUpdateModel *)versionModel;

View File

@@ -149,7 +149,7 @@ NSString * const kNetworkReachabilityKey = @"kNetworkReachabilityKey";
/// 12
/// ticket
/// BaseMvpPresent1415
- (void)getUserInfoSuccess:(UserInfoModel *)userInfo {
- (void)mew_getUserInfoSuccess:(UserInfoModel *)userInfo {
//
if (!userInfo.isBindPhone && [ClientConfig shareConfig].iosPhoneBind) {
[self pushBindPhoneController];

View File

@@ -77,7 +77,7 @@ NSString * const kCancelAccount = @"cancelAccount";
- (void)viewDidLoad {
[super viewDidLoad];
self.isHiddenNav = NO;
[self initView];
[self mew_initView];
}
- (void)viewWillDisappear:(BOOL)animated {
@@ -90,7 +90,7 @@ NSString * const kCancelAccount = @"cancelAccount";
[self.navigationController setNavigationBarHidden:self.isHiddenNav animated:animated];
}
- (void)initView {
- (void)mew_initView {
if (@available(iOS 11.0, *)) {
self.webview.scrollView.contentInsetAdjustmentBehavior = UIScrollViewContentInsetAdjustmentNever;
}else{

View File

@@ -0,0 +1,46 @@
//
// YMHomePresenter.m
// mew-ios
//
// Created by on 2023/11/19.
//
#import "YMHomePresenter.h"
#import "AccountInfoStorage.h"
#import "HomeRecommendRoomModel.h"
#import "Api+Home.h"
#import "YMHomeProtocol.h"
#import "NSArray+MewSafe.h"
#import "NSObject+MEWExtension.h"
@implementation YMHomePresenter
///
/// @param tabId id
/// @param page
/// @param pageSize
- (void)getRecommendRoomList:(NSString *)tabId page:(int)page pageSize:(int)pageSize state:(BOOL)state {
NSString * uid = [AccountInfoStorage instance].getUid;
NSString * pageStr = [NSString stringWithFormat:@"%d", page];
NSString * pageSizeStr = [NSString stringWithFormat:@"%d", pageSize];
[Api getRecommendListComplection:[self createHttpCompletion:^(BaseModel * _Nonnull data) {
NSArray * array = [HomeRecommendRoomModel mewModelsWithArray:data.data];
[[self getView] getmew_homeRecommendRoomListSuccess:array state:state];
}fail:^(NSInteger code, NSString * _Nullable msg) {
// [[self getView] getHomeRecommendRoomListFail:msg state:state];
}showLoading:NO] uid:uid tabId:tabId pageNum:pageStr pageSize:pageSizeStr];
}
///
- (void)homeRecommendRoomList {
NSString *uid = [AccountInfoStorage instance].getUid;
[Api homeRecommendRoomListComplection:[self createHttpCompletion:^(BaseModel * _Nonnull data) {
NSArray * array = [HomeRecommendRoomModel mewModelsWithArray:data.data];
[[self getView] mew_homeRecommendRoomListSuccess:array];
// [[self getView] getmew_homeRecommendRoomListSuccess:array state:state];
}fail:^(NSInteger code, NSString * _Nullable msg) {
// [[self getView] getHomeRecommendRoomListFail:msg state:state];
}] uid:uid];
}
@end

View File

@@ -0,0 +1,22 @@
//
// YMHomeProtocol.h
// mew-ios
//
// Created by 触海 on 2023/11/19.
//
#import <Foundation/Foundation.h>
NS_ASSUME_NONNULL_BEGIN
@protocol YMHomeProtocol <NSObject>
///首页推荐房间的
- (void)getmew_homeRecommendRoomListSuccess:(NSArray *)list state:(BOOL)state;
///首页推荐房间失败
- (void)getHomeRecommendRoomListFail:(NSString *)message state:(BOOL)state;
/// 请求推荐房间列表完成
- (void)mew_homeRecommendRoomListSuccess:(NSArray *)list;
@end
NS_ASSUME_NONNULL_END

View File

@@ -27,7 +27,7 @@
- (void)phoneSmsCode:(NSString *)phone type:(GetSmsType)type {
NSString * desPhone = [DESEncrypt encryptUseDES:phone key:KeyWithType(KeyType_PasswordEncode)];
[Api phoneSmsCode:[self createHttpCompletion:^(id _Nonnull data) {
[[self getView] phoneSmsCodeSuccess];
[[self getView] mew_phoneSmsCodeSuccess];
}] mobile:desPhone type:[NSString stringWithFormat:@"%lu", (unsigned long)type]];
}

View File

@@ -30,9 +30,9 @@
if (model && model.access_token.length > 0){
[[AccountInfoStorage instance] saveAccountInfo:model];
}
[[self getView] phoneAndPasswordLoginSuccess];
[[self getView] mew_phoneAndPasswordLoginSuccess];
} fail:^(NSInteger code, NSString * _Nullable msg) {
[[self getView] phoneAndPasswordLoginFail:msg];
[[self getView] mew_phoneAndPasswordLoginFail:msg];
} showLoading:YES] phone:desPhone password:desPassword client_secret:@"uyzjdhds" version:@"1" client_id:@"erban-client" grant_type:@"password"];
}
@end

View File

@@ -19,7 +19,7 @@ NS_ASSUME_NONNULL_BEGIN
/// @param type 登录的类型
- (void)thirdLoginWithType:(ThirdLoginType)type;
- (void)thirdLoginWithApple:(NSString *)token unionId:(NSString *)unionId;
- (void)thirdmew_loginWithApple:(NSString *)token unionId:(NSString *)unionId;
@end

View File

@@ -34,12 +34,12 @@
}
- (void)thirdLoginWithApple:(NSString *)token unionId:(NSString *)unionId {
- (void)thirdmew_loginWithApple:(NSString *)token unionId:(NSString *)unionId {
[Api loginWithThirdPart:[self createHttpCompletion:^(BaseModel * _Nonnull data) {
AccountModel *model = [AccountModel mewModelWithDictionary:data.data];
if (model != nil) {
[[AccountInfoStorage instance] saveAccountInfo:model];
[[self getView] loginSuccess];
[[self getView] mew_loginSuccess];
}
} fail:^(NSInteger code, NSString * _Nullable msg) {

View File

@@ -23,7 +23,7 @@
NSString * typeStr = [NSString stringWithFormat:@"%lu", (unsigned long)type];
NSString * desPhone = [DESEncrypt encryptUseDES:phone key:KeyWithType(KeyType_PasswordEncode)];
[Api phoneSmsCode:[self createHttpCompletion:^(BaseModel * _Nonnull data) {
[[self getView] phoneSmsCodeSuccess];
[[self getView] mew_phoneSmsCodeSuccess];
}] mobile:desPhone type:typeStr];
}

View File

@@ -31,7 +31,7 @@
NSString *desPhone = [DESEncrypt encryptUseDES:phone key:KeyWithType(KeyType_PasswordEncode)];
[Api phoneSmsCode:[self createHttpCompletion:^(BaseModel * _Nonnull data) {
[[self getView] phoneSmsCodeSuccess];
[[self getView] mew_phoneSmsCodeSuccess];
}] mobile:desPhone type:[NSString stringWithFormat:@"%lu", (unsigned long)type]];
}
@@ -46,7 +46,7 @@
[[AccountInfoStorage instance] saveAccountInfo:accountModel];
}
[[self getView] loginWithPhoneSuccess];
[[self getView] mew_loginWithPhoneSuccess];
} showLoading:YES] phone:desPhone code:code client_secret:@"uyzjdhds" version:@"1" client_id:@"erban-client" grant_type:@"password"];
}
@@ -58,7 +58,7 @@
NSString *ticket = [[AccountInfoStorage instance] getTicket];
NSString * desPhone = [DESEncrypt encryptUseDES:phone key:KeyWithType(KeyType_PasswordEncode)];
[Api bindMoblieCode:[self createHttpCompletion:^(BaseModel * _Nonnull data) {
[[self getView] bindWithPhoneSuccess];
[[self getView] mew_bindWithPhoneSuccess];
} showLoading:YES] phone:desPhone code:code ticket:ticket];
}

View File

@@ -12,7 +12,7 @@ NS_ASSUME_NONNULL_BEGIN
@protocol LoginForgetPasswordProtocol <NSObject>
///请求手机号的验证码成功
- (void)phoneSmsCodeSuccess;
- (void)mew_phoneSmsCodeSuccess;
///重置密码成功
- (void)resetPasswrodSuccess;

View File

@@ -11,9 +11,9 @@ NS_ASSUME_NONNULL_BEGIN
@protocol LoginPasswordProtocol <NSObject>
///手机号密码登录成功
- (void)phoneAndPasswordLoginSuccess;
- (void)mew_phoneAndPasswordLoginSuccess;
///手机号密码登录失败
- (void)phoneAndPasswordLoginFail:(NSString *)error;
- (void)mew_phoneAndPasswordLoginFail:(NSString *)error;
@end
NS_ASSUME_NONNULL_END

View File

@@ -11,7 +11,7 @@ NS_ASSUME_NONNULL_BEGIN
@protocol LoginProtocol <NSObject>
- (void)loginSuccess;
- (void)mew_loginSuccess;
@end

View File

@@ -11,7 +11,7 @@ NS_ASSUME_NONNULL_BEGIN
@protocol LoginVerifBindPhoneProtocol <NSObject>
///请求手机号的验证码成功
- (void)phoneSmsCodeSuccess;
- (void)mew_phoneSmsCodeSuccess;
///绑定手机号成功
- (void)bindMoblieCodeWithMoblieSuccess;
///验证绑定手机成功

View File

@@ -12,13 +12,13 @@ NS_ASSUME_NONNULL_BEGIN
@protocol LoginVerifCodeProtocol <NSObject>
/// 获取手机验证码成功
- (void)phoneSmsCodeSuccess;
- (void)mew_phoneSmsCodeSuccess;
/// 手机号和验证码登录成功
- (void)loginWithPhoneSuccess;
- (void)mew_loginWithPhoneSuccess;
///绑定手机号成功
- (void)bindWithPhoneSuccess;
- (void)mew_bindWithPhoneSuccess;
@end

View File

@@ -29,14 +29,14 @@
#pragma mark - life cycle
- (instancetype)initWithFrame:(CGRect)frame {
if (self = [super initWithFrame:frame]) {
[self initView];
[self mew_initView];
[self initConstrations];
}
return self;
}
#pragma mark - private method
- (void)initView {
- (void)mew_initView {
self.backgroundColor = [MEWThemeColor mewAppCellBackgroundColor];
[self addSubview:self.stackView];
[self addSubview:self.bottomLineView];

View File

@@ -27,21 +27,21 @@
- (instancetype)initWithFrame:(CGRect)frame {
self = [super initWithFrame:frame];
if (self) {
[self initSubViews];
[self initSubViewConstraints];
[self mew_initSubViews];
[self mew_initSubViewConstraints];
}
return self;
}
#pragma mark - Private Method
- (void)initSubViews {
- (void)mew_initSubViews {
[self addSubview:self.stackView];
[self addSubview:self.lineView];
[self.stackView addArrangedSubview:self.titleLabel];
[self.stackView addArrangedSubview:self.textField];
}
- (void)initSubViewConstraints {
- (void)mew_initSubViewConstraints {
[self.titleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
make.width.mas_equalTo(53);
}];

View File

@@ -30,13 +30,13 @@
- (void)viewDidLoad {
[super viewDidLoad];
[self initViews];
[self setUpConstraints];
[self mew_initViews];
[self mew_setUpConstraints];
[self setConfigs];
}
#pragma mark - Private Method
- (void)initViews {
- (void)mew_initViews {
[self.view addSubview:self.containerView];
[self.containerView addSubview:self.iconImageView];
[self.containerView addSubview:self.titleLabel];
@@ -49,7 +49,7 @@
self.phoneLabel.text = self.userInfo.phone;
}
- (void)setUpConstraints {
- (void)mew_setUpConstraints {
[self.containerView mas_makeConstraints:^(MASConstraintMaker *make) {
make.top.mas_equalTo(49);
make.left.right.bottom.mas_equalTo(0);

View File

@@ -35,7 +35,7 @@
@end
@implementation LoginBindPhoneViewController
- (BOOL)isHiddenNavBar {
- (BOOL)mew_isHiddenNavBar {
return YES;
}
#pragma mark - life cycle
@@ -145,7 +145,7 @@
}
#pragma mark - Event Response
- (void)backButtonAction:(UIButton *)sender {
- (void)mew_backButtonAction:(UIButton *)sender {
///退
[self dismissViewControllerAnimated:NO completion:^{
[self.presenter logout];
@@ -214,7 +214,7 @@
[_backButton setImage:[UIImage imageNamed:@"common_nav_back"] forState:UIControlStateNormal];
[_backButton setImage:[UIImage imageNamed:@"common_nav_back"] forState:UIControlStateSelected];
// [_backButton setEnlargeEdgeWithTop:15 right:15 bottom:15 left:15];
[_backButton addTarget:self action:@selector(backButtonAction:) forControlEvents:UIControlEventTouchUpInside];
[_backButton addTarget:self action:@selector(mew_backButtonAction:) forControlEvents:UIControlEventTouchUpInside];
}
return _backButton;
}

View File

@@ -49,16 +49,16 @@
[[MEWCountDownHelper shareHelper] mewStopCountDown];
}
- (BOOL)isHiddenNavBar {
- (BOOL)mew_isHiddenNavBar {
return YES;
}
#pragma mark - Life Cycle
- (void)viewDidLoad {
[super viewDidLoad];
[self initSubViews];
[self initSubViewConstraints];
[self initEvents];
[self mew_initSubViews];
[self mew_initSubViewConstraints];
[self mew_initEvents];
}
- (void)viewDidDisappear:(BOOL)animated {
@@ -69,7 +69,7 @@
#pragma mark - LoginForgetPasswordProtocol
///
- (void)phoneSmsCodeSuccess {
- (void)mew_phoneSmsCodeSuccess {
self.codeView.authCodeButton.enabled= NO;
[self showSuccessToast:@"验证码发送成功"];
[[MEWCountDownHelper shareHelper] mewOpenCountdownWithTime:60];
@@ -105,13 +105,13 @@
}
//
- (void)backButtonAction {
- (void)mew_backButtonAction {
[self.navigationController popViewControllerAnimated:NO];
}
#pragma mark - Private Method
- (void)initSubViews {
- (void)mew_initSubViews {
// self.titleLabel.text = @"忘记密码";
[MEWCountDownHelper shareHelper].delegate = self;
[self.view addSubview:self.bgImageView];
@@ -125,7 +125,7 @@
[self.stackView addArrangedSubview:self.passwordView];
}
- (void)initSubViewConstraints {
- (void)mew_initSubViewConstraints {
[self.bgImageView mas_makeConstraints:^(MASConstraintMaker *make) {
make.edges.equalTo(self.view);
}];
@@ -183,7 +183,7 @@
}];
}
- (void)initEvents {
- (void)mew_initEvents {
// @weakify(self);
// RAC(self.finishButton, enabled) = [RACSignal combineLatest:@[self.phoneView.textField.rac_textSignal, self.codeView.textField.rac_textSignal, self.passwordView.textField.rac_textSignal] reduce:^id _Nonnull(NSString *phone, NSString *code, NSString *password){
// return @(phone.length == 11 && code.length > 0 && password.length >= 6 && password.length <= 16);
@@ -203,7 +203,7 @@
if (!_backButton) {
_backButton = [[UIButton alloc] init];
[_backButton setImage:[UIImage imageNamed:@"mew_common_back_white_left"] forState:UIControlStateNormal];
[_backButton addTarget:self action:@selector(backButtonAction) forControlEvents:UIControlEventTouchUpInside];
[_backButton addTarget:self action:@selector(mew_backButtonAction) forControlEvents:UIControlEventTouchUpInside];
}
return _backButton;
}

View File

@@ -45,7 +45,7 @@
@implementation LoginFullInfoViewController
- (BOOL)isHiddenNavBar {
- (BOOL)mew_isHiddenNavBar {
return YES;
}
@@ -58,9 +58,9 @@
[super viewDidLoad];
// self.title = @"填写资料";
self.sexString = @"";
[self initSubViews];
[self initSubViewConstraints];
// [self initEvents];
[self mew_initSubViews];
[self mew_initSubViewConstraints];
// [self mew_initEvents];
}
#pragma mark - LoginFullInfoProtocol
@@ -89,7 +89,7 @@
}
///
- (void)nextButtonAction {
- (void)mew_nextButtonAction {
if (self.sexString.length == 0 || [self.sexString isEqualToString:@""]) {
[MewHUDTool showErrorWithMessage:@"请选择性别"];
return;
@@ -149,7 +149,7 @@
#pragma mark - Init View
- (void)initSubViews {
- (void)mew_initSubViews {
[self.view addSubview:self.bgImageView];
[self.view addSubview:self.backButton];
[self.view addSubview:self.titleLabel];
@@ -159,7 +159,7 @@
[self.sexStackView addArrangedSubview:self.maleButton];
[self.sexStackView addArrangedSubview:self.femaleButton];
[self.view addSubview:self.nextButton];
[self initSubViewConstraints];
[self mew_initSubViewConstraints];
if ([self.presenter getThirdUserInfo] && [self.presenter getThirdUserInfo].userName.length > 0) {
self.textField.text = [self.presenter getThirdUserInfo].userName;
} else {
@@ -167,7 +167,7 @@
}
}
- (void)initSubViewConstraints {
- (void)mew_initSubViewConstraints {
[self.bgImageView mas_makeConstraints:^(MASConstraintMaker *make) {
make.edges.equalTo(self.view);
}];
@@ -209,7 +209,7 @@
}];
}
- (void)initEvents {
- (void)mew_initEvents {
@weakify(self);
[[self.textField.rac_textSignal map:^id _Nullable(NSString * _Nullable value) {
if (value.length > 15) {
@@ -225,7 +225,7 @@
}
//
- (void)backButtonAction {
- (void)mew_backButtonAction {
[self dismissViewControllerAnimated:NO completion:nil];
}
@@ -251,7 +251,7 @@
if (!_backButton) {
_backButton = [[UIButton alloc] init];
[_backButton setImage:[UIImage imageNamed:@"common_back_white_left"] forState:UIControlStateNormal];
[_backButton addTarget:self action:@selector(backButtonAction) forControlEvents:UIControlEventTouchUpInside];
[_backButton addTarget:self action:@selector(mew_backButtonAction) forControlEvents:UIControlEventTouchUpInside];
}
return _backButton;
}
@@ -327,7 +327,7 @@
_nextButton.titleLabel.font = [UIFont fontWithName:@"PingFang-SC-Medium" size:18];
UIImage *image = [UIImage gradientColorImageFromColors:@[[MEWThemeColor mewColorWithHexString:@"#FF60FD"], [MEWThemeColor mewColorWithHexString:@"#8974FF"],[MEWThemeColor mewColorWithHexString:@"#69EBFF"]] gradientType:GradientTypeLeftToRight imgSize:CGSizeMake(KScreenWidth - 2*36, 52)];
_nextButton.backgroundColor = [UIColor colorWithPatternImage:image];
[_nextButton addTarget:self action:@selector(nextButtonAction) forControlEvents:UIControlEventTouchUpInside];
[_nextButton addTarget:self action:@selector(mew_nextButtonAction) forControlEvents:UIControlEventTouchUpInside];
}
return _nextButton;
}

View File

@@ -48,7 +48,7 @@
@end
@implementation LoginVerifBindPhoneViewController
- (BOOL)isHiddenNavBar {
- (BOOL)mew_isHiddenNavBar {
return YES;
}
@@ -62,8 +62,8 @@
- (void)viewDidLoad {
[super viewDidLoad];
[self initSubViews];
[self initSubViewConstraints];
[self mew_initSubViews];
[self mew_initSubViewConstraints];
[self setConfigs];
[self setEvents];
}
@@ -74,7 +74,7 @@
}
#pragma mark - Private Method
- (void)initSubViews {
- (void)mew_initSubViews {
[MEWCountDownHelper shareHelper].delegate = self;
[self.view addSubview:self.containerView];
[self.containerView addSubview:self.bgImageView];
@@ -94,7 +94,7 @@
// [self.containerView addSubview:self.tipsLabel];
}
- (void)initSubViewConstraints {
- (void)mew_initSubViewConstraints {
[self.containerView mas_makeConstraints:^(MASConstraintMaker *make) {
make.edges.equalTo(self.view);
}];
@@ -260,12 +260,12 @@
}
//
- (void)backButtonAction {
- (void)mew_backButtonAction {
[self.navigationController popViewControllerAnimated:NO];
}
#pragma mark - LoginVerifBindPhoneProtocol
- (void)phoneSmsCodeSuccess {
- (void)mew_phoneSmsCodeSuccess {
self.authCodeBtn.enabled = NO;
[self showSuccessToast:@"验证码发送成功"];
[[MEWCountDownHelper shareHelper] mewOpenCountdownWithTime:60];
@@ -325,7 +325,7 @@
if (!_backButton) {
_backButton = [[UIButton alloc] init];
[_backButton setImage:[UIImage imageNamed:@"mew_common_back_white_left"] forState:UIControlStateNormal];
[_backButton addTarget:self action:@selector(backButtonAction) forControlEvents:UIControlEventTouchUpInside];
[_backButton addTarget:self action:@selector(mew_backButtonAction) forControlEvents:UIControlEventTouchUpInside];
}
return _backButton;
}

View File

@@ -51,7 +51,7 @@
@end
@implementation MineLoginPasswordViewController
- (BOOL)isHiddenNavBar {
- (BOOL)mew_isHiddenNavBar {
return YES;
}
- (MineLoginPasswordPresenter *)createPresenter {
@@ -61,12 +61,12 @@
- (void)viewDidLoad {
[super viewDidLoad];
self.view.backgroundColor = [MEWThemeColor mewColorWithHexString:@"#14171B"];
[self initSubViews];
[self initSubViewConstraints];
[self mew_initSubViews];
[self mew_initSubViewConstraints];
}
#pragma mark - Private Method
- (void)initSubViews {
- (void)mew_initSubViews {
[self.view addSubview:self.backButton];
[self.view addSubview:self.titleLabel];
[self.view addSubview:self.stackView];
@@ -78,7 +78,7 @@
[self.stackView addArrangedSubview:self.checkPwdView];
}
- (void)initSubViewConstraints {
- (void)mew_initSubViewConstraints {
[self.backButton mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.mas_equalTo(self.view).mas_offset(10);
make.top.mas_equalTo(statusbarHeight);
@@ -174,7 +174,7 @@
//
- (void)backButtonAction {
- (void)mew_backButtonAction {
[self.navigationController popViewControllerAnimated:NO];
}
@@ -284,7 +284,7 @@
if (!_backButton) {
_backButton = [[UIButton alloc] init];
[_backButton setImage:[UIImage imageNamed:@"mew_common_back_white_left"] forState:UIControlStateNormal];
[_backButton addTarget:self action:@selector(backButtonAction) forControlEvents:UIControlEventTouchUpInside];
[_backButton addTarget:self action:@selector(mew_backButtonAction) forControlEvents:UIControlEventTouchUpInside];
}
return _backButton;
}

View File

@@ -0,0 +1,25 @@
//
// CHMessagePresenter.h
// mew-ios
//
// Created by 触海 on 2023/11/16.
//
#import "BaseMvpPresenter.h"
NS_ASSUME_NONNULL_BEGIN
@interface CHMessagePresenter : BaseMvpPresenter
- (void)getChatLimitReceiverUid:(NSString *)receiverUid;
/// 获取用户信息
/// @param uid 用户uid
- (void)getUserInfo:(NSString *)uid;
///是否关注当前用户
- (void)getFansLike:(NSString *)likeUid;
/// 关注用户
/// @param targetUid 目标用户的uid
- (void)mew_attentionUser:(NSString *)targetUid;
@end
NS_ASSUME_NONNULL_END

View File

@@ -0,0 +1,27 @@
//
// CHMessageProtocol.h
// mew-ios
//
// Created by 触海 on 2023/11/16.
//
#import <Foundation/Foundation.h>
@class ChatLimitModel, UserInfoModel;
NS_ASSUME_NONNULL_BEGIN
@protocol CHMessageProtocol <NSObject>
- (void)onGetLimitChat:(ChatLimitModel *)chatLimit;
///获取用户信息成功
- (void)onGetSessionUserInfoSuccess:(UserInfoModel *)userInfo;
///获取用户信息失败
- (void)onGetSessionUserInfoFail;
///获取粉丝喜欢成功
- (void)getFansLikeSuccess:(BOOL)isLike;
///关注成功
- (void)mew_attentionUserSuccess:(NSString *)uid;
@end
NS_ASSUME_NONNULL_END

View File

@@ -37,18 +37,18 @@
- (instancetype)initWithFrame:(CGRect)frame {
self = [super initWithFrame:frame];
if (self) {
[self initSubViews];
[self initSubViewConstraints];
[self mew_initSubViews];
[self mew_initSubViewConstraints];
}
return self;
}
#pragma mark - Private Method
- (void)initSubViews {
- (void)mew_initSubViews {
[self addSubview:self.unSupportLabel];
}
- (void)initSubViewConstraints {
- (void)mew_initSubViewConstraints {
[self.unSupportLabel mas_makeConstraints:^(MASConstraintMaker *make) {
make.edges.equalTo(self).with.insets(UIEdgeInsetsMake(MESSAGE_TEXT_PADDING, MESSAGE_TEXT_PADDING, MESSAGE_TEXT_PADDING, MESSAGE_TEXT_PADDING));
}];

View File

@@ -20,18 +20,18 @@
- (instancetype)initWithFrame:(CGRect)frame {
self = [super initWithFrame:frame];
if (self) {
[self initSubViews];
[self initSubViewConstraints];
[self mew_initSubViews];
[self mew_initSubViewConstraints];
}
return self;
}
#pragma mark - Private Method
- (void)initSubViews {
- (void)mew_initSubViews {
[self.contentView addSubview:self.logoImageView];
}
- (void)initSubViewConstraints {
- (void)mew_initSubViewConstraints {
[self.logoImageView mas_makeConstraints:^(MASConstraintMaker *make) {
make.edges.mas_equalTo(self.contentView);
}];

View File

@@ -37,19 +37,19 @@
if (self) {
[[NIMSDK sharedSDK].mediaManager setNeedProximityMonitor:NO];
[[NIMSDK sharedSDK].mediaManager addDelegate:self];
[self initSubViews];
[self initSubViewConstraints];
[self mew_initSubViews];
[self mew_initSubViewConstraints];
}
return self;
}
#pragma mark - Private Method
- (void)initSubViews {
- (void)mew_initSubViews {
[self addSubview:self.backView];
[self.backView addSubview:self.timeLabel];
[self.backView addSubview:self.audioImageView];
}
- (void)initSubViewConstraints {
- (void)mew_initSubViewConstraints {
[self.backView mas_makeConstraints:^(MASConstraintMaker *make) {
make.edges.mas_equalTo(self).insets(UIEdgeInsetsMake(MESSAGE_PADDING, MESSAGE_PADDING, MESSAGE_PADDING, MESSAGE_PADDING));
make.height.mas_equalTo(30);

View File

@@ -26,8 +26,8 @@
- (instancetype)initWithFrame:(CGRect)frame {
self = [super initWithFrame:frame];
if (self) {
[self initSubViews];
[self initSubViewConstraints];
[self mew_initSubViews];
[self mew_initSubViewConstraints];
}
return self;
}
@@ -65,14 +65,14 @@
}
#pragma mark - Private Method
- (void)initSubViews {
- (void)mew_initSubViews {
[self addSubview:self.backView];
[self.backView addSubview:self.logoImageView];
[self.backView addSubview:self.titleLabel];
[self.backView addSubview:self.timeLabel];
}
- (void)initSubViewConstraints {
- (void)mew_initSubViewConstraints {
[self mas_makeConstraints:^(MASConstraintMaker *make) {
make.size.mas_equalTo(CGSizeMake(250, 200));
}];

View File

@@ -47,8 +47,8 @@
- (void)viewDidLoad {
[super viewDidLoad];
[self initData];
[self initSubViews];
[self initSubViewConstraints];
[self mew_initSubViews];
[self mew_initSubViewConstraints];
}
#pragma mark - Private Method
@@ -67,7 +67,7 @@
self.blackButton.selected = [[NIMSDK sharedSDK].userManager isUserInBlackList:self.userId];
}
- (void)initSubViews {
- (void)mew_initSubViews {
self.title = @"举报";
[self.view addSubview:self.stackView];
@@ -84,7 +84,7 @@
[self.contentStackView addArrangedSubview:self.blackButton];
}
- (void)initSubViewConstraints {
- (void)mew_initSubViewConstraints {
[self.stackView mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.right.mas_equalTo(self.view);
make.top.mas_equalTo(self.view).offset(10);

View File

@@ -235,13 +235,13 @@
- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier {
self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
if (self) {
[self initViews];
[self initLayout];
[self mew_initViews];
[self mew_initLayout];
}
return self;
}
- (void)initViews {
- (void)mew_initViews {
self.backgroundColor = UIColor.clearColor;
[self.contentView addSubview:self.leftAvatar];
[self.contentView addSubview:self.rightAvatar];
@@ -249,7 +249,7 @@
[self.contentView addSubview:self.failButton];
}
- (void)initLayout {
- (void)mew_initLayout {
[self.leftAvatar mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.top.mas_equalTo(self).offset(15);
make.width.height.mas_equalTo(45);

View File

@@ -49,12 +49,12 @@
[Api requestIAPRecharge:[self createHttpCompletion:^(BaseModel * _Nonnull data) {
NSString *orderId = (NSString *)data.data[@"recordId"];
NSString *mew_uuid = (NSString *)data.data[@"appAccountToken"];
[[self getView] requestIAPRechargeOrderSuccess:orderId chargeProdId:chargeProdId uuid:mew_uuid];
[[self getView] mew_requestIAPRechargeOrderSuccess:orderId chargeProdId:chargeProdId uuid:mew_uuid];
} fail:^(NSInteger code, NSString * _Nullable msg) {
if(code != 50000){
[[self getView]showErrorToast:msg];
}
[[self getView] requestIAPRechargeOrderFail];
[[self getView] mew_requestIAPRechargeOrderFail];
}] chargeProdId:chargeProdId uid:uid ticket:ticket deviceInfo:deviceInfo clientIp:clientIp];
}
@@ -65,9 +65,9 @@
NSString * uid = [AccountInfoStorage instance].getUid;
NSString * ticket = [AccountInfoStorage instance].getTicket;
[Api checkReceipt:[self createHttpCompletion:^(BaseModel * _Nonnull data) {
[[self getView] checkReceiptSuccess:transcationId];
[[self getView] mew_checkReceiptSuccess:transcationId];
}fail:^(NSInteger code, NSString * _Nullable msg) {
[[self getView]checkReceiptFailWithCode:code transcationId:transcationId];
[[self getView]mew_checkReceiptFailWithCode:code transcationId:transcationId];
} showLoading:NO errorToast:errorToast] chooseEnv:@"true" chargeRecordId:orderId transcationId:transcationId uid:uid ticket:ticket];
}
@@ -79,7 +79,7 @@
NSString * uid = [AccountInfoStorage instance].getUid;
NSString * ticket = [AccountInfoStorage instance].getTicket;
[Api checkReceipt:[self createHttpCompletion:^(BaseModel * _Nonnull data) {
[[self getView] checkReceiptSuccess:transcationId];
[[self getView] mew_checkReceiptSuccess:transcationId];
} showLoading:YES] receipt:receipt chooseEnv:@"true" chargeRecordId:orderId transcationId:transcationId uid:uid ticket:ticket];
}

View File

@@ -22,9 +22,9 @@
NSString * uid = [AccountInfoStorage instance].getUid;
[Api requestMineCollectRoomList:[self createHttpCompletion:^(BaseModel * _Nonnull data) {
NSArray * array = [MineCollectRoomModel mewModelsWithArray:data.data[@"fansRoomList"]];
[[self getView] onGetCollectRoomListSuccess:array state:state];
[[self getView] mew_fonGetCollectRoomListSuccess:array state:state];
} fail:^(NSInteger code, NSString * _Nullable msg) {
[[self getView] getCollectRoomListFail:state];
[[self getView] mew_getCollectRoomListFail:state];
}] uid:uid page:[NSString stringWithFormat:@"%d", page] pageSize:[NSString stringWithFormat:@"%d", pageSize] roomType:type.length ? type : NULL];
}

View File

@@ -53,7 +53,7 @@
NSString *uid = [[AccountInfoStorage instance] getUid];
[Api getUserInfo:[self createHttpCompletion:^(BaseModel * _Nonnull data) {
UserInfoModel *userInfo = [UserInfoModel mewModelWithDictionary:data.data];
[[self getView] onGetUserInfoSuccess:userInfo];
[[self getView] mew_onGetUserInfoSuccess:userInfo];
}] uid:uid];
}

View File

@@ -17,15 +17,15 @@ NS_ASSUME_NONNULL_BEGIN
///请求充值列表成功
- (void)requestRechargeListSucccess:(NSArray<RechargeListModel *> *)list;
///请求充值id的状态成功
- (void)requestIAPRechargeOrderSuccess:(NSString *)orderId chargeProdId:(NSString *)chargeProdId uuid:(NSString *)uuid;
- (void)mew_requestIAPRechargeOrderSuccess:(NSString *)orderId chargeProdId:(NSString *)chargeProdId uuid:(NSString *)uuid;
///请求充值账单失败
- (void)requestIAPRechargeOrderFail;
- (void)mew_requestIAPRechargeOrderFail;
///二次校验成功
- (void)checkReceiptSuccess:(NSString *)transcationId;
- (void)mew_checkReceiptSuccess:(NSString *)transcationId;
///批量验证凭据成功
- (void)checkTranscationIdsSuccess;
///二次校验失败
- (void)checkReceiptFailWithCode:(NSInteger)code transcationId:(NSString *)transcationId;
- (void)mew_checkReceiptFailWithCode:(NSInteger)code transcationId:(NSString *)transcationId;
@end
NS_ASSUME_NONNULL_END

View File

@@ -11,10 +11,10 @@ NS_ASSUME_NONNULL_BEGIN
@protocol YMMineCollectRoomProtocol <NSObject>
///获取收藏房间列表成功
- (void)onGetCollectRoomListSuccess:(NSArray *)array state:(int)state;
- (void)mew_fonGetCollectRoomListSuccess:(NSArray *)array state:(int)state;
///获取收藏房间列表失败
- (void)getCollectRoomListFail:(int)state;
- (void)mew_getCollectRoomListFail:(int)state;
@end
NS_ASSUME_NONNULL_END

View File

@@ -15,7 +15,7 @@ NS_ASSUME_NONNULL_BEGIN
/// 获取数据成功
- (void)getMineSettingDatasourceSuccess:(NSArray *)array;
///获取用户信息成功
- (void)onGetUserInfoSuccess:(UserInfoModel *)userInfo;
- (void)mew_onGetUserInfoSuccess:(UserInfoModel *)userInfo;
///退出当前账号成功
- (void)logoutCurrentAccountSuccess;

View File

@@ -28,13 +28,13 @@
#pragma mark - Init
- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier {
if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
[self initSubViews];
[self initSubViewConstraints];
[self mew_initSubViews];
[self mew_initSubViewConstraints];
}
return self;
}
- (void)initSubViews {
- (void)mew_initSubViews {
self.backgroundColor = [UIColor clearColor];
self.selectionStyle = UITableViewCellSelectionStyleNone;
[self.contentView addSubview:self.avatarImageView];
@@ -42,7 +42,7 @@
[self.contentView addSubview:self.devideView];
}
- (void)initSubViewConstraints {
- (void)mew_initSubViewConstraints {
[self.avatarImageView mas_makeConstraints:^(MASConstraintMaker *make) {
make.size.mas_equalTo(CGSizeMake(44, 44));
make.left.mas_equalTo(self.contentView).offset(15);

View File

@@ -41,13 +41,13 @@
#pragma mark - Life Cycle
- (void)viewDidLoad {
[super viewDidLoad];
[self initHeaderAndFooterRrfresh];
[self initSubViews];
[self mew_initHeaderAndFooterRrfresh];
[self mew_initSubViews];
}
#pragma mark - YMMineCollectRoomProtocol
///
- (void)onGetCollectRoomListSuccess:(NSArray *)array state:(int)state {
- (void)mew_fonGetCollectRoomListSuccess:(NSArray *)array state:(int)state {
if (state == 0) {
[self.datasource removeAllObjects];
[self.tableView.mj_header endRefreshing];
@@ -64,7 +64,7 @@
}
///
- (void)getCollectRoomListFail:(int)state {
- (void)mew_getCollectRoomListFail:(int)state {
if (state == 0) {
[self.tableView.mj_header endRefreshing];
} else {
@@ -93,42 +93,42 @@
#pragma mark - Private Method
- (void)initSubViews {
- (void)mew_initSubViews {
self.title = @"收藏的房间";
[self.view addSubview:self.tableView];
[self initSubViewConstraints];
[self mew_initSubViewConstraints];
}
- (void)initSubViewConstraints {
- (void)mew_initSubViewConstraints {
[self.tableView mas_makeConstraints:^(MASConstraintMaker *make) {
make.edges.mas_equalTo(self.view);
}];
}
#pragma mark -
- (void)initHeaderAndFooterRrfresh {
MJRefreshNormalHeader *header = [MJRefreshNormalHeader headerWithRefreshingTarget:self refreshingAction:@selector(headerRefresh)];
- (void)mew_initHeaderAndFooterRrfresh {
MJRefreshNormalHeader *header = [MJRefreshNormalHeader headerWithRefreshingTarget:self refreshingAction:@selector(mew_headerRefresh)];
header.stateLabel.font = [UIFont systemFontOfSize:10.0];
header.lastUpdatedTimeLabel.font = [UIFont systemFontOfSize:10.0];
header.stateLabel.textColor = [MEWThemeColor mewSecondTextColor];
header.lastUpdatedTimeLabel.textColor = [MEWThemeColor mewSecondTextColor];
self.tableView.mj_header = header;
MJRefreshBackNormalFooter *footer = [MJRefreshBackNormalFooter footerWithRefreshingTarget:self refreshingAction:@selector(footerRefresh)];
MJRefreshBackNormalFooter *footer = [MJRefreshBackNormalFooter footerWithRefreshingTarget:self refreshingAction:@selector(mew_footerRefresh)];
footer.stateLabel.textColor = [MEWThemeColor mewSecondTextColor];
footer.stateLabel.font = [UIFont systemFontOfSize:10.0];
self.tableView.mj_footer = footer;
[self headerRefresh];
[self mew_headerRefresh];
}
#pragma mark -
- (void)headerRefresh {
- (void)mew_headerRefresh {
self.page = 1;
[self.presenter getCollectRoomList:self.page pageSize:20 state:0 type: @"1"];
}
- (void)footerRefresh {
- (void)mew_footerRefresh {
if (self.hasNoMoreData) {
[self showErrorToast:@"没有更多收藏记录了"];
return;

View File

@@ -26,19 +26,19 @@
self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
if (self) {
self.selectionStyle = UITableViewCellSelectionStyleNone;
[self initView];
[self mew_initView];
}
return self;
}
- (void)initView {
- (void)mew_initView {
[self.contentView addSubview:self.avaterImageView];
[self.contentView addSubview:self.roomTitleLabel];
[self.contentView addSubview:self.lineView];
[self initLayout];
[self mew_initLayout];
}
- (void)initLayout {
- (void)mew_initLayout {
[self.avaterImageView mas_makeConstraints:^(MASConstraintMaker *make) {
make.centerY.equalTo(self.contentView);
make.left.equalTo(self.contentView).offset(20);

View File

@@ -31,14 +31,14 @@
#pragma mark - Init
- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier {
if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
[self initSubViews];
[self initSubViewConstraints];
[self mew_initSubViews];
[self mew_initSubViewConstraints];
}
return self;
}
#pragma mark - Private Method
- (void)initSubViews {
- (void)mew_initSubViews {
self.backgroundColor = UIColor.clearColor;
self.selectionStyle = UITableViewCellSelectionStyleNone;
[self.contentView addSubview:self.stackView];
@@ -48,7 +48,7 @@
[self.stackView addArrangedSubview:self.arrowImageView];
}
- (void)initSubViewConstraints {
- (void)mew_initSubViewConstraints {
[self.stackView mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.right.mas_equalTo(self.contentView).inset(15);
make.top.bottom.mas_equalTo(self.contentView);

View File

@@ -31,7 +31,7 @@
@implementation YMMineAboutUsViewController
- (BOOL)isHiddenNavBar {
- (BOOL)mew_isHiddenNavBar {
return YES;
}
@@ -40,7 +40,7 @@
[super viewDidLoad];
self.title = [NSString stringWithFormat:@"关于%@",@"我们"];
self.view.backgroundColor = [MEWThemeColor mewColorWithHexString:@"#14171B"];
[self initSubViews];
[self mew_initSubViews];
[self makeConstriants];
}
@@ -54,12 +54,12 @@
//
- (void)backButtonAction {
- (void)mew_backButtonAction {
[self.navigationController popViewControllerAnimated:NO];
}
#pragma mark - Init View
- (void)initSubViews {
- (void)mew_initSubViews {
[self.view addSubview:self.backButton];
[self.view addSubview:self.titleLabel];
@@ -180,7 +180,7 @@
if (!_backButton) {
_backButton = [[UIButton alloc] init];
[_backButton setImage:[UIImage imageNamed:@"mew_common_back_white_left"] forState:UIControlStateNormal];
[_backButton addTarget:self action:@selector(backButtonAction) forControlEvents:UIControlEventTouchUpInside];
[_backButton addTarget:self action:@selector(mew_backButtonAction) forControlEvents:UIControlEventTouchUpInside];
}
return _backButton;
}

View File

@@ -44,7 +44,7 @@
@implementation YMMineSettingViewController
- (BOOL)isHiddenNavBar {
- (BOOL)mew_isHiddenNavBar {
return YES;
}
@@ -57,7 +57,7 @@
- (void)viewDidLoad {
[super viewDidLoad];
self.view.backgroundColor = [MEWThemeColor mewColorWithHexString:@"#14171B"];
[self initSubViews];
[self mew_initSubViews];
[self.presenter getMineSettingDataSourceWith:self.userInfo];
}
@@ -75,7 +75,7 @@
}
///
- (void)onGetUserInfoSuccess:(UserInfoModel *)userInfo {
- (void)mew_onGetUserInfoSuccess:(UserInfoModel *)userInfo {
self.userInfo = userInfo;
[self.presenter getMineSettingDataSourceWith:userInfo];
}
@@ -165,24 +165,24 @@
//
- (void)backButtonAction {
- (void)mew_backButtonAction {
[self.navigationController popViewControllerAnimated:NO];
}
#pragma mark - Init View
- (void)initSubViews {
- (void)mew_initSubViews {
// self.title = @"设置";
[self.view addSubview:self.backButton];
[self.view addSubview:self.titleLabel];
[self.view addSubview:self.tableView];
[self.footerView addSubview:self.logoutButton];
self.tableView.tableFooterView = self.footerView;
[self initLayout];
[self mew_initLayout];
}
- (void)initLayout {
- (void)mew_initLayout {
[self.backButton mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.mas_equalTo(self.view).mas_offset(10);
make.top.mas_equalTo(statusbarHeight);
@@ -243,7 +243,7 @@
if (!_backButton) {
_backButton = [[UIButton alloc] init];
[_backButton setImage:[UIImage imageNamed:@"mew_common_back_white_left"] forState:UIControlStateNormal];
[_backButton addTarget:self action:@selector(backButtonAction) forControlEvents:UIControlEventTouchUpInside];
[_backButton addTarget:self action:@selector(mew_backButtonAction) forControlEvents:UIControlEventTouchUpInside];
}
return _backButton;
}

View File

@@ -29,8 +29,8 @@
{
self = [super initWithFrame:frame];
if (self) {
[self initSubViews];
[self initSubViewConstraints];
[self mew_initSubViews];
[self mew_initSubViewConstraints];
}
return self;
}
@@ -42,14 +42,14 @@
}
#pragma mark - Private Method
- (void)initSubViews {
- (void)mew_initSubViews {
self.backgroundColor = [MEWThemeColor mewAppCellBackgroundColor];
[self addSubview:self.contentTextField];
[self addSubview:self.commandButton];
[self addSubview:self.partLineView];
}
- (void)initSubViewConstraints {
- (void)mew_initSubViewConstraints {
[self mas_makeConstraints:^(MASConstraintMaker *make) {
make.height.mas_equalTo(50);
}];

View File

@@ -29,7 +29,7 @@
roomUid:(NSString *)roomUid
msg:(NSString *)msg
uid:(NSString *)uid {
NSString *getUrl = [NewEncryptTool MEW_aesDecrypt:@"gIV0xamx+afcRMN4yGb5jw=="];///gift/sendV4
NSString *getUrl = [NewEncryptTool MEW_aesDecrypt:@"gIV0xamx+afcRMN4yGb5jw=="];//gift/sendV4
NSString *method = getUrl;
[self makeRequest:method method:HttpRequestHelperMethodPOST completion:complection, __FUNCTION__, targetUids, giftNum, sendType, giftId, giftSource, giftType, roomUid, msg, uid, nil];
}

View File

@@ -69,19 +69,19 @@
if (self) {
[[NIMSDK sharedSDK].broadcastManager addDelegate:self];
self.delegate = delegate;
[self initSubViews];
[self initSubViewConstraints];
[self mew_initSubViews];
[self mew_initSubViewConstraints];
}
return self;
}
#pragma mark - Private Method
- (void)initSubViews {
- (void)mew_initSubViews {
[self addSubview:self.lowLevelView];
}
- (void)initSubViewConstraints {
- (void)mew_initSubViewConstraints {
[self.lowLevelView mas_makeConstraints:^(MASConstraintMaker *make) {
make.edges.mas_equalTo(self);
}];

View File

@@ -50,8 +50,8 @@
if (self) {
self.delegate = delegate;
[self addNotification];
[self initSubViews];
[self initSubViewConstraints];
[self mew_initSubViews];
[self mew_initSubViewConstraints];
[IQKeyboardManager sharedManager].enable = NO;
}
return self;
@@ -186,14 +186,14 @@
}
#pragma mark - Private Method
- (void)initSubViews {
- (void)mew_initSubViews {
self.backgroundColor = [MEWThemeColor mewAppBackgroundColor];
[self addSubview:self.stackView];
[self.stackView addArrangedSubview:self.editTextFiled];
[self.stackView addArrangedSubview:self.sendButton];
}
- (void)initSubViewConstraints {
- (void)mew_initSubViewConstraints {
[self.stackView mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.mas_equalTo(self).offset(8);
make.right.mas_equalTo(self).offset(-5);

View File

@@ -51,8 +51,8 @@
self = [super init];
if (self) {
self.hostDelegate = delegate;
[self initSubViews];
[self initSubViewConstraints];
[self mew_initSubViews];
[self mew_initSubViewConstraints];
}
return self;
}
@@ -228,13 +228,13 @@
#pragma mark - Init View
- (void)initSubViews {
- (void)mew_initSubViews {
[self addSubview:self.messageTableView];
self.messageTableView.tableHeaderView = self.headerView;
}
- (void)initSubViewConstraints {
- (void)mew_initSubViewConstraints {
[self.messageTableView mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.mas_equalTo(self).offset(15);
make.bottom.right.top.equalTo(self);

View File

@@ -26,18 +26,18 @@
{
self = [super initWithFrame:frame];
if (self) {
[self initSubViews];
[self initSubViewConstraints];
[self mew_initSubViews];
[self mew_initSubViewConstraints];
}
return self;
}
#pragma mark - Private Method
- (void)initSubViews {
- (void)mew_initSubViews {
[self addSubview:self.bubbleBgView];
[self addSubview:self.titleTextLabel];
}
- (void)initSubViewConstraints {
- (void)mew_initSubViewConstraints {
/// 绿
NSString *title = @"平台严禁未成年人直播或打赏,倡导绿色互动,禁止宣传及发布政治、低俗、暴力、色情等违规违法内容,严禁违规交易和诱导欺诈用户,如有发现请及时举报。";
self.titleTextLabel.text = title;

Some files were not shown because too many files have changed in this diff Show More