Commit d6fecd5b by ludi

Merge branch 'feature/私讯+座驾体系' of http://git.yabolive.net:88/pidan/FuSiLive into feature/私讯+座驾体系

parents 7ae3b21b fa28b7d2
Showing with 135 additions and 340 deletions
......@@ -51,7 +51,7 @@ NS_ASSUME_NONNULL_BEGIN
#pragma mark - Views
- (FUSPublicLiveGiftSendView *)fus_createLiveGiftSendViewWithFrame:(CGRect)frame;
- (FUSPublicVideoChatUserInfoView *)fus_createVideoChatUserInfoView;
- (FUSPublicLiveBeautyParameterView *)fus_createLiveBeautyParameterViewWithFrame:(CGRect)frame;
- (FUSPublicLiveBeautyParameterView *__nullable)fus_createWithAnimationWithShowOn:(UIView *__nullable)showOn dismiss:(void(^)(void))dismiss;
- (UIViewController *)fus_homePageViewController;
#pragma mark - Public Methods
......
......@@ -16,6 +16,7 @@ NS_ASSUME_NONNULL_BEGIN
@interface FUSPublicLiveBeautyParameterView : UIView
+ (FUSPublicLiveBeautyParameterView *__nullable)fus_createWithAnimationWithShowOn:(UIView *__nullable)showOn dismiss:(void(^)(void))dismiss;
/**
美颜调节视图在哪个界面展示
......@@ -23,12 +24,11 @@ NS_ASSUME_NONNULL_BEGIN
@property (nonatomic,assign) FUSBeautyParameterFrom beautyViewFrom;
/// 消失
@property (nonatomic, copy) void(^fus_dismissComplete)(void);
@property (nonatomic, copy) void(^__nullable fus_dismissComplete)(void);
/**
显示和隐藏
*/
- (void)fus_showViewWithSuperView:(UIView *)superView;
- (void)fus_dismissViewAnimation:(BOOL)animation;
@end
......
......@@ -89,7 +89,7 @@ class FUSCallOneToOnePanelView: FUSBaseView {
var contentViewHeight = 216 + UIView.fus_SafeBottom()
let contentView = FUSPanGestureAlertView(frame: CGRectMake(0, 0, UIView.fus_screenW(), 216))
var btnList: [UIButton] = .init()
let beautParameterView: FUSPublicLiveBeautyParameterView = FUSRouter.live().fus_createLiveBeautyParameterView(withFrame: UIView.fus_screenFrame())
var beautParameterView: FUSPublicLiveBeautyParameterView?
override func makeUI() {
super.makeUI()
......@@ -173,17 +173,6 @@ class FUSCallOneToOnePanelView: FUSBaseView {
}
}
override func bindViewModel() {
super.bindViewModel()
beautParameterView.beautyViewFrom = .singleLive
// 美颜下降的时候,显示出自己
self.beautParameterView.fus_dismissComplete = {[weak self] in
self?.fus_showWithAnimation(complete: {})
}
}
}
/// method
......@@ -201,7 +190,10 @@ extension FUSCallOneToOnePanelView {
self.fus_dismissWithAnimation(remove: false) {
}
self.beautParameterView.fus_showView(withSuperView: self)
self.beautParameterView = FUSRouter.live().fus_createWithAnimationWithShow(on: self, dismiss: {[weak self] in
self?.fus_showWithAnimation(complete: {})
self?.beautParameterView = nil
})
case .mic:
sender.isSelected = !sender.isSelected
FUSChatCallHelper.shared.agoraSession?.audioEnable = sender.isSelected
......
......@@ -35,7 +35,6 @@
#import "FUSFormatContentHelper.h"
// test
#import "FUSLiveBeautyParameterView.h"
#import "FUSLiveHeadView.h"
#import "FUSAgoraHelper.h"
......@@ -70,8 +69,6 @@ typedef NS_ENUM(NSInteger, FUSStreamState) {
*/
@property (nonatomic, strong) NSTimer *idleTimeDiableTimer;
@property (nonatomic, strong) FUSLiveBeautyParameterView *beautySettingView;
/**
重发5555消息机制 Timer
*/
......@@ -1870,17 +1867,19 @@ typedef NS_ENUM(NSInteger, FUSStreamState) {
*/
- (void)fus_showBeautySettingView
{
if (_beautySettingView) {
[_beautySettingView fus_showViewWithSuperView:self.liveFunctionView];
return;
}
self.beautySettingView = [[FUSLiveBeautyParameterView alloc] initWithFrame:UIView.fus_screenFrame];
_beautySettingView.beautyViewFrom = FUSBeautyParameterFromLivingRoom;
[_beautySettingView setDismissBlock:^{
}];
[_beautySettingView fus_showViewWithSuperView:self.liveFunctionView];
if (FUSLiveHelper.shareInstance.liveRoomType == FUSRoomTypePK) {
//PK状态不需要隐藏
[FUSLiveStartBeautySetView fus_createWithAnimationWithShowOn:nil dismiss:^{
}];
}else {
// 不是pk状态就隐藏
[FUSLiveHelper.shareInstance.currentFunctionView fus_hideFunctionLayersWithoutGiftWithAnimate:YES];
[FUSLiveStartBeautySetView fus_createWithAnimationWithShowOn:nil dismiss:^{
[FUSLiveHelper.shareInstance.currentFunctionView fus_showAllFunctionLayersWithAnimate:YES];
}];
}
}
/**
......
......@@ -44,6 +44,8 @@ NS_ASSUME_NONNULL_BEGIN
+ (void)fus_createRoomWithCityCode:(NSString *)cityCode
introduce:(NSString *)introduce
liveWay:(NSString *)liveWay
themeId:(NSInteger)themeId
themeTitle:(NSString *)themeTitle
success:(void (^)(FUSStreamModel *streamModel))success
failure:(void (^)(NSString *msg, int code, NSDictionary *errorDict))failure;
......
......@@ -40,6 +40,8 @@
+ (void)fus_createRoomWithCityCode:(NSString *)cityCode
introduce:(NSString *)introduce
liveWay:(NSString *)liveWay
themeId:(NSInteger)themeId
themeTitle:(NSString *)themeTitle
success:(void (^)(FUSStreamModel *streamModel))success
failure:(void (^)(NSString *msg, int code, NSDictionary *errorDict))failure
{
......@@ -57,7 +59,9 @@
NSDictionary *params = @{@"cityCode":cityCode,
@"introduce":introduce,
@"liveWay":liveWay
@"liveWay":liveWay,
@"themeId":@(themeId),
@"content":themeTitle ?: @""
};
[FUSHttpHelper postRequestBinaryWithUrl:FUSShowRoomURLs.fus_URL_CREATE_ROOM params:params success:^(NSDictionary *dataDict, int code) {
......
......@@ -14,6 +14,8 @@
@interface FusAnchorRewardView()
@property (nonatomic, strong) UIButton *arrowBtn;
@property (nonatomic, strong) UIView *webviewContentView;
@property (nonatomic, strong) FUSWKWebView *webview;
/// 原始高度
......@@ -75,10 +77,11 @@
/// 11200: fusi直播奖励数据变化
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(receiveAnchorRewardChangedNotification:) name:STR(ROOM_CID_receiveAnchorRewardChanged) object:nil];
self.backgroundColor = UIColor.clearColor;
self.clipsToBounds = YES;
self.webview = [[FUSWKWebView alloc] initWithFrame:CGRectMake(0, 0, self.width - 14, self.height)];
self.webviewContentView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, self.width - 14, self.height)];
[self addSubview:self.webviewContentView];
self.webview = [[FUSWKWebView alloc] initWithFrame:self.webviewContentView.bounds];
self.webview.backgroundColor = UIColor.clearColor;
self.webview.wkWebView.scrollView.scrollEnabled = false;
self.webview.wkWebView.scrollView.maximumZoomScale = 1;
......@@ -88,7 +91,7 @@
self.webview.wkWebView.scrollView.contentInsetAdjustmentBehavior = UIScrollViewContentInsetAdjustmentNever;
self.webview.hideProgress = YES;
[self addSubview:self.webview];
[self.webviewContentView addSubview:self.webview];
self.hidden = YES;
__weak typeof(self) weakSelf = self;
......@@ -152,6 +155,9 @@
[UIView animateWithDuration:0.3 animations:^{
self.height = 33;
self.transform = CGAffineTransformTranslate(CGAffineTransformScale(CGAffineTransformIdentity, scaleFactor, scaleFactor), -originalSize.width * scaleFactor / 2, -33 * scaleFactor / 2);
self.webviewContentView.height = 33;
self.webviewContentView.layer.cornerRadius = 5;
self.webviewContentView.layer.masksToBounds = YES;
} completion:^(BOOL finished) {
self.userInteractionEnabled = YES;
self.coverBtn.hidden = NO;
......@@ -159,10 +165,14 @@
// }];
} else {
self.arrowBtn.selected = NO;
[self.webview.wkWebView reload];
[UIView animateWithDuration:0.3 animations:^{
self.transform = CGAffineTransformIdentity;
self.height = self.orginalHeight;
self.webviewContentView.height = self.orginalHeight;
self.webviewContentView.layer.cornerRadius = 0;
self.webviewContentView.layer.masksToBounds = YES;
} completion:^(BOOL finished) {
self.userInteractionEnabled = YES;
self.coverBtn.hidden = YES;
......
//
// FUSLiveBeautyParameterView.h
// FusiLive
//
// Created by Xiang Liu on 2017/7/10.
// Copyright © 2024年 FusiClub. All rights reserved.
//
#import <UIKit/UIKit.h>
typedef NS_ENUM(NSInteger,FUSBeautyParameterType) {
FUSBeautyParameterTypeWhite = 0, // 美白
FUSBeautyParameterTypeSkin, // 磨皮
FUSBeautyParameterTypeFresh, //
FUSBeautyParameterTypeRed,
FUSBeautyParameterTypeBigEyes, // 大眼
FUSBeautyParameterTypeThinFace, // 瘦脸
FUSBeautyParameterTypeSharpen, // 锐化
FUSBeautyParameterNarrowFace, // 窄脸
FUSBeautyParameterChin, // 下巴
FUSBeautyParameterForehead, // 额头
FUSBeautyParameterThinNose, // 瘦鼻
};
typedef void(^beautySliderChangeBlock)(FUSBeautyParameterType type,CGFloat sliderValue);
typedef void(^beautyLevelClickBlock)(void);
@interface FUSLiveBeautyParameterView : FUSPublicLiveBeautyParameterView
/**
是否允许点击空白处消失掉视图
*/
@property (nonatomic,assign) BOOL enableBgClickDismiss;
/**
当前选择的等级
*/
@property (nonatomic,strong,readonly) NSNumber *currentSelectedLevel;
/**
是否正在显示
*/
@property (nonatomic,assign,readonly) BOOL isOnShow;
/**
改变美颜参数的回调
*/
@property (nonatomic,copy) beautySliderChangeBlock beautySliderChangeBlock;
/**
改变美颜等级的回调
*/
@property (nonatomic,copy) beautyLevelClickBlock beautyLevelClickBlock;
/**
view Dismiss 的回调
*/
@property (nonatomic,copy) beautyLevelClickBlock dismissBlock;
/**
改变美颜等级
*/
- (void)fus_setBeautyLevel:(NSNumber *)level;
@end
......@@ -36,7 +36,7 @@ typedef enum : NSUInteger {
// 小窗播放
FUSLiveBottomToolTypeStartPictureInPicture,
/// 新星养成
FUSLiveBottomToolTypeNovaBuild,
// FUSLiveBottomToolTypeNovaBuild,
} FUSLiveBottomToolType;
......
......@@ -183,13 +183,13 @@
break;
}
case FUSLiveBottomToolTypeNovaBuild:
if (isSelect) {
image = [FUSShowRoomCenterBunble imageNamed:@"live_tool_nova_build_btn"];
}else {
image = [FUSShowRoomCenterBunble imageNamed:@"live_tool_nova_build_btn"];
}
break;
// case FUSLiveBottomToolTypeNovaBuild:
// if (isSelect) {
// image = [FUSShowRoomCenterBunble imageNamed:@"live_tool_nova_build_btn"];
// }else {
// image = [FUSShowRoomCenterBunble imageNamed:@"live_tool_nova_build_btn"];
// }
// break;
default:
break;
}
......
......@@ -13,7 +13,6 @@
#import "FUSLiveShareView.h"
#import "FUSScreenShotShareView.h"
#import "FUSBottomOptionalView.h"
#import "FUSLiveScopeSettingView.h"
#import "FUSLiveGameListView.h"
#import "FUSLiveAnchorSettingAlertView.h"
......@@ -146,7 +145,7 @@
}
break;
case FUSLiveBottomToolTypeRoomScope:{
[FUSLiveScopeSettingView fus_showLiveScopeSettingView];
[FUSLiveStartSetPrivacyView fus_createInLive];
}
break;
......@@ -172,20 +171,20 @@
[self onClickExchangeBtn];
}
break;
case FUSLiveBottomToolTypeNovaBuild:{
[self onclickNovaBuild];
}
// case FUSLiveBottomToolTypeNovaBuild:{
// [self onclickNovaBuild];
// }
default:
break;
}
}
/// 点击新星养成
-(void)onclickNovaBuild{
FUSWKWebViewController *webvc = [[FUSWKWebViewController alloc] init];
webvc.webUrlString = FUSCacheDataShare.shareStore.startLiveConfig.novaToShowUrl;
[UIViewController.fus_topViewController.navigationController pushViewController:webvc animated:YES];
}
///// 点击新星养成
//-(void)onclickNovaBuild{
// FUSWKWebViewController *webvc = [[FUSWKWebViewController alloc] init];
// webvc.webUrlString = FUSCacheDataShare.shareStore.startLiveConfig.novaToShowUrl;
// [UIViewController.fus_topViewController.navigationController pushViewController:webvc animated:YES];
//}
/// 点击房间设置页面
- (void)onclickRoomSetting {
......@@ -517,9 +516,9 @@
- (void)ffupdateToolView2TypesPKState:(FUSPKLiveState)pkState {
if (FUSLiveHelper.shareInstance.liveRoomType == FUSRoomTypeLinkMic) {
[self.toolView2 showItemWithTypesWithToolTypes:@[@(FUSLiveBottomToolTypeLiveSetting),@(FUSLiveBottomToolTypeRoomSetting),@(FUSLiveBottomToolTypeRoomScope), @(FUSLiveBottomToolTypeNovaBuild)]];
[self.toolView2 showItemWithTypesWithToolTypes:@[@(FUSLiveBottomToolTypeLiveSetting),@(FUSLiveBottomToolTypeRoomSetting),@(FUSLiveBottomToolTypeRoomScope)/*, @(FUSLiveBottomToolTypeNovaBuild)*/]];
} else {
[self.toolView2 showItemWithTypesWithToolTypes:@[@(FUSLiveBottomToolTypeLiveSetting),@(FUSLiveBottomToolTypeRoomSetting), @(FUSLiveBottomToolTypeRoomScope),@(FUSLiveBottomToolTypePK), @(FUSLiveBottomToolTypeNovaBuild)]];
[self.toolView2 showItemWithTypesWithToolTypes:@[@(FUSLiveBottomToolTypeLiveSetting),@(FUSLiveBottomToolTypeRoomSetting), @(FUSLiveBottomToolTypeRoomScope),@(FUSLiveBottomToolTypePK)/*, @(FUSLiveBottomToolTypeNovaBuild)*/]];
}
}
......
......@@ -23,7 +23,6 @@
#import <FirebaseAnalytics/FirebaseAnalytics.h>
#import "FUSBottomOptionalView.h"
#import "FUSLiveBeautyParameterView.h"
#import "FUSLiveShareToChatView.h"
@interface FUSLiveChatInputHelper ()
......
......@@ -39,7 +39,7 @@ public class FUSLiveChatInputToolView: UIView {
var liveSettingView = UIView.init()
var roomSettingView = UIView.init()
var openPictureInPictureView = UIView.init()
var novaBuildView = UIView.init()
// var novaBuildView = UIView.init()
var btnW:CGFloat?
......@@ -137,7 +137,7 @@ public class FUSLiveChatInputToolView: UIView {
openPictureInPictureView = fus_createItemViewWithToolType(toolType: FUSLiveBottomToolTypeStartPictureInPicture, withSize: CGSize(width: itemWith, height: buttomViewHeight))
novaBuildView = fus_createItemViewWithToolType(toolType: FUSLiveBottomToolTypeNovaBuild, withSize: CGSize(width: itemWith, height: buttomViewHeight))
// novaBuildView = fus_createItemViewWithToolType(toolType: FUSLiveBottomToolTypeNovaBuild, withSize: CGSize(width: itemWith, height: buttomViewHeight))
let taskCompletedInfo:NSDictionary? = UserDefaults.standard.object(forKey: FUSUserUDKeys.fus_LIVE_TASKCOMPLETED()) as? NSDictionary
if taskCompletedInfo?.value(forKey: (FUSCacheDataShare.shareStore()?.userDetailInfo.uid)!) as? Bool ?? false {
......@@ -274,8 +274,8 @@ public class FUSLiveChatInputToolView: UIView {
profileLb.text = NSString.fus_localString("直播设置")
case FUSLiveBottomToolTypeExchange:
profileLb.text = NSString.fus_localString("兑换")
case FUSLiveBottomToolTypeNovaBuild:
profileLb.text = NSString.fus_localString("新星养成")
// case FUSLiveBottomToolTypeNovaBuild:
// profileLb.text = NSString.fus_localString("新星养成")
default:
break
}
......@@ -311,8 +311,8 @@ public class FUSLiveChatInputToolView: UIView {
toolViews.append(self.roomSettingView)
case FUSLiveBottomToolTypeExchange:
toolViews.append(self.exchangeDewView)
case FUSLiveBottomToolTypeNovaBuild:
toolViews.append(self.novaBuildView)
// case FUSLiveBottomToolTypeNovaBuild:
// toolViews.append(self.novaBuildView)
default:
break
}
......
......@@ -16,7 +16,6 @@
#import "FUSScreenShotShareView.h"
#import "FUSLiveHalfWebViewCatalogueView.h"
#import "FUSLiveScopeSettingView.h"
#import "FUSLiveHttpHelper.h"
#import "FUSCustomizedInfosStore.h"
......@@ -777,7 +776,7 @@
break;
}
case FUSLiveChatToolTypeRoomScope:
[FUSLiveScopeSettingView fus_showLiveScopeSettingView];
[FUSLiveStartSetPrivacyView fus_createInLive];
break;
default:
break;
......
......@@ -307,6 +307,10 @@ typedef NS_ENUM(NSInteger, FUSFunctionMode) {
// 创建一个系统消息
- (void)fus_addSystemTip:(NSString *)tip;
- (void)fus_hideFunctionLayersWithoutGiftWithAnimate:(BOOL)animate;
- (void)fus_showAllFunctionLayersWithAnimate:(BOOL)animate;
#pragma mark -- PK
/**
创建观众端pkcontentView
......
......@@ -6180,6 +6180,50 @@ UIGestureRecognizerDelegate
// [self.hostInfoView fus_updateLikeState:[[FUSLiveHelper shareInstance].roomInfoModel.liked boolValue]];
}
- (void)fus_hideFunctionLayersWithoutGiftWithAnimate:(BOOL)animate {
if (animate) {
[UIView animateWithDuration:0.3 animations:^{
for (FUSLiveFunctionLayerView *layer in self.viewLayerArray) {
if (layer.layerType != FUSLiveFunctionLayerBigEffects && layer != [FUSGiftCenter fus_shareGiftCenter].normalGiftBgView) {
layer.alpha = 0;
}
}
} completion:^(BOOL finished) {
for (FUSLiveFunctionLayerView *layer in self.viewLayerArray) {
if (layer.layerType != FUSLiveFunctionLayerBigEffects && layer != [FUSGiftCenter fus_shareGiftCenter].normalGiftBgView) {
layer.hidden = YES;
}
}
}];
}else {
for (FUSLiveFunctionLayerView *layer in self.viewLayerArray) {
if (layer.layerType != FUSLiveFunctionLayerBigEffects && layer != [FUSGiftCenter fus_shareGiftCenter].normalGiftBgView) {
layer.hidden = YES;
}
}
}
}
- (void)fus_showAllFunctionLayersWithAnimate:(BOOL)animate {
if (animate) {
for (FUSLiveFunctionLayerView *layer in self.viewLayerArray) {
layer.hidden = NO;
layer.alpha = 0;
}
[UIView animateWithDuration:0.3 animations:^{
for (FUSLiveFunctionLayerView *layer in self.viewLayerArray) {
layer.alpha = 1;
}
} completion:^(BOOL finished) {
}];
}else {
for (FUSLiveFunctionLayerView *layer in self.viewLayerArray) {
layer.hidden = NO;
}
}
}
#pragma mark - Emitter Delegate
- (nullable FUSEmitterViewCell *)cellForEmitterView:(nonnull FUSEmitterView *)emitterView
{
......
//
// FUSLiveScopeSettingView.h
// FusiLive
//
// Created by pierce on 2021/3/19.
// Copyright © 2024年 FusiClub. All rights reserved.
//
#import <UIKit/UIKit.h>
NS_ASSUME_NONNULL_BEGIN
@interface FUSLiveScopeSettingView : UIView
+ (void)fus_showLiveScopeSettingView;
@end
NS_ASSUME_NONNULL_END
//
// FUSLiveScopeSettingView.m
// FusiLive
//
// Created by pierce on 2021/3/19.
// Copyright © 2024年 FusiClub. All rights reserved.
//
#import "FUSLiveScopeSettingView.h"
#import "FUSLiveHelper.h"
#import "FUSLiveHttpHelper.h"
@interface FUSLiveScopeSettingView ()
@property (strong, nonatomic) IBOutlet UIButton *scopeOpenBtn;
@property (strong, nonatomic) IBOutlet UILabel *scopeOpenLabel;
@property (strong, nonatomic) IBOutlet UIButton *scopeFollowBtn;
@property (strong, nonatomic) IBOutlet UILabel *scopeFollowLabel;
@property (strong, nonatomic) IBOutlet UILabel *scopeIntimacyLabel;
@property (strong, nonatomic) IBOutlet UIButton *scopeIntimacyBtn;
@property (strong, nonatomic) IBOutlet NSLayoutConstraint *contentBottomConstraint;
@property (strong, nonatomic) IBOutlet UIView *contentView;
@end
@implementation FUSLiveScopeSettingView
+ (void)fus_showLiveScopeSettingView {
FUSLiveScopeSettingView *settingView = [[FUSLiveScopeSettingView alloc] initWithFrame:UIView.fus_screenFrame];
[[UIApplication sharedApplication].keyWindow addSubview:settingView];
[settingView fus_showWithAnim];
}
- (instancetype)initWithFrame:(CGRect)frame
{
self = [super initWithFrame:frame];
if (self) {
// 加载Xib
FUSLiveScopeSettingView *xibView = [[[FUSShowRoomCenterBunble bundle] loadNibNamed:NSStringFromClass([self class]) owner:self options:nil] firstObject];
xibView.frame = frame;
self = xibView;
// 初始化View
[self initView];
}
return self;
}
// 初始化View
- (void)initView
{
self.scopeOpenLabel.text = [NSString fus_localString:@"全公开"];
self.scopeFollowLabel.text = [NSString fus_localString:@"追踪圈"];
self.scopeIntimacyLabel.text = [NSString fus_localString:@"亲密圈"];
[self.scopeOpenBtn setImage:[FUSShowRoomCenterBunble imageNamed:@"live_start_page_scope_open"] forState:UIControlStateNormal];
[self.scopeOpenBtn setImage:[FUSShowRoomCenterBunble imageNamed:@"live_start_page_scope_open_selected"] forState:UIControlStateSelected];
[self.scopeFollowBtn setImage:[FUSShowRoomCenterBunble imageNamed:@"live_start_page_scope_follow"] forState:UIControlStateNormal];
[self.scopeFollowBtn setImage:[FUSShowRoomCenterBunble imageNamed:@"live_start_page_scope_follow_selected"] forState:UIControlStateSelected];
[self.scopeIntimacyBtn setImage:[FUSShowRoomCenterBunble imageNamed:@"live_start_page_scope_intimacy"] forState:UIControlStateNormal];
[self.scopeIntimacyBtn setImage:[FUSShowRoomCenterBunble imageNamed:@"live_start_page_scope_intimacy_selected"] forState:UIControlStateSelected];
self.scopeOpenBtn.selected = NO;
self.scopeFollowBtn.selected = NO;
self.scopeIntimacyBtn.selected = NO;
switch ([FUSLiveHelper shareInstance].roomScopeType) {
case FUSLiveRoomScopeTypeOpen:
self.scopeOpenBtn.selected = YES;
break;
case FUSLiveRoomScopeTypeFollow:
self.scopeFollowBtn.selected = YES;
break;
case FUSLiveRoomScopeTypeIntimacy:
self.scopeIntimacyBtn.selected = YES;
break;
}
[self.contentView addRoundedCorners:UIRectCornerTopLeft|UIRectCornerTopRight withRadii:CGSizeMake(16, 16)];
}
- (IBAction)clickCloseBtnAction:(UIButton *)sender {
[self fus_hideWithAnim];
}
- (IBAction)clickOpenScopeBtnAction:(UIButton *)sender {
if ([FUSLiveHelper shareInstance].roomScopeType == FUSLiveRoomScopeTypeOpen) {
return;
}
[FUSAlertView showAlertWithTitle:[NSString fus_localString:@"确认切换到全公开模式?"] message:[NSString fus_localString:@"切换后所有人可进入房间"] cancelButtonTitle:[NSString fus_localString:@"取消"] otherButtonTitles:@[[NSString fus_localString:@"确定"]] clickBlock:^(NSInteger buttonIndex) {
if (buttonIndex == 1) {
[self fus_changeScopeRequest:FUSLiveRoomScopeTypeOpen];
}
}];
}
- (IBAction)clickFollowScopeBtnAction:(UIButton *)sender {
if ([FUSLiveHelper shareInstance].roomScopeType == FUSLiveRoomScopeTypeFollow) {
return;
}
[FUSAlertView showAlertWithTitle:[NSString fus_localString:@"确认切换到追踪圈模式?"] message:[NSString fus_localString:@"切换后,仅追踪主播超过24小时的粉丝可进入房间,直播时长不计入直播奖励活动"] cancelButtonTitle:[NSString fus_localString:@"取消"] otherButtonTitles:@[[NSString fus_localString:@"确定"]] clickBlock:^(NSInteger buttonIndex) {
if (buttonIndex == 1) {
[self fus_changeScopeRequest:FUSLiveRoomScopeTypeFollow];
}
}];
}
- (IBAction)clickIntimacyScopeBtnAction:(UIButton *)sender {
if ([FUSLiveHelper shareInstance].roomScopeType == FUSLiveRoomScopeTypeIntimacy) {
return;
}
[FUSAlertView showAlertWithTitle:[NSString fus_localString:@"确认切换到亲密圈模式?"] message:[NSString fus_localString:@"切换后,仅亲密好友的用户可进入房间,直播时长不计入直播奖励活动"] cancelButtonTitle:[NSString fus_localString:@"取消"] otherButtonTitles:@[[NSString fus_localString:@"确定"]] clickBlock:^(NSInteger buttonIndex) {
if (buttonIndex == 1) {
[self fus_changeScopeRequest:FUSLiveRoomScopeTypeIntimacy];
}
}];
}
- (void)fus_changeScopeRequest:(FUSLiveRoomScopeType)scopeType {
[self fus_hideWithAnim];
[FUSLoadingView fus_showProgressViewWithMessage:nil];
[FUSLiveHttpHelper fus_requestChangeLiveScope:scopeType liveId:[FUSLiveHelper shareInstance].roomInfoModel.roomId.integerValue success:^{
[FUSLoadingView fus_dismissProgressView];
[FUSLiveHelper shareInstance].roomScopeType = scopeType;
switch ([FUSLiveHelper shareInstance].roomScopeType) {
case FUSLiveRoomScopeTypeOpen:
[FUSDialogView fus_showDialog:[NSString fus_localString:@"房间已切换到全公开模式,所有人可进入房间"]];
break;
case FUSLiveRoomScopeTypeFollow:
[FUSDialogView fus_showDialog:[NSString fus_localString:@"房间已切换到追踪圈模式,仅追踪直播超过24小时的粉丝可进入房间,直播时长不计入直播奖励活动"]];
break;
case FUSLiveRoomScopeTypeIntimacy:
[FUSDialogView fus_showDialog:[NSString fus_localString:@"房间已切换到亲密圈模式,仅亲密好友的用户可进入房间,直播时长不计入直播奖励活动"]];
break;
}
} failure:^(NSString *msg, int code) {
[FUSLoadingView fus_dismissProgressView];
[FUSDialogView fus_showDialog:msg];
}];
}
- (void)fus_showWithAnim {
[UIView animateWithDuration:0.3 animations:^{
self.contentBottomConstraint.constant = 0;
[self updateConstraintsIfNeeded];
}];
}
- (void)fus_hideWithAnim {
[UIView animateWithDuration:0.3 animations:^{
self.contentBottomConstraint.constant = -200;
[self updateConstraintsIfNeeded];
} completion:^(BOOL finished) {
[self removeFromSuperview];
}];
}
@end
......@@ -168,7 +168,7 @@
});
[FUSLiveHelper shareInstance].roomScopeType = model.scopeType;
// 创建包房 http请求
[FUSLiveHttpHelper fus_createRoomWithCityCode:[[NSUserDefaults standardUserDefaults] objectForKey:CITY_CODE] introduce:model.title liveWay:@"0" success:^(FUSStreamModel *streamModel) {
[FUSLiveHttpHelper fus_createRoomWithCityCode:[[NSUserDefaults standardUserDefaults] objectForKey:CITY_CODE] introduce:model.title liveWay:@"0" themeId:model.themeId themeTitle:model.themeTitle success:^(FUSStreamModel *streamModel) {
[[FUSLiveHelper shareInstance] setStreamModel:streamModel];
// 开播前分享
......
......@@ -12,30 +12,18 @@ import FUSFoundation
import FUSCommon
import Bifrost
@objcMembers public class FUSLiveStartBeautySetView: UIView {
@objcMembers public class FUSLiveStartBeautySetView: FUSPublicLiveBeautyParameterView {
//TODO:暴露出去给视频通话用: added By Pidan
// static public func swiftLoad(){
// Bifrost.bindURL(LiveRoute.beautySetView) { parm in
//
// let beautySetView = FUSLiveStartBeautySetView(frame: CGRectZero)
// beautySetView.dismissHandler = {
// if let handler = parm?[LiveRoute.viewDismissWithBifrostRouteCompletion] as? BifrostRouteCompletion {
// handler(nil)
// }
// }
// return beautySetView
// }
// }
static public func fus_createWithAnimation(showOn: UIView? = nil, dismiss: @escaping (() -> Void)){
guard let showOnView = ((showOn != nil) ? showOn : UIViewController.fus_top()?.view) else { return }
public override class func fus_createWithAnimationWithShow(on showOn: UIView?, dismiss: @escaping () -> Void) -> FUSLiveStartBeautySetView? {
guard let showOnView = ((showOn != nil) ? showOn : UIViewController.fus_top()?.view) else { return nil }
let beautySetView = FUSLiveStartBeautySetView(frame: showOnView.bounds)
beautySetView.dismissHandler = {
beautySetView.fus_dismissComplete = {
dismiss()
}
showOnView.addSubview(beautySetView)
return beautySetView
}
//美颜类型
......@@ -182,8 +170,6 @@ import Bifrost
fatalError("init(coder:) has not been implemented")
}
var dismissHandler: (() -> Void)?
let bgView = UIView()
let bgBtn = UIButton(type: .custom)
let contentView = UIView()
......@@ -376,10 +362,7 @@ import Bifrost
self?.levelSlider.isHidden = true
self?.levelView.isHidden = true
self?.fus_dismissWithAnimation(complete: {
self?.dismissHandler?()
self?.removeFromSuperview()
})
self?.fus_dismissAnimation(true)
}).disposed(by: disposedBag)
//美颜点击
beautyBtn.rx.tap.subscribe(onNext: {[weak self] in
......@@ -654,6 +637,13 @@ import Bifrost
}
public override func fus_dismissAnimation(_ animation: Bool) {
self.fus_dismissWithAnimation(complete: {
self.fus_dismissComplete?()
self.removeFromSuperview()
})
}
}
//MARK: 管理两个collectionview
......
......@@ -218,11 +218,12 @@ import FUSCommon
UIView.animate(withDuration: 0.3) {
self?.contentView.alpha = 0
}
FUSLiveStartBeautySetView.fus_createWithAnimation {
let _ = FUSLiveStartBeautySetView.fus_createWithAnimationWithShow(on: self, dismiss: {
UIView.animate(withDuration: 0.3) {
self?.contentView.alpha = 1
}
}
})
}
// // 开播预告
......
......@@ -21,7 +21,6 @@
#import "FUSLiveGiftView.h"
#import "FUSLiveGiftSendView.h"
#import "FUSLiveBeautyParameterView.h"
#import "FUSVideoChatUserInfoView.h"
#import "FUSHomePageViewController.h"
......@@ -146,8 +145,8 @@
}
- (FUSPublicLiveBeautyParameterView *)fus_createLiveBeautyParameterViewWithFrame:(CGRect)frame {
return [[FUSLiveBeautyParameterView alloc] initWithFrame:frame];
- (FUSPublicLiveBeautyParameterView *__nullable)fus_createWithAnimationWithShowOn:(UIView *__nullable)showOn dismiss:(void(^)(void))dismiss {
return [FUSLiveStartBeautySetView fus_createWithAnimationWithShowOn:showOn dismiss:dismiss];
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment