Commit 70447a07 by suolong

修复uibug

parent ffe7f37d
Showing with 133 additions and 102 deletions
{
"images" : [
{
"filename" : "Live_room_MVP.png",
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "Live_room_MVP@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "Live_room_MVP@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
{
"images" : [
{
"filename" : "Live_room_close.png",
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "Live_room_close@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "Live_room_close@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
...@@ -1013,6 +1013,10 @@ static NSString *const KLiveDataCenter_store_liveRTCData = @"LiveDataCenter_stor ...@@ -1013,6 +1013,10 @@ static NSString *const KLiveDataCenter_store_liveRTCData = @"LiveDataCenter_stor
[self.liveVC destroyPlayPictureInPicture]; [self.liveVC destroyPlayPictureInPicture];
} }
UIView *rootView = self.liveVC.view ?: [UIViewController fus_topViewController].view; UIView *rootView = self.liveVC.view ?: [UIViewController fus_topViewController].view;
[self.liveVC fus_setupScrollEnable:NO];
self.liveVC.backgroundImageView.hidden = YES;
[self.currentFunctionView fus_hideAllFunctionLayers];
self.liveVC.liveFunctionView.hidden = YES;
__weak typeof(self) weakSelf = self; __weak typeof(self) weakSelf = self;
__block FUSTicketShowCollectTicketToggleResultModel *buyGetDataModel = nil; __block FUSTicketShowCollectTicketToggleResultModel *buyGetDataModel = nil;
NSString *channelId = [[errorDict[@"channelId"] description] ?: @"" copy]; NSString *channelId = [[errorDict[@"channelId"] description] ?: @"" copy];
...@@ -1218,6 +1222,11 @@ static NSString *const KLiveDataCenter_store_liveRTCData = @"LiveDataCenter_stor ...@@ -1218,6 +1222,11 @@ static NSString *const KLiveDataCenter_store_liveRTCData = @"LiveDataCenter_stor
NSString *channelId = [dataModel.roomData.channelId description] ?: @""; NSString *channelId = [dataModel.roomData.channelId description] ?: @"";
NSString *roundId = [dataModel.roomData.roundId description] ?: @""; NSString *roundId = [dataModel.roomData.roundId description] ?: @"";
[strongSelf.liveVC fus_setupScrollEnable:NO];
strongSelf.liveVC.backgroundImageView.hidden = YES;
[strongSelf.currentFunctionView fus_hideAllFunctionLayers];
strongSelf.liveVC.liveFunctionView.hidden = YES;
__weak typeof(strongSelf) weakStrongSelf = strongSelf; __weak typeof(strongSelf) weakStrongSelf = strongSelf;
__block __weak FUSPayRoomEntryMainView *weakEntryView = nil; __block __weak FUSPayRoomEntryMainView *weakEntryView = nil;
FUSPayRoomEntryMainView *entryView = [FUSPayRoomEntryMainView fus_showOnView:rootView viewModel:viewModel actionHandler:^(FUSPayRoomEntryMainViewAction action) { FUSPayRoomEntryMainView *entryView = [FUSPayRoomEntryMainView fus_showOnView:rootView viewModel:viewModel actionHandler:^(FUSPayRoomEntryMainViewAction action) {
...@@ -2122,6 +2131,10 @@ static NSString *const KLiveDataCenter_store_liveRTCData = @"LiveDataCenter_stor ...@@ -2122,6 +2131,10 @@ static NSString *const KLiveDataCenter_store_liveRTCData = @"LiveDataCenter_stor
} }
self.currentFunctionView.hidden = NO; self.currentFunctionView.hidden = NO;
self.liveVC.backgroundImageView.hidden = NO;
self.liveVC.liveFunctionView.hidden = NO;
[self.currentFunctionView fus_showAllFunctionLayers];
[self.liveVC fus_setupScrollEnable:YES];
FUSLogDebug(@"FUSStreamPlayView==== 进入房间成功"); FUSLogDebug(@"FUSStreamPlayView==== 进入房间成功");
if ([FUSLiveHelper shareInstance].liveRoomType != FUSRoomTypeLinkMic) { if ([FUSLiveHelper shareInstance].liveRoomType != FUSRoomTypeLinkMic) {
......
...@@ -86,8 +86,8 @@ static const NSInteger kFUSShowTimeCollectSeconds = 60 * 10; ...@@ -86,8 +86,8 @@ static const NSInteger kFUSShowTimeCollectSeconds = 60 * 10;
@property (nonatomic, strong) UIImageView *mvpIconView; @property (nonatomic, strong) UIImageView *mvpIconView;
/// 用户端:MVP 头像 /// 用户端:MVP 头像
@property (nonatomic, strong) UIImageView *mvpAvatarView; @property (nonatomic, strong) UIImageView *mvpAvatarView;
/// 用户端:MVP 角标 /// 用户端:MVP 角标(图标)
@property (nonatomic, strong) UILabel *mvpTagLabel; @property (nonatomic, strong) UIImageView *mvpImageView;
/// 取消集票按钮 /// 取消集票按钮
@property (nonatomic, strong) UIButton *cancelBtn; @property (nonatomic, strong) UIButton *cancelBtn;
...@@ -275,22 +275,17 @@ static const NSInteger kFUSShowTimeCollectSeconds = 60 * 10; ...@@ -275,22 +275,17 @@ static const NSInteger kFUSShowTimeCollectSeconds = 60 * 10;
[self.mvpAvatarView addGestureRecognizer:mvpAvatarTap]; [self.mvpAvatarView addGestureRecognizer:mvpAvatarTap];
[self.blurView.contentView addSubview:self.mvpAvatarView]; [self.blurView.contentView addSubview:self.mvpAvatarView];
self.mvpTagLabel = [[UILabel alloc] init]; self.mvpImageView = [[UIImageView alloc] init];
self.mvpTagLabel.hidden = YES; self.mvpImageView.hidden = YES;
self.mvpTagLabel.textAlignment = NSTextAlignmentCenter; self.mvpImageView.contentMode = UIViewContentModeScaleAspectFit;
self.mvpTagLabel.font = [UIFont fus_themeBoldFont:9]; self.mvpImageView.image = [FUSShowRoomCenterBunble imageNamed:@"Live_room_MVP"];
self.mvpTagLabel.textColor = UIColor.blackColor; [self.blurView.contentView addSubview:self.mvpImageView];
self.mvpTagLabel.backgroundColor = [UIColor colorWithHex:@"#52DDE2"];
self.mvpTagLabel.text = @"MVP";
self.mvpTagLabel.layer.cornerRadius = 7;
self.mvpTagLabel.layer.masksToBounds = YES;
[self.blurView.contentView addSubview:self.mvpTagLabel];
[self.blurView mas_makeConstraints:^(MASConstraintMaker *make) { [self.blurView mas_makeConstraints:^(MASConstraintMaker *make) {
make.edges.equalTo(self); make.edges.equalTo(self);
}]; }];
[self.mvpTagLabel mas_makeConstraints:^(MASConstraintMaker *make) { [self.mvpImageView mas_makeConstraints:^(MASConstraintMaker *make) {
make.centerX.equalTo(self.mvpAvatarView); make.centerX.equalTo(self.mvpAvatarView);
make.bottom.equalTo(self.mvpAvatarView).offset(3); make.bottom.equalTo(self.mvpAvatarView).offset(3);
make.size.mas_equalTo(CGSizeMake(34, 14)); make.size.mas_equalTo(CGSizeMake(34, 14));
...@@ -469,18 +464,17 @@ static const NSInteger kFUSShowTimeCollectSeconds = 60 * 10; ...@@ -469,18 +464,17 @@ static const NSInteger kFUSShowTimeCollectSeconds = 60 * 10;
} }
self.mvpIconView.hidden = YES; self.mvpIconView.hidden = YES;
if (mvpUserModel) { self.mvpAvatarView.hidden = NO;
self.mvpAvatarView.hidden = NO; self.mvpImageView.hidden = NO;
self.mvpTagLabel.hidden = NO;
if (mvpUserModel.face.length > 0) { if (mvpUserModel && mvpUserModel.face.length > 0) {
[self.mvpAvatarView setWebImageWithSubURLString:mvpUserModel.face placeholder:nil]; [self.mvpAvatarView setWebImageWithSubURLString:mvpUserModel.face placeholder:[UIImage fus_defaultIcon]];
}
} else { } else {
self.mvpAvatarView.hidden = YES; self.mvpAvatarView.image = [UIImage fus_defaultIcon];
self.mvpTagLabel.hidden = YES;
} }
[self.mvpAvatarView mas_updateConstraints:^(MASConstraintMaker *make) { [self.mvpAvatarView mas_updateConstraints:^(MASConstraintMaker *make) {
make.size.mas_equalTo(self.mvpAvatarView.hidden ? CGSizeZero : CGSizeMake(42, 42)); make.size.mas_equalTo(CGSizeMake(42, 42));
}]; }];
CGFloat clamped = MIN(1.0, MAX(0.0, progress)); CGFloat clamped = MIN(1.0, MAX(0.0, progress));
...@@ -902,7 +896,7 @@ static const NSInteger kFUSShowTimeCollectSeconds = 60 * 10; ...@@ -902,7 +896,7 @@ static const NSInteger kFUSShowTimeCollectSeconds = 60 * 10;
showBtn = (self.cancelHandler != nil); showBtn = (self.cancelHandler != nil);
[self.cancelBtn setTitle:[NSString fus_localString:@"取消集票"] forState:UIControlStateNormal]; [self.cancelBtn setTitle:[NSString fus_localString:@"取消集票"] forState:UIControlStateNormal];
} }
if (self.stageStatus == 2) { if (self.stageStatus == 1 || self.stageStatus == 2) {
if (self.displayMode == FUSLiveShowTimeCollectFrostedDisplayModeAnchor) { if (self.displayMode == FUSLiveShowTimeCollectFrostedDisplayModeAnchor) {
showBtn = NO; showBtn = NO;
} else { } else {
......
...@@ -16,8 +16,8 @@ ...@@ -16,8 +16,8 @@
UIImageView *_faceImageView; UIImageView *_faceImageView;
/// 昵称 /// 昵称
UILabel *_nicknameLabel; UILabel *_nicknameLabel;
/// MVP 标签(仅 MVP 用户展示) /// MVP 图标(仅 MVP 用户展示)
UILabel *_mvpTagLabel; UIImageView *_mvpImageView;
/// 在线等级 /// 在线等级
UILabel *_onlineLabel; UILabel *_onlineLabel;
/// 性别和年龄按钮 /// 性别和年龄按钮
...@@ -57,16 +57,11 @@ ...@@ -57,16 +57,11 @@
_nicknameLabel.textColor = [UIColor colorWithHex:@"#1F1F1F"]; _nicknameLabel.textColor = [UIColor colorWithHex:@"#1F1F1F"];
[self.contentView addSubview:_nicknameLabel]; [self.contentView addSubview:_nicknameLabel];
_mvpTagLabel = [[UILabel alloc] initWithFrame:CGRectZero]; _mvpImageView = [[UIImageView alloc] initWithFrame:CGRectZero];
_mvpTagLabel.hidden = YES; _mvpImageView.hidden = YES;
_mvpTagLabel.textAlignment = NSTextAlignmentCenter; _mvpImageView.contentMode = UIViewContentModeScaleAspectFit;
_mvpTagLabel.font = [UIFont fus_themeBoldFont:9]; _mvpImageView.image = [FUSShowRoomCenterBunble imageNamed:@"Live_room_MVP"];
_mvpTagLabel.textColor = UIColor.blackColor; [self.contentView addSubview:_mvpImageView];
_mvpTagLabel.backgroundColor = [UIColor colorWithHex:@"#52DDE2"];
_mvpTagLabel.text = @"MVP";
_mvpTagLabel.layer.cornerRadius = 7;
_mvpTagLabel.layer.masksToBounds = YES;
[self.contentView addSubview:_mvpTagLabel];
_onlineLabel = [[UILabel alloc] initWithFrame:CGRectZero]; _onlineLabel = [[UILabel alloc] initWithFrame:CGRectZero];
_onlineLabel.font = [UIFont fus_themeFont:12]; _onlineLabel.font = [UIFont fus_themeFont:12];
...@@ -172,12 +167,11 @@ ...@@ -172,12 +167,11 @@
make.right.lessThanOrEqualTo(_countLabel.mas_left).offset(-10); make.right.lessThanOrEqualTo(_countLabel.mas_left).offset(-10);
}]; }];
[_mvpTagLabel mas_makeConstraints:^(MASConstraintMaker *make) { [_mvpImageView mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.equalTo(_firstLoveImageView.mas_right).offset(4); make.centerX.equalTo(_faceImageView);
make.centerY.equalTo(_nicknameLabel.mas_centerY); make.centerY.equalTo(_faceImageView.mas_bottom).offset(-2);
make.height.mas_equalTo(14); make.height.mas_equalTo(14);
make.width.mas_equalTo(34); make.width.mas_equalTo(34);
make.right.lessThanOrEqualTo(_countLabel.mas_left).offset(-10);
}]; }];
[_genderAndAgeBtn mas_makeConstraints:^(MASConstraintMaker *make) { [_genderAndAgeBtn mas_makeConstraints:^(MASConstraintMaker *make) {
...@@ -204,7 +198,7 @@ ...@@ -204,7 +198,7 @@
_faceImageView.image = nil; _faceImageView.image = nil;
_nicknameLabel.text = @""; _nicknameLabel.text = @"";
_countLabel.text = @""; _countLabel.text = @"";
_mvpTagLabel.hidden = YES; _mvpImageView.hidden = YES;
_vipImageView.hidden = YES; _vipImageView.hidden = YES;
_newImageView.hidden = YES; _newImageView.hidden = YES;
_firstLoveImageView.hidden = YES; _firstLoveImageView.hidden = YES;
...@@ -269,7 +263,7 @@ ...@@ -269,7 +263,7 @@
} }
_onlineLabel.hidden = NO; _onlineLabel.hidden = NO;
_mvpTagLabel.hidden = !(model.mvp == 1); _mvpImageView.hidden = !(model.mvp == 1);
[_onlineLabel mas_remakeConstraints:^(MASConstraintMaker *make) { [_onlineLabel mas_remakeConstraints:^(MASConstraintMaker *make) {
make.left.equalTo(_nicknameLabel.mas_right).offset(6); make.left.equalTo(_nicknameLabel.mas_right).offset(6);
...@@ -312,23 +306,8 @@ ...@@ -312,23 +306,8 @@
make.right.lessThanOrEqualTo(_countLabel.mas_left).offset(-10); make.right.lessThanOrEqualTo(_countLabel.mas_left).offset(-10);
}]; }];
[_mvpTagLabel mas_remakeConstraints:^(MASConstraintMaker *make) { // MVP Icon remains below avatar, no need to remake horizontal constraints
UIView *leftView = nil; _mvpImageView.hidden = !(model.mvp == 1);
if (!_firstLoveImageView.hidden) {
leftView = _firstLoveImageView;
} else if (showNew) {
leftView = _newImageView;
} else if (showVip) {
leftView = _vipImageView;
} else {
leftView = _onlineLabel;
}
make.left.equalTo(leftView.mas_right).offset(4);
make.centerY.equalTo(_nicknameLabel.mas_centerY);
make.height.mas_equalTo(14);
make.width.mas_equalTo((model.mvp == 1) ? 34 : 0);
make.right.lessThanOrEqualTo(_countLabel.mas_left).offset(-10);
}];
[self.contentView layoutIfNeeded]; [self.contentView layoutIfNeeded];
} }
...@@ -341,10 +320,10 @@ ...@@ -341,10 +320,10 @@
_faceImageView.image = UIImage.fus_defaultIcon; _faceImageView.image = UIImage.fus_defaultIcon;
} }
/// 票数与 MVP 标签受服务端数据影响,统一做兜底,避免异常值导致 UI 抖动 /// 票数与 MVP 图标受服务端数据影响,统一做兜底,避免异常值导致 UI 抖动
_nicknameLabel.text = (nickname.length > 0 ? nickname : @""); _nicknameLabel.text = (nickname.length > 0 ? nickname : @"");
_countLabel.text = [NSString stringWithFormat:@"%zd", (NSInteger)MAX(0, ticketCount)]; _countLabel.text = [NSString stringWithFormat:@"%zd", (NSInteger)MAX(0, ticketCount)];
_mvpTagLabel.hidden = !isMVP; _mvpImageView.hidden = !isMVP;
} }
@end @end
...@@ -255,7 +255,7 @@ NSString * const FUSLiveShowTimeAudienceEntryTicketOptionTagTextKey = @"tagText" ...@@ -255,7 +255,7 @@ NSString * const FUSLiveShowTimeAudienceEntryTicketOptionTagTextKey = @"tagText"
/// 背景遮罩按钮(用于拦截触摸并支持点击关闭) /// 背景遮罩按钮(用于拦截触摸并支持点击关闭)
@property (nonatomic, strong) UIButton *bgBtn; @property (nonatomic, strong) UIButton *bgBtn;
/// 右上角关闭按钮(对齐项目通用关闭样式) /// 右上角关闭按钮
@property (nonatomic, strong) UIButton *closeBtn; @property (nonatomic, strong) UIButton *closeBtn;
/// 白色内容卡片容器(承载所有展示内容) /// 白色内容卡片容器(承载所有展示内容)
@property (nonatomic, strong) UIView *cardView; @property (nonatomic, strong) UIView *cardView;
...@@ -478,7 +478,7 @@ NSString * const FUSLiveShowTimeAudienceEntryTicketOptionTagTextKey = @"tagText" ...@@ -478,7 +478,7 @@ NSString * const FUSLiveShowTimeAudienceEntryTicketOptionTagTextKey = @"tagText"
[self addSubview:self.bgBtn]; [self addSubview:self.bgBtn];
self.closeBtn = [UIButton buttonWithType:UIButtonTypeCustom]; self.closeBtn = [UIButton buttonWithType:UIButtonTypeCustom];
[self.closeBtn setImage:[FUSShowRoomCenterBunble imageNamed:@"live_board_close"] forState:UIControlStateNormal]; [self.closeBtn setImage:[FUSShowRoomCenterBunble imageNamed:@"Live_room_close"] forState:UIControlStateNormal];
[self addSubview:self.closeBtn]; [self addSubview:self.closeBtn];
self.cardView = [[UIView alloc] initWithFrame:CGRectZero]; self.cardView = [[UIView alloc] initWithFrame:CGRectZero];
...@@ -599,7 +599,6 @@ NSString * const FUSLiveShowTimeAudienceEntryTicketOptionTagTextKey = @"tagText" ...@@ -599,7 +599,6 @@ NSString * const FUSLiveShowTimeAudienceEntryTicketOptionTagTextKey = @"tagText"
- (void)fus_bindActions { - (void)fus_bindActions {
__weak typeof(self) weakSelf = self; __weak typeof(self) weakSelf = self;
[self.bgBtn addTarget:self action:@selector(fus_onTapBackground) forControlEvents:UIControlEventTouchUpInside];
[self.closeBtn addTarget:self action:@selector(fus_onTapClose) forControlEvents:UIControlEventTouchUpInside]; [self.closeBtn addTarget:self action:@selector(fus_onTapClose) forControlEvents:UIControlEventTouchUpInside];
[self.enterButton addTarget:self action:@selector(fus_onTapEnter) forControlEvents:UIControlEventTouchUpInside]; [self.enterButton addTarget:self action:@selector(fus_onTapEnter) forControlEvents:UIControlEventTouchUpInside];
[self.noticeButton addTarget:self action:@selector(fus_onTapNotice) forControlEvents:UIControlEventTouchUpInside]; [self.noticeButton addTarget:self action:@selector(fus_onTapNotice) forControlEvents:UIControlEventTouchUpInside];
...@@ -633,16 +632,6 @@ NSString * const FUSLiveShowTimeAudienceEntryTicketOptionTagTextKey = @"tagText" ...@@ -633,16 +632,6 @@ NSString * const FUSLiveShowTimeAudienceEntryTicketOptionTagTextKey = @"tagText"
}]; }];
} }
- (void)fus_onTapBackground {
if (!self.dismissWhenTapBackground) {
return;
}
/// 点击背景属于“用户意图关闭”,是否真正关闭交由外部统一控制(便于做强引导/二次确认)
if (self.actionHandler) {
self.actionHandler(FUSLiveShowTimeAudienceEntryMainViewActionDismiss, self.selectedOptionIndex);
}
}
- (void)fus_onTapClose { - (void)fus_onTapClose {
if (self.actionHandler) { if (self.actionHandler) {
self.actionHandler(FUSLiveShowTimeAudienceEntryMainViewActionDismiss, self.selectedOptionIndex); self.actionHandler(FUSLiveShowTimeAudienceEntryMainViewActionDismiss, self.selectedOptionIndex);
......
...@@ -46,6 +46,7 @@ ...@@ -46,6 +46,7 @@
@interface FUSPayRoomEntryMainView () @interface FUSPayRoomEntryMainView ()
@property (nonatomic, strong) UIButton *backgroundButton; @property (nonatomic, strong) UIButton *backgroundButton;
@property (nonatomic, strong) UIButton *closeBtn;
@property (nonatomic, strong) UIView *cardView; @property (nonatomic, strong) UIView *cardView;
@property (nonatomic, strong) UIView *titleBarView; @property (nonatomic, strong) UIView *titleBarView;
...@@ -165,6 +166,10 @@ ...@@ -165,6 +166,10 @@
self.backgroundButton.backgroundColor = UIColor.clearColor; self.backgroundButton.backgroundColor = UIColor.clearColor;
[self addSubview:self.backgroundButton]; [self addSubview:self.backgroundButton];
self.closeBtn = [UIButton buttonWithType:UIButtonTypeCustom];
[self.closeBtn setImage:[FUSShowRoomCenterBunble imageNamed:@"Live_room_close"] forState:UIControlStateNormal];
[self addSubview:self.closeBtn];
// 卡片层:承载内容与操作按钮。 // 卡片层:承载内容与操作按钮。
self.cardView = [[UIView alloc] initWithFrame:CGRectZero]; self.cardView = [[UIView alloc] initWithFrame:CGRectZero];
self.cardView.backgroundColor = UIColor.whiteColor; self.cardView.backgroundColor = UIColor.whiteColor;
...@@ -243,6 +248,12 @@ ...@@ -243,6 +248,12 @@
make.edges.equalTo(self); make.edges.equalTo(self);
}]; }];
[self.closeBtn mas_makeConstraints:^(MASConstraintMaker *make) {
make.top.equalTo(self.mas_safeAreaLayoutGuideTop).offset(6);
make.right.equalTo(self).offset(-8);
make.width.height.mas_equalTo(44);
}];
[self.cardView mas_makeConstraints:^(MASConstraintMaker *make) { [self.cardView mas_makeConstraints:^(MASConstraintMaker *make) {
make.center.equalTo(self); make.center.equalTo(self);
make.width.mas_equalTo(285); make.width.mas_equalTo(285);
...@@ -280,8 +291,8 @@ ...@@ -280,8 +291,8 @@
[self.accompanyAvatarContainerView mas_makeConstraints:^(MASConstraintMaker *make) { [self.accompanyAvatarContainerView mas_makeConstraints:^(MASConstraintMaker *make) {
make.top.equalTo(self.anchorNameLabel.mas_bottom).offset(12); make.top.equalTo(self.anchorNameLabel.mas_bottom).offset(12);
make.centerX.equalTo(self.cardView); make.centerX.equalTo(self.cardView);
make.height.mas_equalTo(18); make.height.mas_equalTo(30);
self.accompanyAvatarContainerWidthConstraint = make.width.mas_equalTo(18); self.accompanyAvatarContainerWidthConstraint = make.width.mas_equalTo(30);
}]; }];
[self.accompanyCountLabel mas_makeConstraints:^(MASConstraintMaker *make) { [self.accompanyCountLabel mas_makeConstraints:^(MASConstraintMaker *make) {
...@@ -320,7 +331,8 @@ ...@@ -320,7 +331,8 @@
} }
- (void)fus_bindActions { - (void)fus_bindActions {
[self.backgroundButton addTarget:self action:@selector(fus_onTapBackground) forControlEvents:UIControlEventTouchUpInside]; [self.backgroundButton addTarget:self action:@selector(fus_onTapClose) forControlEvents:UIControlEventTouchUpInside];
[self.closeBtn addTarget:self action:@selector(fus_onTapClose) forControlEvents:UIControlEventTouchUpInside];
[self.primaryButton addTarget:self action:@selector(fus_onTapPrimary) forControlEvents:UIControlEventTouchUpInside]; [self.primaryButton addTarget:self action:@selector(fus_onTapPrimary) forControlEvents:UIControlEventTouchUpInside];
[self.trialButton addTarget:self action:@selector(fus_onTapTrial) forControlEvents:UIControlEventTouchUpInside]; [self.trialButton addTarget:self action:@selector(fus_onTapTrial) forControlEvents:UIControlEventTouchUpInside];
} }
...@@ -395,7 +407,7 @@ ...@@ -395,7 +407,7 @@
- (void)fus_updateAccompanyAvatarsWithFacePaths:(NSArray<NSString *> *)facePaths { - (void)fus_updateAccompanyAvatarsWithFacePaths:(NSArray<NSString *> *)facePaths {
NSArray<NSString *> *safeFacePaths = (facePaths ?: @[]); NSArray<NSString *> *safeFacePaths = (facePaths ?: @[]);
NSUInteger maxCount = 8; NSUInteger maxCount = 10;
NSUInteger displayCount = MIN(maxCount, safeFacePaths.count); NSUInteger displayCount = MIN(maxCount, safeFacePaths.count);
if (displayCount == 0) { if (displayCount == 0) {
displayCount = 1; displayCount = 1;
...@@ -404,7 +416,7 @@ ...@@ -404,7 +416,7 @@
while (self.accompanyAvatarViews.count < displayCount) { while (self.accompanyAvatarViews.count < displayCount) {
UIImageView *imageView = [[UIImageView alloc] initWithFrame:CGRectZero]; UIImageView *imageView = [[UIImageView alloc] initWithFrame:CGRectZero];
imageView.contentMode = UIViewContentModeScaleAspectFill; imageView.contentMode = UIViewContentModeScaleAspectFill;
imageView.layer.cornerRadius = 9; imageView.layer.cornerRadius = 15;
imageView.layer.masksToBounds = YES; imageView.layer.masksToBounds = YES;
imageView.backgroundColor = [UIColor colorWithHex:@"#E6E6E6"]; imageView.backgroundColor = [UIColor colorWithHex:@"#E6E6E6"];
[self.accompanyAvatarContainerView addSubview:imageView]; [self.accompanyAvatarContainerView addSubview:imageView];
...@@ -428,17 +440,24 @@ ...@@ -428,17 +440,24 @@
} else { } else {
[imageView setLiveFaceWebImageWithSubURLString:facePath placeholder:UIImage.fus_defaultIcon]; [imageView setLiveFaceWebImageWithSubURLString:facePath placeholder:UIImage.fus_defaultIcon];
} }
// 为了实现错位层叠效果,后添加的视图在最上面
[self.accompanyAvatarContainerView bringSubviewToFront:imageView];
// 为了和设计图保持一致,给头像加一层白边,让层叠时边界更清晰
imageView.layer.borderWidth = 1.0;
imageView.layer.borderColor = UIColor.whiteColor.CGColor;
} }
CGFloat size = 18; CGFloat size = 30;
CGFloat space = 6; CGFloat overlap = 8; // 重叠部分的宽度
CGFloat totalW = displayCount * size + (displayCount > 0 ? (displayCount - 1) * space : 0); CGFloat visibleWidth = size - overlap; // 每个头像实际增加的宽度
CGFloat totalW = displayCount > 0 ? (size + (displayCount - 1) * visibleWidth) : 0;
[self.accompanyAvatarContainerWidthConstraint setOffset:totalW]; [self.accompanyAvatarContainerWidthConstraint setOffset:totalW];
for (NSUInteger idx = 0; idx < displayCount; idx++) { for (NSUInteger idx = 0; idx < displayCount; idx++) {
UIImageView *imageView = self.accompanyAvatarViews[idx]; UIImageView *imageView = self.accompanyAvatarViews[idx];
[imageView mas_remakeConstraints:^(MASConstraintMaker *make) { [imageView mas_remakeConstraints:^(MASConstraintMaker *make) {
make.left.equalTo(self.accompanyAvatarContainerView).offset(idx * (size + space)); make.left.equalTo(self.accompanyAvatarContainerView).offset(idx * visibleWidth);
make.centerY.equalTo(self.accompanyAvatarContainerView); make.centerY.equalTo(self.accompanyAvatarContainerView);
make.size.mas_equalTo(CGSizeMake(size, size)); make.size.mas_equalTo(CGSizeMake(size, size));
}]; }];
...@@ -450,11 +469,7 @@ ...@@ -450,11 +469,7 @@
#pragma mark - Actions #pragma mark - Actions
- (void)fus_onTapBackground { - (void)fus_onTapClose {
if (!self.viewModel.dismissWhenTapBackground) {
return;
}
if (self.actionHandler) { if (self.actionHandler) {
self.actionHandler(FUSPayRoomEntryMainViewActionDismiss); self.actionHandler(FUSPayRoomEntryMainViewActionDismiss);
} }
......
...@@ -24,8 +24,8 @@ static const NSInteger kFUSLiveShowTimeMVPConfirmPopViewTag = 8817401; ...@@ -24,8 +24,8 @@ static const NSInteger kFUSLiveShowTimeMVPConfirmPopViewTag = 8817401;
@property (nonatomic, strong) UILabel *ticketCountLabel; @property (nonatomic, strong) UILabel *ticketCountLabel;
/// MVP 头像 /// MVP 头像
@property (nonatomic, strong) UIImageView *avatarView; @property (nonatomic, strong) UIImageView *avatarView;
/// MVP 标识标签 /// MVP 标识图标
@property (nonatomic, strong) UILabel *mvpTagLabel; @property (nonatomic, strong) UIImageView *mvpImageView;
/// 昵称标签 /// 昵称标签
@property (nonatomic, strong) UILabel *nicknameLabel; @property (nonatomic, strong) UILabel *nicknameLabel;
...@@ -106,15 +106,10 @@ static const NSInteger kFUSLiveShowTimeMVPConfirmPopViewTag = 8817401; ...@@ -106,15 +106,10 @@ static const NSInteger kFUSLiveShowTimeMVPConfirmPopViewTag = 8817401;
self.avatarView.image = [UIImage fus_defaultIcon]; self.avatarView.image = [UIImage fus_defaultIcon];
[self.contentView addSubview:self.avatarView]; [self.contentView addSubview:self.avatarView];
self.mvpTagLabel = [[UILabel alloc] init]; self.mvpImageView = [[UIImageView alloc] init];
self.mvpTagLabel.text = @"MVP"; self.mvpImageView.contentMode = UIViewContentModeScaleAspectFit;
self.mvpTagLabel.textAlignment = NSTextAlignmentCenter; self.mvpImageView.image = [FUSShowRoomCenterBunble imageNamed:@"Live_room_MVP"];
self.mvpTagLabel.font = [UIFont fus_themeBoldFont:12]; [self.contentView addSubview:self.mvpImageView];
self.mvpTagLabel.textColor = UIColor.blackColor;
self.mvpTagLabel.backgroundColor = [UIColor colorWithHex:@"#01D9E0"];
self.mvpTagLabel.layer.cornerRadius = 10;
self.mvpTagLabel.layer.masksToBounds = YES;
[self.contentView addSubview:self.mvpTagLabel];
self.nicknameLabel = [[UILabel alloc] init]; self.nicknameLabel = [[UILabel alloc] init];
self.nicknameLabel.textAlignment = NSTextAlignmentCenter; self.nicknameLabel.textAlignment = NSTextAlignmentCenter;
...@@ -172,16 +167,16 @@ static const NSInteger kFUSLiveShowTimeMVPConfirmPopViewTag = 8817401; ...@@ -172,16 +167,16 @@ static const NSInteger kFUSLiveShowTimeMVPConfirmPopViewTag = 8817401;
make.size.mas_equalTo(CGSizeMake(50, 50)); make.size.mas_equalTo(CGSizeMake(50, 50));
}]; }];
[self.mvpTagLabel mas_makeConstraints:^(MASConstraintMaker *make) { [self.mvpImageView mas_makeConstraints:^(MASConstraintMaker *make) {
make.centerX.equalTo(self.avatarView); make.centerX.equalTo(self.avatarView);
make.top.equalTo(self.avatarView.mas_bottom).offset(-8); make.top.equalTo(self.avatarView.mas_bottom).offset(-8);
make.size.mas_equalTo(CGSizeMake(54, 20)); make.size.mas_equalTo(CGSizeMake(42, 16));
}]; }];
[self.nicknameLabel mas_makeConstraints:^(MASConstraintMaker *make) { [self.nicknameLabel mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.equalTo(self.contentView).offset(16); make.left.equalTo(self.contentView).offset(16);
make.right.equalTo(self.contentView).offset(-16); make.right.equalTo(self.contentView).offset(-16);
make.top.equalTo(self.mvpTagLabel.mas_bottom).offset(6); make.top.equalTo(self.mvpImageView.mas_bottom).offset(6);
make.height.mas_equalTo(20); make.height.mas_equalTo(20);
}]; }];
...@@ -233,7 +228,7 @@ static const NSInteger kFUSLiveShowTimeMVPConfirmPopViewTag = 8817401; ...@@ -233,7 +228,7 @@ static const NSInteger kFUSLiveShowTimeMVPConfirmPopViewTag = 8817401;
} }
} }
self.nicknameLabel.text = (decodedNickname.length > 0 ? decodedNickname : @""); self.nicknameLabel.text = (decodedNickname.length > 0 ? decodedNickname : @"");
self.mvpTagLabel.text = (tagText.length > 0 ? tagText : @"MVP"); // self.mvpImageView.image is fixed as Live_room_MVP, so tagText is ignored here.
} }
- (void)fus_updateTicketCount:(NSInteger)ticketCount { - (void)fus_updateTicketCount:(NSInteger)ticketCount {
......
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