CNLiveDigitalThreeCerCollectCell .swift
2.07 KB
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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
//
// CNLiveDigitalThreeCerCollectCell .swift
// metaCode
//
// Created by zx on 2024/8/7.
// 数字资产-其他证书-证书img列表Cell
import Foundation
import Kingfisher
class CNLiveDigitalThreeCerCollectCell: UICollectionViewCell {
var _cerModel : CNLiveVitaeCertificatesModel?
var cerModel : CNLiveVitaeCertificatesModel? {
get{
_cerModel
}
set{
_cerModel = newValue!
setupNewUI(model: _cerModel!)
}
}
lazy var iconImgView :UIImageView = {
let iconImgView = UIImageView(frame: CGRect(x: 18, y: 0, width: 85, height: 101))
iconImgView.contentMode = .scaleAspectFill
iconImgView.clipsToBounds = true
iconImgView.layer.cornerRadius = 5
return iconImgView
}()
lazy var titleLbl: UILabel = {
let imgW:CGFloat = self.iconImgView.width
let titleX:Float = Float(15.0*imgW/85)
let titleY:Float = Float(19.0*imgW/85)
let titleW:Float = Float(55.0*imgW/85)
let titleH:Float = 30.0
let titleLbl = UILabel()
titleLbl.frame = CGRect(x: CGFloat(titleX), y: CGFloat(titleY), width: CGFloat(titleW), height: CGFloat(titleH))
titleLbl.numberOfLines = 2
titleLbl.font = BoldFont_11
titleLbl.textColor = HexColor("#333333")
titleLbl.textAlignment = .center
return titleLbl
}()
override init(frame: CGRect) {
super.init(frame: frame)
self.contentView.addSubview(self.iconImgView)
self.iconImgView.addSubview(self.titleLbl)
}
required init?(coder: NSCoder) {
fatalError("init(coder:) has not been implemented")
}
func setupNewUI(model:CNLiveVitaeCertificatesModel){
if model.status == 1{
self.iconImgView.image = UIImage(named: "mine_jianli_cerBg_authed")
}else{
self.iconImgView.image = UIImage(named: "mine_jianli_cerBg_unauthed")
}
self.titleLbl.text = model.title
// self.iconImgView.kf.setImage(with: URL(string: model.img))
}
}