|
@@ -0,0 +1,147 @@
|
|
|
+//
|
|
|
+// PublishShareBottomView.swift
|
|
|
+// RainbowPlanet
|
|
|
+//
|
|
|
+// Created by Christopher on 2019/6/17.
|
|
|
+// Copyright © 2019 RainbowPlanet. All rights reserved.
|
|
|
+//
|
|
|
+
|
|
|
+import UIKit
|
|
|
+import RxSwift
|
|
|
+import RxCocoa
|
|
|
+
|
|
|
+class PublishShareBottomView: BaseView {
|
|
|
+
|
|
|
+ override func setupViews() {
|
|
|
+ self.backgroundColor = kffffffColor
|
|
|
+
|
|
|
+ addSubview(titleLabel)
|
|
|
+ addSubview(wechatBtn)
|
|
|
+ addSubview(friendsBtn)
|
|
|
+ addSubview(saveImgBtn)
|
|
|
+ addSubview(sepView)
|
|
|
+ addSubview(jumpBtn)
|
|
|
+ }
|
|
|
+
|
|
|
+ override func setupLayouts() {
|
|
|
+ titleLabel.snp.makeConstraints { (make) in
|
|
|
+ make.top.equalTo(24)
|
|
|
+ make.centerX.equalToSuperview()
|
|
|
+ make.height.equalTo(18)
|
|
|
+ }
|
|
|
+
|
|
|
+ wechatBtn.snp.makeConstraints { (make) in
|
|
|
+ make.top.equalTo(titleLabel.snp_bottom).offset(20)
|
|
|
+ make.centerX.equalTo(friendsBtn.snp_centerX).multipliedBy(0.565)
|
|
|
+ make.width.equalTo(50)
|
|
|
+ make.height.equalTo(69)
|
|
|
+ }
|
|
|
+ wechatBtn.layoutButton(edgeInsetsStyle: ButtonEdgeInsetsStyle.top, imageTitleSpace: 4)
|
|
|
+
|
|
|
+ friendsBtn.snp.makeConstraints { (make) in
|
|
|
+ make.top.equalTo(titleLabel.snp_bottom).offset(20)
|
|
|
+ make.centerX.equalToSuperview()
|
|
|
+ make.width.equalTo(50)
|
|
|
+ make.height.equalTo(69)
|
|
|
+ }
|
|
|
+ friendsBtn.layoutButton(edgeInsetsStyle: ButtonEdgeInsetsStyle.top, imageTitleSpace: 4)
|
|
|
+
|
|
|
+ saveImgBtn.snp.makeConstraints { (make) in
|
|
|
+ make.top.equalTo(titleLabel.snp_bottom).offset(20)
|
|
|
+ make.centerX.equalTo(friendsBtn.snp_centerX).multipliedBy(1.435)
|
|
|
+ make.width.equalTo(50)
|
|
|
+ make.height.equalTo(69)
|
|
|
+ }
|
|
|
+ saveImgBtn.layoutButton(edgeInsetsStyle: ButtonEdgeInsetsStyle.top, imageTitleSpace: 4)
|
|
|
+
|
|
|
+ sepView.snp.makeConstraints { (make) in
|
|
|
+ make.left.right.equalToSuperview()
|
|
|
+ make.height.equalTo(1)
|
|
|
+ make.bottom.equalTo(-44)
|
|
|
+ }
|
|
|
+
|
|
|
+ jumpBtn.snp.makeConstraints { (make) in
|
|
|
+ make.centerX.equalToSuperview()
|
|
|
+ make.bottom.equalToSuperview()
|
|
|
+ make.width.equalTo(160)
|
|
|
+ make.height.equalTo(44)
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ private lazy var titleLabel: UILabel = {
|
|
|
+ let titleLabel = UILabel()
|
|
|
+ titleLabel.text = "向好友传递美好生活,收货更多彩虹豆"
|
|
|
+ titleLabel.textColor = k333333Color
|
|
|
+ titleLabel.font = kRegularFont16
|
|
|
+ return titleLabel
|
|
|
+ }()
|
|
|
+
|
|
|
+ private lazy var wechatBtn: UIButton = {
|
|
|
+ let wechatBtn = UIButton(type: UIButton.ButtonType.custom)
|
|
|
+ wechatBtn.setTitle("微信", for: UIControl.State.normal)
|
|
|
+ wechatBtn.setTitleColor(k333333Color, for: UIControl.State.normal)
|
|
|
+ wechatBtn.setImage(kImage(name: "edit_pic_wechat"), for: UIControl.State.normal)
|
|
|
+ wechatBtn.titleLabel?.font = kRegularFont11
|
|
|
+ wechatBtn.rx.tap.subscribe(onNext: { [weak self] (data) in
|
|
|
+// if let allSelectBlock = self?.allSelectBlock {
|
|
|
+// let isAllSel: Int = wechatBtn.isSelected == true ? 1 : 0
|
|
|
+// allSelectBlock(isAllSel)
|
|
|
+// }
|
|
|
+ print("----点击了-微信")
|
|
|
+ }).disposed(by: disposeBag)
|
|
|
+ return wechatBtn
|
|
|
+ }()
|
|
|
+
|
|
|
+ private lazy var friendsBtn: UIButton = {
|
|
|
+ let friendsBtn = UIButton(type: UIButton.ButtonType.custom)
|
|
|
+ friendsBtn.setTitle("朋友圈", for: UIControl.State.normal)
|
|
|
+ friendsBtn.setTitleColor(k333333Color, for: UIControl.State.normal)
|
|
|
+ friendsBtn.setImage(kImage(name: "edit_pic_moments"), for: UIControl.State.normal)
|
|
|
+ friendsBtn.titleLabel?.font = kRegularFont11
|
|
|
+ friendsBtn.rx.tap.subscribe(onNext: { [weak self] (data) in
|
|
|
+// if let allSelectBlock = self?.allSelectBlock {
|
|
|
+// let isAllSel: Int = wechatBtn.isSelected == true ? 1 : 0
|
|
|
+// allSelectBlock(isAllSel)
|
|
|
+// }
|
|
|
+ print("----点击了-朋友圈")
|
|
|
+ }).disposed(by: disposeBag)
|
|
|
+ return friendsBtn
|
|
|
+ }()
|
|
|
+
|
|
|
+ private lazy var saveImgBtn: UIButton = {
|
|
|
+ let saveImgBtn = UIButton(type: UIButton.ButtonType.custom)
|
|
|
+ saveImgBtn.setTitle("保存图片", for: UIControl.State.normal)
|
|
|
+ saveImgBtn.setTitleColor(k333333Color, for: UIControl.State.normal)
|
|
|
+ saveImgBtn.setImage(kImage(name: "edit_pic_download"), for: UIControl.State.normal)
|
|
|
+ saveImgBtn.titleLabel?.font = kRegularFont11
|
|
|
+ saveImgBtn.rx.tap.subscribe(onNext: { [weak self] (data) in
|
|
|
+// if let allSelectBlock = self?.allSelectBlock {
|
|
|
+// let isAllSel: Int = wechatBtn.isSelected == true ? 1 : 0
|
|
|
+// allSelectBlock(isAllSel)
|
|
|
+// }
|
|
|
+ print("----点击了-保存图片")
|
|
|
+ }).disposed(by: disposeBag)
|
|
|
+ return saveImgBtn
|
|
|
+ }()
|
|
|
+
|
|
|
+ private lazy var sepView: UIView = {
|
|
|
+ let sepView = UIView()
|
|
|
+ sepView.backgroundColor = kDDDDDDColor
|
|
|
+ return sepView
|
|
|
+ }()
|
|
|
+
|
|
|
+ private lazy var jumpBtn: UIButton = {
|
|
|
+ let jumpBtn = UIButton(type: UIButton.ButtonType.custom)
|
|
|
+ jumpBtn.setTitle("去首页", for: UIControl.State.normal)
|
|
|
+ jumpBtn.titleLabel?.font = kRegularFont16
|
|
|
+ jumpBtn.setTitleColor(k333333Color, for: .normal)
|
|
|
+ jumpBtn.rx.tap.subscribe(onNext: { [weak self] (data) in
|
|
|
+// if let orderPayBlock = self?.orderPayBlock {
|
|
|
+// orderPayBlock()
|
|
|
+// }
|
|
|
+ print("----点击了-去首页")
|
|
|
+ }).disposed(by: disposeBag)
|
|
|
+ return jumpBtn
|
|
|
+ }()
|
|
|
+
|
|
|
+}
|