Commit 19606c11 authored by Steven杜宇's avatar Steven杜宇

// 我的证件

parent 8cb67c62
...@@ -549,6 +549,7 @@ extension YHCertificateUploadContentListVC { ...@@ -549,6 +549,7 @@ extension YHCertificateUploadContentListVC {
msg = errorMsg msg = errorMsg
} }
YHHUD.flash(message: msg) YHHUD.flash(message: msg)
YHCertificateUploadFailTipsView.tipsView().show()
} }
} else { } else {
......
...@@ -32,6 +32,29 @@ enum YHCertificateUploadType: Int { ...@@ -32,6 +32,29 @@ enum YHCertificateUploadType: Int {
class YHCertificateUploadSheetView: UIView { class YHCertificateUploadSheetView: UIView {
static let sheetView = YHCertificateUploadSheetView(frame:UIScreen.main.bounds) static let sheetView = YHCertificateUploadSheetView(frame:UIScreen.main.bounds)
func calculateHeight() -> CGFloat {
guard let templateInfo = templateInfo else { return 0.0}
// 注意事项文字高度
var descHeight = templateInfo.description.boundingRect(with: CGSize(width:KScreenWidth-40.0 , height:.greatestFiniteMagnitude),
options: .usesLineFragmentOrigin,
attributes: [.font : UIFont.PFSC_R(ofSize:14)],
context: nil).size.height
descHeight = ceil(descHeight)+20
// 所有模版高度之和
let templatesHeight = 82.0 * Double(templateArr.count)
// 底部四个操作行高度之和
let actionsHeight = 52.0 * 4.0
let tableViewHeight = descHeight+templatesHeight+actionsHeight
// 白色View总高度
var totalHeight = 53.0+20.0+tableViewHeight+k_Height_safeAreaInsetsBottom()
if totalHeight > KScreenHeight {
totalHeight = 458
}
return totalHeight
}
var templateInfo: YHTemplateInfo? { var templateInfo: YHTemplateInfo? {
didSet { didSet {
...@@ -44,6 +67,12 @@ class YHCertificateUploadSheetView: UIView { ...@@ -44,6 +67,12 @@ class YHCertificateUploadSheetView: UIView {
templateArr.append(templateInfo.guideFilePath[0]) templateArr.append(templateInfo.guideFilePath[0])
} }
} }
let totalHeight = calculateHeight()
whiteContentView.snp.updateConstraints { make in
make.height.equalTo(totalHeight)
}
self.setNeedsLayout()
self.layoutIfNeeded()
self.tableView.reloadData() self.tableView.reloadData()
} }
} }
...@@ -195,7 +224,7 @@ class YHCertificateUploadSheetView: UIView { ...@@ -195,7 +224,7 @@ class YHCertificateUploadSheetView: UIView {
whiteContentView.snp.makeConstraints { make in whiteContentView.snp.makeConstraints { make in
make.left.right.bottom.equalToSuperview() make.left.right.bottom.equalToSuperview()
make.top.equalToSuperview().offset(355) make.height.equalTo(458.0)
} }
topView.snp.makeConstraints { make in topView.snp.makeConstraints { make in
make.top.left.right.equalToSuperview() make.top.left.right.equalToSuperview()
......
...@@ -75,6 +75,10 @@ class YHCertificateUploadItemView: UIView { ...@@ -75,6 +75,10 @@ class YHCertificateUploadItemView: UIView {
if item.type == .cancel { if item.type == .cancel {
titleLabel.textColor = UIColor(hexString:"#909090") titleLabel.textColor = UIColor(hexString:"#909090")
titleLabel.font = UIFont.PFSC_R(ofSize: 14)
} else {
titleLabel.textColor = UIColor.mainTextColor
titleLabel.font = UIFont.PFSC_M(ofSize: 14)
} }
titleLabel.snp.remakeConstraints { make in titleLabel.snp.remakeConstraints { make in
......
...@@ -248,13 +248,14 @@ class YHCertificateViewModel: YHBaseViewModel { ...@@ -248,13 +248,14 @@ class YHCertificateViewModel: YHBaseViewModel {
if operation == "add" { if operation == "add" {
if success { if success {
YHHUD.flash(message: "添加成功") YHHUD.flash(message: "上传成功")
} else { } else {
var msg = "添加失败" var msg = "上传失败"
if let errorMsg = error?.errorMsg, !errorMsg.isEmpty { if let errorMsg = error?.errorMsg, !errorMsg.isEmpty {
msg = errorMsg msg = errorMsg
} }
YHHUD.flash(message:msg) YHHUD.flash(message:msg)
YHCertificateUploadFailTipsView.tipsView().show()
} }
callBack?() callBack?()
return return
......
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