Commit 7ce0c345 by suolong

修复部分bug

parent 8fc659f3
Showing with 296 additions and 70 deletions
......@@ -691,7 +691,7 @@
CLANG_CXX_LANGUAGE_STANDARD = "gnu++17";
CODE_SIGN_ENTITLEMENTS = FuSiLive/FuSiLive.entitlements;
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 202506260051;
CURRENT_PROJECT_VERSION = 202506260053;
DEFINES_MODULE = YES;
DEVELOPMENT_TEAM = 6GG26BHUMC;
ENABLE_ON_DEMAND_RESOURCES = NO;
......@@ -956,7 +956,7 @@
CLANG_CXX_LANGUAGE_STANDARD = "gnu++17";
CODE_SIGN_ENTITLEMENTS = FuSiLive/FuSiLive.entitlements;
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 202506260051;
CURRENT_PROJECT_VERSION = 202506260053;
DEFINES_MODULE = YES;
DEVELOPMENT_TEAM = 6GG26BHUMC;
ENABLE_ON_DEMAND_RESOURCES = NO;
......
......@@ -1163,6 +1163,7 @@
3E4DC89A2F580A46003070EC /* live_link_mic_boy_speak_anim.webp in Resources */ = {isa = PBXBuildFile; fileRef = 3E4DC8982F580A46003070EC /* live_link_mic_boy_speak_anim.webp */; };
3E4DC89B2F580A46003070EC /* live_link_mic_girl_speak_anim.webp in Resources */ = {isa = PBXBuildFile; fileRef = 3E4DC8992F580A46003070EC /* live_link_mic_girl_speak_anim.webp */; };
3E50054E2F556DC300058145 /* FUSLiveRTCData.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3E50054D2F556DC300058145 /* FUSLiveRTCData.swift */; };
3ED4D5C42F7BB15D00C17B8E /* fus_home_navi_startLive2_animate.webp in Resources */ = {isa = PBXBuildFile; fileRef = 3ED4D5C32F7BB15D00C17B8E /* fus_home_navi_startLive2_animate.webp */; };
7C2A1F1A3A1D4D2C9A0B1C2D /* FUSPayRoomCompanionDataModel.h in Headers */ = {isa = PBXBuildFile; fileRef = 7C2A1F0B3A1D4D2C9A0B1C2D /* FUSPayRoomCompanionDataModel.h */; };
7C2A1F1B3A1D4D2C9A0B1C2D /* FUSPayRoomCompanionDataModel.m in Sources */ = {isa = PBXBuildFile; fileRef = 7C2A1F0C3A1D4D2C9A0B1C2D /* FUSPayRoomCompanionDataModel.m */; };
7C2A1F1C3A1D4D2C9A0B1C2D /* FUSPayRoomCompanionPopView.h in Headers */ = {isa = PBXBuildFile; fileRef = 7C2A1F0D3A1D4D2C9A0B1C2D /* FUSPayRoomCompanionPopView.h */; };
......@@ -3575,6 +3576,7 @@
3E4DC8982F580A46003070EC /* live_link_mic_boy_speak_anim.webp */ = {isa = PBXFileReference; lastKnownFileType = file; path = live_link_mic_boy_speak_anim.webp; sourceTree = "<group>"; };
3E4DC8992F580A46003070EC /* live_link_mic_girl_speak_anim.webp */ = {isa = PBXFileReference; lastKnownFileType = file; path = live_link_mic_girl_speak_anim.webp; sourceTree = "<group>"; };
3E50054D2F556DC300058145 /* FUSLiveRTCData.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FUSLiveRTCData.swift; sourceTree = "<group>"; };
3ED4D5C32F7BB15D00C17B8E /* fus_home_navi_startLive2_animate.webp */ = {isa = PBXFileReference; lastKnownFileType = file; path = fus_home_navi_startLive2_animate.webp; sourceTree = "<group>"; };
549D669035746701FD4C7ADC /* FUSLiveGiftInteractOptionModel.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; path = FUSLiveGiftInteractOptionModel.m; sourceTree = "<group>"; };
7C2A1F0B3A1D4D2C9A0B1C2D /* FUSPayRoomCompanionDataModel.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = FUSPayRoomCompanionDataModel.h; sourceTree = "<group>"; };
7C2A1F0C3A1D4D2C9A0B1C2D /* FUSPayRoomCompanionDataModel.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = FUSPayRoomCompanionDataModel.m; sourceTree = "<group>"; };
......@@ -8747,6 +8749,7 @@
BEF675A72C6B156500A670FB /* Check */,
BEF675AC2C6B156500A670FB /* FirstTop */,
BEF675EB2C6B156500A670FB /* img_novaList_cell_new_animation.webp */,
3ED4D5C32F7BB15D00C17B8E /* fus_home_navi_startLive2_animate.webp */,
004773212F5C0C2000E46A79 /* fus_home_navi_startLive_animate.webp */,
00E6CE192F56E36500B63797 /* live_pk_control_contribute_bottom_inpk_animate.webp */,
00E6CE262F56F89F00B63797 /* img_liveroom_input_linkmic_apply_animation.webp */,
......@@ -9905,6 +9908,7 @@
00E2A62C2F2087C6003B779E /* live_pk_first_kill_zh_50@2x.png in Resources */,
00E2A62D2F2087C6003B779E /* live_pk_first_kill_zh_26@2x.png in Resources */,
00E2A62E2F2087C6003B779E /* live_pk_first_kill_en_28@2x.png in Resources */,
3ED4D5C42F7BB15D00C17B8E /* fus_home_navi_startLive2_animate.webp in Resources */,
00CD25582F593D9300A07432 /* pk_user_contribute_burst_dew_type_one_10@2x.png in Resources */,
00CD25592F593D9300A07432 /* pk_user_contribute_burst_dew_type_one_5@2x.png in Resources */,
00CD255A2F593D9300A07432 /* pk_user_contribute_burst_dew_type_one_22@2x.png in Resources */,
......@@ -10807,10 +10811,14 @@
inputFileListPaths = (
"${PODS_ROOT}/Target Support Files/Pods-FUSShowRoomModule/Pods-FUSShowRoomModule-resources-${CONFIGURATION}-input-files.xcfilelist",
);
inputPaths = (
);
name = "[CP] Copy Pods Resources";
outputFileListPaths = (
"${PODS_ROOT}/Target Support Files/Pods-FUSShowRoomModule/Pods-FUSShowRoomModule-resources-${CONFIGURATION}-output-files.xcfilelist",
);
outputPaths = (
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-FUSShowRoomModule/Pods-FUSShowRoomModule-resources.sh\"\n";
......@@ -64,8 +64,9 @@
}
if (i == 2) {
[tempBtn fus_setImage:[FUSShowRoomCenterBunble webpImageName:@"fus_home_navi_startLive_animate" scale:2] forState:UIControlStateNormal];
[tempBtn fus_setImage:[FUSShowRoomCenterBunble webpImageName:@"fus_home_navi_startLive_animate" scale:2] forState:UIControlStateSelected];
UIImage *startLiveImage = [FUSShowRoomCenterBunble webpImageName:@"fus_home_navi_startLive2_animate" scale:2];
[tempBtn fus_setImage:startLiveImage forState:UIControlStateNormal];
[tempBtn fus_setImage:startLiveImage forState:UIControlStateSelected];
}
tempBtn.tag = i;
......
......@@ -42,5 +42,7 @@
/// 加入时间戳
@property (nonatomic, assign) NSInteger addTimestamp;
/// 贡献分数(萤火)
@property (nonatomic, assign) NSInteger devoteScore; // 是否VIP/是否SVIP(服务端字段,0否,1VIP,2SVIP等)
@end
......@@ -845,6 +845,10 @@ static NSString *const KLiveDataCenter_store_liveRTCData = @"LiveDataCenter_stor
*/
- (void)fus_setupScrollToSwitchRoomEnable:(BOOL)enable
{
if (self.liveType == FUSLiveTypeAudience && self.roomScopeType == FUSLiveRoomScopeTypePay) {
[_liveVC fus_setupScrollEnable:NO];
return;
}
[_liveVC fus_setupScrollEnable:enable];
}
......@@ -1259,16 +1263,20 @@ static NSString *const KLiveDataCenter_store_liveRTCData = @"LiveDataCenter_stor
} failure:^(NSString *msg, NSInteger code) {
dispatch_async(dispatch_get_main_queue(), ^{
[FUSLoadingView fus_dismissProgressView];
/// 房間類型變化,請重新進入
if (code == -20124) {
[FUSDialogView fus_showDialog:([NSString isNull:msg] ? [NSString fus_localString:@"房间类型变化,请重新进入"] : msg)];
[weakEntryView fus_dismissAnimated:YES];
[FUSLiveHelper fus_quitLiveWithCompletion:nil];
return;
}
/// 當前為公開屋,可直接進入直播間
if (code == -20133) {
[weakEntryView fus_dismissAnimated:YES];
[weakSelf fus_audienceJoinRoomWithRoomId:(roomId ?: @"") password:(password ?: @"") behaviorSrc:(behaviorSrc ?: @"") otherInfo:otherInfo];
return;
}
/// :宝石不足
if (code == -100) {
[FUSDialogView fus_showDialog:([NSString isNull:msg] ? [NSString fus_localString:@"宝石不足"] : msg)];
[FUSRechargeViewController fus_showRechargeViewControllerForRootVC:[UIViewController fus_topViewController] from:FUSFromLiveRoom rechargePageFrom:FUSRechargePageFromGEMsLack backHandler:^{
......@@ -1373,7 +1381,7 @@ static NSString *const KLiveDataCenter_store_liveRTCData = @"LiveDataCenter_stor
return;
}
if (action == FUSPayRoomEntryMainViewActionTrial) {
[strongSelf fus_requestPayRoomPreviewWithUid:uid roomId:roomId channelId:channelId roundId:roundId entryView:weakEntryView];
[strongSelf fus_requestPayRoomPreviewWithUid:uid roomId:roomId channelId:channelId roundId:roundId previewSeconds:previewTime entryView:weakEntryView];
return;
}
if (action == FUSPayRoomEntryMainViewActionPrimary) {
......@@ -1420,6 +1428,9 @@ static NSString *const KLiveDataCenter_store_liveRTCData = @"LiveDataCenter_stor
dispatch_async(dispatch_get_main_queue(), ^{
[self fus_stopPayRoomPreviewCountdown];
[self fus_stopPayRoomRenewalCountdown];
self.payRoomCompanionPayloadModel = nil;
FUSPayRoomCompanionPopView *companionPopView = [self fus_currentPayRoomCompanionPopView];
[companionPopView removeFromSuperview];
UIView *rootView = self.liveVC.view ?: [UIViewController fus_topViewController].view;
for (UIView *subview in rootView.subviews.copy) {
......@@ -1459,6 +1470,7 @@ static NSString *const KLiveDataCenter_store_liveRTCData = @"LiveDataCenter_stor
roomId:(NSString *)roomId
channelId:(NSString *)channelId
roundId:(NSString *)roundId
previewSeconds:(NSInteger)previewSeconds
entryView:(FUSPayRoomEntryMainView *)entryView
{
self.payRoomPreviewChannelId = channelId;
......@@ -1481,7 +1493,16 @@ static NSString *const KLiveDataCenter_store_liveRTCData = @"LiveDataCenter_stor
__strong typeof(weakSelf) strongSelf = weakSelf;
NSDictionary *payload = ([dataDict[@"data"] isKindOfClass:NSDictionary.class] ? dataDict[@"data"] : dataDict);
NSDictionary *userData = ([payload[@"userData"] isKindOfClass:NSDictionary.class] ? payload[@"userData"] : nil);
NSDictionary *configData = ([payload[@"payRoomConfigData"] isKindOfClass:NSDictionary.class] ? payload[@"payRoomConfigData"] : nil);
NSString *pullUrl = [(userData ?: payload)[@"pullUrl"] description];
NSInteger serverPreviewSeconds = previewSeconds;
if (configData) {
serverPreviewSeconds = [configData[@"previewTime"] integerValue];
} else if ([payload[@"previewTime"] respondsToSelector:@selector(integerValue)]) {
serverPreviewSeconds = [payload[@"previewTime"] integerValue];
} else if ([userData[@"previewTime"] respondsToSelector:@selector(integerValue)]) {
serverPreviewSeconds = [userData[@"previewTime"] integerValue];
}
if ([NSString isNull:pullUrl]) {
dispatch_async(dispatch_get_main_queue(), ^{
[FUSDialogView fus_showDialog:[NSString fus_localString:@"拉流地址为空"]];
......@@ -1490,15 +1511,18 @@ static NSString *const KLiveDataCenter_store_liveRTCData = @"LiveDataCenter_stor
}
dispatch_async(dispatch_get_main_queue(), ^{
[weakEntryView fus_dismissAnimated:YES];
[strongSelf fus_playPayRoomPreviewWithPullUrl:pullUrl];
[strongSelf fus_playPayRoomPreviewWithPullUrl:pullUrl previewSeconds:serverPreviewSeconds];
});
} failure:^(NSString *msg, NSInteger code) {
dispatch_async(dispatch_get_main_queue(), ^{
/// 房間類型變化,請重新進入
if (code == -20124) {
[FUSDialogView fus_showDialog:([NSString isNull:msg] ? [NSString fus_localString:@"房间类型变化,请重新进入"] : msg)];
[weakEntryView fus_dismissAnimated:YES];
[FUSLiveHelper fus_quitLiveWithCompletion:nil];
return;
}
/// 當前為公開屋,可直接進入直播間
if (code == -20133) {
[weakEntryView fus_dismissAnimated:YES];
[weakSelf fus_audienceJoinRoomWithRoomId:(roomId ?: @"") password:@"" behaviorSrc:@"" otherInfo:nil];
......@@ -1532,16 +1556,20 @@ static NSString *const KLiveDataCenter_store_liveRTCData = @"LiveDataCenter_stor
});
} failure:^(NSString *msg, NSInteger code) {
dispatch_async(dispatch_get_main_queue(), ^{
/// 房間類型變化,請重新進入
if (code == -20124) {
[FUSDialogView fus_showDialog:([NSString isNull:msg] ? [NSString fus_localString:@"房间类型变化,请重新进入"] : msg)];
[weakEntryView fus_dismissAnimated:YES];
[FUSLiveHelper fus_quitLiveWithCompletion:nil];
return;
}
/// 當前為公開屋,可直接進入直播間
if (code == -20133) {
[weakEntryView fus_dismissAnimated:YES];
[weakSelf fus_audienceJoinRoomWithRoomId:(roomId ?: @"") password:@"" behaviorSrc:@"" otherInfo:nil];
return;
}
/// :宝石不足
if (code == -100) {
[FUSDialogView fus_showDialog:([NSString isNull:msg] ? [NSString fus_localString:@"宝石不足"] : msg)];
[FUSRechargeViewController fus_showRechargeViewControllerForRootVC:[UIViewController fus_topViewController] from:FUSFromLiveRoom rechargePageFrom:FUSRechargePageFromGEMsLack backHandler:^{
......@@ -1582,11 +1610,9 @@ static NSString *const KLiveDataCenter_store_liveRTCData = @"LiveDataCenter_stor
FUSPayRoomCompanionPopView *popView = [FUSPayRoomCompanionPopView fus_showWithRootView:rootView payRoomData:payRoomDataModel];
__weak typeof(self) weakSelf = self;
popView.rechargeHandler = ^{
/// 去充值:复用全局充值页入口
UIViewController *topVC = [UIViewController fus_topViewController];
if (topVC) {
[FUSRechargeViewController fus_showRechargeViewControllerForRootVC:topVC];
}
/// 去充值:走“储值宝石”的半屏充值面板(与礼物面板一致)
[FUSLiveGiftHalfChargeView fus_createWithDismissHandle:^(NSInteger type) {
}];
weakSelf.payRoomCompanionPayloadModel = nil;
};
......@@ -1597,9 +1623,10 @@ static NSString *const KLiveDataCenter_store_liveRTCData = @"LiveDataCenter_stor
将直播间切换为“试看播放态”:
- 使用 preview 接口返回的 pullUrl 播放
- 隐藏所有业务/互动 UI,仅保留视频播放画面
- 右上角展示 20 秒倒计时,并提供点击退出
- 右上角展示后端下发的试看时长倒计时,并提供点击退出
*/
- (void)fus_playPayRoomPreviewWithPullUrl:(NSString *)pullUrl
previewSeconds:(NSInteger)previewSeconds
{
FUSLiveMainViewController *liveVC = self.liveVC;
if (!liveVC) {
......@@ -1616,7 +1643,7 @@ static NSString *const KLiveDataCenter_store_liveRTCData = @"LiveDataCenter_stor
liveVC.liveFunctionView.hidden = YES;
[liveVC fus_playStreamWithUrl:(pullUrl ?: @"")];
[self fus_startPayRoomPreviewCountdownSeconds:20];
[self fus_startPayRoomPreviewCountdownSeconds:previewSeconds];
}
/**
......@@ -2296,7 +2323,7 @@ static NSString *const KLiveDataCenter_store_liveRTCData = @"LiveDataCenter_stor
self.liveVC.backgroundImageView.hidden = NO;
self.liveVC.liveFunctionView.hidden = NO;
[self.currentFunctionView fus_showAllFunctionLayers];
if ([FUSLiveHelper shareInstance].liveType == FUSLiveTypeAudience && roomInfoModel.liveScope == 5) {
if ([FUSLiveHelper shareInstance].liveType == FUSLiveTypeAudience && ([FUSLiveHelper shareInstance].roomScopeType == FUSLiveRoomScopeTypePay || roomInfoModel.liveScope == 5)) {
[self.liveVC fus_setupScrollEnable:NO];
} else {
[self.liveVC fus_setupScrollEnable:YES];
......
......@@ -32,6 +32,12 @@
/// 首充图标
@property (nonatomic, strong) UIImageView *firstLoveImageView;
/// 萤火图标
@property (nonatomic, strong) UIImageView *fireImageView;
/// 萤火分数
@property (nonatomic, strong) UILabel *fireLabel;
@end
@implementation FUSAudienceTableViewCell
......@@ -100,6 +106,17 @@
self.genderAndAgeBtn.layer.cornerRadius = 7;
self.genderAndAgeBtn.layer.masksToBounds = YES;
[self.contentView addSubview:self.genderAndAgeBtn];
self.fireLabel = [[UILabel alloc] init];
self.fireLabel.font = [UIFont fus_themeMediumFont:12];
self.fireLabel.textColor = [UIColor fus_fireGreen];
self.fireLabel.textAlignment = NSTextAlignmentRight;
[self.contentView addSubview:self.fireLabel];
self.fireImageView = [[UIImageView alloc] init];
self.fireImageView.contentMode = UIViewContentModeScaleAspectFit;
self.fireImageView.image = [UIImage fus_fireIcon];
[self.contentView addSubview:self.fireImageView];
}
- (void)fus_setupViews {
......@@ -113,7 +130,7 @@
[self.nicknameLabel mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.equalTo(self.faceImageView.mas_right).offset(12);
make.top.equalTo(self.faceImageView.mas_top);
make.width.mas_lessThanOrEqualTo(200);
make.right.lessThanOrEqualTo(self.fireImageView.mas_left).offset(-8);
}];
[self.onlineLabel mas_makeConstraints:^(MASConstraintMaker *make) {
......@@ -147,6 +164,17 @@
make.height.mas_equalTo(14);
make.width.mas_equalTo(30);
}];
[self.fireLabel mas_makeConstraints:^(MASConstraintMaker *make) {
make.centerY.equalTo(self.contentView);
make.right.equalTo(self.contentView).offset(-20);
}];
[self.fireImageView mas_makeConstraints:^(MASConstraintMaker *make) {
make.centerY.equalTo(self.fireLabel);
make.right.equalTo(self.fireLabel.mas_left).offset(-2);
make.width.height.mas_equalTo(11);
}];
}
- (void)setUserModel:(FUSOnlineUserModel *)userModel {
......@@ -161,7 +189,12 @@
self.firstLoveImageView.hidden = YES;
self.onlineLabel.hidden = YES;
self.genderAndAgeBtn.hidden = YES;
self.fireLabel.hidden = YES;
self.fireImageView.hidden = YES;
} else {
self.fireLabel.hidden = NO;
self.fireImageView.hidden = NO;
self.fireLabel.text = [NSString stringWithFormat:@"%ld", (long)userModel.devoteScore];
NSInteger level = 0;
if ([userModel.privilege[@"richPower"] integerValue] == 1) {
......
......@@ -93,9 +93,9 @@
[NSString fus_localString:@"闪光关闭"],
[NSString fus_localString:@"镜像"],
[NSString fus_localString:@"贴纸"],
[NSString fus_localString:@"礼物互动"],
[NSString fus_localString:@"快捷发言"],
[NSString fus_localString:@"直播主题"],
[NSString fus_localString:@"快捷发言"]]
[NSString fus_localString:@"礼物互动"]]
withImages:@[@"live_icon_cameraSetting",
@"live_setting_quality",
// @"live_setting_close_mic",
......@@ -104,9 +104,9 @@
@"live_icon_turnOffLine",
@"live_setting_video_mirror",
@"live_setting_live_sticker",
@"live_setting_live_giftInteract",
@"live_setting_live_quickChat",
@"live_setting_live_theme",
@"live_setting_live_quickChat"]
@"live_setting_live_giftInteract"]
withTypes:@[@(FUSFaceBeautySetting),
@(FUSLiveQuality),
@(FUSLiveCameraMic),
......@@ -114,9 +114,9 @@
@(FUSFaceBeautyTurnOnLight),
@(FUSLiveCameraMirror),
@(FUSLiveSetSticker),
@(FUSLiveGiftInteract),
@(FUSLiveEditQuickChat),
@(FUSLiveRoomTheme),
@(FUSLiveEditQuickChat)]
@(FUSLiveGiftInteract)]
clickItem:click];
}else if(type == FUSShowFlashLineAndCamera){
......
......@@ -614,17 +614,31 @@
- (void)ffupdateToolView2TypesPKState:(FUSPKState)pkState {
NSMutableArray *toolTypesList = [[NSMutableArray alloc] init];
FUSRoomInfoModel *roomInfoModel = FUSLiveHelper.shareInstance.roomInfoModel;
/// 限时表演进行中判定:重连恢复后 roomScopeType 可能不是 Open,这里要额外兜住展示入口
BOOL inShowTimeRound = (roomInfoModel.collectTicket == 1 || roomInfoModel.liveScope == 5);
/// 连麦房仅保留基础设置,不显示 PK / 限时表演入口
if (FUSLiveHelper.shareInstance.liveRoomType == FUSRoomTypeLinkMic) {
[toolTypesList appendObjects:@[@(FUSLiveBottomToolTypeLiveSetting),@(FUSLiveBottomToolTypeRoomSetting)/*,@(FFLiveBottomToolTypeRoomScope), @(FFLiveBottomToolTypeNovaBuild)*/]];
} else {
/// 私享屋:默认不展示限时表演;若当前回合已在限时表演中,则强制补回入口,避免“恢复直播后按钮丢失”
if (FUSLiveHelper.shareInstance.roomScopeType == FUSLiveRoomScopeTypePassword) {
[toolTypesList appendObjects:@[@(FUSLiveBottomToolTypeLiveSetting),@(FUSLiveBottomToolTypeRoomSetting), @(FUSLiveBottomToolTypePK)]];
if (inShowTimeRound) {
[toolTypesList appendObjects:@[@(FUSLiveBottomToolTypeLiveSetting),@(FUSLiveBottomToolTypeRoomSetting),@(FUSLiveBottomToolTypeShowTime), @(FUSLiveBottomToolTypePK)]];
} else {
[toolTypesList appendObjects:@[@(FUSLiveBottomToolTypeLiveSetting),@(FUSLiveBottomToolTypeRoomSetting), @(FUSLiveBottomToolTypePK)]];
}
}
else {
/// 公开屋始终显示限时表演入口;其他房型仅在“限时表演进行中”时显示入口
if (FUSLiveHelper.shareInstance.roomScopeType == FUSLiveRoomScopeTypeOpen) {
[toolTypesList appendObjects:@[@(FUSLiveBottomToolTypeLiveSetting),@(FUSLiveBottomToolTypeRoomSetting),@(FUSLiveBottomToolTypeShowTime), /*@(FUSLiveBottomToolTypeRoomScope),*/@(FUSLiveBottomToolTypePK)/*, @(FUSLiveBottomToolTypeNovaBuild)*/]];
} else {
[toolTypesList appendObjects:@[@(FUSLiveBottomToolTypeLiveSetting),@(FUSLiveBottomToolTypeRoomSetting), /*@(FUSLiveBottomToolTypeRoomScope),*/@(FUSLiveBottomToolTypePK)/*, @(FUSLiveBottomToolTypeNovaBuild)*/]];
if (inShowTimeRound) {
[toolTypesList appendObjects:@[@(FUSLiveBottomToolTypeLiveSetting),@(FUSLiveBottomToolTypeRoomSetting),@(FUSLiveBottomToolTypeShowTime),@(FUSLiveBottomToolTypePK)]];
} else {
[toolTypesList appendObjects:@[@(FUSLiveBottomToolTypeLiveSetting),@(FUSLiveBottomToolTypeRoomSetting), /*@(FUSLiveBottomToolTypeRoomScope),*/@(FUSLiveBottomToolTypePK)/*, @(FUSLiveBottomToolTypeNovaBuild)*/]];
}
}
}
// [toolTypesList appendObjects:@[@(FFLiveBottomToolTypeLiveSetting),@(FFLiveBottomToolTypeRoomSetting), @(FFLiveBottomToolTypeRoomScope),@(FFLiveBottomToolTypeBeautySticker), @(FFLiveBottomToolTypeNovaBuild)]];
......
......@@ -27,7 +27,11 @@
+ (instancetype)fus_showOnView:(UIView *)onView defaultText:(nullable NSString *)defaultText {
FUSLiveRoomThemePopView *view = [[FUSLiveRoomThemePopView alloc] initWithFrame:onView.bounds];
view.themeTextField.text = defaultText ?: @"";
NSString *historyThemeText = [NSString stringWithObject:defaultText];
NSString *placeholderText = ([NSString isNull:historyThemeText] ? [NSString fus_localString:@"请输入直播主题"] : historyThemeText);
view.themeTextField.attributedPlaceholder = [[NSAttributedString alloc] initWithString:placeholderText
attributes:@{NSForegroundColorAttributeName:[UIColor colorWithHex:@"#9AA0A6"]}];
view.themeTextField.text = @"";
[onView addSubview:view];
[view fus_show];
return view;
......@@ -157,8 +161,13 @@
NSString *content = (self.themeTextField.text ?: @"");
content = [content stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceAndNewlineCharacterSet]];
if (content.length <= 0) {
[FUSDialogView fus_showDialog:[NSString fus_localString:@"请输入直播主题"]];
return;
NSString *placeholderText = [NSString stringWithObject:self.themeTextField.attributedPlaceholder.string];
placeholderText = [placeholderText stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceAndNewlineCharacterSet]];
if (placeholderText.length <= 0 || [placeholderText isEqualToString:[NSString fus_localString:@"请输入直播主题"]]) {
[FUSDialogView fus_showDialog:[NSString fus_localString:@"请输入直播主题"]];
return;
}
content = placeholderText;
}
if (self.confirmHandler) {
self.confirmHandler(content);
......
......@@ -269,7 +269,10 @@ static const NSInteger kFUSShowTimeTicketMax = 50;
/// 点击主按钮:后续接入真实“开始集票/开启表演”逻辑
- (void)fus_onClickStart {
if (self.startCollectHandler) {
NSString *themeText = (self.themeTextField.text.length > 0 ? self.themeTextField.text : @"");
NSString *themeText = [self.themeTextField.text stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceAndNewlineCharacterSet]];
if (themeText.length <= 0) {
themeText = [[NSString stringWithObject:self.themeTextField.attributedPlaceholder.string] stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceAndNewlineCharacterSet]];
}
self.startCollectHandler(themeText, self.ticketCount);
}
[self fus_dismiss];
......@@ -417,12 +420,11 @@ static const NSInteger kFUSShowTimeTicketMax = 50;
}
- (void)fus_updateThemeTextIfNeeded:(nullable NSString *)themeText {
if (self.themeTextField.text.length > 0) {
return;
}
if (![NSString isNull:themeText]) {
self.themeTextField.text = themeText;
}
NSString *historyThemeText = [NSString stringWithObject:themeText];
NSString *placeholderText = ([NSString isNull:historyThemeText] ? [NSString fus_localString:@"每日16:00,来找我一起玩吧。"] : historyThemeText);
self.themeTextField.attributedPlaceholder = [[NSAttributedString alloc] initWithString:placeholderText
attributes:@{NSForegroundColorAttributeName:[UIColor colorWithHex:@"#9AA0A6"]}];
self.themeTextField.text = @"";
}
@end
......@@ -11,6 +11,8 @@
/// 承载贡献列表的 tableView(复用 cell,避免频繁创建视图)
@property (nonatomic, strong) UITableView *tableView;
/// 无贡献时的空视图
@property (nonatomic, strong) FUSEmptyView *emptyView;
@end
......@@ -33,9 +35,18 @@
self.tableView.separatorStyle = UITableViewCellSeparatorStyleNone;
self.tableView.backgroundColor = UIColor.whiteColor;
self.tableView.rowHeight = 64;
/// 默认展示空态占位:覆盖未主动调用 fus_updateContributionList: 的页面场景
self.tableView.tableFooterView = self.emptyView;
[self.tableView registerClass:FUSLiveShowTimeTicketContributionCell.class forCellReuseIdentifier:NSStringFromClass(FUSLiveShowTimeTicketContributionCell.class)];
[self addSubview:self.tableView];
self.emptyView = [[FUSEmptyView alloc] initWithFrame:CGRectMake(0, 0, UIView.fus_screenW, 320)];
self.emptyView.contentAligment = FUSEmptyViewAligmentCenter;
[self.emptyView fus_setEmptyViewIcon:UIImage.fus_emptyImg title:[NSString fus_localString:@"空空如也"] buttonTittle:nil];
self.emptyView.imageScale = 0.3;
self.emptyView.contentVerticalOffset = -10;
self.emptyView.backgroundColor = UIColor.clearColor;
[self.tableView mas_makeConstraints:^(MASConstraintMaker *make) {
make.edges.equalTo(self);
}];
......@@ -46,6 +57,12 @@
- (void)setContributionList:(NSArray<FUSShowRoomUserContributeModel *> *)contributionList {
/// copy 保证外部可变数组传入时不会被后续修改影响 UI 展示
_contributionList = [contributionList copy] ?: @[];
/// 统一空态处理:无数据展示“展位图”,有数据恢复普通 footer
if (_contributionList.count > 0) {
self.tableView.tableFooterView = [[UIView alloc] init];
} else {
self.tableView.tableFooterView = self.emptyView;
}
[self.tableView reloadData];
}
......
......@@ -398,7 +398,13 @@ NSString * const FUSLiveShowTimeAudienceEntryTicketOptionImageNameTextKey = @"im
FUSLiveShowTimeAudienceEntryTicketOptionTagTextKey: [NSString fus_localString:@"抢当MVP"],
FUSLiveShowTimeAudienceEntryTicketOptionImageNameTextKey: @"live_room_tickets",
};
[self fus_updateTicketOptions:@[opt1, opt2, opt3] selectedIndex:0];
NSInteger selectedIndex = 0;
NSInteger userDiamond = [[[FUSCacheDataShare shareStore].userDetailInfo.diamond description] integerValue];
NSInteger strengthPrice = MAX(0, strengthNum * unitPrice);
if (userDiamond >= strengthPrice && strengthPrice > 0) {
selectedIndex = 1;
}
[self fus_updateTicketOptions:@[opt1, opt2, opt3] selectedIndex:selectedIndex];
}
- (void)fus_dismissAnimated:(BOOL)animated {
......
......@@ -763,6 +763,7 @@ BDAlphaPlayerMetalViewDelegate
[_bottomToolView setKeyboardWillShowHandler:^(CGFloat height){
weakSelf.isEditing = YES;
weakSelf.isKeyboard = YES;
[weakSelf fus_setLiveTopicWindowHidden:YES];
weakSelf.contentView.y = -height;
for (FUSLiveFunctionLayerView *view in weakSelf.viewLayerArray) {
if (view.layerType != FUSLiveFunctionLayerEffects
......@@ -792,6 +793,7 @@ BDAlphaPlayerMetalViewDelegate
[_bottomToolView setKeyboardWillHideHandler:^(){
weakSelf.isEditing = NO;
weakSelf.isKeyboard = NO;
[weakSelf fus_refreshLiveTopicWindow];
weakSelf.contentView.y = 0;
for (UIView *view in weakSelf.viewLayerArray) {
view.y = 0;
......@@ -922,6 +924,11 @@ BDAlphaPlayerMetalViewDelegate
}
CGFloat bulletsHeight = (self.bottomToolView.chatTextView.isBulletsHeight && self.isKeyboard) ? BULLETS_LIST_HEIGHT : 0;
CGFloat liveTopicAvoidHeight = 0;
if (self.liveTopicWindowView && self.liveTopicWindowView.hidden == NO) {
CGSize topicSize = [self.liveTopicWindowView fus_sizeThatFitsMaxWidth:self.width - 16];
liveTopicAvoidHeight = topicSize.height + 6;
}
__block CGFloat lastViewY = self.bottomToolView.y - bulletsHeight - fastChatInputViewHeight;
[UIView animateWithDuration:0.3 animations:^{
......@@ -935,9 +942,9 @@ BDAlphaPlayerMetalViewDelegate
self.linkMicroView.hidden = NO;
}
if (self.isKeyboard) {
self.chatTableView.superview.y = self.height - self.fus_chatTextViewHeight - self.chatTableView.superview.height - 6 - safeAreaBottom - fastChatInputViewHeight;
self.chatTableView.superview.y = self.height - self.fus_chatTextViewHeight - self.chatTableView.superview.height - 6 - safeAreaBottom - fastChatInputViewHeight - liveTopicAvoidHeight;
} else {
self.chatTableView.superview.y = self.bottomToolView.y - self.chatTableView.height - fastChatInputViewHeight;
self.chatTableView.superview.y = self.bottomToolView.y - self.chatTableView.height - fastChatInputViewHeight - liveTopicAvoidHeight;
}
// self.treasureBoxListIcon.y = releasePunishmentViewY - 75 - 10;
// self.sendGiftCountdownBtn.y = self.bottomToolView.y - 55 - 10 - bulletsHeight - fastChatInputViewHeight;
......@@ -2772,6 +2779,7 @@ BDAlphaPlayerMetalViewDelegate
}
self.liveTopicWindowView.hidden = NO;
[self.liveTopicWindowView fus_updateTopicText:roomInfoModel.introduce restartTimer:YES];
[self.liveTopicWindowView fus_setExpanded:YES restartTimer:YES];
[self fus_reloadUIWithKeyboardSetPart];
}
......@@ -2780,7 +2788,8 @@ BDAlphaPlayerMetalViewDelegate
self.liveTopicWindowView.hidden = hidden;
if (!hidden) {
FUSRoomInfoModel *roomInfoModel = FUSLiveHelper.shareInstance.roomInfoModel;
[self.liveTopicWindowView fus_updateTopicText:roomInfoModel.introduce restartTimer:NO];
[self.liveTopicWindowView fus_updateTopicText:roomInfoModel.introduce restartTimer:YES];
[self.liveTopicWindowView fus_setExpanded:YES restartTimer:YES];
}
[self fus_reloadUIWithKeyboardSetPart];
}
......@@ -2935,6 +2944,7 @@ BDAlphaPlayerMetalViewDelegate
// 监听礼物互动任务变化通知
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(fus_receiveGiftInteractTaskChangedNotification:) name:STR(ROOM_CID_GIFT_INTERACT_TASK_CHANGED) object:nil];
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(fus_receiveGiftInteractSwitchStateDidChangedSocketNotification:) name:STR(ROOM_CID_giftInteractionStateDidChanged) object:nil];
// 礼物互动任务列表刷新:收到后用 socket dataList 直刷观众端面板,避免等待接口回包
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(fus_receiveGiftInteractAudienceTaskListRefreshSocketNotification:) name:STR(ROOM_CID_GIFT_INTERACT_TASK_LIST_REFRESH) object:nil];
// 接收pk惩罚结束的通知
......@@ -3932,9 +3942,10 @@ BDAlphaPlayerMetalViewDelegate
CGFloat height = 0;
CGFloat headerH = 30;
CGFloat padding = 8;
CGFloat rowHeight = 24;
CGFloat rowHeight = 30;
CGFloat rowGap = 6;
if (count > 0) {
height = headerH + padding * 2 + rowHeight * count;
height = headerH + padding * 2 + rowHeight * count + rowGap * MAX(0, count - 1);
} else {
height = headerH + 40;
}
......
......@@ -21,6 +21,8 @@
@property (nonatomic, strong) NSMutableArray<CBAutoScrollLabel *> *taskLabels;
/// 右侧“消失”按钮列表(按 taskTexts 数量动态增减)
@property (nonatomic, strong) NSMutableArray<UIButton *> *doneButtons;
/// 分隔线列表(按 items 数量动态增减)
@property (nonatomic, strong) NSMutableArray<UIView *> *separatorViews;
@end
@implementation FUSLiveGiftInteractTaskPanelView
......@@ -63,6 +65,7 @@ static NSString *fus_substringComposedToLength(NSString *text, NSUInteger maxLen
self.nicknameLabels = [NSMutableArray array];
self.taskLabels = [NSMutableArray array];
self.doneButtons = [NSMutableArray array];
self.separatorViews = [NSMutableArray array];
self.emptyLabel = [[UILabel alloc] initWithFrame:CGRectZero];
self.emptyLabel.text = [NSString fus_localString:@"暂无"];
......@@ -99,6 +102,12 @@ static NSString *fus_substringComposedToLength(NSString *text, NSUInteger maxLen
[btn removeFromSuperview];
[self.doneButtons removeLastObject];
}
NSInteger separatorTargetCount = (targetCount > 0 ? (targetCount - 1) : 0);
while (self.separatorViews.count > separatorTargetCount) {
UIView *line = self.separatorViews.lastObject;
[line removeFromSuperview];
[self.separatorViews removeLastObject];
}
while (self.avatarViews.count < targetCount) {
UIImageView *view = [[UIImageView alloc] initWithFrame:CGRectZero];
view.contentMode = UIViewContentModeScaleAspectFill;
......@@ -120,7 +129,7 @@ static NSString *fus_substringComposedToLength(NSString *text, NSUInteger maxLen
CBAutoScrollLabel *label = [[CBAutoScrollLabel alloc] initWithFrame:CGRectZero];
label.font = [UIFont fus_themeFont:10];
label.textColor = UIColor.whiteColor;
label.textAlignment = NSTextAlignmentRight;
label.textAlignment = NSTextAlignmentLeft;
[label observeApplicationNotifications];
[self addSubview:label];
[self.taskLabels addObject:label];
......@@ -133,6 +142,12 @@ static NSString *fus_substringComposedToLength(NSString *text, NSUInteger maxLen
[self addSubview:btn];
[self.doneButtons addObject:btn];
}
while (self.separatorViews.count < separatorTargetCount) {
UIView *line = [[UIView alloc] initWithFrame:CGRectZero];
line.backgroundColor = [UIColor colorWithWhite:1 alpha:0.15];
[self addSubview:line];
[self.separatorViews addObject:line];
}
for (NSInteger i = 0; i < targetCount; i++) {
FUSLiveGiftInteractSettingItemModel *model = self.items[i];
......@@ -193,30 +208,44 @@ static NSString *fus_substringComposedToLength(NSString *text, NSUInteger maxLen
CGFloat avatarRight = avatarX + avatarSize + 4;
CGFloat nicknameW = 30;
CGFloat nicknameX = avatarRight;
CGFloat taskX = nicknameX + nicknameW + 6;
CGFloat textX = nicknameX;
CGFloat buttonX = CGRectGetWidth(self.bounds) - padding - buttonSize;
CGFloat taskW = buttonX - taskX - 6;
if (taskW < 0) {
taskW = 0;
CGFloat textW = buttonX - textX - 6;
CGFloat lineGap = 1;
CGFloat rowGap = 6;
if (textW < 0) {
textW = 0;
}
CGFloat availableH = CGRectGetHeight(self.bounds) - contentTop - padding * 2;
CGFloat rowHeight = (availableH > 0 ? (availableH / self.items.count) : 0);
CGFloat totalGap = rowGap * MAX(0, self.items.count - 1);
CGFloat rowHeight = (availableH > totalGap ? ((availableH - totalGap) / self.items.count) : 0);
for (NSInteger i = 0; i < self.items.count; i++) {
CGFloat y = contentTop + padding + i * rowHeight;
CGFloat y = contentTop + padding + i * (rowHeight + rowGap);
UIImageView *avatarView = self.avatarViews[i];
avatarView.frame = CGRectMake(avatarX, y + (rowHeight - avatarSize) * 0.5, avatarSize, avatarSize);
avatarView.layer.cornerRadius = avatarSize * 0.5;
CGFloat nicknameH = MIN(11, rowHeight * 0.45);
CGFloat taskH = MAX(0, rowHeight - nicknameH - lineGap);
UILabel *nicknameLabel = self.nicknameLabels[i];
nicknameLabel.frame = CGRectMake(nicknameX, y, nicknameW, rowHeight);
nicknameLabel.frame = CGRectMake(textX, y, textW, nicknameH);
CBAutoScrollLabel *taskLabel = self.taskLabels[i];
taskLabel.frame = CGRectMake(taskX, y, taskW, rowHeight);
taskLabel.frame = CGRectMake(textX, CGRectGetMaxY(nicknameLabel.frame) + lineGap, textW, taskH);
UIButton *btn = self.doneButtons[i];
btn.frame = CGRectMake(buttonX, y + (rowHeight - buttonSize) * 0.5, buttonSize, buttonSize);
}
CGFloat lineX = padding;
CGFloat lineW = CGRectGetWidth(self.bounds) - padding * 2;
CGFloat lineH = 0.5;
for (NSInteger i = 0; i < self.separatorViews.count; i++) {
CGFloat sepY = contentTop + padding + (i + 1) * rowHeight + i * rowGap + (rowGap - lineH) * 0.5;
UIView *line = self.separatorViews[i];
line.frame = CGRectMake(lineX, sepY, lineW, lineH);
}
}
/// 点击“消失”
......
......@@ -136,7 +136,7 @@ static const CGFloat kFUSLiveTopicWindowInnerSpacing = 8.0;
self.backgroundColor = UIColor.clearColor;
self.bgView = [[UIView alloc] initWithFrame:CGRectZero];
self.bgView.backgroundColor = [[UIColor whiteColor] colorWithAlphaComponent:0.6];
self.bgView.backgroundColor = UIColor.whiteColor;
self.bgView.layer.masksToBounds = YES;
[self addSubview:self.bgView];
......@@ -146,7 +146,7 @@ static const CGFloat kFUSLiveTopicWindowInnerSpacing = 8.0;
[self.bgView addSubview:self.topicIconView];
self.topicLabel = [[UILabel alloc] initWithFrame:CGRectZero];
self.topicLabel.textColor = [[UIColor blackColor] colorWithAlphaComponent:0.9];
self.topicLabel.textColor = UIColor.blackColor;
self.topicLabel.font = [UIFont systemFontOfSize:14 weight:UIFontWeightMedium];
self.topicLabel.numberOfLines = 1;
self.topicLabel.lineBreakMode = NSLineBreakByTruncatingTail;
......
......@@ -17,6 +17,8 @@
/// “已陪伴:xx 分钟”文案
@property (nonatomic, strong) UILabel *companionLabel;
/// “已陪伴”区域点击层(点击后收起面板)
@property (nonatomic, strong) UIButton *companionTapBtn;
/// “下次计费”标题文案
@property (nonatomic, strong) UILabel *nextBillingLabel;
/// “您可继续陪伴 xx 分钟”文案
......@@ -124,6 +126,11 @@
self.companionLabel.textColor = [UIColor colorWithWhite:1 alpha:0.95];
[self.contentView addSubview:self.companionLabel];
self.companionTapBtn = [UIButton buttonWithType:UIButtonTypeCustom];
self.companionTapBtn.frame = CGRectMake(0, 0, self.contentView.width, CGRectGetMaxY(self.companionLabel.frame) + 8);
[self.companionTapBtn addTarget:self action:@selector(fus_clickCompanionArea) forControlEvents:UIControlEventTouchUpInside];
[self.contentView addSubview:self.companionTapBtn];
y = self.companionLabel.bottom + 6;
self.dashLine1Layer = [CAShapeLayer layer];
self.dashLine1Layer.strokeColor = [UIColor colorWithWhite:1 alpha:0.35].CGColor;
......@@ -362,4 +369,11 @@
}
}
- (void)fus_clickCompanionArea {
// 仅在展开态时响应“收起”,避免影响收起态点击展开逻辑
if (self.arrowBtn.isSelected == NO) {
[self fus_clickArrowBtnAction:self.arrowBtn];
}
}
@end
......@@ -59,7 +59,7 @@
[self.bgBtn addTarget:self action:@selector(fus_dismissView) forControlEvents:UIControlEventTouchUpInside];
[self addSubview:self.bgBtn];
self.contentView = [[UIView alloc] initWithFrame:CGRectMake(0, UIView.fus_screenH, UIView.fus_screenW, 632)];
self.contentView = [[UIView alloc] initWithFrame:CGRectMake(0, UIView.fus_screenH, UIView.fus_screenW, 582)];
self.contentView.backgroundColor = UIColor.whiteColor;
[self.contentView addRoundedCorners:UIRectCornerTopLeft|UIRectCornerTopRight withRadii:CGSizeMake(16, 16)];
[self addSubview:self.contentView];
......
......@@ -46,7 +46,14 @@ class FUSLiveStartContentThemeEditView: UIView {
if let uid = FUSCacheDataShare.shareStore().userDetailInfo.uid, let userDefault = UserDefaults.init(suiteName: uid) {
//标题
let preTitle = userDefault.string(forKey: FUSLiveUDKeys.fus_lastLiveTitleUDKey())
LiveTitleTextFiled.text = preTitle
if let historyTitle = preTitle, !historyTitle.trimmingCharacters(in: .whitespacesAndNewlines).isEmpty {
let attributes: [NSAttributedString.Key: Any] = [
.font: UIFont.fus_themeFont(18),
.foregroundColor: UIColor.init(hex:"#EAEAEA", alpha: 0.6)
]
LiveTitleTextFiled.text = ""
LiveTitleTextFiled.attributedPlaceholder = NSAttributedString(string: historyTitle, attributes: attributes)
}
//主题
let selectId = userDefault.integer(forKey: FUS_SelectedLiveThemeIdUDKey)
......
......@@ -241,8 +241,11 @@ import FUSCommon
case 2:
if let payData = FUSLiveHelper.shareInstance().liveBeforeReadyInfo?.payData { // 判断是否允许付费屋
if (payData.enable ?? "0").intValue != 1 {
FUSAlertView.showAlert(withTitle: payData.warnTitle ?? "",
message: payData.warnSubTitle ?? "",
let warnTitle = payData.warnTitle ?? ""
let warnSubTitle = payData.warnSubTitle ?? ""
let message = [warnTitle, warnSubTitle].filter { $0.isEmpty == false }.joined(separator: "\n")
FUSAlertView.showAlert(withTitle: "",
message: message,
cancelButtonTitle: nil,
otherButtonTitles: [String.fus_localString("知道了")])
break
......
......@@ -437,10 +437,12 @@ import FUSCommon
// 开播主题名称与开播主题id
if let model = themeView.selectModel, model.themeId > 0{
let historyThemeTitle = userDefault.string(forKey: FUS_LastLiveThemeTopicUDKey) ?? ""
let finalThemeTitle = themeView.themeTitle.trimmingCharacters(in: .whitespacesAndNewlines).isEmpty ? historyThemeTitle : themeView.themeTitle
userDefault.set(model.themeId, forKey: FUS_SelectedLiveThemeIdUDKey)
userDefault.set(themeView.themeTitle, forKey: FUS_LastLiveThemeTopicUDKey)
userDefault.set(finalThemeTitle, forKey: FUS_LastLiveThemeTopicUDKey)
startLiveModel.themeId = model.themeId
startLiveModel.themeTitle = themeView.themeTitle
startLiveModel.themeTitle = finalThemeTitle
}else {
userDefault.set(0, forKey: FUS_SelectedLiveThemeIdUDKey)
userDefault.set("", forKey: FUS_LastLiveThemeTopicUDKey)
......
......@@ -203,8 +203,9 @@
NSUserDefaults *userDefault = [[NSUserDefaults alloc] initWithSuiteName:FUSCacheDataShare.shareStore.userDetailInfo.uid];
NSString *preTitle = [userDefault objectForKey:FUS_LastLiveThemeTopicUDKey];
if (![NSString isNullWithString:preTitle]) {
self.themeTitleTextField.text = preTitle;
self.themeTitleCountLabel.text = [NSString stringWithFormat:@"%zd/%d",self.themeTitleTextField.text.length,kFUSVSSTVMaxThemeTitleCount];
self.themeTitleTextField.text = @"";
self.themeTitleTextField.attributedPlaceholder = [[NSAttributedString alloc] initWithString:preTitle attributes:@{NSForegroundColorAttributeName:[UIColor colorWithHex:@"#9AA0A6"]}];
self.themeTitleCountLabel.text = [NSString stringWithFormat:@"%d/%d",0,kFUSVSSTVMaxThemeTitleCount];
self.themeTitle = preTitle;
}
......@@ -317,6 +318,12 @@
- (IBAction)clickOkBtnAction:(FUSStyleButton *)sender {
NSString *themeTitle = [self.themeTitleTextField.text stringByTrim];
if (themeTitle.length == 0) {
themeTitle = [[NSString stringWithObject:self.themeTitleTextField.attributedPlaceholder.string] stringByTrim];
if ([themeTitle isEqualToString:[NSString fus_localString:@"输入主题内容"]]) {
themeTitle = @"";
}
}
if (self.selectedModel.themeId > 0 && themeTitle.length == 0) {
[FUSDialogView fus_showDialog:[NSString fus_localString:@"请输入直播主题内容"]];
return;
......@@ -410,8 +417,10 @@
}
- (void)setThemeTitle:(NSString *)themeTitle{
_themeTitle = themeTitle;
_themeTitleTextField.text = themeTitle;
_themeTitleCountLabel.text = [NSString stringWithFormat:@"%zd/%d",_themeTitleTextField.text.length,kFUSVSSTVMaxThemeTitleCount];
NSString *placeholder = ([NSString isNullWithString:themeTitle] ? [NSString fus_localString:@"输入主题内容"] : themeTitle);
_themeTitleTextField.attributedPlaceholder = [[NSAttributedString alloc] initWithString:placeholder attributes:@{NSForegroundColorAttributeName:[UIColor colorWithHex:@"#9AA0A6"]}];
_themeTitleTextField.text = @"";
_themeTitleCountLabel.text = [NSString stringWithFormat:@"%d/%d",0,kFUSVSSTVMaxThemeTitleCount];
}
#pragma mark - Getters
......
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