| | |
| | | """ |
| | | |
| | | 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 |
| | | } |
| | |
| | | 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() |
| | | }) |
| | | |
| | |
| | | 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) |
| | | } |