|
@@ -15,6 +15,7 @@ class ShoppingCartListTableViewHeader: BaseView {
|
|
var shopName : String? {
|
|
var shopName : String? {
|
|
didSet {
|
|
didSet {
|
|
titleButton.setTitle(shopName, for: UIControl.State.normal)
|
|
titleButton.setTitle(shopName, for: UIControl.State.normal)
|
|
|
|
+ titleButton.layoutButton(edgeInsetsStyle: ButtonEdgeInsetsStyle.right, imageTitleSpace: 4)
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
@@ -31,9 +32,13 @@ class ShoppingCartListTableViewHeader: BaseView {
|
|
}
|
|
}
|
|
|
|
|
|
override func setupViews() {
|
|
override func setupViews() {
|
|
- self.backgroundColor = kffffffColor
|
|
|
|
|
|
+ self.backgroundColor = kf7f8faColor
|
|
addSubview(separateView)
|
|
addSubview(separateView)
|
|
- addSubview(titleButton)
|
|
|
|
|
|
+ addSubview(headerBackView)
|
|
|
|
+ addSubview(bottomLineView)
|
|
|
|
+
|
|
|
|
+ headerBackView.addSubview(titleButton)
|
|
|
|
+ headerBackView.addSubview(selectedButton)
|
|
}
|
|
}
|
|
|
|
|
|
override func setupLayouts() {
|
|
override func setupLayouts() {
|
|
@@ -42,9 +47,28 @@ class ShoppingCartListTableViewHeader: BaseView {
|
|
make.height.equalTo(10)
|
|
make.height.equalTo(10)
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ headerBackView.snp.makeConstraints { (make) in
|
|
|
|
+ make.top.equalTo(separateView.snp_bottom)
|
|
|
|
+ make.left.right.equalToSuperview()
|
|
|
|
+ make.height.equalTo(48)
|
|
|
|
+ }
|
|
|
|
+
|
|
titleButton.snp.makeConstraints { (make) in
|
|
titleButton.snp.makeConstraints { (make) in
|
|
- make.left.equalToSuperview().offset(10)
|
|
|
|
|
|
+ make.left.equalToSuperview().offset(36)
|
|
|
|
+// make.top.equalTo(separateView.snp_bottom).offset(14)
|
|
make.centerY.equalToSuperview()
|
|
make.centerY.equalToSuperview()
|
|
|
|
+ make.height.equalTo(20)
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ selectedButton.snp.makeConstraints { (make) in
|
|
|
|
+ make.left.equalTo(10)
|
|
|
|
+ make.centerY.equalTo(titleButton)
|
|
|
|
+ make.size.equalTo(18)
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ bottomLineView.snp.makeConstraints { (make) in
|
|
|
|
+ make.left.right.bottom.equalToSuperview()
|
|
|
|
+ make.height.equalTo(1)
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
@@ -54,22 +78,56 @@ class ShoppingCartListTableViewHeader: BaseView {
|
|
return separateView
|
|
return separateView
|
|
}()
|
|
}()
|
|
|
|
|
|
|
|
+ lazy var headerBackView: UIView = {
|
|
|
|
+ let headerBackView = UIView()
|
|
|
|
+ headerBackView.backgroundColor = kffffffColor
|
|
|
|
+ let shapeLayer = CAShapeLayer()
|
|
|
|
+ headerBackView.layer.mask = nil
|
|
|
|
+ let rect = CGRect(x: 0, y: 0, width: kScreenWidth - 14 * kScaleWidth * 2, height: 48)
|
|
|
|
+ let bezierPath = UIBezierPath(roundedRect: rect,
|
|
|
|
+ byRoundingCorners: [.topLeft,.topRight],
|
|
|
|
+ cornerRadii: CGSize(width: 4,height: 4))
|
|
|
|
+ shapeLayer.frame = headerBackView.bounds
|
|
|
|
+ shapeLayer.path = bezierPath.cgPath
|
|
|
|
+ headerBackView.layer.mask = shapeLayer
|
|
|
|
+ return headerBackView
|
|
|
|
+ }()
|
|
|
|
+
|
|
|
|
+ private lazy var selectedButton: UIButton = {
|
|
|
|
+ let selectedButton = UIButton(type: UIButton.ButtonType.custom)
|
|
|
|
+ selectedButton.setImage(kImage(name: "common_uncheck_icon"), for: UIControl.State.normal)
|
|
|
|
+ selectedButton.setImage(kImage(name: "common_check_icon"), for: UIControl.State.selected)
|
|
|
|
+ selectedButton.rx.tap.subscribe(onNext: { [weak self] (data) in
|
|
|
|
+
|
|
|
|
+ // if let loginBlock = self?.loginBlock {
|
|
|
|
+ // loginBlock((self?.phoneNumber)!,(self?.password)!)
|
|
|
|
+ // }
|
|
|
|
+ print("点击了全选当前section")
|
|
|
|
+
|
|
|
|
+ }).disposed(by: disposeBag)
|
|
|
|
+ return selectedButton
|
|
|
|
+ }()
|
|
|
|
+
|
|
private lazy var titleButton: UIButton = {
|
|
private lazy var titleButton: UIButton = {
|
|
let titleButton = UIButton(type: UIButton.ButtonType.custom)
|
|
let titleButton = UIButton(type: UIButton.ButtonType.custom)
|
|
|
|
+ titleButton.setImage(kImage(name: "my_arrows_unfold"), for: UIControl.State.normal)
|
|
titleButton.setTitleColor(k333333Color, for: UIControl.State.normal)
|
|
titleButton.setTitleColor(k333333Color, for: UIControl.State.normal)
|
|
- titleButton.setTitleColor(k666666Color, for: UIControl.State.selected)
|
|
|
|
- titleButton.setImage(UIImage.imageWithColor(color: kDisabledButtonColor), for: UIControl.State.selected)
|
|
|
|
- titleButton.setImage(UIImage.imageWithColor(color: kEnabledButtonColor), for: UIControl.State.normal)
|
|
|
|
titleButton.titleLabel?.font = kScaleRegularFont14
|
|
titleButton.titleLabel?.font = kScaleRegularFont14
|
|
titleButton.rx.tap.subscribe(onNext: { [weak self] (data) in
|
|
titleButton.rx.tap.subscribe(onNext: { [weak self] (data) in
|
|
|
|
|
|
// if let loginBlock = self?.loginBlock {
|
|
// if let loginBlock = self?.loginBlock {
|
|
// loginBlock((self?.phoneNumber)!,(self?.password)!)
|
|
// loginBlock((self?.phoneNumber)!,(self?.password)!)
|
|
// }
|
|
// }
|
|
- print("点击了全选当前section")
|
|
|
|
|
|
+ print("点击了商店Title")
|
|
|
|
|
|
}).disposed(by: disposeBag)
|
|
}).disposed(by: disposeBag)
|
|
return titleButton
|
|
return titleButton
|
|
}()
|
|
}()
|
|
|
|
|
|
|
|
+ private lazy var bottomLineView: UIView = {
|
|
|
|
+ let bottomLineView = UIView()
|
|
|
|
+ bottomLineView.backgroundColor = kf5f5f5Color
|
|
|
|
+ return bottomLineView
|
|
|
|
+ }()
|
|
|
|
+
|
|
}
|
|
}
|