Commit fd2012c6 authored by Steven杜宇's avatar Steven杜宇

// 我的

parent 28001214
...@@ -14,6 +14,7 @@ class YHMyFunctionGroupItemCell: UICollectionViewCell { ...@@ -14,6 +14,7 @@ class YHMyFunctionGroupItemCell: UICollectionViewCell {
func updateItem(_ item : PersonalModuleItem) { func updateItem(_ item : PersonalModuleItem) {
titleLabel.text = item.title titleLabel.text = item.title
redPointView.isHidden = !item.isShowRedPoint
if let icon = item.icon, !icon.isEmpty { if let icon = item.icon, !icon.isEmpty {
iconImgView.image = UIImage(named:icon) iconImgView.image = UIImage(named:icon)
} else { } else {
...@@ -34,6 +35,15 @@ class YHMyFunctionGroupItemCell: UICollectionViewCell { ...@@ -34,6 +35,15 @@ class YHMyFunctionGroupItemCell: UICollectionViewCell {
return v return v
}() }()
private lazy var redPointView: UIView = {
let view = UIView()
view.layer.cornerRadius = 2.5
view.clipsToBounds = true
view.backgroundColor = .failColor
view.isHidden = true
return view
}()
required init?(coder: NSCoder) { required init?(coder: NSCoder) {
super.init(coder: coder) super.init(coder: coder)
} }
...@@ -46,6 +56,8 @@ class YHMyFunctionGroupItemCell: UICollectionViewCell { ...@@ -46,6 +56,8 @@ class YHMyFunctionGroupItemCell: UICollectionViewCell {
func setupUI() { func setupUI() {
self.contentView.addSubview(titleLabel) self.contentView.addSubview(titleLabel)
self.contentView.addSubview(iconImgView) self.contentView.addSubview(iconImgView)
self.contentView.addSubview(redPointView)
iconImgView.snp.makeConstraints { make in iconImgView.snp.makeConstraints { make in
make.top.equalTo(20) make.top.equalTo(20)
...@@ -53,6 +65,12 @@ class YHMyFunctionGroupItemCell: UICollectionViewCell { ...@@ -53,6 +65,12 @@ class YHMyFunctionGroupItemCell: UICollectionViewCell {
make.centerX.equalToSuperview() make.centerX.equalToSuperview()
} }
redPointView.snp.makeConstraints { make in
make.width.height.equalTo(5)
make.top.equalTo(iconImgView)
make.left.equalTo(iconImgView.snp.right).offset(0)
}
titleLabel.snp.makeConstraints { make in titleLabel.snp.makeConstraints { make in
make.top.equalTo(iconImgView.snp.bottom).offset(8) make.top.equalTo(iconImgView.snp.bottom).offset(8)
make.height.equalTo(18) make.height.equalTo(18)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment