Commit f766ee8e by suolong

提交修改部分bug

parent 4308636e
Showing with 276 additions and 16 deletions
...@@ -691,7 +691,7 @@ ...@@ -691,7 +691,7 @@
CLANG_CXX_LANGUAGE_STANDARD = "gnu++17"; CLANG_CXX_LANGUAGE_STANDARD = "gnu++17";
CODE_SIGN_ENTITLEMENTS = FuSiLive/FuSiLive.entitlements; CODE_SIGN_ENTITLEMENTS = FuSiLive/FuSiLive.entitlements;
CODE_SIGN_STYLE = Automatic; CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 202506260048; CURRENT_PROJECT_VERSION = 202506260050;
DEFINES_MODULE = YES; DEFINES_MODULE = YES;
DEVELOPMENT_TEAM = 6GG26BHUMC; DEVELOPMENT_TEAM = 6GG26BHUMC;
ENABLE_ON_DEMAND_RESOURCES = NO; ENABLE_ON_DEMAND_RESOURCES = NO;
...@@ -956,7 +956,7 @@ ...@@ -956,7 +956,7 @@
CLANG_CXX_LANGUAGE_STANDARD = "gnu++17"; CLANG_CXX_LANGUAGE_STANDARD = "gnu++17";
CODE_SIGN_ENTITLEMENTS = FuSiLive/FuSiLive.entitlements; CODE_SIGN_ENTITLEMENTS = FuSiLive/FuSiLive.entitlements;
CODE_SIGN_STYLE = Automatic; CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 202506260048; CURRENT_PROJECT_VERSION = 202506260050;
DEFINES_MODULE = YES; DEFINES_MODULE = YES;
DEVELOPMENT_TEAM = 6GG26BHUMC; DEVELOPMENT_TEAM = 6GG26BHUMC;
ENABLE_ON_DEMAND_RESOURCES = NO; ENABLE_ON_DEMAND_RESOURCES = NO;
......
{
"images" : [
{
"filename" : "Live_botton_payIn.png",
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "Live_botton_payIn@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "Live_botton_payIn@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
{
"images" : [
{
"filename" : "Live_room_showTime.png",
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "Live_room_showTime@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "Live_room_showTime@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
...@@ -391,7 +391,7 @@ ...@@ -391,7 +391,7 @@
return; return;
} }
if (!self.selectedGift || self.giftLabel.text.length == 0) { if (!self.selectedGift || self.giftLabel.text.length == 0) {
[FUSDialogView fus_showDialog:[NSString fus_localString:@"请选择礼物"]]; [FUSDialogView fus_showDialog:[NSString fus_localString:@"请绑定互动礼物"]];
return; return;
} }
if (self.count <= 0) { if (self.count <= 0) {
...@@ -458,4 +458,29 @@ ...@@ -458,4 +458,29 @@
[self fus_hideGiftDropdown]; [self fus_hideGiftDropdown];
} }
- (BOOL)textField:(UITextField *)textField shouldChangeCharactersInRange:(NSRange)range replacementString:(NSString *)string {
if (textField != self.descField) {
return YES;
}
if (string.length == 0) {
return YES;
}
NSString *originText = textField.text ?: @"";
if (range.location > originText.length) {
return YES;
}
NSString *nextText = [originText stringByReplacingCharactersInRange:range withString:(string ?: @"")];
NSRegularExpression *regex = [NSRegularExpression regularExpressionWithPattern:@"^[A-Za-z\\u4e00-\\u9fa5\\s]*$" options:0 error:nil];
NSUInteger matchCount = [regex numberOfMatchesInString:nextText options:0 range:NSMakeRange(0, nextText.length)];
if (matchCount == 0) {
[FUSDialogView fus_showDialog:[NSString fus_localString:@"仅限中文、英文、空格"]];
return NO;
}
if (nextText.length <= 6) {
return YES;
}
[FUSDialogView fus_showDialog:[NSString fus_localString:@"互动描述过长,请重新输入"]];
return NO;
}
@end @end
...@@ -86,6 +86,11 @@ static NSInteger const FUSLiveGiftInteractMaxItemCount = 20; ...@@ -86,6 +86,11 @@ static NSInteger const FUSLiveGiftInteractMaxItemCount = 20;
- (void)fus_onGiftInteractSwitchChanged:(BOOL)isOn cell:(FUSLiveGiftInteractSettingEnableCell *)cell { - (void)fus_onGiftInteractSwitchChanged:(BOOL)isOn cell:(FUSLiveGiftInteractSettingEnableCell *)cell {
BOOL previous = self.isEnabled; BOOL previous = self.isEnabled;
if (isOn && [self fus_activeGiftInteractItemCount] == 0) {
[cell fus_setupWithEnabled:previous];
[FUSDialogView fus_showDialog:[NSString fus_localString:@"请至少添加或激活一种互动选项"]];
return;
}
self.isEnabled = isOn; self.isEnabled = isOn;
[cell fus_setSwitchUserInteractionEnabled:NO]; [cell fus_setSwitchUserInteractionEnabled:NO];
...@@ -108,6 +113,16 @@ static NSInteger const FUSLiveGiftInteractMaxItemCount = 20; ...@@ -108,6 +113,16 @@ static NSInteger const FUSLiveGiftInteractMaxItemCount = 20;
}]; }];
} }
- (NSInteger)fus_activeGiftInteractItemCount {
NSInteger count = 0;
for (FUSLiveGiftInteractSettingItemModel *item in self.items) {
if (item.status == 1) {
count += 1;
}
}
return count;
}
- (void)onClickAdd { - (void)onClickAdd {
if (self.items.count >= FUSLiveGiftInteractMaxItemCount) { if (self.items.count >= FUSLiveGiftInteractMaxItemCount) {
[FUSDialogView fus_showDialog:[NSString fus_localString:@"互动内容数量已达上限"]]; [FUSDialogView fus_showDialog:[NSString fus_localString:@"互动内容数量已达上限"]];
...@@ -197,6 +212,11 @@ static NSInteger const FUSLiveGiftInteractMaxItemCount = 20; ...@@ -197,6 +212,11 @@ static NSInteger const FUSLiveGiftInteractMaxItemCount = 20;
return; return;
} }
FUSLiveGiftInteractSettingItemModel *item = self.items[index]; FUSLiveGiftInteractSettingItemModel *item = self.items[index];
if (!isOn && self.isEnabled && item.status == 1 && [self fus_activeGiftInteractItemCount] <= 1) {
[FUSDialogView fus_showDialog:[NSString fus_localString:@"请至少添加或激活一种互动选项"]];
[self.tableView reloadRowsAtIndexPaths:@[[NSIndexPath indexPathForRow:index inSection:1]] withRowAnimation:UITableViewRowAnimationNone];
return;
}
NSString *uid = FUSCacheDataShare.shareStore.userDetailInfo.uid ?: @""; NSString *uid = FUSCacheDataShare.shareStore.userDetailInfo.uid ?: @"";
NSString *roomId = [FUSLiveHelper shareInstance].roomInfoModel.roomId ?: @""; NSString *roomId = [FUSLiveHelper shareInstance].roomInfoModel.roomId ?: @"";
NSString *channelId = [FUSLiveHelper shareInstance].roomInfoModel.channelId ?: @""; NSString *channelId = [FUSLiveHelper shareInstance].roomInfoModel.channelId ?: @"";
......
...@@ -1603,14 +1603,26 @@ typedef NS_ENUM(NSInteger, FUSStreamState) { ...@@ -1603,14 +1603,26 @@ typedef NS_ENUM(NSInteger, FUSStreamState) {
- (void)forceKick:(NSNotification *)noti { - (void)forceKick:(NSNotification *)noti {
FUSSocketMessageModel *messageModel = noti.object; FUSSocketMessageModel *messageModel = noti.object;
NSDictionary *dict = [messageModel fus_getJsonDict]; NSDictionary *dict = [messageModel fus_getJsonDict];
NSInteger exitType = [dict[@"exitType"] integerValue];
if ([dict[@"exitType"] integerValue] == 1) { if (exitType == 1) {
NSString *roomId = [FUSLiveHelper shareInstance].roomInfoModel.roomId; NSString *roomId = [FUSLiveHelper shareInstance].roomInfoModel.roomId;
[[FUSLiveHelper shareInstance] fus_endPayRoomPreviewWithRoomId:roomId]; [[FUSLiveHelper shareInstance] fus_endPayRoomPreviewWithRoomId:roomId];
[FUSDialogView fus_showDialog:[FUSFormatContentHelper fus_getContentFromArr:dict[@"multiContents"]]]; [FUSDialogView fus_showDialog:[FUSFormatContentHelper fus_getContentFromArr:dict[@"multiContents"]]];
return; return;
} }
if (exitType == 2) {
if ([FUSLiveHelper shareInstance].liveType == FUSLiveTypeAudience) {
NSString *roomId = [FUSLiveHelper shareInstance].roomInfoModel.roomId;
NSString *channelId = [[dict[@"channelId"] description] length] ? [dict[@"channelId"] description] : [FUSLiveHelper shareInstance].roomInfoModel.channelId;
NSString *roundId = [[dict[@"roundId"] description] length] ? [dict[@"roundId"] description] : [FUSLiveHelper shareInstance].roomInfoModel.roundId;
NSString *tipText = [FUSFormatContentHelper fus_getContentFromArr:dict[@"multiContents"]];
[[FUSLiveHelper shareInstance] fus_handleShowTimeKickToBuyEntryWithRoomId:(roomId ?: @"") channelId:(channelId ?: @"") roundId:(roundId ?: @"") tipText:(tipText ?: @"")];
return;
}
}
if ([[FUSLiveHelper shareInstance] liveType] == FUSLiveTypeAudience) { if ([[FUSLiveHelper shareInstance] liveType] == FUSLiveTypeAudience) {
// 播放 // 播放
[_streamView.playView fus_stopALLPlayer]; [_streamView.playView fus_stopALLPlayer];
......
...@@ -280,6 +280,12 @@ typedef NS_ENUM(NSInteger,FUSLiveRoomScopeType) { ...@@ -280,6 +280,12 @@ typedef NS_ENUM(NSInteger,FUSLiveRoomScopeType) {
/// 付费房模式切到非付费(mode=0):恢复正常UI并重置播放 /// 付费房模式切到非付费(mode=0):恢复正常UI并重置播放
- (void)fus_handlePayRoomSwitchToNormalPlayWithRoomId:(NSString *)roomId; - (void)fus_handlePayRoomSwitchToNormalPlayWithRoomId:(NSString *)roomId;
/// 限时表演房被踢出后统一处理:停播并隐藏直播层,展示购票入口页
- (void)fus_handleShowTimeKickToBuyEntryWithRoomId:(NSString *)roomId
channelId:(NSString *)channelId
roundId:(NSString *)roundId
tipText:(NSString *)tipText;
// 最小化直播间 // 最小化直播间
+ (void)fus_minimizeLiveCompletion: (void (^ __nullable)(void))completion; + (void)fus_minimizeLiveCompletion: (void (^ __nullable)(void))completion;
......
...@@ -1074,6 +1074,65 @@ static NSString *const KLiveDataCenter_store_liveRTCData = @"LiveDataCenter_stor ...@@ -1074,6 +1074,65 @@ static NSString *const KLiveDataCenter_store_liveRTCData = @"LiveDataCenter_stor
[self fus_requestTicketShowBuyGetDataAndFillEntry:entry roomId:roomId channelId:channelId roundId:roundId completion:nil]; [self fus_requestTicketShowBuyGetDataAndFillEntry:entry roomId:roomId channelId:channelId roundId:roundId completion:nil];
} }
- (void)fus_handleShowTimeKickToBuyEntryWithRoomId:(NSString *)roomId
channelId:(NSString *)channelId
roundId:(NSString *)roundId
tipText:(NSString *)tipText
{
dispatch_async(dispatch_get_main_queue(), ^{
NSString *currentRoomId = ([NSString isNull:roomId] ? (self.roomInfoModel.roomId ?: @"") : roomId);
NSString *safeChannelId = ([NSString isNull:channelId] ? (self.roomInfoModel.channelId ?: @"") : channelId);
NSString *safeRoundId = ([NSString isNull:roundId] ? (self.roomInfoModel.roundId ?: @"") : roundId);
FUSStreamPlayStatus status = [self.liveVC.playView fus_statusForUID:currentRoomId];
if (status == FUSStreamPlayStatusPlaying
|| status == FUSStreamPlayStatusLoading
|| status == FUSStreamPlayStatusPause) {
[self.liveVC.playView fus_stopWithUID:currentRoomId];
[self.liveVC.playView fus_destroyAllPlayer];
[self.liveVC fus_stopPlay];
[self.liveVC destroyPlayPictureInPicture];
}
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;
__block FUSTicketShowCollectTicketToggleResultModel *buyGetDataModel = nil;
__block __weak FUSLiveShowTimeAudienceEntryMainView *weakEntryView = nil;
FUSLiveShowTimeAudienceEntryMainView *entry = [FUSLiveShowTimeAudienceEntryMainView fus_showOnView:rootView actionHandler:^(FUSLiveShowTimeAudienceEntryMainViewAction action, NSInteger selectedOptionIndex) {
__strong typeof(weakSelf) strongSelf = weakSelf;
if (!strongSelf) {
return;
}
if (action == FUSLiveShowTimeAudienceEntryMainViewActionDismiss) {
[FUSLiveHelper fus_quitLiveWithCompletion:nil];
return;
}
if (action == FUSLiveShowTimeAudienceEntryMainViewActionEnter) {
if (!buyGetDataModel) {
[FUSDialogView fus_showDialog:[NSString fus_localString:@"数据加载中,请稍后"]];
return;
}
NSInteger buyNum = [strongSelf fus_ticketShowBuyNumWithBuyGetDataModel:buyGetDataModel selectedOptionIndex:selectedOptionIndex];
[strongSelf fus_requestTicketShowUserBuyAndEnterRoomWithRoomId:currentRoomId channelId:safeChannelId roundId:safeRoundId buyNum:buyNum entryView:weakEntryView password:@"" behaviorSrc:@"" otherInfo:nil];
return;
}
}];
weakEntryView = entry;
[self fus_requestTicketShowBuyGetDataAndFillEntry:entry roomId:currentRoomId channelId:safeChannelId roundId:safeRoundId completion:^(FUSTicketShowCollectTicketToggleResultModel * _Nullable model) {
buyGetDataModel = model;
}];
if (![NSString isNull:tipText]) {
[FUSDialogView fus_showDialog:tipText];
}
});
}
- (void)fus_requestTicketShowBuyGetDataAndFillEntry:(FUSLiveShowTimeAudienceEntryMainView *)entry - (void)fus_requestTicketShowBuyGetDataAndFillEntry:(FUSLiveShowTimeAudienceEntryMainView *)entry
roomId:(NSString *)roomId roomId:(NSString *)roomId
channelId:(NSString *)channelId channelId:(NSString *)channelId
...@@ -1152,6 +1211,23 @@ static NSString *const KLiveDataCenter_store_liveRTCData = @"LiveDataCenter_stor ...@@ -1152,6 +1211,23 @@ static NSString *const KLiveDataCenter_store_liveRTCData = @"LiveDataCenter_stor
} failure:^(NSString *msg, NSInteger code) { } failure:^(NSString *msg, NSInteger code) {
dispatch_async(dispatch_get_main_queue(), ^{ dispatch_async(dispatch_get_main_queue(), ^{
[FUSLoadingView fus_dismissProgressView]; [FUSLoadingView fus_dismissProgressView];
if (code == -20124) {
[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:^{
[[FUSLiveHelper shareInstance].currentFunctionView fus_autoShowFirstChargeViewWhenBackFromRechargeIfNeeded];
}];
return;
}
if (![NSString isNull:msg]) { if (![NSString isNull:msg]) {
[FUSDialogView fus_showDialog:msg]; [FUSDialogView fus_showDialog:msg];
} else { } else {
...@@ -1370,6 +1446,16 @@ static NSString *const KLiveDataCenter_store_liveRTCData = @"LiveDataCenter_stor ...@@ -1370,6 +1446,16 @@ static NSString *const KLiveDataCenter_store_liveRTCData = @"LiveDataCenter_stor
}); });
} failure:^(NSString *msg, NSInteger code) { } failure:^(NSString *msg, NSInteger code) {
dispatch_async(dispatch_get_main_queue(), ^{ dispatch_async(dispatch_get_main_queue(), ^{
if (code == -20124) {
[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;
}
[FUSDialogView fus_showDialog:(msg ?: @"")]; [FUSDialogView fus_showDialog:(msg ?: @"")];
}); });
}]; }];
...@@ -1398,6 +1484,23 @@ static NSString *const KLiveDataCenter_store_liveRTCData = @"LiveDataCenter_stor ...@@ -1398,6 +1484,23 @@ static NSString *const KLiveDataCenter_store_liveRTCData = @"LiveDataCenter_stor
}); });
} failure:^(NSString *msg, NSInteger code) { } failure:^(NSString *msg, NSInteger code) {
dispatch_async(dispatch_get_main_queue(), ^{ dispatch_async(dispatch_get_main_queue(), ^{
if (code == -20124) {
[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:^{
[[FUSLiveHelper shareInstance].currentFunctionView fus_autoShowFirstChargeViewWhenBackFromRechargeIfNeeded];
}];
return;
}
if (![NSString isNull:msg]) { if (![NSString isNull:msg]) {
[FUSDialogView fus_showDialog:msg]; [FUSDialogView fus_showDialog:msg];
} }
...@@ -2145,7 +2248,11 @@ static NSString *const KLiveDataCenter_store_liveRTCData = @"LiveDataCenter_stor ...@@ -2145,7 +2248,11 @@ static NSString *const KLiveDataCenter_store_liveRTCData = @"LiveDataCenter_stor
self.liveVC.backgroundImageView.hidden = NO; self.liveVC.backgroundImageView.hidden = NO;
self.liveVC.liveFunctionView.hidden = NO; self.liveVC.liveFunctionView.hidden = NO;
[self.currentFunctionView fus_showAllFunctionLayers]; [self.currentFunctionView fus_showAllFunctionLayers];
[self.liveVC fus_setupScrollEnable:YES]; if ([FUSLiveHelper shareInstance].liveType == FUSLiveTypeAudience && roomInfoModel.liveScope == 5) {
[self.liveVC fus_setupScrollEnable:NO];
} else {
[self.liveVC fus_setupScrollEnable:YES];
}
FUSLogDebug(@"FUSStreamPlayView==== 进入房间成功"); FUSLogDebug(@"FUSStreamPlayView==== 进入房间成功");
if ([FUSLiveHelper shareInstance].liveRoomType != FUSRoomTypeLinkMic) { if ([FUSLiveHelper shareInstance].liveRoomType != FUSRoomTypeLinkMic) {
...@@ -2287,6 +2394,29 @@ static NSString *const KLiveDataCenter_store_liveRTCData = @"LiveDataCenter_stor ...@@ -2287,6 +2394,29 @@ static NSString *const KLiveDataCenter_store_liveRTCData = @"LiveDataCenter_stor
// code: -20036 直播已經結束了 // code: -20036 直播已經結束了
return; return;
} }
if (code == -40013) {
dispatch_async(dispatch_get_main_queue(), ^{
NSString *channelId = [[errorDict[@"channelId"] description] ?: @"" copy];
NSString *roundId = [[errorDict[@"roundId"] description] ?: @"" copy];
[[FUSLiveHelper shareInstance] fus_handleShowTimeKickToBuyEntryWithRoomId:roomid
channelId:channelId
roundId:roundId
tipText:msg];
});
return;
}
if (code == -20065) {
dispatch_async(dispatch_get_main_queue(), ^{
[[FUSLiveHelper shareInstance] joinRoomFailuerWithErrorDict:(errorDict ?: @{})
code:-20065
msg:msg
currentRoomId:roomid
password:@""
behaviorSrc:@""
otherInfo:nil];
});
return;
}
[FUSDialogView fus_showDialog:msg]; [FUSDialogView fus_showDialog:msg];
}]; }];
} else { } else {
......
...@@ -696,7 +696,7 @@ ...@@ -696,7 +696,7 @@
if (FUSLiveHelper.shareInstance.roomScopeType == FUSLiveRoomScopeTypePassword) { if (FUSLiveHelper.shareInstance.roomScopeType == FUSLiveRoomScopeTypePassword) {
image = [FUSShowRoomCenterBunble imageNamed:@"live_RoomScope_password"]; image = [FUSShowRoomCenterBunble imageNamed:@"live_RoomScope_password"];
} else if (FUSLiveHelper.shareInstance.roomScopeType == FUSLiveRoomScopeTypePay) { } else if (FUSLiveHelper.shareInstance.roomScopeType == FUSLiveRoomScopeTypePay) {
image = [FUSShowRoomCenterBunble imageNamed:@"live_RoomScope_pay"]; image = [FUSShowRoomCenterBunble imageNamed:@"Live_botton_payIn"];
} else { } else {
image = [FUSShowRoomCenterBunble imageNamed:@"live_RoomScope_normal"]; image = [FUSShowRoomCenterBunble imageNamed:@"live_RoomScope_normal"];
} }
......
...@@ -15,6 +15,7 @@ static NSInteger const kFUSLiveShowTimeAudienceEntryMainViewTag = 90917002; ...@@ -15,6 +15,7 @@ static NSInteger const kFUSLiveShowTimeAudienceEntryMainViewTag = 90917002;
NSString * const FUSLiveShowTimeAudienceEntryTicketOptionCountTextKey = @"countText"; NSString * const FUSLiveShowTimeAudienceEntryTicketOptionCountTextKey = @"countText";
NSString * const FUSLiveShowTimeAudienceEntryTicketOptionPriceTextKey = @"priceText"; NSString * const FUSLiveShowTimeAudienceEntryTicketOptionPriceTextKey = @"priceText";
NSString * const FUSLiveShowTimeAudienceEntryTicketOptionTagTextKey = @"tagText"; NSString * const FUSLiveShowTimeAudienceEntryTicketOptionTagTextKey = @"tagText";
NSString * const FUSLiveShowTimeAudienceEntryTicketOptionImageNameTextKey = @"imageName";
@interface FUSLiveShowTimeAudienceEntryTicketOptionCardView : UIControl @interface FUSLiveShowTimeAudienceEntryTicketOptionCardView : UIControl
...@@ -151,9 +152,11 @@ NSString * const FUSLiveShowTimeAudienceEntryTicketOptionTagTextKey = @"tagText" ...@@ -151,9 +152,11 @@ NSString * const FUSLiveShowTimeAudienceEntryTicketOptionTagTextKey = @"tagText"
NSString *countText = [NSString stringWithObject:option[FUSLiveShowTimeAudienceEntryTicketOptionCountTextKey]]; NSString *countText = [NSString stringWithObject:option[FUSLiveShowTimeAudienceEntryTicketOptionCountTextKey]];
NSString *priceText = [NSString stringWithObject:option[FUSLiveShowTimeAudienceEntryTicketOptionPriceTextKey]]; NSString *priceText = [NSString stringWithObject:option[FUSLiveShowTimeAudienceEntryTicketOptionPriceTextKey]];
NSString *tagText = [NSString stringWithObject:option[FUSLiveShowTimeAudienceEntryTicketOptionTagTextKey]]; NSString *tagText = [NSString stringWithObject:option[FUSLiveShowTimeAudienceEntryTicketOptionTagTextKey]];
NSString *imageName = [NSString stringWithObject:option[FUSLiveShowTimeAudienceEntryTicketOptionImageNameTextKey]];
self.countLabel.text = ([NSString isNull:countText] ? @"x--" : countText); self.countLabel.text = ([NSString isNull:countText] ? @"x--" : countText);
self.priceLabel.text = ([NSString isNull:priceText] ? @"--" : priceText); self.priceLabel.text = ([NSString isNull:priceText] ? @"--" : priceText);
self.ticketImageView.image = [FUSShowRoomCenterBunble imageNamed:([NSString isNull:imageName] ? @"live_room_ticket" : imageName)];
if (![NSString isNull:tagText]) { if (![NSString isNull:tagText]) {
self.tagButton.hidden = NO; self.tagButton.hidden = NO;
[self.tagButton setTitle:tagText forState:UIControlStateNormal]; [self.tagButton setTitle:tagText forState:UIControlStateNormal];
...@@ -361,7 +364,7 @@ NSString * const FUSLiveShowTimeAudienceEntryTicketOptionTagTextKey = @"tagText" ...@@ -361,7 +364,7 @@ NSString * const FUSLiveShowTimeAudienceEntryTicketOptionTagTextKey = @"tagText"
- (void)fus_updateWithBuyGetDataModel:(FUSTicketShowCollectTicketToggleResultModel *)model - (void)fus_updateWithBuyGetDataModel:(FUSTicketShowCollectTicketToggleResultModel *)model
anchorFacePath:(nullable NSString *)anchorFacePath { anchorFacePath:(nullable NSString *)anchorFacePath {
NSString *theme = [model.showTheme description]; NSString *theme = [model.showTheme description];
NSInteger remainMs = (model.stageData ? model.stageData.showStatusTime : model.showStatusTime); NSInteger remainMs = (model.stageData ? model.stageData.remaintime : model.remaintime);
NSInteger remainSec = MAX(0, (NSInteger)llround(((double)remainMs / 1000.0))); NSInteger remainSec = MAX(0, (NSInteger)llround(((double)remainMs / 1000.0)));
[self fus_updateTitleText:nil [self fus_updateTitleText:nil
anchorName:(![NSString isNull:theme] ? theme : nil) anchorName:(![NSString isNull:theme] ? theme : nil)
...@@ -375,18 +378,25 @@ NSString * const FUSLiveShowTimeAudienceEntryTicketOptionTagTextKey = @"tagText" ...@@ -375,18 +378,25 @@ NSString * const FUSLiveShowTimeAudienceEntryTicketOptionTagTextKey = @"tagText"
NSInteger directNum = MAX(1, model.directBuyNum); NSInteger directNum = MAX(1, model.directBuyNum);
NSInteger strengthNum = MAX(1, model.showStrengthNum); NSInteger strengthNum = MAX(1, model.showStrengthNum);
NSInteger mvpNum = MAX(1, model.mvpBuyNum); NSInteger mvpNum = MAX(1, model.mvpBuyNum);
NSString *priceText = [@(unitPrice) description]; NSString *directPriceText = [@(MAX(0, directNum * unitPrice)) description];
NSString *strengthPriceText = [@(MAX(0, strengthNum * unitPrice)) description];
NSString *mvpPriceText = [@(MAX(0, mvpNum * unitPrice)) description];
NSDictionary *opt1 = @{ NSDictionary *opt1 = @{
FUSLiveShowTimeAudienceEntryTicketOptionCountTextKey: [NSString stringWithFormat:@"x%ld", (long)directNum], FUSLiveShowTimeAudienceEntryTicketOptionCountTextKey: [NSString stringWithFormat:@"x%ld", (long)directNum],
FUSLiveShowTimeAudienceEntryTicketOptionPriceTextKey: priceText, FUSLiveShowTimeAudienceEntryTicketOptionPriceTextKey: directPriceText,
FUSLiveShowTimeAudienceEntryTicketOptionImageNameTextKey: @"live_room_ticket",
}; };
NSDictionary *opt2 = @{ NSDictionary *opt2 = @{
FUSLiveShowTimeAudienceEntryTicketOptionCountTextKey: [NSString stringWithFormat:@"x%ld", (long)strengthNum], FUSLiveShowTimeAudienceEntryTicketOptionCountTextKey: [NSString stringWithFormat:@"x%ld", (long)strengthNum],
FUSLiveShowTimeAudienceEntryTicketOptionPriceTextKey: priceText, FUSLiveShowTimeAudienceEntryTicketOptionPriceTextKey: strengthPriceText,
FUSLiveShowTimeAudienceEntryTicketOptionTagTextKey: [NSString fus_localString:@"展示实力"],
FUSLiveShowTimeAudienceEntryTicketOptionImageNameTextKey: @"live_room_tickets",
}; };
NSDictionary *opt3 = @{ NSDictionary *opt3 = @{
FUSLiveShowTimeAudienceEntryTicketOptionCountTextKey: [NSString stringWithFormat:@"x%ld", (long)mvpNum], FUSLiveShowTimeAudienceEntryTicketOptionCountTextKey: [NSString stringWithFormat:@"x%ld", (long)mvpNum],
FUSLiveShowTimeAudienceEntryTicketOptionPriceTextKey: priceText, FUSLiveShowTimeAudienceEntryTicketOptionPriceTextKey: mvpPriceText,
FUSLiveShowTimeAudienceEntryTicketOptionTagTextKey: [NSString fus_localString:@"抢当MVP"],
FUSLiveShowTimeAudienceEntryTicketOptionImageNameTextKey: @"live_room_tickets",
}; };
[self fus_updateTicketOptions:@[opt1, opt2, opt3] selectedIndex:0]; [self fus_updateTicketOptions:@[opt1, opt2, opt3] selectedIndex:0];
} }
......
...@@ -139,6 +139,8 @@ class FUSLiveStartContentThemeEditView: UIView { ...@@ -139,6 +139,8 @@ class FUSLiveStartContentThemeEditView: UIView {
self?.selectModel?.themeId = 0 self?.selectModel?.themeId = 0
self?.selectModel?.title = "" self?.selectModel?.title = ""
self?.themeTitle = ""
self?.fus_saveThemeToLocal()
self?.reloadUI() self?.reloadUI()
}).disposed(by: disposedBag) }).disposed(by: disposedBag)
...@@ -159,6 +161,7 @@ class FUSLiveStartContentThemeEditView: UIView { ...@@ -159,6 +161,7 @@ class FUSLiveStartContentThemeEditView: UIView {
guard let model = model as? FUSLiveThemeModel else { return } guard let model = model as? FUSLiveThemeModel else { return }
self?.selectModel = model self?.selectModel = model
self?.themeTitle = themeView.themeTitle self?.themeTitle = themeView.themeTitle
self?.fus_saveThemeToLocal()
self?.reloadUI() self?.reloadUI()
} }
themeView.removeFromSuperview() themeView.removeFromSuperview()
...@@ -179,5 +182,15 @@ class FUSLiveStartContentThemeEditView: UIView { ...@@ -179,5 +182,15 @@ class FUSLiveStartContentThemeEditView: UIView {
self.closeBtn.isHidden = true self.closeBtn.isHidden = true
} }
} }
func fus_saveThemeToLocal() {
guard let uid = FUSCacheDataShare.shareStore().userDetailInfo.uid,
let userDefault = UserDefaults(suiteName: uid) else {
return
}
let selectedThemeId = self.selectModel?.themeId ?? 0
userDefault.set(selectedThemeId, forKey: FUS_SelectedLiveThemeIdUDKey)
userDefault.set((selectedThemeId > 0 ? self.themeTitle : ""), forKey: FUS_LastLiveThemeTopicUDKey)
}
} }
...@@ -428,13 +428,11 @@ import FUSCommon ...@@ -428,13 +428,11 @@ import FUSCommon
// 开播标题 // 开播标题
if !result.isEmpty, result != themeView.LiveTitleTextFiled.attributedPlaceholder?.string { if !result.isEmpty, result != themeView.LiveTitleTextFiled.attributedPlaceholder?.string {
userDefault.set(result, forKey: FUS_LastLiveThemeTopicUDKey) userDefault.set(result, forKey: FUSLiveUDKeys.fus_lastLiveTitleUDKey())
startLiveModel.title = result startLiveModel.title = result
} else { } else {
if let placeholderString = themeView.LiveTitleTextFiled.attributedPlaceholder?.string { userDefault.set("", forKey: FUSLiveUDKeys.fus_lastLiveTitleUDKey())
userDefault.set("", forKey: FUS_LastLiveThemeTopicUDKey) startLiveModel.title = themeView.LiveTitleTextFiled.attributedPlaceholder?.string ?? ""
startLiveModel.title = placeholderString
}
} }
// 开播主题名称与开播主题id // 开播主题名称与开播主题id
......
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