From 43bf0ec5c14b977886c29797b165f3aabb61cfce Mon Sep 17 00:00:00 2001 From: linyudan <1031378945@qq.com> Date: Thu, 23 Nov 2023 19:16:55 -0800 Subject: [PATCH] =?UTF-8?q?=E5=9F=9F=E5=90=8D=E6=9B=B4=E6=94=B9=E5=92=8C?= =?UTF-8?q?=E5=8A=A0=E5=AF=86=EF=BC=8C=E4=BF=AE=E6=94=B9=E5=A3=B0=E9=9F=B3?= =?UTF-8?q?=E7=A7=80=E7=9A=84=E5=A3=B0=E9=9F=B3=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- yinmeng-ios/yinmeng-ios/Base/Net/ApiHost.h | 9 +++- .../yinmeng-ios/Base/Net/HttpRequestHelper.m | 3 +- .../Main/Mew/Home/Api/Api+MewHome.m | 2 +- .../Mew/Home/Presenter/MewHomePresenter.m | 2 +- .../Mew/Home/View/MewHomeViewController.m | 42 ++++++++++++------- .../View/SubView/MewRightFollowVoiceView.h | 1 + .../View/SubView/MewRightFollowVoiceView.m | 6 +-- .../View/RoomStageView/MewSocialStageView.m | 14 +++++-- .../RoomMicroView/MewSocialMicroView.m | 2 +- .../Room/View/StageView/MicroView/MicroView.m | 6 +-- .../YinMeng/Room/View/StageView/StageView.m | 13 ++++-- 11 files changed, 65 insertions(+), 35 deletions(-) diff --git a/yinmeng-ios/yinmeng-ios/Base/Net/ApiHost.h b/yinmeng-ios/yinmeng-ios/Base/Net/ApiHost.h index e032737..eead9c7 100644 --- a/yinmeng-ios/yinmeng-ios/Base/Net/ApiHost.h +++ b/yinmeng-ios/yinmeng-ios/Base/Net/ApiHost.h @@ -10,10 +10,15 @@ #ifdef DEBUG #define API_HOST_H5_URL @"http://beta.h5.nnbc123.cn" -#define API_HOST_URL @"http://beta.api.nnbc123.cn" + +/// http://beta.api.ymlive.fun +#define API_HOST_URL @"699gQF4rRYIwztF2zlUunGDlDP2GdDcO5MWptrXUmgU=" + #else #define API_HOST_H5_URL @"https://h5.nnbc123.cn" -#define API_HOST_URL @"https://api.nnbc123.cn" + +/// https://api.ymlive.fun +#define API_HOST_URL @"Lk4rBT4xOjIVF9nPfBvRvyW9xx/sjOb0YbkCThRndxU=" #endif diff --git a/yinmeng-ios/yinmeng-ios/Base/Net/HttpRequestHelper.m b/yinmeng-ios/yinmeng-ios/Base/Net/HttpRequestHelper.m index 9df929b..de45d1b 100644 --- a/yinmeng-ios/yinmeng-ios/Base/Net/HttpRequestHelper.m +++ b/yinmeng-ios/yinmeng-ios/Base/Net/HttpRequestHelper.m @@ -14,6 +14,7 @@ #import "YYUtility.h" #import "YYReachability.h" +#import "NewEncryptTool.h" @implementation HttpRequestHelper @@ -24,7 +25,7 @@ static BOOL isShowing = NO; static AFHTTPSessionManager *manager = nil; static dispatch_once_t onceToken; dispatch_once(&onceToken, ^{ - manager = [[AFHTTPSessionManager manager]initWithBaseURL:[NSURL URLWithString:API_HOST_URL]]; + manager = [[AFHTTPSessionManager manager]initWithBaseURL:[NSURL URLWithString:[NewEncryptTool MEW_aesDecrypt: API_HOST_URL]]]; manager.responseSerializer = [AFJSONResponseSerializer serializer]; manager.requestSerializer.HTTPShouldHandleCookies = YES; // 客户端是否信任非法证书 diff --git a/yinmeng-ios/yinmeng-ios/Main/Mew/Home/Api/Api+MewHome.m b/yinmeng-ios/yinmeng-ios/Main/Mew/Home/Api/Api+MewHome.m index 9719b14..c5b1eef 100644 --- a/yinmeng-ios/yinmeng-ios/Main/Mew/Home/Api/Api+MewHome.m +++ b/yinmeng-ios/yinmeng-ios/Main/Mew/Home/Api/Api+MewHome.m @@ -33,7 +33,7 @@ /// 音萌商店包的上传声音秀 + (void)mewPublishVoiceShow:(HttpRequestHelperCompletion)completion dura:(NSString *)dura desc:(NSString *)desc gender:(NSString *)gender url:(NSString *)url { - [self makeRequest:@"voiceShow/publish" method:HttpRequestHelperMethodGET completion:completion, __FUNCTION__, dura, desc, gender, url, nil]; + [self makeRequest:@"voiceShow/publish" method:HttpRequestHelperMethodPOST completion:completion, __FUNCTION__, dura, desc, gender, url, nil]; } @end diff --git a/yinmeng-ios/yinmeng-ios/Main/Mew/Home/Presenter/MewHomePresenter.m b/yinmeng-ios/yinmeng-ios/Main/Mew/Home/Presenter/MewHomePresenter.m index 59c851b..3b421fc 100644 --- a/yinmeng-ios/yinmeng-ios/Main/Mew/Home/Presenter/MewHomePresenter.m +++ b/yinmeng-ios/yinmeng-ios/Main/Mew/Home/Presenter/MewHomePresenter.m @@ -124,7 +124,7 @@ NSString * pageStr = [NSString stringWithFormat:@"%d", page]; NSString * pageSizeStr = [NSString stringWithFormat:@"%d", pageSize]; [Api getattentionListCompletion:[self createHttpCompletion:^(BaseModel * _Nonnull data) { - NSArray * array = [FansInfoModel modelsWithArray:data.data]; + NSArray * array = [UserInfoModel modelsWithArray:data.data]; [[self getView] getUserAttentionListSuccess:array state:state]; }fail:^(NSInteger code, NSString * _Nullable msg) { // [[self getView] getUserAttentionListFail:state]; diff --git a/yinmeng-ios/yinmeng-ios/Main/Mew/Home/View/MewHomeViewController.m b/yinmeng-ios/yinmeng-ios/Main/Mew/Home/View/MewHomeViewController.m index 6e16a18..c064adc 100644 --- a/yinmeng-ios/yinmeng-ios/Main/Mew/Home/View/MewHomeViewController.m +++ b/yinmeng-ios/yinmeng-ios/Main/Mew/Home/View/MewHomeViewController.m @@ -29,11 +29,12 @@ #import "MewHomeProtocol.h" /// Model #import "FansInfoModel.h" +#import "UserInfoModel.h" #import #import -@interface MewHomeViewController () +@interface MewHomeViewController () /// 引导页 @property (nonatomic, strong) MewVoiceGuideView *guideView; @@ -75,7 +76,7 @@ @property (nonatomic,assign) int page; ///更多数据 @property (nonatomic,assign) BOOL hasNoMoreData; -@property (nonatomic, strong) NSMutableArray *fansListModels; +@property (nonatomic, strong) NSMutableArray *fansListModels; @end @@ -232,17 +233,7 @@ #pragma mark - MewShowVoiceViewDelegate (中部用户信息回调) /// 点击 - (void)didSelectMewShowVoiceViewWithTargetIndex:(NSInteger)index { - MewUserIntroductionView *view = [MewUserIntroductionView showUserIntroductionViewWithType:UserIntroductionView_OtherUser delegate:self]; - self.userIntroductionView = view; - [view setCurrentUserModel:self.userInfoModels[index]]; - [self.view addSubview:view]; - if (self.userInfoModels.count > index) { - self.targetUid = [NSString stringWithFormat:@"%ld",self.userInfoModels[index].uid]; - // 获取当前用户的详细信息 - [self.presenter getUserDetailInfoWithUid:self.targetUid]; - // 获取与当前用户的关注状态 - [self.presenter getUserAttentionState:self.targetUid]; - } + [self pushUserInfoView:UserIntroductionView_OtherUser userInfo:self.userInfoModels[index]]; } /// 发布声音秀 @@ -294,6 +285,10 @@ } +#pragma mark - MewRightFollowVoiceViewDelegate +- (void)didSelectRightFollowVoiceUser:(UserInfoModel *)userInfo { + [self pushUserInfoView:UserIntroductionView_OtherUser userInfo:userInfo]; +} #pragma mark - Action Event @@ -323,6 +318,21 @@ self.pushExcelusiveVoiceView.delegate = self; } +#pragma mark - Private Method +- (void)pushUserInfoView:(UserIntroductionType)type userInfo:(UserInfoModel *)userInfo { + MewUserIntroductionView *view = [MewUserIntroductionView showUserIntroductionViewWithType:type delegate:self]; + self.userIntroductionView = view; + [view setCurrentUserModel:userInfo]; + [self.view addSubview:view]; +// if (self.userInfoModels.count > index) { + self.targetUid = [NSString stringWithFormat:@"%ld",userInfo.uid]; + // 获取当前用户的详细信息 + [self.presenter getUserDetailInfoWithUid:self.targetUid]; + // 获取与当前用户的关注状态 + [self.presenter getUserAttentionState:self.targetUid]; +// } +} + #pragma mark - Init // 引导页 @@ -434,14 +444,16 @@ _rightFollowVoiceView = [[MewRightFollowVoiceView alloc] init]; _rightFollowVoiceView.backgroundColor = [ThemeColor colorWithHexString:@"#050505"]; _rightFollowVoiceView.hidden = YES; + _rightFollowVoiceView.delegate = self; + __weak typeof(self) weakSelf = self; _rightFollowVoiceView.loadFollownRefresh = ^{ //刷新 - [self loadFollownModelRefresh]; + [weakSelf loadFollownModelRefresh]; }; _rightFollowVoiceView.moreFollownRefresh = ^{ //加载更多 - [self moreFollownModelRefresh]; + [weakSelf moreFollownModelRefresh]; }; } diff --git a/yinmeng-ios/yinmeng-ios/Main/Mew/Home/View/SubView/MewRightFollowVoiceView.h b/yinmeng-ios/yinmeng-ios/Main/Mew/Home/View/SubView/MewRightFollowVoiceView.h index 488b0a8..a61a492 100644 --- a/yinmeng-ios/yinmeng-ios/Main/Mew/Home/View/SubView/MewRightFollowVoiceView.h +++ b/yinmeng-ios/yinmeng-ios/Main/Mew/Home/View/SubView/MewRightFollowVoiceView.h @@ -26,6 +26,7 @@ typedef void(^follownRefresh)(void); @property (nonatomic, strong, readonly) UICollectionView *followCollectionView; +@property (nonatomic, weak) id delegate; @end diff --git a/yinmeng-ios/yinmeng-ios/Main/Mew/Home/View/SubView/MewRightFollowVoiceView.m b/yinmeng-ios/yinmeng-ios/Main/Mew/Home/View/SubView/MewRightFollowVoiceView.m index ae42f17..9de9fe3 100644 --- a/yinmeng-ios/yinmeng-ios/Main/Mew/Home/View/SubView/MewRightFollowVoiceView.m +++ b/yinmeng-ios/yinmeng-ios/Main/Mew/Home/View/SubView/MewRightFollowVoiceView.m @@ -62,9 +62,9 @@ - (void)collectionView:(UICollectionView *)collectionView didSelectItemAtIndexPath:(NSIndexPath *)indexPath { -// if () { -// -// } + if (self.delegate) { + [self.delegate didSelectRightFollowVoiceUser:self.fansListModel[indexPath.row]]; + } } diff --git a/yinmeng-ios/yinmeng-ios/Main/Mew/Room/View/RoomStageView/MewSocialStageView.m b/yinmeng-ios/yinmeng-ios/Main/Mew/Room/View/RoomStageView/MewSocialStageView.m index c939eb5..2281658 100644 --- a/yinmeng-ios/yinmeng-ios/Main/Mew/Room/View/RoomStageView/MewSocialStageView.m +++ b/yinmeng-ios/yinmeng-ios/Main/Mew/Room/View/RoomStageView/MewSocialStageView.m @@ -13,8 +13,8 @@ #import "ThemeColor.h" #define ownerTopMargin 0.0 -#define ownerWidth 130 * kScreenScale -#define ownerHeight 148 +#define ownerWidth 140 * kScreenScale +#define ownerHeight 140 * kScreenScale // 下面 6 个坑位宽55 + 光圈 5 #define mcWidth (65 + 5) * kScreenScale @@ -57,8 +57,14 @@ } MewSocialMicroView *newMicroView = [[MewSocialMicroView alloc] init]; - newMicroView.layer.cornerRadius = mcWidth/2.0; - newMicroView.layer.masksToBounds = YES; + if (index == 0) { + newMicroView.layer.cornerRadius = 20; + newMicroView.layer.masksToBounds = YES; + } else { + newMicroView.layer.cornerRadius = mcWidth/2.0; + newMicroView.layer.masksToBounds = YES; + } + return newMicroView; } diff --git a/yinmeng-ios/yinmeng-ios/Main/Mew/Room/View/RoomStageView/RoomMicroView/MewSocialMicroView.m b/yinmeng-ios/yinmeng-ios/Main/Mew/Room/View/RoomStageView/RoomMicroView/MewSocialMicroView.m index 4bfa4d4..80c2b46 100644 --- a/yinmeng-ios/yinmeng-ios/Main/Mew/Room/View/RoomStageView/RoomMicroView/MewSocialMicroView.m +++ b/yinmeng-ios/yinmeng-ios/Main/Mew/Room/View/RoomStageView/RoomMicroView/MewSocialMicroView.m @@ -26,7 +26,7 @@ UserInfoModel *userInfo = model.userInfo; UIImage *image = [UIImage imageNamed:@"mew_room_position_empty"]; - if (micState == 0) { + if (micState.position == -1) { image = [UIImage imageNamed:@"mew_room_position_first_empty"]; } diff --git a/yinmeng-ios/yinmeng-ios/Main/YinMeng/Room/View/StageView/MicroView/MicroView.m b/yinmeng-ios/yinmeng-ios/Main/YinMeng/Room/View/StageView/MicroView/MicroView.m index 26481ec..1ece35b 100644 --- a/yinmeng-ios/yinmeng-ios/Main/YinMeng/Room/View/StageView/MicroView/MicroView.m +++ b/yinmeng-ios/yinmeng-ios/Main/YinMeng/Room/View/StageView/MicroView/MicroView.m @@ -81,7 +81,7 @@ // [self.avatarImageView mas_makeConstraints:^(MASConstraintMaker *make) { make.left.right.top.mas_equalTo(self); - make.height.mas_equalTo(self.mas_width); + make.height.mas_equalTo(self.mas_height); }]; [self.micStateImageView mas_makeConstraints:^(MASConstraintMaker *make) { @@ -199,8 +199,8 @@ if (!_avatarImageView) { _avatarImageView = [[NetImageView alloc] init]; _avatarImageView.userInteractionEnabled = YES; - _avatarImageView.layer.cornerRadius = 70/2.0; - _avatarImageView.layer.masksToBounds = YES; +// _avatarImageView.layer.cornerRadius = 70/2.0; +// _avatarImageView.layer.masksToBounds = YES; } return _avatarImageView; } diff --git a/yinmeng-ios/yinmeng-ios/Main/YinMeng/Room/View/StageView/StageView.m b/yinmeng-ios/yinmeng-ios/Main/YinMeng/Room/View/StageView/StageView.m index e3c24e8..738ca63 100644 --- a/yinmeng-ios/yinmeng-ios/Main/YinMeng/Room/View/StageView/StageView.m +++ b/yinmeng-ios/yinmeng-ios/Main/YinMeng/Room/View/StageView/StageView.m @@ -25,7 +25,7 @@ #import -@interface StageView() +@interface StageView() /**云信麦序的 position 和本类 index 的关系 * 网易云信返回的麦序(position)从 -1 开始 * - 使用者:MicroStateModel、self.micQueue. @@ -239,9 +239,9 @@ // } roomUid:roomUid micUid:uid position:position uid:uid]; // } //如果是当前用户上麦,关闭自己的麦克风 - if (sequence && sequence.userInfo.uid == [AccountInfoStorage instance].getUid.integerValue ) { - [RtcManager instance].localMuted = YES; - } +// if (sequence && sequence.userInfo.uid == [AccountInfoStorage instance].getUid.integerValue ) { + [RtcManager instance].localMuted = NO; +// } } microQueueChanged = YES; @@ -406,6 +406,11 @@ } + if (!isHandleRTC) { + return; + } + [[RtcManager instance] broadcast:YES]; + } - (NSString *)getMewMicroSelectUid {