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

// 我的

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