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

证件优化

parent 97b8603c
......@@ -71,6 +71,7 @@ class YHSupplementInfo: SmartCodable {
var auditContent: String = ""
var uploadRequirement: Int = 0
var contentUrl: [YHContentUrl] = []
var isNeedDealt: Bool = false // 是否是银河代办
func getStatusName() -> String {
if checkStatus == YHCertificateUploadStatus.review.rawValue {
......@@ -104,6 +105,7 @@ class YHSupplementInfo: SmartCodable {
case auditContent = "audit_content"
case uploadRequirement = "upload_requirement"
case contentUrl = "content_url"
case isNeedDealt = "is_need_dealt"
}
required init() {
......
......@@ -13,7 +13,7 @@ import AttributedString
class YHCertificateInfoCell: UITableViewCell {
static let cellReuseIdentifier = "YHCertificateInfoCell"
var model: YHSupplementInfo = YHSupplementInfo()
var status : YHCertificateUploadStatus = .preUpload
var templateBlock:(()->())?
var whiteView: UIView!
......@@ -21,7 +21,19 @@ class YHCertificateInfoCell: UITableViewCell {
var infoLabel: UILabel!
var statusLabel: UILabel!
var rightArrowImgV: UIImageView!
var templateButton: UIButton!
lazy var templateButton: UIButton = {
let btn = UIButton()
btn.frame = CGRect(x: 0, y: 0, width: 48, height: 16)
btn.setTitle("资料模版", for: .normal)
btn.titleLabel?.font = .PFSC_M(ofSize: 10)
btn.setTitleColor(.brandMainColor, for: .normal)
btn.layer.cornerRadius = kCornerRadius3
btn.clipsToBounds = true
btn.backgroundColor = .brandMainColor8
btn.addTarget(self, action: #selector(didTemplateBtnClicked), for: .touchUpInside)
btn.YH_clickEdgeInsets = UIEdgeInsets(top: 20, left: 20, bottom: 20, right: 20)
return btn
}()
required init?(coder: NSCoder) {
super.init(coder: coder)
......@@ -34,6 +46,7 @@ class YHCertificateInfoCell: UITableViewCell {
func updateModel(_ model: YHSupplementInfo) {
self.model = model
if let status = YHCertificateUploadStatus(rawValue: model.checkStatus) {
var titleColor: UIColor = .labelTextColor2
......@@ -82,15 +95,27 @@ class YHCertificateInfoCell: UITableViewCell {
var result:ASAttributedString = .init(string:"", .font(UIFont.PFSC_M(ofSize: 16)), .foreground(UIColor.mainTextColor))
let mustTag: ASAttributedString = .init("*", .font(UIFont.PFSC_M(ofSize: 16)),.foreground(UIColor.failColor))
let cerName: ASAttributedString = .init(string:model.name , .font(UIFont.PFSC_M(ofSize: 16)), .foreground(UIColor.mainTextColor))
var name = model.name
if !model.nameExtra.organization.isEmpty {
name += "(\(model.nameExtra.organization))"
}
let cerName: ASAttributedString = .init(string:name , .font(UIFont.PFSC_M(ofSize: 16)), .foreground(UIColor.mainTextColor))
var template: ASAttributedString = " \(.view(templateButton, .original(.center)))"
// 是否展示右边的模版按钮
var showTemplateBtn = true
if model.isNeedDealt {
templateButton.setTitle("银河代办", for: .normal)
template = " \(.view(templateButton, .original(.center)))"
} else {
templateButton.setTitle("资料模版", for: .normal)
template = " \(.view(templateButton, .original(.center)))"
if model.templateInfo.materialPath.isEmpty && model.templateInfo.guideFilePath.isEmpty && model.templateInfo.description.isEmpty {
showTemplateBtn = false
}
}
if model.isNeedSupplemnt() {
result += mustTag
......@@ -103,6 +128,9 @@ class YHCertificateInfoCell: UITableViewCell {
}
@objc func didTemplateBtnClicked() {
if self.model.isNeedDealt { // 银河代办
return
}
if let templateBlock = templateBlock {
templateBlock()
}
......@@ -127,16 +155,6 @@ class YHCertificateInfoCell: UITableViewCell {
nameTextView.isSelectable = false
whiteView.addSubview(nameTextView)
templateButton = UIButton()
templateButton.frame = CGRect(x: 0, y: 0, width: 48, height: 16)
templateButton.setTitle("资料模版", for: .normal)
templateButton.titleLabel?.font = .PFSC_M(ofSize: 10)
templateButton.setTitleColor(.brandMainColor, for: .normal)
templateButton.layer.cornerRadius = kCornerRadius3
templateButton.clipsToBounds = true
templateButton.backgroundColor = .brandMainColor8
templateButton.addTarget(self, action: #selector(didTemplateBtnClicked), for: .touchUpInside)
templateButton.YH_clickEdgeInsets = UIEdgeInsets(top: 20, left: 20, bottom: 20, right: 20)
nameTextView.attributed.text = """
\("资料名称", .foreground(UIColor.mainTextColor), .font(UIFont.PFSC_M(ofSize: 16))) \(.view(templateButton, .original(.center))))
......
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