diff --git a/Podfile b/Podfile index 876c8d05..f4841a87 100644 --- a/Podfile +++ b/Podfile @@ -9,6 +9,8 @@ target 'YuMi' do pod 'Adjust', '~> 4.31.0' pod 'Firebase/Analytics' pod 'FBSDKLoginKit' + pod 'FBSDKCoreKit' + pod 'FBSDKShareKit' # 滑动标签栏 pod 'JXCategoryView' pod 'JXPagingView/Pager' @@ -59,6 +61,7 @@ target 'YuMi' do pod 'SVGAPlayer' pod 'GoogleSignIn', '6.2.4' + pod 'mob_linksdk_pro' pod 'mob_sharesdk' pod 'mob_sharesdk/ShareSDKPlatforms/Apple' pod 'mob_sharesdk/ShareSDKPlatforms/Line' diff --git a/YuMi/Appdelegate/AppDelegate+ThirdConfig.m b/YuMi/Appdelegate/AppDelegate+ThirdConfig.m index 6daac3e1..1a947594 100644 --- a/YuMi/Appdelegate/AppDelegate+ThirdConfig.m +++ b/YuMi/Appdelegate/AppDelegate+ThirdConfig.m @@ -103,11 +103,11 @@ UIKIT_EXTERN NSString * adImageName; -// [ShareSDK registPlatforms:^(SSDKRegister *platformsRegister) { -// ///faceBook + [ShareSDK registPlatforms:^(SSDKRegister *platformsRegister) { + ///faceBook // [platformsRegister setupFacebookWithAppkey:@"1266232494209868" appSecret:@"c9b170b383f8be9cdf118823b8632821" displayName:YMLocalizedString(@"AppDelegate_ThirdConfig0")]; -// [platformsRegister setupLineAuthType:SSDKAuthorizeTypeBoth]; -// }]; + [platformsRegister setupLineAuthType:SSDKAuthorizeTypeBoth]; + }]; } #pragma mark - 表情 diff --git a/YuMi/Appdelegate/AppDelegate.m b/YuMi/Appdelegate/AppDelegate.m index 98e82d83..c43b039f 100644 --- a/YuMi/Appdelegate/AppDelegate.m +++ b/YuMi/Appdelegate/AppDelegate.m @@ -44,6 +44,9 @@ UIKIT_EXTERN NSString * const kOpenRoomNotification; } + + + - (void)applicationDidEnterBackground:(UIApplication *)application { NSInteger count = [NIMSDK sharedSDK].conversationManager.allUnreadCount; [[UIApplication sharedApplication] setApplicationIconBadgeNumber:count]; diff --git a/YuMi/Assets.xcassets/utils/common_nav_back_white.imageset/Contents.json b/YuMi/Assets.xcassets/utils/common_nav_back_white.imageset/Contents.json new file mode 100644 index 00000000..7458e93a --- /dev/null +++ b/YuMi/Assets.xcassets/utils/common_nav_back_white.imageset/Contents.json @@ -0,0 +1,22 @@ +{ + "images" : [ + { + "idiom" : "universal", + "scale" : "1x" + }, + { + "filename" : "common_nav_back_white@2x.png", + "idiom" : "universal", + "scale" : "2x" + }, + { + "filename" : "common_nav_back_white@3x.png", + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/YuMi/Assets.xcassets/utils/common_nav_back_white.imageset/common_nav_back_white@2x.png b/YuMi/Assets.xcassets/utils/common_nav_back_white.imageset/common_nav_back_white@2x.png new file mode 100644 index 00000000..17669a49 Binary files /dev/null and b/YuMi/Assets.xcassets/utils/common_nav_back_white.imageset/common_nav_back_white@2x.png differ diff --git a/YuMi/Assets.xcassets/utils/common_nav_back_white.imageset/common_nav_back_white@3x.png b/YuMi/Assets.xcassets/utils/common_nav_back_white.imageset/common_nav_back_white@3x.png new file mode 100644 index 00000000..3b45c50e Binary files /dev/null and b/YuMi/Assets.xcassets/utils/common_nav_back_white.imageset/common_nav_back_white@3x.png differ diff --git a/YuMi/Assets.xcassets/yna/room_info_share.imageset/Contents.json b/YuMi/Assets.xcassets/yna/room_info_share.imageset/Contents.json new file mode 100644 index 00000000..37f71705 --- /dev/null +++ b/YuMi/Assets.xcassets/yna/room_info_share.imageset/Contents.json @@ -0,0 +1,22 @@ +{ + "images" : [ + { + "idiom" : "universal", + "scale" : "1x" + }, + { + "filename" : "room_info_share@2x.png", + "idiom" : "universal", + "scale" : "2x" + }, + { + "filename" : "room_info_share@3x.png", + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/YuMi/Assets.xcassets/yna/room_info_share.imageset/room_info_share@2x.png b/YuMi/Assets.xcassets/yna/room_info_share.imageset/room_info_share@2x.png new file mode 100644 index 00000000..88fc50ff Binary files /dev/null and b/YuMi/Assets.xcassets/yna/room_info_share.imageset/room_info_share@2x.png differ diff --git a/YuMi/Assets.xcassets/yna/room_info_share.imageset/room_info_share@3x.png b/YuMi/Assets.xcassets/yna/room_info_share.imageset/room_info_share@3x.png new file mode 100644 index 00000000..a8187c69 Binary files /dev/null and b/YuMi/Assets.xcassets/yna/room_info_share.imageset/room_info_share@3x.png differ diff --git a/YuMi/CustomUI/ShareView/XPShareView.h b/YuMi/CustomUI/ShareView/XPShareView.h index 815df53f..49ee6b14 100644 --- a/YuMi/CustomUI/ShareView/XPShareView.h +++ b/YuMi/CustomUI/ShareView/XPShareView.h @@ -1,9 +1,9 @@ // -// YMShareView.h -// YMRoomMoudle +// XCShareView.h +// XCRoomMoudle // -// Created by YUMI on 2022/9/2. -// Copyright © 2023 YUMI. All rights reserved. +// Created by KevinWang on 2018/9/2. +// Copyright © 2018年 YiZhuan. All rights reserved. // #import @@ -23,6 +23,8 @@ @interface XPShareView : UIView @property (nonatomic, weak) id delegate; +@property (nonatomic,assign) BOOL isFromWebVeiw; + - (instancetype)initWithItems:(NSArray *)items itemSize:(CGSize)itemSize shareInfo:(XPShareInfoModel *)shareInfo; diff --git a/YuMi/CustomUI/ShareView/XPShareView.m b/YuMi/CustomUI/ShareView/XPShareView.m index cb371966..44fbcb31 100644 --- a/YuMi/CustomUI/ShareView/XPShareView.m +++ b/YuMi/CustomUI/ShareView/XPShareView.m @@ -11,18 +11,17 @@ #import #import #import +#import +#import "XCCurrentVCStackManager.h" ///Tool -#import "YUMIMacroUitls.h" -#import "DJDKMIMOMColor.h" #import "XCCurrentVCStackManager.h" #import "TTPopup.h" -#import "XNDJTDDLoadingTool.h" -#import "NSArray+Safe.h" +#import "XPFirebbaseEvent.h" ///View #import "XPShareItemCell.h" #import "XPMineShareViewController.h" -@interface XPShareView() +@interface XPShareView() ///取消 @property (nonatomic, strong) UIButton *cancleButton; ///列表 @@ -39,194 +38,269 @@ #pragma mark - Life Style - (instancetype)initWithItems:(NSArray *)items itemSize:(CGSize)itemSize shareInfo:(XPShareInfoModel *)shareInfo { - if (self = [super init]) { - self.items = items; - self.itemSize =itemSize; - self.shareInfo = shareInfo; - [self initSubViews]; - [self initSubViewConstraints]; - } - return self; + if (self = [super init]) { + self.items = items; + self.itemSize =itemSize; + self.shareInfo = shareInfo; + [self initSubViews]; + [self initSubViewConstraints]; + } + return self; } #pragma mark - Private Method - (void)initSubViews { - [self addSubview:self.collectionView]; - [self addSubview:self.cancleButton]; + [self addSubview:self.collectionView]; + [self addSubview:self.cancleButton]; } - (void)initSubViewConstraints { - - CGFloat collectionWidth = KScreenWidth - 15 * 2; - ///一行有几个 - int numberLine = collectionWidth / self.itemSize.width; - int page = self.items.count % numberLine > 0 ? (int)self.items.count / numberLine + 1 : (int)self.items.count / numberLine; - CGFloat collectionHeight = page * self.itemSize.height + 20 + (page-1) * 10 + 10; - [self.collectionView mas_makeConstraints:^(MASConstraintMaker *make) { - make.top.mas_equalTo(self); - make.height.mas_equalTo(collectionHeight); - make.left.right.mas_equalTo(self).inset(15); - }]; - - [self.cancleButton mas_makeConstraints:^(MASConstraintMaker *make) { - make.height.mas_equalTo(45); - make.left.right.mas_equalTo(self.collectionView); - make.top.mas_equalTo(self.collectionView.mas_bottom).offset(15); - }]; - - [self mas_makeConstraints:^(MASConstraintMaker *make) { - make.width.mas_equalTo(KScreenWidth); - make.bottom.mas_equalTo(self.cancleButton.mas_bottom).offset(30); - }]; + + CGFloat collectionWidth = KScreenWidth - 15 * 2; + ///一行有几个 + int numberLine = collectionWidth / self.itemSize.width; + int page = self.items.count % numberLine > 0 ? (int)self.items.count / numberLine + 1 : (int)self.items.count / numberLine; + CGFloat collectionHeight = page * self.itemSize.height + 20 + (page-1) * 10 + 10; + [self.collectionView mas_makeConstraints:^(MASConstraintMaker *make) { + make.top.mas_equalTo(self); + make.height.mas_equalTo(collectionHeight); + make.left.right.mas_equalTo(self).inset(15); + }]; + + [self.cancleButton mas_makeConstraints:^(MASConstraintMaker *make) { + make.height.mas_equalTo(45); + make.left.right.mas_equalTo(self.collectionView); + make.top.mas_equalTo(self.collectionView.mas_bottom).offset(15); + }]; + + [self mas_makeConstraints:^(MASConstraintMaker *make) { + make.width.mas_equalTo(KScreenWidth); + make.bottom.mas_equalTo(self.cancleButton.mas_bottom).offset(30); + }]; } - (BOOL)isInstallClient:(SSDKPlatformType)platform { - return [ShareSDK isClientInstalled:platform]; + return [ShareSDK isClientInstalled:platform]; } - (SSDKPlatformType)getSharePlatformType:(XPShareItemTag)itemTag { - SSDKPlatformType type; - switch (itemTag) { - case XPShareItemTagFaceBook: - type = SSDKPlatformTypeFacebook; - break; - case XPShareItemTagLine: - type = SSDKPlatformTypeLine; - break; - default: - type = SSDKPlatformTypeUnknown; - break; - } - return type; + SSDKPlatformType type; + switch (itemTag) { + case XPShareItemTagFaceBook: + type = SSDKPlatformTypeFacebook; + break; + case XPShareItemTagLine: + type = SSDKPlatformTypeLine; + break; + default: + type = SSDKPlatformTypeUnknown; + break; + } + return type; } #pragma mark - UICollectionViewDelegate - (NSInteger)collectionView:(UICollectionView *)collectionView numberOfItemsInSection:(NSInteger)section{ - return self.items.count; + return self.items.count; } - (UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath{ - XPShareItemCell *cell = [collectionView dequeueReusableCellWithReuseIdentifier:NSStringFromClass([XPShareItemCell class]) forIndexPath:indexPath]; - XPShareItem * item = [self.items safeObjectAtIndex1:indexPath.item]; - if(item != nil){ - if (item.type == XPShareItemTagAppFriends || item.type == XPShareItemTagCopyLink) { - item.disable = YES; - } else { - item.disable = [self isInstallClient:[self getSharePlatformType:item.type]]; - } - cell.shareItem = item; - } - return cell; + XPShareItemCell *cell = [collectionView dequeueReusableCellWithReuseIdentifier:NSStringFromClass([XPShareItemCell class]) forIndexPath:indexPath]; + XPShareItem * item = [self.items safeObjectAtIndex1:indexPath.item]; + if(item != nil){ + if (item.type == XPShareItemTagAppFriends || item.type == XPShareItemTagCopyLink) { + item.disable = YES; + } else { + item.disable = [self isInstallClient:[self getSharePlatformType:item.type]]; + } + cell.shareItem = item; + } + return cell; } - (void)collectionView:(UICollectionView *)collectionView didSelectItemAtIndexPath:(NSIndexPath *)indexPath{ - [collectionView deselectItemAtIndexPath:indexPath animated:YES]; - XPShareItem * item = [self.items safeObjectAtIndex1:indexPath.item]; - if (item == nil)return; - if (item.type == XPShareItemTagAppFriends) { - [TTPopup dismiss]; - XPMineShareViewController * shareVC = [[XPMineShareViewController alloc] init]; - shareVC.shareType = MineShareType_Monents; - shareVC.shareInfo = self.shareInfo; - [[XCCurrentVCStackManager shareManager].getCurrentVC.navigationController pushViewController:shareVC animated:YES]; - return; - } else if(item.type == XPShareItemTagCopyLink) { - NSString * urlString = self.shareInfo.shareUrl; - UIPasteboard *pasteboard = [UIPasteboard generalPasteboard]; - [pasteboard setString:urlString]; - [XNDJTDDLoadingTool showSuccessWithMessage:YMLocalizedString(@"XPShareView0")]; - [TTPopup dismiss]; - return; - } - self.shareInfo.shareType = item.type; - NSMutableDictionary *shareParams = [NSMutableDictionary dictionary]; - NSString * title = [self.shareInfo shareTitle].length > 0 ? self.shareInfo.shareTitle : @""; - NSString * content = self.shareInfo.shareContent.length > 0 ? self.shareInfo.shareContent : @""; - NSString * urlString = self.shareInfo.shareUrl.length > 0 ?self.shareInfo.shareUrl : @""; - NSString * imageURL = self.shareInfo.shareImageUrl.length > 0 ? self.shareInfo.shareImageUrl : @""; - NSString *encodedUrl = [urlString stringByAddingPercentEncodingWithAllowedCharacters:[NSCharacterSet URLQueryAllowedCharacterSet]]; - SSDKPlatformType platformType; - if (item.type == XPShareItemTagLine) { - title = YMLocalizedString(@"XPShareView1"); - platformType = SSDKPlatformTypeLine; - if (![ShareSDK isClientInstalled:platformType]) { - [XNDJTDDLoadingTool showErrorWithMessage:YMLocalizedString(@"XPShareView2")]; - return; - } - [shareParams SSDKSetupLineParamsByText:encodedUrl image:nil type:SSDKContentTypeAuto]; - } else { - title = YMLocalizedString(@"XPShareView3"); - platformType = SSDKPlatformTypeFacebook; - content = YMLocalizedString(@"XPShareView4"); - [shareParams SSDKSetupFacebookParamsByText:title image:@"https://image.hfighting.com/morentouxiang.png" url:[NSURL URLWithString:urlString] urlTitle:@"title" urlName:@"name" attachementUrl:nil hashtag:@"#Piko" quote:@"Piko" shareType:SSDKFacebookShareTypeNative type:SSDKContentTypeWebPage]; - } - - [ShareSDK share:platformType parameters:shareParams onStateChanged:^(SSDKResponseState state, NSDictionary *userData, SSDKContentEntity *contentEntity, NSError *error) { - switch (state) { - case SSDKResponseStateSuccess: - { - if (self.delegate && [self.delegate respondsToSelector:@selector(shareView:didSuccess:)]) { - [self.delegate shareView:self didSuccess:self.shareInfo]; - } - } - break; - case SSDKResponseStateFail: - { - if (self.delegate && [self.delegate respondsToSelector:@selector(shareView:shareFail:)]) { - [self.delegate shareView:self shareFail:YMLocalizedString(@"XPShareView5")]; - } - } - break; - case SSDKResponseStateCancel: - { - if (self.delegate && [self.delegate respondsToSelector:@selector(shareView:shareFail:)]) { - [self.delegate shareView:self shareFail:YMLocalizedString(@"XPShareView6")]; - } - } - break; - default: - break; - } - }]; + [collectionView deselectItemAtIndexPath:indexPath animated:YES]; + + NSMutableDictionary *shareParams = [NSMutableDictionary dictionary]; + NSString * title = [self.shareInfo shareTitle].length > 0 ? self.shareInfo.shareTitle : @""; + NSString * content = self.shareInfo.shareContent.length > 0 ? self.shareInfo.shareContent : @""; + NSString * urlString = self.shareInfo.shareUrl.length > 0 ?self.shareInfo.shareUrl : @""; + NSString * imageURL = self.shareInfo.shareImageUrl.length > 0 ? self.shareInfo.shareImageUrl : @""; + NSString *encodedUrl = [urlString stringByAddingPercentEncodingWithAllowedCharacters:[NSCharacterSet URLQueryAllowedCharacterSet]]; + + XPShareItem * item = [self.items safeObjectAtIndex1:indexPath.item]; + if (item == nil)return; + if (item.type == XPShareItemTagAppFriends) { + [TTPopup dismiss]; + XPMineShareViewController * shareVC = [[XPMineShareViewController alloc] init]; + shareVC.shareType = MineShareType_Monents; + shareVC.shareInfo = self.shareInfo; + [[XCCurrentVCStackManager shareManager].getCurrentVC.navigationController pushViewController:shareVC animated:YES]; + return; + } else if(item.type == XPShareItemTagCopyLink) { + NSString * urlString = self.shareInfo.shareUrl; + UIPasteboard *pasteboard = [UIPasteboard generalPasteboard]; + [pasteboard setString:urlString]; + [XNDJTDDLoadingTool showSuccessWithMessage:YMLocalizedString(@"XPShareView0")]; + [TTPopup dismiss]; + return; + } + + + self.shareInfo.shareType = item.type; + + SSDKPlatformType platformType; + XPPlatformType FBtype; + if (item.type == XPShareItemTagLine) { + title = YMLocalizedString(@"XPShareView1"); + platformType = SSDKPlatformTypeLine; + if (![ShareSDK isClientInstalled:platformType]) { + [XNDJTDDLoadingTool showErrorWithMessage:YMLocalizedString(@"XPShareView2")]; + return; + } + FBtype = PlatformOfLine; + [shareParams SSDKSetupLineParamsByText:encodedUrl image:nil type:SSDKContentTypeAuto]; + } else { + title = YMLocalizedString(@"XPShareView3"); + platformType = SSDKPlatformTypeFacebook; + FBtype = PlatformOfFB; + content = YMLocalizedString(@"XPShareView4"); + [shareParams SSDKSetupFacebookParamsByText:title image:@"https://pic.lecheng163.com/ananLogo256.png" url:[NSURL URLWithString:urlString] urlTitle:@"title" urlName:@"name" attachementUrl:nil hashtag:@"#Piko" quote:@"Piko" shareType:SSDKFacebookShareTypeNative type:SSDKContentTypeWebPage]; + } + if(item.type == XPShareItemTagFaceBook){ + FBSDKShareLinkContent*linkContent = [[FBSDKShareLinkContent alloc]init]; + linkContent.contentURL= [NSURL URLWithString:urlString]; + linkContent.quote = content; + + FBSDKShareDialog *shareDialog = [[FBSDKShareDialog alloc]initWithViewController:[XCCurrentVCStackManager shareManager].getCurrentVC content:linkContent delegate:self]; + // 需要指定模式,否则会调起web分享 + shareDialog.mode = FBSDKShareDialogModeNative; + if (![shareDialog canShow]) { + shareDialog.mode = FBSDKShareDialogModeWeb; + } + + + [shareDialog show]; + return; + } + + [ShareSDK share:platformType parameters:shareParams onStateChanged:^(SSDKResponseState state, NSDictionary *userData, SSDKContentEntity *contentEntity, NSError *error) { + switch (state) { + case SSDKResponseStateSuccess: + { + if(self.isFromWebVeiw == NO){ + [XPFirebbaseEvent shareEventWithContentID:@(self.shareInfo.roomUid).stringValue type:FBtype]; + }else{ + [XPFirebbaseEvent shareEventWithContentID:self.shareInfo.uid type:FBtype]; + } + if (self.delegate && [self.delegate respondsToSelector:@selector(shareView:didSuccess:)]) { + [self.delegate shareView:self didSuccess:self.shareInfo]; + } + } + break; + case SSDKResponseStateFail: + { + if (self.delegate && [self.delegate respondsToSelector:@selector(shareView:shareFail:)]) { + [self.delegate shareView:self shareFail:YMLocalizedString(@"XPShareView5")]; + } + } + break; + case SSDKResponseStateCancel: + { + if (self.delegate && [self.delegate respondsToSelector:@selector(shareView:shareFail:)]) { + [self.delegate shareView:self shareFail:YMLocalizedString(@"XPShareView6")]; + } + } + break; + default: + break; + } + }]; +} +#pragma mark - FBSDKSharingDelegate +/// Sent to the delegate when sharing completes without error or cancellation. +/// @param sharer The sharer that completed. +/// @param results The results from the sharer. This may be nil or empty. +- (void)sharer:(id _Nonnull)sharer didCompleteWithResults:(NSDictionary * _Nonnull)results{ + NSString *postId = results[@"postId"]; + FBSDKShareDialog *dialog = (FBSDKShareDialog *)sharer; + if (dialog.mode == FBSDKShareDialogModeBrowser && (postId == nil || [postId isEqualToString:@""])) { + // 如果使用webview分享的,但postId是空的, + // 这种情况是用户点击了『完成』按钮,并没有真的分享 + if (self.delegate && [self.delegate respondsToSelector:@selector(shareView:shareFail:)]) { + [self.delegate shareView:self shareFail:YMLocalizedString(@"XPShareView6")]; + } + } else { + if(self.isFromWebVeiw == NO){ + [XPFirebbaseEvent shareEventWithContentID:@(self.shareInfo.roomUid).stringValue type:PlatformOfFB]; + }else{ + [XPFirebbaseEvent shareEventWithContentID:self.shareInfo.uid type:PlatformOfFB]; + } + if (self.delegate && [self.delegate respondsToSelector:@selector(shareView:didSuccess:)]) { + [self.delegate shareView:self didSuccess:self.shareInfo]; + } + } +} +/// Sent to the delegate when the sharer encounters an error. +/// @param sharer The sharer that completed. +/// @param error The error. +- (void)sharer:(id _Nonnull)sharer didFailWithError:(NSError * _Nonnull)error{ + FBSDKShareDialog *dialog = (FBSDKShareDialog *)sharer; + if (error == nil && dialog.mode == FBSDKShareDialogModeNative) { + // 如果使用原生登录失败,但error为空,那是因为用户没有安装Facebook app + // 重设dialog的mode,再次弹出对话框 + dialog.mode = FBSDKShareDialogModeBrowser; + [dialog show]; + } else { + if (self.delegate && [self.delegate respondsToSelector:@selector(shareView:shareFail:)]) { + [self.delegate shareView:self shareFail:YMLocalizedString(@"XPShareView5")]; + } + } +} +/// Sent to the delegate when the sharer is cancelled. +/// @param sharer The sharer that completed. +- (void)sharerDidCancel:(id _Nonnull)sharer{ + if (self.delegate && [self.delegate respondsToSelector:@selector(shareView:shareFail:)]) { + [self.delegate shareView:self shareFail:YMLocalizedString(@"XPShareView6")]; + } } - #pragma mark - Event Response - (void)cancleButtonDidClck:(UIButton *)button{ - if (self.delegate && [self.delegate respondsToSelector:@selector(shareViewDidClickCancel:)]) { - [self.delegate shareViewDidClickCancel:self]; - } + if (self.delegate && [self.delegate respondsToSelector:@selector(shareViewDidClickCancel:)]) { + [self.delegate shareViewDidClickCancel:self]; + } } #pragma mark - Getters And Setters - (UICollectionView *)collectionView{ - if (!_collectionView) { - UICollectionViewFlowLayout *layout = [[UICollectionViewFlowLayout alloc] init]; - layout.itemSize = self.itemSize; - layout.minimumInteritemSpacing = 0; - layout.minimumLineSpacing = 10; - layout.sectionInset = UIEdgeInsetsMake(20, 0, 10, 0); - _collectionView = [[UICollectionView alloc] initWithFrame:CGRectZero collectionViewLayout:layout]; - _collectionView.backgroundColor = [UIColor whiteColor]; - _collectionView.dataSource = self; - _collectionView.delegate = self; - _collectionView.layer.masksToBounds = YES; - _collectionView.layer.cornerRadius = 15; - [_collectionView registerClass:[XPShareItemCell class] forCellWithReuseIdentifier:NSStringFromClass([XPShareItemCell class])]; - } - return _collectionView; + if (!_collectionView) { + UICollectionViewFlowLayout *layout = [[UICollectionViewFlowLayout alloc] init]; + layout.itemSize = self.itemSize; + layout.minimumInteritemSpacing = 0; + layout.minimumLineSpacing = 10; + layout.sectionInset = UIEdgeInsetsMake(20, 0, 10, 0); + _collectionView = [[UICollectionView alloc] initWithFrame:CGRectZero collectionViewLayout:layout]; + _collectionView.backgroundColor = [UIColor whiteColor]; + _collectionView.dataSource = self; + _collectionView.delegate = self; + _collectionView.layer.masksToBounds = YES; + _collectionView.layer.cornerRadius = 15; + [_collectionView registerClass:[XPShareItemCell class] forCellWithReuseIdentifier:NSStringFromClass([XPShareItemCell class])]; + } + return _collectionView; } - (UIButton *)cancleButton{ - if (!_cancleButton) { - _cancleButton = [[UIButton alloc] init]; - [_cancleButton setBackgroundColor:[UIColor whiteColor]]; - [_cancleButton setTitle:YMLocalizedString(@"XPShareView7") forState:UIControlStateNormal]; - _cancleButton.titleLabel.font = [UIFont fontWithName:@"PingFang-SC-Medium" size:15]; - _cancleButton.layer.masksToBounds = YES; - _cancleButton.layer.cornerRadius = 45/2; - [_cancleButton setTitleColor:[DJDKMIMOMColor textThirdColor] forState:UIControlStateNormal]; - [_cancleButton addTarget:self action:@selector(cancleButtonDidClck:) forControlEvents:UIControlEventTouchUpInside]; - } - return _cancleButton; + if (!_cancleButton) { + _cancleButton = [[UIButton alloc] init]; + [_cancleButton setBackgroundColor:[UIColor whiteColor]]; + [_cancleButton setTitle:YMLocalizedString(@"XPShareView7") forState:UIControlStateNormal]; + _cancleButton.titleLabel.font = [UIFont fontWithName:@"PingFang-SC-Medium" size:15]; + _cancleButton.layer.masksToBounds = YES; + _cancleButton.layer.cornerRadius = 45/2; + [_cancleButton setTitleColor:[DJDKMIMOMColor textThirdColor] forState:UIControlStateNormal]; + [_cancleButton addTarget:self action:@selector(cancleButtonDidClck:) forControlEvents:UIControlEventTouchUpInside]; + } + return _cancleButton; } @end diff --git a/YuMi/Modules/YMRoom/View/ArrangeMic/View/XPArrangeMicViewController.m b/YuMi/Modules/YMRoom/View/ArrangeMic/View/XPArrangeMicViewController.m index 29665646..4912f77f 100644 --- a/YuMi/Modules/YMRoom/View/ArrangeMic/View/XPArrangeMicViewController.m +++ b/YuMi/Modules/YMRoom/View/ArrangeMic/View/XPArrangeMicViewController.m @@ -643,27 +643,24 @@ #pragma mark - Event Response - (void)applyButtonAction:(UIButton *)sender { if (self.userInfo.isManager) { - return;///上架 先不处理 - XPShareItem *cycle = [XPShareItem itemWitTag:XPShareItemTagMoments title:YMLocalizedString(@"XPArrangeMicViewController15") imageName:@"share_wechat_circle_normal" disableImageName:@"share_wechat_circle_disable"]; - XPShareItem *wechat = [XPShareItem itemWitTag:XPShareItemTagWeChat title:YMLocalizedString(@"XPArrangeMicViewController16") imageName:@"share_wechat_normal" disableImageName:@"share_wechat_disable"]; - XPShareItem *qq = [XPShareItem itemWitTag:XPShareItemTagQQ title:YMLocalizedString(@"XPArrangeMicViewController17") imageName:@"share_qq_normal" disableImageName:@"share_qq_disable"]; - XPShareItem *qqzone = [XPShareItem itemWitTag:XPShareItemTagQQZone title:YMLocalizedString(@"XPArrangeMicViewController18") imageName:@"share_qqzone_normal" disableImageName:@"share_qqzone_disable"]; - NSArray * items = @[wechat,cycle, qq, qqzone]; - XPShareInfoModel * shareInfo = [[XPShareInfoModel alloc] init]; - shareInfo.shareTitle = self.userInfo.roomTitle; - shareInfo.shareContent = self.userInfo.nick; - shareInfo.shareImageUrl = self.userInfo.roomAvatar; - shareInfo.type = ShareType_Room; - shareInfo.roomUid = self.userInfo.roomUid.integerValue; - NSString * uid = [AccountInfoStorage instance].getUid; - NSString * urlString = [NSString stringWithFormat:@"%@/%@?shareUid=%@&uid=%@&room_name=%@&room_id=%@&room_avatar=%@&share_name=%@",API_HOST_URL,URLWithType(kShareRoomURL),uid,self.userInfo.roomUid,self.userInfo.nick,self.userInfo.roomId,self.userInfo.roomAvatar,self.userInfo.nick]; - shareInfo.shareUrl = urlString; - CGFloat margin = 15; - CGSize itemSize = CGSizeMake((KScreenWidth-2*margin)/4, 65); - XPShareView *shareView = [[XPShareView alloc] initWithItems:items itemSize:itemSize shareInfo:shareInfo]; - shareView.delegate = self; - [TTPopup popupView:shareView style:TTPopupStyleActionSheet]; - + XPShareItem *cycle = [XPShareItem itemWitTag:XPShareItemTagFaceBook title:@"FaceBook" imageName:@"share_fb" disableImageName:@"share_fb"]; + XPShareItem *wechat = [XPShareItem itemWitTag:XPShareItemTagLine title:@"Line" imageName:@"share_line" disableImageName:@"share_line"]; + XPShareItem *qq = [XPShareItem itemWitTag:XPShareItemTagCopyLink title:YMLocalizedString(@"RoomHeaderView3") imageName:@"share_copy_link" disableImageName:@"share_copy_link"]; + NSArray * items = @[wechat,cycle, qq]; + XPShareInfoModel * shareInfo = [[XPShareInfoModel alloc] init]; + shareInfo.shareTitle = self.userInfo.roomTitle; + shareInfo.shareContent = self.userInfo.nick; + shareInfo.shareImageUrl = self.userInfo.roomAvatar; + shareInfo.type = ShareType_Room; + shareInfo.roomUid = self.userInfo.roomUid.integerValue; + NSString * uid = [AccountInfoStorage instance].getUid; + NSString * urlString = [NSString stringWithFormat:@"%@/%@?shareUid=%@&uid=%@&room_name=%@&room_id=%@&room_avatar=%@&share_name=%@",API_HOST_URL,URLWithType(kShareRoomURL),uid,self.userInfo.roomUid,self.userInfo.nick,self.userInfo.roomId,self.userInfo.roomAvatar,self.userInfo.nick]; + shareInfo.shareUrl = urlString; + CGFloat margin = 15; + CGSize itemSize = CGSizeMake((KScreenWidth-2*margin)/4, 65); + XPShareView *shareView = [[XPShareView alloc] initWithItems:items itemSize:itemSize shareInfo:shareInfo]; + shareView.delegate = self; + [TTPopup popupView:shareView style:TTPopupStyleActionSheet]; } else { if (self.arrangeMicInfo.myPos.integerValue > 0) { [TTPopup alertWithMessage:YMLocalizedString(@"XPArrangeMicViewController19") confirmHandler:^{ diff --git a/YuMi/Modules/YMRoom/View/MoreView/Model/XPRoomMoreItemModel.h b/YuMi/Modules/YMRoom/View/MoreView/Model/XPRoomMoreItemModel.h index 5d3553c1..3882a3c1 100644 --- a/YuMi/Modules/YMRoom/View/MoreView/Model/XPRoomMoreItemModel.h +++ b/YuMi/Modules/YMRoom/View/MoreView/Model/XPRoomMoreItemModel.h @@ -54,6 +54,8 @@ typedef NS_ENUM(NSInteger, RoomMoreMenuType) { RoomMoreMenuType_Room_Voice = 21, ///心愿礼物 RoomMoreMenuType_Room_Wish_Gift = 22, + ///举报 + RoomMoreMenuType_Room_report = 23, }; @interface XPRoomMoreItemModel : NSObject diff --git a/YuMi/Modules/YMRoom/View/MoreView/Presenter/XPMoreMenuPresenter.m b/YuMi/Modules/YMRoom/View/MoreView/Presenter/XPMoreMenuPresenter.m index fc63c58f..1462ffe1 100644 --- a/YuMi/Modules/YMRoom/View/MoreView/Presenter/XPMoreMenuPresenter.m +++ b/YuMi/Modules/YMRoom/View/MoreView/Presenter/XPMoreMenuPresenter.m @@ -130,6 +130,12 @@ voice.titleColor = [DJDKMIMOMColor roomMoreMenuTextColor]; voice.isSelected = [RtcManager instance].isRemoteMuted; + XPRoomMoreItemModel * report = [[XPRoomMoreItemModel alloc] init]; + report.title = YMLocalizedString(@"XPMoreMenuPresenter36"); + report.imageName = @"room_info_report"; + report.type = RoomMoreMenuType_Room_report; + report.titleColor = [DJDKMIMOMColor roomMoreMenuTextColor]; + NSString * uid = [AccountInfoStorage instance].getUid; if (uid.length <= 0) { return; @@ -194,7 +200,7 @@ [array addObject:roomSetting]; [array addObject:voice]; } - + [array addObject:report]; [[self getView] getMoreMenuDataSuccess:array]; }]; } diff --git a/YuMi/Modules/YMRoom/View/MoreView/View/XPRoomMoreMenuViewController.m b/YuMi/Modules/YMRoom/View/MoreView/View/XPRoomMoreMenuViewController.m index 8cf117d7..317a1e9f 100644 --- a/YuMi/Modules/YMRoom/View/MoreView/View/XPRoomMoreMenuViewController.m +++ b/YuMi/Modules/YMRoom/View/MoreView/View/XPRoomMoreMenuViewController.m @@ -8,6 +8,7 @@ #import "XPRoomMoreMenuViewController.h" ///Third #import +#import "FFPopup.h" ///Tool #import "YUMIMacroUitls.h" #import "TTPopup.h" @@ -36,6 +37,7 @@ #import "XPWishGiftCreateViewController.h" #import "XPAnchorPKSelectTypeController.h" #import "XPRoomTrumpetViewController.h" +#import "XPWebViewController.h" ///P #import "XPMoreMenuPresenter.h" #import "XPMoreMenuProtocol.h" @@ -488,6 +490,25 @@ UIKIT_EXTERN NSString * const kRoomGiftEffectUpdateNotificationKey; [self.hostDelegate.getCurrentNav pushViewController:wishGiftVC animated:YES]; } break; + case RoomMoreMenuType_Room_report: + { + [self dismissViewControllerAnimated:YES completion:nil]; + TTActionSheetConfig *action = [TTActionSheetConfig normalTitle:YMLocalizedString(@"RoomHeaderView10") clickAction:^{ + [FFPopup dismissPopupForView:self.view animated:NO]; + [self.hostDelegate requesstShieldingAction]; + }]; + TTActionSheetConfig *action1 = [TTActionSheetConfig normalTitle:YMLocalizedString(@"RoomHeaderView12") clickAction:^{ + [FFPopup dismissPopupForView:self.view animated:NO]; + + XPWebViewController * webVC = [[XPWebViewController alloc] init]; + NSString *urlstr = [NSString stringWithFormat:@"%@?reportUid=%ld&source=ROOM", URLWithType(kReportRoomURL),self.hostDelegate.getRoomInfo.uid]; + webVC.url = urlstr; + [[self.hostDelegate getCurrentNav] pushViewController:webVC animated:YES]; + + }]; + [TTPopup actionSheetWithItems:@[action,action1]]; + break; + } default: break; } diff --git a/YuMi/Modules/YMRoom/View/RoomHeaderView/RoomHeaderView.m b/YuMi/Modules/YMRoom/View/RoomHeaderView/RoomHeaderView.m index a2cf18d6..edb897a7 100644 --- a/YuMi/Modules/YMRoom/View/RoomHeaderView/RoomHeaderView.m +++ b/YuMi/Modules/YMRoom/View/RoomHeaderView/RoomHeaderView.m @@ -1,33 +1,27 @@ // -// YMRoomInfoView.m -// YUMI +// XPRoomInfoView.m +// xplan-ios // -// Created by YUMI on 2021/10/11. +// Created by 冯硕 on 2021/10/11. // #import "RoomHeaderView.h" ///Third #import #import - #import #import "TTPopup.h" #import +#import "HttpRequestHelper.h" ///Tool #import "UIImage+Utils.h" #import "UIButton+EnlargeTouchArea.h" -#import "YUMIMacroUitls.h" #import "ThemeColor+Room.h" #import "TTPopup.h" -#import "XNDJTDDLoadingTool.h" -#import "YUMIHtmlUrl.h" #import "AccountInfoStorage.h" #import "HttpRequestHelper.h" #import "Api+Room.h" #import "XCCurrentVCStackManager.h" -#import "StatisticsServiceHelper.h" -#import "NSMutableDictionary+Saft.h" -#import "ClientConfig.h" ///Model #import "RoomInfoModel.h" #import "UserInfoModel.h" @@ -43,9 +37,6 @@ #import "XPRoomViewController.h" @interface RoomHeaderView () - -///返回按钮 -@property (nonatomic, strong) UIButton *backButton; ///容器 @property (nonatomic,strong) UIStackView *nickStackView; /// @@ -64,56 +55,44 @@ @property (nonatomic,strong) YYLabel *idLabel; ///收藏 @property (nonatomic,strong) UIButton *collectButton; +///取消收藏 +@property (nonatomic,strong) UIButton *cancelButton; +///分享 +@property (nonatomic,strong) UIButton *shareButton; ///设置 @property (nonatomic,strong) UIButton *settingButton; +///代理 @property (nonatomic, weak) id hostDelegate; ///右侧推荐房间 @property (nonatomic, strong) XPRoomRecommendView *recommendRoomView; - +///返回按钮,最小化 +@property (nonatomic,strong) UIButton *backBtn; ///是否已发送过收藏房间公屏消息 @property (nonatomic, assign) BOOL hadShowCollectInScreen; - @end @implementation RoomHeaderView - (instancetype)initWithDelegate:(id)delegate { - self = [super init]; - if (self) { + self = [super init]; + if (self) { _hostDelegate = delegate; - [self initSubViews]; - [self initSubViewConstraints]; - } - return self; + [self initSubViews]; + [self initSubViewConstraints]; + } + return self; } #pragma mark - Event Response - (void)backButtonAction:(UIButton *)sender { - [StatisticsServiceHelper trackEventWithKey:StatisticsServiceEventroom_return_click eventAttributes:@{@"roomUid" : @(self.hostDelegate.getRoomInfo.uid)}]; [self.hostDelegate miniRoom]; } - (void)shareButtonAction:(UIButton *)sender{ - [self showSharePanel]; + [self showSharePanel]; } - (void)settingButtonAction:(UIButton *)sender { - - if (![ClientConfig shareConfig].canOpen) { - TTActionSheetConfig *exit = [TTActionSheetConfig normalTitle:YMLocalizedString(@"RoomHeaderView0") clickAction:^{ - [self.hostDelegate exitRoom]; - }]; - - TTActionSheetConfig *report = [TTActionSheetConfig normalTitle:YMLocalizedString(@"RoomHeaderView1") clickAction:^{ - dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0.5 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{ - [XNDJTDDLoadingTool showErrorWithMessage:YMLocalizedString(@"RoomHeaderView2")]; - }); - }]; - - [TTPopup actionSheetWithItems:@[exit, report]]; - return; - } - self.recommendRoomView.frame = CGRectMake(KScreenWidth, 0, 250, KScreenHeight); FFPopup *popup = [FFPopup popupWithContentView:self.recommendRoomView]; popup.showType = FFPopupShowType_SlideInFromRight; @@ -139,271 +118,282 @@ } - (void)onlineTapRecognizer { - [StatisticsServiceHelper trackEventWithKey:StatisticsServiceEventroom_online_list_click eventAttributes:@{@"roomUid" : @(self.hostDelegate.getRoomInfo.uid)}]; - XPRoomOnLineViewController * onlineVC = [[XPRoomOnLineViewController alloc] initWithDelegate:self.hostDelegate]; - [self.hostDelegate.getCurrentNav pushViewController:onlineVC animated:YES]; + XPRoomOnLineViewController * onlineVC = [[XPRoomOnLineViewController alloc] initWithDelegate:self.hostDelegate]; + [self.hostDelegate.getCurrentNav pushViewController:onlineVC animated:YES]; } #pragma mark - Private Method - (void)initSubViews { - [self addSubview:self.backButton]; - [self addSubview:self.nickStackView]; - [self addSubview:self.collectButton]; - [self addSubview:self.settingButton]; - - [self.nickStackView addArrangedSubview:self.titleStackView]; - [self.nickStackView addArrangedSubview:self.onlineStackView]; - - [self.onlineStackView addArrangedSubview:self.greenDotView]; - [self.onlineStackView addArrangedSubview:self.idLabel]; - - [self.titleStackView addArrangedSubview:self.titleLabel]; - [self.titleStackView addArrangedSubview:self.giftEffectImageView]; - [self.titleStackView addArrangedSubview:self.lockRoomImageView]; + + [self addSubview:self.nickStackView]; + [self addSubview:self.collectButton]; + [self addSubview:self.cancelButton]; + [self addSubview:self.shareButton]; + [self addSubview:self.settingButton]; + [self addSubview:self.backBtn]; + [self.nickStackView addArrangedSubview:self.titleStackView]; + [self.nickStackView addArrangedSubview:self.onlineStackView]; + + [self.onlineStackView addArrangedSubview:self.greenDotView]; + [self.onlineStackView addArrangedSubview:self.idLabel]; + + [self.titleStackView addArrangedSubview:self.titleLabel]; + [self.titleStackView addArrangedSubview:self.giftEffectImageView]; + [self.titleStackView addArrangedSubview:self.lockRoomImageView]; } - (void)initSubViewConstraints { - [self.backButton mas_makeConstraints:^(MASConstraintMaker *make) { - make.left.equalTo(self).offset(14); - make.height.width.equalTo(@22); - make.centerY.mas_equalTo(self.settingButton); - }]; - // 设置 - [self.settingButton mas_makeConstraints:^(MASConstraintMaker *make) { - make.right.mas_equalTo(-15); + // 设置 + [self.settingButton mas_makeConstraints:^(MASConstraintMaker *make) { + make.right.mas_equalTo(-15); make.bottom.mas_equalTo(-11); - make.width.height.mas_equalTo(22); - }]; - - [self.collectButton mas_makeConstraints:^(MASConstraintMaker *make) { - make.centerY.equalTo(self.settingButton); - make.right.equalTo(self.settingButton.mas_left).offset(-8); - make.width.height.mas_equalTo(22); - }]; - - [self.nickStackView mas_makeConstraints:^(MASConstraintMaker *make) { + make.width.height.mas_equalTo(22); + }]; + + [self.shareButton mas_makeConstraints:^(MASConstraintMaker *make) { + make.right.equalTo(self.settingButton.mas_left).offset(-15); make.centerY.mas_equalTo(self.settingButton); - make.left.mas_equalTo(self.backButton.mas_right).offset(10); - }]; - - [self.titleLabel mas_makeConstraints:^(MASConstraintMaker *make) { - make.width.mas_lessThanOrEqualTo(100); + make.width.height.mas_equalTo(22); + }]; + + [self.collectButton mas_makeConstraints:^(MASConstraintMaker *make) { + make.centerY.equalTo(self.settingButton); + make.left.equalTo(self.nickStackView.mas_right).offset(6); + make.size.mas_equalTo(CGSizeMake(52, 23)); + }]; + [self.cancelButton mas_makeConstraints:^(MASConstraintMaker *make) { + make.edges.equalTo(self.collectButton); + }]; + [self.nickStackView mas_makeConstraints:^(MASConstraintMaker *make) { + make.centerY.mas_equalTo(self.settingButton); + make.left.mas_equalTo(self).offset(35); + }]; + + [self.titleLabel mas_makeConstraints:^(MASConstraintMaker *make) { + make.width.mas_lessThanOrEqualTo(100); make.height.mas_equalTo(21); - }]; - [self.greenDotView mas_makeConstraints:^(MASConstraintMaker *make) { - make.size.mas_equalTo(CGSizeMake(3,3)); - }]; + }]; + [self.greenDotView mas_makeConstraints:^(MASConstraintMaker *make) { + make.size.mas_equalTo(CGSizeMake(3,3)); + }]; [self.idLabel mas_makeConstraints:^(MASConstraintMaker *make) { make.height.mas_equalTo(14); }]; - - [self.giftEffectImageView mas_makeConstraints:^(MASConstraintMaker *make) { - make.size.mas_equalTo(CGSizeMake(10,10)); - }]; - - [self.lockRoomImageView mas_makeConstraints:^(MASConstraintMaker *make) { - make.size.mas_equalTo(CGSizeMake(10,10)); - }]; + + [self.giftEffectImageView mas_makeConstraints:^(MASConstraintMaker *make) { + make.size.mas_equalTo(CGSizeMake(10,10)); + }]; + + [self.lockRoomImageView mas_makeConstraints:^(MASConstraintMaker *make) { + make.size.mas_equalTo(CGSizeMake(10,10)); + }]; + + [self.backBtn mas_makeConstraints:^(MASConstraintMaker *make) { + make.left.mas_equalTo(15); + make.height.width.mas_equalTo(20); + make.centerY.mas_equalTo(self.settingButton); + }]; + } #pragma mark - RoomGuestDelegate - (void)onRoomEntered { - RoomInfoModel* roomInfo = self.hostDelegate.getRoomInfo; - ///最小化进房 人数不对的问题 - [[[NIMSDK sharedSDK] chatroomManager] fetchChatroomInfo:[NSString stringWithFormat:@"%ld", (long)self.hostDelegate.getRoomInfo.roomId] completion:^(NSError * _Nullable error, NIMChatroom * _Nullable chatroom) { - if (error == nil) { - self.idLabel.text = [NSString stringWithFormat:YMLocalizedString(@"RoomHeaderView3"), (long)(chatroom.onlineUserCount > 0 ? chatroom.onlineUserCount : 0), (long)roomInfo.erbanNo]; - } else { - self.idLabel.text = [NSString stringWithFormat:YMLocalizedString(@"RoomHeaderView3"), (long)(roomInfo.onlineNum > 0 ? roomInfo.onlineNum : 0), (long)roomInfo.erbanNo]; - } - }]; - - if (roomInfo) { - self.titleLabel.text = roomInfo.title; - self.giftEffectImageView.hidden = roomInfo.hasAnimationEffect; - if (roomInfo.uid == [AccountInfoStorage instance].getUid.integerValue) { - self.collectButton.hidden = YES; - } else { - self.collectButton.hidden = NO; - self.collectButton.selected = roomInfo.isRoomFans; - } - self.lockRoomImageView.hidden = roomInfo.roomPwd.length <= 0; - } - - if (![ClientConfig shareConfig].canOpen) { - self.onlineStackView.hidden = YES; - } + RoomInfoModel* roomInfo = self.hostDelegate.getRoomInfo; + ///最小化进房 人数不对的问题 + [[[NIMSDK sharedSDK] chatroomManager] fetchChatroomInfo:[NSString stringWithFormat:@"%ld", (long)self.hostDelegate.getRoomInfo.roomId] completion:^(NSError * _Nullable error, NIMChatroom * _Nullable chatroom) { + if (error == nil) { + self.idLabel.text = [NSString stringWithFormat:YMLocalizedString(@"RoomHeaderView0"), (long)(chatroom.onlineUserCount > 0 ? chatroom.onlineUserCount : 0), (long)roomInfo.erbanNo]; + } else { + self.idLabel.text = [NSString stringWithFormat:YMLocalizedString(@"RoomHeaderView1"), (long)(roomInfo.onlineNum > 0 ? roomInfo.onlineNum : 0), (long)roomInfo.erbanNo]; + } + }]; + + if (roomInfo) { + self.titleLabel.text = roomInfo.title; + self.giftEffectImageView.hidden = roomInfo.hasAnimationEffect; + if (roomInfo.uid == [AccountInfoStorage instance].getUid.integerValue) { + self.collectButton.hidden = YES; + self.cancelButton.hidden = YES; + } else { + self.collectButton.hidden = roomInfo.isRoomFans; + self.cancelButton.hidden = !roomInfo.isRoomFans; + } + self.lockRoomImageView.hidden = roomInfo.roomPwd.length <= 0; + } } - (void)onRoomUpdate { - RoomInfoModel* roomInfo = self.hostDelegate.getRoomInfo; - self.titleLabel.text = roomInfo.title; - self.idLabel.text = [NSString stringWithFormat:YMLocalizedString(@"RoomHeaderView3"), (long)(roomInfo.onlineNum > 0 ? roomInfo.onlineNum : 0), (long)roomInfo.erbanNo]; - self.giftEffectImageView.hidden = roomInfo.hasAnimationEffect; - if (roomInfo.uid == [AccountInfoStorage instance].getUid.integerValue) { - self.collectButton.hidden = YES; - } else { - self.collectButton.hidden = NO; - self.collectButton.selected = roomInfo.isRoomFans; - } - self.lockRoomImageView.hidden = roomInfo.roomPwd.length <= 0; - if (![ClientConfig shareConfig].canOpen) { - self.onlineStackView.hidden = YES; - } + RoomInfoModel* roomInfo = self.hostDelegate.getRoomInfo; + self.titleLabel.text = roomInfo.title; + self.idLabel.text = [NSString stringWithFormat:YMLocalizedString(@"RoomHeaderView2"), (long)(roomInfo.onlineNum > 0 ? roomInfo.onlineNum : 0), (long)roomInfo.erbanNo]; + self.giftEffectImageView.hidden = roomInfo.hasAnimationEffect; + if (roomInfo.uid == [AccountInfoStorage instance].getUid.integerValue) { + self.collectButton.hidden = YES; + self.cancelButton.hidden = YES; + } else { + self.collectButton.hidden = roomInfo.isRoomFans; + self.cancelButton.hidden = !roomInfo.isRoomFans; + } + self.lockRoomImageView.hidden = roomInfo.roomPwd.length <= 0; } #pragma mark - Event Response - (void)showSharePanel { - XPShareItem *cycle = [XPShareItem itemWitTag:XPShareItemTagMoments title:YMLocalizedString(@"RoomHeaderView6") imageName:@"share_wechat_circle_normal" disableImageName:@"share_wechat_circle_disable"]; - XPShareItem *wechat = [XPShareItem itemWitTag:XPShareItemTagWeChat title:YMLocalizedString(@"RoomHeaderView7") imageName:@"share_wechat_normal" disableImageName:@"share_wechat_disable"]; - XPShareItem *qq = [XPShareItem itemWitTag:XPShareItemTagQQ title:YMLocalizedString(@"RoomHeaderView8") imageName:@"share_qq_normal" disableImageName:@"share_qq_disable"]; - XPShareItem *qqzone = [XPShareItem itemWitTag:XPShareItemTagQQZone title:YMLocalizedString(@"RoomHeaderView9") imageName:@"share_qqzone_normal" disableImageName:@"share_qqzone_disable"]; - NSArray * items = @[wechat,cycle, qq, qqzone]; - RoomInfoModel * roomInfo = [self.hostDelegate getRoomInfo]; - XPShareInfoModel * shareInfo = [[XPShareInfoModel alloc] init]; - shareInfo.shareTitle = YMLocalizedString(@"RoomHeaderView10"); - shareInfo.shareContent = [NSString stringWithFormat:YMLocalizedString(@"RoomHeaderView11"), roomInfo.title]; - shareInfo.shareImageUrl = [self.hostDelegate getRoomInfo].avatar; - shareInfo.type = ShareType_Room; - shareInfo.roomUid = roomInfo.uid; - NSString * uid = [AccountInfoStorage instance].getUid; - NSString * urlString = [NSString stringWithFormat:@"%@/%@?shareUid=%@&uid=%ld&room_name=%@&room_id=%ld&room_avatar=%@&share_name=%@",API_HOST_URL,URLWithType(kShareRoomURL),uid,roomInfo.uid,roomInfo.title,roomInfo.erbanNo,roomInfo.avatar,roomInfo.nick]; - shareInfo.shareUrl = urlString; - CGFloat margin = 15; - CGSize itemSize = CGSizeMake((KScreenWidth-2*margin)/4, 65); - XPShareView *shareView = [[XPShareView alloc] initWithItems:items itemSize:itemSize shareInfo:shareInfo]; - shareView.delegate = self; - [TTPopup popupView:shareView style:TTPopupStyleActionSheet]; + + + XPShareItem *cycle = [XPShareItem itemWitTag:XPShareItemTagFaceBook title:@"FaceBook" imageName:@"share_fb" disableImageName:@"share_fb"]; + XPShareItem *wechat = [XPShareItem itemWitTag:XPShareItemTagLine title:@"Line" imageName:@"share_line" disableImageName:@"share_line"]; + XPShareItem *qq = [XPShareItem itemWitTag:XPShareItemTagCopyLink title:YMLocalizedString(@"RoomHeaderView3") imageName:@"share_copy_link" disableImageName:@"share_copy_link"]; + NSArray * items = @[wechat,cycle, qq]; + RoomInfoModel * roomInfo = [self.hostDelegate getRoomInfo]; + XPShareInfoModel * shareInfo = [[XPShareInfoModel alloc] init]; + shareInfo.shareTitle = YMLocalizedString(@"RoomHeaderView4"); + shareInfo.shareContent = YMLocalizedString(@"RoomHeaderView5"); + shareInfo.shareImageUrl = [self.hostDelegate getRoomInfo].avatar; + shareInfo.type = ShareType_Room; + shareInfo.roomUid = roomInfo.uid; + NSString * uid = [AccountInfoStorage instance].getUid; + NSString * urlString = [NSString stringWithFormat:@"%@/%@?shareUid=%@&uid=%ld&room_name=%@&room_id=%ld&room_avatar=%@&share_name=%@",API_HOST_URL,URLWithType(kShareRoomURL),uid,roomInfo.uid,roomInfo.title,roomInfo.erbanNo,roomInfo.avatar,roomInfo.nick]; + urlString = [urlString stringByAddingPercentEncodingWithAllowedCharacters:[NSCharacterSet URLFragmentAllowedCharacterSet]]; + shareInfo.shareUrl = urlString; + CGFloat margin = 15; + CGSize itemSize = CGSizeMake((KScreenWidth-2*margin)/4, 65); + XPShareView *shareView = [[XPShareView alloc] initWithItems:items itemSize:itemSize shareInfo:shareInfo]; + shareView.delegate = self; + [TTPopup popupView:shareView style:TTPopupStyleActionSheet]; } ///保存一下分享的内容的 不需要处理错误码 - (void)saveShare:(XPShareInfoModel *)shareInfo { - NSMutableDictionary *params = [NSMutableDictionary dictionary]; - NSString *uid = [AccountInfoStorage instance].getUid; - NSString *ticket = [AccountInfoStorage instance].getTicket; - [params safeSetObject:uid forKey:@"uid"]; - [params safeSetObject:@(shareInfo.shareType) forKey:@"shareType"]; - [params safeSetObject:ticket forKey:@"ticket"]; - [params safeSetObject:@(shareInfo.type) forKey:@"sharePageId"]; - if (shareInfo.shareUrl.length > 0) { - [params safeSetObject:shareInfo.shareUrl forKey:@"shareUrl"]; - } - if (shareInfo.roomUid > 0) { - [params safeSetObject:@(shareInfo.roomUid) forKey:@"targetUid"]; - } - [HttpRequestHelper POST:@"usershare/save" params:params success:^(BaseModel * _Nonnull data) { - - } failure:^(NSInteger resCode, NSString * _Nonnull message) { - - }]; + NSMutableDictionary *params = [NSMutableDictionary dictionary]; + NSString *uid = [AccountInfoStorage instance].getUid; + NSString *ticket = [AccountInfoStorage instance].getTicket; + [params setObject:uid forKey:@"uid"]; + [params setObject:@(shareInfo.shareType) forKey:@"shareType"]; + [params setObject:ticket forKey:@"ticket"]; + [params setObject:@(shareInfo.type) forKey:@"sharePageId"]; + if (shareInfo.shareUrl.length > 0) { + [params setObject:shareInfo.shareUrl forKey:@"shareUrl"]; + } + if (shareInfo.roomUid > 0) { + [params setObject:@(shareInfo.roomUid) forKey:@"targetUid"]; + } + [HttpRequestHelper POST:@"usershare/save" params:params success:^(BaseModel * _Nonnull data) { + + } failure:^(NSInteger resCode, NSString * _Nonnull message) { + + }]; } - (void)collectButtonAction:(UIButton *)sender { - NSString * type = sender.selected ? @"2" : @"1"; - NSString * uid = [AccountInfoStorage instance].getUid; - NSString * roomUid = [NSString stringWithFormat:@"%ld", self.hostDelegate.getRoomInfo.uid]; - [Api collectRoom:^(BaseModel * _Nullable data, NSInteger code, NSString * _Nullable msg) { - if (code == 200) { - sender.selected= !sender.selected; - if ([type isEqualToString:@"1"]) {///收藏的话 - [StatisticsServiceHelper trackEventWithKey:StatisticsServiceEventroom_collect_icon_click eventAttributes:@{@"roomUid" : @(self.hostDelegate.getRoomInfo.uid)}]; - [XNDJTDDLoadingTool showSuccessWithMessage:YMLocalizedString(@"RoomHeaderView12")]; + + + + NSString * type = sender == self.cancelButton ? @"2" : @"1"; + NSString * uid = [AccountInfoStorage instance].getUid; + NSString * roomUid = [NSString stringWithFormat:@"%ld", self.hostDelegate.getRoomInfo.uid]; + [Api collectRoom:^(BaseModel * _Nullable data, NSInteger code, NSString * _Nullable msg) { + if (code == 200) { + + self.collectButton.hidden = !self.collectButton.hidden; + self.cancelButton.hidden = !self.cancelButton.hidden; + + + if ([type isEqualToString:@"1"]) {///收藏的话 + [XNDJTDDLoadingTool showSuccessWithMessage:YMLocalizedString(@"RoomHeaderView6")]; if (self.hadShowCollectInScreen) { return; } self.hadShowCollectInScreen = YES; - NSMutableDictionary * dic = [NSMutableDictionary dictionary]; - [dic safeSetObject:[AccountInfoStorage instance].getUid forKey:@"uid"]; - [dic safeSetObject:self.hostDelegate.getUserInfo.nick forKey:@"nick"]; - [dic safeSetObject:[NSString stringWithFormat:@"%ld", self.hostDelegate.getRoomInfo.uid] forKey:@"targetUid"]; - [dic safeSetObject:self.hostDelegate.getRoomInfo.nick forKey:@"targetNick"]; - NSDictionary * data = @{@"data":dic}; - AttachmentModel *attachment = [[AttachmentModel alloc]init]; - attachment.first = CustomMessageType_Collection_Room; - attachment.second = Custom_Message_Sub_Collect_Room_Tips; - attachment.data = data; - NIMMessage *message = [[NIMMessage alloc]init]; - NIMCustomObject *object = [[NIMCustomObject alloc] init]; - object.attachment = attachment; - message.messageObject = object; - NSString *sessionId = [NSString stringWithFormat:@"%ld",self.hostDelegate.getRoomInfo.roomId]; - //构造会话 - NIMSession *session = [NIMSession session:sessionId type:NIMSessionTypeChatroom]; - [[NIMSDK sharedSDK].chatManager sendMessage:message toSession:session error:nil]; - } - } else { - [XNDJTDDLoadingTool showErrorWithMessage:msg]; - } - } roomUid:roomUid uid:uid type:type roomUids:NULL]; + NSMutableDictionary * dic = [NSMutableDictionary dictionary]; + [dic setValue:[AccountInfoStorage instance].getUid forKey:@"uid"]; + [dic setValue:self.hostDelegate.getUserInfo.nick forKey:@"nick"]; + [dic setValue:[NSString stringWithFormat:@"%ld", self.hostDelegate.getRoomInfo.uid] forKey:@"targetUid"]; + [dic setValue:self.hostDelegate.getRoomInfo.nick forKey:@"targetNick"]; + NSDictionary * data = @{@"data":dic}; + AttachmentModel *attachment = [[AttachmentModel alloc]init]; + attachment.first = CustomMessageType_Collection_Room; + attachment.second = Custom_Message_Sub_Collect_Room_Tips; + attachment.data = data; + NIMMessage *message = [[NIMMessage alloc]init]; + NIMCustomObject *object = [[NIMCustomObject alloc] init]; + object.attachment = attachment; + message.messageObject = object; + NSString *sessionId = [NSString stringWithFormat:@"%ld",self.hostDelegate.getRoomInfo.roomId]; + //构造会话 + NIMSession *session = [NIMSession session:sessionId type:NIMSessionTypeChatroom]; + [[NIMSDK sharedSDK].chatManager sendMessage:message toSession:session error:nil]; + } + } else { + [XNDJTDDLoadingTool showErrorWithMessage:msg]; + } + } roomUid:roomUid uid:uid type:type roomUids:NULL]; } #pragma mark - XCShareViewDelegate - (void)shareView:(XPShareView *)shareView shareFail:(NSString *)message { - [TTPopup dismiss]; - [XNDJTDDLoadingTool showErrorWithMessage:message]; + [TTPopup dismiss]; + [XNDJTDDLoadingTool showErrorWithMessage:message]; } - (void)shareView:(XPShareView *)shareView didSuccess:(XPShareInfoModel *)shareInfo{ - [TTPopup dismiss]; - [XNDJTDDLoadingTool showErrorWithMessage:YMLocalizedString(@"RoomHeaderView13")]; - AttachmentModel * attachMent = [[AttachmentModel alloc] init]; - attachMent.first = CustomMessageType_Room_Tip; - attachMent.second = Custom_Message_Sub_Room_Tip_ShareRoom; - NSMutableDictionary * dic = [NSMutableDictionary dictionary]; - NSString * uid = [AccountInfoStorage instance].getUid; - [dic safeSetObject:uid forKey:@"uid"]; - NSMutableDictionary * userDic = [NSMutableDictionary dictionary]; - UserInfoModel * userInfo = [self.hostDelegate getUserInfo]; - RoomInfoModel * roomInfo = [self.hostDelegate getRoomInfo]; - [userDic safeSetObject:roomInfo.nick.length > 0 ? roomInfo.nick : @"" forKey:@"targetNick"]; - [userDic safeSetObject:@(roomInfo.uid) forKey:@"targetUid"]; - [userDic safeSetObject:userInfo.nick.length > 0 ? userInfo.nick : @"" forKey:@"nick"]; - [dic safeSetObject:userDic forKey:@"data"]; - attachMent.data = dic; - NSString *sessionID = [NSString stringWithFormat:@"%ld", [self.hostDelegate getRoomInfo].roomId]; - - NIMMessage *message = [[NIMMessage alloc]init]; - NIMCustomObject *object = [[NIMCustomObject alloc] init]; - object.attachment = attachMent; - message.messageObject = object; - //构造会话 - NIMSession *session = [NIMSession session:sessionID type:NIMSessionTypeChatroom]; - [[NIMSDK sharedSDK].chatManager sendMessage:message toSession:session error:nil]; - ///上报一下 - [self saveShare:shareInfo]; + [TTPopup dismiss]; + [XNDJTDDLoadingTool showErrorWithMessage:YMLocalizedString(@"RoomHeaderView7")]; + AttachmentModel * attachMent = [[AttachmentModel alloc] init]; + attachMent.first = CustomMessageType_Room_Tip; + attachMent.second = Custom_Message_Sub_Room_Tip_ShareRoom; + NSMutableDictionary * dic = [NSMutableDictionary dictionary]; + NSString * uid = [AccountInfoStorage instance].getUid; + [dic setValue:uid forKey:@"uid"]; + NSMutableDictionary * userDic = [NSMutableDictionary dictionary]; + UserInfoModel * userInfo = [self.hostDelegate getUserInfo]; + RoomInfoModel * roomInfo = [self.hostDelegate getRoomInfo]; + [userDic setValue:roomInfo.nick.length > 0 ? roomInfo.nick : @"" forKey:@"targetNick"]; + [userDic setValue:@(roomInfo.uid) forKey:@"targetUid"]; + [userDic setValue:userInfo.nick.length > 0 ? userInfo.nick : @"" forKey:@"nick"]; + [dic setValue:userDic forKey:@"data"]; + attachMent.data = dic; + NSString *sessionID = [NSString stringWithFormat:@"%ld", [self.hostDelegate getRoomInfo].roomId]; + + NIMMessage *message = [[NIMMessage alloc]init]; + NIMCustomObject *object = [[NIMCustomObject alloc] init]; + object.attachment = attachMent; + message.messageObject = object; + //构造会话 + NIMSession *session = [NIMSession session:sessionID type:NIMSessionTypeChatroom]; + [[NIMSDK sharedSDK].chatManager sendMessage:message toSession:session error:nil]; + ///上报一下 + [self saveShare:shareInfo]; } - (void)shareViewDidClickCancel:(XPShareView *)shareView { - [TTPopup dismiss]; + [TTPopup dismiss]; } #pragma mark - XPRoomRecommendViewDelegate - (void)xPRoomRecommendViewReport { - [StatisticsServiceHelper trackEventWithKey:StatisticsServiceEventroom_more_icon_click eventAttributes:@{@"reportRoom" : @(self.hostDelegate.getRoomInfo.uid)}]; - [FFPopup dismissPopupForView:self.recommendRoomView animated:NO]; - XPWebViewController * webVC = [[XPWebViewController alloc] init]; - NSString *urlstr = [NSString stringWithFormat:@"%@?reportUid=%ld&source=ROOM", URLWithType(kReportRoomURL),self.hostDelegate.getRoomInfo.uid]; - webVC.url = urlstr; - [[self.hostDelegate getCurrentNav] pushViewController:webVC animated:YES]; + TTActionSheetConfig *action = [TTActionSheetConfig normalTitle:YMLocalizedString(@"RoomHeaderView10") clickAction:^{ + [FFPopup dismissPopupForView:self.recommendRoomView animated:NO]; + [self.hostDelegate requesstShieldingAction]; + }]; + TTActionSheetConfig *action1 = [TTActionSheetConfig normalTitle:YMLocalizedString(@"RoomHeaderView12") clickAction:^{ + [FFPopup dismissPopupForView:self.recommendRoomView animated:NO]; + XPWebViewController * webVC = [[XPWebViewController alloc] init]; + NSString *urlstr = [NSString stringWithFormat:@"%@?reportUid=%ld&source=ROOM", URLWithType(kReportRoomURL),self.hostDelegate.getRoomInfo.uid]; + webVC.url = urlstr; + [[self.hostDelegate getCurrentNav] pushViewController:webVC animated:YES]; + }]; + [TTPopup actionSheetWithItems:@[action,action1]]; } - (void)xPRoomRecommendViewMiniRoom { - [StatisticsServiceHelper trackEventWithKey:StatisticsServiceEventroom_more_icon_click eventAttributes:@{@"miniRoom" : @(self.hostDelegate.getRoomInfo.uid)}]; [FFPopup dismissPopupForView:self.recommendRoomView animated:NO]; [self.hostDelegate miniRoom]; } - (void)xPRoomRecommendViewExitRoom { - [StatisticsServiceHelper trackEventWithKey:StatisticsServiceEventroom_more_icon_click eventAttributes:@{@"exitRoom" : @(self.hostDelegate.getRoomInfo.uid)}]; [FFPopup dismissPopupForView:self.recommendRoomView animated:NO]; [self.hostDelegate exitRoom]; } -- (void)xPRoomRecommendViewShare { - [StatisticsServiceHelper trackEventWithKey:StatisticsServiceEventroom_more_icon_click eventAttributes:@{@"shareRoom" : @(self.hostDelegate.getRoomInfo.uid)}]; - [FFPopup dismissPopupForView:self.recommendRoomView animated:NO]; - [self showSharePanel]; -} - - (void)xPRoomRecommendViewJumpToRoom:(NSString *)roomUid { - [StatisticsServiceHelper trackEventWithKey:StatisticsServiceEventroom_more_icon_click eventAttributes:@{@"jumpToRoom" : roomUid}]; [FFPopup dismissPopupForView:self.recommendRoomView animated:NO]; [self.hostDelegate exitRoom]; dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(1 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{ @@ -412,123 +402,140 @@ } #pragma mark - Getters And Setters -- (UIButton *)backButton{ - if (!_backButton) { - _backButton = [[UIButton alloc] init]; - [_backButton setImage:[UIImage imageNamed:@"room_info_back"] forState:UIControlStateNormal]; - [_backButton addTarget:self action:@selector(backButtonAction:) forControlEvents:UIControlEventTouchUpInside]; - [_backButton setEnlargeEdgeWithTop:15 right:15 bottom:15 left:15]; +- (UIButton *)shareButton { + if(!_shareButton){ + _shareButton = [UIButton buttonWithType:UIButtonTypeCustom]; + [_shareButton setImage:[UIImage imageNamed:@"room_info_share"] forState:UIControlStateNormal]; + [_shareButton addTarget:self action:@selector(shareButtonAction:) forControlEvents:UIControlEventTouchUpInside]; + [_shareButton setEnlargeEdgeWithTop:8 right:8 bottom:8 left:8]; } - return _backButton; + return _shareButton; } - (UIButton *)settingButton { - if (!_settingButton) { - _settingButton = [UIButton buttonWithType:UIButtonTypeCustom]; - [_settingButton setImage:[UIImage imageNamed:@"room_info_setting"] forState:UIControlStateNormal]; - [_settingButton addTarget:self action:@selector(settingButtonAction:) forControlEvents:UIControlEventTouchUpInside]; - [_settingButton setEnlargeEdgeWithTop:8 right:8 bottom:8 left:8]; - } - return _settingButton; + if (!_settingButton) { + _settingButton = [UIButton buttonWithType:UIButtonTypeCustom]; + [_settingButton setImage:[UIImage imageNamed:@"room_info_setting"] forState:UIControlStateNormal]; + [_settingButton addTarget:self action:@selector(settingButtonAction:) forControlEvents:UIControlEventTouchUpInside]; + [_settingButton setEnlargeEdgeWithTop:8 right:8 bottom:8 left:8]; + } + return _settingButton; } - (UIButton *)collectButton { - if (!_collectButton) { - _collectButton = [UIButton buttonWithType:UIButtonTypeCustom]; - [_collectButton setImage:[UIImage imageNamed:@"room_collect_normal"] forState:UIControlStateNormal]; - [_collectButton setImage:[UIImage imageNamed:@"room_collect_selected"] forState:UIControlStateSelected]; - [_collectButton addTarget:self action:@selector(collectButtonAction:) forControlEvents:UIControlEventTouchUpInside]; - [_collectButton setEnlargeEdgeWithTop:8 right:8 bottom:8 left:8]; - _collectButton.adjustsImageWhenHighlighted = NO; - _collectButton.hidden = YES; - } - return _collectButton; + if (!_collectButton) { + _collectButton = [UIButton buttonWithType:UIButtonTypeCustom]; + [_collectButton setTitle:YMLocalizedString(@"RoomHeaderView8") forState:UIControlStateNormal]; + [_collectButton setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal]; + _collectButton.titleLabel.font = [UIFont systemFontOfSize:12]; + + _collectButton.backgroundColor = UIColorFromRGB(0x67D7D7); + _collectButton.layer.masksToBounds = YES; + _collectButton.layer.cornerRadius = 23 / 2.0; + _collectButton.hidden = YES; + [_collectButton addTarget:self action:@selector(collectButtonAction:) forControlEvents:UIControlEventTouchUpInside]; + } + return _collectButton; +} +-(UIButton *)cancelButton{ + if (!_cancelButton){ + _cancelButton = [UIButton buttonWithType:UIButtonTypeCustom]; + [_cancelButton setTitle:YMLocalizedString(@"RoomHeaderView9") forState:UIControlStateNormal]; + [_cancelButton setTitleColor:[UIColor colorWithWhite:1 alpha:0.9] forState:UIControlStateNormal]; + _cancelButton.titleLabel.font = [UIFont systemFontOfSize:12]; + [_cancelButton setBackgroundImage:[UIImage new] forState:UIControlStateNormal]; + _cancelButton.backgroundColor = [UIColor colorWithWhite:1 alpha:0.3]; + _cancelButton.layer.masksToBounds = YES; + _cancelButton.layer.cornerRadius = 23 / 2.0; + _cancelButton.hidden = YES; + [_cancelButton addTarget:self action:@selector(collectButtonAction:) forControlEvents:UIControlEventTouchUpInside]; + } + return _cancelButton; } - - (UIStackView *)nickStackView { - if (!_nickStackView) { - _nickStackView = [[UIStackView alloc] init]; - _nickStackView.axis = UILayoutConstraintAxisVertical; - _nickStackView.distribution = UIStackViewDistributionFill; - _nickStackView.alignment = UIStackViewAlignmentLeading; - } - return _nickStackView; + if (!_nickStackView) { + _nickStackView = [[UIStackView alloc] init]; + _nickStackView.axis = UILayoutConstraintAxisVertical; + _nickStackView.distribution = UIStackViewDistributionFill; + _nickStackView.alignment = UIStackViewAlignmentLeading; + } + return _nickStackView; } - (UIStackView *)titleStackView { - if (!_titleStackView) { - _titleStackView = [[UIStackView alloc] init]; - _titleStackView.axis = UILayoutConstraintAxisHorizontal; - _titleStackView.distribution = UIStackViewDistributionFill; - _titleStackView.alignment = UIStackViewAlignmentCenter; - _titleStackView.spacing = 5; - } - return _titleStackView; + if (!_titleStackView) { + _titleStackView = [[UIStackView alloc] init]; + _titleStackView.axis = UILayoutConstraintAxisHorizontal; + _titleStackView.distribution = UIStackViewDistributionFill; + _titleStackView.alignment = UIStackViewAlignmentCenter; + _titleStackView.spacing = 5; + } + return _titleStackView; } - (MarqueeLabel *)titleLabel{ - if (!_titleLabel) { - _titleLabel = [[MarqueeLabel alloc] init]; - _titleLabel.scrollDuration = 8.0; - _titleLabel.fadeLength = 6.0f; - _titleLabel.font = [UIFont fontWithName:@"PingFang-SC-Bold" size:15]; - _titleLabel.textColor = [DJDKMIMOMColor roomOwnerNickColor]; + if (!_titleLabel) { + _titleLabel = [[MarqueeLabel alloc] init]; + _titleLabel.scrollDuration = 8.0; + _titleLabel.fadeLength = 6.0f; + _titleLabel.font = [UIFont systemFontOfSize:14]; + _titleLabel.textColor = [DJDKMIMOMColor roomOwnerNickColor]; _titleLabel.userInteractionEnabled = YES; UITapGestureRecognizer * tap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(onlineTapRecognizer)]; [_titleLabel addGestureRecognizer:tap]; - } - return _titleLabel; + } + return _titleLabel; } - (UIImageView *)giftEffectImageView { - if (!_giftEffectImageView) { - _giftEffectImageView = [[UIImageView alloc] init]; - _giftEffectImageView.userInteractionEnabled = YES; - _giftEffectImageView.image = [UIImage imageNamed:@"room_info_gift_effect"]; - } - return _giftEffectImageView; + if (!_giftEffectImageView) { + _giftEffectImageView = [[UIImageView alloc] init]; + _giftEffectImageView.userInteractionEnabled = YES; + _giftEffectImageView.image = [UIImage imageNamed:@"room_info_gift_effect"]; + } + return _giftEffectImageView; } - (UIImageView *)lockRoomImageView { - if (!_lockRoomImageView) { - _lockRoomImageView = [[UIImageView alloc] init]; - _lockRoomImageView.userInteractionEnabled = YES; - _lockRoomImageView.image = [UIImage imageNamed:@"room_info_lock_room"]; - _lockRoomImageView.hidden = YES; - } - return _lockRoomImageView; + if (!_lockRoomImageView) { + _lockRoomImageView = [[UIImageView alloc] init]; + _lockRoomImageView.userInteractionEnabled = YES; + _lockRoomImageView.image = [UIImage imageNamed:@"room_info_lock_room"]; + _lockRoomImageView.hidden = YES; + } + return _lockRoomImageView; } - (UIStackView *)onlineStackView { - if (!_onlineStackView) { - _onlineStackView = [[UIStackView alloc] init]; - _onlineStackView.axis = UILayoutConstraintAxisHorizontal; - _onlineStackView.distribution = UIStackViewDistributionFill; - _onlineStackView.alignment = UIStackViewAlignmentCenter; - _onlineStackView.spacing = 2; - UITapGestureRecognizer * tap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(onlineTapRecognizer)]; - [_onlineStackView addGestureRecognizer:tap]; - } - return _onlineStackView; + if (!_onlineStackView) { + _onlineStackView = [[UIStackView alloc] init]; + _onlineStackView.axis = UILayoutConstraintAxisHorizontal; + _onlineStackView.distribution = UIStackViewDistributionFill; + _onlineStackView.alignment = UIStackViewAlignmentCenter; + _onlineStackView.spacing = 2; + UITapGestureRecognizer * tap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(onlineTapRecognizer)]; + [_onlineStackView addGestureRecognizer:tap]; + } + return _onlineStackView; } - (UIView *)greenDotView { - if (!_greenDotView) { - _greenDotView = [[UIView alloc] init]; - _greenDotView.backgroundColor = [DJDKMIMOMColor roomOnLineIdenColor]; - _greenDotView.layer.masksToBounds = YES; - _greenDotView.layer.cornerRadius = 1.5; - } - return _greenDotView; + if (!_greenDotView) { + _greenDotView = [[UIView alloc] init]; + _greenDotView.backgroundColor = [DJDKMIMOMColor roomOnLineIdenColor]; + _greenDotView.layer.masksToBounds = YES; + _greenDotView.layer.cornerRadius = 1.5; + } + return _greenDotView; } - (YYLabel *)idLabel { - if (!_idLabel) { - _idLabel = [[YYLabel alloc] init]; - _idLabel.textColor = [DJDKMIMOMColor roomOwnerNickColor]; - _idLabel.font = [UIFont systemFontOfSize:10]; - } - return _idLabel; + if (!_idLabel) { + _idLabel = [[YYLabel alloc] init]; + _idLabel.textColor = [DJDKMIMOMColor roomOnLineIdenColor]; + _idLabel.font = [UIFont systemFontOfSize:10]; + } + return _idLabel; } - (XPRoomRecommendView *)recommendRoomView { @@ -539,4 +546,14 @@ return _recommendRoomView; } +- (UIButton *)backBtn{ + if (!_backBtn){ + _backBtn = [UIButton new]; + [_backBtn setBackgroundImage:[UIImage imageNamed:@"common_nav_back_white"] forState:UIControlStateNormal]; + [_backBtn addTarget:self action:@selector(backButtonAction:) forControlEvents:UIControlEventTouchUpInside]; + [_backBtn setCornerWithLeftTopCorner:10 rightTopCorner:10 bottomLeftCorner:10 bottomRightCorner:10 size:CGSizeMake(20,20)]; + } + return _backBtn; +} + @end diff --git a/YuMi/Modules/YMRoom/View/RoomHostDelegate.h b/YuMi/Modules/YMRoom/View/RoomHostDelegate.h index f31b3e42..a521562e 100644 --- a/YuMi/Modules/YMRoom/View/RoomHostDelegate.h +++ b/YuMi/Modules/YMRoom/View/RoomHostDelegate.h @@ -36,6 +36,8 @@ NS_ASSUME_NONNULL_BEGIN - (NSArray *)getRoomPKGroupTeamList; ///房间内PK是否正在进行 - (BOOL)isRoomPKPlaying; +///屏蔽 +-(void)requesstShieldingAction; @end NS_ASSUME_NONNULL_END diff --git a/YuMi/Modules/YMRoom/View/RoomRecommend/XPRoomRecommendView.h b/YuMi/Modules/YMRoom/View/RoomRecommend/XPRoomRecommendView.h index adbb7c3d..b12a2987 100644 --- a/YuMi/Modules/YMRoom/View/RoomRecommend/XPRoomRecommendView.h +++ b/YuMi/Modules/YMRoom/View/RoomRecommend/XPRoomRecommendView.h @@ -10,7 +10,7 @@ NS_ASSUME_NONNULL_BEGIN @protocol XPRoomRecommendViewDelegate - +@optional ///举报房间 - (void)xPRoomRecommendViewReport; ///最小化房间 diff --git a/YuMi/Modules/YMRoom/View/RoomRecommend/XPRoomRecommendView.m b/YuMi/Modules/YMRoom/View/RoomRecommend/XPRoomRecommendView.m index 260e65b5..0c600e88 100644 --- a/YuMi/Modules/YMRoom/View/RoomRecommend/XPRoomRecommendView.m +++ b/YuMi/Modules/YMRoom/View/RoomRecommend/XPRoomRecommendView.m @@ -1,31 +1,37 @@ // -// YMRoomRecommendView.m -// YUMI +// XPRoomRecommendView.m +// xplan-ios // -// Created by YUMI on 2022/4/28. +// Created by GreenLand on 2022/4/28. // #import "XPRoomRecommendView.h" ///Third #import ///Tool -#import "YUMIMacroUitls.h" -#import "DJDKMIMOMColor.h" -#import "NSArray+Safe.h" + ///View #import "XPRoomInsideRecommendCell.h" #import "XPRoomInsideRecommendEmptyCell.h" -#import "XPRoomInsideOperationCell.h" -@interface XPRoomRecommendView () +@interface XPRoomRecommendView () ///模糊背景 @property (nonatomic, strong) UIToolbar *toolBar; @property (nonatomic, strong) UITableView *tableView; -@property (nonatomic, strong) UICollectionView *collectionView; -@property (nonatomic, strong) NSMutableArray *titleArray; -@property (nonatomic, strong) NSMutableArray *imageArray; +@property (nonatomic, strong) UIStackView *miniStackView; +@property (nonatomic, strong) UIStackView *exitStackView; + +///最小化 +@property (nonatomic,strong) UIButton *miniButton; +///退出房间 +@property (nonatomic,strong) UIButton *exitButton; + +///最小化 +@property (nonatomic,strong) UILabel *miniLabel; +///退出房间 +@property (nonatomic,strong) UILabel *exitLabel; ///为你推荐 @property (nonatomic, strong) UILabel *recommentLabel; @@ -44,7 +50,12 @@ #pragma mark - lifeCycle - (void)setUpUI { [self addSubview:self.toolBar]; - [self addSubview:self.collectionView]; + [self addSubview:self.miniStackView]; + [self addSubview:self.exitStackView]; + [self.miniStackView addArrangedSubview:self.miniButton]; + [self.miniStackView addArrangedSubview:self.miniLabel]; + [self.exitStackView addArrangedSubview:self.exitButton]; + [self.exitStackView addArrangedSubview:self.exitLabel]; [self addSubview:self.recommentLabel]; [self addSubview:self.tableView]; } @@ -59,13 +70,25 @@ [self.toolBar mas_makeConstraints:^(MASConstraintMaker *make) { make.top.left.right.bottom.mas_equalTo(self); }]; - [self.collectionView mas_makeConstraints:^(MASConstraintMaker *make) { - make.left.right.mas_equalTo(0); + + [self.miniStackView mas_makeConstraints:^(MASConstraintMaker *make) { make.top.mas_equalTo(kStatusBarHeight + 8); - make.height.mas_equalTo(82*2); + make.left.mas_equalTo(self).mas_offset(36); + }]; + [self.exitStackView mas_makeConstraints:^(MASConstraintMaker *make) { + make.top.mas_equalTo(kStatusBarHeight + 8); + make.left.mas_equalTo(self.miniStackView.mas_right).mas_offset(72); + }]; + + + [self.miniButton mas_makeConstraints:^(MASConstraintMaker *make) { + make.width.height.mas_equalTo(54); + }]; + [self.exitButton mas_makeConstraints:^(MASConstraintMaker *make) { + make.width.height.mas_equalTo(54); }]; [self.recommentLabel mas_makeConstraints:^(MASConstraintMaker *make) { - make.top.mas_equalTo(self.collectionView.mas_bottom).mas_offset(16); + make.top.mas_equalTo(self.miniStackView.mas_bottom).mas_offset(16); make.left.mas_equalTo(11); }]; [self.tableView mas_makeConstraints:^(MASConstraintMaker *make) { @@ -73,38 +96,6 @@ make.top.mas_equalTo(self.recommentLabel.mas_bottom); }]; } -#pragma mark - UICollectionViewDataSource -- (NSInteger)collectionView:(UICollectionView *)collectionView numberOfItemsInSection:(NSInteger)section { - return self.titleArray.count; -} - -- (__kindof UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath { - XPRoomInsideOperationCell *cell = [collectionView dequeueReusableCellWithReuseIdentifier:NSStringFromClass([XPRoomInsideOperationCell class]) forIndexPath:indexPath]; - cell.title = [self.titleArray safeObjectAtIndex1:indexPath.row]; - cell.imageName = [self.imageArray safeObjectAtIndex1:indexPath.row]; - return cell; -} - -- (void)collectionView:(UICollectionView *)collectionView didSelectItemAtIndexPath:(NSIndexPath *)indexPath { - if (indexPath.row == 0) {//最小化房间 - if (self.delegate && [self.delegate respondsToSelector:@selector(xPRoomRecommendViewMiniRoom)]) { - [self.delegate xPRoomRecommendViewMiniRoom]; - } - } else if (indexPath.row == 1) {//分享房间 - if (self.delegate && [self.delegate respondsToSelector:@selector(xPRoomRecommendViewExitRoom)]) { - [self.delegate xPRoomRecommendViewExitRoom]; - } - } else if (indexPath.row == 2) {//退出房间 - if (self.delegate && [self.delegate respondsToSelector:@selector(xPRoomRecommendViewReport)]) { - [self.delegate xPRoomRecommendViewReport]; - } - } else {//举报房间 - if (self.delegate && [self.delegate respondsToSelector:@selector(xPRoomRecommendViewShare)]) { - [self.delegate xPRoomRecommendViewShare]; - } - - } -} #pragma mark - UITableViewDelegate - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section { @@ -114,7 +105,7 @@ - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { if (self.roomList.count > 0) { XPRoomInsideRecommendCell * cell = [tableView dequeueReusableCellWithIdentifier:NSStringFromClass([XPRoomInsideRecommendCell class])]; - XPRoomRecommendModel *model = [self.roomList safeObjectAtIndex1:indexPath.row]; + XPRoomRecommendModel *model = self.roomList[indexPath.row]; cell.model = model; return cell; } @@ -128,7 +119,7 @@ - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath { [tableView deselectRowAtIndexPath:indexPath animated:YES]; if (self.roomList.count > 0) { - XPRoomRecommendModel *model = [self.roomList safeObjectAtIndex1:indexPath.row]; + XPRoomRecommendModel *model = self.roomList[indexPath.row]; if (self.delegate && [self.delegate respondsToSelector:@selector(xPRoomRecommendViewJumpToRoom:)]) { [self.delegate xPRoomRecommendViewJumpToRoom:[NSString stringWithFormat:@"%ld", model.uid]]; } @@ -139,6 +130,25 @@ return self.roomList.count > 0 ? 84 : KScreenHeight - kStatusBarHeight -8 - 120; } +#pragma mark - atcion +- (void)reportButtonAction:(UIButton *)sender { + if (self.delegate && [self.delegate respondsToSelector:@selector(xPRoomRecommendViewReport)]) { + [self.delegate xPRoomRecommendViewReport]; + } +} + +- (void)miniButtonAction:(UIButton *)sender { + if (self.delegate && [self.delegate respondsToSelector:@selector(xPRoomRecommendViewMiniRoom)]) { + [self.delegate xPRoomRecommendViewMiniRoom]; + } +} + +- (void)exitButtonAction:(UIButton *)sender{ + if (self.delegate && [self.delegate respondsToSelector:@selector(xPRoomRecommendViewExitRoom)]) { + [self.delegate xPRoomRecommendViewExitRoom]; + } +} + #pragma mark - getter - (UIToolbar *)toolBar { if (!_toolBar) { @@ -149,10 +159,78 @@ return _toolBar; } +- (UIButton *)miniButton { + if(!_miniButton){ + _miniButton = [UIButton buttonWithType:UIButtonTypeCustom]; + [_miniButton setImage:[UIImage imageNamed:@"room_info_mini"] forState:UIControlStateNormal]; + [_miniButton addTarget:self action:@selector(miniButtonAction:) forControlEvents:UIControlEventTouchUpInside]; + [_miniButton setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal]; + _miniButton.titleLabel.font = [UIFont systemFontOfSize:12 weight:UIFontWeightMedium]; + } + return _miniButton; +} + +- (UIButton *)exitButton { + if (!_exitButton) { + _exitButton = [UIButton buttonWithType:UIButtonTypeCustom]; + [_exitButton setImage:[UIImage imageNamed:@"room_info_exit"] forState:UIControlStateNormal]; + [_exitButton addTarget:self action:@selector(exitButtonAction:) forControlEvents:UIControlEventTouchUpInside]; + } + return _exitButton; +} + + + + +- (UIStackView *)miniStackView { + if (!_miniStackView) { + _miniStackView = [[UIStackView alloc] init]; + _miniStackView.axis = UILayoutConstraintAxisVertical; + _miniStackView.distribution = UIStackViewDistributionFill; + _miniStackView.alignment = UIStackViewAlignmentCenter; + _miniStackView.spacing = 17; + } + return _miniStackView; +} +- (UIStackView *)exitStackView { + if (!_exitStackView) { + _exitStackView = [[UIStackView alloc] init]; + _exitStackView.axis = UILayoutConstraintAxisVertical; + _exitStackView.distribution = UIStackViewDistributionFill; + _exitStackView.alignment = UIStackViewAlignmentCenter; + _exitStackView.spacing = 17; + } + return _exitStackView; +} + + + +- (UILabel *)miniLabel { + if (!_miniLabel) { + _miniLabel = [[UILabel alloc] init]; + _miniLabel.text = YMLocalizedString(@"XPRoomRecommendView1"); + _miniLabel.font = [UIFont systemFontOfSize:12 weight:UIFontWeightMedium]; + _miniLabel.textAlignment = NSTextAlignmentCenter; + _miniLabel.textColor = [UIColor whiteColor]; + } + return _miniLabel; +} + +- (UILabel *)exitLabel { + if (!_exitLabel) { + _exitLabel = [[UILabel alloc] init]; + _exitLabel.text = YMLocalizedString(@"XPRoomRecommendView2"); + _exitLabel.font = [UIFont systemFontOfSize:12 weight:UIFontWeightMedium]; + _exitLabel.textAlignment = NSTextAlignmentCenter; + _exitLabel.textColor = [UIColor whiteColor]; + } + return _exitLabel; +} + - (UILabel *)recommentLabel { if (!_recommentLabel) { _recommentLabel = [[UILabel alloc] init]; - _recommentLabel.text = YMLocalizedString(@"XPRoomRecommendView0"); + _recommentLabel.text = YMLocalizedString(@"XPRoomRecommendView3"); _recommentLabel.font = [UIFont systemFontOfSize:14 weight:UIFontWeightMedium]; _recommentLabel.textColor = [UIColor whiteColor]; } @@ -173,35 +251,4 @@ return _tableView; } -- (UICollectionView *)collectionView { - if (!_collectionView) { - UICollectionViewFlowLayout *layout = [[UICollectionViewFlowLayout alloc] init]; - layout.scrollDirection = UICollectionViewScrollDirectionVertical; - layout.minimumLineSpacing = 14; - layout.minimumInteritemSpacing = (250 - 3 * 52) / 4; - layout.itemSize = CGSizeMake(52, 68); - layout.sectionInset = UIEdgeInsetsMake(0, (250 - 3 * 52) / 4, 0, (250 - 3 * 52) / 4); - _collectionView = [[UICollectionView alloc] initWithFrame:CGRectZero collectionViewLayout:layout]; - [_collectionView registerClass:[XPRoomInsideOperationCell class] forCellWithReuseIdentifier:NSStringFromClass([XPRoomInsideOperationCell class])]; - _collectionView.delegate = self; - _collectionView.dataSource = self; - _collectionView.backgroundColor = [UIColor clearColor]; - } - return _collectionView; -} - -- (NSMutableArray *)titleArray { - if (!_titleArray) { - _titleArray = [NSMutableArray arrayWithObjects:YMLocalizedString(@"XPRoomRecommendView1"), YMLocalizedString(@"XPRoomRecommendView2"), YMLocalizedString(@"XPRoomRecommendView3"), nil]; - } - return _titleArray; -} - -- (NSMutableArray *)imageArray { - if (!_imageArray) { - _imageArray = [NSMutableArray arrayWithObjects:@"room_info_mini", @"room_info_exit", @"room_info_report", nil]; - } - return _imageArray; -} - @end diff --git a/YuMi/Modules/YMRoom/View/XPRoomViewController.m b/YuMi/Modules/YMRoom/View/XPRoomViewController.m index b54eb364..831f8249 100644 --- a/YuMi/Modules/YMRoom/View/XPRoomViewController.m +++ b/YuMi/Modules/YMRoom/View/XPRoomViewController.m @@ -831,7 +831,9 @@ NSString * const kHadQuitOtherRoomKey = @"kHadQuitOtherRoomKey";//是否退出 return NO; } } - +-(void)requesstShieldingAction{ + [self.presenter requesstShieldingWtihType:@"1" objId:[NSString stringWithFormat:@"%ld",self.roomInfo.uid]]; +} #pragma mark - 本地礼物特效更新 - (void)myGiftEffectUpdate:(NSNotification *)notification { NSDictionary * dic = notification.object; diff --git a/YuMi/zh-Hans.lproj/Localizable.strings b/YuMi/zh-Hans.lproj/Localizable.strings index 813423ac..406ef417 100644 --- a/YuMi/zh-Hans.lproj/Localizable.strings +++ b/YuMi/zh-Hans.lproj/Localizable.strings @@ -57,6 +57,7 @@ "XPShareView5" = "分享失败"; "XPShareView6" = "取消分享"; "XPShareView7" = "取消"; +"XPShareView8" = "来piko,邂逅你的专属声音"; ///XPFirstRechargeViewController.m "XPFirstRechargeViewController0" = "1.每人仅可获得1次首充福利\n2.每个ID、设备仅能参加一次。"; "XPFirstRechargeViewController1" = "立即充值"; @@ -1018,10 +1019,11 @@ "XPRoomInsideRecommendEmptyCell0" = "努力寻找合适房间中"; -"XPRoomRecommendView0" = "为你推荐"; +///XPRoomRecommendView.m +"XPRoomRecommendView0" = "屏蔽举报"; "XPRoomRecommendView1" = "收起房间"; "XPRoomRecommendView2" = "退出房间"; -"XPRoomRecommendView3" = "举报房间"; +"XPRoomRecommendView3" = "为你推荐"; "XPAnchorFansTeamEntranceView0" = "粉丝团(%ld)"; "XPAnchorFansTeamEntranceView1" = "开通粉丝团"; @@ -1106,7 +1108,7 @@ "XPMoreMenuPresenter33" = "主播PK"; "XPMoreMenuPresenter34" = "开启公屏"; "XPMoreMenuPresenter35" = "房间小喇叭"; - +"XPMoreMenuPresenter36" = "举报屏蔽"; "XPRoomMoreMenuViewController0" = "开启礼物值成功"; @@ -1235,20 +1237,20 @@ "AnchorPKStageView0" = "规则"; -"RoomHeaderView0" = "退出聊天室"; -"RoomHeaderView1" = "举报该聊天室"; -"RoomHeaderView2" = "您的请求我们已经收到,我们将儘快处理"; -"RoomHeaderView3" = "在线:%ld ID:%ld"; -"RoomHeaderView4" = "在线"; -"RoomHeaderView5" = "在线"; -"RoomHeaderView6" = "朋友圈"; -"RoomHeaderView7" = "微信好友"; -"RoomHeaderView8" = "QQ好友"; -"RoomHeaderView9" = "QQ空间"; -"RoomHeaderView10" = "聆听声音,分享快乐"; -"RoomHeaderView11" = "%@ 这个房间很好玩,推荐给你,快来和我一起玩吧~"; -"RoomHeaderView12" = "收藏成功"; -"RoomHeaderView13" = "分享成功"; +///RoomHeaderView.m +"RoomHeaderView0" = "在线:%ld ID:%ld"; +"RoomHeaderView1" = "在线:%ld ID:%ld"; +"RoomHeaderView2" = "在线:%ld ID:%ld"; +"RoomHeaderView3" = "複制链接"; +"RoomHeaderView4" = "来Peko,开黑交友玩游戏"; +"RoomHeaderView5" = "人美声甜带上分,一起来玩吧~"; +"RoomHeaderView6" = "收藏成功"; +"RoomHeaderView7" = "分享成功"; +"RoomHeaderView8" = "收藏"; +"RoomHeaderView9" = "已收藏"; +"RoomHeaderView10" = "屏蔽房间"; +"RoomHeaderView11" = "已屏蔽该房间"; +"RoomHeaderView12" = "举报房间或用户"; "XPRoomMorePlayPresenter0" = "航海"; diff --git a/YuMi/zh-Hant.lproj/Localizable.strings b/YuMi/zh-Hant.lproj/Localizable.strings index 0cae38be..70223906 100644 --- a/YuMi/zh-Hant.lproj/Localizable.strings +++ b/YuMi/zh-Hant.lproj/Localizable.strings @@ -57,6 +57,7 @@ "XPShareView5" = "分享失敗"; "XPShareView6" = "取消分享"; "XPShareView7" = "取消"; +"XPShareView8" = "來piko,邂逅你的專屬聲音"; ///XPFirstRechargeViewController.m "XPFirstRechargeViewController0" = "1.每人僅可獲得1次首充福利\n2.每個ID、設備僅能參加一次。"; "XPFirstRechargeViewController1" = "立即充值"; @@ -1026,10 +1027,10 @@ "XPRoomInsideRecommendEmptyCell0" = "努力尋找合適房間中"; -"XPRoomRecommendView0" = "為你推薦"; +"XPRoomRecommendView0" = "屏蔽舉報"; "XPRoomRecommendView1" = "收起房間"; "XPRoomRecommendView2" = "退出房間"; -"XPRoomRecommendView3" = "舉報房間"; +"XPRoomRecommendView3" = "為你推薦";; "XPAnchorFansTeamEntranceView0" = "粉絲團(%ld)"; "XPAnchorFansTeamEntranceView1" = "開通粉絲團"; @@ -1114,7 +1115,7 @@ "XPMoreMenuPresenter33" = "主播PK"; "XPMoreMenuPresenter34" = "開啟公屏"; "XPMoreMenuPresenter35" = "房間小喇叭"; - +"XPMoreMenuPresenter36" = "舉報屏蔽"; "XPRoomMoreMenuViewController0" = "開啟禮物值成功"; @@ -1243,20 +1244,19 @@ "AnchorPKStageView0" = "規則"; -"RoomHeaderView0" = "退出聊天室"; -"RoomHeaderView1" = "舉報該聊天室"; -"RoomHeaderView2" = "您的請求我們已經收到,我們將儘快處理"; -"RoomHeaderView3" = "在線:%ld ID:%ld"; -"RoomHeaderView4" = "在線"; -"RoomHeaderView5" = "在線"; -"RoomHeaderView6" = "朋友圈"; -"RoomHeaderView7" = "微信好友"; -"RoomHeaderView8" = "QQ好友"; -"RoomHeaderView9" = "QQ空間"; -"RoomHeaderView10" = "聆聽聲音,分享快樂"; -"RoomHeaderView11" = "%@ 這個房間很好玩,推薦給你,快來和我一起玩吧~"; -"RoomHeaderView12" = "收藏成功"; -"RoomHeaderView13" = "分享成功"; +"RoomHeaderView0" = "在線:%ld ID:%ld"; +"RoomHeaderView1" = "在線:%ld ID:%ld"; +"RoomHeaderView2" = "在線:%ld ID:%ld"; +"RoomHeaderView3" = "複製鏈接"; +"RoomHeaderView4" = "來peko,開黑交友玩游戲"; +"RoomHeaderView5" = "人美聲甜帶上分,一起來玩吧~"; +"RoomHeaderView6" = "收藏成功"; +"RoomHeaderView7" = "分享成功"; +"RoomHeaderView8" = "收藏"; +"RoomHeaderView9" = "已收藏"; +"RoomHeaderView10" = "屏蔽房間"; +"RoomHeaderView11" = "已屏蔽該房間"; +"RoomHeaderView12" = "舉報房間或用戶"; "XPRoomMorePlayPresenter0" = "航海";