宽窄优行-由【嘉易行】项目成品而来
younger_times
2023-07-05 0d8f5fc8a516bfd07e425909e4a4432600572ee7
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
//
//  MineTopUpCell.swift
//  OKProject
//
//  Created by alvin_y on 2020/6/17.
//  Copyright © 2020 yangwang. All rights reserved.
//
 
import UIKit
 
class MineTopUpCell: UICollectionViewCell {
    private let label_name: UILabel = {
       let label = UILabel()
        label.textAlignment = .center
        label.textColor = UIColor.color(light: UIColor.color(hexString: "#666666"), dark: UIColor.color(hexString: "#666666"))
        label.font = UIFont.init(name: Medium, size: 14)
        return label
    }()
    override init(frame: CGRect) {
        super.init(frame: frame)
        setupViews()
        defineLayouts()
    }
    
    required init?(coder: NSCoder) {
        super.init(coder: coder)
        setupViews()
        defineLayouts()
    }
    
    
    func configure(model: MineTopUpModel){
        label_name.text = model.name
        label_name.layer.borderColor = model.select ? ThemeColor.cgColor : UIColor.color(light: UIColor.color(hexString: "#CCCCCC"), dark: UIColor.color(hexString: "#CCCCCC")).cgColor
        label_name.textColor = model.select ? ThemeColor : UIColor.color(light: UIColor.color(hexString: "#666666"), dark: UIColor.color(hexString: "#666666"))
    }
    
    //MARK: - UI
    func setupViews() {
        contentView.addSubview(label_name)
        label_name.layer.cornerRadius = 2
        label_name.layer.borderWidth = 1
        label_name.layer.borderColor = UIColor.color(light: UIColor.color(hexString: "#CCCCCC"), dark: UIColor.color(hexString: "#CCCCCC")).cgColor
    }
    
    //MARK: - Layouts
    func defineLayouts() {
        label_name.snp.makeConstraints { (make) in
            make.edges.equalToSuperview()
        }
    }
}