Commit 59b41db5 authored by Steven杜宇's avatar Steven杜宇

// 名片

parent 129c8eff
......@@ -39,7 +39,7 @@
041CCDF72D7ED9030015E7BC /* YHHKVisaRenewalPaymentInfoList.swift in Sources */ = {isa = PBXBuildFile; fileRef = 041CCDF62D7ED9030015E7BC /* YHHKVisaRenewalPaymentInfoList.swift */; };
041CCDF92D7EE8B90015E7BC /* YHVisaRenewalPayMemberCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 041CCDF82D7EE8B90015E7BC /* YHVisaRenewalPayMemberCell.swift */; };
0426E09A2E84E962005C9F5D /* YHContact.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0426E0992E84E962005C9F5D /* YHContact.swift */; };
0426E09C2E851A91005C9F5D /* YHNewNameCardViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0426E09B2E851A91005C9F5D /* YHNewNameCardViewController.swift */; };
0426E09C2E851A91005C9F5D /* YHNameCardContainerViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0426E09B2E851A91005C9F5D /* YHNameCardContainerViewController.swift */; };
04307B662D1942F500ED8E8D /* YHDynamicSheetPickerView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04307B652D1942F500ED8E8D /* YHDynamicSheetPickerView.swift */; };
04307B682D19911800ED8E8D /* YHIncomeInfoEditCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04307B672D19911800ED8E8D /* YHIncomeInfoEditCell.swift */; };
04307B6A2D1A4C6500ED8E8D /* YHIncomeInfoSelectCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04307B692D1A4C6500ED8E8D /* YHIncomeInfoSelectCell.swift */; };
......@@ -1388,7 +1388,7 @@
041CCDF62D7ED9030015E7BC /* YHHKVisaRenewalPaymentInfoList.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHHKVisaRenewalPaymentInfoList.swift; sourceTree = "<group>"; };
041CCDF82D7EE8B90015E7BC /* YHVisaRenewalPayMemberCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHVisaRenewalPayMemberCell.swift; sourceTree = "<group>"; };
0426E0992E84E962005C9F5D /* YHContact.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHContact.swift; sourceTree = "<group>"; };
0426E09B2E851A91005C9F5D /* YHNewNameCardViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHNewNameCardViewController.swift; sourceTree = "<group>"; };
0426E09B2E851A91005C9F5D /* YHNameCardContainerViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHNameCardContainerViewController.swift; sourceTree = "<group>"; };
04307B652D1942F500ED8E8D /* YHDynamicSheetPickerView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHDynamicSheetPickerView.swift; sourceTree = "<group>"; };
04307B672D19911800ED8E8D /* YHIncomeInfoEditCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHIncomeInfoEditCell.swift; sourceTree = "<group>"; };
04307B692D1A4C6500ED8E8D /* YHIncomeInfoSelectCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHIncomeInfoSelectCell.swift; sourceTree = "<group>"; };
......@@ -6907,7 +6907,7 @@
04B30B7D2E86374E004E4B12 /* C */ = {
isa = PBXGroup;
children = (
0426E09B2E851A91005C9F5D /* YHNewNameCardViewController.swift */,
0426E09B2E851A91005C9F5D /* YHNameCardContainerViewController.swift */,
04B30B7A2E86307C004E4B12 /* YHNameCardHomePageViewController.swift */,
);
path = C;
......@@ -8692,7 +8692,7 @@
045C137C2D12CA5F00BD2DC0 /* YHVisaRenewalPayInfoBaseCell.swift in Sources */,
045C137D2D12CA5F00BD2DC0 /* YHPaddedLabel.swift in Sources */,
045C137E2D12CA5F00BD2DC0 /* IMAppKey.swift in Sources */,
0426E09C2E851A91005C9F5D /* YHNewNameCardViewController.swift in Sources */,
0426E09C2E851A91005C9F5D /* YHNameCardContainerViewController.swift in Sources */,
045C137F2D12CA5F00BD2DC0 /* YHHomeWebViewBottomForSavePicView.swift in Sources */,
045C13802D12CA5F00BD2DC0 /* YHLifeViewController.swift in Sources */,
045C13812D12CA5F00BD2DC0 /* YHParentInfoVC.swift in Sources */,
......
......@@ -65,7 +65,7 @@ extension YHConnectListViewController: UITableViewDelegate, UITableViewDataSourc
func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
if 0 <= indexPath.row && indexPath.row < arr.count {
let vc = YHNewNameCardViewController()
let vc = YHNameCardContainerViewController()
navigationController?.pushViewController(vc)
}
}
......
......@@ -157,9 +157,9 @@ class YHSetExplainView: UIView {
make.bottom.equalTo(-42)
make.height.equalTo(48)
}
bottomButton.layoutIfNeeded()
// bottomButton.layoutIfNeeded()
bottomButton.addYinHeGradualLayer()
// bottomButton.addYinHeGradualLayer()
}
@objc private func handleTap(_ sender: AnyObject?) {
......
......@@ -667,7 +667,7 @@ extension YHMyNewViewController {
switch item.type {
case .myCard:// 我的名片
let vc = YHNewNameCardViewController()
let vc = YHNameCardContainerViewController()
self.navigationController?.pushViewController(vc)
// enterMyNameCard()
case .myMessage:// 我的消息
......
......@@ -10,10 +10,22 @@ import AttributedString
import JXSegmentedView
import UIKit
class YHNewNameCardViewController: YHBaseViewController {
class YHNameCardContainerViewController: YHBaseViewController {
var defaultIndex = 0
lazy var containerScrollView: UIScrollView = {
let scrollView = UIScrollView(frame: .zero)
scrollView.delegate = self
scrollView.contentInsetAdjustmentBehavior = .never
return scrollView
}()
lazy var containerView: UIView = {
let view = UIView()
return view
}()
lazy var headerView: UIView = {
let view = UIView()
view.clipsToBounds = true
......@@ -23,7 +35,39 @@ class YHNewNameCardViewController: YHBaseViewController {
view.addSubview(bgImgView)
bgImgView.snp.makeConstraints { make in
make.left.right.top.equalToSuperview()
make.height.equalTo(bgImgView.snp.width).multipliedBy(300.0 / 375.0)
make.height.equalTo(bgImgView.snp.width).multipliedBy(800.0 / 375.0)
}
view.addSubview(avatarImgView)
avatarImgView.snp.makeConstraints { make in
make.left.equalTo(20)
make.top.equalTo(24 + k_Height_NavigationtBarAndStatuBar)
make.width.height.equalTo(68)
}
view.addSubview(editBtn)
editBtn.snp.makeConstraints { make in
make.width.height.equalTo(20)
make.centerY.equalTo(avatarImgView)
make.right.equalTo(-20)
}
view.addSubview(nameTextView)
nameTextView.snp.makeConstraints { make in
make.left.equalTo(20)
make.right.equalTo(-20)
make.top.equalTo(avatarImgView.snp.bottom).offset(12)
}
view.addSubview(professionalLabel)
professionalLabel.snp.makeConstraints { make in
make.left.equalTo(20)
make.right.equalTo(-20)
make.top.equalTo(nameTextView.snp.bottom).offset(4)
}
view.addSubview(signatureLabel)
signatureLabel.snp.makeConstraints { make in
make.left.equalTo(20)
make.right.equalTo(-20)
make.top.equalTo(professionalLabel.snp.bottom).offset(6)
make.bottom.equalTo(-32)
}
return view
}()
......@@ -120,12 +164,20 @@ class YHNewNameCardViewController: YHBaseViewController {
}()
lazy var childrenVC: [YHBaseViewController] = {
let vc1 = YHNameCardHomePageViewController()
let vc2 = YHNameCardHomePageViewController()
let vcs: [YHBaseViewController] = [vc1, vc2]
let vcs: [YHBaseViewController] = [homePageVC, vc2]
return vcs
}()
lazy var homePageVC: YHNameCardHomePageViewController = {
let vc = YHNameCardHomePageViewController()
if let userId = YHLoginManager.shared.userModel?.id {
vc.userId = userId
}
return vc
}()
lazy var bottomBtn: UIButton = {
let btn = UIButton(type: .custom)
btn.setTitle("发布动态", for: .normal)
......@@ -144,53 +196,49 @@ class YHNewNameCardViewController: YHBaseViewController {
gk_navRightBarButtonItem = rightButtonItem
gk_navItemRightSpace = 16
NotificationCenter.default.addObserver(self, selector: #selector(leaveTopOp), name: Notification.Name(rawValue: "leaveTop0"), object: nil)
createUI()
}
deinit {
NotificationCenter.default.removeObserver(self)
}
@objc func authorizeBtnClicked() {
}
func createUI() {
view.backgroundColor = .white
view.addSubview(headerView)
headerView.snp.makeConstraints { make in
view.addSubview(containerScrollView)
containerScrollView.addSubview(containerView)
view.addSubview(bottomBtn)
containerScrollView.snp.makeConstraints { make in
make.left.right.top.equalToSuperview()
make.bottom.equalTo(bottomBtn.snp.top).offset(-8)
}
headerView.addSubview(avatarImgView)
avatarImgView.snp.makeConstraints { make in
make.left.equalTo(20)
make.top.equalTo(24 + k_Height_NavigationtBarAndStatuBar)
make.width.height.equalTo(68)
}
headerView.addSubview(editBtn)
editBtn.snp.makeConstraints { make in
make.width.height.equalTo(20)
make.centerY.equalTo(avatarImgView)
make.right.equalTo(-20)
}
headerView.addSubview(nameTextView)
nameTextView.snp.makeConstraints { make in
make.left.equalTo(20)
make.right.equalTo(-20)
make.top.equalTo(avatarImgView.snp.bottom).offset(12)
containerView.snp.makeConstraints { make in
make.width.equalTo(KScreenWidth)
make.edges.equalToSuperview()
}
headerView.addSubview(professionalLabel)
professionalLabel.snp.makeConstraints { make in
make.left.equalTo(20)
make.right.equalTo(-20)
make.top.equalTo(nameTextView.snp.bottom).offset(4)
bottomBtn.snp.makeConstraints { make in
make.left.equalTo(16)
make.right.equalTo(-16)
make.height.equalTo(46)
make.bottom.equalTo(-k_Height_safeAreaInsetsBottom()-10)
}
headerView.addSubview(signatureLabel)
signatureLabel.snp.makeConstraints { make in
make.left.equalTo(20)
make.right.equalTo(-20)
make.top.equalTo(professionalLabel.snp.bottom).offset(6)
make.bottom.equalTo(-32)
containerView.addSubview(headerView)
headerView.snp.makeConstraints { make in
make.left.right.top.equalToSuperview()
}
segmentedView.dataSource = segmentedDataSource
segmentedView.delegate = self
view.addSubview(segmentedView)
containerView.addSubview(segmentedView)
segmentedView.snp.makeConstraints { make in
make.left.right.equalToSuperview()
make.top.equalTo(headerView.snp.bottom)
......@@ -198,20 +246,13 @@ class YHNewNameCardViewController: YHBaseViewController {
}
segmentedView.listContainer = listContainerView
view.addSubview(listContainerView)
view.addSubview(bottomBtn)
containerView.addSubview(listContainerView)
listContainerView.snp.makeConstraints { make in
make.left.right.equalToSuperview()
make.top.equalTo(segmentedView.snp.bottom).offset(0.0)
make.bottom.equalTo(bottomBtn.snp.top).offset(-8)
}
bottomBtn.snp.makeConstraints { make in
make.left.equalTo(16)
make.right.equalTo(-16)
make.height.equalTo(46)
make.bottom.equalTo(-k_Height_safeAreaInsetsBottom()-10)
make.height.equalTo(KScreenHeight-k_Height_NavigationtBarAndStatuBar-30-k_Height_safeAreaInsetsBottom()-46-10)
make.bottom.equalTo(containerView)
}
// 分类Title
......@@ -243,7 +284,7 @@ class YHNewNameCardViewController: YHBaseViewController {
// self.signImgV.isHidden = !self.userModel.isSigned
var name: ASAttributedString = .init(string: "阿萨德减肥啦拒收到付垃圾啊送达了开发机山卡拉", .font(UIFont.PFSC_M(ofSize: 21)), .foreground(UIColor.brandGrayColor8))
let name: ASAttributedString = .init(string: "阿萨德减肥啦拒收到付垃圾啊送达了开发机山卡拉", .font(UIFont.PFSC_M(ofSize: 21)), .foreground(UIColor.brandGrayColor8))
let cityTag: ASAttributedString = " \(.view(cityLabel, .original(.center)))"
let zodiacTag: ASAttributedString = " \(.view(zodiacLabel, .original(.center)))"
......@@ -260,7 +301,7 @@ class YHNewNameCardViewController: YHBaseViewController {
}
}
extension YHNewNameCardViewController: JXSegmentedViewDelegate {
extension YHNameCardContainerViewController: JXSegmentedViewDelegate {
func segmentedView(_ segmentedView: JXSegmentedView, didSelectedItemAt index: Int) {
}
......@@ -268,7 +309,7 @@ extension YHNewNameCardViewController: JXSegmentedViewDelegate {
}
}
extension YHNewNameCardViewController: JXSegmentedListContainerViewDataSource {
extension YHNameCardContainerViewController: JXSegmentedListContainerViewDataSource {
func numberOfLists(in listContainerView: JXSegmentedListContainerView) -> Int {
if let titleDataSource = segmentedView.dataSource as? JXSegmentedBaseDataSource {
return titleDataSource.dataSource.count
......@@ -283,3 +324,41 @@ extension YHNewNameCardViewController: JXSegmentedListContainerViewDataSource {
return vc
}
}
extension YHNameCardContainerViewController: UIScrollViewDelegate {
func scrollViewDidScroll(_ scrollView: UIScrollView) {
if scrollView.contentOffset.y > 0 {
var alpha = scrollView.contentOffset.y / (24)
if alpha > 1.0 {
alpha = 1.0
}
gk_navBarAlpha = alpha
gk_navBackgroundColor = .white
gk_navTitle = "我的名片"
} else {
gk_navBarAlpha = 0.0
gk_navBackgroundColor = .clear
gk_navTitle = nil
}
// 吸顶
let fixOffSetY: CGFloat = self.headerView.height-k_Height_NavigationtBarAndStatuBar
if scrollView.contentOffset.y >= fixOffSetY {
scrollView.contentOffset = CGPoint(x: 0, y: fixOffSetY)
scrollView.isScrollEnabled = false
homePageVC.vcCanScroll = true
} else {
containerScrollView.isScrollEnabled = true
homePageVC.vcCanScroll = false
}
}
}
extension YHNameCardContainerViewController {
@objc func leaveTopOp() {
containerScrollView.isScrollEnabled = true
}
}
......@@ -11,17 +11,249 @@ import JXSegmentedView
class YHNameCardHomePageViewController: YHBaseViewController {
var userId: String = ""
var cardInfoArr: [YHUserNameCardInfo] = []
let viewModel = YHMatchUserViewModel()
var vcCanScroll: Bool = false {
didSet {
tableView.isScrollEnabled = vcCanScroll
}
}
var isCurrentUser: Bool {
get {
return (!self.userId.isEmpty && self.userId == YHLoginManager.shared.userModel?.id)
}
}
lazy var tableView: UITableView = {
let tableView = UITableView(frame: .zero, style: .grouped)
tableView.estimatedSectionHeaderHeight = 100
tableView.showsVerticalScrollIndicator = false
tableView.separatorStyle = .none
tableView.delegate = self
tableView.dataSource = self
tableView.backgroundColor = .clear
tableView.register(UITableViewCell.self, forCellReuseIdentifier: "UITableViewCell")
tableView.register(YHMyNameCardAvatarInfoCell.self, forCellReuseIdentifier: YHMyNameCardAvatarInfoCell.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)
return tableView
}()
deinit {
NotificationCenter.default.removeObserver(self)
}
override func viewDidLoad() {
super.viewDidLoad()
view.backgroundColor = .white
gk_navigationBar.isHidden = true
createUI()
requestNameCardInfo()
}
func createUI() {
vcCanScroll = false
view.addSubview(self.tableView)
self.tableView.snp.makeConstraints { make in
make.left.equalTo(0)
make.right.equalTo(0)
make.bottom.equalToSuperview()
make.top.equalToSuperview()
}
}
func requestNameCardInfo() {
self.viewModel.getUserNameCardInfo(uid: self.userId) {
_, _ in
self.cardInfoArr.removeAll()
// 个人简介信息
var isShowIntroduce = true
if !self.isCurrentUser {
isShowIntroduce = !self.viewModel.nameCardInfo.bio.isEmpty
}
if isShowIntroduce {
let model2 = YHUserNameCardInfo()
model2.type = .introduce
model2.isCurrentUser = self.isCurrentUser
model2.updateModel(self.viewModel.nameCardInfo)
self.cardInfoArr.append(model2)
}
// 教育经历信息
var isShowEducation = true
if !self.isCurrentUser {
isShowEducation = !self.viewModel.nameCardInfo.isHiddenEducation
if isShowEducation {
isShowEducation = (!self.viewModel.nameCardInfo.college.isEmpty || !self.viewModel.nameCardInfo.background.isEmpty || !self.viewModel.nameCardInfo.major.isEmpty)
}
}
if isShowEducation {
let model3 = YHUserNameCardInfo()
model3.type = .education
model3.isCurrentUser = self.isCurrentUser
model3.updateModel(self.viewModel.nameCardInfo)
self.cardInfoArr.append(model3)
}
// 工作经历信息
var isShowWorkExperience = true
if !self.isCurrentUser {
isShowWorkExperience = !self.viewModel.nameCardInfo.isHiddenWorkExperience
if isShowWorkExperience {
isShowWorkExperience = (!self.viewModel.nameCardInfo.companyName.isEmpty || !self.viewModel.nameCardInfo.position.isEmpty || !self.viewModel.nameCardInfo.industry.isEmpty)
}
}
if isShowWorkExperience {
let model4 = YHUserNameCardInfo()
model4.type = .workExperience
model4.isCurrentUser = self.isCurrentUser
model4.updateModel(self.viewModel.nameCardInfo)
self.cardInfoArr.append(model4)
}
// 荣誉奖项信息
var isShowHonor = true
if !self.isCurrentUser {
isShowHonor = !self.viewModel.nameCardInfo.honor.isEmpty
}
if isShowHonor {
let model5 = YHUserNameCardInfo()
model5.type = .honor
model5.isCurrentUser = self.isCurrentUser
model5.updateModel(self.viewModel.nameCardInfo)
self.cardInfoArr.append(model5)
}
// 兴趣话题
var isShowTopics = true
if !self.isCurrentUser {
isShowTopics = self.viewModel.nameCardInfo.topics.count > 0
}
if isShowTopics {
let model6 = YHUserNameCardInfo()
model6.type = .topics
model6.isCurrentUser = self.isCurrentUser
model6.updateModel(self.viewModel.nameCardInfo)
self.cardInfoArr.append(model6)
}
self.tableView.reloadData()
}
}
}
extension YHNameCardHomePageViewController: UITableViewDelegate, UITableViewDataSource {
func numberOfSections(in tableView: UITableView) -> Int {
return self.cardInfoArr.count
}
func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
return 1
}
func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
if 0 <= indexPath.section && indexPath.section < self.cardInfoArr.count {
let cardInfo = self.cardInfoArr[indexPath.section]
if cardInfo.type == .honor || cardInfo.type == .introduce {
guard let introCell = tableView.dequeueReusableCell(withIdentifier: YHMyIntroductionCell.cellReuseIdentifier, for: indexPath) as? YHMyIntroductionCell else { return UITableViewCell() }
introCell.userModel = cardInfo
introCell.editBlock = { [weak self] in
guard let self = self else { return }
if cardInfo.type == .honor {
let vc = YHEditHonorViewController()
vc.model = self.viewModel.nameCardInfo
self.navigationController?.pushViewController(vc)
} else if cardInfo.type == .introduce {
let vc = YHEditPersonalProfileViewController()
vc.model = self.viewModel.nameCardInfo
self.navigationController?.pushViewController(vc)
}
}
return introCell
}
if cardInfo.type == .education {
guard let eduCell = tableView.dequeueReusableCell(withIdentifier: YHMyEducationCell.cellReuseIdentifier, for: indexPath) as? YHMyEducationCell else { return UITableViewCell() }
eduCell.userModel = cardInfo
eduCell.hiddenBtnBlock = {
[weak self] in
guard let self = self else { return }
YHWholeScreenTipsView.show(type: .nameCardEducation, targetView: eduCell.hiddenBtn)
}
eduCell.editBlock = { [weak self] in
guard let self = self else { return }
let vc = YHEditSchoolViewController()
vc.model = self.viewModel.nameCardInfo
self.navigationController?.pushViewController(vc)
}
return eduCell
}
if cardInfo.type == .workExperience {
guard let workCell = tableView.dequeueReusableCell(withIdentifier: YHMyWorkExperienceCell.cellReuseIdentifier, for: indexPath) as? YHMyWorkExperienceCell else { return UITableViewCell() }
workCell.userModel = cardInfo
workCell.hiddenBtnBlock = {
[weak self] in
guard let self = self else { return }
YHWholeScreenTipsView.show(type: .nameCardWorkExperience, targetView: workCell.hiddenBtn)
}
workCell.editBlock = { [weak self] in
guard let self = self else { return }
let vc = YHEditWorkViewController()
vc.model = self.viewModel.nameCardInfo
self.navigationController?.pushViewController(vc)
}
return workCell
}
if cardInfo.type == .topics {
guard let topicCell = tableView.dequeueReusableCell(withIdentifier: YHMyInterestTopicCell.cellReuseIdentifier, for: indexPath) as? YHMyInterestTopicCell else { return UITableViewCell() }
topicCell.userModel = cardInfo
topicCell.editBlock = { [weak self] in
guard let self = self else { return }
let vc = YHEditInterestViewController()
vc.model = self.viewModel.nameCardInfo
self.navigationController?.pushViewController(vc)
}
return topicCell
}
}
let defaultCell = tableView.dequeueReusableCell(withIdentifier: "UITableViewCell", for: indexPath)
return defaultCell
}
func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat {
return UITableView.automaticDimension
}
func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
}
func tableView(_ tableView: UITableView, heightForFooterInSection section: Int) -> CGFloat {
return 16.0
}
func tableView(_ tableView: UITableView, viewForFooterInSection section: Int) -> UIView? {
let view = UIView()
return view
}
func tableView(_ tableView: UITableView, heightForHeaderInSection section: Int) -> CGFloat {
return 1.0
}
}
extension YHNameCardHomePageViewController: JXSegmentedListContainerViewListDelegate {
......@@ -29,3 +261,21 @@ extension YHNameCardHomePageViewController: JXSegmentedListContainerViewListDele
return view
}
}
extension YHNameCardHomePageViewController: UIScrollViewDelegate {
// 控制滑动交互
func scrollViewDidScroll(_ scrollView: UIScrollView) {
let scrollViewSet: CGFloat = scrollView.contentOffset.y
if vcCanScroll == false {// 不能滚动时
scrollView.contentOffset = CGPoint(x: 0, y: 0)
} else {
if scrollViewSet <= 0 {
scrollView.contentOffset = CGPoint(x: 0, y: 0)
vcCanScroll = false
NotificationCenter.default.post(name: Notification.Name(rawValue: "leaveTop0"), object: nil)
} else {
scrollView.contentOffset = CGPoint(x: 0, y: scrollViewSet)
}
}
}
}
......@@ -5,12 +5,12 @@
"scale" : "1x"
},
{
"filename" : "头部背景图.png",
"filename" : "头部背景图-1.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "头部背景图-1.png",
"filename" : "头部背景图 1.png",
"idiom" : "universal",
"scale" : "3x"
}
......
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