12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182 |
- //
- // SettingViewController.swift
- // CommonFrame
- //
- // Created by Virgil on 2019/1/26.
- // Copyright © 2019 Virgil. All rights reserved.
- //
- import UIKit
- class SafeSettingViewController: BaseViewController {
- @IBOutlet weak var lblVersion: UILabel!
- @IBOutlet weak var rad2: UISwitch!
- @IBOutlet weak var rad1: UISwitch!
- override func viewDidLoad() {
- super.viewDidLoad()
- initNavLeftBackButton()
- self.title = "安全设置"
- rad1.setSize(x: 0.75, y: 0.7)
- rad2.setSize(x: 0.75, y: 0.7)
- lblVersion.text = CommonUntils.getSystemVersion()
- }
- @IBAction func chkChange(_ sender: UISwitch) {
- if(sender.tag == 1001) //登录密码
- {
- if rad1.isOn {
- CommonValue.setDefaultUserInfoForString(value: "1", key: "common_default_is_alert_hb_sound")
- } else {
- CommonValue.setDefaultUserInfoForString(value: "0", key: "common_default_is_alert_hb_sound")
- }
- } else if(sender.tag == 1002) //手势密码
- {
- if rad2.isOn {
- toViewController(viewController: GuesturePasswordViewController())
- } else {
- DBGuestureLock.clearPassword()
- CommonValue.setDefaultUserInfoForString(value: "0", key: "common_default_is_ss_password")
- }
- // CommonLocalAuthentication.localAuthentication();
- //toViewController(viewController: GuesturePasswordViewController());
- }
- }
- @IBAction func btnModPasswordClick(_ sender: Any) {
- let vc = ForgetPasswordViewController()
- vc.type = 1
- toViewController(viewController: vc)
- }
-
- @IBAction func btnClick(_ sender: Any) {
- if CommonUntils.getIsSimulator() {
- SVProgressHUD.showError(withStatus: "模拟器环境下不能拨打电话")
- } else {
- if CommonValue.getDefaultValueForKey(key: "customer_phone") != "" {
- CommonUntils.callPhone(phone: CommonValue.getDefaultValueForKey(key: "customer_phone"))
- }
- }
- }
- override func viewWillAppear(_ animated: Bool) {
- super.viewWillAppear(animated)
- if CommonValue.getDefaultUserInfoForString(key: "common_default_is_alert_hb_sound") == "0" {
- rad1.isOn = false
- } else {
- rad1.isOn = true
- }
- if CommonValue.getDefaultUserInfoForString(key: "common_default_is_ss_password") == "0" {
- rad2.isOn = false
- } else {
- rad2.isOn = true
- }
- }
- override init(nibName nibNameOrNil: String?, bundle nibBundleOrNil: Bundle?) {
- super.init(nibName: "SafeSettingViewController", bundle: nil)
- }
- required init?(coder aDecoder: NSCoder) {
- fatalError("init(coder:) has not been implemented")
- }
- }
|