无故事王国
2024-07-24 59bd9f792891efa0d0d69f256e1a146c44c944db
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
//
//  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 {
                                                
                                }
                }
}