InviteViewControllerBack.swift 3.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  1. //
  2. // InviteViewController.swift
  3. // xingchuangke
  4. //
  5. // Created by Virgil on 2019/3/23.
  6. // Copyright © 2019 Virgil. All rights reserved.
  7. //
  8. import UIKit
  9. class InviteViewControllerBack: BaseViewController {
  10. @IBOutlet weak var viewMenu1: UIView!
  11. @IBOutlet weak var viewMenu2: UIView!
  12. @IBOutlet weak var viewMenu3: UIView!
  13. @IBOutlet weak var viewBottomContent: UIView!
  14. @IBOutlet weak var viewBottom: UIView!
  15. @IBOutlet weak var imgShow: UIImageView!
  16. @IBOutlet weak var viewContent: UIView!
  17. var viewCode: ShareCodeView!
  18. override func viewDidLoad() {
  19. super.viewDidLoad()
  20. self.title = "邀请好友"
  21. let viewNav = (CommonViewUntils.getViewForXIB(xibName: "NavView") as! NavView)
  22. viewNav.initView(title: "邀请好友") {[weak self] (index, _) in
  23. if index == 0 {
  24. self!.handleBack()
  25. }
  26. }
  27. self.view.addSubview(viewNav)
  28. viewNav.marginTop(top: 0)
  29. viewContent.marginTop(top: -64, view: viewNav)
  30. imgShow.setSizeHeight(height: imgShow.width() / 1154 * 1249)
  31. viewBottomContent.setSizeHeight(height: imgShow.bottom() + 148)
  32. viewBottom.setSizeWidth(width: ScreenWidth)
  33. viewBottom.setCornerRadius(size: 8)
  34. viewMenu1.setSizeWidth(width: ScreenWidth / 2)
  35. viewMenu2.setSizeWidth(width: ScreenWidth / 2)
  36. viewMenu2.marginLeft(left: 0, view: viewMenu1)
  37. viewCode = (CommonViewUntils.getViewForXIB(xibName: "ShareCodeView") as! ShareCodeView)
  38. viewCode.initView()
  39. let image2 = CommonBarCodeTools.setupQRCodeImage("\(RequestURL.userRecCode)?recCode=\(CommonValue.getUserRecCode())", image: UIImage(named: "icon"))
  40. viewCode.imgView.image = image2
  41. }
  42. //btnAddTarget(view: self.view, selector: #selector(self.btnMenuClick))
  43. @IBAction func btnMenuClick(_ sender: AnyObject) {
  44. switch (sender as! UIButton).tag {
  45. case 1001: //
  46. CommonUMengShare.showSharedMenu(viewController: self, title: "立即注册,开启您的财富之旅", desc: "POS机办理,信用卡申请,积分换钱......", icon: UIImage(named: "icon")!, url: "\(RequestURL.userRecCode)?recCode=\(CommonValue.getUserRecCode())")
  47. break
  48. case 1002: //
  49. appDelegate.navController.showBackgroudView(viewContent: viewCode, isCenter: true)
  50. break
  51. case 1003: //
  52. break
  53. case 1004: //
  54. break
  55. case 1005: //
  56. break
  57. case 1006: //
  58. break
  59. default:
  60. break
  61. }
  62. }
  63. override func viewWillAppear(_ animated: Bool) {
  64. super.viewWillAppear(animated)
  65. setNavLineHidden(hidden: true)
  66. appDelegate.setNavigationBarHidden(isHidden: true)
  67. }
  68. override init(nibName nibNameOrNil: String?, bundle nibBundleOrNil: Bundle?) {
  69. super.init(nibName: "InviteViewControllerBack", bundle: nil)
  70. }
  71. required init?(coder aDecoder: NSCoder) {
  72. fatalError("init(coder:) has not been implemented")
  73. }
  74. }