Commit 4c2a8616 authored by Steven杜宇's avatar Steven杜宇

// 活动

parent 79925724
...@@ -87,6 +87,23 @@ enum YHActivityStatus: Int { ...@@ -87,6 +87,23 @@ enum YHActivityStatus: Int {
} }
} }
var activityBottomColor: UIColor {
switch self {
case .notApply:
return UIColor.brandGrayColor8
case .applied:
return UIColor.successColor
case .end:
return UIColor.mainTextColor30
case .canceled:
return UIColor.brandGrayColor8
case .soldout:
return UIColor.mainTextColor30
default:
return UIColor.clear
}
}
var activityColorForMyApplyList: UIColor { var activityColorForMyApplyList: UIColor {
switch self { switch self {
case .notApply: case .notApply:
......
...@@ -15,6 +15,62 @@ class YHActivitySignSuccessViewController: YHBaseViewController { ...@@ -15,6 +15,62 @@ class YHActivitySignSuccessViewController: YHBaseViewController {
private var prize: Prize? private var prize: Prize?
private var event: CheckInEvent? private var event: CheckInEvent?
lazy var backImgV: UIImageView = {
let v = UIImageView()
v.image = UIImage(named: "salon_result_bg")
return v
}()
lazy var bottomLogoView: UIView = {
let v = UIView()
let logoImgV: UIImageView = UIImageView(image: UIImage(named: "salon_logo"))
v.addSubview(logoImgV)
logoImgV.snp.makeConstraints { make in
make.width.equalTo(133)
make.height.equalTo(26)
make.centerX.equalToSuperview()
make.bottom.equalTo(-16)
}
return v
}()
lazy var signFailBgView: UIView = {
let v = UIView()
let imgV = UIImageView(image: UIImage(named: "salon_fail_icon"))
v.addSubview(imgV)
let titleLabel = UILabel()
titleLabel.font = .PFSC_B(ofSize: 18)
titleLabel.textColor = .brandGrayColor8
titleLabel.textAlignment = .center
titleLabel.text = "签到失败"
v.addSubview(titleLabel)
let detailLabel = UILabel()
detailLabel.font = .PFSC_R(ofSize: 14)
detailLabel.textColor = .brandGrayColor6
detailLabel.textAlignment = .center
detailLabel.text = "活动已结束或因其他未知原因,详情请咨询现场顾问"
v.addSubview(detailLabel)
imgV.snp.makeConstraints { make in
make.width.height.equalTo(128)
make.top.equalTo(100)
make.centerX.equalToSuperview()
}
titleLabel.snp.makeConstraints { make in
make.centerX.equalToSuperview()
make.height.equalTo(25)
make.top.equalTo(imgV.snp.bottom)
}
detailLabel.snp.makeConstraints { make in
make.centerX.equalToSuperview()
make.height.equalTo(25)
make.top.equalTo(titleLabel.snp.bottom).offset(12)
}
return v
}()
override func viewDidLoad() { override func viewDidLoad() {
super.viewDidLoad() super.viewDidLoad()
setupUI() setupUI()
...@@ -22,7 +78,10 @@ class YHActivitySignSuccessViewController: YHBaseViewController { ...@@ -22,7 +78,10 @@ class YHActivitySignSuccessViewController: YHBaseViewController {
} }
private func setupUI() { private func setupUI() {
view.backgroundColor = UIColor(red: 0.85, green: 0.90, blue: 0.95, alpha: 1) view.backgroundColor = .contentBkgColor
view.addSubview(backImgV)
view.addSubview(signFailBgView)
tableView.delegate = self tableView.delegate = self
tableView.dataSource = self tableView.dataSource = self
tableView.backgroundColor = .clear tableView.backgroundColor = .clear
...@@ -30,7 +89,23 @@ class YHActivitySignSuccessViewController: YHBaseViewController { ...@@ -30,7 +89,23 @@ class YHActivitySignSuccessViewController: YHBaseViewController {
tableView.register(YHSignPrizeCell.self, forCellReuseIdentifier: YHSignPrizeCell.cellReuseIdentifier) tableView.register(YHSignPrizeCell.self, forCellReuseIdentifier: YHSignPrizeCell.cellReuseIdentifier)
tableView.register(YHSignActivityInfoCell.self, forCellReuseIdentifier: YHSignActivityInfoCell.cellReuseIdentifier) tableView.register(YHSignActivityInfoCell.self, forCellReuseIdentifier: YHSignActivityInfoCell.cellReuseIdentifier)
view.addSubview(tableView) view.addSubview(tableView)
view.addSubview(bottomLogoView)
tableView.snp.makeConstraints { make in tableView.snp.makeConstraints { make in
make.top.equalTo(k_Height_NavigationtBarAndStatuBar)
make.left.right.equalToSuperview()
make.bottom.equalTo(bottomLogoView.snp.top)
}
bottomLogoView.snp.makeConstraints { make in
make.height.equalTo(58)
make.left.right.equalToSuperview()
make.bottom.equalTo(-k_Height_safeAreaInsetsBottom())
}
backImgV.snp.makeConstraints { make in
make.top.left.right.equalToSuperview()
make.height.equalTo(backImgV.snp.width).multipliedBy(422.0/375.0)
}
signFailBgView.snp.makeConstraints { make in
make.top.equalTo(k_Height_NavigationtBarAndStatuBar) make.top.equalTo(k_Height_NavigationtBarAndStatuBar)
make.left.right.bottom.equalToSuperview() make.left.right.bottom.equalToSuperview()
} }
...@@ -45,7 +120,7 @@ class YHActivitySignSuccessViewController: YHBaseViewController { ...@@ -45,7 +120,7 @@ class YHActivitySignSuccessViewController: YHBaseViewController {
image: "prize_sofa" image: "prize_sofa"
) )
event = CheckInEvent( event = CheckInEvent(
title: "翱翔云端·探索无限", title: "翱翔云端·探索无限2025无人机创新科技沙龙2025无人机创新科技沙龙2025无人机创新科技沙龙2025无人机创新科技沙龙2025无人机创新科技沙龙2025无人机创新科技沙龙2025无人机创新科技沙龙2025无人机创新科技沙龙2025无人机创新科技沙龙",
subtitle: "2025无人机创新科技沙龙", subtitle: "2025无人机创新科技沙龙",
date: "2025-09-13 周六 09:30", date: "2025-09-13 周六 09:30",
location: "银河集团香港体验中心(香港湾仔港湾道26号华润大厦27楼2705室)", location: "银河集团香港体验中心(香港湾仔港湾道26号华润大厦27楼2705室)",
......
...@@ -48,7 +48,7 @@ private extension YHActivityDetailBottomView { ...@@ -48,7 +48,7 @@ private extension YHActivityDetailBottomView {
if let status = Int(model.status) { if let status = Int(model.status) {
isHidden = false isHidden = false
saveButton.setTitle(YHActivityStatus.init(rawValue: status)?.titleForDetail, for: .normal) saveButton.setTitle(YHActivityStatus.init(rawValue: status)?.titleForDetail, for: .normal)
saveButton.backgroundColor = YHActivityStatus.init(rawValue: status)?.activityColor saveButton.backgroundColor = YHActivityStatus.init(rawValue: status)?.activityBottomColor
} else { } else {
isHidden = true isHidden = true
} }
......
...@@ -14,7 +14,6 @@ class YHSignActivityInfoCell: UITableViewCell { ...@@ -14,7 +14,6 @@ class YHSignActivityInfoCell: UITableViewCell {
private let containerView = UIView() private let containerView = UIView()
private let titleLabel = UILabel() private let titleLabel = UILabel()
private let subtitleLabel = UILabel()
private let thumbnailImageView = UIImageView() private let thumbnailImageView = UIImageView()
private let timeLabel = UILabel() private let timeLabel = UILabel()
private let timeValueLabel = UILabel() private let timeValueLabel = UILabel()
...@@ -35,98 +34,88 @@ class YHSignActivityInfoCell: UITableViewCell { ...@@ -35,98 +34,88 @@ class YHSignActivityInfoCell: UITableViewCell {
backgroundColor = .clear backgroundColor = .clear
selectionStyle = .none selectionStyle = .none
containerView.backgroundColor = UIColor(white: 0.98, alpha: 1) containerView.backgroundColor = .white
containerView.layer.cornerRadius = 12 containerView.layer.cornerRadius = 6
contentView.addSubview(containerView) contentView.addSubview(containerView)
titleLabel.font = .systemFont(ofSize: 16, weight: .medium) titleLabel.font = .PFSC_B(ofSize: 18)
titleLabel.textColor = .black titleLabel.textColor = .brandGrayColor8
titleLabel.numberOfLines = 0 titleLabel.numberOfLines = 0
containerView.addSubview(titleLabel) containerView.addSubview(titleLabel)
subtitleLabel.font = .systemFont(ofSize: 16, weight: .medium)
subtitleLabel.textColor = .black
subtitleLabel.numberOfLines = 0
containerView.addSubview(subtitleLabel)
thumbnailImageView.contentMode = .scaleAspectFit thumbnailImageView.contentMode = .scaleAspectFit
thumbnailImageView.layer.cornerRadius = 4 thumbnailImageView.layer.cornerRadius = 4
thumbnailImageView.clipsToBounds = true thumbnailImageView.clipsToBounds = true
thumbnailImageView.backgroundColor = .systemBlue.withAlphaComponent(0.2) thumbnailImageView.backgroundColor = .red
containerView.addSubview(thumbnailImageView) containerView.addSubview(thumbnailImageView)
timeLabel.text = "时间" timeLabel.text = "时间"
timeLabel.font = .systemFont(ofSize: 14) timeLabel.font = .PFSC_R(ofSize: 14)
timeLabel.textColor = .gray timeLabel.textColor = .brandGrayColor6
containerView.addSubview(timeLabel) containerView.addSubview(timeLabel)
timeValueLabel.font = .systemFont(ofSize: 14) timeValueLabel.font = .PFSC_R(ofSize: 14)
timeValueLabel.textColor = .black timeValueLabel.textColor = .brandGrayColor8
timeValueLabel.numberOfLines = 0 timeValueLabel.numberOfLines = 0
containerView.addSubview(timeValueLabel) containerView.addSubview(timeValueLabel)
locationLabel.text = "地点" locationLabel.text = "地点"
locationLabel.font = .systemFont(ofSize: 14) locationLabel.font = .PFSC_R(ofSize: 14)
locationLabel.textColor = .gray locationLabel.textColor = .brandGrayColor6
containerView.addSubview(locationLabel) containerView.addSubview(locationLabel)
locationValueLabel.font = .systemFont(ofSize: 14) locationValueLabel.font = .PFSC_R(ofSize: 14)
locationValueLabel.textColor = .black locationValueLabel.textColor = .brandGrayColor8
locationValueLabel.numberOfLines = 0 locationValueLabel.numberOfLines = 0
containerView.addSubview(locationValueLabel) containerView.addSubview(locationValueLabel)
subLocationLabel.font = .systemFont(ofSize: 12) subLocationLabel.font = .PFSC_R(ofSize: 12)
subLocationLabel.textColor = .lightGray subLocationLabel.textColor = .brandGrayColor5
subLocationLabel.numberOfLines = 0 subLocationLabel.numberOfLines = 0
containerView.addSubview(subLocationLabel) containerView.addSubview(subLocationLabel)
// 约束 // 约束
containerView.snp.makeConstraints { make in containerView.snp.makeConstraints { make in
make.top.equalToSuperview().offset(8) make.top.equalToSuperview().offset(16)
make.left.equalToSuperview().offset(16)
make.right.equalToSuperview().offset(-16)
make.bottom.equalToSuperview().offset(-8)
}
titleLabel.snp.makeConstraints { make in
make.top.equalToSuperview().offset(20)
make.left.equalToSuperview().offset(20) make.left.equalToSuperview().offset(20)
make.right.equalTo(thumbnailImageView.snp.left).offset(-12) make.right.equalToSuperview().offset(-20)
make.bottom.equalToSuperview().offset(-16)
} }
subtitleLabel.snp.makeConstraints { make in titleLabel.snp.makeConstraints { make in
make.top.equalTo(titleLabel.snp.bottom).offset(4) make.top.equalToSuperview().offset(24)
make.left.equalToSuperview().offset(20) make.left.equalToSuperview().offset(20)
make.right.equalTo(thumbnailImageView.snp.left).offset(-12) make.right.equalTo(thumbnailImageView.snp.left).offset(-17)
} }
thumbnailImageView.snp.makeConstraints { make in thumbnailImageView.snp.makeConstraints { make in
make.top.equalToSuperview().offset(20) make.top.equalToSuperview().offset(20)
make.right.equalToSuperview().offset(-20) make.right.equalToSuperview().offset(-20)
make.width.height.equalTo(60) make.width.height.equalTo(72)
} }
timeLabel.snp.makeConstraints { make in timeLabel.snp.makeConstraints { make in
make.top.equalTo(subtitleLabel.snp.bottom).offset(20) make.top.greaterThanOrEqualTo(titleLabel.snp.bottom).offset(24)
make.top.greaterThanOrEqualTo(thumbnailImageView.snp.bottom).offset(24)
make.left.equalToSuperview().offset(20) make.left.equalToSuperview().offset(20)
make.width.equalTo(50) make.width.equalTo(50)
} }
timeValueLabel.snp.makeConstraints { make in timeValueLabel.snp.makeConstraints { make in
make.centerY.equalTo(timeLabel) make.centerY.equalTo(timeLabel)
make.left.equalTo(timeLabel.snp.right).offset(12) make.left.equalTo(timeLabel.snp.right).offset(16)
make.right.equalToSuperview().offset(-20) make.right.equalToSuperview().offset(-20)
} }
locationLabel.snp.makeConstraints { make in locationLabel.snp.makeConstraints { make in
make.top.equalTo(timeLabel.snp.bottom).offset(16) make.top.equalTo(timeLabel.snp.bottom).offset(13)
make.left.equalToSuperview().offset(20) make.left.equalToSuperview().offset(20)
make.width.equalTo(50) make.width.equalTo(50)
} }
locationValueLabel.snp.makeConstraints { make in locationValueLabel.snp.makeConstraints { make in
make.top.equalTo(locationLabel) make.top.equalTo(locationLabel)
make.left.equalTo(locationLabel.snp.right).offset(12) make.left.equalTo(locationLabel.snp.right).offset(16)
make.right.equalToSuperview().offset(-20) make.right.equalToSuperview().offset(-20)
} }
...@@ -140,7 +129,6 @@ class YHSignActivityInfoCell: UITableViewCell { ...@@ -140,7 +129,6 @@ class YHSignActivityInfoCell: UITableViewCell {
func configure(with event: CheckInEvent) { func configure(with event: CheckInEvent) {
titleLabel.text = event.title titleLabel.text = event.title
subtitleLabel.text = event.subtitle
timeValueLabel.text = event.date timeValueLabel.text = event.date
locationValueLabel.text = event.location locationValueLabel.text = event.location
subLocationLabel.text = event.subLocation subLocationLabel.text = event.subLocation
......
...@@ -30,41 +30,33 @@ class YHSignPrizeCell: UITableViewCell { ...@@ -30,41 +30,33 @@ class YHSignPrizeCell: UITableViewCell {
backgroundColor = .clear backgroundColor = .clear
selectionStyle = .none selectionStyle = .none
containerView.backgroundColor = UIColor(white: 0.98, alpha: 1) containerView.backgroundColor = .white
containerView.layer.cornerRadius = 12 containerView.layer.cornerRadius = 6
contentView.addSubview(containerView) contentView.addSubview(containerView)
greetingLabel.font = .systemFont(ofSize: 20, weight: .medium) greetingLabel.font = .PFSC_B(ofSize: 18)
greetingLabel.textColor = .black greetingLabel.textColor = .brandGrayColor8
containerView.addSubview(greetingLabel) containerView.addSubview(greetingLabel)
instructionLabel.font = .systemFont(ofSize: 14) instructionLabel.font = .PFSC_R(ofSize: 14)
instructionLabel.textColor = .gray instructionLabel.textColor = .brandGrayColor7
containerView.addSubview(instructionLabel) containerView.addSubview(instructionLabel)
prizeImageView.contentMode = .scaleAspectFill prizeImageView.contentMode = .scaleAspectFill
prizeImageView.clipsToBounds = true prizeImageView.clipsToBounds = true
prizeImageView.layer.cornerRadius = 8 prizeImageView.layer.cornerRadius = 6
prizeImageView.backgroundColor = .lightGray prizeImageView.backgroundColor = .red
containerView.addSubview(prizeImageView) containerView.addSubview(prizeImageView)
overlayButton.setTitle("一步了解", for: .normal)
overlayButton.setTitleColor(.white, for: .normal)
overlayButton.titleLabel?.font = .systemFont(ofSize: 14)
overlayButton.layer.cornerRadius = 16
overlayButton.layer.borderWidth = 1
overlayButton.layer.borderColor = UIColor.white.cgColor
prizeImageView.addSubview(overlayButton)
containerView.snp.makeConstraints { make in containerView.snp.makeConstraints { make in
make.top.equalToSuperview().offset(8) make.top.equalToSuperview().offset(0)
make.left.equalToSuperview().offset(16) make.left.equalToSuperview().offset(20)
make.right.equalToSuperview().offset(-16) make.right.equalToSuperview().offset(-20)
make.bottom.equalToSuperview().offset(-8) make.bottom.equalToSuperview().offset(0)
} }
greetingLabel.snp.makeConstraints { make in greetingLabel.snp.makeConstraints { make in
make.top.equalToSuperview().offset(20) make.top.equalToSuperview().offset(28)
make.left.equalToSuperview().offset(20) make.left.equalToSuperview().offset(20)
make.right.equalToSuperview().offset(-20) make.right.equalToSuperview().offset(-20)
} }
...@@ -76,18 +68,11 @@ class YHSignPrizeCell: UITableViewCell { ...@@ -76,18 +68,11 @@ class YHSignPrizeCell: UITableViewCell {
} }
prizeImageView.snp.makeConstraints { make in prizeImageView.snp.makeConstraints { make in
make.top.equalTo(instructionLabel.snp.bottom).offset(16) make.top.equalTo(instructionLabel.snp.bottom).offset(12)
make.left.equalToSuperview().offset(20) make.left.equalToSuperview().offset(20)
make.right.equalToSuperview().offset(-20) make.right.equalToSuperview().offset(-20)
make.bottom.equalToSuperview().offset(-20) make.bottom.equalToSuperview().offset(-20)
make.height.equalTo(200) make.height.equalTo(295)
}
overlayButton.snp.makeConstraints { make in
make.left.equalToSuperview().offset(16)
make.bottom.equalToSuperview().offset(-16)
make.width.equalTo(100)
make.height.equalTo(32)
} }
} }
......
...@@ -25,25 +25,24 @@ class YHSignSuccessHeaderView: UIView { ...@@ -25,25 +25,24 @@ class YHSignSuccessHeaderView: UIView {
private func setupUI() { private func setupUI() {
backgroundColor = .clear backgroundColor = .clear
checkIconView.image = UIImage(systemName: "checkmark.circle") checkIconView.image = UIImage(named: "salon_sign_success")
checkIconView.tintColor = .black
addSubview(checkIconView) addSubview(checkIconView)
titleLabel.text = "签到成功" titleLabel.text = "签到成功"
titleLabel.font = .systemFont(ofSize: 28, weight: .semibold) titleLabel.font = .PFSC_B(ofSize: 28)
titleLabel.textColor = .black titleLabel.textColor = .black
addSubview(titleLabel) addSubview(titleLabel)
checkIconView.snp.makeConstraints { make in checkIconView.snp.makeConstraints { make in
make.top.equalToSuperview().offset(24) make.top.equalToSuperview().offset(30)
make.left.equalToSuperview().offset(32) make.left.equalToSuperview().offset(20)
make.width.height.equalTo(36) make.width.height.equalTo(28)
make.bottom.equalToSuperview().offset(-24)
} }
titleLabel.snp.makeConstraints { make in titleLabel.snp.makeConstraints { make in
make.centerY.equalTo(checkIconView) make.centerY.equalTo(checkIconView)
make.left.equalTo(checkIconView.snp.right).offset(12) make.left.equalTo(checkIconView.snp.right).offset(8)
make.height.equalTo(40)
} }
} }
} }
{
"info" : {
"author" : "xcode",
"version" : 1
}
}
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "Component 6.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "Component 6-1.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "Frame 2033198509.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "Frame 2033198509-1.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "BG.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "BG-1.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "24pt状态提示.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "24pt状态提示-1.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
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