fix
无故事王国
4 天以前 2aac1ba6449741aedbf97d75c340719a7b67d7db
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
//
//  WorldCupIntroVC.swift
//  WanPai
//
//  Created by 无故事王国 on 2024/2/28.
//
 
import UIKit
import WebKit
import JQTools
 
class WorldCupIntroVC: BaseVC {
                private var webView: WKWebView!
                private var btn:UIButton!
                private var model:BannerModel?
 
                override func viewDidLoad() {
                                super.viewDidLoad()
 
                                Services.getHomeModule().subscribe(onNext: {data in
                                                if let data = data.data{
                                                                self.title = data.title
                                                                self.btn.sd_setBackgroundImage(with: URL(string: data.buttonImage), for: .normal)
                                                                self.btn.imageView?.contentMode = .scaleAspectFit
                                                                self.btn.titleLabel?.font = UIFont.systemFont(ofSize: 15, weight: .medium)
                                                                self.webView.loadHTMLString(data.content.jq_wrapHtml(), baseURL: nil)
                                                                self.btn.isHidden = data.model == "不跳转"
                                                                self.model = data
                                                }
                                }).disposed(by: disposeBag)
                                view.backgroundColor = .white
 
                }
 
                override func setUI() {
                                webView = WKWebView(frame: .zero)
                                view.addSubview(webView)
                                webView.snp.makeConstraints { make in
                                                make.edges.equalToSuperview().inset(UIEdgeInsets(top: 0, left: 0, bottom: 75, right: 0))
                                }
 
                                btn = UIButton(type: .custom)
                                btn.backgroundColor = Def_ThemeColor
                                btn.addTarget(self, action: #selector(jumpAction), for: .touchUpInside)
                                btn.setTitleColor(.white, for: .normal)
                                btn.jq_cornerRadius = 20
                                view.addSubview(btn)
                                btn.snp.makeConstraints { make in
                                                make.left.equalTo(64)
                                                make.right.equalTo(-64)
                                                make.height.equalTo(40)
                                                make.bottom.equalToSuperview().offset(-23)
                                }
                }
 
                @objc func jumpAction(){
                                if let m = model{
                                                jumpPage(model: m.model, page: m.page, type: m.type, id: m.turnId)
                                }
                }
}