杨锴
2024-11-08 529f3c6b775dc75869f978f7403ac50c5343b4e4
XQMuse/Root/Other/WebVC.swift
@@ -25,13 +25,14 @@
            """
            public var tintColor = UIColor.blue
    private var subVC:Bool = false
            public convenience init(url:String) {
                        self.init()
                        self.url = url
            }
            public convenience init(type:AgreementType){
    public convenience init(type:AgreementType,subVC:Bool = false){
                        self.init()
                        self.type = type
            }
@@ -54,7 +55,7 @@
                        webView?.addObserver(self, forKeyPath: "estimatedProgress", options: .new, context: nil)
                        view.addSubview(webView!)
                        webView?.snp.makeConstraints({ (make) in
            make.top.equalToSuperview().offset(UIDevice.jq_safeEdges.top)
            make.top.equalToSuperview().offset(subVC ? UIDevice.jq_safeEdges.top:0)
                                    make.left.right.bottom.equalToSuperview()
                        })
@@ -76,7 +77,7 @@
                        if type != nil{
                                    Services.agreementBy(type!).subscribe(onNext: {data in
                                                if let model = data.data{
                                                            self.webView?.loadHTMLString(model.content.jq_wrapHtml(), baseURL: nil)
                    self.webView?.loadHTMLString(model.content.jq_wrapHtml(edge: UIEdgeInsets(top: 0, left: 5, bottom: 0, right: 5)), baseURL: nil)
                                                }
                                    }).disposed(by: disposeBag)
                        }