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

// 我的证件

parent 156e63ee
...@@ -20,7 +20,8 @@ class YHCertificateInfoCell: UITableViewCell { ...@@ -20,7 +20,8 @@ class YHCertificateInfoCell: UITableViewCell {
var whiteView: UIView! var whiteView: UIView!
var nameTextView: UITextView! var nameTextView: UITextView!
var infoLabel: UILabel! var infoLabel: UILabel!
var statusBtn: UIButton! var statusLabel: UILabel!
var rightArrowImgV: UIImageView!
private lazy var templateLabel : UILabel = { private lazy var templateLabel : UILabel = {
let label = UILabel(frame: CGRect(x: 0, y: 0, width: 48, height: 16)) let label = UILabel(frame: CGRect(x: 0, y: 0, width: 48, height: 16))
...@@ -37,7 +38,6 @@ class YHCertificateInfoCell: UITableViewCell { ...@@ -37,7 +38,6 @@ class YHCertificateInfoCell: UITableViewCell {
return label return label
}() }()
required init?(coder: NSCoder) { required init?(coder: NSCoder) {
super.init(coder: coder) super.init(coder: coder)
} }
...@@ -69,8 +69,8 @@ class YHCertificateInfoCell: UITableViewCell { ...@@ -69,8 +69,8 @@ class YHCertificateInfoCell: UITableViewCell {
case .all: case .all:
titleColor = .labelTextColor2 titleColor = .labelTextColor2
} }
statusBtn.setTitleColor(titleColor, for:.normal) statusLabel.text = title
statusBtn.setTitle(title, for: .normal) statusLabel.textColor = titleColor
} }
if model.templateInfo.materialPath.isEmpty && model.templateInfo.guideFilePath.isEmpty && model.templateInfo.description.isEmpty { if model.templateInfo.materialPath.isEmpty && model.templateInfo.guideFilePath.isEmpty && model.templateInfo.description.isEmpty {
...@@ -113,26 +113,24 @@ class YHCertificateInfoCell: UITableViewCell { ...@@ -113,26 +113,24 @@ class YHCertificateInfoCell: UITableViewCell {
whiteView.addSubview(nameTextView) whiteView.addSubview(nameTextView)
nameTextView.attributed.text = """ nameTextView.attributed.text = """
\("我是资料名称", .foreground(UIColor.mainTextColor), .font(UIFont.PFSC_M(ofSize: 16))) \(.view(templateLabel, .original(.center))) \("资料名称", .foreground(UIColor.mainTextColor), .font(UIFont.PFSC_M(ofSize: 16))) \(.view(templateLabel, .original(.center)))
""" """
infoLabel = UILabel() infoLabel = UILabel()
infoLabel.textColor = UIColor.labelTextColor2 infoLabel.textColor = UIColor.labelTextColor2
infoLabel.textAlignment = .left infoLabel.textAlignment = .left
infoLabel.font = UIFont.PFSC_R(ofSize:11) infoLabel.font = UIFont.PFSC_R(ofSize:11)
infoLabel.text = "类型:证件资料 所属人:张康" infoLabel.numberOfLines = 0
whiteView.addSubview(infoLabel) whiteView.addSubview(infoLabel)
statusBtn = UIButton() statusLabel = UILabel()
statusBtn.titleLabel?.font = UIFont.PFSC_R(ofSize:14) statusLabel.textColor = UIColor.labelTextColor2
statusLabel.textAlignment = .left
statusLabel.font = UIFont.PFSC_R(ofSize:14)
whiteView.addSubview(statusLabel)
let iconWidth = 16.0 rightArrowImgV = UIImageView(image: UIImage(named: "service_center_right_next_icon"))
let titleWidth = 42.0 whiteView.addSubview(rightArrowImgV)
statusBtn.titleEdgeInsets = UIEdgeInsets(top: 0, left: -iconWidth, bottom: 0, right: iconWidth)
statusBtn.imageEdgeInsets = UIEdgeInsets(top: 0, left: titleWidth, bottom: 0, right: -titleWidth)
statusBtn.setImage(UIImage(named:"my_cer_arrow_right"), for:.normal)
statusBtn.setTitleColor(.labelTextColor2, for:.normal)
whiteView.addSubview(statusBtn)
whiteView.snp.makeConstraints { make in whiteView.snp.makeConstraints { make in
make.left.equalToSuperview().offset(20) make.left.equalToSuperview().offset(20)
...@@ -143,7 +141,7 @@ class YHCertificateInfoCell: UITableViewCell { ...@@ -143,7 +141,7 @@ class YHCertificateInfoCell: UITableViewCell {
nameTextView.snp.makeConstraints { make in nameTextView.snp.makeConstraints { make in
make.left.equalToSuperview().offset(10) make.left.equalToSuperview().offset(10)
make.top.equalToSuperview().offset(4) make.top.equalToSuperview().offset(4)
make.right.equalTo(statusBtn.snp.left) make.right.equalTo(statusLabel.snp.left).offset(-6)
} }
infoLabel.snp.makeConstraints { make in infoLabel.snp.makeConstraints { make in
...@@ -154,11 +152,16 @@ class YHCertificateInfoCell: UITableViewCell { ...@@ -154,11 +152,16 @@ class YHCertificateInfoCell: UITableViewCell {
make.height.equalTo(20) make.height.equalTo(20)
} }
statusBtn.snp.makeConstraints { make in statusLabel.snp.makeConstraints { make in
make.height.equalTo(60) make.right.equalTo(rightArrowImgV.snp.left).offset(-6)
make.width.equalTo(92) make.size.equalTo(CGSize(width: 42, height: 20))
make.centerY.equalToSuperview()
}
rightArrowImgV.snp.makeConstraints { make in
make.right.equalToSuperview().offset(-16)
make.size.equalTo(CGSize(width: 16, height: 16))
make.centerY.equalToSuperview() make.centerY.equalToSuperview()
make.right.equalToSuperview()
} }
} }
......
{
"images" : [
{
"filename" : "icon-展开.png",
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"scale" : "2x"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
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