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

import UIKit

class YHScorePersonInfoCell: UITableViewCell {
    static let cellReuseIdentifier = "YHScorePersonInfoCell"
    
//    var dataModel : YHContactItemModel? {
//        didSet {
////            updateUI()
//        }
//    }
    
    
    
    private lazy var headImagV : UIImageView = {
        let imageV = UIImageView(image: UIImage(named: "score_header_default"))
        imageV.contentMode = .scaleAspectFit
        return imageV
    }()
    
    override func awakeFromNib() {
        super.awakeFromNib()
        // Initialization code
    }

    override func setSelected(_ selected: Bool, animated: Bool) {
        super.setSelected(selected, animated: animated)

        // Configure the view for the selected state
    }
    
    override init(style: UITableViewCell.CellStyle, reuseIdentifier: String?) {
        super.init(style: style, reuseIdentifier: reuseIdentifier)
        setupUI()
    }
    
    required init?(coder: NSCoder) {
        fatalError("init(coder:) has not been implemented")
    }
    
}

extension YHScorePersonInfoCell {
    func setupUI() {
        backgroundColor = .clear
        contentView.backgroundColor = .clear
        
        let lable0 = UILabel(text: "香港优才评分报告")
        lable0.textColor = .white
        lable0.font = UIFont.PingFangScB(ofSize: 24)
        contentView.addSubview(lable0)
        lable0.snp.makeConstraints { make in
            make.top.equalTo(32)
            make.left.equalTo(8)
            make.right.equalTo(-8)
            make.height.equalTo(34)
        }
        
        
        let lable1 = UILabel(text: "根据您填写的资料情况生成")
        lable1.textColor = UIColor(hex: 0xffffff,alpha: 0.8)
        lable1.font = UIFont.PingFangScR(ofSize: 12)
        contentView.addSubview(lable1)
        lable1.snp.makeConstraints { make in
            make.top.equalTo(lable0.snp.bottom).offset(6)
            make.left.equalTo(lable0.snp.left)
            make.right.equalTo(lable0.snp.right)
            make.height.equalTo(17)
        }
        
        
        let holdView = UIView()
        holdView.backgroundColor = .white
        holdView.layer.cornerRadius = 12
        holdView.clipsToBounds = true
        contentView.addSubview(holdView)
        holdView.snp.makeConstraints { make in
            make.top.equalTo(lable1.snp.bottom).offset(30)
            make.left.right.equalToSuperview()
            make.height.equalTo(89)
            make.bottom.equalToSuperview().offset(-14)
        }
        
        
        let bkgImageV = UIImageView(image: UIImage(named: "scroe_icon_bkg"))
        bkgImageV.contentMode = .scaleAspectFill
        holdView.addSubview(bkgImageV)
        bkgImageV.snp.makeConstraints { make in
            make.top.right.bottom.equalToSuperview()
            make.width.equalTo(178)
        }
        
        
        let interHoldView = UIView()
        interHoldView.layer.borderWidth = 1
        interHoldView.layer.borderColor = UIColor(red: 0.235, green: 0.525, blue: 0.973, alpha: 0.2).cgColor
        interHoldView.layer.cornerRadius = 10
        interHoldView.clipsToBounds = true
        holdView.addSubview(interHoldView)
        interHoldView.snp.makeConstraints { make in
            make.top.left.equalTo(4)
            make.right.bottom.equalTo(-4)
        }
        
        
        // 头像 名称  电话号码  得分
        holdView.addSubview(headImagV)
        headImagV.snp.makeConstraints { make in
            make.centerY.equalToSuperview()
            make.left.equalTo(21)
            make.width.height.equalTo(42)
        }
        
       
        
        
    }
    
}
