Commit c1d55a74 by ludi

修复一些bug,把直播间下面的工具栏变为可滚动

parent 452c13d0
...@@ -26,6 +26,9 @@ ...@@ -26,6 +26,9 @@
@interface FUSLiveBottomToolView ()<FUSLiveBottomToolSubViewDelegate> @interface FUSLiveBottomToolView ()<FUSLiveBottomToolSubViewDelegate>
/// 容器的View
@property (nonatomic, strong) UIScrollView *contentView;
// 是主播类型、观众类型,OBS类型 // 是主播类型、观众类型,OBS类型
@property (nonatomic, assign) FUSLiveBottomViewType viewType; @property (nonatomic, assign) FUSLiveBottomViewType viewType;
...@@ -75,7 +78,7 @@ ...@@ -75,7 +78,7 @@
@property (nonatomic, strong) UIButton *beautyBtn; @property (nonatomic, strong) UIButton *beautyBtn;
@property (nonatomic, strong) UIButton *giftBtn; @property (nonatomic, strong) FUSLiveBottomToolCustomImageSizeButton *giftBtn;
/// 礼物引导图片 /// 礼物引导图片
@property (nonatomic, strong) YYAnimatedImageView *giftGuideImageView; @property (nonatomic, strong) YYAnimatedImageView *giftGuideImageView;
...@@ -114,6 +117,7 @@ ...@@ -114,6 +117,7 @@
self = [super initWithFrame:frame]; self = [super initWithFrame:frame];
if (self) { if (self) {
[self fus_setupContentViewIfNeeded];
_allBtnTypes = [NSMutableArray arrayWithArray:bottomTypes]; _allBtnTypes = [NSMutableArray arrayWithArray:bottomTypes];
[self initBtnsWithTypes:_allBtnTypes]; [self initBtnsWithTypes:_allBtnTypes];
...@@ -138,6 +142,7 @@ ...@@ -138,6 +142,7 @@
BOOL isHaveGiftBtn = [[[NSUserDefaults standardUserDefaults] objectForKey:FUSLiveUDKeys.fus_LIVE_HOST_GIFT_VIEW_SWITCH] boolValue]; BOOL isHaveGiftBtn = [[[NSUserDefaults standardUserDefaults] objectForKey:FUSLiveUDKeys.fus_LIVE_HOST_GIFT_VIEW_SWITCH] boolValue];
if (self) { if (self) {
[self fus_setupContentViewIfNeeded];
if (viewType == FUSLiveBottomViewTypeHost) { if (viewType == FUSLiveBottomViewTypeHost) {
if ([FUSLiveHelper shareInstance].liveRoomType == FUSRoomTypeLinkMic) { if ([FUSLiveHelper shareInstance].liveRoomType == FUSRoomTypeLinkMic) {
_allBtnTypes = [NSMutableArray arrayWithArray:@[@(FUSLiveBottomToolTypeTool), _allBtnTypes = [NSMutableArray arrayWithArray:@[@(FUSLiveBottomToolTypeTool),
...@@ -184,6 +189,25 @@ ...@@ -184,6 +189,25 @@
return self; return self;
} }
- (void)fus_setupContentViewIfNeeded {
if (_contentView) {
return;
}
self.contentView = [[UIScrollView alloc] initWithFrame:self.bounds];
self.contentView.contentSize = self.size;
self.contentView.clipsToBounds = YES;
self.contentView.pagingEnabled = YES;
self.contentView.bounces = NO;
self.contentView.scrollEnabled = YES;
self.contentView.showsVerticalScrollIndicator = NO;
self.contentView.showsHorizontalScrollIndicator = NO;
self.contentView.backgroundColor = [UIColor clearColor];
[self addSubview:self.contentView];
}
- (void)fus_changeToLinkMicMode{ - (void)fus_changeToLinkMicMode{
if (self.viewType == FUSLiveBottomViewTypeHost) { if (self.viewType == FUSLiveBottomViewTypeHost) {
...@@ -208,6 +232,7 @@ ...@@ -208,6 +232,7 @@
[normalBtn sizeToFit]; [normalBtn sizeToFit];
normalBtn.frame = CGRectMake(0, 0, normalBtn.width, 0); normalBtn.frame = CGRectMake(0, 0, normalBtn.width, 0);
[normalBtn setImage:[FUSShowRoomCenterBunble imageNamed:@"live_chat_icon_message"] forState:UIControlStateNormal]; [normalBtn setImage:[FUSShowRoomCenterBunble imageNamed:@"live_chat_icon_message"] forState:UIControlStateNormal];
normalBtn.titleLabel.lineBreakMode = NSLineBreakByTruncatingTail;
normalBtn.imageEdgeInsets = UIEdgeInsetsMake(0, 8, 0, -8); normalBtn.imageEdgeInsets = UIEdgeInsetsMake(0, 8, 0, -8);
normalBtn.titleEdgeInsets = UIEdgeInsetsMake(0, 12, 0, -8); normalBtn.titleEdgeInsets = UIEdgeInsetsMake(0, 12, 0, -8);
normalBtn.titleLabel.minimumScaleFactor = 0.5; normalBtn.titleLabel.minimumScaleFactor = 0.5;
...@@ -280,24 +305,113 @@ ...@@ -280,24 +305,113 @@
/// 按钮重新布局 /// 按钮重新布局
- (void)fus_layoutBtnFrame{ //- (void)fus_layoutBtnFrame{
//
// [self fus_updateDivisionBtnType];
// // 按钮大小不变
// CGFloat wholeBtnW = 0;
// for (UIButton *btn in _allBtns) {
// CGFloat w = BTN_WIDTH;
// if (btn.width > BTN_WIDTH) {
// w = btn.width;
// }
//
// wholeBtnW += (w + BTN_MARGIN);
// }
// CGFloat btnW = BTN_WIDTH;
//
// // 剩余空白地方
// CGFloat leftW = UIView.fus_screenW - wholeBtnW;
// if (leftW < 0) {
// }
//
// CGFloat lastMaxX = BTN_MARGIN;
// CGFloat bottomY = 0;
// for (UIButton *btn in _allBtns) {
// CGFloat width = btn.width > btnW?btn.width:btnW;
//
// btn.frame = CGRectMake(lastMaxX, self.height/2.0 - btnW/2.0, width, btnW);
//
// if (btn.tag == FUSLiveBottomToolTypeFirstCharge) { // 首充的图片尺寸有点奇葩,不能随便插入,特殊处理
// btn.x = lastMaxX - 18;
// btn.height = width;
// btn.centerY = self.height/2.0;
// }
//
// if (btn.tag == _divisionBtnType) {
// lastMaxX = lastMaxX + btn.width + leftW;
// }else{
// lastMaxX = lastMaxX + btn.width + BTN_MARGIN;
// }
//
// if (btn.tag == FUSLiveBottomToolTypeAudienceMessage) {
// btn.layer.cornerRadius = btn.height/2.0;
// btn.clipsToBounds = YES;
// }
//
// bottomY = CGRectGetMaxY(btn.frame);
// [self addSubview:btn];
// }
//}
/// 按钮重新布局
- (void)fus_layoutBtnFrame {
[self fus_updateDivisionBtnType]; [self fus_updateDivisionBtnType];
// 按钮大小不变 // 按钮大小不变
CGFloat wholeBtnW = 0; CGFloat wholeBtnW = 0;
UIButton *audienceMsgBtn = nil;
for (UIButton *btn in _allBtns) { for (UIButton *btn in _allBtns) {
CGFloat w = BTN_WIDTH; CGFloat w = BTN_WIDTH;
if (btn.width > BTN_WIDTH) { if (btn.width > BTN_WIDTH && btn.tag != FUSLiveBottomToolTypeFirstCharge) {
w = btn.width; w = btn.width;
} }
if (btn.tag == FUSLiveBottomToolTypeAudienceMessage) {
audienceMsgBtn = btn;
} else {
wholeBtnW += (w + BTN_MARGIN); wholeBtnW += (w + BTN_MARGIN);
} }
CGFloat btnW = BTN_WIDTH; }
CGFloat btnW = BTN_WIDTH;
// 剩余空白地方 // 剩余空白地方
CGFloat leftW = UIView.fus_screenW - wholeBtnW; CGFloat leftW = [UIView fus_screenW] - wholeBtnW;
/// 如果存在关注的聊天按钮,在空间不足的情况下,要缩小聊天按钮
if (audienceMsgBtn != nil) {
// 还可以给 audienceMsgBtn的宽度
CGFloat leftToBtnWidth = leftW - BTN_MARGIN;
/// 如果剩余的大小已经比观众聊天按钮少了。则重置一下观众聊天按钮
if (leftToBtnWidth < audienceMsgBtn.width) {
if (leftToBtnWidth < BTN_WIDTH) {
audienceMsgBtn.width = BTN_WIDTH;
// [audienceMsgBtn setImage:[LiveRoomBundle imageNamed:@"live_chat_icon_message_host"] forState:UIControlStateNormal];
UIImage *btnImage = [FUSShowRoomCenterBunble imageNamed:@"live_chat_icon_message"];
[audienceMsgBtn setImage:btnImage forState:UIControlStateNormal];
[audienceMsgBtn setTitle:nil forState:UIControlStateNormal];
} else {
UIImage *btnImage = [FUSShowRoomCenterBunble imageNamed:@"live_chat_icon_message"];
NSString *titleStr = [NSString stringWithFormat:@" %@",[NSString fus_localString:@"和所有人聊天"]];
[audienceMsgBtn setImage:btnImage forState:UIControlStateNormal];
[audienceMsgBtn setTitle:titleStr forState:UIControlStateNormal];
audienceMsgBtn.width = leftToBtnWidth;
}
}
leftW = leftW - (audienceMsgBtn.width + BTN_MARGIN);
_inputChatGuideRippleView.frame = audienceMsgBtn.frame;
}
if (leftW < 0) { if (leftW < 0) {
self.contentView.contentSize = CGSizeMake(self.height, self.width - leftW);
self.contentView.scrollEnabled = YES;
leftW = 0;
} else {
self.contentView.contentSize = self.size;
self.contentView.scrollEnabled = NO;
} }
CGFloat lastMaxX = BTN_MARGIN; CGFloat lastMaxX = BTN_MARGIN;
...@@ -307,16 +421,20 @@ ...@@ -307,16 +421,20 @@
btn.frame = CGRectMake(lastMaxX, self.height/2.0 - btnW/2.0, width, btnW); btn.frame = CGRectMake(lastMaxX, self.height/2.0 - btnW/2.0, width, btnW);
CGFloat lastMaxXBtnWidth = btn.width;
if (btn.tag == FUSLiveBottomToolTypeFirstCharge) { // 首充的图片尺寸有点奇葩,不能随便插入,特殊处理 if (btn.tag == FUSLiveBottomToolTypeFirstCharge) { // 首充的图片尺寸有点奇葩,不能随便插入,特殊处理
btn.x = lastMaxX - 18; btn.x = lastMaxX - 18;
btn.height = width; btn.height = width;
btn.centerY = self.height/2.0; btn.centerY = self.height/2.0;
lastMaxXBtnWidth = BTN_WIDTH;
} }
if (btn.tag == _divisionBtnType) { if (btn.tag == _divisionBtnType) {
lastMaxX = lastMaxX + btn.width + leftW; lastMaxX = lastMaxX + lastMaxXBtnWidth + leftW;
}else{ }else{
lastMaxX = lastMaxX + btn.width + BTN_MARGIN; lastMaxX = lastMaxX + lastMaxXBtnWidth + BTN_MARGIN;
} }
if (btn.tag == FUSLiveBottomToolTypeAudienceMessage) { if (btn.tag == FUSLiveBottomToolTypeAudienceMessage) {
...@@ -325,8 +443,15 @@ ...@@ -325,8 +443,15 @@
} }
bottomY = CGRectGetMaxY(btn.frame); bottomY = CGRectGetMaxY(btn.frame);
[self addSubview:btn];
[self.contentView addSubview:btn];
} }
// if (_pkMatchingAnimationView != nil) {
// _pkMatchingAnimationView.frame = self.PKBtn.frame;
// }
// [self fus_setupMessageBoxBadgeHidden];
} }
#pragma mark - 设置按钮的图片, 新加的按钮要在这里添加按钮的图片 #pragma mark - 设置按钮的图片, 新加的按钮要在这里添加按钮的图片
...@@ -388,13 +513,15 @@ ...@@ -388,13 +513,15 @@
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];
self.giftBtn.customImageView.image = image;
} }
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];
self.giftBtn.customImageView.image = image;
btn = self.giftBtn; btn = self.giftBtn;
} }
...@@ -918,7 +1045,7 @@ ...@@ -918,7 +1045,7 @@
if (!_inputChatGuideRippleView) { if (!_inputChatGuideRippleView) {
_inputChatGuideRippleView = [[FUSUserGuideRippleView alloc] init]; _inputChatGuideRippleView = [[FUSUserGuideRippleView alloc] init];
_inputChatGuideRippleView.frame = [self fus_getBtnFrameWithToolType:FUSLiveBottomToolTypeAudienceMessage]; _inputChatGuideRippleView.frame = [self fus_getBtnFrameWithToolType:FUSLiveBottomToolTypeAudienceMessage];
[self addSubview:_inputChatGuideRippleView]; [self.contentView addSubview:_inputChatGuideRippleView];
} }
}else { }else {
self.giftGuideImageView.hidden = YES; self.giftGuideImageView.hidden = YES;
...@@ -1278,7 +1405,7 @@ ...@@ -1278,7 +1405,7 @@
[self fus_hideGiftMessageTipView]; [self fus_hideGiftMessageTipView];
self.giftMessageTipView = [[UIView alloc] init]; self.giftMessageTipView = [[UIView alloc] init];
[self addSubview:self.giftMessageTipView]; [self.contentView addSubview:self.giftMessageTipView];
UIImageView *bgImageView = [[UIImageView alloc] initWithImage:[FUSShowRoomCenterBunble imageNamed:@"live_receive_gift_message_tip_bg"]]; UIImageView *bgImageView = [[UIImageView alloc] initWithImage:[FUSShowRoomCenterBunble imageNamed:@"live_receive_gift_message_tip_bg"]];
bgImageView.contentMode = UIViewContentModeScaleToFill; bgImageView.contentMode = UIViewContentModeScaleToFill;
...@@ -1448,11 +1575,12 @@ ...@@ -1448,11 +1575,12 @@
return _beautyBtn; return _beautyBtn;
} }
- (UIButton *)giftBtn{ - (FUSLiveBottomToolCustomImageSizeButton *)giftBtn{
if (!_giftBtn) { if (!_giftBtn) {
_giftBtn = [UIButton buttonWithType:UIButtonTypeCustom]; _giftBtn = [FUSLiveBottomToolCustomImageSizeButton buttonWithType:UIButtonTypeCustom];
_giftBtn.tag = FUSLiveBottomToolTypeGift; _giftBtn.tag = FUSLiveBottomToolTypeGift;
[_giftBtn fus_setImageInset:-6];
if (!_giftGuideImageView) { if (!_giftGuideImageView) {
NSData *resourceData = [NSData dataWithContentsOfFile:[[FUSShowRoomCenterBunble bundle] pathForResource:@"live_bottom_tool_gift_guide_animate.webp" ofType:nil]]; NSData *resourceData = [NSData dataWithContentsOfFile:[[FUSShowRoomCenterBunble bundle] pathForResource:@"live_bottom_tool_gift_guide_animate.webp" ofType:nil]];
......
...@@ -25,3 +25,26 @@ import UIKit ...@@ -25,3 +25,26 @@ import UIKit
}() }()
} }
/// 可以让图片大,但是按钮小的按钮
@objc public class FUSLiveBottomToolCustomImageSizeButton: UIButton {
@objc public lazy var customImageView: UIImageView = {
let imageView = UIImageView()
imageView.isUserInteractionEnabled = false
self.addSubview(imageView)
imageView.snp.makeConstraints { make in
make.center.equalToSuperview()
make.size.equalToSuperview()
}
return imageView
}()
@objc public func fus_setImageInset(_ inset: CGFloat) {
self.customImageView.snp.remakeConstraints { make in
make.center.equalToSuperview()
make.size.equalToSuperview().inset(inset)
}
}
}
...@@ -13,18 +13,25 @@ class FUSPKScoreProgressView: FUSBaseView { ...@@ -13,18 +13,25 @@ class FUSPKScoreProgressView: FUSBaseView {
public var clickLeftSideHandler:((Bool) -> Void)? public var clickLeftSideHandler:((Bool) -> Void)?
let circleViewHeight: CGFloat = 36.0 * UIView.fus_screenW() / 375.0
let circleBlackBackgroundHeight: CGFloat = 42.0 * UIView.fus_screenW() / 375.0
let leftBtn = UIButton(type: .custom) let leftBtn = UIButton(type: .custom)
let leftBlackColorView = UIView()
let leftView = UIView() let leftView = UIView()
let leftScoreImageView = UIImageView(image: FUSShowRoomCenterBunble.imageNamed("live_pk_score_icon")) let leftScoreImageView = UIImageView(image: FUSShowRoomCenterBunble.imageNamed("live_pk_score_icon"))
let leftScoreLabel = UILabel() let leftScoreLabel = UILabel()
let leftProgress = UIView() let leftProgress = UIView()
let rightBtn = UIButton(type: .custom) let rightBtn = UIButton(type: .custom)
let rightBlackColorView = UIView()
let rightView = UIView() let rightView = UIView()
let rightScoreImageView = UIImageView(image: FUSShowRoomCenterBunble.imageNamed("live_pk_score_icon")) let rightScoreImageView = UIImageView(image: FUSShowRoomCenterBunble.imageNamed("live_pk_score_icon"))
let rightScoreLabel = UILabel() let rightScoreLabel = UILabel()
let rightProgress = UIView() let rightProgress = UIView()
let progressBlackColorView = UIView()
var redScoreIconAddAnimImage: UIImage? = FUSShowRoomCenterBunble.imageNamed("live_pk_score_icon_add_anim") var redScoreIconAddAnimImage: UIImage? = FUSShowRoomCenterBunble.imageNamed("live_pk_score_icon_add_anim")
var blueScoreIconAddAnimImage: UIImage? = FUSShowRoomCenterBunble.imageNamed("live_pk_score_icon_add_anim") var blueScoreIconAddAnimImage: UIImage? = FUSShowRoomCenterBunble.imageNamed("live_pk_score_icon_add_anim")
let lightImageView = UIImageView(image: FUSShowRoomCenterBunble.imageNamed("live_pk_progress_light_img")) let lightImageView = UIImageView(image: FUSShowRoomCenterBunble.imageNamed("live_pk_progress_light_img"))
...@@ -40,14 +47,25 @@ class FUSPKScoreProgressView: FUSBaseView { ...@@ -40,14 +47,25 @@ class FUSPKScoreProgressView: FUSBaseView {
self.backgroundColor = .clear self.backgroundColor = .clear
self.clipsToBounds = false self.clipsToBounds = false
self.leftBlackColorView.backgroundColor = .init(hex: "#111111")
self.leftBlackColorView.layer.cornerRadius = circleBlackBackgroundHeight / 2.0
self.addSubview(leftBlackColorView)
self.rightBlackColorView.backgroundColor = .init(hex: "#111111")
self.rightBlackColorView.layer.cornerRadius = circleBlackBackgroundHeight / 2.0
self.addSubview(rightBlackColorView)
self.progressBlackColorView.backgroundColor = .init(hex: "#111111")
self.addSubview(self.progressBlackColorView)
self.addSubview(self.leftProgress) self.addSubview(self.leftProgress)
self.addSubview(self.rightProgress) self.addSubview(self.rightProgress)
self.leftView.layer.cornerRadius = 18.0 * UIView.fus_screenW() / 375.0 self.leftView.layer.cornerRadius = circleViewHeight / 2.0
self.leftView.layer.masksToBounds = true self.leftView.layer.masksToBounds = true
self.addSubview(self.leftView) self.addSubview(self.leftView)
self.rightView.layer.cornerRadius = 18.0 * UIView.fus_screenW() / 375.0 self.rightView.layer.cornerRadius = circleViewHeight / 2.0
self.rightView.layer.masksToBounds = true self.rightView.layer.masksToBounds = true
self.addSubview(self.rightView) self.addSubview(self.rightView)
...@@ -91,7 +109,7 @@ class FUSPKScoreProgressView: FUSBaseView { ...@@ -91,7 +109,7 @@ class FUSPKScoreProgressView: FUSBaseView {
self.leftView.snp.makeConstraints { make in self.leftView.snp.makeConstraints { make in
make.left.equalToSuperview().offset(1) make.left.equalToSuperview().offset(1)
make.centerY.equalToSuperview() make.centerY.equalToSuperview()
make.height.equalTo(37.0 * UIView.fus_screenW() / 375.0) make.height.equalTo(circleViewHeight)
make.width.equalTo(self.leftView.snp.height) make.width.equalTo(self.leftView.snp.height)
} }
...@@ -110,7 +128,7 @@ class FUSPKScoreProgressView: FUSBaseView { ...@@ -110,7 +128,7 @@ class FUSPKScoreProgressView: FUSBaseView {
self.rightView.snp.makeConstraints { make in self.rightView.snp.makeConstraints { make in
make.right.equalToSuperview().offset(-1) make.right.equalToSuperview().offset(-1)
make.centerY.equalToSuperview() make.centerY.equalToSuperview()
make.height.equalTo(37.0 * UIView.fus_screenW() / 375.0) make.height.equalTo(circleViewHeight)
make.width.equalTo(self.leftView.snp.height) make.width.equalTo(self.leftView.snp.height)
} }
...@@ -163,6 +181,22 @@ class FUSPKScoreProgressView: FUSBaseView { ...@@ -163,6 +181,22 @@ class FUSPKScoreProgressView: FUSBaseView {
make.edges.equalToSuperview() make.edges.equalToSuperview()
} }
self.leftBlackColorView.snp.makeConstraints { make in
make.center.equalTo(self.leftView)
make.size.equalTo(CGSizeMake(self.circleBlackBackgroundHeight, self.circleBlackBackgroundHeight))
}
self.rightBlackColorView.snp.makeConstraints { make in
make.center.equalTo(self.rightView)
make.size.equalTo(CGSizeMake(self.circleBlackBackgroundHeight, self.circleBlackBackgroundHeight))
}
self.progressBlackColorView.snp.makeConstraints { make in
make.left.equalTo(self.leftView.snp.right).offset(-4)
make.right.equalTo(self.rightView.snp.left).offset(4)
make.centerY.equalToSuperview()
make.height.equalTo(23.0 * UIView.fus_screenW() / 375.0)
}
} }
override func layoutSubviews() { override func layoutSubviews() {
......
...@@ -31,10 +31,9 @@ class FUSPKUserContributionLogCell: UITableViewCell { ...@@ -31,10 +31,9 @@ class FUSPKUserContributionLogCell: UITableViewCell {
let bgView = UIView() let bgView = UIView()
let avatarTapBtn = UIButton(type: .custom) let avatarTapBtn = UIButton(type: .custom)
let faceView = FUSRichIconView(frame: CGRectMake(0, 0, 34, 34)) let faceView = UIImageView(frame: CGRectMake(0, 0, 30, 30))
let richImageView = UIImageView(frame: .init(x: 0, y: 0, width: 37, height: 14)) let richImageView = UIImageView(frame: .init(x: 0, y: 0, width: 37, height: 14))
let nicknameLabel = UILabel() let nicknameLabel = UILabel()
let noRichNickNameLabel = UILabel()
let hotNumLabel = UILabel() let hotNumLabel = UILabel()
let hotImageView = UIImageView() let hotImageView = UIImageView()
let plusLabel = UILabel() let plusLabel = UILabel()
...@@ -52,17 +51,19 @@ class FUSPKUserContributionLogCell: UITableViewCell { ...@@ -52,17 +51,19 @@ class FUSPKUserContributionLogCell: UITableViewCell {
let bgColorView = UIView() let bgColorView = UIView()
bgColorView.layer.cornerRadius = 12 bgColorView.layer.cornerRadius = 12
bgColorView.backgroundColor = .white.withAlphaComponent(0.08) bgColorView.backgroundColor = .init(hex: "#F0F0F0")
bgView.addSubview(bgColorView) bgView.addSubview(bgColorView)
bgColorView.snp.makeConstraints { make in bgColorView.snp.makeConstraints { make in
make.edges.equalToSuperview() make.edges.equalToSuperview()
} }
faceView.layer.cornerRadius = 30 / 2.0
faceView.layer.masksToBounds = true
bgView.addSubview(faceView) bgView.addSubview(faceView)
faceView.snp.makeConstraints { make in faceView.snp.makeConstraints { make in
make.left.equalTo(12) make.left.equalTo(12)
make.top.equalTo(6) make.top.equalTo(6)
make.size.equalTo(CGSizeMake(34, 34)) make.size.equalTo(CGSizeMake(30, 30))
} }
bgView.addSubview(avatarTapBtn) bgView.addSubview(avatarTapBtn)
...@@ -74,40 +75,30 @@ class FUSPKUserContributionLogCell: UITableViewCell { ...@@ -74,40 +75,30 @@ class FUSPKUserContributionLogCell: UITableViewCell {
}) })
.disposed(by: disposeBag) .disposed(by: disposeBag)
richImageView.contentMode = .scaleAspectFit
bgView.addSubview(richImageView)
richImageView.snp.makeConstraints { make in
make.left.equalTo(faceView.snp.right).offset(8)
make.centerY.equalTo(faceView.snp.centerY)
make.width.equalTo(37)
make.height.equalTo(14)
}
nicknameLabel.font = .fus_themeMediumFont(15) nicknameLabel.font = .fus_themeMediumFont(15)
nicknameLabel.textColor = .fus_textColorRich()
bgView.addSubview(nicknameLabel) bgView.addSubview(nicknameLabel)
nicknameLabel.snp.makeConstraints { make in nicknameLabel.snp.makeConstraints { make in
// make.left.equalTo(richImageView.snp.right).offset(6) // make.left.equalTo(richImageView.snp.right).offset(6)
make.left.equalTo(faceView.snp.right).offset(8 + 37 + 6) make.left.equalTo(faceView.snp.right).offset(8)
make.centerY.equalTo(richImageView.snp.centerY) make.centerY.equalTo(faceView.snp.centerY)
make.width.lessThanOrEqualTo(174) make.width.lessThanOrEqualTo(174)
} }
noRichNickNameLabel.isHidden = true richImageView.contentMode = .scaleAspectFit
noRichNickNameLabel.font = .fus_themeMediumFont(15) bgView.addSubview(richImageView)
bgView.addSubview(noRichNickNameLabel) richImageView.snp.makeConstraints { make in
noRichNickNameLabel.snp.makeConstraints { make in make.left.equalTo(nicknameLabel.snp.right).offset(2)
make.left.equalTo(faceView.snp.right).offset(8)
make.width.lessThanOrEqualTo(174)
make.centerY.equalTo(faceView.snp.centerY) make.centerY.equalTo(faceView.snp.centerY)
} }
hotNumLabel.font = .fus_themeMediumFont(15) hotNumLabel.font = .fus_themeMediumFont(15)
hotNumLabel.textColor = .white hotNumLabel.textColor = .fus_textColorRich()
hotNumLabel.text = "0" hotNumLabel.text = "0"
bgView.addSubview(hotNumLabel) bgView.addSubview(hotNumLabel)
hotNumLabel.snp.makeConstraints { make in hotNumLabel.snp.makeConstraints { make in
make.right.equalTo(-12) make.right.equalTo(-12)
make.centerY.equalTo(noRichNickNameLabel.snp.centerY) make.centerY.equalTo(nicknameLabel.snp.centerY)
} }
hotImageView.contentMode = .scaleAspectFit hotImageView.contentMode = .scaleAspectFit
...@@ -119,7 +110,7 @@ class FUSPKUserContributionLogCell: UITableViewCell { ...@@ -119,7 +110,7 @@ class FUSPKUserContributionLogCell: UITableViewCell {
} }
plusLabel.font = .fus_themeMediumFont(15) plusLabel.font = .fus_themeMediumFont(15)
plusLabel.textColor = .white plusLabel.textColor = .fus_textColorRich()
plusLabel.text = "+" plusLabel.text = "+"
bgView.addSubview(plusLabel) bgView.addSubview(plusLabel)
plusLabel.snp.makeConstraints { make in plusLabel.snp.makeConstraints { make in
...@@ -156,8 +147,6 @@ class FUSPKUserContributionLogCell: UITableViewCell { ...@@ -156,8 +147,6 @@ class FUSPKUserContributionLogCell: UITableViewCell {
func fus_setup(model: FUSVSIndexDevoteUserModel, icon: UIImage?) { func fus_setup(model: FUSVSIndexDevoteUserModel, icon: UIImage?) {
var level = model.level var level = model.level
self.nicknameLabel.textColor = .white
self.noRichNickNameLabel.textColor = .white
if model.inVip == 0 { if model.inVip == 0 {
level = 0 level = 0
...@@ -167,37 +156,9 @@ class FUSPKUserContributionLogCell: UITableViewCell { ...@@ -167,37 +156,9 @@ class FUSPKUserContributionLogCell: UITableViewCell {
level = -1 level = -1
} }
if let levelModel = FUSSwiftCacheDataShare.share.fus_levelModel(level: level) { self.faceView.setWebImageWithSubURLString(model.face)
self.nicknameLabel.textColor = .init(hex: levelModel.color) self.richImageView.image = .fus_image(withLevel: level)
self.noRichNickNameLabel.textColor = .init(hex: levelModel.color)
richImageView.setWebImageWithSubURLString(levelModel.icon)
}
if level > 0 {
richImageView.isHidden = false
nicknameLabel.isHidden = false
noRichNickNameLabel.isHidden = true
// nicknameLabel.snp.remakeConstraints { make in
//// make.left.equalTo(richImageView.snp.right).offset(6)
// make.left.equalTo(faceView.snp.right).offset(8 + 37 + 6)
// make.width.lessThanOrEqualTo(174)
// make.centerY.equalTo(faceView.snp.centerY)
// }
}
else {
richImageView.isHidden = true
nicknameLabel.isHidden = true
noRichNickNameLabel.isHidden = false
// nicknameLabel.snp.remakeConstraints { make in
// make.left.equalTo(faceView.snp.right).offset(8)
// make.width.lessThanOrEqualTo(174)
// make.centerY.equalTo(faceView.snp.centerY)
// }
}
self.faceView.fus_setupIcon(withFacePath: model.face, level: level)
self.nicknameLabel.text = model.nickname.removingPercentEncoding self.nicknameLabel.text = model.nickname.removingPercentEncoding
self.noRichNickNameLabel.text = model.nickname.removingPercentEncoding
self.hotNumLabel.text = "\(model.total)" self.hotNumLabel.text = "\(model.total)"
self.firstBloodImageView.isHidden = (model.firstblood == 0) self.firstBloodImageView.isHidden = (model.firstblood == 0)
......
...@@ -84,7 +84,7 @@ class FUSPKControlWebView: FUSPKControlSubBaseView { ...@@ -84,7 +84,7 @@ class FUSPKControlWebView: FUSPKControlSubBaseView {
make.alignment = .center make.alignment = .center
} }
make.append(.fus_localString("记录")) make.append(.fus_localString("记录"))
make.font(.fus_themeMediumFont(18)).textColor(.white) make.font(.fus_themeMediumFont(18)).textColor(.fus_textColorRich())
}) })
if let urlDict = FUSCacheDataShare.shareStore().settingInitDataModel.vsUrlConfig as? [String: Any], if let urlDict = FUSCacheDataShare.shareStore().settingInitDataModel.vsUrlConfig as? [String: Any],
let url = urlDict["url"] as? String { let url = urlDict["url"] as? String {
...@@ -105,7 +105,7 @@ class FUSPKControlWebView: FUSPKControlSubBaseView { ...@@ -105,7 +105,7 @@ class FUSPKControlWebView: FUSPKControlSubBaseView {
make.alignment = .center make.alignment = .center
} }
make.append(" " + .fus_localString("说明")) make.append(" " + .fus_localString("说明"))
make.font(.fus_themeMediumFont(18)).textColor(.white) make.font(.fus_themeMediumFont(18)).textColor(.fus_textColorRich())
}) })
if let urlDict = FUSCacheDataShare.shareStore().settingInitDataModel.vsUrlConfig as? [String: Any], if let urlDict = FUSCacheDataShare.shareStore().settingInitDataModel.vsUrlConfig as? [String: Any],
let url = urlDict["helpUrl"] as? String { let url = urlDict["helpUrl"] as? String {
...@@ -121,7 +121,7 @@ class FUSPKControlWebView: FUSPKControlSubBaseView { ...@@ -121,7 +121,7 @@ class FUSPKControlWebView: FUSPKControlSubBaseView {
make.alignment = .center make.alignment = .center
} }
make.append(.fus_localString("说明")) make.append(.fus_localString("说明"))
make.font(.fus_themeMediumFont(18)).textColor(.white) make.font(.fus_themeMediumFont(18)).textColor(.fus_textColorRich())
}) })
if let urlDict = FUSCacheDataShare.shareStore().settingInitDataModel.vsUrlConfig as? [String: Any], if let urlDict = FUSCacheDataShare.shareStore().settingInitDataModel.vsUrlConfig as? [String: Any],
let url = urlDict["helpUrl"] as? String { let url = urlDict["helpUrl"] as? String {
......
...@@ -195,7 +195,7 @@ class FUSPKUserContributionLogInLiveAlertView: FUSPKControlSubBaseView { ...@@ -195,7 +195,7 @@ class FUSPKUserContributionLogInLiveAlertView: FUSPKControlSubBaseView {
make.alignment = .center make.alignment = .center
} }
make.append(.fus_localString("按赞值记录")) make.append(.fus_localString("按赞值记录"))
make.font(.fus_themeMediumFont(18)).textColor(.white) make.font(.fus_themeMediumFont(18)).textColor(.fus_textColorRich())
}) })
} }
else if gamePlay == 104 { else if gamePlay == 104 {
...@@ -206,7 +206,7 @@ class FUSPKUserContributionLogInLiveAlertView: FUSPKControlSubBaseView { ...@@ -206,7 +206,7 @@ class FUSPKUserContributionLogInLiveAlertView: FUSPKControlSubBaseView {
make.alignment = .center make.alignment = .center
} }
make.append(.fus_localString("礼物值记录")) make.append(.fus_localString("礼物值记录"))
make.font(.fus_themeMediumFont(18)).textColor(.white) make.font(.fus_themeMediumFont(18)).textColor(.fus_textColorRich())
}) })
} }
else { else {
...@@ -217,7 +217,7 @@ class FUSPKUserContributionLogInLiveAlertView: FUSPKControlSubBaseView { ...@@ -217,7 +217,7 @@ class FUSPKUserContributionLogInLiveAlertView: FUSPKControlSubBaseView {
make.alignment = .center make.alignment = .center
} }
make.append(.fus_localString("人气值记录")) make.append(.fus_localString("人气值记录"))
make.font(.fus_themeMediumFont(18)).textColor(.white) make.font(.fus_themeMediumFont(18)).textColor(.fus_textColorRich())
}) })
} }
} }
......
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