Commit ffe7f37d by suolong

修改部分bug

parent 8166699e
...@@ -810,10 +810,7 @@ ...@@ -810,10 +810,7 @@
NSInteger durationMs = (model.stageData ? model.stageData.showStatusTime : model.showStatusTime); NSInteger durationMs = (model.stageData ? model.stageData.showStatusTime : model.showStatusTime);
NSInteger remainMs = (model.stageData ? model.stageData.remaintime : model.remaintime); NSInteger remainMs = (model.stageData ? model.stageData.remaintime : model.remaintime);
NSInteger totalSeconds = (durationMs > 0 ? (NSInteger)llround(((NSTimeInterval)durationMs) / 1000.0) : -1); NSInteger totalSeconds = (durationMs > 0 ? (NSInteger)llround(((NSTimeInterval)durationMs) / 1000.0) : -1);
NSInteger remainSeconds = -1; NSInteger remainSeconds = (remainMs >= 0 ? (NSInteger)llround(((NSTimeInterval)remainMs) / 1000.0) : -1);
if (durationMs > 0 && remainMs >= 0 && remainMs <= durationMs) {
remainSeconds = (NSInteger)llround(((NSTimeInterval)remainMs) / 1000.0);
}
self.showTimeCountdownRemainSeconds = remainSeconds; self.showTimeCountdownRemainSeconds = remainSeconds;
[bar fus_updateAudienceWithState:showState [bar fus_updateAudienceWithState:showState
themeText:themeText themeText:themeText
...@@ -832,6 +829,13 @@ ...@@ -832,6 +829,13 @@
newTicketCount:newTicketCount newTicketCount:newTicketCount
giftUserModel:giftUser giftUserModel:giftUser
mvpUserModel:mvpUser]; mvpUserModel:mvpUser];
if (stageStatus == 2) {
NSInteger durationMs = (model.stageData ? model.stageData.showStatusTime : model.showStatusTime);
NSInteger remainMs = (model.stageData ? model.stageData.remaintime : model.remaintime);
NSInteger totalSeconds = (durationMs > 0 ? (NSInteger)llround(((NSTimeInterval)durationMs) / 1000.0) : -1);
NSInteger remainSeconds = (remainMs >= 0 ? (NSInteger)llround(((NSTimeInterval)remainMs) / 1000.0) : -1);
[bar fus_syncCountdownTotalSeconds:totalSeconds countdownRemainingSeconds:remainSeconds];
}
} }
}); });
} }
...@@ -1303,6 +1307,8 @@ ...@@ -1303,6 +1307,8 @@
return; return;
} }
FUSLiveHelper.shareInstance.roomInfoModel.introduce = finalTheme;
if (innerSelf.showTimeFrostedView.superview) { if (innerSelf.showTimeFrostedView.superview) {
[innerSelf.showTimeFrostedView removeFromSuperview]; [innerSelf.showTimeFrostedView removeFromSuperview];
} }
...@@ -1367,8 +1373,13 @@ ...@@ -1367,8 +1373,13 @@
CGFloat progress = (target > 0 ? ((CGFloat)finalNum / (CGFloat)target) : 0); CGFloat progress = (target > 0 ? ((CGFloat)finalNum / (CGFloat)target) : 0);
NSString *remainingText = [NSString stringWithFormat:[NSString fus_localString:@"还差 %zd 张!"], (NSInteger)remaining]; NSString *remainingText = [NSString stringWithFormat:[NSString fus_localString:@"还差 %zd 张!"], (NSInteger)remaining];
NSString *updateTheme = (model.showTheme.length > 0 ? model.showTheme : finalTheme);
if (updateTheme.length > 0) {
FUSLiveHelper.shareInstance.roomInfoModel.introduce = updateTheme;
}
[bar fus_updateWithState:FUSLiveShowTimeCollectFrostedStateStarted [bar fus_updateWithState:FUSLiveShowTimeCollectFrostedStateStarted
themeText:(model.showTheme.length > 0 ? model.showTheme : finalTheme) themeText:updateTheme
progress:progress progress:progress
remainingText:remainingText remainingText:remainingText
newTicketCount:0 newTicketCount:0
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
#import <FUSCommon/FUSCommon.h> #import <FUSCommon/FUSCommon.h>
#import <FUSFoundation/FUSFoundation.h> #import <FUSFoundation/FUSFoundation.h>
@interface FUSLiveRoomThemePopView () @interface FUSLiveRoomThemePopView () <UITextFieldDelegate>
/// 背景遮罩按钮(点击空白处关闭) /// 背景遮罩按钮(点击空白处关闭)
@property (nonatomic, strong) UIButton *bgBtn; @property (nonatomic, strong) UIButton *bgBtn;
...@@ -74,11 +74,17 @@ ...@@ -74,11 +74,17 @@
self.themeTextField.textColor = [UIColor colorWithHex:@"#666666"]; self.themeTextField.textColor = [UIColor colorWithHex:@"#666666"];
self.themeTextField.attributedPlaceholder = [[NSAttributedString alloc] initWithString:[NSString fus_localString:@"请输入直播主题"] self.themeTextField.attributedPlaceholder = [[NSAttributedString alloc] initWithString:[NSString fus_localString:@"请输入直播主题"]
attributes:@{NSForegroundColorAttributeName:[UIColor colorWithHex:@"#9AA0A6"]}]; attributes:@{NSForegroundColorAttributeName:[UIColor colorWithHex:@"#9AA0A6"]}];
self.themeTextField.userInteractionEnabled = NO; self.themeTextField.userInteractionEnabled = YES;
self.themeTextField.returnKeyType = UIReturnKeyDone;
self.themeTextField.delegate = self;
[self.themeBgView addSubview:self.themeTextField]; [self.themeBgView addSubview:self.themeTextField];
UITapGestureRecognizer *tapTheme = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(fus_onTapTheme)]; [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(keyboardWillShow:) name:UIKeyboardWillShowNotification object:nil];
[self.themeBgView addGestureRecognizer:tapTheme]; [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(keyboardWillHide:) name:UIKeyboardWillHideNotification object:nil];
UITapGestureRecognizer *tapContent = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(fus_endEditing)];
tapContent.cancelsTouchesInView = NO;
[self.contentView addGestureRecognizer:tapContent];
CGFloat btnH = 44; CGFloat btnH = 44;
self.confirmBtn = [UIButton buttonWithType:UIButtonTypeCustom]; self.confirmBtn = [UIButton buttonWithType:UIButtonTypeCustom];
...@@ -95,49 +101,55 @@ ...@@ -95,49 +101,55 @@
return self; return self;
} }
- (void)fus_endEditing {
[self.contentView endEditing:YES];
}
#pragma mark - UITextFieldDelegate
- (BOOL)textFieldShouldReturn:(UITextField *)textField {
[self fus_endEditing];
return YES;
}
- (void)keyboardWillShow:(NSNotification *)notification {
NSDictionary *userInfo = notification.userInfo;
CGRect keyboardFrame = [userInfo[UIKeyboardFrameEndUserInfoKey] CGRectValue];
CGFloat duration = [userInfo[UIKeyboardAnimationDurationUserInfoKey] floatValue];
[UIView animateWithDuration:duration animations:^{
self.contentView.bottom = self.height - keyboardFrame.size.height;
}];
}
- (void)keyboardWillHide:(NSNotification *)notification {
NSDictionary *userInfo = notification.userInfo;
CGFloat duration = [userInfo[UIKeyboardAnimationDurationUserInfoKey] floatValue];
[UIView animateWithDuration:duration animations:^{
self.contentView.bottom = self.height;
}];
}
- (void)fus_show { - (void)fus_show {
[UIView animateWithDuration:0.3 animations:^{ [UIView animateWithDuration:0.3 animations:^{
self.contentView.bottom = UIView.fus_screenH; self.contentView.bottom = self.height;
}]; }];
} }
/// 隐藏弹窗并移除 /// 隐藏弹窗并移除
- (void)fus_dismiss { - (void)fus_dismiss {
[self fus_endEditing];
[UIView animateWithDuration:0.25 animations:^{ [UIView animateWithDuration:0.25 animations:^{
self.bgBtn.alpha = 0; self.bgBtn.alpha = 0;
self.contentView.top = UIView.fus_screenH; self.contentView.top = self.height;
} completion:^(BOOL finished) { } completion:^(BOOL finished) {
[self removeFromSuperview]; [self removeFromSuperview];
}]; }];
} }
/// 点击主题输入区域:弹出系统输入框填写主题 - (void)dealloc {
- (void)fus_onTapTheme { [[NSNotificationCenter defaultCenter] removeObserver:self];
UIViewController *topVC = [UIViewController fus_topViewController];
if (!topVC) {
return;
}
UIAlertController *alert = [UIAlertController alertControllerWithTitle:[NSString fus_localString:@"设置主播主题"]
message:nil
preferredStyle:UIAlertControllerStyleAlert];
__weak typeof(self) weakSelf = self;
[alert addTextFieldWithConfigurationHandler:^(UITextField * _Nonnull textField) {
textField.text = weakSelf.themeTextField.text ?: @"";
textField.placeholder = [NSString fus_localString:@"请输入直播主题"];
textField.clearButtonMode = UITextFieldViewModeWhileEditing;
textField.returnKeyType = UIReturnKeyDone;
}];
[alert addAction:[UIAlertAction actionWithTitle:[NSString fus_localString:@"取消"]
style:UIAlertActionStyleCancel
handler:nil]];
[alert addAction:[UIAlertAction actionWithTitle:[NSString fus_localString:@"确定"]
style:UIAlertActionStyleDefault
handler:^(UIAlertAction * _Nonnull action) {
NSString *text = alert.textFields.firstObject.text ?: @"";
weakSelf.themeTextField.text = text;
}]];
[topVC presentViewController:alert animated:YES completion:nil];
} }
/// 点击确定:提交“主播主题”文案并刷新底部主题展示 /// 点击确定:提交“主播主题”文案并刷新底部主题展示
......
...@@ -74,6 +74,12 @@ typedef NS_ENUM(NSInteger, FUSLiveShowTimeCollectFrostedAvatarTapType) { ...@@ -74,6 +74,12 @@ typedef NS_ENUM(NSInteger, FUSLiveShowTimeCollectFrostedAvatarTapType) {
newTicketCount:(NSInteger)newTicketCount newTicketCount:(NSInteger)newTicketCount
giftUserModel:(FUSOnlineUserModel * _Nullable)giftUserModel giftUserModel:(FUSOnlineUserModel * _Nullable)giftUserModel
mvpUserModel:(FUSOnlineUserModel * _Nullable)mvpUserModel; mvpUserModel:(FUSOnlineUserModel * _Nullable)mvpUserModel;
/// 同步倒计时(优先使用服务端 remainTime/showStatusTime 等数据)
/// @param countdownTotalSeconds 当前阶段总时长(秒);<=0 表示未知
/// @param countdownRemainingSeconds 距离结束剩余秒数;<0 表示未知
- (void)fus_syncCountdownTotalSeconds:(NSInteger)countdownTotalSeconds
countdownRemainingSeconds:(NSInteger)countdownRemainingSeconds;
/// 更新顶部赠票用户信息(新票贡献时调用) /// 更新顶部赠票用户信息(新票贡献时调用)
/// @param giftUserModel 赠票用户信息 /// @param giftUserModel 赠票用户信息
/// @param newTicketCount 新票数 /// @param newTicketCount 新票数
......
...@@ -634,26 +634,32 @@ static const NSInteger kFUSShowTimeCollectSeconds = 60 * 10; ...@@ -634,26 +634,32 @@ static const NSInteger kFUSShowTimeCollectSeconds = 60 * 10;
if (countdownRemainingSeconds < 0) { if (countdownRemainingSeconds < 0) {
return; return;
} }
[self fus_syncCountdownTotalSeconds:countdownTotalSeconds countdownRemainingSeconds:countdownRemainingSeconds];
}
NSInteger totalSeconds = (countdownTotalSeconds > 0 ? countdownTotalSeconds : kFUSShowTimeCollectSeconds); - (void)fus_syncCountdownTotalSeconds:(NSInteger)countdownTotalSeconds
self.countdownTotalSeconds = totalSeconds; countdownRemainingSeconds:(NSInteger)countdownRemainingSeconds {
NSInteger clampedRemain = MAX(0, MIN(totalSeconds, countdownRemainingSeconds)); if (countdownRemainingSeconds < 0) {
NSTimeInterval nowSec = [[NSDate date] timeIntervalSince1970];
NSTimeInterval base = nowSec - MAX(0, (NSTimeInterval)totalSeconds - (NSTimeInterval)clampedRemain);
if (self.startTimestamp <= 0) {
self.startTimestamp = base;
self.countdownStageStatus = self.stageStatus;
[self fus_startCountdownTimerIfNeeded];
return; return;
} }
if (self.startTimestamp <= 0 && self.countdownTimer) {
[self fus_stopCountdownTimer];
}
NSInteger totalSeconds = countdownTotalSeconds;
if (totalSeconds <= 0) {
totalSeconds = MAX(kFUSShowTimeCollectSeconds, countdownRemainingSeconds);
} else {
totalSeconds = MAX(totalSeconds, countdownRemainingSeconds);
}
self.countdownTotalSeconds = totalSeconds;
if (self.countdownStageStatus != self.stageStatus) { NSInteger remainSeconds = MAX(0, MIN(totalSeconds, countdownRemainingSeconds));
NSTimeInterval nowSec = [[NSDate date] timeIntervalSince1970];
NSTimeInterval base = nowSec - MAX(0, (NSTimeInterval)totalSeconds - (NSTimeInterval)remainSeconds);
self.startTimestamp = base; self.startTimestamp = base;
self.countdownStageStatus = self.stageStatus; self.countdownStageStatus = self.stageStatus;
[self fus_startCountdownTimerIfNeeded]; [self fus_startCountdownTimerIfNeeded];
return;
}
} }
- (void)setCancelHandler:(void (^)(void))cancelHandler { - (void)setCancelHandler:(void (^)(void))cancelHandler {
...@@ -766,7 +772,6 @@ static const NSInteger kFUSShowTimeCollectSeconds = 60 * 10; ...@@ -766,7 +772,6 @@ static const NSInteger kFUSShowTimeCollectSeconds = 60 * 10;
/// 点击取消:预留给服务端取消接口 /// 点击取消:预留给服务端取消接口
- (void)fus_onClickCancel { - (void)fus_onClickCancel {
// 功能:处理用户端按钮点击或主播端“取消集票”,未接好后端时给出提示
if (self.displayMode == FUSLiveShowTimeCollectFrostedDisplayModeAudience) { if (self.displayMode == FUSLiveShowTimeCollectFrostedDisplayModeAudience) {
if (self.actionHandler) { if (self.actionHandler) {
self.actionHandler(); self.actionHandler();
...@@ -776,11 +781,18 @@ static const NSInteger kFUSShowTimeCollectSeconds = 60 * 10; ...@@ -776,11 +781,18 @@ static const NSInteger kFUSShowTimeCollectSeconds = 60 * 10;
return; return;
} }
if (self.cancelHandler) { if (self.cancelHandler) {
[FUSAlertView showAlertWithTitle:nil
message:[NSString fus_localString:@"确定取消集票?"]
cancelButtonTitle:[NSString fus_localString:@"继续集票"]
otherButtonTitles:@[[NSString fus_localString:@"确定"]]
clickBlock:^(NSInteger buttonIndex) {
if (buttonIndex == 1) {
self.cancelHandler(); self.cancelHandler();
}
}];
return; return;
} }
[FUSDialogView fus_showDialog:[NSString fus_localString:@"功能开发中"]]; [FUSDialogView fus_showDialog:[NSString fus_localString:@"功能开发中"]];
[self fus_dismiss];
} }
/// 根据展示模式调整布局(主播端/用户端差异) /// 根据展示模式调整布局(主播端/用户端差异)
......
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
static const NSInteger kFUSShowTimeTicketMin = 5; static const NSInteger kFUSShowTimeTicketMin = 5;
static const NSInteger kFUSShowTimeTicketMax = 50; static const NSInteger kFUSShowTimeTicketMax = 50;
@interface FUSLiveShowTimePopView () @interface FUSLiveShowTimePopView () <UITextFieldDelegate>
/// 点击背景关闭按钮 /// 点击背景关闭按钮
@property (nonatomic, strong) UIButton *bgBtn; @property (nonatomic, strong) UIButton *bgBtn;
...@@ -109,12 +109,11 @@ static const NSInteger kFUSShowTimeTicketMax = 50; ...@@ -109,12 +109,11 @@ static const NSInteger kFUSShowTimeTicketMax = 50;
self.themeTextField.textColor = [UIColor colorWithHex:@"#666666"]; self.themeTextField.textColor = [UIColor colorWithHex:@"#666666"];
self.themeTextField.attributedPlaceholder = [[NSAttributedString alloc] initWithString:[NSString fus_localString:@"每日16:00,来找我一起玩吧。"] self.themeTextField.attributedPlaceholder = [[NSAttributedString alloc] initWithString:[NSString fus_localString:@"每日16:00,来找我一起玩吧。"]
attributes:@{NSForegroundColorAttributeName:[UIColor colorWithHex:@"#9AA0A6"]}]; attributes:@{NSForegroundColorAttributeName:[UIColor colorWithHex:@"#9AA0A6"]}];
self.themeTextField.userInteractionEnabled = NO; self.themeTextField.userInteractionEnabled = YES;
self.themeTextField.returnKeyType = UIReturnKeyDone;
self.themeTextField.delegate = self;
[self.themeBgView addSubview:self.themeTextField]; [self.themeBgView addSubview:self.themeTextField];
UITapGestureRecognizer *tapTheme = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(fus_onTapTheme)];
[self.themeBgView addGestureRecognizer:tapTheme];
UIView *separator = [[UIView alloc] initWithFrame:CGRectMake(0, self.themeBgView.bottom + 14, self.contentView.width, 1)]; UIView *separator = [[UIView alloc] initWithFrame:CGRectMake(0, self.themeBgView.bottom + 14, self.contentView.width, 1)];
separator.backgroundColor = [UIColor colorWithHex:@"#F2F3F5"]; separator.backgroundColor = [UIColor colorWithHex:@"#F2F3F5"];
[self.contentView addSubview:separator]; [self.contentView addSubview:separator];
...@@ -185,22 +184,60 @@ static const NSInteger kFUSShowTimeTicketMax = 50; ...@@ -185,22 +184,60 @@ static const NSInteger kFUSShowTimeTicketMax = 50;
UILongPressGestureRecognizer *longPressSub = [[UILongPressGestureRecognizer alloc] initWithTarget:self action:@selector(fus_onLongPressSub:)]; UILongPressGestureRecognizer *longPressSub = [[UILongPressGestureRecognizer alloc] initWithTarget:self action:@selector(fus_onLongPressSub:)];
longPressSub.minimumPressDuration = 0.4; longPressSub.minimumPressDuration = 0.4;
[self.subBtn addGestureRecognizer:longPressSub]; [self.subBtn addGestureRecognizer:longPressSub];
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(keyboardWillShow:) name:UIKeyboardWillShowNotification object:nil];
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(keyboardWillHide:) name:UIKeyboardWillHideNotification object:nil];
UITapGestureRecognizer *tapContent = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(fus_endEditing)];
tapContent.cancelsTouchesInView = NO;
[self.contentView addGestureRecognizer:tapContent];
} }
return self; return self;
} }
- (void)fus_endEditing {
[self.contentView endEditing:YES];
}
#pragma mark - UITextFieldDelegate
- (BOOL)textFieldShouldReturn:(UITextField *)textField {
[self fus_endEditing];
return YES;
}
- (void)keyboardWillShow:(NSNotification *)notification {
NSDictionary *userInfo = notification.userInfo;
CGRect keyboardFrame = [userInfo[UIKeyboardFrameEndUserInfoKey] CGRectValue];
CGFloat duration = [userInfo[UIKeyboardAnimationDurationUserInfoKey] floatValue];
[UIView animateWithDuration:duration animations:^{
self.contentView.bottom = self.height - keyboardFrame.size.height;
}];
}
- (void)keyboardWillHide:(NSNotification *)notification {
NSDictionary *userInfo = notification.userInfo;
CGFloat duration = [userInfo[UIKeyboardAnimationDurationUserInfoKey] floatValue];
[UIView animateWithDuration:duration animations:^{
self.contentView.bottom = self.height;
}];
}
/// 执行动画:弹窗从底部滑入 /// 执行动画:弹窗从底部滑入
- (void)fus_show { - (void)fus_show {
[UIView animateWithDuration:0.3 animations:^{ [UIView animateWithDuration:0.3 animations:^{
self.contentView.bottom = UIView.fus_screenH; self.contentView.bottom = self.height;
}]; }];
} }
/// 执行动画:弹窗滑出并移除 /// 执行动画:弹窗滑出并移除
- (void)fus_dismiss { - (void)fus_dismiss {
[self fus_endEditing];
[self fus_stopLongPressTimer]; [self fus_stopLongPressTimer];
[UIView animateWithDuration:0.25 animations:^{ [UIView animateWithDuration:0.25 animations:^{
self.contentView.top = UIView.fus_screenH; self.contentView.top = self.height;
self.bgBtn.alpha = 0; self.bgBtn.alpha = 0;
} completion:^(BOOL finished) { } completion:^(BOOL finished) {
[self removeFromSuperview]; [self removeFromSuperview];
...@@ -209,6 +246,7 @@ static const NSInteger kFUSShowTimeTicketMax = 50; ...@@ -209,6 +246,7 @@ static const NSInteger kFUSShowTimeTicketMax = 50;
/// 视图移除前确保定时器释放 /// 视图移除前确保定时器释放
- (void)dealloc { - (void)dealloc {
[[NSNotificationCenter defaultCenter] removeObserver:self];
[self fus_stopLongPressTimer]; [self fus_stopLongPressTimer];
} }
...@@ -257,35 +295,6 @@ static const NSInteger kFUSShowTimeTicketMax = 50; ...@@ -257,35 +295,6 @@ static const NSInteger kFUSShowTimeTicketMax = 50;
} }
} }
/// 点击主题输入区域:弹出输入框填写主题,避免键盘遮挡
- (void)fus_onTapTheme {
UIViewController *topVC = [UIViewController fus_topViewController];
if (!topVC) {
return;
}
UIAlertController *alert = [UIAlertController alertControllerWithTitle:[NSString fus_localString:@"设置主题"]
message:nil
preferredStyle:UIAlertControllerStyleAlert];
__weak typeof(self) weakSelf = self;
[alert addTextFieldWithConfigurationHandler:^(UITextField * _Nonnull textField) {
textField.text = weakSelf.themeTextField.text ?: @"";
textField.placeholder = [NSString fus_localString:@"每日16:00,来找我一起玩吧。"];
textField.clearButtonMode = UITextFieldViewModeWhileEditing;
textField.returnKeyType = UIReturnKeyDone;
}];
[alert addAction:[UIAlertAction actionWithTitle:[NSString fus_localString:@"取消"]
style:UIAlertActionStyleCancel
handler:nil]];
[alert addAction:[UIAlertAction actionWithTitle:[NSString fus_localString:@"确定"]
style:UIAlertActionStyleDefault
handler:^(UIAlertAction * _Nonnull action) {
NSString *text = alert.textFields.firstObject.text ?: @"";
weakSelf.themeTextField.text = text;
}]];
[topVC presentViewController:alert animated:YES completion:nil];
}
/// 点击中间数字:弹出输入框填写具体票数 /// 点击中间数字:弹出输入框填写具体票数
- (void)fus_onTapCount { - (void)fus_onTapCount {
UIViewController *topVC = [UIViewController fus_topViewController]; UIViewController *topVC = [UIViewController fus_topViewController];
......
...@@ -254,7 +254,7 @@ ...@@ -254,7 +254,7 @@
NSInteger fillCount = (remainingTicketCount >= 0 ? (NSInteger)MAX(0, remainingTicketCount) : -1); NSInteger fillCount = (remainingTicketCount >= 0 ? (NSInteger)MAX(0, remainingTicketCount) : -1);
NSString *fillCountText = (fillCount >= 0 ? [NSString stringWithFormat:@"x%zd", fillCount] : @"x--"); NSString *fillCountText = (fillCount >= 0 ? [NSString stringWithFormat:@"x%zd", fillCount] : @"x--");
NSString *fillPriceText = (fillCount >= 0 ? priceTextForCount(fillCount) : @"--"); NSString *fillPriceText = (fillCount >= 0 ? priceTextForCount(fillCount) : @"--");
NSString *fillTag = (stageStatus == 2 ? @"黑票票力" : [NSString fus_localString:@"直接开始"]); NSString *fillTag = (stageStatus == 2 ? @"展现实力" : [NSString fus_localString:@"直接开始"]);
[self.fillAllOptionView fus_setupCountText:fillCountText priceText:fillPriceText tagText:fillTag]; [self.fillAllOptionView fus_setupCountText:fillCountText priceText:fillPriceText tagText:fillTag];
NSInteger mvpCount = (mvpNeedTicketCount >= 0 ? (NSInteger)MAX(0, mvpNeedTicketCount) : -1); NSInteger mvpCount = (mvpNeedTicketCount >= 0 ? (NSInteger)MAX(0, mvpNeedTicketCount) : -1);
......
...@@ -245,7 +245,7 @@ ...@@ -245,7 +245,7 @@
[self.cardView mas_makeConstraints:^(MASConstraintMaker *make) { [self.cardView mas_makeConstraints:^(MASConstraintMaker *make) {
make.center.equalTo(self); make.center.equalTo(self);
make.size.mas_equalTo(CGSizeMake(285, 366)); make.width.mas_equalTo(285);
}]; }];
[self.titleBarView mas_makeConstraints:^(MASConstraintMaker *make) { [self.titleBarView mas_makeConstraints:^(MASConstraintMaker *make) {
......
...@@ -223,7 +223,16 @@ static const NSInteger kFUSLiveShowTimeMVPConfirmPopViewTag = 8817401; ...@@ -223,7 +223,16 @@ static const NSInteger kFUSLiveShowTimeMVPConfirmPopViewTag = 8817401;
if (url.length > 0) { if (url.length > 0) {
[self.avatarView setWebImageWithSubURLString:url placeholder:[UIImage fus_defaultIcon]]; [self.avatarView setWebImageWithSubURLString:url placeholder:[UIImage fus_defaultIcon]];
} }
self.nicknameLabel.text = (nickname.length > 0 ? nickname : @""); NSString *decodedNickname = nickname;
if (nickname.length > 0) {
decodedNickname = [nickname stringByReplacingOccurrencesOfString:@"+" withString:@" "];
NSString *last = nil;
while (![last isEqualToString:decodedNickname] && [decodedNickname stringByRemovingPercentEncoding]) {
last = decodedNickname;
decodedNickname = [decodedNickname stringByRemovingPercentEncoding];
}
}
self.nicknameLabel.text = (decodedNickname.length > 0 ? decodedNickname : @"");
self.mvpTagLabel.text = (tagText.length > 0 ? tagText : @"MVP"); self.mvpTagLabel.text = (tagText.length > 0 ? tagText : @"MVP");
} }
......
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