CNLiveShopConsoleCell.swift
3.04 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
88
89
90
91
92
93
94
95
96
97
98
99
100
101
//
// CNLiveShopConsoleCell.swift
// metaCode
//
// Created by zx on 2023/10/30.
// 电商控制台cell
import Foundation
class CNLiveShopConsoleCell: UICollectionViewCell {
var bgView = UIView()
var iconImageView = UIImageView()
var titleLbl = UILabel()
var subTitleLbl = UILabel()
//slideModel
var _shopListContentModel : CNLiveShopConsoleListContentModel?
var shopListContentModel : CNLiveShopConsoleListContentModel? {
get{
_shopListContentModel
}
set{
_shopListContentModel = newValue!
self.iconImageView.image = UIImage(named: _shopListContentModel!.simg!)
self.titleLbl.text = _shopListContentModel?.title
self.subTitleLbl.text = _shopListContentModel?.subtitle
}
}
override init(frame: CGRect) {
super.init(frame: frame)
self.backgroundColor = .clear
self.setUI()
}
required init?(coder: NSCoder) {
fatalError("init(coder:) has not been implemented")
}
func setUI(){
self.bgView = UIView(frame: contentView.bounds)
self.bgView.backgroundColor = .white
self.bgView.layer.cornerRadius = 7
contentView.addSubview(self.bgView)
self.iconImageView = UIImageView(frame: CGRectMake(15, 0, 35, 35))
self.iconImageView.centerY = contentView.centerY
self.iconImageView.clipsToBounds = true
self.iconImageView.contentMode = .scaleAspectFit
self.bgView.addSubview(self.iconImageView)
self.titleLbl = UILabel(frame: CGRect(x: self.iconImageView.right+10, y: (contentView.height-20-15)*0.5, width: contentView.width-self.iconImageView.right-10-20, height: 20))
self.titleLbl.text = "创建店铺分类"
self.titleLbl.font = Font_14
self.titleLbl.textColor = HexColor("#4A4A4A")
self.bgView.addSubview(self.titleLbl)
self.subTitleLbl = UILabel(frame: CGRect(x: self.titleLbl.left, y: self.titleLbl.bottom, width: self.titleLbl.width, height: 15))
self.subTitleLbl.text = "创建店铺分类"
self.subTitleLbl.font = Font_11
self.subTitleLbl.textColor = HexColor("#999999")
self.bgView.addSubview(self.subTitleLbl)
}
}
class CNLiveShopConsoleHeaderView:UICollectionReusableView{
var _title:String?
var title:String? {
get{
return _title
}
set{
_title = newValue!
self.titleLbl.text = _title
}
}
var titleLbl:UILabel = {
let titleLbl = UILabel(frame: CGRect(x: 15, y: 0, width: 100, height:23 ))
titleLbl.text = "商品管理"
titleLbl.font = Font_16
titleLbl.textColor = HexColor("#B4B4B4")
return titleLbl
}()
override init(frame: CGRect) {
super.init(frame: frame)
self.setUI()
}
required init?(coder: NSCoder) {
fatalError("init(coder:) has not been implemented")
}
func setUI(){
self.addSubview(self.titleLbl)
}
}