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

// 我的

parent e9e38729
......@@ -18,6 +18,7 @@ enum YHPersonalModuleItemType: Int {
case myProgress
case myActivity
case scoreCenter
case inviteFriends
case recommend
case myPoster
case myTestCode
......
......@@ -12,6 +12,9 @@ class YHMyFunctionGroup2Cell: UITableViewCell {
static let cellReuseIdentifier = "YHMyFunctionGroup2Cell"
static let itemHeight = 74.0
var clickItem:((PersonalModuleItem)->())?
func updateGroup(_ group: YHFunctionGroupInfo) {
groupArr = group.arr
}
......@@ -105,7 +108,11 @@ extension YHMyFunctionGroup2Cell: UICollectionViewDelegate, UICollectionViewData
}
func collectionView(_ collectionView: UICollectionView, didSelectItemAt indexPath: IndexPath) {
if 0 <= indexPath.item && indexPath.item < groupArr.count {
let item: PersonalModuleItem = groupArr[indexPath.item]
if let click = clickItem {
click(item)
}
}
}
}
......@@ -12,6 +12,8 @@ class YHMySectionGroupCell: UITableViewCell {
static let cellReuseIdentifier = "YHMySectionGroupCell"
var clickItem:((PersonalModuleItem)->())?
func updateGroup(_ group: YHFunctionGroupInfo) {
titleLabel.text = group.title
groupArr = group.arr
......@@ -134,7 +136,11 @@ extension YHMySectionGroupCell: UICollectionViewDelegate, UICollectionViewDataSo
}
func collectionView(_ collectionView: UICollectionView, didSelectItemAt indexPath: IndexPath) {
if 0 <= indexPath.item && indexPath.item < groupArr.count {
let item: PersonalModuleItem = groupArr[indexPath.item]
if let click = clickItem {
click(item)
}
}
}
}
......@@ -19,6 +19,7 @@ class YHMyUserInfoView: UIView {
var likeClick:(()->Void)?
var collectClick:(()->Void)?
var recentScanClick:(()->Void)?
var enterClick:(()->Void)?
lazy var contentView: UIView = {
let view = UIView()
......@@ -111,6 +112,12 @@ class YHMyUserInfoView: UIView {
return imgV
}()
lazy var enterBtn: UIButton = {
let btn = UIButton()
btn.addTarget(self, action: #selector(enterBtnClicked), for: .touchUpInside)
return btn
}()
override init(frame: CGRect) {
super.init(frame: frame)
self.clipsToBounds = true
......@@ -140,6 +147,7 @@ class YHMyUserInfoView: UIView {
contentView.addSubview(line2View)
contentView.addSubview(arrowImgView)
contentView.addSubview(enterBtn)
contentView.snp.makeConstraints { make in
make.left.right.equalToSuperview()
......@@ -210,12 +218,21 @@ class YHMyUserInfoView: UIView {
make.right.equalTo(0)
}
enterBtn.snp.makeConstraints { make in
make.right.top.bottom.equalToSuperview()
make.width.equalTo(enterBtn.snp.height)
}
update(count: 0, label: likeLabel)
update(count: 0, label: collectLabel)
update(count: 0, label: scanLabel)
}
@objc func enterBtnClicked() {
enterClick?()
}
func updateAvatar() {
let headImgName = YHLoginManager.shared.isLogin() ? "people_head_default" : "mine_head_logout"
avarImgView.image = UIImage(named: headImgName)
......
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