Commit d6550f93 by pidan

1、适配iOS 26

2、fixed 上麦断断续续的问题
3、UI修改
parent 35b46755
Showing with 147 additions and 47 deletions
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
"scale" : "1x" "scale" : "1x"
}, },
{ {
"filename" : "square_holder4_500.png", "filename" : "20250919-161516.png",
"idiom" : "universal", "idiom" : "universal",
"scale" : "2x" "scale" : "2x"
}, },
......
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
"scale" : "1x" "scale" : "1x"
}, },
{ {
"filename" : "square_holder4_500.png", "filename" : "20250919-161516.png",
"idiom" : "universal", "idiom" : "universal",
"scale" : "2x" "scale" : "2x"
}, },
......
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
"scale" : "1x" "scale" : "1x"
}, },
{ {
"filename" : "square_holder4_500.png", "filename" : "20250919-161516.png",
"idiom" : "universal", "idiom" : "universal",
"scale" : "2x" "scale" : "2x"
}, },
......
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
"scale" : "1x" "scale" : "1x"
}, },
{ {
"filename" : "square_holder4_500.png", "filename" : "20250919-161516.png",
"idiom" : "universal", "idiom" : "universal",
"scale" : "2x" "scale" : "2x"
}, },
......
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
"scale" : "1x" "scale" : "1x"
}, },
{ {
"filename" : "square_holder4_500.png", "filename" : "20250919-161516.png",
"idiom" : "universal", "idiom" : "universal",
"scale" : "2x" "scale" : "2x"
}, },
......
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
"scale" : "1x" "scale" : "1x"
}, },
{ {
"filename" : "square_holder4_500.png", "filename" : "20250919-161516.png",
"idiom" : "universal", "idiom" : "universal",
"scale" : "2x" "scale" : "2x"
}, },
......
...@@ -3204,3 +3204,4 @@ ...@@ -3204,3 +3204,4 @@
"请联系您的邀请人获取邀请码" = "请联系您的邀请人获取邀请码"; "请联系您的邀请人获取邀请码" = "请联系您的邀请人获取邀请码";
"%zd 人" = "%zd 人";
...@@ -3204,3 +3204,5 @@ ...@@ -3204,3 +3204,5 @@
"请联系您的邀请人获取邀请码" = "請聯繫您的邀請人獲取邀請碼"; "请联系您的邀请人获取邀请码" = "請聯繫您的邀請人獲取邀請碼";
"%zd 人" = "%zd 人";
...@@ -3204,3 +3204,4 @@ ...@@ -3204,3 +3204,4 @@
"请联系您的邀请人获取邀请码" = "Please contact your inviter to obtain the invitation code"; "请联系您的邀请人获取邀请码" = "Please contact your inviter to obtain the invitation code";
"%zd 人" = "%zd Players";
...@@ -3182,3 +3182,4 @@ ...@@ -3182,3 +3182,4 @@
"请联系您的邀请人获取邀请码" = "招待コードを取得するには、招待者に連絡してください。"; "请联系您的邀请人获取邀请码" = "招待コードを取得するには、招待者に連絡してください。";
"%zd 人" = "%zd Players";
...@@ -3176,3 +3176,4 @@ ...@@ -3176,3 +3176,4 @@
"请联系您的邀请人获取邀请码" = "กรุณาติดต่อผู้เชิญของคุณเพื่อรับรหัสเชิญ"; "请联系您的邀请人获取邀请码" = "กรุณาติดต่อผู้เชิญของคุณเพื่อรับรหัสเชิญ";
"%zd 人" = "%zd Players";
...@@ -3181,3 +3181,5 @@ ...@@ -3181,3 +3181,5 @@
"扫描邀请码QRCode图片完成绑定" = "Quét mã mời QRCode hình ảnh để hoàn tất việc đóng sách"; "扫描邀请码QRCode图片完成绑定" = "Quét mã mời QRCode hình ảnh để hoàn tất việc đóng sách";
"请联系您的邀请人获取邀请码" = "Vui lòng liên hệ với người mời để lấy mã mời"; "请联系您的邀请人获取邀请码" = "Vui lòng liên hệ với người mời để lấy mã mời";
"%zd 人" = "%zd Players";
...@@ -224,10 +224,10 @@ ...@@ -224,10 +224,10 @@
__weak typeof(self) weakSelf = self; __weak typeof(self) weakSelf = self;
self.engine.statusChangedBlock = ^(LiveStreamSessionState state, LiveStreamErrorCode errCode) { self.engine.statusChangedBlock = ^(LiveStreamSessionState state, LiveStreamErrorCode errCode) {
if (state == LiveStreamSessionStateStarted) { // if (state == LiveStreamSessionStateStarted) {
weakSelf.engine.liveSession.echoCancellationEnabled = YES; // weakSelf.engine.liveSession.echoCancellationEnabled = YES;
[weakSelf.engine setEchoCancellationEnabled:YES]; // [weakSelf.engine setEchoCancellationEnabled:YES];
} // }
if (weakSelf.completionHandler) { if (weakSelf.completionHandler) {
weakSelf.completionHandler((FUSStreamSessionState)state); weakSelf.completionHandler((FUSStreamSessionState)state);
......
...@@ -124,11 +124,13 @@ typedef id<FUSVideoPlayerProtocal> FUSStreamPlayer; ...@@ -124,11 +124,13 @@ typedef id<FUSVideoPlayerProtocal> FUSStreamPlayer;
case AVAudioSessionSilenceSecondaryAudioHintTypeBegin: case AVAudioSessionSilenceSecondaryAudioHintTypeBegin:
break; break;
case AVAudioSessionSilenceSecondaryAudioHintTypeEnd: case AVAudioSessionSilenceSecondaryAudioHintTypeEnd: {
[[AVAudioSession sharedInstance] setCategory:AVAudioSessionCategoryPlayback
error:nil]; AVAudioSessionCategoryOptions categoryOptions = AVAudioSessionCategoryOptionMixWithOthers | AVAudioSessionCategoryOptionAllowBluetooth | AVAudioSessionCategoryOptionDefaultToSpeaker | AVAudioSessionCategoryOptionAllowBluetoothA2DP;
[[AVAudioSession sharedInstance] setCategory:AVAudioSessionCategoryPlayback withOptions:categoryOptions error:nil];
[[AVAudioSession sharedInstance] setActive:YES error:nil]; [[AVAudioSession sharedInstance] setActive:YES error:nil];
break; break;
}
} }
} }
......
...@@ -353,11 +353,13 @@ NSString * const kStreamRTCDidOfflineNotification = @"kStreamRTCDidOfflineNotifi ...@@ -353,11 +353,13 @@ NSString * const kStreamRTCDidOfflineNotification = @"kStreamRTCDidOfflineNotifi
self.streamType = FUSStreamTypeRTC; self.streamType = FUSStreamTypeRTC;
FUSLogVerbose(@"FUSStreamPushView:开始加入频道"); FUSLogVerbose(@"FUSStreamPushView:开始加入频道");
[[AVAudioSession sharedInstance] setCategory:AVAudioSessionCategoryPlayAndRecord error:nil];
[self.captureHelper fus_stopStreamPush];
[self.captureHelper fus_pauseAudioCapture];
// 加入频道 // 加入频道
int code = [self.agoraEngine joinChannelByToken:nil channelId:channelId info:@"" uid:FUSConfig.sharedInstanced.userConfigs.uid.integerValue joinSuccess:^(NSString * _Nonnull channel, NSUInteger uid, NSInteger elapsed) { int code = [self.agoraEngine joinChannelByToken:nil channelId:channelId info:@"" uid:FUSConfig.sharedInstanced.userConfigs.uid.integerValue joinSuccess:^(NSString * _Nonnull channel, NSUInteger uid, NSInteger elapsed) {
[[AVAudioSession sharedInstance] setCategory:AVAudioSessionCategoryPlayAndRecord error:nil];
// 推流到自己的 CDN v6.3改为和安卓一样使用旁路推流 // 推流到自己的 CDN v6.3改为和安卓一样使用旁路推流
[FUSDeviceHelper fus_checkOldIPhoneDeviceHandler:^(BOOL oldDev) { [FUSDeviceHelper fus_checkOldIPhoneDeviceHandler:^(BOOL oldDev) {
if (oldDev) { if (oldDev) {
...@@ -414,12 +416,18 @@ NSString * const kStreamRTCDidOfflineNotification = @"kStreamRTCDidOfflineNotifi ...@@ -414,12 +416,18 @@ NSString * const kStreamRTCDidOfflineNotification = @"kStreamRTCDidOfflineNotifi
[_agoraOtherPreview removeFromSuperview]; [_agoraOtherPreview removeFromSuperview];
_agoraOtherPreview = nil; _agoraOtherPreview = nil;
_agoraOtherCanvas = nil; _agoraOtherCanvas = nil;
[UIView animateWithDuration:0.15 animations:^{
self.localPreviewFrame = UIView.fus_screenFrame;
}];
if (!_agoraEngine) { if (!_agoraEngine) {
return; return;
} }
// [[NSNotificationCenter defaultCenter] removeObserver:self]; // [[NSNotificationCenter defaultCenter] removeObserver:self];
__weak typeof(self) weakSelf = self;
int code = [_agoraEngine leaveChannel:^(AgoraChannelStats * _Nonnull stat) { int code = [_agoraEngine leaveChannel:^(AgoraChannelStats * _Nonnull stat) {
[FUSDeviceHelper fus_checkOldIPhoneDeviceHandler:^(BOOL oldDev) { [FUSDeviceHelper fus_checkOldIPhoneDeviceHandler:^(BOOL oldDev) {
...@@ -427,8 +435,11 @@ NSString * const kStreamRTCDidOfflineNotification = @"kStreamRTCDidOfflineNotifi ...@@ -427,8 +435,11 @@ NSString * const kStreamRTCDidOfflineNotification = @"kStreamRTCDidOfflineNotifi
if (oldDev && FUSConfig.sharedInstanced.liveConfigs.isAnchor) { if (oldDev && FUSConfig.sharedInstanced.liveConfigs.isAnchor) {
// 移除旁路推流 // 移除旁路推流
[self.agoraEngine stopRtmpStream:self.streamUrl]; [weakSelf.agoraEngine stopRtmpStream:weakSelf.streamUrl];
[self.captureHelper fus_restartStreamPush]; [weakSelf.captureHelper fus_resumeAudioCapture];
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0.5 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
[weakSelf.captureHelper fus_restartStreamPush];
});
} }
}]; }];
......
...@@ -110,7 +110,8 @@ ...@@ -110,7 +110,8 @@
if (self.liveManager) { if (self.liveManager) {
// 开始播放 // 开始播放
[self.liveManager play]; [self.liveManager play];
[[AVAudioSession sharedInstance] setCategory:AVAudioSessionCategoryPlayback error:nil]; AVAudioSessionCategoryOptions categoryOptions = AVAudioSessionCategoryOptionMixWithOthers | AVAudioSessionCategoryOptionAllowBluetooth | AVAudioSessionCategoryOptionDefaultToSpeaker | AVAudioSessionCategoryOptionAllowBluetoothA2DP;
[[AVAudioSession sharedInstance] setCategory:AVAudioSessionCategoryPlayback withOptions:categoryOptions error:nil];
} else { } else {
[self fus_resetEngine]; [self fus_resetEngine];
} }
...@@ -210,7 +211,8 @@ ...@@ -210,7 +211,8 @@
if (self.liveManager) { if (self.liveManager) {
// 开始播放 // 开始播放
[self.liveManager play]; [self.liveManager play];
[[AVAudioSession sharedInstance] setCategory:AVAudioSessionCategoryPlayback error:nil]; AVAudioSessionCategoryOptions categoryOptions = AVAudioSessionCategoryOptionMixWithOthers | AVAudioSessionCategoryOptionAllowBluetooth | AVAudioSessionCategoryOptionDefaultToSpeaker | AVAudioSessionCategoryOptionAllowBluetoothA2DP;
[[AVAudioSession sharedInstance] setCategory:AVAudioSessionCategoryPlayback withOptions:categoryOptions error:nil];
} }
} }
...@@ -476,7 +478,8 @@ ...@@ -476,7 +478,8 @@
break; break;
case TVLPlayerPlaybackStatePlaying: case TVLPlayerPlaybackStatePlaying:
if ([AVAudioSession sharedInstance].category != AVAudioSessionCategoryPlayback) { if ([AVAudioSession sharedInstance].category != AVAudioSessionCategoryPlayback) {
[[AVAudioSession sharedInstance] setCategory:AVAudioSessionCategoryPlayback error:nil]; AVAudioSessionCategoryOptions categoryOptions = AVAudioSessionCategoryOptionMixWithOthers | AVAudioSessionCategoryOptionAllowBluetooth | AVAudioSessionCategoryOptionDefaultToSpeaker | AVAudioSessionCategoryOptionAllowBluetoothA2DP;
[[AVAudioSession sharedInstance] setCategory:AVAudioSessionCategoryPlayback withOptions:categoryOptions error:nil];
} }
self.playState = FUSVideoPlayerPlayStatePlaying; self.playState = FUSVideoPlayerPlayStatePlaying;
break; break;
......
...@@ -227,24 +227,27 @@ ...@@ -227,24 +227,27 @@
+(UIImage *)fus_liveGiftImage_normal{ +(UIImage *)fus_liveGiftImage_normal{
NSString *imgName = @"live_chat_icon_gift_"; NSString *imgName = @"live_chat_icon_gift_";
NSMutableArray *array = [FUSFoundationBundle sharedInstance].cacheImages[imgName]; NSMutableArray *array = [FUSFoundationBundle sharedInstance].cacheImages[imgName];
CGFloat frames = 15;
CGFloat fps = 15.0;
if (![NSArray isNull:array]) { if (![NSArray isNull:array]) {
return [UIImage animatedImageWithImages:array duration:(15 / 12.0) + 3.0]; /// 15帧,15帧/s
return [UIImage animatedImageWithImages:array duration:frames / fps + 1.0];
} }
NSMutableArray *imageArr = [NSMutableArray arrayWithCapacity:30]; NSMutableArray *imageArr = [NSMutableArray arrayWithCapacity:30];
for (int i = 1; i <= 15; i++) { for (int i = 0; i <= frames; i++) {
UIImage *image = [UIImage fus_ImageNamed:[NSString stringWithFormat:@"live_chat_icon_gift_%d", i]]; UIImage *image = [UIImage fus_ImageNamed:[NSString stringWithFormat:@"live_chat_icon_gift_%d", i]];
if (image) { if (image) {
[imageArr addObject:image]; [imageArr addObject:image];
} }
} }
for (int i = 0; i <= (3 * 12); i++) { for (int i = 0; i <= (3 * frames); i++) {
UIImage *image = [UIImage fus_ImageNamed:@"live_chat_icon_gift_15"]; UIImage *image = [UIImage fus_ImageNamed:@"live_chat_icon_gift_15"];
if (image) { if (image) {
[imageArr addObject:image]; [imageArr addObject:image];
} }
} }
[[FUSFoundationBundle sharedInstance].cacheImages setValue:imageArr forKey:imgName]; [[FUSFoundationBundle sharedInstance].cacheImages setValue:imageArr forKey:imgName];
return [UIImage animatedImageWithImages:imageArr duration:(15 / 12.0) + 3.0]; return [UIImage animatedImageWithImages:imageArr duration:frames / fps + 1.0];
} }
/// 首冲图标 /// 首冲图标
......
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "live_contribute_total_icon@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "live_contribute_total_icon@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
...@@ -215,7 +215,8 @@ static VELPictureInPictureController *vel_instance_pip = nil; ...@@ -215,7 +215,8 @@ static VELPictureInPictureController *vel_instance_pip = nil;
// 这部分代码,可根据自身业务需求进行配置 // 这部分代码,可根据自身业务需求进行配置
// 例如是否需要和别的 App 同时播放音频 // 例如是否需要和别的 App 同时播放音频
NSError *error = nil; NSError *error = nil;
[[AVAudioSession sharedInstance] setCategory:AVAudioSessionCategoryPlayback error:&error]; AVAudioSessionCategoryOptions categoryOptions = AVAudioSessionCategoryOptionMixWithOthers | AVAudioSessionCategoryOptionAllowBluetooth | AVAudioSessionCategoryOptionDefaultToSpeaker | AVAudioSessionCategoryOptionAllowBluetoothA2DP;
[[AVAudioSession sharedInstance] setCategory:AVAudioSessionCategoryPlayback withOptions:categoryOptions error:&error];
[[AVAudioSession sharedInstance] setActive:YES error:nil]; [[AVAudioSession sharedInstance] setActive:YES error:nil];
// if (error) { // if (error) {
// VELPipLog(LOG_TAG, @"set audio session playback error %@", error); // VELPipLog(LOG_TAG, @"set audio session playback error %@", error);
......
...@@ -371,14 +371,14 @@ ...@@ -371,14 +371,14 @@
case FUSLiveBottomToolTypeGift: case FUSLiveBottomToolTypeGift:
{ {
if (isSelect){ if (isSelect){
// image = [UIImage fus_liveGiftImage_normal]; image = [UIImage fus_liveGiftImage_normal];
image = [FUSShowRoomCenterBunble imageNamed:@"live_chat_icon_gift_type2"]; // image = [FUSShowRoomCenterBunble imageNamed:@"live_chat_icon_gift_type2"];
[self.giftBtn setImage:image forState:UIControlStateHighlighted]; [self.giftBtn setImage:image forState:UIControlStateHighlighted];
} }
else else
{ {
// image = [UIImage fus_liveGiftImage_normal]; image = [UIImage fus_liveGiftImage_normal];
image = [FUSShowRoomCenterBunble imageNamed:@"live_chat_icon_gift_type2"]; // image = [FUSShowRoomCenterBunble imageNamed:@"live_chat_icon_gift_type2"];
[self.giftBtn setImage:image forState:UIControlStateNormal]; [self.giftBtn setImage:image forState:UIControlStateNormal];
btn = self.giftBtn; btn = self.giftBtn;
......
...@@ -268,6 +268,11 @@ NSString * const kLiveLinkMicRoleDidChanged = @"linkMicRoleChange"; ...@@ -268,6 +268,11 @@ NSString * const kLiveLinkMicRoleDidChanged = @"linkMicRoleChange";
[self delayUpdateToSpeakerPlay]; [self delayUpdateToSpeakerPlay];
if([FUSLiveHelper shareInstance].liveRoomType != FUSRoomTypeLinkMic){
[self.captureHelper fus_stopStreamPush];
[self.captureHelper fus_pauseAudioCapture];
}
FUSLogDebug(@"pp===准备进入频道 %@", channelId); FUSLogDebug(@"pp===准备进入频道 %@", channelId);
__weak typeof(self) weakSelf = self; __weak typeof(self) weakSelf = self;
int code = [self.agoraEngine joinChannelByToken:nil channelId:channelId info:@"" uid:uid joinSuccess:^(NSString * _Nonnull channel, NSUInteger uid, NSInteger elapsed) { int code = [self.agoraEngine joinChannelByToken:nil channelId:channelId info:@"" uid:uid joinSuccess:^(NSString * _Nonnull channel, NSUInteger uid, NSInteger elapsed) {
...@@ -278,7 +283,8 @@ NSString * const kLiveLinkMicRoleDidChanged = @"linkMicRoleChange"; ...@@ -278,7 +283,8 @@ NSString * const kLiveLinkMicRoleDidChanged = @"linkMicRoleChange";
if ([FUSLiveHelper shareInstance].liveType == FUSLiveTypeAudience) { if ([FUSLiveHelper shareInstance].liveType == FUSLiveTypeAudience) {
}else if([FUSLiveHelper shareInstance].liveRoomType != FUSRoomTypeLinkMic){ }else if([FUSLiveHelper shareInstance].liveRoomType != FUSRoomTypeLinkMic){
[weakSelf.captureHelper fus_stopStreamPush]; // [weakSelf.captureHelper fus_stopStreamPush];
// [weakSelf.captureHelper fus_pauseAudioCapture];
[weakSelf.agoraEngine startRtmpStreamWithoutTranscoding:FUSLiveHelper.shareInstance.streamView.pushView.streamUrl]; [weakSelf.agoraEngine startRtmpStreamWithoutTranscoding:FUSLiveHelper.shareInstance.streamView.pushView.streamUrl];
} }
...@@ -372,11 +378,16 @@ NSString * const kLiveLinkMicRoleDidChanged = @"linkMicRoleChange"; ...@@ -372,11 +378,16 @@ NSString * const kLiveLinkMicRoleDidChanged = @"linkMicRoleChange";
dispatch_async(dispatch_get_main_queue(), ^{ dispatch_async(dispatch_get_main_queue(), ^{
if ([FUSLiveHelper shareInstance].liveType == FUSLiveTypeAnchor) { if ([FUSLiveHelper shareInstance].liveType == FUSLiveTypeAnchor) {
[weakSelf.captureHelper fus_restartStreamPush];
[weakSelf.agoraEngine stopRtmpStream:[FUSLiveHelper shareInstance].streamView.pushView.streamUrl]; [weakSelf.agoraEngine stopRtmpStream:[FUSLiveHelper shareInstance].streamView.pushView.streamUrl];
weakSelf.captureHelper.videoFrameCallBackHandler = nil; weakSelf.captureHelper.videoFrameCallBackHandler = nil;
[weakSelf.agoraEngine setVideoFrameDelegate:nil]; [weakSelf.agoraEngine setVideoFrameDelegate:nil];
[weakSelf.captureHelper fus_resumeAudioCapture];
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0.5 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
[weakSelf.captureHelper fus_restartStreamPush];
});
} else if ([FUSLiveHelper shareInstance].liveType == FUSLiveTypeAudience && oldRoomType == FUSRoomTypeVideoLinkMic) { } else if ([FUSLiveHelper shareInstance].liveType == FUSLiveTypeAudience && oldRoomType == FUSRoomTypeVideoLinkMic) {
[weakSelf.agoraEngine setVideoFrameDelegate:nil]; [weakSelf.agoraEngine setVideoFrameDelegate:nil];
......
...@@ -21,10 +21,16 @@ ...@@ -21,10 +21,16 @@
@property (nonatomic, strong) UIButton *titleBtn; @property (nonatomic, strong) UIButton *titleBtn;
@property (nonatomic, strong) UIImageView *totalUserIconImageView;
@property (nonatomic, strong) UILabel *totalUserLabel;
@property (nonatomic, strong) UIButton *closeBtn; @property (nonatomic, strong) UIButton *closeBtn;
@property (nonatomic, strong) UITableView *tableView; @property (nonatomic, strong) UITableView *tableView;
@property (nonatomic, strong) NSMutableArray<FUSShowRoomUserContributeModel *> *dataList; @property (nonatomic, strong) NSMutableArray<FUSShowRoomUserContributeModel *> *dataList;
@property (nonatomic, strong) NSMutableDictionary<NSString *, FUSShowRoomUserContributeModel *> *userDict; @property (nonatomic, strong) NSMutableDictionary<NSString *, FUSShowRoomUserContributeModel *> *userDict;
...@@ -78,6 +84,22 @@ ...@@ -78,6 +84,22 @@
self.titleBtn.centerY = self.closeBtn.centerY; self.titleBtn.centerY = self.closeBtn.centerY;
[self.contentView addSubview:self.titleBtn]; [self.contentView addSubview:self.titleBtn];
self.totalUserIconImageView = [[UIImageView alloc] initWithFrame:CGRectMake(0, 0, 10, 10)];
self.totalUserIconImageView.image = [FUSShowRoomCenterBunble imageNamed:@"live_contribute_total_icon"];
self.totalUserIconImageView.contentMode = UIViewContentModeScaleAspectFit;
[self.contentView addSubview:self.totalUserIconImageView];
self.totalUserLabel = [[UILabel alloc] init];
self.totalUserLabel.font = [UIFont fus_themeMediumFont:11];
self.totalUserLabel.textColor = UIColor.fus_textColorRich;
[self.contentView addSubview:self.totalUserLabel];
self.totalUserIconImageView.x = self.titleBtn.right + 13;
self.totalUserIconImageView.centerY = self.titleBtn.centerY;
self.totalUserLabel.x = self.totalUserIconImageView.right + 5;
self.totalUserLabel.centerY = self.totalUserIconImageView.centerY;
UIView *lineView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, 10, 4)]; UIView *lineView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, 10, 4)];
lineView.backgroundColor = UIColor.fus_textColorRich; lineView.backgroundColor = UIColor.fus_textColorRich;
lineView.layer.cornerRadius = 2; lineView.layer.cornerRadius = 2;
...@@ -167,8 +189,12 @@ ...@@ -167,8 +189,12 @@
NSArray *dataList = dataDict[@"dataList"]; NSArray *dataList = dataDict[@"dataList"];
NSInteger allTotal = [dataDict[@"allTotal"] integerValue]; NSInteger allTotal = [dataDict[@"allTotal"] integerValue];
self.totalUserLabel.text = [NSString stringWithFormat:@"%zd 人",allTotal];
[self.totalUserLabel sizeToFit];
self.totalUserLabel.centerY = self.totalUserIconImageView.centerY;
NSInteger page = [dataDict[@"page"] integerValue]; NSInteger page = [dataDict[@"page"] integerValue];
NSInteger pageSize = [dataDict[@"pageSize"] integerValue]; NSInteger pageSize = [dataDict[@"pageSize"] integerValue];
......
...@@ -48,7 +48,7 @@ import RxSwift ...@@ -48,7 +48,7 @@ import RxSwift
var password:String = "" var password:String = ""
var isAudience:Bool = false var isAudience:Bool = false
let contentViewHeight = 228 + UIView.fus_SafeBottom() var contentViewHeight = 228 + UIView.fus_SafeBottom()
let contentView = FUSPanGestureAlertView(frame: CGRectMake(0, 0, UIView.fus_screenW(), 228)) let contentView = FUSPanGestureAlertView(frame: CGRectMake(0, 0, UIView.fus_screenW(), 228))
let titleLabel = UILabel() let titleLabel = UILabel()
let passwordView = FUSPinCodeInputView(frame: .init(x: 0, y: 0, width: 240, height: 52)) let passwordView = FUSPinCodeInputView(frame: .init(x: 0, y: 0, width: 240, height: 52))
...@@ -68,6 +68,11 @@ import RxSwift ...@@ -68,6 +68,11 @@ import RxSwift
make.edges.equalToSuperview() make.edges.equalToSuperview()
} }
/// 用户端多了一个私信要密码的按钮
if isAudience {
contentViewHeight += 14
}
contentView.frame = CGRectMake(0, UIView.fus_screenH(), UIView.fus_screenW(), contentViewHeight) contentView.frame = CGRectMake(0, UIView.fus_screenH(), UIView.fus_screenW(), contentViewHeight)
contentView.backgroundColor = .fus_appBG() contentView.backgroundColor = .fus_appBG()
contentView.addRoundedCorners(UIRectCorner(rawValue: UIRectCorner(rawValue: UIRectCorner.topRight.rawValue | UIRectCorner.topLeft.rawValue).rawValue), withRadii: CGSizeMake(14, 14)) contentView.addRoundedCorners(UIRectCorner(rawValue: UIRectCorner(rawValue: UIRectCorner.topRight.rawValue | UIRectCorner.topLeft.rawValue).rawValue), withRadii: CGSizeMake(14, 14))
...@@ -123,22 +128,30 @@ import RxSwift ...@@ -123,22 +128,30 @@ import RxSwift
self.submitBtn.setTitle(.fus_localString("打开"), for: .normal) self.submitBtn.setTitle(.fus_localString("打开"), for: .normal)
let chatBtn = UIButton(type: .custom) let chatBtn = UIButton(type: .custom)
// 设置带下划线的文字 // // 设置带下划线的文字
let attributedTitle = NSAttributedString( // let attributedTitle = NSAttributedString(
string: .fus_localString("私信问密码"), // string: .fus_localString("私信问密码"),
attributes: [ // attributes: [
.foregroundColor: UIColor.fus_themeColorOnWhiteBg() ?? .black, // .foregroundColor: UIColor.fus_themeColorOnWhiteBg() ?? .black,
.underlineStyle: NSUnderlineStyle.single.rawValue, // .underlineStyle: NSUnderlineStyle.single.rawValue,
.font: UIFont.fus_themeFont(13) ?? .systemFont(ofSize: 13) // .font: UIFont.fus_themeFont(13) ?? .systemFont(ofSize: 13)
] // ]
) // )
chatBtn.setAttributedTitle(attributedTitle, for: .normal) // chatBtn.setAttributedTitle(attributedTitle, for: .normal)
chatBtn.layer.cornerRadius = 38.0 / 2.0
chatBtn.backgroundColor = .fus_line()
chatBtn.setTitle(.fus_localString("私信问密码"), for: .normal)
chatBtn.titleLabel?.font = .fus_themeFont(14)
chatBtn.setTitleColor(.fus_textColorRich(), for: .normal)
contentView.addSubview(chatBtn) contentView.addSubview(chatBtn)
chatBtn.snp.makeConstraints { make in chatBtn.snp.makeConstraints { make in
make.right.equalToSuperview().offset(-16) make.centerX.equalToSuperview()
make.top.equalToSuperview().offset(8) make.width.equalToSuperview().multipliedBy(205.0 / 375.0)
make.height.equalTo(30) make.height.equalTo(38)
make.bottom.equalTo(self.submitBtn.snp.top).offset(-8)
} }
......
This source diff could not be displayed because it is too large. You can view the blob instead.
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