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

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

* '630-dev' of http://gitlab.galaxy-immi.com/mobile-group/galaxy-iOS:
  人脉开启权限成功
  //  我的好友
  tabbar相关细节修改
  兴趣标签
parents 3665a7b8 8e7ab464
......@@ -31,6 +31,7 @@
0435FA812BA186D600024EAE /* YHMyFileMethodTableViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0435FA802BA186D600024EAE /* YHMyFileMethodTableViewCell.swift */; };
0435FA832BA2DEB100024EAE /* YHCardButton.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0435FA822BA2DEB100024EAE /* YHCardButton.swift */; };
043B0A352C1190C6008A9BBA /* YHSelectFileSheetView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 043B0A342C1190C6008A9BBA /* YHSelectFileSheetView.swift */; };
043BA8752C241B38006EF02D /* YHAddFriendCardCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 043BA8742C241B38006EF02D /* YHAddFriendCardCell.swift */; };
043D2C8A2C0EEF3F00172438 /* YHOrderSearchViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 043D2C892C0EEF3F00172438 /* YHOrderSearchViewController.swift */; };
043D2C8C2C0F037B00172438 /* YHServiceOrderSearchViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 043D2C8B2C0F037B00172438 /* YHServiceOrderSearchViewModel.swift */; };
044378A42BFC848C001F95AE /* loginBkg.mov in Resources */ = {isa = PBXBuildFile; fileRef = 044378A32BFC848C001F95AE /* loginBkg.mov */; };
......@@ -293,6 +294,8 @@
04AA19FD2BB40D5C00C1CBBD /* Applegate(JPush).swift in Sources */ = {isa = PBXBuildFile; fileRef = 04AA19FC2BB40D5C00C1CBBD /* Applegate(JPush).swift */; };
04AAA8DC2BF5E5A200FE9FD5 /* YHEmptyDataView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04AAA8DB2BF5E5A200FE9FD5 /* YHEmptyDataView.swift */; };
04AD31772C22DE6600DF5655 /* YHEditInterestViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04AD31762C22DE6600DF5655 /* YHEditInterestViewController.swift */; };
04AD31792C23FFC700DF5655 /* YHInterestModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04AD31782C23FFC700DF5655 /* YHInterestModel.swift */; };
04AD317B2C2428CB00DF5655 /* YHPeopleSuccessView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04AD317A2C2428CB00DF5655 /* YHPeopleSuccessView.swift */; };
04AF514E2BEB585C00009E3A /* YHVideoPlayerVC.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04AF514D2BEB585C00009E3A /* YHVideoPlayerVC.swift */; };
04AF58C42B4FC51C0066011A /* YHLocalizable.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04AF58C32B4FC51C0066011A /* YHLocalizable.swift */; };
04B9EE5A2C06CC3100A4018D /* YHCodeSueecssViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04B9EE582C06CC3100A4018D /* YHCodeSueecssViewController.swift */; };
......@@ -569,6 +572,7 @@
0435FA802BA186D600024EAE /* YHMyFileMethodTableViewCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHMyFileMethodTableViewCell.swift; sourceTree = "<group>"; };
0435FA822BA2DEB100024EAE /* YHCardButton.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHCardButton.swift; sourceTree = "<group>"; };
043B0A342C1190C6008A9BBA /* YHSelectFileSheetView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHSelectFileSheetView.swift; sourceTree = "<group>"; };
043BA8742C241B38006EF02D /* YHAddFriendCardCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHAddFriendCardCell.swift; sourceTree = "<group>"; };
043D2C892C0EEF3F00172438 /* YHOrderSearchViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHOrderSearchViewController.swift; sourceTree = "<group>"; };
043D2C8B2C0F037B00172438 /* YHServiceOrderSearchViewModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHServiceOrderSearchViewModel.swift; sourceTree = "<group>"; };
044378A32BFC848C001F95AE /* loginBkg.mov */ = {isa = PBXFileReference; lastKnownFileType = video.quicktime; path = loginBkg.mov; sourceTree = "<group>"; };
......@@ -834,6 +838,8 @@
04AA19FC2BB40D5C00C1CBBD /* Applegate(JPush).swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "Applegate(JPush).swift"; sourceTree = "<group>"; };
04AAA8DB2BF5E5A200FE9FD5 /* YHEmptyDataView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHEmptyDataView.swift; sourceTree = "<group>"; };
04AD31762C22DE6600DF5655 /* YHEditInterestViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHEditInterestViewController.swift; sourceTree = "<group>"; };
04AD31782C23FFC700DF5655 /* YHInterestModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHInterestModel.swift; sourceTree = "<group>"; };
04AD317A2C2428CB00DF5655 /* YHPeopleSuccessView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHPeopleSuccessView.swift; sourceTree = "<group>"; };
04AF514D2BEB585C00009E3A /* YHVideoPlayerVC.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHVideoPlayerVC.swift; sourceTree = "<group>"; };
04AF58C32B4FC51C0066011A /* YHLocalizable.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHLocalizable.swift; sourceTree = "<group>"; };
04B9EE582C06CC3100A4018D /* YHCodeSueecssViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = YHCodeSueecssViewController.swift; sourceTree = "<group>"; };
......@@ -1268,6 +1274,7 @@
044D0C092C22874600C5CF5E /* M */ = {
isa = PBXGroup;
children = (
04AD31782C23FFC700DF5655 /* YHInterestModel.swift */,
);
path = M;
sourceTree = "<group>";
......@@ -2135,6 +2142,8 @@
04FB01CD2C23DDBD0040115D /* YHPeopleMatchNoDataView.swift */,
04FB01D12C23FCDD0040115D /* YHMatchCardUsageGuideView.swift */,
04FB01D32C2404F50040115D /* YHMyFriendsNoDataView.swift */,
043BA8742C241B38006EF02D /* YHAddFriendCardCell.swift */,
04AD317A2C2428CB00DF5655 /* YHPeopleSuccessView.swift */,
);
path = V;
sourceTree = "<group>";
......@@ -3061,6 +3070,7 @@
A5ACE9542B4564F7002C94D2 /* YHNavigationController.swift in Sources */,
044D0C002C21663300C5CF5E /* YHMyInformationItemCell.swift in Sources */,
045EEF252B9F171A0022A143 /* YHMainInformationCardTableViewCell.swift in Sources */,
04AD317B2C2428CB00DF5655 /* YHPeopleSuccessView.swift in Sources */,
045EEE862B9F171A0022A143 /* YHPreviewWorkExpViewController.swift in Sources */,
045EEED22B9F171A0022A143 /* YHScoreTitleView.swift in Sources */,
045EEEA72B9F171A0022A143 /* YHWorkExperienceViewController.swift in Sources */,
......@@ -3314,6 +3324,7 @@
A5787E3C2C23DEE500B021D7 /* YHAcitivityTitleItemView.swift in Sources */,
A567E5AF2BD7643D00D5D5A0 /* YHHomeWebViewBottomForSavePicView.swift in Sources */,
048787D72BCE96F50036E221 /* YHServiceOrderProgressTableViewCell.swift in Sources */,
04AD31792C23FFC700DF5655 /* YHInterestModel.swift in Sources */,
04EA23082BB50753009DA928 /* YHDocumentMessageTableViewCell.swift in Sources */,
045EEE8E2B9F171A0022A143 /* YHPreviewInfoWorkSummaryView.swift in Sources */,
045EEECE2B9F171A0022A143 /* YHScoreDetailViewController.swift in Sources */,
......@@ -3375,6 +3386,7 @@
045EEEF42B9F171A0022A143 /* YHSpouseBasicInfoVC.swift in Sources */,
A5FD63C32B63438A00D1D9DA /* YHContactMainItemStatusModel.swift in Sources */,
045EEEEA2B9F171A0022A143 /* YHFamilyInitialInfo.swift in Sources */,
043BA8752C241B38006EF02D /* YHAddFriendCardCell.swift in Sources */,
A5C382CF2B5F9A9100C5E65C /* YHServiceCenterMainViewModel.swift in Sources */,
045EEEA52B9F171A0022A143 /* YHImageViewController.swift in Sources */,
045EEEF32B9F171A0022A143 /* YHFamilyMemberInfoListVC.swift in Sources */,
......
......@@ -22,7 +22,7 @@ class YHCommunityViewController: YHBaseViewController {
return view
}()
lazy var segmentedDataSource: JXSegmentedBaseDataSource = {
lazy var segmentedDataSource: JXSegmentedTitleDataSource = {
let dataSource = JXSegmentedTitleDataSource()
dataSource.isTitleColorGradientEnabled = true
dataSource.titles = arrItemTitles
......@@ -74,7 +74,7 @@ class YHCommunityViewController: YHBaseViewController {
super.viewDidLoad()
gk_navBarAlpha = 0
gk_navigationBar.isHidden = true
self.view.backgroundColor = .white
self.view.addSubview(bgImgV)
self.bgImgV.snp.makeConstraints { make in
make.edges.equalToSuperview()
......@@ -143,6 +143,27 @@ class YHCommunityViewController: YHBaseViewController {
extension YHCommunityViewController: JXSegmentedViewDelegate {
func segmentedView(_ segmentedView: JXSegmentedView, didSelectedItemAt index: Int) {
navigationController?.interactivePopGestureRecognizer?.isEnabled = (segmentedView.selectedIndex == 0)
if segmentedView.selectedIndex == 0 {
bgImgV.isHidden = false
friendsBtn.isHidden = false
segmentedDataSource.titleNormalColor = UIColor(hex: 0xFFFFFF, alpha: 0.6)
segmentedDataSource.titleSelectedColor = .white
let indicator = JXSegmentedIndicatorLineView()
indicator.indicatorWidth = 16
indicator.indicatorColor = UIColor.white
segmentedView.indicators = [indicator]
} else {
bgImgV.isHidden = true
friendsBtn.isHidden = true
segmentedDataSource.titleNormalColor = UIColor(hex: 0x94a3b8)
segmentedDataSource.titleSelectedColor = UIColor.mainTextColor
let indicator = JXSegmentedIndicatorLineView()
indicator.indicatorWidth = 16
indicator.indicatorColor = UIColor.brandMainColor
segmentedView.indicators = [indicator]
}
segmentedView.dataSource = segmentedDataSource
segmentedView.reloadData()
}
}
......
......@@ -20,8 +20,7 @@ class YHMyGoodFriendsVC: YHBaseViewController {
tableView.backgroundColor = UIColor(hex: 0xF8FAFB)
tableView.register(UITableViewCell.self, forCellReuseIdentifier: "UITableViewCell")
tableView.register(YHMyFriendsCell.self, forCellReuseIdentifier: YHMyFriendsCell.cellReuseIdentifier)
tableView.contentInset = UIEdgeInsets(top: YHFriendsResponseView.height+16, left: 0, bottom: 0, right: 0)
tableView.addSubview(self.friendRequestView)
tableView.register(YHAddFriendCardCell.self, forCellReuseIdentifier: YHAddFriendCardCell.cellReuseIdentifier)
return tableView
}()
......@@ -48,6 +47,7 @@ class YHMyGoodFriendsVC: YHBaseViewController {
}()
var friendsArr:[String] = ["","","",""]
var friendRequestArr:[String] = ["","","",""]
override func viewDidLoad() {
super.viewDidLoad()
......@@ -68,17 +68,30 @@ class YHMyGoodFriendsVC: YHBaseViewController {
extension YHMyGoodFriendsVC: UITableViewDelegate, UITableViewDataSource {
func numberOfSections(in tableView: UITableView) -> Int {
if self.friendsArr.count > 0 {
return 1
}
return 0
return 2
}
func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
if section == 0 {
return self.friendRequestArr.count > 0 ? 1 : 0
}
return friendsArr.count
}
func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
if indexPath.section == 0 {
let cell = tableView.dequeueReusableCell(withIdentifier: YHAddFriendCardCell.cellReuseIdentifier, for: indexPath) as! YHAddFriendCardCell
cell.acceptBlock = {
[weak self] accept in
guard let self = self else { return }
self.friendRequestArr.removeFirst()
self.tableView.reloadData()
}
return cell
}
let cell = tableView.dequeueReusableCell(withIdentifier: YHMyFriendsCell.cellReuseIdentifier, for: indexPath) as! YHMyFriendsCell
if 0 <= indexPath.row && indexPath.row < friendsArr.count {
}
......@@ -86,43 +99,84 @@ extension YHMyGoodFriendsVC: UITableViewDelegate, UITableViewDataSource {
}
func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat {
return 101
if indexPath.section == 1 {
return 101
}
return UITableView.automaticDimension
}
func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
if 0 <= indexPath.row && indexPath.row < friendsArr.count {
let vc = YHMyNameCardViewController()
self.navigationController?.pushViewController(vc)
if indexPath.section == 1 {
if 0 <= indexPath.row && indexPath.row < friendsArr.count {
let vc = YHMyNameCardViewController()
self.navigationController?.pushViewController(vc)
}
}
}
func tableView(_ tableView: UITableView, heightForHeaderInSection section: Int) -> CGFloat {
return 52.0
if section == 0 {
if friendRequestArr.count > 0 {
return 38.0
}
return 0.1
}
if section == 1 {
if friendsArr.count > 0 {
return 52.0
}
return 0.1
}
return 0.1
}
func tableView(_ tableView: UITableView, viewForHeaderInSection section: Int) -> UIView? {
let view = UIView(frame: CGRect(x: 0, y: 0, width: KScreenWidth-16.0*2, height: 52))
view.backgroundColor = .white
let titleLabel = UILabel()
titleLabel.text = "好友列表"
titleLabel.textColor = UIColor.mainTextColor
titleLabel.textAlignment = .left
titleLabel.font = UIFont.PFSC_M(ofSize:16)
view.addSubview(titleLabel)
let corner = UIRectCorner(rawValue: UIRectCorner.topLeft.rawValue | UIRectCorner.topRight.rawValue)
let path = UIBezierPath(roundedRect:view.bounds,byRoundingCorners: corner,cornerRadii:CGSizeMake(6.0, 6.0))
let layer = CAShapeLayer()
layer.frame = view.bounds
layer.path = path.cgPath
view.layer.mask = layer
let view = UIView()
titleLabel.snp.makeConstraints { make in
make.left.equalTo(16)
make.top.equalTo(16)
make.height.equalTo(22)
if section == 0 {
if friendRequestArr.count <= 0 { return view }
let titleLabel = UILabel()
titleLabel.text = "好友请求(\(self.friendRequestArr.count))"
titleLabel.textColor = UIColor.mainTextColor
titleLabel.textAlignment = .left
titleLabel.font = UIFont.PFSC_M(ofSize:16)
view.addSubview(titleLabel)
titleLabel.snp.makeConstraints { make in
make.left.equalTo(0)
make.top.equalTo(0)
make.height.equalTo(22)
}
} else if section == 1 {
if friendsArr.count <= 0 { return view }
view.frame = CGRect(x: 0, y: 0, width: KScreenWidth-16.0*2, height: 52)
view.backgroundColor = .white
let titleLabel = UILabel()
titleLabel.text = "好友列表"
titleLabel.textColor = UIColor.mainTextColor
titleLabel.textAlignment = .left
titleLabel.font = UIFont.PFSC_M(ofSize:16)
view.addSubview(titleLabel)
let corner = UIRectCorner(rawValue: UIRectCorner.topLeft.rawValue | UIRectCorner.topRight.rawValue)
let path = UIBezierPath(roundedRect:view.bounds,byRoundingCorners: corner,cornerRadii:CGSizeMake(6.0, 6.0))
let layer = CAShapeLayer()
layer.frame = view.bounds
layer.path = path.cgPath
view.layer.mask = layer
titleLabel.snp.makeConstraints { make in
make.left.equalTo(16)
make.top.equalTo(16)
make.height.equalTo(22)
}
}
return view
}
......
......@@ -30,6 +30,21 @@ class YHPeopleViewController: YHBaseViewController {
btn.addTarget(self, action: #selector(didMatchBtnClicked), for: .touchUpInside)
return btn
}()
lazy var bottomLabel:UILabel = {
let label = UILabel()
label.textAlignment = .center
label.textColor = UIColor.mainTextColor70
label.font = UIFont.PFSC_R(ofSize:13)
label.text = "授权基础信息,获取更多人脉"
return label
}()
lazy var firstImageView: UIImageView = {
let imageView = UIImageView()
imageView.image = UIImage(named: "people_first_bg_image")
return imageView
}()
override func viewDidLoad() {
super.viewDidLoad()
......@@ -47,8 +62,14 @@ class YHPeopleViewController: YHBaseViewController {
self.view.addSubview(wingRightImgV)
self.view.addSubview(topLabel)
self.view.addSubview(firstImageView)
self.view.addSubview(self.bottomBtn)
self.view.addSubview(self.bottomLabel)
firstImageView.snp.makeConstraints { make in
make.left.right.equalToSuperview()
make.height.equalTo(547)
make.bottom.equalTo(-k_Height_safeAreaInsetsBottom())
}
self.topLabel.snp.makeConstraints { make in
make.centerX.equalToSuperview()
make.top.equalTo(50)
......@@ -62,6 +83,13 @@ class YHPeopleViewController: YHBaseViewController {
make.bottom.equalTo(-k_Height_safeAreaInsetsBottom()-48-60)
}
self.bottomLabel.snp.makeConstraints { make in
make.left.equalTo(24)
make.right.equalTo(-24)
make.height.equalTo(18.0)
make.top.equalTo(self.bottomBtn.snp.bottom).offset(12)
}
wingLeftImgV.snp.makeConstraints { make in
make.width.height.equalTo(19)
make.right.equalTo(self.topLabel.snp.left)
......@@ -75,9 +103,11 @@ class YHPeopleViewController: YHBaseViewController {
}
@objc func didMatchBtnClicked() {
let vc = YHMatchPeopleViewController()
self.navigationController?.pushViewController(vc)
let view = YHPeopleSuccessView(frame: CGRect(x: 0, y: 0, width: KScreenWidth, height: KScreenHeight))
let window = UIApplication.shared.yhKeyWindow()
window?.addSubview(view)
// let vc = YHMatchPeopleViewController()
// self.navigationController?.pushViewController(vc)
// let view = YHNameCardInfoView.createCardView()
// view.show()
......
//
// YHAddFriendCardCell.swift
// galaxy
//
// Created by edy on 2024/6/20.
// Copyright © 2024 https://www.galaxy-immi.com. All rights reserved.
//
import UIKit
class YHAddFriendCardCell: UITableViewCell {
static let cellReuseIdentifier = "YHAddFriendCardCell"
var acceptBlock:((Bool)->())?
static let height = 218.0
lazy var cardView: UIView = {
let view = UIView()
view.backgroundColor = .white
view.layer.cornerRadius = 3.0
return view
}()
lazy var bgImageView:UIImageView = {
let bgImgView = UIImageView(image: UIImage(named: "people_add_friend_bg"))
return bgImgView
}()
lazy var headImgV:UIImageView = {
let view = UIImageView()
view.layer.cornerRadius = 23.0
return view
}()
lazy var nameLabel:UILabel = {
let nameLabel = UILabel()
nameLabel.textColor = UIColor.mainTextColor
nameLabel.textAlignment = .left
nameLabel.font = UIFont.PFSC_B(ofSize:16)
return nameLabel
}()
lazy var signImgV:UIImageView = {
let view = UIImageView()
view.image = UIImage(named: "people_sign")
return view
}()
lazy var professionalLabel:UILabel = {
let label = UILabel()
label.textColor = UIColor.mainTextColor70
label.textAlignment = .left
label.font = UIFont.PFSC_R(ofSize:13)
return label
}()
lazy var scrollView:UIScrollView = {
let view = UIScrollView()
view.backgroundColor = UIColor(hex: 0xF4F6FA)
view.layer.cornerRadius = 3.0
return view
}()
lazy var scrollContentView:UIView = {
let view = UIView()
return view
}()
lazy var msgLabel:UILabel = {
let label = UILabel()
label.textColor = UIColor.mainTextColor50
label.textAlignment = .left
label.font = UIFont.PFSC_R(ofSize:13)
label.numberOfLines = 0
return label
}()
lazy var ignoreBtn:UIButton = {
let btn = UIButton()
btn.setTitle("忽略", for: .normal)
btn.backgroundColor = UIColor(hexString:"#F8F9FB")
btn.setTitleColor(UIColor(hexString: "#222222"), for: .normal)
btn.titleLabel?.font = .PFSC_M(ofSize: 13.6)
btn.layer.cornerRadius = 2.75
btn.addTarget(self, action: #selector(didIgnoreBtnClicked), for: .touchUpInside)
return btn
}()
lazy var acceptBtn:UIButton = {
let btn = UIButton()
btn.setTitle("接受", for: .normal)
btn.backgroundColor = UIColor.brandMainColor
btn.setTitleColor(UIColor.white, for: .normal)
btn.titleLabel?.font = .PFSC_M(ofSize: 13.6)
btn.layer.cornerRadius = 2.75
btn.addTarget(self, action: #selector(didAcceptBtnClicked), for: .touchUpInside)
return btn
}()
override init(style: UITableViewCell.CellStyle, reuseIdentifier: String?) {
super.init(style: style, reuseIdentifier: reuseIdentifier)
createUI()
}
required init?(coder: NSCoder) {
fatalError("init(coder:) has not been implemented")
}
@objc func didIgnoreBtnClicked() {
self.acceptBlock?(true)
}
@objc func didAcceptBtnClicked() {
self.acceptBlock?(false)
}
func createUI() {
self.contentView.addSubview(cardView)
cardView.addSubview(bgImageView)
cardView.addSubview(headImgV)
cardView.addSubview(nameLabel)
cardView.addSubview(signImgV)
cardView.addSubview(professionalLabel)
cardView.addSubview(scrollView)
scrollView.addSubview(scrollContentView)
scrollContentView.addSubview(msgLabel)
cardView.addSubview(ignoreBtn)
cardView.addSubview(acceptBtn)
self.headImgV.backgroundColor = .red
self.nameLabel.text = "XASAFSDFASDXASAFSDFASDXASAFSDFASDXASAFSDFASD"
self.professionalLabel.text = "咨询副总监 | 资讯科技及电讯"
self.msgLabel.text = "资讯科技及电讯资资讯科技及电讯资资讯科技及电讯资资讯科技及电讯资资讯科技及电讯资资讯科技及电讯资资讯科技及电讯资资讯科技及电讯资资讯科技及电讯资资讯科技及电讯资资讯科技及电讯资资讯科技及电讯资资讯科技及电讯资资讯科技及电讯资资讯科技及电讯资资讯科技及电讯资资讯科技及电讯资资讯科技及电讯资"
cardView.snp.makeConstraints { make in
make.edges.equalToSuperview()
}
bgImageView.snp.makeConstraints { make in
make.edges.equalToSuperview()
}
headImgV.snp.makeConstraints { make in
make.width.height.equalTo(46.0)
make.left.equalTo(16)
make.top.equalTo(16)
}
self.nameLabel.snp.makeConstraints { make in
make.left.equalTo(self.headImgV.snp.right).offset(10)
make.height.equalTo(22.0)
make.top.equalTo(self.headImgV)
}
self.signImgV.snp.makeConstraints { make in
make.width.equalTo(49)
make.height.equalTo(16)
make.centerY.equalTo(self.nameLabel)
make.left.equalTo(self.nameLabel.snp.right).offset(8)
make.right.lessThanOrEqualToSuperview().offset(-16)
}
self.professionalLabel.snp.makeConstraints { make in
make.left.equalTo(self.nameLabel)
make.right.equalTo(-16)
make.top.equalTo(self.nameLabel.snp.bottom).offset(6)
make.height.equalTo(18)
}
self.scrollView.snp.makeConstraints { make in
make.left.equalTo(16)
make.right.equalTo(-16)
make.top.equalTo(self.headImgV.snp.bottom).offset(16)
make.bottom.equalTo(self.ignoreBtn.snp.top).offset(-16)
make.height.lessThanOrEqualTo(60.0+6*2)
}
self.scrollContentView.snp.makeConstraints { make in
make.width.equalTo(KScreenWidth-40*2)
make.height.equalToSuperview().offset(-12)
make.left.equalToSuperview().offset(8)
make.right.equalToSuperview().offset(-8)
make.top.equalToSuperview().offset(6)
make.bottom.equalToSuperview().offset(-6)
}
self.msgLabel.snp.makeConstraints { make in
make.edges.equalToSuperview()
}
self.ignoreBtn.snp.makeConstraints { make in
make.left.equalTo(16)
make.width.equalTo(78)
make.height.equalTo(40)
make.bottom.equalToSuperview().offset(-16)
}
self.acceptBtn.snp.makeConstraints { make in
make.left.equalTo(self.ignoreBtn.snp.right).offset(10)
make.right.equalTo(-16)
make.centerY.equalTo(self.ignoreBtn)
make.height.equalTo(40)
}
}
}
......@@ -12,7 +12,7 @@ class YHFriendRequestView: UIView {
var sendBlock:((String?)->())?
static let cardHeight = 313.0
let textMaxCount = 10
let textMaxCount = 200
// 底层蒙版
lazy var blackMaskView: UIView = {
let view = UIView()
......
......@@ -12,7 +12,7 @@ class YHFriendsResponseView: UIView {
var acceptBlock:((Bool)->())?
static let height = 218.0
static let height = 218.0+30.0
lazy var titleLabel: UILabel = {
let titleLabel = UILabel()
......@@ -67,11 +67,22 @@ class YHFriendsResponseView: UIView {
return view
}()
lazy var scrollView:UIScrollView = {
let view = UIScrollView()
return view
}()
lazy var scrollContentView:UIView = {
let view = UIView()
return view
}()
lazy var msgLabel:UILabel = {
let label = UILabel()
label.textColor = UIColor.mainTextColor50
label.textAlignment = .left
label.font = UIFont.PFSC_R(ofSize:13)
label.numberOfLines = 0
return label
}()
......@@ -123,7 +134,9 @@ class YHFriendsResponseView: UIView {
cardView.addSubview(professionalLabel)
cardView.addSubview(msgContentView)
msgContentView.addSubview(msgLabel)
msgContentView.addSubview(scrollView)
scrollView.addSubview(scrollContentView)
scrollContentView.addSubview(msgLabel)
cardView.addSubview(ignoreBtn)
cardView.addSubview(acceptBtn)
......@@ -131,7 +144,7 @@ class YHFriendsResponseView: UIView {
self.headImgV.backgroundColor = .red
self.nameLabel.text = "XASAFSDFASDXASAFSDFASDXASAFSDFASDXASAFSDFASD"
self.professionalLabel.text = "咨询副总监 | 资讯科技及电讯"
self.msgLabel.text = "sdfasdfasdfasfasfasfasfasdfasdfas"
self.msgLabel.text = "资讯科技及电讯资讯科技及电讯资讯科技及电讯资讯科技及电讯资讯科技及电讯资讯科技及电讯资讯科技及电讯资讯科技及电讯"
titleLabel.snp.makeConstraints { make in
make.left.top.right.equalToSuperview()
......@@ -175,14 +188,22 @@ class YHFriendsResponseView: UIView {
make.left.equalTo(16)
make.right.equalTo(-16)
make.top.equalTo(self.headImgV.snp.bottom).offset(16)
make.height.equalTo(30)
make.height.equalTo(60)
}
self.msgLabel.snp.makeConstraints { make in
self.scrollView.snp.makeConstraints { make in
make.left.top.equalTo(6)
make.right.bottom.equalTo(-6)
}
self.scrollContentView.snp.makeConstraints { make in
make.width.equalTo(KScreenWidth-38*2)
make.edges.equalToSuperview()
}
self.msgLabel.snp.makeConstraints { make in
make.edges.equalToSuperview()
}
self.ignoreBtn.snp.makeConstraints { make in
make.left.equalTo(16)
make.top.equalTo(self.msgContentView.snp.bottom).offset(16)
......
//
// YHPeopleSuccessView.swift
// galaxy
//
// Created by EDY on 2024/6/20.
// Copyright © 2024 https://www.galaxy-immi.com. All rights reserved.
//
import UIKit
class YHPeopleSuccessView: UIView {
var centerView: UIView!
var titleLabel: UILabel!
var closeButton: UIButton!
var messageLabel: UILabel!
var bottomImageView: UIImageView!
var bottomButton: UIButton!
override init(frame: CGRect) {
super.init(frame: frame)
backgroundColor = UIColor(white: 0.5, alpha: 0.1)
let tap = UITapGestureRecognizer(target: self, action: #selector(handleTap))
tap.delegate = self
addGestureRecognizer(tap)
setView()
}
required init?(coder: NSCoder) {
fatalError("init(coder:) has not been implemented")
}
func setView() {
backgroundColor = UIColor(hex: 0x000000, alpha: 0.5)
centerView = {
let view = UIView()
view.backgroundColor = .white
view.layer.cornerRadius = kCornerRadius6
return view
}()
addSubview(centerView)
centerView.snp.makeConstraints { make in
make.center.equalToSuperview()
make.height.equalTo(273)
make.width.equalTo(299)
}
titleLabel = {
let label = UILabel()
label.text = "Hi,王凤姣\n您的人脉网络已激活"
label.font = UIFont.PFSC_M(ofSize: 17)
label.textColor = UIColor.mainTextColor
label.textAlignment = .center
label.numberOfLines = 0
return label
}()
centerView.addSubview(titleLabel)
titleLabel.snp.makeConstraints { make in
make.left.equalTo(21)
make.right.equalTo(-21)
make.height.equalTo(48)
make.top.equalTo(40)
}
closeButton = {
let button = UIButton(type: .custom)
button.setBackgroundImage(UIImage(named: "service_card_close"), for: .normal)
button.addTarget(self, action: #selector(dismiss), for: .touchUpInside)
return button
}()
centerView.addSubview(closeButton)
closeButton.snp.makeConstraints { make in
make.right.equalTo(-21)
make.width.height.equalTo(24)
make.top.equalTo(16)
}
messageLabel = {
let label = UILabel()
label.text = "我们已为您智能匹配新人脉"
label.font = UIFont.PFSC_R(ofSize: 14)
label.textColor = UIColor.placeHolderColor
label.textAlignment = .center
label.numberOfLines = 0
return label
}()
centerView.addSubview(messageLabel)
messageLabel.snp.makeConstraints { make in
make.left.equalTo(21)
make.right.equalTo(-21)
make.top.equalTo(96)
}
bottomImageView = {
let imageView = UIImageView()
imageView.image = UIImage(named: "people_success_alert_bg_image")
imageView.layer.cornerRadius = kCornerRadius6
imageView.clipsToBounds = true
return imageView
}()
centerView.addSubview(bottomImageView)
bottomImageView.snp.makeConstraints { make in
make.width.equalTo(164)
make.centerX.equalToSuperview()
make.height.equalTo(40)
make.top.equalTo(136)
}
bottomButton = {
let button = UIButton(type: .custom)
button.backgroundColor = UIColor(hex:0x4d9ffb)
button.titleLabel?.font = UIFont.PFSC_M(ofSize: 16)
button.contentHorizontalAlignment = .center
button.setTitle("去看看", for: .normal)
button.setTitleColor( UIColor(hex:0xffffff), for: .normal)
button.layer.cornerRadius = kCornerRadius3
button.clipsToBounds = true
button.addTarget(self, action: #selector(dismiss), for: .touchUpInside)
return button
}()
centerView.addSubview(bottomButton)
bottomButton.snp.makeConstraints { make in
make.right.equalTo(-16)
make.left.equalTo(16)
make.bottom.equalTo(-16)
make.height.equalTo(45)
}
bottomButton.layoutIfNeeded()
bottomButton.addYinHeGradualLayer()
}
@objc private func handleTap(_ sender: AnyObject?) {
print("处理点击手势")
dismiss()
}
@objc func dismiss() {
removeFromSuperview()
}
}
extension YHPeopleSuccessView: UIGestureRecognizerDelegate {
func gestureRecognizer(_ gestureRecognizer:UIGestureRecognizer, shouldReceive touch:UITouch) -> Bool {
if touch.view == self {
return true
}
return false
}
}
......@@ -110,9 +110,11 @@ class YHFileRenameInputView: UIView {
fatalError("init(coder:) has not been implemented")
}
static func inputView(defalutText:String?)-> YHFileRenameInputView {
static func inputView(defalutText:String?,_ placeholde: String = "请输入文件名称", _ title: String = "文件重命名")-> YHFileRenameInputView {
let view = YHFileRenameInputView(frame:CGRect(x: 0, y: 0, width:KScreenWidth, height:Self.height))
view.textField.text = defalutText
view.textField.attributedPlaceholder = NSAttributedString(string: placeholde, attributes: [NSAttributedString.Key.foregroundColor : UIColor.placeHolderColor])
view.titleLabel.text = title
return view
}
......
......@@ -7,11 +7,28 @@
//
import UIKit
import IQKeyboardManagerSwift
class YHEditInterestViewController: YHBaseViewController {
var collectionView: UICollectionView!
var nextButton: UIButton!
var normalItems: [YHInterestModel] = [YHInterestModel(name: "香港子女教育", isNormal: true, isSelect: false), YHInterestModel(name: "香港房产", isNormal: true, isSelect: false), YHInterestModel(name: "香港创业", isNormal: true, isSelect: false), YHInterestModel(name: "香港就业", isNormal: true, isSelect: false), YHInterestModel(name: "香港保险", isNormal: true, isSelect: false), YHInterestModel(name: "香港商务", isNormal: true, isSelect: false), YHInterestModel(name: "企业家", isNormal: true, isSelect: false), YHInterestModel(name: "ENTJ指挥家", isNormal: true, isSelect: false), YHInterestModel(name: "ENTP辩论家", isNormal: true, isSelect: false), YHInterestModel(name: "INTJ建筑师", isNormal: true, isSelect: false)]
var likeItems: [YHInterestModel] = [YHInterestModel(name: "ENTP辩论家", isNormal: false, isSelect: false), YHInterestModel(name: "+自定义", isNormal: false, isSelect: true)]
var viewModel: YHEditViewModel = YHEditViewModel()
lazy var blackMaskView: UIView = {
let view = UIView(frame:UIScreen.main.bounds)
view.backgroundColor = UIColor(hex: 0x0F1214, alpha: 0.5)
let tap = UITapGestureRecognizer(target: self, action: #selector(dismissed))
view.addGestureRecognizer(tap)
view.isHidden = true
return view
}()
var renameInputView: YHFileRenameInputView = {
let view = YHFileRenameInputView.inputView(defalutText: "请输入自定义标签", "请输入自定义标签", "请输入自定义标签")
return view
}()
override func viewDidLoad() {
super.viewDidLoad()
setView()
......@@ -24,7 +41,31 @@ class YHEditInterestViewController: YHBaseViewController {
func setView() {
gk_navTitle = "兴趣话题"
addKeyBoardNotify()
view.backgroundColor = .white
collectionView = {
// 创建集合视图布局
let layout = YHSearchItemLayout()
layout.scrollDirection = .vertical
layout.minimumInteritemSpacing = 12
// 创建集合视图
let collectView = UICollectionView(frame:.zero, collectionViewLayout: layout)
collectView.delegate = self
collectView.dataSource = self
collectView.backgroundColor = .white
// 注册自定义单元格
collectView.register(YHEditInterestViewCell.self, forCellWithReuseIdentifier: YHSearchInfoHistoryCell.cellReuseIdentifier)
collectView.register(YHEditInterestViewHeaderView.self, forSupplementaryViewOfKind: UICollectionView.elementKindSectionHeader, withReuseIdentifier: "YHEditInterestViewHeaderView")
return collectView
}()
view.addSubview(collectionView)
collectionView.snp.makeConstraints { make in
make.left.equalTo(21)
make.right.equalTo(-21)
make.bottom.equalTo(-8 - k_Height_safeAreaInsetsBottom() - 48)
make.top.equalTo(k_Height_NavigationtBarAndStatuBar)
}
nextButton = {
let button = UIButton(type: .custom)
......@@ -45,9 +86,282 @@ class YHEditInterestViewController: YHBaseViewController {
make.height.equalTo(48)
}
view.addSubview(blackMaskView)
view.addSubview(renameInputView)
renameInputView.snp.makeConstraints { make in
make.left.right.equalTo(view)
make.height.equalTo(YHEmailInputAlertView.height)
make.bottom.equalToSuperview().offset(YHEmailInputAlertView.height)
}
renameInputView.editBlock = {
[weak self] text in
guard let self = self else { return }
if let text = text {
let model = YHInterestModel(name: text, isNormal: false, isSelect: false)
self.likeItems.insert(model, at: likeItems.count - 1)
self.collectionView.reloadData()
}
}
}
@objc func dismissed() {
renameInputView.textField.resignFirstResponder()
}
@objc func nextStep() {
self.navigationController?.popViewController(animated: true)
}
// 计算文字宽度大小
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)
}
}
extension YHEditInterestViewController {
func addKeyBoardNotify() {
NotificationCenter.default.addObserver(self, selector: #selector(handleKeyboardNotification(_:)), name: UIResponder.keyboardWillShowNotification, object: nil)
NotificationCenter.default.addObserver(self, selector: #selector(handleKeyboardNotification(_:)), name: UIResponder.keyboardWillHideNotification, object: nil)
}
func removeNotify() {
NotificationCenter.default.removeObserver(self)
}
@objc func handleKeyboardNotification(_ notification: Notification) {
if notification.userInfo != nil {
guard let keyboardFrame = (notification.userInfo?[UIResponder.keyboardFrameEndUserInfoKey] as AnyObject).cgRectValue else {return }
let isKeyboardShow = notification.name == UIResponder.keyboardWillShowNotification
self.blackMaskView.isHidden = !isKeyboardShow
let bottomMargin = (isKeyboardShow ? 0 : keyboardFrame.height)
if !isKeyboardShow {
IQKeyboardManager.shared.enable = true
}
self.renameInputView.snp.updateConstraints { make in
make.bottom.equalToSuperview().offset(bottomMargin)
}
self.view.setNeedsLayout()
self.view.layoutIfNeeded()
}
}
}
extension YHEditInterestViewController: UICollectionViewDelegate, UICollectionViewDataSource, UICollectionViewDelegateFlowLayout {
func numberOfSections(in collectionView: UICollectionView) -> Int {
return 2
}
// 返回单元格数量
func collectionView(_ collectionView: UICollectionView, numberOfItemsInSection section: Int) -> Int {
if section == 0 {
return normalItems.count
} else {
return likeItems.count
}
}
// 返回每个单元格的大小
func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, sizeForItemAt indexPath: IndexPath) -> CGSize {
var model = YHInterestModel(name: "", isNormal: false, isSelect: false)
if indexPath.section == 0 {
model = normalItems[indexPath.item]
} else {
model = likeItems[indexPath.item]
}
let size = self.getwith(font: UIFont.systemFont(ofSize: 12), height: 24, string: model.name)
var width = size.width + 12*2.0
if !model.isNormal && !model.isSelect {
width = width + 22
}
if width > 226.0 {
width = 226.0
}
return CGSize(width: width, height: 30)
}
// 返回自定义单元格
func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell {
let cell = collectionView.dequeueReusableCell(withReuseIdentifier: YHSearchInfoHistoryCell.cellReuseIdentifier, for: indexPath) as! YHEditInterestViewCell
if indexPath.section == 0 {
cell.dataSource = normalItems[indexPath.item]
} else {
cell.dataSource = likeItems[indexPath.item]
}
cell.deleteBlock = { [weak self] in
guard let self = self else { return }
self.likeItems.remove(at: indexPath.item)
self.collectionView.reloadData()
}
return cell
}
func collectionView(_ collectionView: UICollectionView, didSelectItemAt indexPath: IndexPath) {
if indexPath.section == 0 {
normalItems[indexPath.item].isSelect = !normalItems[indexPath.item].isSelect
} else {
if indexPath.row != likeItems.count - 1 {
likeItems[indexPath.item].isSelect = !likeItems[indexPath.item].isSelect
} else {
//添加标签
renameInputView.textField.text = ""
renameInputView.textField.becomeFirstResponder()
}
}
collectionView.reloadData()
}
func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, referenceSizeForHeaderInSection section: Int) -> CGSize {
return CGSize(width: collectionView.frame.width, height: 50) // 设置section view的高度
}
// 创建section view
func collectionView(_ collectionView: UICollectionView, viewForSupplementaryElementOfKind kind: String, at indexPath: IndexPath) -> UICollectionReusableView {
if kind == UICollectionView.elementKindSectionHeader {
let headerView = collectionView.dequeueReusableSupplementaryView(ofKind: kind, withReuseIdentifier: "YHEditInterestViewHeaderView", for: indexPath) as! YHEditInterestViewHeaderView
if indexPath.section == 0 {
headerView.label.text = "话题标签"
}
if indexPath.section == 1 {
headerView.label.text = "自定义标签"
}
return headerView
}
return UICollectionReusableView()
}
}
class YHEditInterestViewHeaderView: UICollectionReusableView {
var label = UILabel()
override init(frame: CGRect) {
super.init(frame: frame)
setupLabel()
}
required init?(coder: NSCoder) {
fatalError("init(coder:) has not been implemented")
}
func setupLabel() {
label.frame = self.bounds
label.textAlignment = .left
label.textColor = UIColor.mainTextColor
label.font = UIFont.PFSC_M(ofSize: 15)
addSubview(label)
}
}
class YHEditInterestViewCell: UICollectionViewCell {
typealias DeleteBlock = () -> ()
var deleteBlock: DeleteBlock?
static let cellReuseIdentifier = "YHEditInterestViewCell"
var dataSource: YHInterestModel? {
didSet {
updateData()
}
}
lazy var titleLabel: UILabel = {
var label = UILabel()
label.font = .PFSC_R(ofSize: 12)
label.textAlignment = .left
label.textColor = UIColor.mainTextColor
return label
}()
lazy var deleteButton: UIButton = {
var button = UIButton()
button.setImage(UIImage(named: "set_interest_delete"), for: .normal)
button.addTarget(self, action: #selector(deleteClick), for: .touchUpInside)
return button
}()
lazy var addImageView: UIImageView = {
var label = UIImageView()
label.image = UIImage(named: "")
return label
}()
required init?(coder: NSCoder) {
super.init(coder: coder)
}
override init(frame: CGRect) {
super.init(frame: frame)
setupUI()
}
private func setupUI() {
contentView.backgroundColor = UIColor(hexString: "#F4F6FA")
contentView.clipsToBounds = true
contentView.addSubview(titleLabel)
contentView.addSubview(deleteButton)
titleLabel.snp.makeConstraints { make in
make.top.bottom.equalToSuperview()
make.left.equalToSuperview().offset(12.0)
make.right.equalToSuperview().offset(-12.0)
}
deleteButton.snp.makeConstraints { make in
make.right.top.bottom.equalToSuperview()
make.width.equalTo(22.0)
}
}
@objc func deleteClick() {
if let block = deleteBlock {
block()
}
}
func updateData() {
guard let dataSource = dataSource else {
return
}
contentView.layer.masksToBounds = true
contentView.layer.cornerRadius = kCornerRadius3
titleLabel.text = dataSource.name
if dataSource.isNormal {
deleteButton.isHidden = true
if dataSource.isSelect {
contentView.layer.borderWidth = 0.5
contentView.layer.borderColor = UIColor.brandMainColor.cgColor
titleLabel.textColor = UIColor.brandMainColor
} else {
contentView.layer.borderWidth = 0
contentView.layer.borderColor = UIColor.brandMainColor.cgColor
titleLabel.textColor = UIColor.mainTextColor
}
} else {
if dataSource.isSelect {
contentView.layer.borderWidth = 0.5
contentView.layer.borderColor = UIColor.brandMainColor.cgColor
titleLabel.textColor = UIColor.brandMainColor
deleteButton.isHidden = true
} else {
contentView.layer.borderWidth = 0
contentView.layer.borderColor = UIColor.brandMainColor.cgColor
titleLabel.textColor = UIColor.mainTextColor
deleteButton.isHidden = false
}
}
}
}
//
// YHInterestModel.swift
// galaxy
//
// Created by EDY on 2024/6/20.
// Copyright © 2024 https://www.galaxy-immi.com. All rights reserved.
//
import UIKit
class YHInterestModel {
var name: String = ""
var isNormal: Bool = true
var isSelect: Bool = false
init(name: String, isNormal: Bool, isSelect: Bool) {
self.name = name
self.isNormal = isNormal
self.isSelect = isSelect
}
}
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "set_interest_delete@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "set_interest_delete@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "people_first_bg_image@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "people_first_bg_image@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "people_success_alert_bg_image@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "people_success_alert_bg_image@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