//
|
// VIPCenterVC.swift
|
// DolphinEnglishLearnStudent
|
//
|
// Created by 无故事王国 on 2024/7/1.
|
//
|
|
import UIKit
|
import WebKit
|
|
class VIPCenterVC: BaseVC {
|
|
private var btn_vip:UIButton!
|
private var webView:WKWebView!
|
|
override func viewDidLoad() {
|
super.viewDidLoad()
|
|
yy_popBlock = {[weak self] () in
|
guard let weakSelf = self else { return }
|
var toVC:UIViewController?
|
for subVC in weakSelf.navigationController?.viewControllers ?? []{
|
if subVC.isKind(of: HomeListenVC.self){
|
toVC = subVC;break
|
}
|
}
|
|
if toVC != nil{
|
weakSelf.navigationController?.popToViewController(toVC!, animated: true)
|
}else{
|
weakSelf.navigationController?.popViewController(animated: true)
|
}
|
}
|
|
Services.vipInfo().subscribe(onNext: {data in
|
if let model = data.data?.first{
|
self.webView.loadHTMLString(model.info.jq_wrapHtml(edge: UIEdgeInsets(top: 0, left: 10, bottom: 3, right: 0)), baseURL: nil)
|
}
|
}).disposed(by: disposeBag)
|
}
|
|
override func setUI() {
|
|
view.backgroundColor = .white
|
webView = WKWebView(frame: .zero)
|
view.addSubview(webView)
|
webView.snp.makeConstraints { make in
|
make.left.right.top.equalToSuperview()
|
make.bottom.equalToSuperview().offset(-150)
|
}
|
|
|
btn_vip = UIButton(type: .custom)
|
btn_vip.setTitle("成为会员", for: .normal)
|
btn_vip.setTitleColor(.white, for: .normal)
|
btn_vip.backgroundColor = UIColor(hexStr: "#41A2EB")
|
btn_vip.titleLabel?.font = .systemFont(ofSize: 16, weight: .medium)
|
btn_vip.addTarget(self, action: #selector(becomeVIPAction), for: .touchUpInside)
|
btn_vip.jq_cornerRadius = 8
|
view.addSubview(btn_vip)
|
btn_vip.snp.makeConstraints { make in
|
make.width.equalTo(316)
|
make.height.equalTo(49)
|
make.bottom.equalTo(-91)
|
make.centerX.equalToSuperview()
|
}
|
}
|
|
@objc func becomeVIPAction(){
|
ParentVerifiyView.show {
|
|
}
|
}
|
}
|