Commit 6c48e326 authored by David黄金龙's avatar David黄金龙

完成 我的评分 优化

parent eb6b71fb
...@@ -41,10 +41,10 @@ class YHScoreOptionsView: UIView { ...@@ -41,10 +41,10 @@ class YHScoreOptionsView: UIView {
private lazy var customLabel : UILabel = { private lazy var customLabel : UILabel = {
let customLabel = UILabel(frame: CGRect(x: 0, y: 0, width: 40, height: 20)) let customLabel = UILabel(frame: CGRect(x: 0, y: 0, width: 40, height: 20))
customLabel.text = "-" customLabel.text = "-"
customLabel.font = .PFSC_R(ofSize: 12) customLabel.font = .PFSC_M(ofSize: 12)
customLabel.backgroundColor = UIColor(hex:0xF8F9FB) customLabel.backgroundColor = UIColor(hex:0xF8F9FB)
customLabel.textColor = UIColor(hex: 0x888F98) customLabel.textColor = UIColor(hex: 0x888F98)
customLabel.layer.cornerRadius = 4 customLabel.layer.cornerRadius = 3
customLabel.clipsToBounds = true customLabel.clipsToBounds = true
customLabel.textAlignment = .center customLabel.textAlignment = .center
return customLabel return customLabel
...@@ -68,9 +68,9 @@ private extension YHScoreOptionsView { ...@@ -68,9 +68,9 @@ private extension YHScoreOptionsView {
addSubview(nameTextView) addSubview(nameTextView)
nameTextView.snp.makeConstraints { make in nameTextView.snp.makeConstraints { make in
make.top.equalTo(16) make.top.equalTo(kMargin)
make.left.right.equalToSuperview() make.left.right.equalToSuperview()
make.bottom.equalTo(bottomLine.snp.top).offset(-16) make.bottom.equalTo(bottomLine.snp.top).offset(-kMargin)
} }
} }
...@@ -86,17 +86,17 @@ private extension YHScoreOptionsView { ...@@ -86,17 +86,17 @@ private extension YHScoreOptionsView {
if model.isSelected == true { if model.isSelected == true {
nameTextView.attributed.text = """ nameTextView.attributed.text = """
\(model.scoreName, .foreground(UIColor(hex: 0x3C86F8)), .font(UIFont.PFSC_R(ofSize: 14))) \(.view(customLabel, .original(.center))) \(model.scoreName, .foreground(UIColor.brandMainColor), .font(UIFont.PFSC_R(ofSize: 14))) \(.view(customLabel, .original(.center)))
""" """
customLabel.backgroundColor = UIColor(hex:0x3C86F8,alpha:0.12) customLabel.backgroundColor = UIColor.brandMainColor8
customLabel.textColor = UIColor(hex: 0x3C86F8) customLabel.textColor = UIColor.brandMainColor
} else { } else {
nameTextView.attributed.text = """ nameTextView.attributed.text = """
\(model.scoreName, .foreground(UIColor(hex: 0x4E4E4E)), .font(UIFont.PFSC_R(ofSize: 14))) \(.view(customLabel, .original(.center))) \(model.scoreName, .foreground(UIColor(hex: 0x4E4E4E)), .font(UIFont.PFSC_R(ofSize: 14))) \(.view(customLabel, .original(.center)))
""" """
customLabel.backgroundColor = UIColor(hex:0xF8F9FB) customLabel.backgroundColor = UIColor(hex:0xF8F9FB)
customLabel.textColor = UIColor(hex: 0x888F98) customLabel.textColor = UIColor.labelTextColor2
} }
} }
} }
...@@ -167,7 +167,7 @@ extension YHScorePersonInfoCell { ...@@ -167,7 +167,7 @@ extension YHScorePersonInfoCell {
holdView.addSubview(phoneLable) holdView.addSubview(phoneLable)
phoneLable.snp.makeConstraints { make in phoneLable.snp.makeConstraints { make in
make.top.equalTo(nameLable.snp.bottom) make.top.equalTo(nameLable.snp.bottom)
make.left.equalTo(headImagV.snp.right).offset(12) make.left.equalTo(nameLable.snp.left)
make.height.equalTo(20) make.height.equalTo(20)
make.width.equalTo(200) make.width.equalTo(200)
} }
...@@ -192,7 +192,7 @@ extension YHScorePersonInfoCell { ...@@ -192,7 +192,7 @@ extension YHScorePersonInfoCell {
return return
} }
nameLable.text = "davidHuang for test"//model.user_info?.username ?? "-" nameLable.text = "DavidHuang for test"//model.user_info?.username ?? "-"
phoneLable.text = model.user_info?.mobile ?? "-" phoneLable.text = model.user_info?.mobile ?? "-"
let score : String = String(model.total_score?.sum_score ?? 0) let score : String = String(model.total_score?.sum_score ?? 0)
......
...@@ -27,7 +27,7 @@ class YHScoreResultView: UIView { ...@@ -27,7 +27,7 @@ class YHScoreResultView: UIView {
//固定高度 //固定高度
static let viewH : CGFloat = 52.0 static let viewH : CGFloat = 60.5
//icon //icon
...@@ -69,24 +69,46 @@ private extension YHScoreResultView { ...@@ -69,24 +69,46 @@ private extension YHScoreResultView {
make.height.equalTo(0.5) make.height.equalTo(0.5)
} }
addSubview(iconImageV) let holdView = UIView()
holdView.backgroundColor = UIColor.contentBkgColor
holdView.layer.cornerRadius = kCornerRadius6
holdView.clipsToBounds = true
addSubview(holdView)
holdView.snp.makeConstraints { make in
make.bottom.equalTo(bottomLine.snp.top).offset(-kMargin)
make.left.right.equalToSuperview()
make.height.equalTo(44)
}
holdView.addSubview(iconImageV)
iconImageV.snp.makeConstraints { make in iconImageV.snp.makeConstraints { make in
make.left.equalToSuperview() make.left.equalTo(12)
make.centerY.equalToSuperview().offset(-0.5) make.centerY.equalToSuperview()
make.width.height.equalTo(14) make.width.height.equalTo(14)
} }
addSubview(nameLable) holdView.addSubview(nameLable)
nameLable.snp.makeConstraints { make in nameLable.snp.makeConstraints { make in
make.centerY.equalTo(iconImageV.snp.centerY) make.centerY.equalToSuperview()
make.left.equalTo(iconImageV.snp.right).offset(12) make.left.equalTo(iconImageV.snp.right).offset(8)
make.bottom.equalTo(bottomLine.snp.top) }
let line = UIView()
line.backgroundColor = UIColor.labelTextColor2
holdView.addSubview(line)
line.snp.makeConstraints { make in
make.centerY.equalToSuperview()
make.left.equalTo(nameLable.snp.right).offset(20)
make.height.equalTo(13.5)
make.width.equalTo(0.5)
} }
addSubview(desLable) holdView.addSubview(desLable)
desLable.snp.makeConstraints { make in desLable.snp.makeConstraints { make in
make.centerY.equalTo(nameLable.snp.centerY) make.centerY.equalToSuperview()
make.left.equalTo(nameLable.snp.right).offset(6) make.left.equalTo(line.snp.right).offset(20)
} }
} }
......
...@@ -23,47 +23,34 @@ class YHScoreTitleView: UIView { ...@@ -23,47 +23,34 @@ class YHScoreTitleView: UIView {
//固定高度 //固定高度
static let viewH : CGFloat = 52.0 static let viewH : CGFloat = 56.0
private lazy var nameLable : UILabel = { private lazy var nameLable : UILabel = {
let lable0 = UILabel(text: "年龄得分") let lable0 = UILabel(text: "-")
lable0.textColor = UIColor(hex: 0x222222) lable0.textColor = UIColor.mainTextColor
lable0.font = UIFont.PFSC_M(ofSize: 17) lable0.font = UIFont.PFSC_M(ofSize: 17)
return lable0 return lable0
}() }()
private lazy var desLable : UILabel = { private lazy var desLable : UILabel = {
let lable0 = UILabel(text: "(最高30分)") let lable0 = UILabel(text: "-")
lable0.textColor = UIColor(hex: 0x888F98) lable0.textColor = UIColor.labelTextColor2
lable0.font = UIFont.PFSC_R(ofSize: 14) lable0.font = UIFont.PFSC_R(ofSize: 14)
return lable0 return lable0
}() }()
private lazy var bottomLine : UIView = {
let view = UIView()
view.backgroundColor = UIColor(hex:0xF0F0F0)
return view
}()
} }
private extension YHScoreTitleView { private extension YHScoreTitleView {
func setupUI() { func setupUI() {
addSubview(bottomLine)
bottomLine.snp.makeConstraints { make in
make.bottom.left.right.equalToSuperview()
make.height.equalTo(0.5)
}
addSubview(nameLable) addSubview(nameLable)
nameLable.snp.makeConstraints { make in nameLable.snp.makeConstraints { make in
make.top.left.equalToSuperview() make.centerY.equalToSuperview()
make.bottom.equalTo(bottomLine.snp.top) make.left.equalToSuperview()
make.height.equalTo(24)
} }
addSubview(desLable) addSubview(desLable)
desLable.snp.makeConstraints { make in desLable.snp.makeConstraints { make in
make.centerY.equalTo(nameLable.snp.centerY) make.centerY.equalTo(nameLable.snp.centerY)
......
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 to comment