Commit 47424308 authored by Alex朱枝文's avatar Alex朱枝文

会员中心按钮状态调整

parent d331adc0
...@@ -10,7 +10,7 @@ import Foundation ...@@ -10,7 +10,7 @@ import Foundation
enum YHMemberCenterCellContent: String, CaseIterable { enum YHMemberCenterCellContent: String, CaseIterable {
case kidsBay = "kidsbay高端早教盒子" case kidsBay = "kidsbay高端早教盒子"
case luxury = "奢华体验中心" case luxury = "奢华会客体验中心"
case crossBorder = "深港跨境出行预约" case crossBorder = "深港跨境出行预约"
case hkTravel = "香港境内出行预约" case hkTravel = "香港境内出行预约"
case drivingLicense = "国际驾照续期" case drivingLicense = "国际驾照续期"
......
...@@ -38,6 +38,30 @@ class YHMemberCenterMyPrivilegeCell: YHResignDocumentCell { ...@@ -38,6 +38,30 @@ class YHMemberCenterMyPrivilegeCell: YHResignDocumentCell {
view.image = UIImage(named: "right_arrow_black_20") view.image = UIImage(named: "right_arrow_black_20")
return view return view
}() }()
private lazy var bottomContainerView: UIView = {
let view = UIView()
view.backgroundColor = UIColor(hexString: "#F8F9FB")
view.layer.cornerRadius = 2
view.clipsToBounds = true
return view
}()
private lazy var privilegeLabel: UILabel = {
let label = UILabel()
label.text = "高端权益兑换"
label.font = .PFSC_R(ofSize: 12)
label.textColor = .mainTextColor
return label
}()
private lazy var privilegeTipsLabel: UILabel = {
let label = UILabel()
label.text = "可兑换次数: 0,已兑换次数: 0"
label.font = .PFSC_R(ofSize: 12)
label.textColor = UIColor(hexString: "#8993A2")
return label
}()
override init(style: UITableViewCell.CellStyle, reuseIdentifier: String?) { override init(style: UITableViewCell.CellStyle, reuseIdentifier: String?) {
super.init(style: style, reuseIdentifier: reuseIdentifier) super.init(style: style, reuseIdentifier: reuseIdentifier)
...@@ -48,8 +72,9 @@ class YHMemberCenterMyPrivilegeCell: YHResignDocumentCell { ...@@ -48,8 +72,9 @@ class YHMemberCenterMyPrivilegeCell: YHResignDocumentCell {
fatalError("init(coder:) has not been implemented") fatalError("init(coder:) has not been implemented")
} }
func setupCell(right: String) { func setupCell(right: String, redeemCount: Int, redeemedCount: Int) {
rightLabel.text = right rightLabel.text = right
privilegeTipsLabel.text = "可兑换次数: \(redeemCount),已兑换次数: \(redeemedCount)"
} }
private func setupUI() { private func setupUI() {
...@@ -58,6 +83,10 @@ class YHMemberCenterMyPrivilegeCell: YHResignDocumentCell { ...@@ -58,6 +83,10 @@ class YHMemberCenterMyPrivilegeCell: YHResignDocumentCell {
subContainerView.addSubview(leftIcon) subContainerView.addSubview(leftIcon)
subContainerView.addSubview(rightLabel) subContainerView.addSubview(rightLabel)
subContainerView.addSubview(rightIcon) subContainerView.addSubview(rightIcon)
subContainerView.addSubview(bottomContainerView)
bottomContainerView.addSubview(privilegeLabel)
bottomContainerView.addSubview(privilegeTipsLabel)
midLabel.setContentCompressionResistancePriority(.defaultHigh, for: .horizontal) midLabel.setContentCompressionResistancePriority(.defaultHigh, for: .horizontal)
leftIcon.setContentCompressionResistancePriority(.required, for: .horizontal) leftIcon.setContentCompressionResistancePriority(.required, for: .horizontal)
...@@ -65,26 +94,46 @@ class YHMemberCenterMyPrivilegeCell: YHResignDocumentCell { ...@@ -65,26 +94,46 @@ class YHMemberCenterMyPrivilegeCell: YHResignDocumentCell {
rightLabel.setContentCompressionResistancePriority(.required, for: .horizontal) rightLabel.setContentCompressionResistancePriority(.required, for: .horizontal)
leftIcon.snp.makeConstraints { make in leftIcon.snp.makeConstraints { make in
make.centerY.equalToSuperview() make.top.equalToSuperview().offset(20)
make.left.equalToSuperview().offset(16) make.left.equalToSuperview().offset(16)
make.width.height.equalTo(24) make.width.height.equalTo(24)
} }
midLabel.snp.makeConstraints { make in midLabel.snp.makeConstraints { make in
make.centerY.equalToSuperview() make.centerY.equalTo(leftIcon)
make.left.equalTo(leftIcon.snp.right).offset(8) make.left.equalTo(leftIcon.snp.right).offset(8)
make.right.lessThanOrEqualTo(rightLabel.snp.left).offset(-8) make.right.lessThanOrEqualTo(rightLabel.snp.left).offset(-8)
} }
rightIcon.snp.makeConstraints { make in rightIcon.snp.makeConstraints { make in
make.centerY.equalToSuperview() make.centerY.equalTo(leftIcon)
make.right.equalToSuperview().offset(-16) make.right.equalToSuperview().offset(-16)
make.width.height.equalTo(20) make.width.height.equalTo(20)
} }
rightLabel.snp.makeConstraints { make in rightLabel.snp.makeConstraints { make in
make.centerY.equalToSuperview() make.centerY.equalTo(leftIcon)
make.right.equalTo(rightIcon.snp.left).offset(-1) make.right.equalTo(rightIcon.snp.left).offset(-1)
} }
bottomContainerView.snp.makeConstraints { make in
make.top.equalTo(midLabel.snp.bottom).offset(17)
make.left.equalTo(leftIcon)
make.right.equalTo(rightIcon)
make.bottom.equalToSuperview().offset(-17)
make.height.equalTo(41)
}
privilegeLabel.setContentCompressionResistancePriority(.required, for: .horizontal)
privilegeTipsLabel.setContentCompressionResistancePriority(.defaultLow, for: .horizontal)
privilegeLabel.snp.makeConstraints { make in
make.left.equalToSuperview().offset(12)
make.centerY.equalToSuperview()
}
privilegeTipsLabel.snp.makeConstraints { make in
make.right.equalToSuperview().offset(-12)
make.centerY.equalToSuperview()
}
} }
} }
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