Commit 65cc6848 by ludi

修复一些bug

parent c1d55a74
Showing with 980 additions and 144 deletions
......@@ -60,7 +60,7 @@
"%@倍大奖" = "%@倍大奖";
"珍爱团改名卡" = "珍爱团改名卡";
"社团改名卡" = "社团改名卡";
"热门主播 %@ 已拒绝你的邀请" = "热门主播 %@ 已拒绝你的邀请";
......@@ -1322,7 +1322,7 @@
"说话时间太短" = "说话时间太短";
"请输入珍爱团名" = "请输入珍爱团名";
"请输入社团名" = "请输入社团名";
"登录失败" = "登入失败";
......@@ -1394,7 +1394,7 @@
"通话失败,请打开权限以使用麦克风和相机" = "通话失败,请打开权限以使用麦克风和相机";
"修改珍爱团名消耗 %@ x1" = "修改珍爱团名消耗 %@ x1";
"修改社团名消耗 %@ x1" = "修改社团名消耗 %@ x1";
"切换后的直播时长不计入直播奖励活动" = "切换后的直播时长不计入直播奖励活动";
......@@ -1476,7 +1476,7 @@
"点击追踪主播哦~" = "点击追踪主播哦~";
"修改珍爱团名" = "修改珍爱团名";
"修改社团名" = "修改社团名";
"确认分享的内容符合您所在国家的法律" = "确认分享的内容符合您所在国家的法律";
......@@ -2686,7 +2686,7 @@
"设置您的直播主题" = "设置您的直播主题";
"珍爱值:%@" = "珍爱值:%@";
"声望:%@" = "声望:%@";
"是否关闭所有美颜特效?" = "是否关闭所有美颜特效?";
......@@ -2698,7 +2698,7 @@
"直播预告" = "直播预告";
"珍爱团新成员" = "珍爱团新成员";
"社团新成员" = "社团新成员";
"质量" = "质量";
......@@ -2776,7 +2776,7 @@
"美颜特效" = "美颜特效";
"珍爱团团员" = "珍爱团团员";
"社团团员" = "社团团员";
"獎勵記錄" = "奖励记录";
......@@ -3218,3 +3218,211 @@
"当前版本不支援此社交平台" = "当前版本不支援此社交平台";
"来自" = "来自";
"要回来哟~" = "要回来哟~";
"退出之前先追踪主播叭~" = "退出之前先追蹤主播叭~";
"追踪并退出" = "追蹤并退出";
"和主播打个招呼吧" = "和主播打个招呼吧";
"点击发送快捷发言" = "点击发送快捷发言";
"点击小心心追踪主播" = "点击小心心追蹤主播";
"送礼和主播互动吧~" = "送礼和主播互动吧~";
"点击查看背包里的礼物" = "点击查看背包裏的礼物";
"立即送出礼物与主播互动吧" = "立即送出礼物与主播互动吧";
"点亮加入主播队伍赢露水" = "点亮加入主播队伍赢露水";
"您正在接受惩罚,无法使用脸部特效" = "您正在接受惩罚,无法使用脸部特效";
"直播管理" = "直播管理";
"PK游戏" = "PK游戏";
"惩罚列表" = "惩罚列表";
"PK败北" = "PK败北";
"解救条件" = "解救条件";
"去解救" = "去解救";
"未开始" = "未开始";
"生效中" = "已生效";
"已结束" = "已结束";
"已解除" = "已解除";
"当前没有惩罚进行中" = "当前没有惩罚进行中";
"惩罚" = "惩罚";
"对方视频连线中..." = "对方视频连线中...";
"视频连线中..." = "视频连线中...";
"静音对方" = "静音对方";
"取消静音" = "取消静音";
"您已静音对方,您的直播间观众听不到对方主播的声音" = "您已静音对方,您的直播间观众听不到对方主播的声音";
"您已取消静音对方,对方主播的声音可以在您直播间内被听到" = "您已取消静音对方,对方主播的声音可以在您直播间内被听到";
"选择惩罚" = "选择惩罚";
"连胜" = "连胜";
"还差 #$1# 开启#$2#" = "还差 #$1# 开启#$2#";
"礼物暴击" = "礼物暴击";
"即将开始" = "即将开始";
"再来一场" = "再来一场";
"PK说明" = "PK说明";
"今日战绩" = "今日战绩";
"PK场次" = "PK场次";
"胜场" = "胜场";
"场均人气" = "场均人气";
"PKの贡献" = "PKの贡献";
"随机匹配" = "随机匹配";
"开启随机匹配后您可以正常直播,匹配成功后立即开始PK" = "开启随机匹配后您可以正常直播,匹配成功后立即开始PK";
"主播列表" = "主播列表";
"通过ID/暱称搜寻主播" = "通过ID/昵称搜寻主播";
"PK邀请" = "PK邀请";
"开启PK" = "开启PK";
"匹配对手中" = "匹配对手中";
"等候对手接受PK" = "等候对手接受PK";
"取消匹配" = "取消匹配";
"结束PK" = "结束PK";
"提前结束PK将被判定为失败" = "提前结束PK将被判定为失败";
"是否提前结束PK?" = "是否提前结束PK?";
"提前结束PK将判定为本场PK失败, 是否提前结束PK?" = "提前结束PK将判定为本场PK失败, 是否提前结束PK?";
"对方" = "对方";
"PK模式" = "PK模式";
"PK玩法" = "PK玩法";
"点击下方按钮选择PK模式进入下一步" = "点击下方按钮选择PK模式进入下一步";
"点击下方按钮选择PK玩法进入下一步" = "点击下方按钮选择PK玩法进入下一步";
"PK对手" = "PK对手";
"接受PK邀请" = "接受PK邀请";
"公屏消息互通" = "公屏消息互通";
"关闭 PK 动效" = "关闭 PK 动效";
"参与「迎新奖励」的直播间无法设置此选项" = "参与「迎新奖励」的直播间无法设置此选项";
"迎新" = "迎新";
"说明" = "说明";
"本场直播不在接受PK邀请" = "本场直播不在接受PK邀请";
"模式" = "模式";
"玩法" = "玩法";
"邀请你再来一场" = "邀请你再来一场";
"拒绝了您的PK邀请" = "拒绝了您的PK邀请";
"本场PK惩罚" = "本场PK惩罚";
"你本场PK选择了以下惩罚" = "你本场PK选择了以下惩罚";
"%@本场PK选择了以下惩罚" = "%@本场PK选择了以下惩罚";
"惩罚详情" = "惩罚详情";
"惩罚类型:" = "惩罚类型:";
"选择本场PK惩罚" = "选择本场PK惩罚";
"在下方#$1#个惩罚中选择#$2#个作为您本次PK的惩罚,惩罚生效时 将在您选择的惩罚中随机开启一个惩罚" = "在下方#$1#个惩罚中选择#$2#个作为您本次PK的惩罚,惩罚生效时 将在您选择的惩罚中随机开启一个惩罚";
"已选择惩罚" = "已选择惩罚";
"超出可选择惩罚数量" = "超出可选择惩罚数量";
"你已选择了该惩罚" = "你已选择了该惩罚";
"该惩罚已被其他主播选择" = "该惩罚已被其他主播选择";
"PK惩罚详情" = "PK惩罚详情";
"名称" = "名称";
"类型" = "类型";
"描述" = "描述";
"PK胜利" = "PK胜利";
"PK失败" = "PK失败";
"PK平局" = "PK平局";
"领取胜利奖励" = "领取胜利奖励";
"您支持的主播获胜,领取PK胜利奖励!" = "您支持的主播获胜,领取PK胜利奖励!";
"主播队伍在PK中获得胜利" = "主播队伍在PK中获得胜利";
"您加入的主播队伍在PK中败下阵来!" = "您加入的主播队伍在PK中败下阵来!";
"您加入的主播队伍在PK与对方打成平手" = "您加入的主播队伍在PK与对方打成平手";
"人气贡献榜" = "人气贡献榜";
"红" = "红";
"蓝" = "蓝";
"按赞值贡献榜" = "按赞值贡献榜";
"礼物值贡献榜" = "礼物值贡献榜";
"按赞值记录" = "按赞值记录";
"礼物值记录" = "礼物值记录";
"人气值记录" = "人气值记录";
"俱乐部" = "社团";
......@@ -3425,3 +3425,4 @@
"人气值记录" = "人氣值記錄";
"俱乐部" = "社團";
......@@ -60,7 +60,7 @@
"%@倍大奖" = "%@ times";
"珍爱团改名卡" = "Fan Club name change card";
"社团改名卡" = "Club name change card";
"热门主播 %@ 已拒绝你的邀请" = "Broadcaster %@ has rejected your PK invitation";
......@@ -1322,7 +1322,7 @@
"说话时间太短" = "Message too short";
"请输入珍爱团名" = "Please enter the Fan Club name";
"请输入团名" = "Please enter the Fan Club name";
"登录失败" = "Login failed";
......@@ -1394,7 +1394,7 @@
"通话失败,请打开权限以使用麦克风和相机" = "The call failed, please open the permission to use the microphone and camera";
"修改珍爱团名消耗 %@ x1" = "Change the Fan Club name consumes %@ x1";
"修改社团名消耗 %@ x1" = "Changing the club name costs %@ x1";
"切换后的直播时长不计入直播奖励活动" = "After switching,afterwards broadcasting time won't be included in the Broadcaster Award Activity";
......@@ -1476,7 +1476,7 @@
"点击追踪主播哦~" = "Click to follow the broadcaster~";
"修改珍爱团名" = "Change the name of the Fan Club";
"修改社团名" = "Modify club name";
"确认分享的内容符合您所在国家的法律" = "Make sure the content you share complies with the laws of your country";
......@@ -2686,7 +2686,7 @@
"设置您的直播主题" = "Enter live topic";
"珍爱值:%@" = "Club Points: %@";
"声望:%@" = "Reputation: %@";
"是否关闭所有美颜特效?" = "Do you want to turn off all beauty effects?";
......@@ -2698,7 +2698,7 @@
"直播预告" = "Preview";
"珍爱团新成员" = "New members of the Fan Club";
"社团新成员" = "New Club Member";
"质量" = "Quality";
......@@ -2776,7 +2776,7 @@
"美颜特效" = "Beauty";
"珍爱团团员" = "Fan Club members";
"社团团员" = "Club member";
"獎勵記錄" = "Reward record";
......@@ -2896,7 +2896,7 @@
"申请重新认定成功" = "Application for re-certification was successful";
"你已加入对方的 _#{俱乐部}#_,解锁团员畅聊特权" = "You have joined the anchor's _#{Club}#_, unlocking the privilege of free chatting with other members";
"你已加入对方的 _#{俱乐部}#_,解锁团员畅聊特权" = "You have joined the party's _#{Club}#_, unlocking the privilege of free chat with other members.";
"对方已加入你的 _#{俱乐部}#_" = "The opposite has joined your _#{Club}#_";
......@@ -3218,3 +3218,211 @@
"当前版本不支援此社交平台" = "This social platform is not supported in the current version";
"来自" = "From";
"要回来哟~" = "Don’t' forget me~";
"退出之前先追踪主播叭~" = "Follow her before leaving~";
"追踪并退出" = "Follow and exit";
"和主播打个招呼吧" = "Say hello to her";
"点击发送快捷发言" = "Click to send shortcut message";
"点击小心心追踪主播" = "Click the little heart to follow the anchor";
"送礼和主播互动吧~" = "Send gifts and interact with her~";
"点击查看背包里的礼物" = "Click to view the gifts in the backpack";
"立即送出礼物与主播互动吧" = "Send gifts to interact with her";
"点亮加入主播队伍赢露水" = "Light up to join the team and win DEWs";
"您正在接受惩罚,无法使用脸部特效" = "You are being punished for using facial effects";
"直播管理" = "Live Stream Management";
"PK游戏" = "PK Game";
"惩罚列表" = "Punishment list";
"PK败北" = "PK defeated";
"解救条件" = "Rescue conditions";
"去解救" = "to rescue";
"未开始" = "Not started";
"生效中" = "In force";
"已结束" = "ended";
"已解除" = "Dismissed";
"当前没有惩罚进行中" = "No penalties in progress";
"惩罚" = "punish";
"对方视频连线中..." = "Opponent's video connectiing...";
"视频连线中..." = "Video connecting...";
"静音对方" = "Mute";
"取消静音" = "Unmute";
"您已静音对方,您的直播间观众听不到对方主播的声音" = "You have muted the opposite. Audience in your room cannot hear the opposite's voice.";
"您已取消静音对方,对方主播的声音可以在您直播间内被听到" = "Unmuted the opposite. Opposite's voice can be heard in your room";
"选择惩罚" = "Select a penalty";
"连胜" = "Wins";
"还差 #$1# 开启#$2#" = "#$1# needed to active #$2#";
"礼物暴击" = "Gift Strike";
"即将开始" = "Coming Soon";
"再来一场" = "Once more";
"PK说明" = "PK Introduction";
"今日战绩" = "Today's results";
"PK场次" = "PK Matches";
"胜场" = "Wins";
"场均人气" = "Average Popularity";
"PKの贡献" = "PK Contribution";
"随机匹配" = "Random Match";
"开启随机匹配后您可以正常直播,匹配成功后立即开始PK" = "After enabling random matching, you can stream normally. PK will start immediately after a successful match.";
"主播列表" = "Broadcaster List";
"通过ID/暱称搜寻主播" = "Searching braodcaster by ID/Nickname";
"PK邀请" = "PK Invitation";
"开启PK" = "Start PK";
"匹配对手中" = "Matching opponents";
"等候对手接受PK" = "Wait for your opponent to accept PK";
"取消匹配" = "Cancel match";
"结束PK" = "End PK";
"提前结束PK将被判定为失败" = "Ending the PK early will result in a loss";
"是否提前结束PK?" = "Do you want to end the PK early?";
"提前结束PK将判定为本场PK失败, 是否提前结束PK?" = "Ending the PK early will result in a PK failure. Do you want to end the PK early?";
"对方" = "Opposite";
"PK模式" = "PK Mode";
"PK玩法" = "PK Playstyle";
"点击下方按钮选择PK模式进入下一步" = "Click the button below to select PK mode and go to the next step";
"点击下方按钮选择PK玩法进入下一步" = "Click the button below to select PK mode and go to the next step";
"PK对手" = "PK Opponent";
"接受PK邀请" = "Accept PK invitation";
"公屏消息互通" = "Public Screen Message Interoperability";
"关闭 PK 动效" = "Turn Off PK Animation";
"参与「迎新奖励」的直播间无法设置此选项" = "This option cannot be set in live streams participating in the 'Welcome Rewards'.";
"迎新" = "Welcome";
"说明" = "illustrate";
"本场直播不在接受PK邀请" = "No more PK Invitation in this live stream";
"模式" = "Mode";
"玩法" = "Playstyle";
"邀请你再来一场" = "Invite you to PK again";
"拒绝了您的PK邀请" = "Your PK invitation has been rejected";
"本场PK惩罚" = "Punishment for this PK";
"你本场PK选择了以下惩罚" = "You have selected the following punishment for this PK match";
"%@本场PK选择了以下惩罚" = "%@ selected for this PK match";
"惩罚详情" = "Penalty Details";
"惩罚类型:" = "Penalty type:";
"选择本场PK惩罚" = "Select this PK punishment.";
"在下方#$1#个惩罚中选择#$2#个作为您本次PK的惩罚,惩罚生效时 将在您选择的惩罚中随机开启一个惩罚" = "Select #$2# of the #$1# punishment below as your punishment for this PK match. When the punishment take effect, one of the selected punishment will be randomly activated.";
"已选择惩罚" = "Selected Punishments";
"超出可选择惩罚数量" = "Exceeded the number of selectable punishments.";
"你已选择了该惩罚" = "You have selected this punishment.";
"该惩罚已被其他主播选择" = "This punishment has already been selected by another anchor.";
"PK惩罚详情" = "PK Punishment Details";
"名称" = "Name";
"类型" = "Type";
"描述" = "Description";
"PK胜利" = "PK victory";
"PK失败" = "PK Failed";
"PK平局" = "PK draw";
"领取胜利奖励" = "Claim victory reward";
"您支持的主播获胜,领取PK胜利奖励!" = "Anchor you supported won! Claim your PK victory rewards!";
"主播队伍在PK中获得胜利" = "The team won the PK";
"您加入的主播队伍在PK中败下阵来!" = "The team you joined lost in the PK!";
"您加入的主播队伍在PK与对方打成平手" = "The team you joined is tied with the opposing team in the PK.";
"人气贡献榜" = "Qi's Contribution Ranking";
"红" = "Red";
"蓝" = "Blue";
"按赞值贡献榜" = "Likes Contribution Ranking";
"礼物值贡献榜" = "Gift Value Contribution Ranking";
"按赞值记录" = "Likes Record";
"礼物值记录" = "Gift Value Record";
"人气值记录" = " Popularity Record";
"俱乐部" = "Fans group";
......@@ -654,6 +654,13 @@ typedef id<FUSVideoPlayerProtocal> FUSStreamPlayer;
}];
}
- (void)fus_setPKUser:(NSString *)uid mute:(BOOL)mute {
FUSStreamPlayer player = [self playerForUID:uid];
if (player) {
player.muted = mute;
}
}
/**
获取实时统计信息
......
......@@ -673,7 +673,7 @@
CLANG_CXX_LANGUAGE_STANDARD = "gnu++17";
CODE_SIGN_ENTITLEMENTS = FuSiLive/FuSiLive.entitlements;
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 202506260035;
CURRENT_PROJECT_VERSION = 202506260037;
DEFINES_MODULE = YES;
DEVELOPMENT_TEAM = 6GG26BHUMC;
ENABLE_ON_DEMAND_RESOURCES = NO;
......@@ -938,7 +938,7 @@
CLANG_CXX_LANGUAGE_STANDARD = "gnu++17";
CODE_SIGN_ENTITLEMENTS = FuSiLive/FuSiLive.entitlements;
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 202506260035;
CURRENT_PROJECT_VERSION = 202506260037;
DEFINES_MODULE = YES;
DEVELOPMENT_TEAM = 6GG26BHUMC;
ENABLE_ON_DEMAND_RESOURCES = NO;
......
......@@ -316,7 +316,7 @@ class FUSSwiftAgoraSession: NSObject {
localView.translatesAutoresizingMaskIntoConstraints = false
localView.contentMode = .scaleAspectFill
self.audioEnable = true
// self.audioEnable = true
FUSLog.info("pidan test localView = \(localView)")
self.localViewDidLoad.accept(true)
......
......@@ -160,6 +160,8 @@ class FUSCallOneToOnePanelView: FUSBaseView {
}).disposed(by: disposeBag)
case .beauty:
tempBtn.isSelected = false
case .flashLight:
tempBtn.isSelected = FUSChatCallHelper.shared.agoraSession?.isTorchOn ?? false
default:
break
}
......
......@@ -669,7 +669,7 @@ BDAlphaPlayerMetalViewDelegate
- (void)fus_setupPopularView {
__weak typeof(self) weakSelf = self;
if (self.popularView == nil) {
self.popularView = [[FUSPopularProgressView alloc] initWithFrame:CGRectMake(12, self.headView.bottom, 75, 75)];
self.popularView = [[FUSPopularProgressView alloc] initWithFrame:CGRectMake(12, self.headView.bottom + 8, 75, 75)];
self.popularView.tapPopularViewHandler = ^{
[weakSelf fus_headViewClickHeatPower];
};
......@@ -679,7 +679,7 @@ BDAlphaPlayerMetalViewDelegate
if (self.pusherPopularView == nil) {
self.pusherPopularView = [[FUSPopularProgressView alloc] initWithFrame:CGRectMake(12, self.pusherHeadView.bottom, 75, 75)];
self.pusherPopularView = [[FUSPopularProgressView alloc] initWithFrame:CGRectMake(12, self.pusherHeadView.bottom + 8, 75, 75)];
self.pusherPopularView.tapPopularViewHandler = ^{
[weakSelf fus_headViewClickHeatPower];
};
......@@ -2458,6 +2458,10 @@ BDAlphaPlayerMetalViewDelegate
if (isAutoShow && FUSSwiftLiveHelper.shared.pkHelper.ocViewModel.currentPKState != FUSPKStateNone) {
return;
}
// 未到时间不打开
if ([treasureBoxModel.countdownTimeStr isEqualToString:@"00:00"] == NO) {
return;
}
if (!weakSelf.treasureBoxGrabView) {
if ([treasureBoxModel.countdownTimeStr isEqualToString:@"00:00"]) {
......@@ -2753,6 +2757,12 @@ BDAlphaPlayerMetalViewDelegate
if (weakSelf.realtimeActivityView) {
weakSelf.realtimeActivityView.hidden = NO;
}
if ([FUSLiveHelper shareInstance].roomInfoModel.roomType.integerValue != 2) {
self.popularView.hidden = NO;
}
if ([FUSLiveHelper shareInstance].liveType == FUSLiveTypeAnchor) {
weakSelf.anchorRewardView.hidden = NO;
}
[weakSelf fus_reloadRealtimeActivityWebView];
......@@ -2775,6 +2785,8 @@ BDAlphaPlayerMetalViewDelegate
// ludy: 活动框架应该是隐藏逻辑才对,因为需要触发一些cid,修改了皮蛋逻辑
weakSelf.realtimeActivityWebView.hidden = YES;
weakSelf.gameOperationWebView.hidden = YES;
weakSelf.anchorRewardView.hidden = YES;
weakSelf.popularView.hidden = YES;
[weakSelf.listView removeFromSuperview];
}
......@@ -6827,7 +6839,7 @@ BDAlphaPlayerMetalViewDelegate
return;
}
_liveTimeRecordView = [[FUSLiveTimeRecordView alloc] initWithFrame:CGRectMake(UIView.fus_screenW - 62 - 8, [[FUSLiveHelper shareInstance].currentFunctionView fus_getHeaderViewHeight] - 30, 62, 22)];
_liveTimeRecordView = [[FUSLiveTimeRecordView alloc] initWithFrame:CGRectMake(UIView.fus_screenW - 62 - 8, [[FUSLiveHelper shareInstance].currentFunctionView fus_getHeaderViewHeight] - 24, 62, 22)];
UITapGestureRecognizer *tapGesture = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(tapTimeRecordViewGesture:)];
[_liveTimeRecordView addGestureRecognizer:tapGesture];
[[self fus_viewWithLayer:FUSLiveFunctionLayerRoomInfos] addSubview:_liveTimeRecordView];
......
......@@ -496,7 +496,7 @@ NSString * const kDidHotScoreChangeNotification = @"kDidHotScoreChangeNotificati
_userInfoLabel.text = [NSString stringWithFormat:@"%@ %@",FUSLiveHelper.shareInstance.roomInfoModel.roomId,[[NSDate date] stringWithFormat:@"dd/MM/yyyy"]];
[_userInfoLabel sizeToFit];
_userInfoLabel.height = 20;
_userInfoLabel.x = self.width - self.userInfoLabel.width - 10;
_userInfoLabel.x = self.width - self.userInfoLabel.width - 86;
_userInfoLabel.centerY = self.coinTicketView.centerY;
_waterMark.centerY = _userInfoLabel.centerY;
_waterMark.right = _userInfoLabel.left - 4;
......
......@@ -58,41 +58,32 @@
@implementation FUSLinkMicItemView
- (instancetype)initWithFrame:(CGRect)frame{
- (instancetype)initWithFrame:(CGRect)frame {
self = [super initWithFrame:frame];
if (self) {
[self initUI];
[self setupViews];
[self setupImageDict];
}
return self;
}
- (void)initUI{
- (void)setupViews {
self.backgroundColor = [[UIColor colorWithHex:@"#000000"] colorWithAlphaComponent:0.8];
self.layer.cornerRadius = 13;
self.clipsToBounds = YES;
_bgView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, UIView.fus_screenW, UIView.fus_screenH)];
_bgView.backgroundColor = [UIColor clearColor];
UITapGestureRecognizer *tap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(fus_dismissView)];
[_bgView addGestureRecognizer:tap];
[_itemCollectionView removeFromSuperview];
_itemCollectionView = nil;
if ([NSArray isNull:_dataSource]) {
return;
}
UICollectionViewFlowLayout *layout = [[UICollectionViewFlowLayout alloc]init];
layout.itemSize = CGSizeMake((CGFloat)self.bounds.size.width/_dataSource.count, (CGFloat)self.bounds.size.width/_dataSource.count);
UICollectionViewFlowLayout *layout = [[UICollectionViewFlowLayout alloc] init];
layout.minimumLineSpacing = 0;
layout.minimumInteritemSpacing = 0;
layout.scrollDirection = UICollectionViewScrollDirectionHorizontal;
_itemCollectionView = [[UICollectionView alloc]initWithFrame:CGRectMake(0, 0, self.bounds.size.width, self.bounds.size.height) collectionViewLayout:layout];
_itemCollectionView = [[UICollectionView alloc] initWithFrame:self.bounds collectionViewLayout:layout];
_itemCollectionView.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight;
_itemCollectionView.backgroundColor = [UIColor clearColor];
_itemCollectionView.delegate = self;
_itemCollectionView.dataSource = self;
......@@ -101,97 +92,101 @@
_itemCollectionView.pagingEnabled = YES;
[_itemCollectionView registerClass:[FUSLinkMicItemViewCollectionViewCell class] forCellWithReuseIdentifier:@"FUSLinkMicItemViewCollectionViewCell"];
[self addSubview:_itemCollectionView];
_normalImageDict = @{[NSString stringWithFormat:@"%ld",FUSItemViewCloseMic]:@"live_link_mic_voice_close",
[NSString stringWithFormat:@"%ld",FUSItemViewHomeMic]:@"live_link_mic_voice_home",
[NSString stringWithFormat:@"%ld",FUSItemViewDeleteMic]:@"live_link_mic_voice_delete",
[NSString stringWithFormat:@"%ld",FUSItemViewSendGift]:@"live_gift_view_icon_hl",
[NSString stringWithFormat:@"%ld",FUSItemViewOpenMic]:@"live_link_mic_voice_open",
}
- (void)setupImageDict {
_normalImageDict = @{[NSString stringWithFormat:@"%ld", FUSItemViewCloseMic]: @"live_link_mic_voice_close",
[NSString stringWithFormat:@"%ld", FUSItemViewHomeMic]: @"live_link_mic_voice_home",
[NSString stringWithFormat:@"%ld", FUSItemViewDeleteMic]: @"live_link_mic_voice_delete",
[NSString stringWithFormat:@"%ld", FUSItemViewSendGift]: @"live_gift_view_icon_hl",
[NSString stringWithFormat:@"%ld", FUSItemViewOpenMic]: @"live_link_mic_voice_open",
};
// _hightlightedImageDict = @{[NSString stringWithFormat:@"%ld",FUSItemViewOpenMic]:@"live_link_mic_voice_close",
// [NSString stringWithFormat:@"%ld",FUSItemViewHomeMic]:@"live_link_mic_voice_home",
// [NSString stringWithFormat:@"%ld",FUSItemViewDeleteMic]:@"live_link_mic_voice_delete",
// [NSString stringWithFormat:@"%ld",FUSItemViewSendGift]:@"live_gift_view_icon"};
}
- (void)reloadDataView{
- (void)reloadDataView {
if ([NSArray isNull:_dataSource] || _dataSource.count == 0) {
return;
}
UICollectionViewFlowLayout *layout = (UICollectionViewFlowLayout *)_itemCollectionView.collectionViewLayout;
layout.itemSize = CGSizeMake(self.bounds.size.width / _dataSource.count, self.bounds.size.height);
[_itemCollectionView setCollectionViewLayout:layout animated:NO];
[_itemCollectionView reloadData];
[self.superview insertSubview:_bgView belowSubview:self];
}
- (void)fus_onClickEvent:(UIButton *)sender{
- (void)fus_onClickEvent:(UIButton *)sender {
if (_delgate && [_delgate respondsToSelector:@selector(fus_linkMicItemView:itemType:)]) {
if (sender.tag == 1 || sender.tag == 2) {
FUSItemViewType type = (FUSItemViewType)sender.tag;
if (type == FUSItemViewOpenMic || type == FUSItemViewCloseMic) {
if (sender.selected) {
[_delgate fus_linkMicItemView:self itemType:FUSItemViewOpenMic];
}else{
} else {
[_delgate fus_linkMicItemView:self itemType:FUSItemViewCloseMic];
}
}else{
[_delgate fus_linkMicItemView:self itemType:sender.tag];
} else {
[_delgate fus_linkMicItemView:self itemType:type];
}
}
[self fus_dismissView];
}
- (void)fus_showMicStatus:(BOOL)isOpen model:(nonnull FUSLinkMicroModel *)model{
- (void)fus_showMicStatus:(BOOL)isOpen model:(nonnull FUSLinkMicroModel *)model {
model.isOpenMic = isOpen;
FUSLinkMicItemViewCollectionViewCell *cell = (FUSLinkMicItemViewCollectionViewCell *)[_itemCollectionView cellForItemAtIndexPath:[NSIndexPath indexPathWithIndex:0]];
cell.selected = !isOpen;
for (FUSLinkMicItemViewCollectionViewCell *cell in _itemCollectionView.visibleCells) {
if (cell.micBtn.tag == FUSItemViewCloseMic || cell.micBtn.tag == FUSItemViewOpenMic) {
cell.micBtn.selected = !isOpen;
}
}
}
- (void)fus_dismissView{
- (void)fus_dismissView {
self.model = nil;
[self.bgView removeFromSuperview];
[self removeFromSuperview];
}
#pragma mark - UICollectionViewDataSource
- (NSInteger)collectionView:(UICollectionView *)collectionView numberOfItemsInSection:(NSInteger)section{
- (NSInteger)collectionView:(UICollectionView *)collectionView numberOfItemsInSection:(NSInteger)section {
return _dataSource.count;
}
#pragma mark - UICollectionViewDelegate
- (__kindof UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath{
- (__kindof UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath {
FUSLinkMicItemViewCollectionViewCell *cell = [collectionView dequeueReusableCellWithReuseIdentifier:@"FUSLinkMicItemViewCollectionViewCell" forIndexPath:indexPath];
if (cell) {
NSInteger type = [_dataSource[indexPath.row] integerValue];
NSString *imageStr = _normalImageDict[[NSString stringWithFormat:@"%ld",type]];
NSString *selectImgStr = nil;
if (indexPath.row == 0 && (type == FUSItemViewCloseMic || type == FUSItemViewOpenMic)) {
selectImgStr = @"live_link_mic_voice_open";
}
[cell setNormalImage:imageStr selectedImage:selectImgStr hightlightImage:nil];
cell.micBtn.tag = type;
NSInteger type = [_dataSource[indexPath.row] integerValue];
NSString *imageStr = _normalImageDict[[NSString stringWithFormat:@"%ld", type]];
NSString *selectImgStr = nil;
if (type == FUSItemViewCloseMic || type == FUSItemViewOpenMic) {
selectImgStr = _normalImageDict[[NSString stringWithFormat:@"%ld", FUSItemViewOpenMic]];
cell.micBtn.selected = !_model.isOpenMic;
} else {
cell.micBtn.selected = NO;
}
[cell setNormalImage:imageStr selectedImage:selectImgStr hightlightImage:nil];
cell.micBtn.tag = type;
return cell;
}
- (void)collectionView:(UICollectionView *)collectionView didSelectItemAtIndexPath:(NSIndexPath *)indexPath{
#pragma mark - UICollectionViewDelegate
- (void)collectionView:(UICollectionView *)collectionView didSelectItemAtIndexPath:(NSIndexPath *)indexPath {
FUSLinkMicItemViewCollectionViewCell *cell = (FUSLinkMicItemViewCollectionViewCell *)[collectionView cellForItemAtIndexPath:indexPath];
[self fus_onClickEvent:cell.micBtn];
if (cell) {
[self fus_onClickEvent:cell.micBtn];
}
}
- (void)setDataSource:(NSArray *)dataSource{
- (void)setDataSource:(NSArray *)dataSource {
_dataSource = dataSource;
[self initUI];
[self reloadDataView];
}
@end
......@@ -250,8 +250,8 @@ class FUSPKControlSearchPlayerPlayerListCell: UITableViewCell {
let avatarTapBtn = UIButton(type: .custom)
let bgImageView = UIImageView()
let faceView = FUSRichIconView(frame: CGRectMake(0, 0, 40, 40))
let richImageView = UIImageView(frame: .init(x: 0, y: 0, width: 37, height: 14))
let faceView = UIImageView(frame: CGRectMake(0, 0, 40, 40))
let richImageView = UIImageView()
let nicknameLabel = UILabel()
let inviteBtn = UIButton(type: .custom)
let lineView = UIView()
......@@ -276,6 +276,8 @@ class FUSPKControlSearchPlayerPlayerListCell: UITableViewCell {
make.left.right.equalToSuperview().inset(16)
}
faceView.layer.cornerRadius = 40 / 2.0
faceView.layer.masksToBounds = true
bgImageView.addSubview(faceView)
faceView.snp.makeConstraints { make in
make.left.equalTo(14)
......@@ -288,17 +290,21 @@ class FUSPKControlSearchPlayerPlayerListCell: UITableViewCell {
make.edges.equalTo(faceView).inset(-10)
}
nicknameLabel.font = .fus_themeMediumFont(15)
nicknameLabel.textColor = .fus_textColorRich()
bgImageView.addSubview(nicknameLabel)
// nicknameLabel.snp.makeConstraints { make in
// make.left.equalTo(faceView.snp.right).offset(8)
// make.centerY.equalTo(faceView.snp.centerY)
// make.right.lessThanOrEqualTo(inviteBtn.snp.left).offset(-80)
// }
bgImageView.addSubview(richImageView)
richImageView.snp.makeConstraints { make in
make.left.equalTo(faceView.snp.right).offset(8)
make.centerY.equalToSuperview()
make.width.equalTo(37)
make.height.equalTo(14)
make.left.equalTo(nicknameLabel.snp.right).offset(2)
make.centerY.equalTo(faceView.snp.centerY)
}
nicknameLabel.font = .fus_themeMediumFont(15)
bgImageView.addSubview(nicknameLabel)
let normalTitle: String = .fus_localString("PK邀请")
let selectTitle: String = .fus_localString("取消邀请")
let refuseTitle: String = .fus_localString("拒绝PK")
......@@ -329,9 +335,9 @@ class FUSPKControlSearchPlayerPlayerListCell: UITableViewCell {
}
nicknameLabel.snp.makeConstraints { make in
make.left.equalTo(richImageView.snp.right).offset(6)
make.centerY.equalToSuperview()
make.right.lessThanOrEqualTo(inviteBtn.snp.left).offset(-4)
make.left.equalTo(faceView.snp.right).offset(8)
make.centerY.equalTo(faceView.snp.centerY)
make.right.lessThanOrEqualTo(inviteBtn.snp.left).offset(-80)
}
lineView.backgroundColor = .fus_line()
......@@ -383,31 +389,12 @@ class FUSPKControlSearchPlayerPlayerListCell: UITableViewCell {
let isVip = model.vip
var level = model.level
self.nicknameLabel.textColor = .fus_textColorRich()
if isVip, let levelModel = FUSSwiftCacheDataShare.share.fus_levelModel(level: level) {
self.nicknameLabel.textColor = .init(hex: levelModel.color)
richImageView.setWebImageWithSubURLString(levelModel.icon)
richImageView.isHidden = false
nicknameLabel.snp.remakeConstraints { make in
make.left.equalTo(richImageView.snp.right).offset(6)
make.centerY.equalToSuperview()
make.right.lessThanOrEqualTo(inviteBtn.snp.left).offset(-4)
}
}else {
richImageView.isHidden = true
level = 0
nicknameLabel.snp.remakeConstraints { make in
make.left.equalTo(faceView.snp.right).offset(8)
make.centerY.equalToSuperview()
make.right.lessThanOrEqualTo(inviteBtn.snp.left).offset(-4)
}
if isVip == false {
level = -1
}
nicknameLabel.layoutIfNeeded()
self.faceView.fus_setupIcon(withFacePath: model.face, level: level)
self.richImageView.image = .fus_image(withLevel: level)
self.faceView.setWebImageWithSubURLString(model.face)
self.nicknameLabel.text = model.nickname
}
}
......
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