SInfoAndSecurityViewController.swift 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. //
  2. // SInfoAndSecurityViewController.swift
  3. // O2Platform
  4. //
  5. // Created by 刘振兴 on 2016/10/17.
  6. // Copyright © 2016年 zoneland. All rights reserved.
  7. //
  8. import UIKit
  9. import Eureka
  10. import O2OA_Auth_SDK
  11. class SInfoAndSecurityViewController: FormViewController {
  12. override func viewDidLoad() {
  13. super.viewDidLoad()
  14. let account = O2AuthSDK.shared.myInfo()
  15. let isSecurity = AppConfigSettings.shared.accountIsSecurity
  16. LabelRow.defaultCellUpdate = {
  17. cell,row in
  18. cell.textLabel?.font = setting_content_textFont
  19. cell.textLabel?.textColor = setting_content_textColor
  20. cell.detailTextLabel?.font = setting_value_textFont
  21. cell.detailTextLabel?.textColor = setting_value_textColor
  22. cell.accessoryType = .disclosureIndicator
  23. }
  24. form +++ Section()
  25. <<< LabelRow(){
  26. $0.title = "帐号保护"
  27. $0.value = (isSecurity == true ? "已保护":"未保护")
  28. }.onCellSelection({ (cell, row) in
  29. self.performSegue(withIdentifier: "showAccountSecSegue", sender: nil)
  30. })
  31. +++ Section()
  32. <<< LabelRow(){
  33. $0.title = "登录帐号"
  34. $0.value = account?.name
  35. }
  36. <<< LabelRow(){
  37. $0.title = "登录密码"
  38. $0.value = "修改密码"
  39. }.onCellSelection({ (cell,row) in
  40. self.performSegue(withIdentifier: "showPassworChangeSegue", sender: nil)
  41. })
  42. if O2IsConnect2Collect {
  43. let mobile = O2AuthSDK.shared.bindDevice()?.mobile
  44. form +++ Section()
  45. <<< LabelRow() {
  46. $0.title = "变更手机号码"
  47. $0.value = mobile
  48. }.onCellSelection({ (cell,row) in
  49. self.performSegue(withIdentifier: "showMobileChangeSegue", sender: nil)
  50. })
  51. }
  52. }
  53. override func didReceiveMemoryWarning() {
  54. super.didReceiveMemoryWarning()
  55. // Dispose of any resources that can be recreated.
  56. }
  57. }