//
//  YHScoreResultView.swift
//  galaxy
//
//  Created by davidhuangA on 2024/1/28.
//  Copyright © 2024 https://www.galaxy-immi.com. All rights reserved.
//

import UIKit
class YHScoreResultView: UIView {
    
    override init(frame: CGRect) {
        super.init(frame: frame)
        
        setupUI()
        
    }
    required init?(coder: NSCoder) {
        fatalError("init(coder:) has not been implemented")
    }
    
    
    
    //固定高度
    static let viewH : CGFloat = 52.0
    
    
    //icon
    private lazy var iconImageV : UIImageView = {
        let imageV = UIImageView(image: UIImage(named: "score_satisfy_0"))
        imageV.contentMode = .scaleAspectFit
        return imageV
    }()
    
    
    private lazy var nameLable : UILabel = {
        let lable0 = UILabel(text: "年龄：32")
        lable0.textColor = UIColor(hex: 0x4E4E4E)
        lable0.font = UIFont.PFSC_M(ofSize: 14)
        return lable0
    }()
    
    
    private lazy var desLable : UILabel = {
        let lable0 = UILabel(text: "得分：30分")
        lable0.textColor = UIColor(hex: 0x4E4E4E)
        lable0.font = UIFont.PFSC_M(ofSize: 14)
        return lable0
    }()
    
    
    private lazy var bottomLine : UIView = {
        let view = UIView()
        view.backgroundColor = UIColor(hex:0xF0F0F0)
        return view
    }()
}

private extension YHScoreResultView {
    func setupUI() {
        addSubview(bottomLine)
        bottomLine.snp.makeConstraints { make in
            make.bottom.left.right.equalToSuperview()
            make.height.equalTo(0.5)
        }
        
        addSubview(iconImageV)
        iconImageV.snp.makeConstraints { make in
            make.left.equalToSuperview()
            make.centerY.equalToSuperview().offset(-0.5)
            make.width.height.equalTo(14)
        }
        
        addSubview(nameLable)
        nameLable.snp.makeConstraints { make in
            make.centerY.equalTo(iconImageV.snp.centerY)
            make.left.equalTo(iconImageV.snp.right).offset(12)
            make.bottom.equalTo(bottomLine.snp.top)
        }
        
        addSubview(desLable)
        desLable.snp.makeConstraints { make in
            make.centerY.equalTo(nameLable.snp.centerY)
            make.left.equalTo(nameLable.snp.right).offset(6)
        }
    }
}
