Commit 34a525c2 authored by pete谢兆麟's avatar pete谢兆麟

香港生活主UI

parent db860983
......@@ -278,6 +278,10 @@
047AA3D52C4A3643009C4554 /* YHInvitationWithGiftsDetailView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 047AA3D42C4A3643009C4554 /* YHInvitationWithGiftsDetailView.swift */; };
047AA3D72C4A4399009C4554 /* YHInvitationWithGiftsShareView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 047AA3D62C4A4399009C4554 /* YHInvitationWithGiftsShareView.swift */; };
047AA3D92C4A4A91009C4554 /* YHInvatationShareViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 047AA3D82C4A4A91009C4554 /* YHInvatationShareViewController.swift */; };
047AA3DD2C4A6126009C4554 /* YHLifeViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 047AA3DC2C4A6126009C4554 /* YHLifeViewController.swift */; };
047AA3E02C4A63B2009C4554 /* YHLifeSectionView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 047AA3DF2C4A63B2009C4554 /* YHLifeSectionView.swift */; };
047AA3E22C4A66CE009C4554 /* YHLifeItemTableViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 047AA3E12C4A66CE009C4554 /* YHLifeItemTableViewCell.swift */; };
047AA3E42C4A6ADC009C4554 /* YHLifeHeadView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 047AA3E32C4A6ADC009C4554 /* YHLifeHeadView.swift */; };
0480976B2BA15269000B9DCA /* YHCertificateInfoCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0480976A2BA15269000B9DCA /* YHCertificateInfoCell.swift */; };
0480976D2BA158A1000B9DCA /* YHCertificateListVC.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0480976C2BA158A1000B9DCA /* YHCertificateListVC.swift */; };
048097712BA18D66000B9DCA /* YHCertificateSearchBar.swift in Sources */ = {isa = PBXBuildFile; fileRef = 048097702BA18D66000B9DCA /* YHCertificateSearchBar.swift */; };
......@@ -882,6 +886,10 @@
047AA3D42C4A3643009C4554 /* YHInvitationWithGiftsDetailView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHInvitationWithGiftsDetailView.swift; sourceTree = "<group>"; };
047AA3D62C4A4399009C4554 /* YHInvitationWithGiftsShareView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHInvitationWithGiftsShareView.swift; sourceTree = "<group>"; };
047AA3D82C4A4A91009C4554 /* YHInvatationShareViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHInvatationShareViewController.swift; sourceTree = "<group>"; };
047AA3DC2C4A6126009C4554 /* YHLifeViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHLifeViewController.swift; sourceTree = "<group>"; };
047AA3DF2C4A63B2009C4554 /* YHLifeSectionView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHLifeSectionView.swift; sourceTree = "<group>"; };
047AA3E12C4A66CE009C4554 /* YHLifeItemTableViewCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHLifeItemTableViewCell.swift; sourceTree = "<group>"; };
047AA3E32C4A6ADC009C4554 /* YHLifeHeadView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHLifeHeadView.swift; sourceTree = "<group>"; };
0480976A2BA15269000B9DCA /* YHCertificateInfoCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHCertificateInfoCell.swift; sourceTree = "<group>"; };
0480976C2BA158A1000B9DCA /* YHCertificateListVC.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHCertificateListVC.swift; sourceTree = "<group>"; };
048097702BA18D66000B9DCA /* YHCertificateSearchBar.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHCertificateSearchBar.swift; sourceTree = "<group>"; };
......@@ -2115,6 +2123,33 @@
path = M;
sourceTree = "<group>";
};
047AA3DA2C4A6102009C4554 /* Life */ = {
isa = PBXGroup;
children = (
047AA3DE2C4A639C009C4554 /* V */,
047AA3DB2C4A6110009C4554 /* C */,
);
path = Life;
sourceTree = "<group>";
};
047AA3DB2C4A6110009C4554 /* C */ = {
isa = PBXGroup;
children = (
047AA3DC2C4A6126009C4554 /* YHLifeViewController.swift */,
);
path = C;
sourceTree = "<group>";
};
047AA3DE2C4A639C009C4554 /* V */ = {
isa = PBXGroup;
children = (
047AA3DF2C4A63B2009C4554 /* YHLifeSectionView.swift */,
047AA3E12C4A66CE009C4554 /* YHLifeItemTableViewCell.swift */,
047AA3E32C4A6ADC009C4554 /* YHLifeHeadView.swift */,
);
path = V;
sourceTree = "<group>";
};
04808C022B4686510056D53C /* Frameworks */ = {
isa = PBXGroup;
children = (
......@@ -2561,6 +2596,7 @@
A567E5662BD7643D00D5D5A0 /* Home(首页) */ = {
isa = PBXGroup;
children = (
047AA3DA2C4A6102009C4554 /* Life */,
0419A0952C48F79100A5FCFA /* InvitationWithGifts(邀请有礼) */,
A567E5672BD7643D00D5D5A0 /* VM */,
A567E56A2BD7643D00D5D5A0 /* M */,
......@@ -3343,6 +3379,7 @@
045EEEA72B9F171A0022A143 /* YHWorkExperienceViewController.swift in Sources */,
A5FD63BD2B623C2C00D1D9DA /* YHInformationPerfectListVC.swift in Sources */,
045EEE8D2B9F171A0022A143 /* YHPreviewInfoCell.swift in Sources */,
047AA3E22C4A66CE009C4554 /* YHLifeItemTableViewCell.swift in Sources */,
048FA0362BFDE04000AD3BA9 /* YHSubmitAllInfoSuccessAlertView.swift in Sources */,
04B9EE5B2C06CC3100A4018D /* YHOtherLoginViewController.swift in Sources */,
045EEF0C2B9F171A0022A143 /* YHBasicInfoFillBottomView.swift in Sources */,
......@@ -3407,6 +3444,7 @@
A567E5982BD7643D00D5D5A0 /* YHHKEventModel.swift in Sources */,
045EEE992B9F171A0022A143 /* YHPreviewInfoHoldView.swift in Sources */,
045EEE7E2B9F171A0022A143 /* YHPersonInfoCellModel1.swift in Sources */,
047AA3DD2C4A6126009C4554 /* YHLifeViewController.swift in Sources */,
04FD856C2C2153F000BEF9C5 /* YHMyEducationCell.swift in Sources */,
A5DE0D3C2BB9016200976FE1 /* YHEmailInputAlertView.swift in Sources */,
A5ACE9512B4564F7002C94D2 /* YhConstant.swift in Sources */,
......@@ -3692,6 +3730,7 @@
045EEEC02B9F171A0022A143 /* YHOtherInfoFillViewModel.swift in Sources */,
045EEEF22B9F171A0022A143 /* YHChildBasicInfoVC.swift in Sources */,
A567E5A22BD7643D00D5D5A0 /* YHConfigManager.swift in Sources */,
047AA3E02C4A63B2009C4554 /* YHLifeSectionView.swift in Sources */,
04174D772BCD5B74000BA46D /* YHMessageDetailListVC.swift in Sources */,
044D0BFE2C21649A00C5CF5E /* YHUserInformationModel.swift in Sources */,
A592BFEF2B9AB720004C04A9 /* YHWholeScreenTipsView.swift in Sources */,
......@@ -3778,6 +3817,7 @@
A5ACE9302B4564F7002C94D2 /* Algorithm.swift in Sources */,
045EEED52B9F171A0022A143 /* YHEducationRequestViewModel.swift in Sources */,
045EEEB62B9F171A0022A143 /* YHWorkExperienceItemView.swift in Sources */,
047AA3E42C4A6ADC009C4554 /* YHLifeHeadView.swift in Sources */,
A58A8C942BA6C7C600632765 /* YHCertificateEntryModel.swift in Sources */,
045EEEB82B9F171A0022A143 /* YHWorkExampleMessageView.swift in Sources */,
04F4B76B2BAA7E1E00D13284 /* YHCertificateTemplateSheetView.swift in Sources */,
......
......@@ -236,7 +236,7 @@ extension YHHomeHoldViewPageViewController {
arrItemVCs.append(vc)
} else if i == 2 {
//生活
let vc = YHServerHKLifeViewController()
let vc = YHLifeViewController()
arrItemVCs.append(vc)
} else if i == 3 {
//资讯
......
//
// YHLifeViewController.swift
// galaxy
//
// Created by EDY on 2024/7/19.
// Copyright © 2024 https://www.galaxy-immi.com. All rights reserved.
//
import UIKit
import JXSegmentedView
class YHLifeViewController: YHBaseViewController {
var sectionView: YHLifeSectionView!
var tableView: UITableView!
var headView = YHLifeHeadView()
override func viewDidLoad() {
super.viewDidLoad()
setupUI()
}
override func viewWillAppear(_ animated: Bool) {
super.viewWillAppear(animated)
loadData()
}
}
extension YHLifeViewController {
func loadData() {
}
func setupUI() {
gk_navBarAlpha = 0
gk_navigationBar.isHidden = true
view.backgroundColor = .white
sectionView = {
let view = YHLifeSectionView()
view.items = ["创业", "教育", "永居"]
view.block = {[weak self] model in
}
return view
}()
view.addSubview(sectionView)
sectionView.snp.makeConstraints { make in
make.top.left.right.equalToSuperview()
make.height.equalTo(44)
}
headView.frame = CGRect(x: 0, y: 0, width: KScreenWidth, height: KScreenWidth + 16)
tableView = {
let tableView = UITableView(frame: .zero, style: .grouped)
tableView.contentInsetAdjustmentBehavior = .never
tableView.backgroundColor = .clear
tableView.separatorStyle = .none
tableView.showsHorizontalScrollIndicator = false
tableView.showsVerticalScrollIndicator = false
tableView.dataSource = self
tableView.delegate = self
tableView.tableHeaderView = headView
tableView.tableFooterView = UIView(frame: CGRect(x: 0, y: 0, width: KScreenWidth, height: 0.01))
tableView.register(cellWithClass: YHLifeItemTableViewCell.self)
return tableView
}()
view.addSubview(tableView)
tableView.snp.makeConstraints { make in
make.bottom.left.right.equalToSuperview()
make.top.equalTo(44)
}
}
}
extension YHLifeViewController: UITableViewDelegate, UITableViewDataSource {
func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
return 10
}
func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
let cell = tableView.dequeueReusableCell(withClass: YHLifeItemTableViewCell.self)
return cell
}
func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat {
return 124
}
func tableView(_ tableView: UITableView, heightForHeaderInSection section: Int) -> CGFloat {
return 0.01
}
func tableView(_ tableView: UITableView, viewForHeaderInSection section: Int) -> UIView? {
return UIView()
}
func tableView(_ tableView: UITableView, heightForFooterInSection section: Int) -> CGFloat {
return 0.01
}
func tableView(_ tableView: UITableView, viewForFooterInSection section: Int) -> UIView? {
return UIView()
}
}
extension YHLifeViewController: JXSegmentedListContainerViewListDelegate {
func listView() -> UIView {
return view
}
}
//
// YHLifeHeadView.swift
// galaxy
//
// Created by EDY on 2024/7/19.
// Copyright © 2024 https://www.galaxy-immi.com. All rights reserved.
//
import UIKit
class YHLifeHeadView: UIView {
var imageView = UIImageView()
override init(frame: CGRect) {
super.init(frame: frame)
backgroundColor = .white
setUpView()
}
required init?(coder: NSCoder) {
fatalError("init(coder:) has not been implemented")
}
func setUpView() {
addSubview(imageView)
imageView.backgroundColor = .red
imageView.snp.makeConstraints { make in
make.left.right.equalToSuperview()
make.top.equalTo(8)
make.bottom.equalTo(-8)
}
}
}
//
// YHLifeItemTableViewCell.swift
// galaxy
//
// Created by EDY on 2024/7/19.
// Copyright © 2024 https://www.galaxy-immi.com. All rights reserved.
//
import UIKit
class YHLifeItemTableViewCell: UITableViewCell {
var centerImageView: UIImageView!
var titleLabel: UILabel!
var subTitleLabel: UILabel!
override func awakeFromNib() {
super.awakeFromNib()
// Initialization code
}
override func setSelected(_ selected: Bool, animated: Bool) {
super.setSelected(selected, animated: animated)
// Configure the view for the selected state
}
required init?(coder: NSCoder) {
super.init(coder: coder)
}
override init(style: UITableViewCell.CellStyle, reuseIdentifier: String?) {
super.init(style: style, reuseIdentifier: reuseIdentifier)
selectionStyle = .none
setupUI()
}
func setupUI() {
self.backgroundColor = .white
centerImageView = {
let imageView = UIImageView()
imageView.image = UIImage(named: "invitation_with_gifts_first")
return imageView
}()
contentView.addSubview(centerImageView)
centerImageView.snp.makeConstraints { make in
make.centerY.equalToSuperview()
make.left.equalTo(12)
make.height.width.equalTo(100)
}
titleLabel = {
let view = UILabel()
view.text = "注册公司"
view.font = UIFont.PFSC_M(ofSize: 17)
view.textColor = UIColor.mainTextColor
return view
}()
contentView.addSubview(titleLabel)
titleLabel.snp.makeConstraints { make in
make.left.equalTo(144)
make.right.equalTo(-20)
make.top.equalTo(20)
make.height.equalTo(24)
}
subTitleLabel = {
let view = UILabel()
view.text = "长期稳定银行渠道,可选择的银行多"
view.font = UIFont.PFSC_M(ofSize: 14)
view.textColor = UIColor.mainTextColor50
return view
}()
contentView.addSubview(subTitleLabel)
subTitleLabel.snp.makeConstraints { make in
make.left.equalTo(144)
make.right.equalTo(-20)
make.top.equalTo(52)
}
}
}
//
// YHLifeSectionView.swift
// galaxy
//
// Created by EDY on 2024/7/19.
// Copyright © 2024 https://www.galaxy-immi.com. All rights reserved.
//
import UIKit
class YHLifeSectionView: UIView {
static let viewH : CGFloat = 44.0
typealias Block = (Int) -> ()
var block: Block?
var items: [String] = [] {
didSet {
self.myCollectView.reloadData()
}
}
var type: Int = 0
var selectIndex = 0
lazy var myCollectView = {
// 设置布局方向
let flowLayout = UICollectionViewFlowLayout()
flowLayout.itemSize = CGSize(width: 50, height: 26)
flowLayout.minimumInteritemSpacing = 12.0
flowLayout.minimumLineSpacing = 12.0
flowLayout.scrollDirection = .horizontal
let collectinoView = UICollectionView(frame: .zero, collectionViewLayout: flowLayout)
collectinoView.backgroundColor = .white
collectinoView.contentInset = UIEdgeInsets(top: 0, left: 20, bottom: 0, right: 20)
collectinoView.register(YHLifeSectionCollectionViewCell.self, forCellWithReuseIdentifier:YHLifeSectionCollectionViewCell.cellReuseIdentifier)
collectinoView.delegate = self
collectinoView.dataSource = self
collectinoView.translatesAutoresizingMaskIntoConstraints = false
collectinoView.alwaysBounceVertical = true
collectinoView.bounces = false
collectinoView.showsHorizontalScrollIndicator = false
collectinoView.showsVerticalScrollIndicator = false
return collectinoView
}()
override init(frame: CGRect) {
super.init(frame: frame)
backgroundColor = .white
setUpView()
}
required init?(coder: NSCoder) {
fatalError("init(coder:) has not been implemented")
}
func setUpView() {
backgroundColor = .white
addSubview(myCollectView)
myCollectView.snp.makeConstraints { make in
make.top.left.right.bottom.equalToSuperview()
}
// self.myCollectView.es.addInfiniteScrolling {
// self.loadFakeData()
// }
}
}
extension YHLifeSectionView: UICollectionViewDelegate, UICollectionViewDataSource {
func collectionView(_ collectionView: UICollectionView, numberOfItemsInSection section: Int) -> Int {
return items.count
}
func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell {
let cell = collectionView.dequeueReusableCell(withReuseIdentifier: YHLifeSectionCollectionViewCell.cellReuseIdentifier, for: indexPath) as! YHLifeSectionCollectionViewCell
cell.dataSource = items[indexPath.row]
if indexPath.row == selectIndex {
cell.setSelectedStyle()
} else {
cell.setDeSelectedStyle()
}
return cell
}
func collectionView(_ collectionView: UICollectionView, didSelectItemAt indexPath: IndexPath) {
selectIndex = indexPath.row
collectionView.reloadData()
if let block = block {
block(indexPath.row)
}
print("index is \(indexPath.row)")
}
}
class YHLifeSectionCollectionViewCell: UICollectionViewCell {
static let cellReuseIdentifier = "YHLifeSectionCollectionViewCell"
func setSelectedStyle() {
descripeLable.textColor = UIColor.mainTextColor
contentView.layer.borderWidth = 1
contentView.layer.borderColor = UIColor.mainTextColor.cgColor
}
func setDeSelectedStyle() {
descripeLable.textColor = UIColor.mainTextColor50
contentView.layer.borderWidth = 1
contentView.layer.borderColor = UIColor.mainTextColor18.cgColor
}
var dataSource: String? {
didSet {
updataAllSubViews()
}
}
lazy var descripeLable:UILabel = {
let label = UILabel()
label.text = "赴港"
label.textColor = UIColor(hex: 0x94a3bb)
label.font = UIFont.PFSC_R(ofSize: 13)
label.textAlignment = .center
return label
}()
required init?(coder: NSCoder) {
super.init(coder: coder)
}
override init(frame: CGRect) {
super.init(frame: frame)
setupUI()
}
private func setupUI() {
contentView.addSubview(descripeLable)
descripeLable.snp.makeConstraints { make in
make.top.left.right.bottom.equalToSuperview()
}
}
func updataAllSubViews() {
guard let dataSource = dataSource else { return }
descripeLable.text = dataSource
}
}
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