Commit 3a377be9 authored by David黄金龙's avatar David黄金龙

行程单UI

parent 7808450a
This diff is collapsed.
//
// YHActivityTravelViewController.swift
// galaxy
//
// Created by davidhuangA on 2024/6/20.
// Copyright © 2024 https://www.galaxy-immi.com. All rights reserved.
//
import UIKit
class YHActivityTravelViewController: YHBaseViewController {
lazy var tableView: UITableView = {
let tableView = UITableView(frame:.zero, style:.plain)
tableView.showsVerticalScrollIndicator = false
tableView.separatorStyle = .none
tableView.delegate = self
tableView.dataSource = self
tableView.backgroundColor = UIColor.clear
tableView.register(UITableViewCell.self, forCellReuseIdentifier: "UITableViewCell")
tableView.register(YHActivityTravelCell.self, forCellReuseIdentifier: YHActivityTravelCell.cellReuseIdentifier)
tableView.tableHeaderView = nil
tableView.tableFooterView = nil
tableView.estimatedSectionHeaderHeight = 0
tableView.estimatedSectionFooterHeight = 0
return tableView
}()
lazy var topBkgImageV : UIImageView = {
let view = UIImageView()
view.contentMode = .scaleAspectFill
view.image = UIImage(named: "activity_travel_bkg")
return view
}()
lazy var topView : UIView = {
let view = UIView()
return view
}()
lazy var bottomView : YHActivityDetailBottomView = {
let view = YHActivityDetailBottomView()
return view
}()
// MARK: - 生命周期方法
override func viewDidLoad() {
super.viewDidLoad()
gk_navigationBar.isHidden = false
gk_navigationBar.backgroundColor = .clear
view.backgroundColor = UIColor.pageBkgColor //for test hjl
//1.
view.addSubview(topBkgImageV)
view.addSubview(tableView)
view.addSubview(bottomView)
topBkgImageV.snp.makeConstraints { make in
make.top.left.right.equalToSuperview()
make.height.equalTo(332)
}
tableView.contentInsetAdjustmentBehavior = .never
tableView.snp.makeConstraints { make in
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)
}
}
//2.
// addTopView()
// topView.backgroundColor = .red
}
}
extension YHActivityTravelViewController {
func addTopView() {
topView.frame = CGRect(x: 0, y: 0, width: KScreenWidth, height: 114)
view.addSubview(topView)
let gradientLayer = CAGradientLayer()
gradientLayer.frame = topView.bounds
// 定义渐变颜色,这里使用了两种颜色
let colorTop = UIColor.red//UIColor(hex: 0x000000, alpha: 1)
let colorBottom = UIColor.blue//UIColor(hex: 0x000000, alpha: 0)
// 设置颜色数组
gradientLayer.colors = [colorTop, colorBottom]
// 设置渐变方向,从上到下
gradientLayer.startPoint = CGPoint(x: 0.5, y: 0.0)
gradientLayer.endPoint = CGPoint(x: 0.5, y: 1.0)
// 添加渐变层到当前视图的layer
topView.layer.insertSublayer(gradientLayer, at: 0)
}
}
extension YHActivityTravelViewController: UITableViewDelegate, UITableViewDataSource {
func numberOfSections(in tableView: UITableView) -> Int {
return 1
}
func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
return 1
}
func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
let cell = tableView.dequeueReusableCell(withIdentifier: YHActivityTravelCell.cellReuseIdentifier, for: indexPath) as! YHActivityTravelCell
cell.sessionIndex = indexPath.section
return cell
}
func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat {
return UITableView.automaticDimension
}
// func tableView(_ tableView: UITableView, heightForHeaderInSection section: Int) -> CGFloat {
//
// return 0.001
// }
//
// func tableView(_ tableView: UITableView, viewForHeaderInSection section: Int) -> UIView? {
//
// let view = UIView(frame: CGRect(x: 0, y: 0, width: KScreenWidth, height: 0.001))
// view.backgroundColor = .clear
// return view
// }
//
// func tableView(_ tableView: UITableView, viewForFooterInSection section: Int) -> UIView? {
// let view = UIView(frame: CGRect(x: 0, y: 0, width: KScreenWidth-16.0*2, height: 0.001))
// view.backgroundColor = .clear
// return view
// }
//
// func tableView(_ tableView: UITableView, heightForFooterInSection section: Int) -> CGFloat {
// return 0.001
// }
}
...@@ -106,6 +106,7 @@ extension YHApplyActivityResultViewController { ...@@ -106,6 +106,7 @@ extension YHApplyActivityResultViewController {
} }
@objc func clickSubmitBtn() { @objc func clickSubmitBtn() {
let vc = YHActivityTravelViewController()
self.navigationController?.pushViewController(vc)
} }
} }
...@@ -41,21 +41,21 @@ class YHActivityDetailCell: UITableViewCell { ...@@ -41,21 +41,21 @@ class YHActivityDetailCell: UITableViewCell {
//活动名称地址 //活动名称地址
lazy var acitivityTitle:YHAcitivityTitleItemView = { lazy var acitivityTitle:YHActivityTitleItemView = {
let view = YHAcitivityTitleItemView() let view = YHActivityTitleItemView()
return view return view
}() }()
//活动详情 //活动详情
lazy var acitivityDetail:YHAcitivityDetailItemView = { lazy var acitivityDetail:YHActivityDetailItemView = {
let view = YHAcitivityDetailItemView() let view = YHActivityDetailItemView()
return view return view
}() }()
//活动温馨提示 //活动温馨提示
lazy var acitivityTips:YHAcitivityTipsItemView = { lazy var acitivityTips:YHActivityTipsItemView = {
let view = YHAcitivityTipsItemView() let view = YHActivityTipsItemView()
return view return view
}() }()
} }
......
// //
// YHAcitivityDetailItemView.swift // YHActivityDetailItemView.swift
// galaxy // galaxy
// //
// Created by davidhuangA on 2024/6/20. // Created by davidhuangA on 2024/6/20.
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
import UIKit import UIKit
class YHAcitivityDetailItemView: UIView { class YHActivityDetailItemView: UIView {
required init?(coder: NSCoder) { required init?(coder: NSCoder) {
fatalError("init(coder:) has not been implemented") fatalError("init(coder:) has not been implemented")
...@@ -49,7 +49,7 @@ class YHAcitivityDetailItemView: UIView { ...@@ -49,7 +49,7 @@ class YHAcitivityDetailItemView: UIView {
} }
extension YHAcitivityDetailItemView { extension YHActivityDetailItemView {
func setupUI() { func setupUI() {
addSubview(bottomLine) addSubview(bottomLine)
......
// //
// YHAcitivityTipsItemView.swift // YHActivityTipsItemView.swift
// galaxy // galaxy
// //
// Created by davidhuangA on 2024/6/20. // Created by davidhuangA on 2024/6/20.
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
import UIKit import UIKit
class YHAcitivityTipsItemView: UIView { class YHActivityTipsItemView: UIView {
required init?(coder: NSCoder) { required init?(coder: NSCoder) {
fatalError("init(coder:) has not been implemented") fatalError("init(coder:) has not been implemented")
...@@ -49,7 +49,7 @@ class YHAcitivityTipsItemView: UIView { ...@@ -49,7 +49,7 @@ class YHAcitivityTipsItemView: UIView {
} }
extension YHAcitivityTipsItemView { extension YHActivityTipsItemView {
func setupUI() { func setupUI() {
addSubview(bottomLine) addSubview(bottomLine)
......
// //
// YHAcitivityTitleView.swift // YHActivityTitleItemView.swift
// galaxy // galaxy
// //
// Created by davidhuangA on 2024/6/20. // Created by davidhuangA on 2024/6/20.
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
import UIKit import UIKit
class YHAcitivityTitleItemView: UIView { class YHActivityTitleItemView: UIView {
required init?(coder: NSCoder) { required init?(coder: NSCoder) {
fatalError("init(coder:) has not been implemented") fatalError("init(coder:) has not been implemented")
...@@ -80,7 +80,7 @@ class YHAcitivityTitleItemView: UIView { ...@@ -80,7 +80,7 @@ class YHAcitivityTitleItemView: UIView {
} }
extension YHAcitivityTitleItemView { extension YHActivityTitleItemView {
func setupUI() { func setupUI() {
addSubview(nameLabel) addSubview(nameLabel)
......
//
// YHActivityTravelCell.swift
// galaxy
//
// Created by davidhuangA on 2024/6/21.
// Copyright © 2024 https://www.galaxy-immi.com. All rights reserved.
//
import UIKit
class YHActivityTravelCell: UITableViewCell {
static let cellReuseIdentifier = "YHActivityTravelCell"
var sessionIndex : Int = 0 {
didSet {
// let tmp = sessionIndex % 3
// let name = "activity_cell_bkg_" + String(tmp)
// bkgImgV.image = UIImage(named: name)
}
}
required init?(coder: NSCoder) {
super.init(coder: coder)
}
override init(style: UITableViewCell.CellStyle, reuseIdentifier: String?) {
super.init(style: style, reuseIdentifier: reuseIdentifier)
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
lable.textAlignment = .left
lable.font = UIFont.PFSC_M(ofSize:28)
lable.text = "已报名"
return lable
}()
//活动名称地址
lazy var acitivityTitle:YHActivityTitleItemView = {
let view = YHActivityTitleItemView()
return view
}()
//活动详情
lazy var acitivityDetail:YHActivityDetailItemView = {
let view = YHActivityDetailItemView()
return view
}()
//活动温馨提示
lazy var acitivityTips:YHActivityTipsItemView = {
let view = YHActivityTipsItemView()
return view
}()
}
extension YHActivityTravelCell {
func setupUI() {
backgroundColor = .clear
contentView.backgroundColor = .clear
selectionStyle = .none
// contentView.addSubview(topImgV)
contentView.addSubview(statusLable)
contentView.addSubview(acitivityTitle)
contentView.addSubview(acitivityDetail)
contentView.addSubview(acitivityTips)
// 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()
make.height.equalTo(40)
}
acitivityTitle.snp.makeConstraints { make in
make.top.equalTo(statusLable.snp.bottom).offset(20)
make.left.right.equalToSuperview()
}
acitivityDetail.snp.makeConstraints { make in
make.top.equalTo(acitivityTitle.snp.bottom).offset(24)
make.left.right.equalToSuperview()
}
acitivityTips.snp.makeConstraints { make in
make.top.equalTo(acitivityDetail.snp.bottom).offset(24)
make.left.right.equalToSuperview()
make.bottom.equalToSuperview().offset(-42)
}
}
}
...@@ -380,10 +380,11 @@ extension YHHomePageViewController : UITabBarControllerDelegate { ...@@ -380,10 +380,11 @@ extension YHHomePageViewController : UITabBarControllerDelegate {
} }
self.tapTimestamp = timestamp self.tapTimestamp = timestamp
} else if tabBarController.selectedIndex == 2 { }
// 点击消息tab 清空应用icon未读数 // else if tabBarController.selectedIndex == 2 {
UIApplication.shared.applicationIconBadgeNumber = 0 // // 点击消息tab 清空应用icon未读数
} // UIApplication.shared.applicationIconBadgeNumber = 0
// }
} }
...@@ -391,7 +392,7 @@ extension YHHomePageViewController : UITabBarControllerDelegate { ...@@ -391,7 +392,7 @@ extension YHHomePageViewController : UITabBarControllerDelegate {
guard let index = tabBarController.viewControllers?.firstIndex(of: viewController) else { guard let index = tabBarController.viewControllers?.firstIndex(of: viewController) else {
return false return false
} }
if index == 1 || index == 2 { if index == 1 {
if YHLoginManager.shared.isLogin() { if YHLoginManager.shared.isLogin() {
return true return true
} else { } else {
......
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "Group 2033195113@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "Group 2033195113@3x.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