From eb795a6523edbc0fe3a3b1a3d3bea1063041efd5 Mon Sep 17 00:00:00 2001 From: 无故事王国 <841720330@qq.com> Date: 星期四, 19 十月 2023 18:09:23 +0800 Subject: [PATCH] 修复BUG --- WanPai/Common/View/AgreentView.swift | 18 +++++++++++------- 1 files changed, 11 insertions(+), 7 deletions(-) diff --git a/WanPai/Common/View/AgreentView.swift b/WanPai/Common/View/AgreentView.swift index 77a5bf6..ea671c0 100644 --- a/WanPai/Common/View/AgreentView.swift +++ b/WanPai/Common/View/AgreentView.swift @@ -14,16 +14,16 @@ @IBOutlet weak var label_title: UILabel! @IBOutlet weak var view_container: UIView! - @IBOutlet weak var webView: WKWebView! +// @IBOutlet weak var webView: WKWebView! @IBOutlet weak var bottom_cons: NSLayoutConstraint! - private var type:AgreentType! + @IBOutlet weak var label_content: UILabel! + private var type:AgreentType! private var content:String? private let disposeBag = DisposeBag() override func awakeFromNib() { super.awakeFromNib() - webView.backgroundColor = .white - bottom_cons.constant = -(JQ_ScreenH - JQ_ScreenW * 0.9) + bottom_cons.constant = -(JQ_ScreenH - JQ_ScreenW * 0.69) layoutIfNeeded() } @@ -41,15 +41,19 @@ alertView.layoutIfNeeded() } + let attributed = AttributedStringbuilder.build() + if type != .other && type != .matchStore{ Services.queryProtocol(type,progress: false).subscribe(onNext: { result in if let text = result.data?.jq_wrapHtml(){ - alertView.webView.loadHTMLString(text, baseURL: nil) + attributed.add(string: text, withFont: UIFont.systemFont(ofSize: 14, weight: .semibold), withColor: UIColor(hexStr: "727272"), lineSpace: 4) } }).disposed(by: alertView.disposeBag) }else{ - alertView.webView.loadHTMLString(content?.jq_wrapHtml() ?? "", baseURL: nil) + attributed.add(string: content!, withFont: UIFont.systemFont(ofSize: 14, weight: .semibold), withColor: UIColor(hexStr: "727272"), lineSpace: 4) } + alertView.label_content.attributedText = attributed.mutableAttributedString + alertView.label_content.textAlignment = .center } @@ -59,7 +63,7 @@ } @IBAction func completeAction(_ sender: UIButton) { - bottom_cons.constant = -(JQ_ScreenH - JQ_ScreenW * 0.9) + bottom_cons.constant = -(JQ_ScreenH - JQ_ScreenW * 0.69) UIView.animate(withDuration: 0.4) { self.layoutIfNeeded() self.alpha = 0 -- Gitblit v1.7.1