//
|
// VIPAgreementVC.swift
|
// XQMuse
|
//
|
// Created by 无故事王国 on 2024/11/8.
|
//
|
|
import UIKit
|
import WebKit
|
|
class VIPAgreementVC: BaseVC {
|
|
@IBOutlet weak var label_title: UILabel!
|
@IBOutlet weak var webView: WKWebView!
|
@IBOutlet weak var view_container: UIView!
|
@IBOutlet weak var btn_reject: UIButton!
|
@IBOutlet weak var btn_agreement: UIButton!
|
|
private var textTitle = ""
|
private var content:String = ""
|
private var clouse:(()->Void)?
|
|
init(title:String,content:String,clouse:@escaping ()->Void) {
|
super.init(nibName: nil, bundle: nil)
|
self.textTitle = title
|
self.content = content
|
self.clouse = clouse
|
}
|
|
required init?(coder: NSCoder) {
|
fatalError("init(coder:) has not been implemented")
|
}
|
|
override func viewDidLoad() {
|
super.viewDidLoad()
|
|
view.alpha = 0
|
view.backgroundColor = .black.withAlphaComponent(0.7)
|
label_title.text = textTitle
|
|
btn_reject.jq_borderColor = UIColor(hexString: "#8AAE65")
|
btn_reject.jq_borderWidth = 1
|
|
view_container.jq_cornerRadius = 10
|
btn_reject.jq_cornerRadius = 22
|
btn_agreement.jq_cornerRadius = 22
|
|
webView.loadHTMLString(content.jq_wrapHtml(edge: UIEdgeInsets(top: 0, left: 5, bottom: 0, right: 5)), baseURL: nil)
|
|
UIView.animate(withDuration: 0.5) {
|
self.view.alpha = 1.0
|
}
|
}
|
|
|
override func viewDidLayoutSubviews() {
|
super.viewDidLayoutSubviews()
|
btn_agreement.localGradientColor(cornerRadius: 22)
|
}
|
|
@IBAction func rejectAction(_ sender: UIButton) {
|
UIView.animate(withDuration: 0.5) {
|
self.view.alpha = 0
|
} completion: { _ in
|
self.dismiss(animated: true)
|
}
|
}
|
|
@IBAction func agreementAction(_ sender: UIButton) {
|
UIView.animate(withDuration: 0.5) {
|
self.view.alpha = 0
|
} completion: { _ in
|
self.dismiss(animated: true)
|
self.clouse?()
|
}
|
}
|
}
|