杨锴
2024-09-05 586eb879891e852e50302206470149766c35ee08
XQMuse/Root/Login/VC/LoginTreatyVC.swift
@@ -12,7 +12,8 @@
class LoginTreatyVC: BaseVC {
            @IBOutlet weak var view_menu: UIView!
            @IBOutlet weak var view_content: UIView!
            var topIndex = 0
            private(set) var pageMenu:SPPageMenu = {
                        let pageMenu = SPPageMenu(frame: .zero, trackerStyle: .line)
                        // 追踪线
@@ -50,6 +51,8 @@
                        pageVC.scrollview.bounces = false
                        return pageVC
            }()
            private var clouse:((Bool)->Void)!
            override func viewWillAppear(_ animated: Bool) {
                        super.viewWillAppear(animated)
                        UIView.animate(withDuration: 0.5) {
@@ -65,10 +68,16 @@
    override func viewDidLoad() {
        super.viewDidLoad()
                        view.backgroundColor = UIColor.black.withAlphaComponent(0)
                        DispatchQueue.main.asyncAfter(delay: 0.1) {
                                    self.pageMenu.selectedItemIndex = self.topIndex
                                    self.pageViewController.scroll(toPage: self.topIndex, animation: true)
                        }
    }
            override func setUI() {
                        view_menu.addSubview(pageMenu)
                        pageMenu.delegate = self
                        pageMenu.snp.makeConstraints { make in
                                    make.edges.equalToSuperview()
                        }
@@ -82,12 +91,18 @@
                        }
            }
            func clickHandle(_ clouse:@escaping (Bool)->Void){
                        self.clouse = clouse
            }
            @IBAction func rejectAction(_ sender: UIButton) {
                        dismiss(animated: true)
                        clouse(false)
            }
            @IBAction func completeAction(_ sender: UIButton) {
                        dismiss(animated: true)
                        clouse(true)
            }
}
@@ -109,6 +124,14 @@
            }
            func pageViewController(_ pageViewConteoller: FFPageViewController, controllerForPage page: Int) -> UIViewController {
                        return WebVC(url: "https://www.baidu.com")
                        var agreementType:AgreementType = .none
                        if page == 0{
                                    agreementType = .user
                        }else{
                                    agreementType = .privacy
                        }
                        return WebVC(type: agreementType)
            }
}