Commit 91f67a9f authored by David黄金龙's avatar David黄金龙

行程单

parent c6ebfa74
......@@ -52,14 +52,11 @@ class YHActivityTravelViewController: YHBaseViewController {
gk_navigationBar.isHidden = false
gk_navigationBar.backgroundColor = .clear
view.backgroundColor = UIColor.pageBkgColor //for test hjl
view.backgroundColor = UIColor.pageBkgColor
//1.
view.addSubview(topBkgImageV)
view.addSubview(tableView)
view.addSubview(bottomView)
topBkgImageV.snp.makeConstraints { make in
make.top.left.right.equalToSuperview()
......@@ -71,26 +68,8 @@ class YHActivityTravelViewController: YHBaseViewController {
make.top.equalTo(k_Height_NavigationtBarAndStatuBar)
make.left.equalTo(20)
make.right.equalTo(-20)
make.bottom.equalTo(bottomView.snp.top)
}
bottomView.snp.makeConstraints { make in
make.left.right.bottom.equalToSuperview()
make.height.equalTo(YHActivityDetailBottomView.viewH)
}
bottomView.block = { tag in
YHApplyActivityAlert.showApplyActivityAlertView { tag in
let vc = YHApplyActivityResultViewController()
self.navigationController?.pushViewController(vc)
}
make.bottom.equalToSuperview()
}
//2.
// addTopView()
// topView.backgroundColor = .red
}
}
......
......@@ -11,6 +11,8 @@ import UIKit
class YHActivityTravelCell: UITableViewCell {
static let cellReuseIdentifier = "YHActivityTravelCell"
private var isApplyFlag : Bool = true
var sessionIndex : Int = 0 {
didSet {
......@@ -31,15 +33,6 @@ class YHActivityTravelCell: UITableViewCell {
setupUI()
}
lazy var topImgV:UIImageView = {
let view = UIImageView()
view.image = UIImage(named: "activity_cell_bkg_0")
view.contentMode = .scaleAspectFill
view.clipsToBounds = true
return view
}()
lazy var statusLable:UILabel = {
let lable = UILabel()
lable.textColor = UIColor.mainTextColor
......@@ -68,27 +61,74 @@ class YHActivityTravelCell: UITableViewCell {
let view = YHActivityTipsItemView()
return view
}()
//取消活动
lazy var cancelButton:UIButton = {
let button = UIButton(type: .custom)
button.backgroundColor = UIColor.brandMainColor
button.titleLabel?.font = UIFont.PFSC_R(ofSize: 15)
button.contentHorizontalAlignment = .center
button.setTitle("取消报名", for: .normal)
button.setTitleColor(UIColor.white, for: .normal)
button.layer.cornerRadius = kCornerRadius3
button.addTarget(self, action: #selector(clickCancelBtn), for: .touchUpInside)
button.layer.cornerRadius = kCornerRadius3
button.clipsToBounds = true
return button
}()
}
extension YHActivityTravelCell {
@objc func clickCancelBtn() {
YHCommonAlertView.show("", "是否取消报名?", "是", "否",fullGuestureEnable: false) {
self.isApplyFlag = false
self.updateRightBtnUI()
} callBack: {
}
}
func updateRightBtnUI() {
if isApplyFlag {
cancelButton.setTitle("取消报名", for: .normal)
cancelButton.setTitle("取消报名", for: .highlighted)
cancelButton.setTitleColor(UIColor.mainTextColor, for: .normal)
cancelButton.setTitleColor(UIColor.mainTextColor, for: .highlighted)
cancelButton.backgroundColor = .white
cancelButton.layer.borderWidth = 1
cancelButton.layer.borderColor = UIColor.mainTextColor50.cgColor
} else {
cancelButton.setTitle("重新报名", for: .normal)
cancelButton.setTitle("重新报名", for: .highlighted)
cancelButton.setTitleColor(UIColor.white, for: .normal)
cancelButton.setTitleColor(UIColor.white, for: .highlighted)
cancelButton.backgroundColor = .brandMainColor
cancelButton.layer.borderWidth = 0
cancelButton.layer.borderColor = UIColor.clear.cgColor
}
}
func setupUI() {
backgroundColor = .clear
contentView.backgroundColor = .clear
selectionStyle = .none
// contentView.addSubview(topImgV)
contentView.addSubview(statusLable)
contentView.addSubview(acitivityTitle)
contentView.addSubview(acitivityDetail)
contentView.addSubview(acitivityTips)
contentView.addSubview(cancelButton)
// topImgV.snp.makeConstraints { make in
// make.top.left.right.equalToSuperview()
// make.height.equalTo(KScreenWidth)
// }
statusLable.snp.makeConstraints { make in
make.top.equalToSuperview().offset(20)
make.left.right.equalToSuperview()
......@@ -107,12 +147,21 @@ extension YHActivityTravelCell {
}
acitivityTips.snp.makeConstraints { make in
make.top.equalTo(acitivityDetail.snp.bottom).offset(24)
make.left.right.equalToSuperview()
make.bottom.equalToSuperview().offset(-42)
// make.bottom.equalToSuperview().offset(-42)
}
cancelButton.snp.makeConstraints { make in
make.top.equalTo(acitivityTips.snp.bottom).offset(32)
make.width.equalTo(178)
make.height.equalTo(42)
make.centerX.equalToSuperview()
make.bottom.equalToSuperview().offset(-46)
}
updateRightBtnUI()
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment