Commit a2d7dedd authored by David黄金龙's avatar David黄金龙

1、处理 一处编译不过的bug

2、一处UI展示优化
parent 180a561f
...@@ -210,7 +210,7 @@ class YHFormItemDoubleChoiceCell: UITableViewCell { ...@@ -210,7 +210,7 @@ class YHFormItemDoubleChoiceCell: UITableViewCell {
var bounds = CGRect() var bounds = CGRect()
let maxWidth = KScreenWidth-16*2-horizonalGap*2 let maxWidth = KScreenWidth-16*2-horizonalGap*2
bounds = NSString(string:tips).boundingRect(with: CGSize(width:maxWidth, height: .greatestFiniteMagnitude), options: [.usesLineFragmentOrigin], attributes: [.font : titleFont], context: nil) bounds = NSString(string:tips).boundingRect(with: CGSize(width:maxWidth, height: .greatestFiniteMagnitude), options: [.usesLineFragmentOrigin], attributes: [.font : titleFont], context: nil)
tipsHeight = ceill(bounds.size.height) tipsHeight = Double(ceill(Float80(bounds.size.height)))
} }
tipsLabel.snp.updateConstraints { make in tipsLabel.snp.updateConstraints { make in
make.height.equalTo(tipsHeight) make.height.equalTo(tipsHeight)
......
...@@ -22,8 +22,8 @@ class YHPreviewAcademicAndProfessionalQualificationViewController: YHPreviewBase ...@@ -22,8 +22,8 @@ class YHPreviewAcademicAndProfessionalQualificationViewController: YHPreviewBase
private extension YHPreviewAcademicAndProfessionalQualificationViewController { private extension YHPreviewAcademicAndProfessionalQualificationViewController {
func loadData() { func loadData() {
if let orderID = UserDefaults.standard.value(forKey: "orderIdForPreview") { if let orderID = UserDefaults.standard.value(forKey: "orderIdForPreview") {
let tmp = 133967 //for test hjl todo // let tmp = 133967 //全数据 可测试
previewVM.getPreviewForAcademicInfo(params: ["order_id" : tmp]) { success, error in previewVM.getPreviewForAcademicInfo(params: ["order_id" : orderID]) { success, error in
if success == true { if success == true {
} else { } else {
......
...@@ -36,7 +36,6 @@ class YHPreviewInfoQuestionAndAnswerItemView: UIView { ...@@ -36,7 +36,6 @@ class YHPreviewInfoQuestionAndAnswerItemView: UIView {
lable0.font = UIFont.PFSC_R(ofSize: 14) lable0.font = UIFont.PFSC_R(ofSize: 14)
lable0.numberOfLines = 0 lable0.numberOfLines = 0
lable0.lineBreakMode = .byWordWrapping lable0.lineBreakMode = .byWordWrapping
// lable0.textAlignment = .right
return lable0 return lable0
}() }()
...@@ -62,40 +61,15 @@ class YHPreviewInfoQuestionAndAnswerItemView: UIView { ...@@ -62,40 +61,15 @@ class YHPreviewInfoQuestionAndAnswerItemView: UIView {
}() }()
// private lazy var remarkTextField : UITextView = {
// let lable0 = UITextView(frame: .zero)
// lable0.contentInset = UIEdgeInsets(top: 20, left: 12, bottom: 12, right: 12)
// lable0.textColor = UIColor.labelTextColor2
// lable0.font = UIFont.PFSC_R(ofSize: 14)
// lable0.backgroundColor = .contentBkgColor
// lable0.layer.cornerRadius = kCornerRadius6
// lable0.clipsToBounds = true
// lable0.isEditable = false
// lable0.isSelectable = false
// lable0.isScrollEnabled = false
// lable0.text = "我是测试数据哈"
// lable0.isHidden = true
// return lable0
// }()
private func setupUI() { private func setupUI() {
addSubview(nameLable) addSubview(nameLable)
nameLable.snp.makeConstraints { make in nameLable.snp.makeConstraints { make in
make.top.equalToSuperview().offset(18) make.top.equalToSuperview().offset(18)
make.left.equalToSuperview() make.left.equalToSuperview()
make.right.equalToSuperview() make.right.equalToSuperview()
make.height.equalTo(20)
} }
addSubview(subtitleLable) addSubview(subtitleLable)
// subtitleLable.snp.makeConstraints { make in
// make.top.equalTo(nameLable.snp.bottom).offset(8)
// make.right.equalToSuperview()
// make.left.equalToSuperview()
//
// make.bottom.equalToSuperview()
// }
} }
var dataModel : YHPreviewQuestionAndAnswerModel? { var dataModel : YHPreviewQuestionAndAnswerModel? {
...@@ -109,7 +83,6 @@ extension YHPreviewInfoQuestionAndAnswerItemView { ...@@ -109,7 +83,6 @@ extension YHPreviewInfoQuestionAndAnswerItemView {
func updateUI() { func updateUI() {
guard let model = dataModel else { return } guard let model = dataModel else { return }
removeSubviews() removeSubviews()
setupUI() setupUI()
...@@ -117,7 +90,6 @@ extension YHPreviewInfoQuestionAndAnswerItemView { ...@@ -117,7 +90,6 @@ extension YHPreviewInfoQuestionAndAnswerItemView {
subtitleLable.text = model.answer subtitleLable.text = model.answer
if let remark = model.remark { if let remark = model.remark {
subtitleLable.snp.makeConstraints { make in subtitleLable.snp.makeConstraints { make in
make.top.equalTo(nameLable.snp.bottom).offset(8) make.top.equalTo(nameLable.snp.bottom).offset(8)
make.right.equalToSuperview() make.right.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