杨锴
2024-11-07 62a24b3c7cf92919a93ee575e9460037e1a53816
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
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
//
//  SettingVC.swift
//  XQMuse
//
//  Created by 无故事王国 on 2024/8/20.
//
 
import UIKit
import JQTools
 
class SettingVC: BaseVC {
 
    @IBOutlet weak var btn_exchange: UIButton!
    @IBOutlet weak var btn_logout: UIButton!
    @IBOutlet weak var btn_dispel: TapBtn!
    @IBOutlet weak var label_version: UILabel!
    
    override func viewDidLoad() {
        super.viewDidLoad()
                                title = "设置"
        navigationController?.navigationBar.standardAppearance.backgroundColor = .white
        navigationController?.navigationBar.scrollEdgeAppearance?.backgroundColor = .white
 
        btn_exchange.isHidden = UserViewModel.getLoginInfo()?.accessToken.isEmpty ?? true
        btn_logout.isHidden = UserViewModel.getLoginInfo()?.accessToken.isEmpty ?? true
        btn_dispel.isHidden = UserViewModel.getLoginInfo()?.accessToken.isEmpty ?? true
 
        if let appVersion = Bundle.main.infoDictionary?["CFBundleShortVersionString"] as? String {
            label_version.text = JQTool.currentVersion()
        }
    }
 
                override func setUI() {
                                super.setUI()
                                view.backgroundColor = UIColor(hexString: "#fafafa")
                }
 
                @IBAction func bindPhoneAction(_ sender: TapBtn) {
        guard sceneDelegate!.checkisLoginState() else {return}
                                let vc = BindAccountVC()
                                push(vc: vc)
                }
 
                @IBAction func cancelCacheAction(_ sender: TapBtn) {
                                JQTool.cleanCache {
                                                alertSuccess(msg: "清理成功")
                                }
                }
 
                @IBAction func aboutUsAction(_ sender: TapBtn) {
                                let vc = WebVC(type: .aboutUs)
                                vc.title = "关于心泉"
                                push(vc: vc)
                }
                
                @IBAction func logoutAction(_ sender: TapBtn) {
                                let vc = LogoutAccountVC()
                                push(vc: vc)
                }
 
                @IBAction func treatyAction(_ sender: TapBtn) {
                                 let vc = TreatyVC()
                                push(vc: vc)
                }
 
    @IBAction func checkVersion(_ sender: TapBtn) {
        JQTool.checkVersion(appid: AppleID) { stat, model, url in
 
        }
    }
 
                @IBAction func exchangeAccountAction(_ sender: UIButton) {
//        CommonAlertView.show(title: "提示", content: "是否切换当前账号?") {[weak self] s in
//            if s{
                sceneDelegate?.needLogin()
                self.btn_exchange.isHidden = true
                self.btn_logout.isHidden = true
                self.btn_dispel.isHidden = true
//            }
//        }
                }
 
                @IBAction func quitAccountAction(_ sender: UIButton) {
//        CommonAlertView.show(title: "提示", content: "是否退出当前账号?") {[weak self] s in
//            if s{
                sceneDelegate?.needLogin()
                self.btn_exchange.isHidden = true
                self.btn_logout.isHidden = true
                self.btn_dispel.isHidden = true
//            }
//        }
                }
}