SelectBusTypeViewController.swift 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  1. //
  2. // SelectBusTypeViewController.swift
  3. // xingchuangke
  4. //
  5. // Created by Virgil on 2019/3/27.
  6. // Copyright © 2019 Virgil. All rights reserved.
  7. //
  8. import UIKit
  9. class SelectBusTypeViewController: BaseViewController {
  10. @IBOutlet weak var btnRight: UIButton!
  11. @IBOutlet weak var btnLeft: UIButton!
  12. var selectIndex = 0
  13. var shopOpen = ShopOpenEntity()
  14. override func viewDidLoad() {
  15. super.viewDidLoad()
  16. self.title = "选择商户类型"
  17. initNavLeftBackButton()
  18. shopOpen.shopType = 0
  19. //156 145
  20. btnRight.setSize(width: (ScreenWidth - 60)/2, height: (ScreenWidth - 60)/2 / 156 * 145)
  21. btnLeft.setSize(width: (ScreenWidth - 60)/2, height: (ScreenWidth - 60)/2 / 156 * 145)
  22. CommonViewUntils.setViewCenter(arrView: [btnLeft, btnRight], marginLeft: 20, marginRight: 20)
  23. //initNavRightButtonForTitle(title: "下一步", color: UIColor.white)
  24. imgViewSelect = UIImageView(frame: CGRect(x: 0, y: 0, width: 57, height: 54))
  25. imgViewSelect.image = UIImage(named: "ion_opening_merchants_14")
  26. btnLeft.addSubview(imgViewSelect)
  27. imgViewSelect.isHidden = true
  28. imgViewSelect.marginRight(right: 5)
  29. }
  30. override func btnRightMenuClick() {
  31. let vc = QuickOpenViewController()
  32. vc.shopOpen = self.shopOpen
  33. toViewController(viewController: vc)
  34. }
  35. var imgViewSelect: UIImageView!
  36. //btnAddTarget(view: self.view, selector: #selector(self.btnMenuClick))
  37. @IBAction func btnMenuClick(_ sender: AnyObject) {
  38. imgViewSelect.isHidden = false
  39. switch (sender as! UIButton).tag {
  40. case 1001: // 个人入网
  41. selectIndex = 0
  42. imgViewSelect.removeFromSuperview()
  43. btnLeft.addSubview(imgViewSelect)
  44. imgViewSelect.marginRight(right: 3)
  45. shopOpen.shopType = 0
  46. btnRightMenuClick()
  47. break
  48. case 1002: // 商户入网
  49. selectIndex = 1
  50. imgViewSelect.removeFromSuperview()
  51. btnRight.addSubview(imgViewSelect)
  52. imgViewSelect.marginRight(right: 3)
  53. shopOpen.shopType = 1
  54. btnRightMenuClick()
  55. break
  56. case 1003: //
  57. break
  58. case 1004: //
  59. break
  60. case 1005: //
  61. break
  62. case 1006: //
  63. break
  64. default:
  65. break
  66. }
  67. }
  68. override func viewWillAppear(_ animated: Bool) {
  69. super.viewWillAppear(animated)
  70. }
  71. override init(nibName nibNameOrNil: String?, bundle nibBundleOrNil: Bundle?) {
  72. super.init(nibName: "SelectBusTypeViewController", bundle: nil)
  73. }
  74. required init?(coder aDecoder: NSCoder) {
  75. fatalError("init(coder:) has not been implemented")
  76. }
  77. }