Commit 6da816d0 authored by Steven杜宇's avatar Steven杜宇

// vip

parent 76afd086
...@@ -110,7 +110,7 @@ class YHMyNewViewController: YHBaseViewController { ...@@ -110,7 +110,7 @@ class YHMyNewViewController: YHBaseViewController {
lazy var vipInfoView: YHUserVipInfoView = { lazy var vipInfoView: YHUserVipInfoView = {
let v = YHUserVipInfoView(frame: CGRectMake(0, 0, tableView.width, 113)) let v = YHUserVipInfoView(frame: CGRectMake(0, 0, tableView.width, 113))
v.rightButtonEvent = { [weak self] in v.clickEvent = { [weak self] in
guard let self = self else { return } guard let self = self else { return }
if !checkLogin() { return } if !checkLogin() { return }
......
...@@ -99,7 +99,7 @@ class YHUserVipFunctionInfoView: UIView { ...@@ -99,7 +99,7 @@ class YHUserVipFunctionInfoView: UIView {
class YHUserVipInfoView: UIView { class YHUserVipInfoView: UIView {
var rightButtonEvent: (() -> Void)? var clickEvent: (() -> Void)?
var growValue: Int = 0 var growValue: Int = 0
var vipLevel: YHUserVipLevel = .none { var vipLevel: YHUserVipLevel = .none {
...@@ -158,7 +158,8 @@ class YHUserVipInfoView: UIView { ...@@ -158,7 +158,8 @@ class YHUserVipInfoView: UIView {
btn.setTitle("更多权益", for: .normal) btn.setTitle("更多权益", for: .normal)
btn.setTitleColor(.white, for: .normal) btn.setTitleColor(.white, for: .normal)
btn.layer.cornerRadius = 15.0 btn.layer.cornerRadius = 15.0
btn.addTarget(self, action: #selector(rightButtonClicked), for: .touchUpInside) btn.isUserInteractionEnabled = false
// btn.addTarget(self, action: #selector(rightButtonClicked), for: .touchUpInside)
return btn return btn
}() }()
...@@ -182,6 +183,9 @@ class YHUserVipInfoView: UIView { ...@@ -182,6 +183,9 @@ class YHUserVipInfoView: UIView {
self.addSubview(function1View) self.addSubview(function1View)
self.addSubview(function2View) self.addSubview(function2View)
self.addSubview(function3View) self.addSubview(function3View)
let tap = UITapGestureRecognizer(target: self, action: #selector(rightButtonClicked))
self.addGestureRecognizer(tap)
bgImgView.snp.makeConstraints { make in bgImgView.snp.makeConstraints { make in
make.edges.equalToSuperview() make.edges.equalToSuperview()
...@@ -233,7 +237,7 @@ class YHUserVipInfoView: UIView { ...@@ -233,7 +237,7 @@ class YHUserVipInfoView: UIView {
} }
@objc func rightButtonClicked() { @objc func rightButtonClicked() {
rightButtonEvent?() clickEvent?()
} }
func updateVipLevel(_ vipLevel: YHUserVipLevel) { func updateVipLevel(_ vipLevel: YHUserVipLevel) {
......
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