Commit ef298904 authored by David黄金龙's avatar David黄金龙

活动详情页

parent cb60d525
...@@ -408,6 +408,10 @@ ...@@ -408,6 +408,10 @@
A5787E342C22B45700B021D7 /* YHActivityListCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = A5787E332C22B45700B021D7 /* YHActivityListCell.swift */; }; A5787E342C22B45700B021D7 /* YHActivityListCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = A5787E332C22B45700B021D7 /* YHActivityListCell.swift */; };
A5787E362C23CFDA00B021D7 /* YHActivityDetailViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = A5787E352C23CFDA00B021D7 /* YHActivityDetailViewController.swift */; }; A5787E362C23CFDA00B021D7 /* YHActivityDetailViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = A5787E352C23CFDA00B021D7 /* YHActivityDetailViewController.swift */; };
A5787E382C23D1DC00B021D7 /* YHActivityDetailCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = A5787E372C23D1DC00B021D7 /* YHActivityDetailCell.swift */; }; A5787E382C23D1DC00B021D7 /* YHActivityDetailCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = A5787E372C23D1DC00B021D7 /* YHActivityDetailCell.swift */; };
A5787E3A2C23DA8A00B021D7 /* YHActivityDetailBottomView.swift in Sources */ = {isa = PBXBuildFile; fileRef = A5787E392C23DA8A00B021D7 /* YHActivityDetailBottomView.swift */; };
A5787E3C2C23DEE500B021D7 /* YHAcitivityTitleItemView.swift in Sources */ = {isa = PBXBuildFile; fileRef = A5787E3B2C23DEE500B021D7 /* YHAcitivityTitleItemView.swift */; };
A5787E3E2C23DF8C00B021D7 /* YHAcitivityDetailItemView.swift in Sources */ = {isa = PBXBuildFile; fileRef = A5787E3D2C23DF8C00B021D7 /* YHAcitivityDetailItemView.swift */; };
A5787E402C23DFD000B021D7 /* YHAcitivityTipsItemView.swift in Sources */ = {isa = PBXBuildFile; fileRef = A5787E3F2C23DFD000B021D7 /* YHAcitivityTipsItemView.swift */; };
A580371E2BAD784B0031C312 /* YHMySchemeViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = A580371D2BAD784B0031C312 /* YHMySchemeViewModel.swift */; }; A580371E2BAD784B0031C312 /* YHMySchemeViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = A580371D2BAD784B0031C312 /* YHMySchemeViewModel.swift */; };
A58037212BAD7B2A0031C312 /* YHMySchemeModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = A58037202BAD7B2A0031C312 /* YHMySchemeModel.swift */; }; A58037212BAD7B2A0031C312 /* YHMySchemeModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = A58037202BAD7B2A0031C312 /* YHMySchemeModel.swift */; };
A582B23D2BB944ED009D098C /* YHHKPlanDoctumentVC.swift in Sources */ = {isa = PBXBuildFile; fileRef = A582B23C2BB944ED009D098C /* YHHKPlanDoctumentVC.swift */; }; A582B23D2BB944ED009D098C /* YHHKPlanDoctumentVC.swift in Sources */ = {isa = PBXBuildFile; fileRef = A582B23C2BB944ED009D098C /* YHHKPlanDoctumentVC.swift */; };
...@@ -945,6 +949,10 @@ ...@@ -945,6 +949,10 @@
A5787E332C22B45700B021D7 /* YHActivityListCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHActivityListCell.swift; sourceTree = "<group>"; }; A5787E332C22B45700B021D7 /* YHActivityListCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHActivityListCell.swift; sourceTree = "<group>"; };
A5787E352C23CFDA00B021D7 /* YHActivityDetailViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHActivityDetailViewController.swift; sourceTree = "<group>"; }; A5787E352C23CFDA00B021D7 /* YHActivityDetailViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHActivityDetailViewController.swift; sourceTree = "<group>"; };
A5787E372C23D1DC00B021D7 /* YHActivityDetailCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHActivityDetailCell.swift; sourceTree = "<group>"; }; A5787E372C23D1DC00B021D7 /* YHActivityDetailCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHActivityDetailCell.swift; sourceTree = "<group>"; };
A5787E392C23DA8A00B021D7 /* YHActivityDetailBottomView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHActivityDetailBottomView.swift; sourceTree = "<group>"; };
A5787E3B2C23DEE500B021D7 /* YHAcitivityTitleItemView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHAcitivityTitleItemView.swift; sourceTree = "<group>"; };
A5787E3D2C23DF8C00B021D7 /* YHAcitivityDetailItemView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHAcitivityDetailItemView.swift; sourceTree = "<group>"; };
A5787E3F2C23DFD000B021D7 /* YHAcitivityTipsItemView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHAcitivityTipsItemView.swift; sourceTree = "<group>"; };
A580371D2BAD784B0031C312 /* YHMySchemeViewModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHMySchemeViewModel.swift; sourceTree = "<group>"; }; A580371D2BAD784B0031C312 /* YHMySchemeViewModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHMySchemeViewModel.swift; sourceTree = "<group>"; };
A58037202BAD7B2A0031C312 /* YHMySchemeModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHMySchemeModel.swift; sourceTree = "<group>"; }; A58037202BAD7B2A0031C312 /* YHMySchemeModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHMySchemeModel.swift; sourceTree = "<group>"; };
A582B23C2BB944ED009D098C /* YHHKPlanDoctumentVC.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHHKPlanDoctumentVC.swift; sourceTree = "<group>"; }; A582B23C2BB944ED009D098C /* YHHKPlanDoctumentVC.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHHKPlanDoctumentVC.swift; sourceTree = "<group>"; };
...@@ -2293,6 +2301,10 @@ ...@@ -2293,6 +2301,10 @@
children = ( children = (
A5787E332C22B45700B021D7 /* YHActivityListCell.swift */, A5787E332C22B45700B021D7 /* YHActivityListCell.swift */,
A5787E372C23D1DC00B021D7 /* YHActivityDetailCell.swift */, A5787E372C23D1DC00B021D7 /* YHActivityDetailCell.swift */,
A5787E392C23DA8A00B021D7 /* YHActivityDetailBottomView.swift */,
A5787E3B2C23DEE500B021D7 /* YHAcitivityTitleItemView.swift */,
A5787E3D2C23DF8C00B021D7 /* YHAcitivityDetailItemView.swift */,
A5787E3F2C23DFD000B021D7 /* YHAcitivityTipsItemView.swift */,
); );
path = V; path = V;
sourceTree = "<group>"; sourceTree = "<group>";
...@@ -3028,6 +3040,7 @@ ...@@ -3028,6 +3040,7 @@
04AF514E2BEB585C00009E3A /* YHVideoPlayerVC.swift in Sources */, 04AF514E2BEB585C00009E3A /* YHVideoPlayerVC.swift in Sources */,
045EEEA12B9F171A0022A143 /* YHWorkExperienceDetailModel.swift in Sources */, 045EEEA12B9F171A0022A143 /* YHWorkExperienceDetailModel.swift in Sources */,
A5573ED22B317BFF00D98EC0 /* AppDelegate.swift in Sources */, A5573ED22B317BFF00D98EC0 /* AppDelegate.swift in Sources */,
A5787E3E2C23DF8C00B021D7 /* YHAcitivityDetailItemView.swift in Sources */,
A567E5A12BD7643D00D5D5A0 /* YHHKEventViewController.swift in Sources */, A567E5A12BD7643D00D5D5A0 /* YHHKEventViewController.swift in Sources */,
A5ACE9542B4564F7002C94D2 /* YHNavigationController.swift in Sources */, A5ACE9542B4564F7002C94D2 /* YHNavigationController.swift in Sources */,
044D0C002C21663300C5CF5E /* YHMyInformationItemCell.swift in Sources */, 044D0C002C21663300C5CF5E /* YHMyInformationItemCell.swift in Sources */,
...@@ -3091,6 +3104,7 @@ ...@@ -3091,6 +3104,7 @@
A567E5972BD7643D00D5D5A0 /* YHHomeModel.swift in Sources */, A567E5972BD7643D00D5D5A0 /* YHHomeModel.swift in Sources */,
0468D4362B57752F00CFB916 /* YHUserModel.swift in Sources */, 0468D4362B57752F00CFB916 /* YHUserModel.swift in Sources */,
A567E5982BD7643D00D5D5A0 /* YHHKEventModel.swift in Sources */, A567E5982BD7643D00D5D5A0 /* YHHKEventModel.swift in Sources */,
A5787E3A2C23DA8A00B021D7 /* YHActivityDetailBottomView.swift in Sources */,
045EEE992B9F171A0022A143 /* YHPreviewInfoHoldView.swift in Sources */, 045EEE992B9F171A0022A143 /* YHPreviewInfoHoldView.swift in Sources */,
045EEE7E2B9F171A0022A143 /* YHPersonInfoCellModel1.swift in Sources */, 045EEE7E2B9F171A0022A143 /* YHPersonInfoCellModel1.swift in Sources */,
04FD856C2C2153F000BEF9C5 /* YHMyEducationCell.swift in Sources */, 04FD856C2C2153F000BEF9C5 /* YHMyEducationCell.swift in Sources */,
...@@ -3278,6 +3292,7 @@ ...@@ -3278,6 +3292,7 @@
A567E5A72BD7643D00D5D5A0 /* YHHomeKingKongBlockView.swift in Sources */, A567E5A72BD7643D00D5D5A0 /* YHHomeKingKongBlockView.swift in Sources */,
A5787E382C23D1DC00B021D7 /* YHActivityDetailCell.swift in Sources */, A5787E382C23D1DC00B021D7 /* YHActivityDetailCell.swift in Sources */,
04A6715E2B9FFCA700C1FB91 /* YHCertificateNameCell.swift in Sources */, 04A6715E2B9FFCA700C1FB91 /* YHCertificateNameCell.swift in Sources */,
A5787E3C2C23DEE500B021D7 /* YHAcitivityTitleItemView.swift in Sources */,
A567E5AF2BD7643D00D5D5A0 /* YHHomeWebViewBottomForSavePicView.swift in Sources */, A567E5AF2BD7643D00D5D5A0 /* YHHomeWebViewBottomForSavePicView.swift in Sources */,
048787D72BCE96F50036E221 /* YHServiceOrderProgressTableViewCell.swift in Sources */, 048787D72BCE96F50036E221 /* YHServiceOrderProgressTableViewCell.swift in Sources */,
04EA23082BB50753009DA928 /* YHDocumentMessageTableViewCell.swift in Sources */, 04EA23082BB50753009DA928 /* YHDocumentMessageTableViewCell.swift in Sources */,
...@@ -3424,6 +3439,7 @@ ...@@ -3424,6 +3439,7 @@
043B0A352C1190C6008A9BBA /* YHSelectFileSheetView.swift in Sources */, 043B0A352C1190C6008A9BBA /* YHSelectFileSheetView.swift in Sources */,
04F5F8662C197FFF004A463C /* YHHKControllerHoldViewController.swift in Sources */, 04F5F8662C197FFF004A463C /* YHHKControllerHoldViewController.swift in Sources */,
A5ACE92D2B4564F7002C94D2 /* YHLoginPrivacyView.swift in Sources */, A5ACE92D2B4564F7002C94D2 /* YHLoginPrivacyView.swift in Sources */,
A5787E402C23DFD000B021D7 /* YHAcitivityTipsItemView.swift in Sources */,
04FD85742C219CFD00BEF9C5 /* YHMatchPeopleViewController.swift in Sources */, 04FD85742C219CFD00BEF9C5 /* YHMatchPeopleViewController.swift in Sources */,
045EEEB72B9F171A0022A143 /* YHWorkItemAddView.swift in Sources */, 045EEEB72B9F171A0022A143 /* YHWorkItemAddView.swift in Sources */,
A5ACE9372B4564F7002C94D2 /* YHBaseUrlManager.swift in Sources */, A5ACE9372B4564F7002C94D2 /* YHBaseUrlManager.swift in Sources */,
......
...@@ -10,7 +10,7 @@ import UIKit ...@@ -10,7 +10,7 @@ import UIKit
class YHActivityDetailViewController: YHBaseViewController { class YHActivityDetailViewController: YHBaseViewController {
lazy var tableView: UITableView = { lazy var tableView: UITableView = {
let tableView = UITableView(frame:.zero, style:.grouped) let tableView = UITableView(frame:.zero, style:.plain)
tableView.showsVerticalScrollIndicator = false tableView.showsVerticalScrollIndicator = false
tableView.separatorStyle = .none tableView.separatorStyle = .none
tableView.delegate = self tableView.delegate = self
...@@ -18,106 +18,94 @@ class YHActivityDetailViewController: YHBaseViewController { ...@@ -18,106 +18,94 @@ class YHActivityDetailViewController: YHBaseViewController {
tableView.backgroundColor = UIColor.white tableView.backgroundColor = UIColor.white
tableView.register(UITableViewCell.self, forCellReuseIdentifier: "UITableViewCell") tableView.register(UITableViewCell.self, forCellReuseIdentifier: "UITableViewCell")
tableView.register(YHActivityDetailCell.self, forCellReuseIdentifier: YHActivityDetailCell.cellReuseIdentifier) tableView.register(YHActivityDetailCell.self, forCellReuseIdentifier: YHActivityDetailCell.cellReuseIdentifier)
tableView.backgroundView = self.emptyDataTipsView tableView.tableHeaderView = nil
tableView.tableFooterView = nil
tableView.estimatedSectionHeaderHeight = 0
tableView.estimatedSectionFooterHeight = 0
return tableView return tableView
}() }()
lazy var emptyDataTipsView: YHEmptyDataView = { // lazy var emptyDataTipsView: YHEmptyDataView = {
let view = YHEmptyDataView.createView("暂无活动", kNoFriendsBgName) // let view = YHEmptyDataView.createView("暂无活动", kNoFriendsBgName)
view.topMargin = 222 // view.topMargin = 222
view.isHidden = true // view.isHidden = true
// return view
// }()
lazy var topView : UIView = {
let view = UIView()
return view
}()
lazy var bottomView : YHActivityDetailBottomView = {
let view = YHActivityDetailBottomView()
return view return view
}() }()
// MARK: - 生命周期方法 // MARK: - 生命周期方法
override func viewDidLoad() { override func viewDidLoad() {
super.viewDidLoad() super.viewDidLoad()
view.backgroundColor = .white
gk_navigationBar.isHidden = true gk_navigationBar.isHidden = false
gk_navigationBar.backgroundColor = .white gk_navigationBar.backgroundColor = .clear
view.addSubview(self.tableView)
view.backgroundColor = .red //for test hjl
//1.
view.addSubview(tableView)
view.addSubview(bottomView)
tableView.contentInsetAdjustmentBehavior = .never
tableView.snp.makeConstraints { make in tableView.snp.makeConstraints { make in
make.left.equalTo(20) make.left.right.top.equalToSuperview()
make.right.equalTo(-20) make.bottom.equalTo(bottomView.snp.top)
make.bottom.equalToSuperview()
make.top.equalToSuperview()
} }
tableView.es.addYHPullToRefresh {
self.loadFirstData() bottomView.snp.makeConstraints { make in
} make.left.right.bottom.equalToSuperview()
make.height.equalTo(YHActivityDetailBottomView.viewH)
tableView.es.addInfiniteScrolling {
self.loadMoreData()
} }
//2.
// addTopView()
// topView.backgroundColor = .red
} }
var friendsArr:[String] = ["","","","","","","","",""]
} }
extension YHActivityDetailViewController { extension YHActivityDetailViewController {
func loadMoreData() { func addTopView() {
// DispatchQueue.global().async {
// self.viewModel.getHomeNewsList(firstPageFlag : false) {[weak self] success, error in topView.frame = CGRect(x: 0, y: 0, width: KScreenWidth, height: 114)
// guard let self = self else { return } view.addSubview(topView)
// DispatchQueue.main.asyncAfter(wallDeadline: .now() + 0.35, execute: {
// CATransaction.setDisableActions(true) let gradientLayer = CAGradientLayer()
// self.homeCollectView.reloadData() gradientLayer.frame = topView.bounds
// CATransaction.commit()
//
// self.homeCollectView.es.stopLoadingMore()
// if self.viewModel.hasMoreForHomeNews == false {
// self.homeCollectView.es.noticeNoMoreData()
// self.homeCollectView.footer?.alpha = 1
// }
// })
// }
// }
DispatchQueue.main.asyncAfter(deadline: .now()+0.5, execute: {
self.tableView.es.stopLoadingMore()
})
}
func loadFirstData() {
// self.viewModel.getHomeNewsList(firstPageFlag : true) {[weak self] success, error in
// guard let self = self else { return }
//
// if let arrB = self.viewModel.arrHomeNewsData,arrB.count > 0 {
// let arrString = arrB.toJSONString()
// UserDefaults.standard.set(arrString, forKey: "homeFirstPageNewsData")
// UserDefaults.standard.synchronize()
// }
//
// DispatchQueue.main.asyncAfter(deadline: .now()+0.5, execute: {
// self.homeCollectView.es.stopPullToRefresh()
//
//
// if self.viewModel.hasMoreForHomeNews == false {
// self.homeCollectView.es.noticeNoMoreData()
// self.homeCollectView.footer?.alpha = 1
// }
//
// CATransaction.setDisableActions(true)
// self.homeCollectView.reloadData()
// CATransaction.commit()
// })
// }
// 定义渐变颜色,这里使用了两种颜色
let colorTop = UIColor.red//UIColor(hex: 0x000000, alpha: 1)
let colorBottom = UIColor.blue//UIColor(hex: 0x000000, alpha: 0)
DispatchQueue.main.asyncAfter(deadline: .now()+0.5, execute: { // 设置颜色数组
self.tableView.es.stopPullToRefresh() 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 YHActivityDetailViewController: UITableViewDelegate, UITableViewDataSource { extension YHActivityDetailViewController: UITableViewDelegate, UITableViewDataSource {
func numberOfSections(in tableView: UITableView) -> Int { func numberOfSections(in tableView: UITableView) -> Int {
if self.friendsArr.count > 0 { return 1
return friendsArr.count
}
return 0
} }
func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int { func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
...@@ -132,39 +120,28 @@ extension YHActivityDetailViewController: UITableViewDelegate, UITableViewDataSo ...@@ -132,39 +120,28 @@ extension YHActivityDetailViewController: UITableViewDelegate, UITableViewDataSo
} }
func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat { func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat {
return 185.0 return UITableView.automaticDimension
}
func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
} }
func tableView(_ tableView: UITableView, heightForHeaderInSection section: Int) -> CGFloat { // func tableView(_ tableView: UITableView, heightForHeaderInSection section: Int) -> CGFloat {
var height : CGFloat = 16.0 //
if section != 0 { // return 0.001
height = 20.0 // }
} //
return height // func tableView(_ tableView: UITableView, viewForHeaderInSection section: Int) -> UIView? {
} //
// let view = UIView(frame: CGRect(x: 0, y: 0, width: KScreenWidth, height: 0.001))
func tableView(_ tableView: UITableView, viewForHeaderInSection section: Int) -> UIView? { // view.backgroundColor = .clear
// return view
var height : CGFloat = 16.0 // }
if section != 0 { //
height = 20.0 // 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
let view = UIView(frame: CGRect(x: 0, y: 0, width: KScreenWidth-16.0*2, height: height)) // return view
view.backgroundColor = .clear // }
return view //
} // func tableView(_ tableView: UITableView, heightForFooterInSection section: Int) -> CGFloat {
// return 0.001
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
}
} }
//
// YHAcitivityDetailItemView.swift
// galaxy
//
// Created by davidhuangA on 2024/6/20.
// Copyright © 2024 https://www.galaxy-immi.com. All rights reserved.
//
import UIKit
class YHAcitivityDetailItemView: UIView {
required init?(coder: NSCoder) {
fatalError("init(coder:) has not been implemented")
}
override init(frame: CGRect) {
super.init(frame: frame)
setupUI()
}
private lazy var bottomLine : UIView = {
let view = UIView()
view.backgroundColor = UIColor.separatorColor
return view
}()
lazy var nameLabel:UILabel = {
let nameLabel = UILabel()
nameLabel.textColor = UIColor.mainTextColor
nameLabel.textAlignment = .left
nameLabel.font = UIFont.PFSC_M(ofSize:17)
nameLabel.text = "活动详情"
nameLabel.numberOfLines = 0
return nameLabel
}()
lazy var describeLable:UILabel = {
let nameLabel = UILabel()
nameLabel.textColor = UIColor.mainTextColor70
nameLabel.textAlignment = .left
nameLabel.lineBreakMode = .byCharWrapping
nameLabel.font = UIFont.PFSC_R(ofSize:14)
nameLabel.text = "1. 从学渣到哈佛,小儿子经历的挫折和迷茫\r\n2. 诈骗到财富自由,大儿子的“啃老”生活\r\n3. 小女儿15岁写两本书,又获艺术类冠亚军\r\n4. 养育五部曲,精心散养、快乐养育"
nameLabel.numberOfLines = 0
return nameLabel
}()
}
extension YHAcitivityDetailItemView {
func setupUI() {
addSubview(bottomLine)
addSubview(nameLabel)
addSubview(describeLable)
bottomLine.snp.makeConstraints { make in
make.top.left.right.equalToSuperview()
make.height.equalTo(1)
}
nameLabel.snp.makeConstraints { make in
make.left.right.equalToSuperview()
make.top.equalTo(bottomLine.snp.bottom).offset(24)
}
describeLable.snp.makeConstraints { make in
make.left.right.equalToSuperview()
make.top.equalTo(nameLabel.snp.bottom).offset(24)
}
let imageV : UIImageView = UIImageView()
imageV.backgroundColor = .red //for test hjl
addSubview(imageV)
imageV.snp.makeConstraints { make in
make.left.right.equalToSuperview()
make.top.equalTo(describeLable.snp.bottom).offset(24)
make.height.equalTo(376)
}
let imageV2 : UIImageView = UIImageView()
imageV2.backgroundColor = .purple //for test hjl
addSubview(imageV2)
imageV2.snp.makeConstraints { make in
make.left.right.equalToSuperview()
make.top.equalTo(imageV.snp.bottom).offset(20)
make.height.equalTo(376)
make.bottom.equalToSuperview()
}
}
}
//
// YHAcitivityTipsItemView.swift
// galaxy
//
// Created by davidhuangA on 2024/6/20.
// Copyright © 2024 https://www.galaxy-immi.com. All rights reserved.
//
import UIKit
class YHAcitivityTipsItemView: UIView {
required init?(coder: NSCoder) {
fatalError("init(coder:) has not been implemented")
}
override init(frame: CGRect) {
super.init(frame: frame)
setupUI()
}
private lazy var bottomLine : UIView = {
let view = UIView()
view.backgroundColor = UIColor.separatorColor
return view
}()
lazy var nameLabel:UILabel = {
let nameLabel = UILabel()
nameLabel.textColor = UIColor.mainTextColor
nameLabel.textAlignment = .left
nameLabel.font = UIFont.PFSC_M(ofSize:17)
nameLabel.text = "温馨提示"
nameLabel.numberOfLines = 0
return nameLabel
}()
lazy var describeLable:UILabel = {
let nameLabel = UILabel()
nameLabel.textColor = UIColor.mainTextColor70
nameLabel.textAlignment = .left
nameLabel.lineBreakMode = .byCharWrapping
nameLabel.font = UIFont.PFSC_R(ofSize:14)
nameLabel.text = "1、请大家仔细甄别活动的真实性、有效性、安全性。所有运动、户外等具有相关风险的活动请确认购买保险;\r\n2、此活动开始前24小时可以取消报名;\r\n3、若取消活动,系统将通知你活动取消。"
nameLabel.numberOfLines = 0
return nameLabel
}()
}
extension YHAcitivityTipsItemView {
func setupUI() {
addSubview(bottomLine)
addSubview(nameLabel)
addSubview(describeLable)
bottomLine.snp.makeConstraints { make in
make.top.left.right.equalToSuperview()
make.height.equalTo(1)
}
nameLabel.snp.makeConstraints { make in
make.left.right.equalToSuperview()
make.top.equalTo(bottomLine.snp.bottom).offset(24)
}
describeLable.snp.makeConstraints { make in
make.left.right.equalToSuperview()
make.top.equalTo(nameLabel.snp.bottom).offset(24)
make.bottom.equalToSuperview()
}
}
}
//
// YHAcitivityTitleView.swift
// galaxy
//
// Created by davidhuangA on 2024/6/20.
// Copyright © 2024 https://www.galaxy-immi.com. All rights reserved.
//
import UIKit
class YHAcitivityTitleItemView: UIView {
required init?(coder: NSCoder) {
fatalError("init(coder:) has not been implemented")
}
override init(frame: CGRect) {
super.init(frame: frame)
setupUI()
}
lazy var nameLabel:UILabel = {
let nameLabel = UILabel()
nameLabel.textColor = UIColor.mainTextColor
nameLabel.textAlignment = .left
nameLabel.font = UIFont.PFSC_B(ofSize:24)
nameLabel.text = "哈佛爸爸线下教育沙龙"
return nameLabel
}()
lazy var timeStaticLable:UILabel = {
let nameLabel = UILabel()
nameLabel.textColor = UIColor.mainTextColor50
nameLabel.textAlignment = .left
nameLabel.font = UIFont.PFSC_R(ofSize:14)
nameLabel.text = "时间"
return nameLabel
}()
lazy var timeLable:UILabel = {
let nameLabel = UILabel()
nameLabel.textColor = UIColor.mainTextColor
nameLabel.textAlignment = .left
nameLabel.font = UIFont.PFSC_R(ofSize:14)
nameLabel.text = "2024-08-06 周五 09:30"
return nameLabel
}()
lazy var addressStaticLable:UILabel = {
let nameLabel = UILabel()
nameLabel.textColor = UIColor.mainTextColor50
nameLabel.textAlignment = .left
nameLabel.font = UIFont.PFSC_R(ofSize:14)
nameLabel.text = "地址"
return nameLabel
}()
lazy var addressLable:UILabel = {
let nameLabel = UILabel()
nameLabel.textColor = UIColor.mainTextColor
nameLabel.textAlignment = .left
nameLabel.font = UIFont.PFSC_R(ofSize:14)
nameLabel.text = "深圳市本元大厦26A银河集团体验中心"
return nameLabel
}()
lazy var navAddressLable:UILabel = {
let nameLabel = UILabel()
nameLabel.textColor = UIColor.mainTextColor50
nameLabel.textAlignment = .left
nameLabel.font = UIFont.PFSC_R(ofSize:14)
nameLabel.text = "距地铁10号线亮马站D口步行62"
return nameLabel
}()
}
extension YHAcitivityTitleItemView {
func setupUI() {
addSubview(nameLabel)
addSubview(timeStaticLable)
addSubview(timeLable)
addSubview(addressStaticLable)
addSubview(addressLable)
addSubview(navAddressLable)
nameLabel.snp.makeConstraints { make in
make.top.left.right.equalToSuperview()
}
timeStaticLable.snp.makeConstraints { make in
make.left.equalToSuperview()
make.top.equalTo(nameLabel.snp.bottom).offset(24)
make.height.equalTo(20)
make.width.equalTo(28)
}
timeLable.snp.makeConstraints { make in
make.left.equalTo(timeStaticLable.snp.right).offset(16)
make.top.equalTo(timeStaticLable.snp.top)
make.right.equalToSuperview()
}
addressStaticLable.snp.makeConstraints { make in
make.left.equalTo(timeStaticLable.snp.left)
make.top.equalTo(timeLable.snp.bottom).offset(13)
make.height.equalTo(timeStaticLable.snp.height)
make.width.equalTo(timeStaticLable.snp.width)
}
addressLable.snp.makeConstraints { make in
make.left.equalTo(timeLable.snp.left)
make.top.equalTo(addressStaticLable.snp.top)
make.right.equalToSuperview()
}
navAddressLable.snp.makeConstraints { make in
make.left.equalTo(addressLable.snp.left)
make.top.equalTo(addressLable.snp.bottom).offset(8)
make.right.equalToSuperview()
make.bottom.equalToSuperview()
}
}
}
//
// YHActivityDetailBottomView.swift
// galaxy
//
// Created by davidhuangA on 2024/6/20.
// Copyright © 2024 https://www.galaxy-immi.com. All rights reserved.
//
import UIKit
class YHActivityDetailBottomView: UIView {
static let viewH : CGFloat = 98.0
override init(frame: CGRect) {
super.init(frame: CGRect(x: 0, y: 0, width: KScreenWidth, height: YHBasicInfoFillBottomView.viewH))
setupUI()
}
required init?(coder: NSCoder) {
fatalError("init(coder:) has not been implemented")
}
typealias Block = (Int) -> ()
var block: Block?
var saveButton: UIButton!
var nextButton: UIButton!
private lazy var bottomLine : UIView = {
let view = UIView()
view.backgroundColor = UIColor.separatorColor
return view
}()
}
private extension YHActivityDetailBottomView {
func setupUI() {
backgroundColor = .white
addSubview(bottomLine)
bottomLine.snp.makeConstraints { make in
make.top.left.right.equalToSuperview()
make.height.equalTo(1)
}
saveButton = {
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(save), for: .touchUpInside)
return button
}()
addSubview(saveButton)
saveButton.snp.makeConstraints { make in
make.left.equalTo(20)
make.right.equalTo(-20)
make.top.equalTo(bottomLine.snp.bottom).offset(8)
make.height.equalTo(48)
}
}
@objc func save() {
block?(0)
}
}
...@@ -14,158 +14,91 @@ class YHActivityDetailCell: UITableViewCell { ...@@ -14,158 +14,91 @@ class YHActivityDetailCell: UITableViewCell {
var sessionIndex : Int = 0 { var sessionIndex : Int = 0 {
didSet { didSet {
let tmp = sessionIndex % 3 // let tmp = sessionIndex % 3
let name = "activity_cell_bkg_" + String(tmp) // let name = "activity_cell_bkg_" + String(tmp)
bkgImgV.image = UIImage(named: name) // bkgImgV.image = UIImage(named: name)
contentView.backgroundColor = .red//for test hjl
} }
} }
lazy var bkgImgV:UIImageView = {
let view = UIImageView()
view.image = UIImage(named: "activity_cell_bkg_0")
// view.contentMode = .scaleAspectFill
return view
}()
lazy var vipImgV:UIImageView = {
let view = UIImageView()
view.image = UIImage(named: "activity_vip_icon")
view.contentMode = .scaleAspectFill
return view
}()
lazy var nameLabel:UILabel = { required init?(coder: NSCoder) {
let nameLabel = UILabel() super.init(coder: coder)
nameLabel.textColor = UIColor.mainTextColor }
nameLabel.textAlignment = .left
nameLabel.font = UIFont.PFSC_M(ofSize:18)
nameLabel.text = "银河APP发布会"
nameLabel.numberOfLines = 2
return nameLabel
}()
override init(style: UITableViewCell.CellStyle, reuseIdentifier: String?) {
super.init(style: style, reuseIdentifier: reuseIdentifier)
setupUI()
}
lazy var activityImgV:UIImageView = { lazy var topImgV:UIImageView = {
let view = UIImageView() let view = UIImageView()
view.image = UIImage(named: "activity_cell_bkg_0")
view.contentMode = .scaleAspectFill view.contentMode = .scaleAspectFill
view.backgroundColor = .purple //for test hjl view.clipsToBounds = true
return view return view
}() }()
lazy var lineView:UIView = {
let view = UIView() //活动名称地址
view.backgroundColor = .separatorColor lazy var acitivityTitle:YHAcitivityTitleItemView = {
let view = YHAcitivityTitleItemView()
return view return view
}() }()
lazy var dateLabel:UILabel = {
let label = UILabel()
label.textColor = UIColor.mainTextColor70
label.textAlignment = .left
label.font = UIFont.PFSC_R(ofSize:12)
label.text = "08/08 周五 18:00-20:00"
return label
}()
lazy var detailLabel:UILabel = { //活动详情
let label = UILabel() lazy var acitivityDetail:YHAcitivityDetailItemView = {
label.textColor = UIColor.mainTextColor70 let view = YHAcitivityDetailItemView()
label.textAlignment = .left return view
label.font = UIFont.PFSC_R(ofSize:12)
label.text = "深圳深南大道本元大厦26A银河体验中心"
return label
}() }()
//活动温馨提示
lazy var acitivityTips:YHAcitivityTipsItemView = {
lazy var statusLabel:UILabel = { let view = YHAcitivityTipsItemView()
let label = UILabel() return view
label.textColor = UIColor.brandMainColor
label.textAlignment = .right
label.font = UIFont.PFSC_R(ofSize:12)
label.text = "立即报名"
return label
}() }()
required init?(coder: NSCoder) {
super.init(coder: coder)
}
override init(style: UITableViewCell.CellStyle, reuseIdentifier: String?) {
super.init(style: style, reuseIdentifier: reuseIdentifier)
setupUI()
}
} }
extension YHActivityDetailCell { extension YHActivityDetailCell {
func setupUI() { func setupUI() {
backgroundColor = .clear backgroundColor = .clear
contentView.backgroundColor = .white//for test hjl
selectionStyle = .none selectionStyle = .none
contentView.addSubview(bkgImgV)
contentView.addSubview(vipImgV)
contentView.addSubview(nameLabel)
contentView.addSubview(activityImgV)
contentView.addSubview(lineView)
contentView.addSubview(dateLabel)
contentView.addSubview(detailLabel)
contentView.addSubview(statusLabel)
contentView.addSubview(topImgV)
contentView.addSubview(acitivityTitle)
contentView.addSubview(acitivityDetail)
contentView.addSubview(acitivityTips)
bkgImgV.snp.makeConstraints { make in
make.edges.equalToSuperview()
}
vipImgV.snp.makeConstraints { make in topImgV.snp.makeConstraints { make in
make.top.left.equalToSuperview() make.top.left.right.equalToSuperview()
make.width.equalTo(44) make.height.equalTo(KScreenWidth)
make.height.equalTo(18)
} }
activityImgV.snp.makeConstraints { make in acitivityTitle.snp.makeConstraints { make in
make.top.equalTo(topImgV.snp.bottom).offset(24)
make.left.equalTo(20)
make.right.equalTo(-20) make.right.equalTo(-20)
make.top.equalTo(20)
make.width.height.equalTo(72)
} }
nameLabel.snp.makeConstraints { make in
make.top.equalTo(28)
make.left.equalTo(18)
make.right.equalTo(activityImgV.snp.left).offset(-20)
}
lineView.snp.makeConstraints { make in
make.top.equalTo(activityImgV.snp.bottom).offset(20)
make.left.equalTo(nameLabel.snp.left)
make.right.equalTo(activityImgV.snp.right)
make.height.equalTo(1)
}
dateLabel.snp.makeConstraints { make in
make.top.equalTo(lineView.snp.bottom).offset(14)
make.left.equalTo(lineView.snp.left)
make.right.equalTo(lineView.snp.right)
make.height.equalTo(17)
}
acitivityDetail.snp.makeConstraints { make in
statusLabel.snp.makeConstraints { make in make.top.equalTo(acitivityTitle.snp.bottom).offset(24)
make.top.equalTo(dateLabel.snp.bottom).offset(8) make.left.equalTo(20)
make.right.equalTo(dateLabel.snp.right) make.right.equalTo(-20)
make.height.equalTo(17)
make.width.equalTo(48)
} }
detailLabel.snp.makeConstraints { make in acitivityTips.snp.makeConstraints { make in
make.top.equalTo(statusLabel.snp.top) make.top.equalTo(acitivityDetail.snp.bottom).offset(24)
make.left.equalTo(dateLabel.snp.left) make.left.equalTo(20)
make.height.equalTo(17) make.right.equalTo(-20)
make.right.equalTo(statusLabel.snp.left).offset(16)
make.bottom.equalToSuperview().offset(-42)
} }
} }
} }
...@@ -17,14 +17,13 @@ class YHActivityListCell: UITableViewCell { ...@@ -17,14 +17,13 @@ class YHActivityListCell: UITableViewCell {
let tmp = sessionIndex % 3 let tmp = sessionIndex % 3
let name = "activity_cell_bkg_" + String(tmp) let name = "activity_cell_bkg_" + String(tmp)
bkgImgV.image = UIImage(named: name) bkgImgV.image = UIImage(named: name)
contentView.backgroundColor = .red//for test hjl
} }
} }
lazy var bkgImgV:UIImageView = { lazy var bkgImgV:UIImageView = {
let view = UIImageView() let view = UIImageView()
view.image = UIImage(named: "activity_cell_bkg_0") view.image = UIImage(named: "activity_cell_bkg_0")
// view.contentMode = .scaleAspectFill view.contentMode = .scaleAspectFit
return view return view
}() }()
......
...@@ -72,7 +72,7 @@ class YHAgreementAlertView: UIView { ...@@ -72,7 +72,7 @@ class YHAgreementAlertView: UIView {
lineView = { lineView = {
let line = UIView() let line = UIView()
line.backgroundColor = UIColor(hex: 0xF0F0F0) line.backgroundColor = UIColor.separatorColor
return line return line
}() }()
centerView.addSubview(lineView) centerView.addSubview(lineView)
......
...@@ -34,7 +34,7 @@ class YHScoreOptionsView: UIView { ...@@ -34,7 +34,7 @@ class YHScoreOptionsView: UIView {
lazy var bottomLine : UIView = { lazy var bottomLine : UIView = {
let view = UIView() let view = UIView()
view.backgroundColor = UIColor(hex:0xF0F0F0) view.backgroundColor = UIColor.separatorColor
return view return view
}() }()
......
...@@ -56,7 +56,7 @@ class YHScoreResultView: UIView { ...@@ -56,7 +56,7 @@ class YHScoreResultView: UIView {
private lazy var bottomLine : UIView = { private lazy var bottomLine : UIView = {
let view = UIView() let view = UIView()
view.backgroundColor = UIColor(hex:0xF0F0F0) view.backgroundColor = UIColor.separatorColor
return view return view
}() }()
} }
......
...@@ -213,7 +213,7 @@ class YHCommonAlertView: UIView { ...@@ -213,7 +213,7 @@ class YHCommonAlertView: UIView {
lineView = { lineView = {
let line = UIView() let line = UIView()
line.backgroundColor = UIColor(hex: 0xF0F0F0) line.backgroundColor = UIColor.separatorColor
return line return line
}() }()
centerView.addSubview(lineView) centerView.addSubview(lineView)
......
...@@ -78,7 +78,7 @@ class YHBasicInfoFillView: UIView, UITextViewDelegate { ...@@ -78,7 +78,7 @@ class YHBasicInfoFillView: UIView, UITextViewDelegate {
private lazy var bottomLine : UIView = { private lazy var bottomLine : UIView = {
let view = UIView() let view = UIView()
view.backgroundColor = UIColor(hex: 0xF0F0F0) view.backgroundColor = UIColor.separatorColor
return view return view
}() }()
......
...@@ -213,7 +213,7 @@ class HKDegreeInfoItemView: UIView { ...@@ -213,7 +213,7 @@ class HKDegreeInfoItemView: UIView {
private lazy var topLineView:UIView = { private lazy var topLineView:UIView = {
let view = UIView() let view = UIView()
view.backgroundColor = UIColor(hex: 0xF0F0F0) view.backgroundColor = UIColor.separatorColor
return view return view
}() }()
......
...@@ -46,7 +46,7 @@ class YHCustomTextView: UIView, UITextViewDelegate { ...@@ -46,7 +46,7 @@ class YHCustomTextView: UIView, UITextViewDelegate {
private lazy var bottomLine : UIView = { private lazy var bottomLine : UIView = {
let view = UIView() let view = UIView()
view.backgroundColor = .clear//UIColor(hex: 0xF0F0F0) view.backgroundColor = .clear//UIColor.separatorColor
return view return view
}() }()
......
...@@ -54,7 +54,7 @@ class YHOtherInfoSessionView: UIView { ...@@ -54,7 +54,7 @@ class YHOtherInfoSessionView: UIView {
private lazy var bottomLine : UIView = { private lazy var bottomLine : UIView = {
let view = UIView() let view = UIView()
view.backgroundColor = UIColor(hex: 0xF0F0F0) view.backgroundColor = UIColor.separatorColor
return view return view
}() }()
......
...@@ -90,7 +90,7 @@ class YHOtherSelecteItemView: UIView { ...@@ -90,7 +90,7 @@ class YHOtherSelecteItemView: UIView {
private lazy var bottomLine : UIView = { private lazy var bottomLine : UIView = {
let view = UIView() let view = UIView()
view.backgroundColor = UIColor(hex: 0xF0F0F0) view.backgroundColor = UIColor.separatorColor
return view return view
}() }()
......
...@@ -79,7 +79,7 @@ class YHOtherTextViewItemView: UIView, UITextViewDelegate { ...@@ -79,7 +79,7 @@ class YHOtherTextViewItemView: UIView, UITextViewDelegate {
private lazy var bottomLine : UIView = { private lazy var bottomLine : UIView = {
let view = UIView() let view = UIView()
view.backgroundColor = UIColor(hex: 0xF0F0F0) view.backgroundColor = UIColor.separatorColor
return view return view
}() }()
......
...@@ -79,7 +79,7 @@ class YHOtherYesOrNoItemView: UIView, UITextViewDelegate { ...@@ -79,7 +79,7 @@ class YHOtherYesOrNoItemView: UIView, UITextViewDelegate {
private lazy var bottomLine : UIView = { private lazy var bottomLine : UIView = {
let view = UIView() let view = UIView()
view.backgroundColor = UIColor(hex: 0xF0F0F0) view.backgroundColor = UIColor.separatorColor
return view return view
}() }()
......
...@@ -87,7 +87,7 @@ extension YHPreviewInfoCertificateInformationItemsView { ...@@ -87,7 +87,7 @@ extension YHPreviewInfoCertificateInformationItemsView {
let bottomLine = UIView() let bottomLine = UIView()
bottomLine.backgroundColor = UIColor(hex: 0xF0F0F0) bottomLine.backgroundColor = UIColor.separatorColor
addSubview(bottomLine) addSubview(bottomLine)
bottomLine.snp.makeConstraints { make in bottomLine.snp.makeConstraints { make in
make.top.equalTo(cellView.snp.bottom).offset(28) make.top.equalTo(cellView.snp.bottom).offset(28)
......
...@@ -85,7 +85,7 @@ class YHPreviewInfoCertificatePictureItemView: UIView { ...@@ -85,7 +85,7 @@ class YHPreviewInfoCertificatePictureItemView: UIView {
lazy var bottomLine : UIView = { lazy var bottomLine : UIView = {
let lable = UIView() let lable = UIView()
lable.backgroundColor = UIColor(hex: 0xF0F0F0) lable.backgroundColor = UIColor.separatorColor
return lable return lable
}() }()
} }
......
...@@ -29,7 +29,7 @@ class YHPreviewInfoSingleLineTitleView: UIView { ...@@ -29,7 +29,7 @@ class YHPreviewInfoSingleLineTitleView: UIView {
private lazy var bottomLine : UIView = { private lazy var bottomLine : UIView = {
let view = UIView() let view = UIView()
view.backgroundColor = UIColor(hex: 0xF0F0F0) view.backgroundColor = UIColor.separatorColor
return view return view
}() }()
......
...@@ -62,7 +62,7 @@ class YHWorkIntroductionViewController: YHBaseViewController { ...@@ -62,7 +62,7 @@ class YHWorkIntroductionViewController: YHBaseViewController {
} }
if i != array.count - 1 { if i != array.count - 1 {
let line = UIView() let line = UIView()
line.backgroundColor = UIColor(hex: 0xf0f0f0) line.backgroundColor = UIColor.separatorColor
view.addSubview(line) view.addSubview(line)
line.snp.makeConstraints { make in line.snp.makeConstraints { make in
make.left.equalTo(18) make.left.equalTo(18)
......
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