| | |
| | | @IBOutlet weak var btn_logout: UIButton! |
| | | @IBOutlet weak var btn_dispel: TapBtn! |
| | | @IBOutlet weak var label_version: UILabel! |
| | | |
| | | @IBOutlet weak var btn_newVersion: UIButton! |
| | | private var model:VersionResultModel? |
| | | |
| | | override func viewDidLoad() { |
| | | super.viewDidLoad() |
| | | title = "设置" |
| | | btn_newVersion.isHidden = true |
| | | navigationController?.navigationBar.standardAppearance.backgroundColor = .white |
| | | navigationController?.navigationBar.scrollEdgeAppearance?.backgroundColor = .white |
| | | |
| | |
| | | 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() |
| | | label_version.text = JQTool.currentVersion() |
| | | |
| | | JQTool.checkVersion(appid: AppleID) { state, model, url in |
| | | if state{ |
| | | DispatchQueue.main.async { |
| | | self.btn_newVersion.isHidden = false |
| | | self.model = model |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | override func setUI() { |
| | | super.setUI() |
| | | view.backgroundColor = UIColor(hexString: "#fafafa") |
| | | btn_newVersion.jq_cornerRadius = 13.5 |
| | | } |
| | | |
| | | @IBAction func bindPhoneAction(_ sender: TapBtn) { |
| | |
| | | } |
| | | |
| | | @IBAction func checkVersion(_ sender: TapBtn) { |
| | | JQTool.checkVersion(appid: AppleID) { stat, model, url in |
| | | if stat{ |
| | | CommonAlertView.show(title: "版本更新", content: "发现新版本,是否更新?") { s in |
| | | if let u = url, s == true{ |
| | | UIApplication.shared.open(u) |
| | | } |
| | | } |
| | | }else{ |
| | | alert(msg: "当前已是最新版本") |
| | | } |
| | | } |
| | | // JQTool.checkVersion(appid: AppleID) { stat, model, url in |
| | | // if stat{ |
| | | // CommonAlertView.show(title: "版本更新", content: "发现新版本,是否更新?") { s in |
| | | // if let u = url, s == true{ |
| | | // UIApplication.shared.open(u) |
| | | // } |
| | | // } |
| | | // }else{ |
| | | // alert(msg: "当前已是最新版本") |
| | | // } |
| | | // } |
| | | } |
| | | |
| | | @IBAction func newVersionAction(_ sender: Any) { |
| | | if let m = model{ |
| | | UIApplication.shared.open(URL(string: m.trackViewUrl)!) |
| | | } |
| | | } |
| | | |
| | | @IBAction func exchangeAccountAction(_ sender: UIButton) { |
| | | // CommonAlertView.show(title: "提示", content: "是否切换当前账号?") {[weak self] s in |
| | | // if s{ |