CNLiveRealManageCell.swift
2.59 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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
//
// CNLiveRealManageCell.swift
// metaCode
//
// Created by zx on 2024/6/20.
// 实名身份管理cell
import Foundation
class CNLiveRealManageCell:UITableViewCell{
var currIsSelect:Bool = false
var _usersModel : MineGetUserMsgVerifyUsersModel?
var usersModel : MineGetUserMsgVerifyUsersModel? {
get{
_usersModel
}
set{
_usersModel = newValue!
setupNewUI(model: _usersModel!)
}
}
lazy var bgView :UIView = {
let bottomNavView = UIView()
bottomNavView.backgroundColor = HexColor("#F7F7F7")
bottomNavView.layer.cornerRadius = 8
bottomNavView.clipsToBounds = true
return bottomNavView
}()
lazy var nameLabel: UILabel = {
let titleLabel = UILabel.init()
titleLabel.textColor = HexColor("#333333")
titleLabel.textAlignment = .left
titleLabel.font = UIFont(name: "PingFangSC-Medium", size: 16.0)
titleLabel.adjustsFontSizeToFitWidth=true
return titleLabel
}()
override init(style: UITableViewCell.CellStyle, reuseIdentifier: String?) {
super.init(style: style, reuseIdentifier: reuseIdentifier)
self.selectionStyle = .none
self.initUI()
}
required init?(coder: NSCoder) {
fatalError("init(coder:) has not been implemented")
}
func initUI(){
self.contentView.addSubview(self.bgView)
self.bgView.snp.makeConstraints { make in
make.top.equalTo(15)
make.height.equalTo(53)
make.left.equalTo(20)
make.right.equalToSuperview().offset(-20)
}
self.bgView.addSubview(self.nameLabel)
self.nameLabel.snp.makeConstraints { make in
make.centerY.equalToSuperview()
make.left.equalTo(15)
make.width.equalToSuperview().offset(-50)
}
}
func setupNewUI(model:MineGetUserMsgVerifyUsersModel){
self.nameLabel.text = model.name
if self.currIsSelect
{//当前cell被选择
self.bgView.layer.borderColor = HexColor("#1961FE")?.cgColor
self.bgView.layer.borderWidth = 0.5
self.bgView.backgroundColor = HexColor("#E8EFFE")
self.nameLabel.textColor = HexColor("#1961FE")
}else{
//cell没选择
self.bgView.layer.borderColor = HexColor("#1961FE")?.cgColor
self.bgView.layer.borderWidth = 0
self.nameLabel.textColor = HexColor("#333333")
self.bgView.backgroundColor = HexColor("#F7F7F7")
}
}
}