Commit 8f82a350 authored by David黄金龙's avatar David黄金龙

Merge branch 'main' into youhua-dev

* main:
  我的评分 界面修改
parents eedbbe52 e9d172ec
...@@ -52,10 +52,20 @@ class YHScorePersonInfoCell: UITableViewCell { ...@@ -52,10 +52,20 @@ class YHScorePersonInfoCell: UITableViewCell {
//综合得分 //综合得分
private lazy var scoreLable : UILabel = { private lazy var scoreLable : UILabel = {
let lable0 = UILabel(text: "92") let lable0 = UILabel(text: "92")
lable0.textColor = UIColor(hex: 0xFFEEB0) lable0.textColor = UIColor(hex: 0xFFEEB0)
lable0.font = UIFont(name: "DINAlternate-Bold", size: 68) lable0.font = UIFont(name: "DINAlternate-Bold", size: 68)
lable0.textAlignment = .right lable0.textAlignment = .center
return lable0
}()
//分
private lazy var fenLable : UILabel = {
let lable0 = UILabel(text: "分")
lable0.textColor = UIColor(hex: 0xFFEEB0)
lable0.font = UIFont.PFSC_R(ofSize: 16)
lable0.textAlignment = .center
return lable0 return lable0
}() }()
...@@ -81,6 +91,9 @@ class YHScorePersonInfoCell: UITableViewCell { ...@@ -81,6 +91,9 @@ class YHScorePersonInfoCell: UITableViewCell {
fatalError("init(coder:) has not been implemented") fatalError("init(coder:) has not been implemented")
} }
private let secondHoldView = UIView()
} }
extension YHScorePersonInfoCell { extension YHScorePersonInfoCell {
...@@ -178,18 +191,36 @@ extension YHScorePersonInfoCell { ...@@ -178,18 +191,36 @@ extension YHScorePersonInfoCell {
make.width.equalTo(200) make.width.equalTo(200)
} }
contentView.addSubview(secondHoldView)
secondHoldView.snp.makeConstraints { make in
make.bottom.equalTo(holdView.snp.top)
make.right.equalTo(holdView.snp.right).offset(5)
make.height.equalTo(105)
make.width.equalTo(148)
}
let imageV = UIImageView(image: UIImage(named: "score_maisui_icon"))
imageV.contentMode = .scaleAspectFill
secondHoldView.addSubview(imageV)
imageV.snp.makeConstraints { make in
make.edges.equalToSuperview()
}
contentView.addSubview(scoreLable) secondHoldView.addSubview(scoreLable)
scoreLable.snp.makeConstraints { make in scoreLable.snp.makeConstraints { make in
make.bottom.equalTo(holdView.snp.top).offset(-kMargin) make.centerX.equalToSuperview()
make.right.equalTo(holdView.snp.right).offset(-5) make.centerY.equalToSuperview()
make.height.equalTo(79) }
secondHoldView.addSubview(fenLable)
fenLable.snp.makeConstraints { make in
make.left.equalTo(scoreLable.snp.right).offset(2)
make.bottom.equalTo(scoreLable.snp.bottom).offset(-13)
} }
let a: ASAttributedString = .init("-",.font(UIFont(name: "DINAlternate-Bold", size: 68) ?? UIFont.PFSC_B(ofSize: 43)),.foreground(UIColor(hex: 0xFFEEB0))) let a: ASAttributedString = .init("-",.font(UIFont(name: "DINAlternate-Bold", size: 68) ?? UIFont.PFSC_B(ofSize: 43)),.foreground(UIColor(hex: 0xFFEEB0)))
let b: ASAttributedString = .init("分", .font(UIFont.PFSC_R(ofSize: 12)),.foreground(UIColor(hex: 0xFFEEB0))) let b: ASAttributedString = .init("分", .font(UIFont.PFSC_R(ofSize: 12)),.foreground(UIColor(hex: 0xFFEEB0)))
scoreLable.attributed.text = a + b scoreLable.attributed.text = a
} }
...@@ -203,9 +234,27 @@ extension YHScorePersonInfoCell { ...@@ -203,9 +234,27 @@ extension YHScorePersonInfoCell {
phoneLable.text = model.userinfo?.mobile ?? "-" phoneLable.text = model.userinfo?.mobile ?? "-"
let score : String = String(model.total_score?.sum_score ?? 0) let score : String = String(model.total_score?.sum_score ?? 0)
let a: ASAttributedString = .init(NSAttributedString(string: score),.font(UIFont(name: "DINAlternate-Bold", size: 68) ?? UIFont.PFSC_B(ofSize: 43)),.foreground(UIColor(hex: 0xFFEEB0))) // let a: ASAttributedString = .init(NSAttributedString(string: score),.font(UIFont(name: "DINAlternate-Bold", size: 68) ?? UIFont.PFSC_B(ofSize: 43)),.foreground(UIColor(hex: 0xFFEEB0)))
let b: ASAttributedString = .init("分", .font(UIFont.PFSC_M(ofSize: 16)),.foreground(.white)) // let b: ASAttributedString = .init("分", .font(UIFont.PFSC_M(ofSize: 16)),.foreground(.white))
scoreLable.attributed.text = a + b // scoreLable.attributed.text = a
scoreLable.text = score
scoreLable.layoutIfNeeded()
let gradientLayer = CAGradientLayer()
gradientLayer.colors = [UIColor(hex: 0xFFF9E3, alpha: 1.0).cgColor, UIColor(hex: 0xFFE895, alpha: 1.0).cgColor]
gradientLayer.startPoint = CGPoint(x: 0, y: 0)
gradientLayer.endPoint = CGPoint(x: 1, y: 1)
gradientLayer.locations = [NSNumber(value: 0.2)]
gradientLayer.frame = scoreLable.bounds
gradientLayer.mask = scoreLable.layer
secondHoldView.layer.insertSublayer(gradientLayer, at: 0)
} }
......
// //
// YHTestViewController.swift // YHDeviceInfoViewController.swift
// galaxy // galaxy
// //
// Created by edy on 2024/4/11. // Created by edy on 2024/4/11.
......
...@@ -5,12 +5,12 @@ ...@@ -5,12 +5,12 @@
"scale" : "1x" "scale" : "1x"
}, },
{ {
"filename" : "Group 3471@2x.png", "filename" : "Group 2033194829@2x.png",
"idiom" : "universal", "idiom" : "universal",
"scale" : "2x" "scale" : "2x"
}, },
{ {
"filename" : "Group 3471@3x.png", "filename" : "Group 2033194829@3x.png",
"idiom" : "universal", "idiom" : "universal",
"scale" : "3x" "scale" : "3x"
} }
......
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "Mask group@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "Mask group@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
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