Commit c1d55a74 by ludi

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

parent 452c13d0
...@@ -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