无故事王国
2023-10-19 eb795a6523edbc0fe3a3b1a3d3bea1063041efd5
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!
   @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