Commit 9f6eb0b4 authored by pete谢兆麟's avatar pete谢兆麟

我的文书我的签字bug

parent 6123b4ac
......@@ -103,6 +103,12 @@ class YHMyDocumentsDetailViewController: YHBaseViewController {
self.bottomView.isHidden = false
self.bottomButton.alpha = 1
self.bottomButton.setTitle("确定已签章,提交", for: .normal)
let height = self.getPromptHeight(self.viewModel.mainModel?.writing_document.doc_sign.audit_opinion ?? "")
self.promptView.snp.remakeConstraints { make in
make.height.equalTo(height)
make.bottom.equalTo(-k_Height_safeAreaInsetsBottom() - 64)
make.left.right.equalTo(self.view)
}
}
self.stepView.currentIndex = 1
}
......@@ -119,6 +125,20 @@ class YHMyDocumentsDetailViewController: YHBaseViewController {
})
}
func getPromptHeight(_ value: String) -> CGFloat {
let text = value // 要显示的文本内容
let font = UIFont.PFSC_R(ofSize: 12) // 字体大小
let maxWidth = KScreenWidth - 74 // 最大宽度限制
// 创建NSAttributedString对象并设置属性
let attributes = [NSAttributedString.Key.font : font] as [NSAttributedString.Key : Any]
_ = NSMutableAttributedString(string: text, attributes: attributes)
// 根据指定的最大宽度和字体大小计算文本的高度
let size = (text as NSString).boundingRect(with: CGSize(width: maxWidth, height: .greatestFiniteMagnitude), options: .usesLineFragmentOrigin, attributes: attributes, context: nil).size
return size.height + 15
}
func updateDataSource() {
self.tableView.reloadData()
......
......@@ -33,7 +33,7 @@ class YHFailPromptView: UIView {
}()
func setPrompt(_ prompt: String) {
titleLable.text = prompt
titleLable.text = "驳回原因:" + prompt
}
}
......@@ -42,7 +42,7 @@ private extension YHFailPromptView {
backgroundColor = UIColor(hex: 0xfeeded)
addSubview(alertImageView)
alertImageView.snp.makeConstraints { make in
make.centerY.equalToSuperview()
make.top.equalTo(10)
make.left.equalTo(18)
make.width.height.equalTo(16)
}
......@@ -51,7 +51,7 @@ private extension YHFailPromptView {
titleLable.snp.makeConstraints { make in
make.left.equalTo(38)
make.right.equalTo(-18)
make.top.bottom.equalToSuperview()
make.top.equalTo(8)
}
}
......
......@@ -88,6 +88,12 @@ class YHMySignatureDetailViewController: YHBaseViewController {
self.bottomView.isHidden = false
self.bottomButton.alpha = 1
self.bottomButton.setTitle("确定已签章,提交", for: .normal)
let height = self.getPromptHeight(self.viewModel.mainModel?.audit_opinion ?? "")
self.promptView.snp.remakeConstraints { make in
make.height.equalTo(height)
make.bottom.equalTo(-k_Height_safeAreaInsetsBottom() - 64)
make.left.right.equalTo(self.view)
}
}
self.tableView.reloadData()
} else {
......@@ -102,6 +108,20 @@ class YHMySignatureDetailViewController: YHBaseViewController {
})
}
func getPromptHeight(_ value: String) -> CGFloat {
let text = value // 要显示的文本内容
let font = UIFont.PFSC_R(ofSize: 12) // 字体大小
let maxWidth = KScreenWidth - 74 // 最大宽度限制
// 创建NSAttributedString对象并设置属性
let attributes = [NSAttributedString.Key.font : font] as [NSAttributedString.Key : Any]
_ = NSMutableAttributedString(string: text, attributes: attributes)
// 根据指定的最大宽度和字体大小计算文本的高度
let size = (text as NSString).boundingRect(with: CGSize(width: maxWidth, height: .greatestFiniteMagnitude), options: .usesLineFragmentOrigin, attributes: attributes, context: nil).size
return size.height + 15
}
func updateDataSource() {
self.tableView.reloadData()
}
......
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