PublishShareBottomView.swift 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148
  1. //
  2. // PublishShareBottomView.swift
  3. // RainbowPlanet
  4. //
  5. // Created by Christopher on 2019/6/17.
  6. // Copyright © 2019 RainbowPlanet. All rights reserved.
  7. //
  8. import UIKit
  9. import RxSwift
  10. import RxCocoa
  11. class PublishShareBottomView: BaseView {
  12. override func setupViews() {
  13. self.backgroundColor = kffffffColor
  14. addSubview(titleLabel)
  15. addSubview(wechatBtn)
  16. addSubview(friendsBtn)
  17. addSubview(saveImgBtn)
  18. addSubview(sepView)
  19. addSubview(jumpBtn)
  20. }
  21. override func setupLayouts() {
  22. titleLabel.snp.makeConstraints { (make) in
  23. make.top.equalTo(24)
  24. make.centerX.equalToSuperview()
  25. make.height.equalTo(18)
  26. }
  27. wechatBtn.snp.makeConstraints { (make) in
  28. make.top.equalTo(titleLabel.snp_bottom).offset(20)
  29. make.centerX.equalTo(friendsBtn.snp_centerX).multipliedBy(0.565)
  30. make.width.equalTo(50)
  31. make.height.equalTo(69)
  32. }
  33. wechatBtn.layoutButton(edgeInsetsStyle: ButtonEdgeInsetsStyle.top, imageTitleSpace: 4)
  34. friendsBtn.snp.makeConstraints { (make) in
  35. make.top.equalTo(titleLabel.snp_bottom).offset(20)
  36. make.centerX.equalToSuperview()
  37. make.width.equalTo(50)
  38. make.height.equalTo(69)
  39. }
  40. friendsBtn.layoutButton(edgeInsetsStyle: ButtonEdgeInsetsStyle.top, imageTitleSpace: 4)
  41. saveImgBtn.snp.makeConstraints { (make) in
  42. make.top.equalTo(titleLabel.snp_bottom).offset(20)
  43. make.centerX.equalTo(friendsBtn.snp_centerX).multipliedBy(1.435)
  44. make.width.equalTo(50)
  45. make.height.equalTo(69)
  46. }
  47. saveImgBtn.layoutButton(edgeInsetsStyle: ButtonEdgeInsetsStyle.top, imageTitleSpace: 4)
  48. sepView.snp.makeConstraints { (make) in
  49. make.left.right.equalToSuperview()
  50. make.height.equalTo(1)
  51. make.bottom.equalTo(-44)
  52. }
  53. jumpBtn.snp.makeConstraints { (make) in
  54. make.centerX.equalToSuperview()
  55. make.bottom.equalToSuperview()
  56. make.width.equalTo(160)
  57. make.height.equalTo(44)
  58. }
  59. }
  60. private lazy var titleLabel: UILabel = {
  61. let titleLabel = UILabel()
  62. titleLabel.text = "向好友传递美好生活,收货更多彩虹豆"
  63. titleLabel.textColor = k333333Color
  64. titleLabel.font = kRegularFont16
  65. return titleLabel
  66. }()
  67. private lazy var wechatBtn: UIButton = {
  68. let wechatBtn = UIButton(type: UIButton.ButtonType.custom)
  69. wechatBtn.setTitle("微信", for: UIControl.State.normal)
  70. wechatBtn.setTitleColor(k333333Color, for: UIControl.State.normal)
  71. wechatBtn.setImage(kImage(name: "edit_pic_wechat"), for: UIControl.State.normal)
  72. wechatBtn.titleLabel?.font = kRegularFont11
  73. wechatBtn.rx.tap.subscribe(onNext: { [weak self] (data) in
  74. // if let allSelectBlock = self?.allSelectBlock {
  75. // let isAllSel: Int = wechatBtn.isSelected == true ? 1 : 0
  76. // allSelectBlock(isAllSel)
  77. // }
  78. print("----点击了-微信")
  79. }).disposed(by: disposeBag)
  80. return wechatBtn
  81. }()
  82. private lazy var friendsBtn: UIButton = {
  83. let friendsBtn = UIButton(type: UIButton.ButtonType.custom)
  84. friendsBtn.setTitle("朋友圈", for: UIControl.State.normal)
  85. friendsBtn.setTitleColor(k333333Color, for: UIControl.State.normal)
  86. friendsBtn.setImage(kImage(name: "edit_pic_moments"), for: UIControl.State.normal)
  87. friendsBtn.titleLabel?.font = kRegularFont11
  88. friendsBtn.rx.tap.subscribe(onNext: { [weak self] (data) in
  89. // if let allSelectBlock = self?.allSelectBlock {
  90. // let isAllSel: Int = wechatBtn.isSelected == true ? 1 : 0
  91. // allSelectBlock(isAllSel)
  92. // }
  93. print("----点击了-朋友圈")
  94. }).disposed(by: disposeBag)
  95. return friendsBtn
  96. }()
  97. private lazy var saveImgBtn: UIButton = {
  98. let saveImgBtn = UIButton(type: UIButton.ButtonType.custom)
  99. saveImgBtn.setTitle("保存图片", for: UIControl.State.normal)
  100. saveImgBtn.setTitleColor(k333333Color, for: UIControl.State.normal)
  101. saveImgBtn.setImage(kImage(name: "edit_pic_download"), for: UIControl.State.normal)
  102. saveImgBtn.titleLabel?.font = kRegularFont11
  103. saveImgBtn.rx.tap.subscribe(onNext: { [weak self] (data) in
  104. // if let allSelectBlock = self?.allSelectBlock {
  105. // let isAllSel: Int = wechatBtn.isSelected == true ? 1 : 0
  106. // allSelectBlock(isAllSel)
  107. // }
  108. print("----点击了-保存图片")
  109. }).disposed(by: disposeBag)
  110. return saveImgBtn
  111. }()
  112. private lazy var sepView: UIView = {
  113. let sepView = UIView()
  114. sepView.backgroundColor = kDDDDDDColor
  115. return sepView
  116. }()
  117. private lazy var jumpBtn: UIButton = {
  118. let jumpBtn = UIButton(type: UIButton.ButtonType.custom)
  119. jumpBtn.setTitle("去首页", for: UIControl.State.normal)
  120. jumpBtn.titleLabel?.font = kRegularFont16
  121. jumpBtn.setTitleColor(k333333Color, for: .normal)
  122. jumpBtn.rx.tap.subscribe(onNext: { [weak self] (data) in
  123. // if let orderPayBlock = self?.orderPayBlock {
  124. // orderPayBlock()
  125. // }
  126. print("----点击了-去首页")
  127. }).disposed(by: disposeBag)
  128. return jumpBtn
  129. }()
  130. }