Commit ca303a56 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:
  //  默认icon
  //  人脉
  //  我的名片
  //  计算collecitonView高度
  提醒更换
parents f47888de 89bf1483
......@@ -53,7 +53,7 @@
044CF8D42BB6BCF700008CE8 /* YHSignatureUploadTableViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 044CF8D32BB6BCF700008CE8 /* YHSignatureUploadTableViewCell.swift */; };
044CF8D62BBA57DC00008CE8 /* YHFailPromptView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 044CF8D52BBA57DC00008CE8 /* YHFailPromptView.swift */; };
044D0BEE2C2019C100C5CF5E /* YHCommunityViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 044D0BED2C2019C100C5CF5E /* YHCommunityViewController.swift */; };
044D0BF22C20262100C5CF5E /* YHPeopleViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 044D0BF12C20262100C5CF5E /* YHPeopleViewController.swift */; };
044D0BF22C20262100C5CF5E /* YHMatchUserViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 044D0BF12C20262100C5CF5E /* YHMatchUserViewController.swift */; };
044D0BF42C21247100C5CF5E /* YHUserInfoSettingViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 044D0BF32C21247100C5CF5E /* YHUserInfoSettingViewController.swift */; };
044D0BF62C2154CA00C5CF5E /* YHAllowUseMyInfoViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 044D0BF52C2154CA00C5CF5E /* YHAllowUseMyInfoViewController.swift */; };
044D0BF82C21572B00C5CF5E /* YHAllowSettingTableViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 044D0BF72C21572B00C5CF5E /* YHAllowSettingTableViewCell.swift */; };
......@@ -373,14 +373,14 @@
04FB01D02C23FA420040115D /* YHMatchUserInfo.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04FB01CF2C23FA420040115D /* YHMatchUserInfo.swift */; };
04FB01D22C23FCDD0040115D /* YHMatchCardUsageGuideView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04FB01D12C23FCDD0040115D /* YHMatchCardUsageGuideView.swift */; };
04FB01D42C2404F50040115D /* YHMyFriendsNoDataView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04FB01D32C2404F50040115D /* YHMyFriendsNoDataView.swift */; };
04FD85662C2124AF00BEF9C5 /* YHMyNameCardViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04FD85652C2124AF00BEF9C5 /* YHMyNameCardViewController.swift */; };
04FD85662C2124AF00BEF9C5 /* YHNameCardViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04FD85652C2124AF00BEF9C5 /* YHNameCardViewController.swift */; };
04FD85682C21277800BEF9C5 /* YHMyNameCardAvatarInfoCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04FD85672C21277800BEF9C5 /* YHMyNameCardAvatarInfoCell.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 */; };
04FD85722C21786900BEF9C5 /* YHNameCardInfoView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04FD85712C21786900BEF9C5 /* YHNameCardInfoView.swift */; };
04FD85742C219CFD00BEF9C5 /* YHMatchPeopleViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04FD85732C219CFD00BEF9C5 /* YHMatchPeopleViewController.swift */; };
04FD85742C219CFD00BEF9C5 /* YHMatchResultListViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04FD85732C219CFD00BEF9C5 /* YHMatchResultListViewController.swift */; };
6203A87EDC96313BBE789D9C /* Pods_galaxy.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 987C69D43AE8D85DC1930DCF /* Pods_galaxy.framework */; };
A51044182B493675006B60BB /* README.md in Resources */ = {isa = PBXBuildFile; fileRef = A51044172B493675006B60BB /* README.md */; };
A510441A2B495DD0006B60BB /* UIView+Extension.swift in Sources */ = {isa = PBXBuildFile; fileRef = A51044192B495DD0006B60BB /* UIView+Extension.swift */; };
......@@ -618,7 +618,7 @@
044CF8D32BB6BCF700008CE8 /* YHSignatureUploadTableViewCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHSignatureUploadTableViewCell.swift; sourceTree = "<group>"; };
044CF8D52BBA57DC00008CE8 /* YHFailPromptView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHFailPromptView.swift; sourceTree = "<group>"; };
044D0BED2C2019C100C5CF5E /* YHCommunityViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHCommunityViewController.swift; sourceTree = "<group>"; };
044D0BF12C20262100C5CF5E /* YHPeopleViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHPeopleViewController.swift; sourceTree = "<group>"; };
044D0BF12C20262100C5CF5E /* YHMatchUserViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHMatchUserViewController.swift; sourceTree = "<group>"; };
044D0BF32C21247100C5CF5E /* YHUserInfoSettingViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHUserInfoSettingViewController.swift; sourceTree = "<group>"; };
044D0BF52C2154CA00C5CF5E /* YHAllowUseMyInfoViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHAllowUseMyInfoViewController.swift; sourceTree = "<group>"; };
044D0BF72C21572B00C5CF5E /* YHAllowSettingTableViewCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHAllowSettingTableViewCell.swift; sourceTree = "<group>"; };
......@@ -940,14 +940,14 @@
04FB01CF2C23FA420040115D /* YHMatchUserInfo.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHMatchUserInfo.swift; sourceTree = "<group>"; };
04FB01D12C23FCDD0040115D /* YHMatchCardUsageGuideView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHMatchCardUsageGuideView.swift; sourceTree = "<group>"; };
04FB01D32C2404F50040115D /* YHMyFriendsNoDataView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHMyFriendsNoDataView.swift; sourceTree = "<group>"; };
04FD85652C2124AF00BEF9C5 /* YHMyNameCardViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHMyNameCardViewController.swift; sourceTree = "<group>"; };
04FD85652C2124AF00BEF9C5 /* YHNameCardViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHNameCardViewController.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>"; };
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>"; };
04FD85712C21786900BEF9C5 /* YHNameCardInfoView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHNameCardInfoView.swift; sourceTree = "<group>"; };
04FD85732C219CFD00BEF9C5 /* YHMatchPeopleViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHMatchPeopleViewController.swift; sourceTree = "<group>"; };
04FD85732C219CFD00BEF9C5 /* YHMatchResultListViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHMatchResultListViewController.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>"; };
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; };
......@@ -1316,10 +1316,10 @@
isa = PBXGroup;
children = (
044D0BED2C2019C100C5CF5E /* YHCommunityViewController.swift */,
044D0BF12C20262100C5CF5E /* YHPeopleViewController.swift */,
044D0BF12C20262100C5CF5E /* YHMatchUserViewController.swift */,
04F957462C203033003C631C /* YHMyGoodFriendsVC.swift */,
04FD85652C2124AF00BEF9C5 /* YHMyNameCardViewController.swift */,
04FD85732C219CFD00BEF9C5 /* YHMatchPeopleViewController.swift */,
04FD85652C2124AF00BEF9C5 /* YHNameCardViewController.swift */,
04FD85732C219CFD00BEF9C5 /* YHMatchResultListViewController.swift */,
044D0BFB2C21635B00C5CF5E /* YHInformationAuthorizationStepOneViewController.swift */,
044D0C032C2180B700C5CF5E /* YHInformationAuthorizationStepTwoViewController.swift */,
);
......@@ -3163,7 +3163,7 @@
044414052BC3B9DE00784A14 /* YHServiceTableFootView.swift in Sources */,
045EEEEF2B9F171A0022A143 /* YHCertificateInfoController.swift in Sources */,
045EEEDA2B9F171A0022A143 /* YHEducationInfoListVC.swift in Sources */,
044D0BF22C20262100C5CF5E /* YHPeopleViewController.swift in Sources */,
044D0BF22C20262100C5CF5E /* YHMatchUserViewController.swift in Sources */,
A5ACE92C2B4564F7002C94D2 /* YHLoginStyleButton.swift in Sources */,
045EEF012B9F171A0022A143 /* YHFormItemSelectSheetCell.swift in Sources */,
045EEEE52B9F171A0022A143 /* YHMySignatureDetailViewController.swift in Sources */,
......@@ -3255,7 +3255,7 @@
04FD856C2C2153F000BEF9C5 /* YHMyEducationCell.swift in Sources */,
A5DE0D3C2BB9016200976FE1 /* YHEmailInputAlertView.swift in Sources */,
A5ACE9512B4564F7002C94D2 /* YhConstant.swift in Sources */,
04FD85662C2124AF00BEF9C5 /* YHMyNameCardViewController.swift in Sources */,
04FD85662C2124AF00BEF9C5 /* YHNameCardViewController.swift in Sources */,
045EEF192B9F171A0022A143 /* YHAddressModel.swift in Sources */,
045EEEDB2B9F171A0022A143 /* YHCollegeSearchViewController.swift in Sources */,
045EEE982B9F171A0022A143 /* YHPreviewInfoQuestionAndAnswerItemsView.swift in Sources */,
......@@ -3608,7 +3608,7 @@
043B0A352C1190C6008A9BBA /* YHSelectFileSheetView.swift in Sources */,
04F5F8662C197FFF004A463C /* YHHKControllerHoldViewController.swift in Sources */,
A5ACE92D2B4564F7002C94D2 /* YHLoginPrivacyView.swift in Sources */,
04FD85742C219CFD00BEF9C5 /* YHMatchPeopleViewController.swift in Sources */,
04FD85742C219CFD00BEF9C5 /* YHMatchResultListViewController.swift in Sources */,
045EEEB72B9F171A0022A143 /* YHWorkItemAddView.swift in Sources */,
A5ACE9372B4564F7002C94D2 /* YHBaseUrlManager.swift in Sources */,
04EA230A2BB5172F009DA928 /* YHDocumentPromptTableViewCell.swift in Sources */,
......
......@@ -134,7 +134,7 @@ class YHCommunityViewController: YHBaseViewController {
let vc = YHActivityListViewController()
arrItemVCs.append(vc)
} else {
let vc = YHPeopleViewController()
let vc = YHMatchUserViewController()
arrItemVCs.append(vc)
}
}
......
......@@ -13,7 +13,7 @@ protocol YHMatchProtocol: NSObjectProtocol {
func startMatchUsers()
}
class YHMatchPeopleViewController: YHBaseViewController {
class YHMatchResultListViewController: YHBaseViewController {
let viewModel = YHMatchUserViewModel()
let loginViewModel = YHLoginViewModel()
......@@ -159,7 +159,7 @@ class YHMatchPeopleViewController: YHBaseViewController {
}
if let userId = YHLoginManager.shared.userModel?.id, !userId.isEmpty {
let vc = YHMyNameCardViewController()
let vc = YHNameCardViewController()
vc.userId = userId
self.navigationController?.pushViewController(vc)
} else {
......@@ -170,7 +170,7 @@ class YHMatchPeopleViewController: YHBaseViewController {
guard let self = self else { return }
if !uid.isEmpty {
YHLoginManager.shared.userModel?.id = uid
let vc = YHMyNameCardViewController()
let vc = YHNameCardViewController()
vc.userId = uid
self.navigationController?.pushViewController(vc)
}
......@@ -347,7 +347,7 @@ class YHMatchPeopleViewController: YHBaseViewController {
}
}
extension YHMatchPeopleViewController: DragCardDataSource {
extension YHMatchResultListViewController: DragCardDataSource {
public func numberOfCards(_ dragCard: DragCardContainer) -> Int {
return matchUsersArr.count
......@@ -384,7 +384,7 @@ extension YHMatchPeopleViewController: DragCardDataSource {
}
}
extension YHMatchPeopleViewController: DragCardDelegate {
extension YHMatchResultListViewController: DragCardDelegate {
public func dragCard(_ dragCard: DragCardContainer, displayTopCardAt index: Int, with cardView: DragCardView) {
print("displayTopCardAt: \(index)")
......
......@@ -10,7 +10,7 @@ import UIKit
import JXSegmentedView
import Lottie
class YHPeopleViewController: YHBaseViewController {
class YHMatchUserViewController: YHBaseViewController {
let viewModel = YHMatchUserViewModel()
var informationAuthorizeViewModel: YHInformationAuthorizeViewModel = YHInformationAuthorizeViewModel()
......@@ -186,13 +186,13 @@ class YHPeopleViewController: YHBaseViewController {
}
}
extension YHPeopleViewController: JXSegmentedListContainerViewListDelegate {
extension YHMatchUserViewController: JXSegmentedListContainerViewListDelegate {
func listView() -> UIView {
return view
}
}
extension YHPeopleViewController: YHMatchProtocol {
extension YHMatchUserViewController: YHMatchProtocol {
func startMatchUsers() {
self.headLottieView.isHidden = true
self.launchLottieView.isHidden = false
......@@ -209,13 +209,13 @@ extension YHPeopleViewController: YHMatchProtocol {
}
}
extension YHPeopleViewController {
extension YHMatchUserViewController {
func requestMatchUserList() {
self.viewModel.getMatchUserlist {
success, error in
if success, self.viewModel.matchUserArr.count > 0 {
let vc = YHMatchPeopleViewController()
let vc = YHMatchResultListViewController()
vc.delegate = self
vc.matchUsersArr = self.viewModel.matchUserArr
self.navigationController?.pushViewController(vc)
......
......@@ -151,7 +151,7 @@ extension YHMyGoodFriendsVC: UITableViewDelegate, UITableViewDataSource {
if indexPath.section == 1 {
if 0 <= indexPath.row && indexPath.row < friendsArr.count {
let friend = self.friendsArr[indexPath.row]
let vc = YHMyNameCardViewController()
let vc = YHNameCardViewController()
vc.userId = friend.yhId
self.navigationController?.pushViewController(vc)
}
......
......@@ -8,7 +8,7 @@
import UIKit
class YHMyNameCardViewController: YHBaseViewController {
class YHNameCardViewController: YHBaseViewController {
var userId: String = ""
var cardInfoArr:[YHUserNameCardInfo] = []
......@@ -46,7 +46,7 @@ class YHMyNameCardViewController: YHBaseViewController {
lazy var navBar: YHCustomNavigationBar = {
let bar = YHCustomNavigationBar.navBar()
bar.backgroundColor = .clear
bar.title = "我的名片"
bar.title = self.isCurrentUser ? "我的名片" : "好友名片"
bar.titleColor = .white
bar.rightButton.setImage(UIImage(named: "people_card_authorized"), for: .normal)
bar.rightButton.setTitle("授权", for: .normal)
......@@ -111,7 +111,7 @@ class YHMyNameCardViewController: YHBaseViewController {
}
}
extension YHMyNameCardViewController: UITableViewDelegate, UITableViewDataSource {
extension YHNameCardViewController: UITableViewDelegate, UITableViewDataSource {
func numberOfSections(in tableView: UITableView) -> Int {
return self.cardInfoArr.count
......@@ -230,7 +230,7 @@ extension YHMyNameCardViewController: UITableViewDelegate, UITableViewDataSource
}
extension YHMyNameCardViewController {
extension YHNameCardViewController {
func requestAuthorization() {
self.authorModel.requestUserAuthorization { success, error in
......@@ -258,18 +258,21 @@ extension YHMyNameCardViewController {
self.cardInfoArr.removeAll()
// 姓名头像信息
let model1 = YHUserNameCardInfo()
model1.type = .avatar
model1.isCurrentUser = self.isCurrentUser
model1.updateModel(self.viewModel.nameCardInfo)
self.cardInfoArr.append(model1)
// 个人简介信息
let model2 = YHUserNameCardInfo()
model2.type = .introduce
model2.isCurrentUser = self.isCurrentUser
model2.updateModel(self.viewModel.nameCardInfo)
self.cardInfoArr.append(model2)
// 教育经历信息
if !self.isCurrentUser {
if !self.viewModel.nameCardInfo.isHiddenEducation {
let model3 = YHUserNameCardInfo()
......@@ -286,6 +289,8 @@ extension YHMyNameCardViewController {
self.cardInfoArr.append(model3)
}
// 工作经历信息
if !self.isCurrentUser {
if !self.viewModel.nameCardInfo.isHiddenWorkExperience {
let model4 = YHUserNameCardInfo()
......@@ -302,12 +307,14 @@ extension YHMyNameCardViewController {
self.cardInfoArr.append(model4)
}
// 荣誉奖项信息
let model5 = YHUserNameCardInfo()
model5.type = .honor
model5.isCurrentUser = self.isCurrentUser
model5.updateModel(self.viewModel.nameCardInfo)
self.cardInfoArr.append(model5)
// 兴趣话题
let model6 = YHUserNameCardInfo()
model6.type = .topics
model6.isCurrentUser = self.isCurrentUser
......
......@@ -43,6 +43,8 @@ class YHAddFriendCardCell: UITableViewCell {
didSet {
if let url = URL(string: self.friendModel.avatar) {
self.headImgV.kf.setImage(with: url, placeholder: UIImage(named: "people_head_default"))
} else {
self.headImgV.image = UIImage(named: "people_head_default")
}
self.nameLabel.text = self.friendModel.username
self.professionalLabel.text = self.friendModel.position
......
......@@ -18,6 +18,8 @@ class YHFriendRequestView: UIView {
didSet {
if let url = URL(string: self.userModel.avatar) {
self.headImgV.kf.setImage(with: url, placeholder: UIImage(named: "people_head_default"))
} else {
self.headImgV.image = UIImage(named: "people_head_default")
}
self.nameLabel.text = self.userModel.username
self.professionalLabel.text = self.userModel.position
......
......@@ -13,6 +13,7 @@ class YHInterestTopicLayout: UICollectionViewFlowLayout {
var dataSource:[String] = []
weak var layoutDelegate: UICollectionViewDelegateFlowLayout? = nil
var interItemSpacing: CGFloat = 12.0 // 相邻单元格之间的水平间距
var collectionViewWidth = KScreenWidth-16.0*4
override func prepare() {
super.prepare()
self.minimumInteritemSpacing = 12
......@@ -35,7 +36,7 @@ class YHInterestTopicLayout: UICollectionViewFlowLayout {
let originX = prevLayout.frame.maxX
//如果当 (上一个cell的最右边X + 我们想要的间距 + 当前cell的宽度 + 区边距) 依然在contentSize中 (小于屏幕宽度),我们改变当前cell的原点位置
//判断 当前cell的 maxX 是否超出屏幕
if((CGFloat(originX) + CGFloat(maximumSpacing) + currentLayout.frame.size.width) + self.sectionInset.right < self.collectionViewContentSize.width) {
if((CGFloat(originX) + CGFloat(maximumSpacing) + currentLayout.frame.size.width) + self.sectionInset.right < self.collectionViewWidth) {
var frame = currentLayout.frame
frame.origin.x = CGFloat(originX) + CGFloat(maximumSpacing)
currentLayout.frame = frame
......@@ -53,9 +54,8 @@ class YHInterestTopicLayout: UICollectionViewFlowLayout {
override var collectionViewContentSize: CGSize {
get {
let width = self.collectionView?.width ?? 0.0
let height = self.calculateHeight()
return CGSize(width: width, height: height)
return CGSize(width: self.collectionViewWidth, height: height)
}
}
......@@ -79,13 +79,14 @@ class YHInterestTopicLayout: UICollectionViewFlowLayout {
height = itemHeight
} else {
let targetX = currentX + self.minimumInteritemSpacing + size.width
if targetX <= self.collectionView!.width {
if targetX <= self.collectionViewWidth {
currentX = targetX
} else {
currentX = 0
currentX = size.width
height += self.minimumLineSpacing + itemHeight
}
}
printLog("calcaulte: \(height)")
}
}
return height
......
......@@ -16,6 +16,8 @@ class YHMyFriendsCell: UITableViewCell {
didSet {
if let url = URL(string: self.friendModel.avatar) {
self.headImgV.kf.setImage(with: url, placeholder: UIImage(named: "people_head_default"))
} else {
self.headImgV.image = UIImage(named: "people_head_default")
}
self.nameLabel.text = self.friendModel.username
self.professionalLabel.text = self.friendModel.position
......
......@@ -64,26 +64,34 @@ class YHMyInterestTopicCell: UITableViewCell {
self.collectionView.isHidden = !isShowList
self.detailLabel.isHidden = isShowList
self.topicArr.removeAll()
if self.userModel.topics.count > 0 {
self.topicArr.append(contentsOf: self.userModel.topics)
}
self.layout.dataSource = self.topicArr
self.layout.invalidateLayout()
self.collectionView.reloadData()
let height = self.layout.collectionViewContentSize.height
printLog("ABC: \(height)")
if isShowList {
self.topicArr.removeAll()
if self.userModel.topics.count > 0 {
self.topicArr.append(contentsOf: self.userModel.topics)
self.collectionView.snp.remakeConstraints { make in
make.height.equalTo(height)
make.left.equalTo(16)
make.right.equalTo(-16)
make.bottom.equalTo(-16)
make.top.equalTo(self.titleLabel.snp.bottom).offset(12)
}
self.layout.dataSource = self.topicArr
self.collectionView.reloadData {
let height = self.layout.collectionViewContentSize.height
printLog("ABC: \(height)")
self.collectionView.snp.remakeConstraints { make in
make.height.equalTo(height)
make.left.equalTo(16)
make.right.equalTo(-16)
make.bottom.equalTo(-16)
make.top.equalTo(self.titleLabel.snp.bottom).offset(12)
}
self.detailLabel.snp.remakeConstraints { make in
make.left.equalTo(16)
make.right.equalTo(-16)
make.top.equalTo(titleLabel.snp.bottom).offset(12)
}
self.setNeedsLayout()
self.layoutIfNeeded()
self.detailLabel.snp.removeConstraints()
} else {
......@@ -93,7 +101,12 @@ class YHMyInterestTopicCell: UITableViewCell {
make.bottom.equalTo(-16)
make.top.equalTo(titleLabel.snp.bottom).offset(12)
}
self.collectionView.snp.removeConstraints()
self.collectionView.snp.remakeConstraints { make in
make.height.equalTo(height)
make.left.equalTo(16)
make.right.equalTo(-16)
make.top.equalTo(self.titleLabel.snp.bottom).offset(12)
}
}
self.setNeedsLayout()
self.layoutIfNeeded()
......@@ -130,18 +143,15 @@ class YHMyInterestTopicCell: UITableViewCell {
layout.scrollDirection = .vertical
layout.dataSource = self.topicArr
layout.layoutDelegate = self
layout.collectionViewWidth = KScreenWidth-16.0*4
return layout
}()
lazy var collectionView: UICollectionView = {
// 创建集合视图布局
// 创建集合视图
let collectView = UICollectionView(frame:.zero, collectionViewLayout: self.layout)
collectView.delegate = self
collectView.dataSource = self
collectView.backgroundColor = .white
// 注册自定义单元格
collectView.register(YHTopicItemCell.self, forCellWithReuseIdentifier: YHTopicItemCell.cellReuseIdentifier)
return collectView
}()
......
......@@ -24,6 +24,8 @@ class YHMyNameCardAvatarInfoCell: UITableViewCell {
if let url = URL(string: self.userModel.avatar) {
self.headImgV.kf.setImage(with: url, placeholder: UIImage(named: "people_head_default"))
} else {
self.headImgV.image = UIImage(named: "people_head_default")
}
let city = self.userModel.address.city
......@@ -31,7 +33,8 @@ class YHMyNameCardAvatarInfoCell: UITableViewCell {
let cityWidth = self.getWith(font: self.cityLabel.font, height: 20, string: city)
self.cityLabel.frame = CGRectMake(0, 0, cityWidth+8, 20)
self.zodiacLabel.text = self.userModel.zodiac
self.signImgV.isHidden = !self.userModel.isSigned
var name:ASAttributedString = .init(string:self.userModel.username, .font(UIFont.PFSC_B(ofSize: 18)), .foreground(UIColor.mainTextColor))
let cityTag: ASAttributedString = " \(.view(self.cityLabel, .original(.center)))"
let zodiacTag: ASAttributedString = " \(.view(self.zodiacLabel, .original(.center)))"
......@@ -44,27 +47,38 @@ class YHMyNameCardAvatarInfoCell: UITableViewCell {
}
self.nameTextView.attributed.text = name
var text1 = ""
if !self.userModel.position.isEmpty {
self.professionalLabel.text = self.userModel.position
text1 = self.userModel.position
} else {
self.professionalLabel.text = ""
if self.userModel.isCurrentUser {
if self.userModel.isCurrentUser { // 当前用户默认文案
self.professionalLabel.textColor = UIColor.mainTextColor30
self.professionalLabel.text = "填写职位 | 填写所属行业"
text1 = "填写职位 | 填写所属行业"
}
}
self.professionalLabel.text = text1
var text2 = ""
if !self.userModel.signature.isEmpty {
self.detailLabel.text = self.userModel.signature
text2 = self.userModel.signature
} else {
self.detailLabel.text = ""
if self.userModel.isCurrentUser {
if self.userModel.isCurrentUser { // 当前用户默认文案
self.detailLabel.textColor = UIColor.mainTextColor30
self.detailLabel.text = "填写个性签名,展现真我风采,彰显独特身份"
text2 = "填写个性签名,展现真我风采,彰显独特身份"
}
}
self.signImgV.isHidden = !self.userModel.isSigned
self.detailLabel.text = text2
var top2Margin = 8.0
if text2.isEmpty {
top2Margin = 0.0
} else {
top2Margin = text1.isEmpty ? 0.0 : 8.0
}
self.detailLabel.snp.updateConstraints { make in
make.top.equalTo(self.professionalLabel.snp.bottom).offset(top2Margin)
}
self.setNeedsLayout()
self.layoutIfNeeded()
}
}
......@@ -227,7 +241,6 @@ class YHMyNameCardAvatarInfoCell: UITableViewCell {
self.professionalLabel.snp.makeConstraints { make in
make.left.equalTo(16)
make.right.equalTo(-16)
// make.height.equalTo(20)
make.top.equalTo(self.nameTextView.snp.bottom).offset(0)
}
......@@ -235,7 +248,6 @@ class YHMyNameCardAvatarInfoCell: UITableViewCell {
make.left.equalTo(16)
make.right.equalTo(-16)
make.top.equalTo(self.professionalLabel.snp.bottom).offset(8)
// make.height.equalTo(18)
make.bottom.equalTo(-16)
}
......
......@@ -19,6 +19,8 @@ class YHNameCardInfoView: DragCardView {
didSet {
if let url = URL(string: self.userModel.avatar) {
self.headImgV.kf.setImage(with: url, placeholder: UIImage(named: "people_head_default"))
} else {
self.headImgV.image = UIImage(named: "people_head_default")
}
self.nameLabel.text = self.userModel.username
var result = ""
......@@ -84,7 +86,7 @@ class YHNameCardInfoView: DragCardView {
lazy var headImgV:UIImageView = {
let view = UIImageView()
view.image = UIImage(named: "")
view.image = UIImage(named: "people_head_default")
view.layer.cornerRadius = 98.0/2.0
view.clipsToBounds = true
return view
......
......@@ -222,7 +222,11 @@ extension YHFileRenameInputView: UITextFieldDelegate {
let newText = (textField.text! as NSString).replacingCharacters(in: range, with: string)
if newText.count > self.maxWordsCount {
YHHUD.flash(message: "重命名限制最多\(maxWordsCount)个字符")
if maxWordsCount == 30 {
YHHUD.flash(message: "重命名限制最多\(maxWordsCount)个字符")
} else {
YHHUD.flash(message: "自定义标签限制最多\(maxWordsCount)个字符")
}
return false
}
return true
......
......@@ -289,7 +289,7 @@ extension YHMyViewController : UITableViewDelegate, UITableViewDataSource {
switch item.type {
case .myCard://我的名片
if let userId = YHLoginManager.shared.userModel?.id, !userId.isEmpty {
let vc = YHMyNameCardViewController()
let vc = YHNameCardViewController()
vc.userId = userId
self.navigationController?.pushViewController(vc)
} else {
......@@ -300,7 +300,7 @@ extension YHMyViewController : UITableViewDelegate, UITableViewDataSource {
guard let self = self else { return }
if !uid.isEmpty {
YHLoginManager.shared.userModel?.id = uid
let vc = YHMyNameCardViewController()
let vc = YHNameCardViewController()
vc.userId = uid
self.navigationController?.pushViewController(vc)
}
......
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