Commit 2e63d041 authored by Steven杜宇's avatar Steven杜宇

Merge branch '630-dev' of http://gitlab.galaxy-immi.com/mobile-group/galaxy-iOS into 630-dev

parents 7e039949 91f67a9f
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
//1.
view.addSubview(topBkgImageV)
view.addSubview(tableView)
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.equalToSuperview()
}
}
}
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 {
}
@objc func clickSubmitBtn() {
let vc = YHActivityTravelViewController()
self.navigationController?.pushViewController(vc)
}
}
......@@ -41,21 +41,21 @@ class YHActivityDetailCell: UITableViewCell {
//活动名称地址
lazy var acitivityTitle:YHAcitivityTitleItemView = {
let view = YHAcitivityTitleItemView()
lazy var acitivityTitle:YHActivityTitleItemView = {
let view = YHActivityTitleItemView()
return view
}()
//活动详情
lazy var acitivityDetail:YHAcitivityDetailItemView = {
let view = YHAcitivityDetailItemView()
lazy var acitivityDetail:YHActivityDetailItemView = {
let view = YHActivityDetailItemView()
return view
}()
//活动温馨提示
lazy var acitivityTips:YHAcitivityTipsItemView = {
let view = YHAcitivityTipsItemView()
lazy var acitivityTips:YHActivityTipsItemView = {
let view = YHActivityTipsItemView()
return view
}()
}
......
//
// YHAcitivityDetailItemView.swift
// YHActivityDetailItemView.swift
// galaxy
//
// Created by davidhuangA on 2024/6/20.
......@@ -8,7 +8,7 @@
import UIKit
class YHAcitivityDetailItemView: UIView {
class YHActivityDetailItemView: UIView {
required init?(coder: NSCoder) {
fatalError("init(coder:) has not been implemented")
......@@ -49,7 +49,7 @@ class YHAcitivityDetailItemView: UIView {
}
extension YHAcitivityDetailItemView {
extension YHActivityDetailItemView {
func setupUI() {
addSubview(bottomLine)
......
//
// YHAcitivityTipsItemView.swift
// YHActivityTipsItemView.swift
// galaxy
//
// Created by davidhuangA on 2024/6/20.
......@@ -8,7 +8,7 @@
import UIKit
class YHAcitivityTipsItemView: UIView {
class YHActivityTipsItemView: UIView {
required init?(coder: NSCoder) {
fatalError("init(coder:) has not been implemented")
......@@ -49,7 +49,7 @@ class YHAcitivityTipsItemView: UIView {
}
extension YHAcitivityTipsItemView {
extension YHActivityTipsItemView {
func setupUI() {
addSubview(bottomLine)
......
//
// YHAcitivityTitleView.swift
// YHActivityTitleItemView.swift
// galaxy
//
// Created by davidhuangA on 2024/6/20.
......@@ -8,7 +8,7 @@
import UIKit
class YHAcitivityTitleItemView: UIView {
class YHActivityTitleItemView: UIView {
required init?(coder: NSCoder) {
fatalError("init(coder:) has not been implemented")
......@@ -80,7 +80,7 @@ class YHAcitivityTitleItemView: UIView {
}
extension YHAcitivityTitleItemView {
extension YHActivityTitleItemView {
func setupUI() {
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"
private var isApplyFlag : Bool = true
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 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
}()
//取消活动
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(statusLable)
contentView.addSubview(acitivityTitle)
contentView.addSubview(acitivityDetail)
contentView.addSubview(acitivityTips)
contentView.addSubview(cancelButton)
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)
}
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()
}
}
......@@ -380,10 +380,11 @@ extension YHHomePageViewController : UITabBarControllerDelegate {
}
self.tapTimestamp = timestamp
} else if tabBarController.selectedIndex == 2 {
// 点击消息tab 清空应用icon未读数
UIApplication.shared.applicationIconBadgeNumber = 0
}
}
// else if tabBarController.selectedIndex == 2 {
// // 点击消息tab 清空应用icon未读数
// UIApplication.shared.applicationIconBadgeNumber = 0
// }
}
......@@ -391,7 +392,7 @@ extension YHHomePageViewController : UITabBarControllerDelegate {
guard let index = tabBarController.viewControllers?.firstIndex(of: viewController) else {
return false
}
if index == 1 || index == 2 {
if index == 1 {
if YHLoginManager.shared.isLogin() {
return true
} 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