ShopManagerViewController.swift 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  1. //
  2. // ShopManagerViewController.swift
  3. // xingchuangke
  4. //
  5. // Created by Virgil on 2019/3/28.
  6. // Copyright © 2019 Virgil. All rights reserved.
  7. //
  8. import UIKit
  9. class ShopManagerViewController: BaseViewController {
  10. @IBOutlet weak var viewMenu1: UIView!
  11. @IBOutlet weak var viewMenu2: UIView!
  12. @IBOutlet weak var viewMenu3: UIView!
  13. @IBOutlet weak var viewMenu4: UIView!
  14. @IBOutlet weak var viewMenuContent: UIView!
  15. @IBOutlet weak var btnOpen: UIButton!
  16. @IBOutlet weak var imgBackgroud: UIImageView!
  17. override func viewDidLoad() {
  18. super.viewDidLoad()
  19. self.title = "开通商户"
  20. imgBackgroud.marginTop(top: 0)
  21. imgBackgroud.setSizeHeight(height: ScreenWidth / 375 * 271)
  22. let viewHeader = CommonViewUntils.getViewForXIB(xibName: "NavView") as! NavView
  23. viewHeader.initView(title: "开通商户") {[weak self] (index, _) in
  24. if index == 0 {
  25. self!.handleBack()
  26. } else {
  27. let vc = SNCheckViewController()
  28. vc.type = 0
  29. self!.toViewController(viewController: vc)
  30. }
  31. }
  32. viewHeader.initRightBtn(title: "SN码查询")
  33. viewHeader.imgBackgroud.isHidden = true
  34. self.view.addSubview(viewHeader)
  35. viewHeader.marginTop(top: 0)
  36. btnOpen.marginTop(top: (imgBackgroud.height() - viewHeader.bottom() - btnOpen.height() ) / 2 - 20, view: viewHeader)
  37. CommonViewUntils.setViewAverage(arrView: [viewMenu1, viewMenu2], marginLeft: 15, marginRight: 5, between: 5)
  38. CommonViewUntils.setViewAverage(arrView: [viewMenu3, viewMenu4], marginLeft: 15, marginRight: 5, between: 5)
  39. viewMenuContent.marginTop(top: 15, view: imgBackgroud)
  40. }
  41. @IBAction func btnMenuClick(_ sender: AnyObject) {
  42. switch (sender as! UIButton).tag {
  43. case 1001: // 开通商户
  44. toViewController(viewController: SelectPayBrandViewController())
  45. break
  46. case 1002: // 未提交
  47. let vc = ShopListViewController()
  48. vc.type = 0
  49. toViewController(viewController: vc)
  50. break
  51. case 1003: // 待修改
  52. let vc = ShopListViewController()
  53. vc.type = 1
  54. toViewController(viewController: vc)
  55. break
  56. case 1004: // 审核中
  57. let vc = ShopListViewController()
  58. vc.type = 2
  59. toViewController(viewController: vc)
  60. break
  61. case 1005: // 审核通过
  62. let vc = ShopListViewController()
  63. vc.type = 3
  64. toViewController(viewController: vc)
  65. break
  66. case 1006: //
  67. break
  68. default:
  69. break
  70. }
  71. }
  72. override func viewWillAppear(_ animated: Bool) {
  73. super.viewWillAppear(animated)
  74. appDelegate.setNavigationBarHidden(isHidden: true)
  75. }
  76. override init(nibName nibNameOrNil: String?, bundle nibBundleOrNil: Bundle?) {
  77. super.init(nibName: "ShopManagerViewController", bundle: nil)
  78. }
  79. required init?(coder aDecoder: NSCoder) {
  80. fatalError("init(coder:) has not been implemented")
  81. }
  82. }