Commit 3660023a authored by Steven杜宇's avatar Steven杜宇

// 我的名片

parent 36e7d1a2
...@@ -321,6 +321,9 @@ ...@@ -321,6 +321,9 @@
04FD85662C2124AF00BEF9C5 /* YHMyNameCardViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04FD85652C2124AF00BEF9C5 /* YHMyNameCardViewController.swift */; }; 04FD85662C2124AF00BEF9C5 /* YHMyNameCardViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04FD85652C2124AF00BEF9C5 /* YHMyNameCardViewController.swift */; };
04FD85682C21277800BEF9C5 /* YHMyNameCardAvatarInfoCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04FD85672C21277800BEF9C5 /* YHMyNameCardAvatarInfoCell.swift */; }; 04FD85682C21277800BEF9C5 /* YHMyNameCardAvatarInfoCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04FD85672C21277800BEF9C5 /* YHMyNameCardAvatarInfoCell.swift */; };
04FD856A2C21362300BEF9C5 /* YHMyIntroductionCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04FD85692C21362300BEF9C5 /* YHMyIntroductionCell.swift */; }; 04FD856A2C21362300BEF9C5 /* YHMyIntroductionCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04FD85692C21362300BEF9C5 /* YHMyIntroductionCell.swift */; };
04FD856C2C2153F000BEF9C5 /* YHMyEducationCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04FD856B2C2153F000BEF9C5 /* YHMyEducationCell.swift */; };
04FD856E2C215DC900BEF9C5 /* YHMyWorkExperienceCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04FD856D2C215DC900BEF9C5 /* YHMyWorkExperienceCell.swift */; };
04FD85702C21646200BEF9C5 /* YHMyInterestTopicCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04FD856F2C21646200BEF9C5 /* YHMyInterestTopicCell.swift */; };
6203A87EDC96313BBE789D9C /* Pods_galaxy.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 987C69D43AE8D85DC1930DCF /* Pods_galaxy.framework */; }; 6203A87EDC96313BBE789D9C /* Pods_galaxy.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 987C69D43AE8D85DC1930DCF /* Pods_galaxy.framework */; };
A51044182B493675006B60BB /* README.md in Resources */ = {isa = PBXBuildFile; fileRef = A51044172B493675006B60BB /* README.md */; }; A51044182B493675006B60BB /* README.md in Resources */ = {isa = PBXBuildFile; fileRef = A51044172B493675006B60BB /* README.md */; };
A510441A2B495DD0006B60BB /* UIView+Extension.swift in Sources */ = {isa = PBXBuildFile; fileRef = A51044192B495DD0006B60BB /* UIView+Extension.swift */; }; A510441A2B495DD0006B60BB /* UIView+Extension.swift in Sources */ = {isa = PBXBuildFile; fileRef = A51044192B495DD0006B60BB /* UIView+Extension.swift */; };
...@@ -818,6 +821,9 @@ ...@@ -818,6 +821,9 @@
04FD85652C2124AF00BEF9C5 /* YHMyNameCardViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHMyNameCardViewController.swift; sourceTree = "<group>"; }; 04FD85652C2124AF00BEF9C5 /* YHMyNameCardViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHMyNameCardViewController.swift; sourceTree = "<group>"; };
04FD85672C21277800BEF9C5 /* YHMyNameCardAvatarInfoCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHMyNameCardAvatarInfoCell.swift; sourceTree = "<group>"; }; 04FD85672C21277800BEF9C5 /* YHMyNameCardAvatarInfoCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHMyNameCardAvatarInfoCell.swift; sourceTree = "<group>"; };
04FD85692C21362300BEF9C5 /* YHMyIntroductionCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHMyIntroductionCell.swift; sourceTree = "<group>"; }; 04FD85692C21362300BEF9C5 /* YHMyIntroductionCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHMyIntroductionCell.swift; sourceTree = "<group>"; };
04FD856B2C2153F000BEF9C5 /* YHMyEducationCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHMyEducationCell.swift; sourceTree = "<group>"; };
04FD856D2C215DC900BEF9C5 /* YHMyWorkExperienceCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHMyWorkExperienceCell.swift; sourceTree = "<group>"; };
04FD856F2C21646200BEF9C5 /* YHMyInterestTopicCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHMyInterestTopicCell.swift; sourceTree = "<group>"; };
19B28612265782F9DC1BE0B0 /* Pods-galaxy.testenv.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-galaxy.testenv.xcconfig"; path = "Target Support Files/Pods-galaxy/Pods-galaxy.testenv.xcconfig"; sourceTree = "<group>"; }; 19B28612265782F9DC1BE0B0 /* Pods-galaxy.testenv.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-galaxy.testenv.xcconfig"; path = "Target Support Files/Pods-galaxy/Pods-galaxy.testenv.xcconfig"; sourceTree = "<group>"; };
58C2405158A4A6632D0E7460 /* Pods-galaxy.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-galaxy.debug.xcconfig"; path = "Target Support Files/Pods-galaxy/Pods-galaxy.debug.xcconfig"; sourceTree = "<group>"; }; 58C2405158A4A6632D0E7460 /* Pods-galaxy.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-galaxy.debug.xcconfig"; path = "Target Support Files/Pods-galaxy/Pods-galaxy.debug.xcconfig"; sourceTree = "<group>"; };
987C69D43AE8D85DC1930DCF /* Pods_galaxy.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_galaxy.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 987C69D43AE8D85DC1930DCF /* Pods_galaxy.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_galaxy.framework; sourceTree = BUILT_PRODUCTS_DIR; };
...@@ -1983,6 +1989,9 @@ ...@@ -1983,6 +1989,9 @@
04F9574A2C2032D8003C631C /* YHMyFriendsCell.swift */, 04F9574A2C2032D8003C631C /* YHMyFriendsCell.swift */,
04FD85672C21277800BEF9C5 /* YHMyNameCardAvatarInfoCell.swift */, 04FD85672C21277800BEF9C5 /* YHMyNameCardAvatarInfoCell.swift */,
04FD85692C21362300BEF9C5 /* YHMyIntroductionCell.swift */, 04FD85692C21362300BEF9C5 /* YHMyIntroductionCell.swift */,
04FD856B2C2153F000BEF9C5 /* YHMyEducationCell.swift */,
04FD856D2C215DC900BEF9C5 /* YHMyWorkExperienceCell.swift */,
04FD856F2C21646200BEF9C5 /* YHMyInterestTopicCell.swift */,
04F9574C2C20644E003C631C /* YHFriendsRequestView.swift */, 04F9574C2C20644E003C631C /* YHFriendsRequestView.swift */,
); );
path = V; path = V;
...@@ -2858,6 +2867,7 @@ ...@@ -2858,6 +2867,7 @@
A5ACE9452B4564F7002C94D2 /* YHHUDContainerView.swift in Sources */, A5ACE9452B4564F7002C94D2 /* YHHUDContainerView.swift in Sources */,
045EEEFD2B9F171A0022A143 /* YHSheetPickerViewType.swift in Sources */, 045EEEFD2B9F171A0022A143 /* YHSheetPickerViewType.swift in Sources */,
045EEEC72B9F171A0022A143 /* YHOtherYesOrNoItemView.swift in Sources */, 045EEEC72B9F171A0022A143 /* YHOtherYesOrNoItemView.swift in Sources */,
04FD85702C21646200BEF9C5 /* YHMyInterestTopicCell.swift in Sources */,
04A7BD172BA43A0F00BD35A2 /* YHMyDocumentsDetailViewModel.swift in Sources */, 04A7BD172BA43A0F00BD35A2 /* YHMyDocumentsDetailViewModel.swift in Sources */,
045EEEB32B9F171A0022A143 /* YHWorkFileSyncTableViewCell.swift in Sources */, 045EEEB32B9F171A0022A143 /* YHWorkFileSyncTableViewCell.swift in Sources */,
045EEEF12B9F171A0022A143 /* YHChildInfoContainerVC.swift in Sources */, 045EEEF12B9F171A0022A143 /* YHChildInfoContainerVC.swift in Sources */,
...@@ -2898,6 +2908,7 @@ ...@@ -2898,6 +2908,7 @@
A567E5982BD7643D00D5D5A0 /* YHHKEventModel.swift in Sources */, A567E5982BD7643D00D5D5A0 /* YHHKEventModel.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 */,
A5DE0D3C2BB9016200976FE1 /* YHEmailInputAlertView.swift in Sources */, A5DE0D3C2BB9016200976FE1 /* YHEmailInputAlertView.swift in Sources */,
A5ACE9512B4564F7002C94D2 /* YhConstant.swift in Sources */, A5ACE9512B4564F7002C94D2 /* YhConstant.swift in Sources */,
04FD85662C2124AF00BEF9C5 /* YHMyNameCardViewController.swift in Sources */, 04FD85662C2124AF00BEF9C5 /* YHMyNameCardViewController.swift in Sources */,
...@@ -3088,6 +3099,7 @@ ...@@ -3088,6 +3099,7 @@
0477E17C2BA4238400436346 /* YHCertificateListContainerVC.swift in Sources */, 0477E17C2BA4238400436346 /* YHCertificateListContainerVC.swift in Sources */,
A517A4DF2BB53BE8000DEECD /* YHDocListBottomView.swift in Sources */, A517A4DF2BB53BE8000DEECD /* YHDocListBottomView.swift in Sources */,
A567E5AB2BD7643D00D5D5A0 /* YHHomeHeadView.swift in Sources */, A567E5AB2BD7643D00D5D5A0 /* YHHomeHeadView.swift in Sources */,
04FD856E2C215DC900BEF9C5 /* YHMyWorkExperienceCell.swift in Sources */,
0414BDAB2BC7E9C200225367 /* YHMyPermissionCell.swift in Sources */, 0414BDAB2BC7E9C200225367 /* YHMyPermissionCell.swift in Sources */,
04C8F4832B7216D800ADF59B /* YHUserInfoHeaderView.swift in Sources */, 04C8F4832B7216D800ADF59B /* YHUserInfoHeaderView.swift in Sources */,
045EEEAF2B9F171A0022A143 /* YHWorkExperienceTextItemView.swift in Sources */, 045EEEAF2B9F171A0022A143 /* YHWorkExperienceTextItemView.swift in Sources */,
......
...@@ -21,6 +21,9 @@ class YHMyNameCardViewController: YHBaseViewController { ...@@ -21,6 +21,9 @@ class YHMyNameCardViewController: YHBaseViewController {
tableView.register(UITableViewCell.self, forCellReuseIdentifier: "UITableViewCell") tableView.register(UITableViewCell.self, forCellReuseIdentifier: "UITableViewCell")
tableView.register(YHMyNameCardAvatarInfoCell.self, forCellReuseIdentifier: YHMyNameCardAvatarInfoCell.cellReuseIdentifier) tableView.register(YHMyNameCardAvatarInfoCell.self, forCellReuseIdentifier: YHMyNameCardAvatarInfoCell.cellReuseIdentifier)
tableView.register(YHMyIntroductionCell.self, forCellReuseIdentifier: YHMyIntroductionCell.cellReuseIdentifier) tableView.register(YHMyIntroductionCell.self, forCellReuseIdentifier: YHMyIntroductionCell.cellReuseIdentifier)
tableView.register(YHMyEducationCell.self, forCellReuseIdentifier: YHMyEducationCell.cellReuseIdentifier)
tableView.register(YHMyWorkExperienceCell.self, forCellReuseIdentifier: YHMyWorkExperienceCell.cellReuseIdentifier)
tableView.register(YHMyInterestTopicCell.self, forCellReuseIdentifier: YHMyInterestTopicCell.cellReuseIdentifier)
tableView.contentInset = UIEdgeInsets(top: 41, left: 0, bottom: 0, right: 0) tableView.contentInset = UIEdgeInsets(top: 41, left: 0, bottom: 0, right: 0)
return tableView return tableView
}() }()
...@@ -57,7 +60,7 @@ class YHMyNameCardViewController: YHBaseViewController { ...@@ -57,7 +60,7 @@ class YHMyNameCardViewController: YHBaseViewController {
extension YHMyNameCardViewController: UITableViewDelegate, UITableViewDataSource { extension YHMyNameCardViewController: UITableViewDelegate, UITableViewDataSource {
func numberOfSections(in tableView: UITableView) -> Int { func numberOfSections(in tableView: UITableView) -> Int {
return 7 return 6
} }
func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int { func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
...@@ -65,6 +68,7 @@ extension YHMyNameCardViewController: UITableViewDelegate, UITableViewDataSource ...@@ -65,6 +68,7 @@ extension YHMyNameCardViewController: UITableViewDelegate, UITableViewDataSource
} }
func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell { func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
let cell = tableView.dequeueReusableCell(withIdentifier: YHMyNameCardAvatarInfoCell.cellReuseIdentifier, for: indexPath) as! YHMyNameCardAvatarInfoCell let cell = tableView.dequeueReusableCell(withIdentifier: YHMyNameCardAvatarInfoCell.cellReuseIdentifier, for: indexPath) as! YHMyNameCardAvatarInfoCell
if indexPath.section == 1 { if indexPath.section == 1 {
...@@ -72,6 +76,26 @@ extension YHMyNameCardViewController: UITableViewDelegate, UITableViewDataSource ...@@ -72,6 +76,26 @@ extension YHMyNameCardViewController: UITableViewDelegate, UITableViewDataSource
let cell = tableView.dequeueReusableCell(withIdentifier: YHMyIntroductionCell.cellReuseIdentifier, for: indexPath) as! YHMyIntroductionCell let cell = tableView.dequeueReusableCell(withIdentifier: YHMyIntroductionCell.cellReuseIdentifier, for: indexPath) as! YHMyIntroductionCell
return cell return cell
} }
if indexPath.section == 2 {
let cell = tableView.dequeueReusableCell(withIdentifier: YHMyEducationCell.cellReuseIdentifier, for: indexPath) as! YHMyEducationCell
return cell
}
if indexPath.section == 3 {
let cell = tableView.dequeueReusableCell(withIdentifier: YHMyWorkExperienceCell.cellReuseIdentifier, for: indexPath) as! YHMyWorkExperienceCell
return cell
}
if indexPath.section == 4 {
let cell = tableView.dequeueReusableCell(withIdentifier: YHMyIntroductionCell.cellReuseIdentifier, for: indexPath) as! YHMyIntroductionCell
cell.titleLabel.text = "荣誉奖项"
return cell
}
if indexPath.section == 5 {
let cell = tableView.dequeueReusableCell(withIdentifier: YHMyInterestTopicCell.cellReuseIdentifier, for: indexPath) as! YHMyInterestTopicCell
return cell
}
return cell return cell
} }
......
//
// YHMyEducationCell.swift
// galaxy
//
// Created by edy on 2024/6/18.
// Copyright © 2024 https://www.galaxy-immi.com. All rights reserved.
//
import UIKit
class YHMyEducationCell: UITableViewCell {
static let cellReuseIdentifier = "YHMyEducationCell"
lazy var cardView: UIView = {
let view = UIView()
view.backgroundColor = .white
view.layer.cornerRadius = 3.0
view.clipsToBounds = true
return view
}()
lazy var titleLabel:UILabel = {
let label = UILabel()
label.text = "教育经历"
label.textColor = UIColor(hexString: "#222222")
label.textAlignment = .left
label.font = UIFont.PFSC_M(ofSize:17)
return label
}()
lazy var collegeLabel:UILabel = {
let label = UILabel()
label.textColor = UIColor.mainTextColor70
label.textAlignment = .left
label.font = UIFont.PFSC_M(ofSize:14)
label.numberOfLines = 0
return label
}()
lazy var detailLabel:UILabel = {
let label = UILabel()
label.textColor = UIColor.mainTextColor70
label.textAlignment = .left
label.font = UIFont.PFSC_R(ofSize:14)
label.numberOfLines = 0
return label
}()
lazy var editBtn:UIButton = {
let btn = UIButton()
btn.setImage(UIImage(named: "people_card_edit"), for: .normal)
btn.YH_clickEdgeInsets = UIEdgeInsets(top: 20, left: 20, bottom: 20, right: 20)
return btn
}()
lazy var hiddenBtn:UIButton = {
let btn = UIButton()
btn.backgroundColor = UIColor.init(hex: 0xF4F6FA)
btn.layer.cornerRadius = 3.0
btn.setImage(UIImage(named: "people_card_hidden"), for: .normal)
btn.setTitle("已隐藏", for: .normal)
btn.setTitleColor(UIColor.mainTextColor50, for: .normal)
btn.titleLabel?.font = UIFont.PFSC_R(ofSize:10)
btn.titleEdgeInsets = UIEdgeInsets(top: 0, left: -11, bottom: 0, right: 11)
btn.imageEdgeInsets = UIEdgeInsets(top: 0, left: 31, bottom: 0, right: -31)
return btn
}()
required init?(coder: NSCoder) {
super.init(coder: coder)
}
override init(style: UITableViewCell.CellStyle, reuseIdentifier: String?) {
super.init(style: style, reuseIdentifier: reuseIdentifier)
setupUI()
}
func setupUI() {
self.selectionStyle = .none
self.backgroundColor = .clear
self.contentView.backgroundColor = .clear
collegeLabel.text = "上海交通大学xxxx学院"
detailLabel.text = "宗教学宗教学宗教学宗教学 · 本科"
self.contentView.addSubview(self.cardView)
cardView.addSubview(self.titleLabel)
cardView.addSubview(self.collegeLabel)
cardView.addSubview(self.detailLabel)
cardView.addSubview(self.editBtn)
cardView.addSubview(self.hiddenBtn)
cardView.snp.makeConstraints { make in
make.edges.equalToSuperview()
}
titleLabel.snp.makeConstraints { make in
make.left.equalTo(16)
make.top.equalTo(16)
make.height.equalTo(24)
}
editBtn.snp.makeConstraints { make in
make.width.height.equalTo(20)
make.right.equalTo(-15)
make.centerY.equalTo(titleLabel)
}
hiddenBtn.snp.makeConstraints { make in
make.width.equalTo(50)
make.height.equalTo(18)
make.centerY.equalTo(self.titleLabel)
make.left.equalTo(self.titleLabel.snp.right).offset(8)
make.right.lessThanOrEqualTo(self.editBtn.snp.left).offset(-15)
}
collegeLabel.snp.makeConstraints { make in
make.top.equalTo(self.titleLabel.snp.bottom).offset(12)
make.left.equalTo(16)
make.right.equalTo(-16)
make.height.greaterThanOrEqualTo(20)
}
detailLabel.snp.makeConstraints { make in
make.top.equalTo(self.collegeLabel.snp.bottom).offset(8)
make.left.equalTo(16)
make.right.equalTo(-16)
make.bottom.equalTo(-16)
}
}
}
//
// YHMyInterestTopicCell.swift
// galaxy
//
// Created by edy on 2024/6/18.
// Copyright © 2024 https://www.galaxy-immi.com. All rights reserved.
//
import UIKit
class YHTopicItemCell: UICollectionViewCell {
static let cellReuseIdentifier = "YHTopicItemCell"
lazy var titleLabel: UILabel = {
var label = UILabel()
label.font = .PFSC_R(ofSize: 12)
label.textAlignment = .left
label.textColor = UIColor.mainTextColor
return label
}()
required init?(coder: NSCoder) {
super.init(coder: coder)
}
override init(frame: CGRect) {
super.init(frame: frame)
setupUI()
}
func setupUI() {
contentView.layer.cornerRadius = 3.0
contentView.layer.borderColor = UIColor(red: 0.071, green: 0.102, blue: 0.149, alpha: 0.3).cgColor
contentView.layer.borderWidth = 1.0
contentView.addSubview(titleLabel)
titleLabel.snp.makeConstraints { make in
make.top.bottom.equalToSuperview()
make.left.equalToSuperview().offset(4.0)
make.right.equalToSuperview().offset(-4.0)
}
}
}
class YHMyInterestTopicCell: UITableViewCell {
static let cellReuseIdentifier = "YHMyInterestTopicCell"
var topicArr:[String] = ["深度阅读爱好者", "皮划艇玩家", "创新主义", "茶道", "皮划艇玩家", "创新主义", "茶道", "深度阅读爱好者"]
lazy var cardView: UIView = {
let view = UIView()
view.backgroundColor = .white
view.layer.cornerRadius = 3.0
view.clipsToBounds = true
return view
}()
lazy var titleLabel:UILabel = {
let label = UILabel()
label.text = "兴趣话题"
label.textColor = UIColor(hexString: "#222222")
label.textAlignment = .left
label.font = UIFont.PFSC_M(ofSize:17)
return label
}()
lazy var editBtn:UIButton = {
let btn = UIButton()
btn.setImage(UIImage(named: "people_card_edit"), for: .normal)
btn.YH_clickEdgeInsets = UIEdgeInsets(top: 20, left: 20, bottom: 20, right: 20)
return btn
}()
lazy var collectionView: UICollectionView = {
// 创建集合视图布局
let layout = YHSearchItemLayout()
layout.scrollDirection = .vertical
// 创建集合视图
let collectView = UICollectionView(frame:.zero, collectionViewLayout: layout)
collectView.delegate = self
collectView.dataSource = self
collectView.backgroundColor = .white
// 注册自定义单元格
collectView.register(YHTopicItemCell.self, forCellWithReuseIdentifier: YHTopicItemCell.cellReuseIdentifier)
return collectView
}()
required init?(coder: NSCoder) {
super.init(coder: coder)
}
override init(style: UITableViewCell.CellStyle, reuseIdentifier: String?) {
super.init(style: style, reuseIdentifier: reuseIdentifier)
setupUI()
}
func setupUI() {
self.selectionStyle = .none
self.backgroundColor = .clear
self.contentView.backgroundColor = .clear
self.contentView.addSubview(self.cardView)
cardView.addSubview(self.titleLabel)
cardView.addSubview(collectionView)
cardView.addSubview(self.editBtn)
cardView.snp.makeConstraints { make in
make.edges.equalToSuperview()
}
titleLabel.snp.makeConstraints { make in
make.left.equalTo(16)
make.top.equalTo(16)
make.height.equalTo(24)
}
editBtn.snp.makeConstraints { make in
make.width.height.equalTo(20)
make.right.equalTo(-15)
make.centerY.equalTo(titleLabel)
}
collectionView.snp.makeConstraints { make in
make.left.equalTo(16)
make.right.equalTo(-16)
make.bottom.equalTo(-16)
make.height.equalTo(58)
make.top.equalTo(titleLabel.snp.bottom).offset(12)
}
}
}
extension YHMyInterestTopicCell: UICollectionViewDelegate, UICollectionViewDataSource, UICollectionViewDelegateFlowLayout {
// 返回单元格数量
func collectionView(_ collectionView: UICollectionView, numberOfItemsInSection section: Int) -> Int {
return topicArr.count
}
// 返回每个单元格的大小
func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, sizeForItemAt indexPath: IndexPath) -> CGSize {
let size = self.getwith(font: UIFont.systemFont(ofSize: 12), height: 24, string: topicArr[indexPath.item])
var width = size.width + 4*2.0
if width > 226.0 {
width = 226.0
}
return CGSize(width: width, height: 24.0)
}
// 返回自定义单元格
func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell {
let cell = collectionView.dequeueReusableCell(withReuseIdentifier: YHTopicItemCell.cellReuseIdentifier, for: indexPath) as! YHTopicItemCell
if 0 <= indexPath.item && indexPath.item < topicArr.count {
cell.titleLabel.text = topicArr[indexPath.item]
}
return cell
}
func collectionView(_ collectionView: UICollectionView, didSelectItemAt indexPath: IndexPath) {
if 0 <= indexPath.item && indexPath.item < topicArr.count {
let text = topicArr[indexPath.item]
}
}
// 计算文字宽度大小
func getwith(font: UIFont, height: CGFloat, string: String) -> CGSize {
let size = CGSize.init(width: CGFloat(MAXFLOAT), height: height)
let dic = [NSAttributedString.Key.font: font] // swift 4.2
var strSize = string.boundingRect(with: size, options: [.usesLineFragmentOrigin], attributes: dic, context:nil).size
return CGSizeMake(ceil(strSize.width), strSize.height)
}
}
...@@ -16,6 +16,7 @@ class YHMyIntroductionCell: UITableViewCell { ...@@ -16,6 +16,7 @@ class YHMyIntroductionCell: UITableViewCell {
let view = UIView() let view = UIView()
view.backgroundColor = .white view.backgroundColor = .white
view.layer.cornerRadius = 3.0 view.layer.cornerRadius = 3.0
view.clipsToBounds = true
return view return view
}() }()
...@@ -54,9 +55,7 @@ class YHMyIntroductionCell: UITableViewCell { ...@@ -54,9 +55,7 @@ class YHMyIntroductionCell: UITableViewCell {
} }
func setupUI() { func setupUI() {
self.backgroundColor = .white
self.selectionStyle = .none
self.selectionStyle = .none self.selectionStyle = .none
self.backgroundColor = .clear self.backgroundColor = .clear
self.contentView.backgroundColor = .clear self.contentView.backgroundColor = .clear
......
...@@ -40,6 +40,13 @@ class YHMyNameCardAvatarInfoCell: UITableViewCell { ...@@ -40,6 +40,13 @@ class YHMyNameCardAvatarInfoCell: UITableViewCell {
return view return view
}() }()
lazy var editBtn:UIButton = {
let btn = UIButton()
btn.setImage(UIImage(named: "people_card_edit"), for: .normal)
btn.YH_clickEdgeInsets = UIEdgeInsets(top: 20, left: 20, bottom: 20, right: 20)
return btn
}()
lazy var nameLabel:UILabel = { lazy var nameLabel:UILabel = {
let nameLabel = UILabel() let nameLabel = UILabel()
nameLabel.textColor = UIColor.mainTextColor nameLabel.textColor = UIColor.mainTextColor
...@@ -88,7 +95,8 @@ class YHMyNameCardAvatarInfoCell: UITableViewCell { ...@@ -88,7 +95,8 @@ class YHMyNameCardAvatarInfoCell: UITableViewCell {
cardView.addSubview(self.nameLabel) cardView.addSubview(self.nameLabel)
cardView.addSubview(self.professionalLabel) cardView.addSubview(self.professionalLabel)
cardView.addSubview(self.detailLabel) cardView.addSubview(self.detailLabel)
cardView.addSubview(self.editBtn)
self.nameLabel.text = "啊防守打法胜多负少" self.nameLabel.text = "啊防守打法胜多负少"
self.professionalLabel.text = "阿迪发沙发沙发撒发生大发三大发沙发沙发上1阿斯顿发双法防" self.professionalLabel.text = "阿迪发沙发沙发撒发生大发三大发沙发沙发上1阿斯顿发双法防"
self.detailLabel.text = "阿凡达所发生的发顺丰大沙发沙发沙发沙发沙发沙发沙发沙发沙发沙发沙发沙发发沙发" self.detailLabel.text = "阿凡达所发生的发顺丰大沙发沙发沙发沙发沙发沙发沙发沙发沙发沙发沙发沙发发沙发"
...@@ -98,6 +106,12 @@ class YHMyNameCardAvatarInfoCell: UITableViewCell { ...@@ -98,6 +106,12 @@ class YHMyNameCardAvatarInfoCell: UITableViewCell {
make.top.equalTo(self.headImgV.snp.centerY) make.top.equalTo(self.headImgV.snp.centerY)
} }
self.editBtn.snp.makeConstraints { make in
make.width.height.equalTo(20)
make.right.equalTo(-16)
make.top.equalTo(16)
}
self.headImgV.snp.makeConstraints { make in self.headImgV.snp.makeConstraints { make in
make.width.height.equalTo(headWidth) make.width.height.equalTo(headWidth)
make.left.equalTo(10) make.left.equalTo(10)
......
//
// YHMyWorkExperienceCell.swift
// galaxy
//
// Created by edy on 2024/6/18.
// Copyright © 2024 https://www.galaxy-immi.com. All rights reserved.
//
import UIKit
class YHExperienceItemView: UIView {
lazy var titleLabel:UILabel = {
let label = UILabel()
label.textColor = UIColor.mainTextColor50
label.textAlignment = .left
label.font = UIFont.PFSC_R(ofSize:14)
return label
}()
lazy var detailLabel:UILabel = {
let label = UILabel()
label.textColor = UIColor.mainTextColor70
label.textAlignment = .left
label.font = UIFont.PFSC_R(ofSize:14)
return label
}()
override init(frame: CGRect) {
super.init(frame: frame)
createUI()
}
required init?(coder: NSCoder) {
fatalError("init(coder:) has not been implemented")
}
func createUI() {
self.addSubview(self.titleLabel)
self.addSubview(self.detailLabel)
self.titleLabel.snp.makeConstraints { make in
make.left.equalTo(0)
make.width.equalTo(56)
make.height.equalTo(20)
make.centerY.equalToSuperview()
}
self.detailLabel.snp.makeConstraints { make in
make.left.equalTo(self.titleLabel.snp.right).offset(56)
make.right.equalToSuperview()
make.centerY.equalToSuperview()
}
}
}
class YHMyWorkExperienceCell: UITableViewCell {
static let cellReuseIdentifier = "YHMyWorkExperienceCell"
lazy var cardView: UIView = {
let view = UIView()
view.backgroundColor = .white
view.layer.cornerRadius = 3.0
view.clipsToBounds = true
return view
}()
lazy var titleLabel:UILabel = {
let label = UILabel()
label.text = "工作经历"
label.textColor = UIColor(hexString: "#222222")
label.textAlignment = .left
label.font = UIFont.PFSC_M(ofSize:17)
return label
}()
lazy var editBtn:UIButton = {
let btn = UIButton()
btn.setImage(UIImage(named: "people_card_edit"), for: .normal)
btn.YH_clickEdgeInsets = UIEdgeInsets(top: 20, left: 20, bottom: 20, right: 20)
return btn
}()
lazy var companyView:YHExperienceItemView = {
let view = YHExperienceItemView()
view.titleLabel.text = "所在企业"
return view
}()
lazy var professionView:YHExperienceItemView = {
let view = YHExperienceItemView()
view.titleLabel.text = "职位"
return view
}()
lazy var industryView:YHExperienceItemView = {
let view = YHExperienceItemView()
view.titleLabel.text = "所在行业"
return view
}()
required init?(coder: NSCoder) {
super.init(coder: coder)
}
override init(style: UITableViewCell.CellStyle, reuseIdentifier: String?) {
super.init(style: style, reuseIdentifier: reuseIdentifier)
setupUI()
}
func setupUI() {
self.selectionStyle = .none
self.backgroundColor = .clear
self.contentView.backgroundColor = .clear
self.contentView.addSubview(self.cardView)
cardView.addSubview(self.titleLabel)
cardView.addSubview(self.editBtn)
cardView.addSubview(self.companyView)
cardView.addSubview(self.professionView)
cardView.addSubview(self.industryView)
cardView.snp.makeConstraints { make in
make.edges.equalToSuperview()
}
titleLabel.snp.makeConstraints { make in
make.left.equalTo(16)
make.top.equalTo(16)
make.height.equalTo(24)
}
editBtn.snp.makeConstraints { make in
make.width.height.equalTo(20)
make.right.equalTo(-15)
make.centerY.equalTo(titleLabel)
}
companyView.snp.makeConstraints { make in
make.left.equalTo(16)
make.right.equalTo(-16)
make.height.equalTo(20)
make.top.equalTo(self.titleLabel.snp.bottom).offset(12)
}
professionView.snp.makeConstraints { make in
make.left.equalTo(16)
make.right.equalTo(-16)
make.height.equalTo(20)
make.top.equalTo(self.companyView.snp.bottom).offset(14)
}
industryView.snp.makeConstraints { make in
make.left.equalTo(16)
make.right.equalTo(-16)
make.height.equalTo(20)
make.top.equalTo(self.professionView.snp.bottom).offset(14)
make.bottom.equalToSuperview().offset(-16)
}
}
}
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "Frame@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "Frame@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