Commit f07c32c1 authored by Steven杜宇's avatar Steven杜宇

// 人脉

parent 2fd39f3a
...@@ -219,10 +219,21 @@ extension YHPeopleViewController { ...@@ -219,10 +219,21 @@ extension YHPeopleViewController {
success, error in success, error in
self.rotateLottieView.stop() self.rotateLottieView.stop()
let vc = YHMatchPeopleViewController()
vc.delegate = self if success, self.viewModel.matchUserArr.count > 0 {
vc.matchUsersArr = self.viewModel.matchUserArr let vc = YHMatchPeopleViewController()
self.navigationController?.pushViewController(vc) vc.delegate = self
vc.matchUsersArr = self.viewModel.matchUserArr
self.navigationController?.pushViewController(vc)
} else {
var msg = "匹配失败"
if let errorMsg = error?.errorMsg, !errorMsg.isEmpty {
msg = errorMsg
}
YHHUD.flash(message: msg)
self.resetAnimation()
}
} }
} }
......
...@@ -266,7 +266,7 @@ class YHFriendRequestView: UIView { ...@@ -266,7 +266,7 @@ class YHFriendRequestView: UIView {
guard let keyboardFrame = (notification.userInfo?[UIResponder.keyboardFrameEndUserInfoKey] as AnyObject).cgRectValue else {return } guard let keyboardFrame = (notification.userInfo?[UIResponder.keyboardFrameEndUserInfoKey] as AnyObject).cgRectValue else {return }
let isKeyboardShow = notification.name == UIResponder.keyboardWillShowNotification let isKeyboardShow = notification.name == UIResponder.keyboardWillShowNotification
let bottomMargin = (isKeyboardShow ? keyboardFrame.height : (KScreenHeight-YHFriendRequestView.cardHeight)/2.0) let bottomMargin = (isKeyboardShow ? keyboardFrame.height+10 : (KScreenHeight-YHFriendRequestView.cardHeight)/2.0)
self.cardView.snp.updateConstraints { make in self.cardView.snp.updateConstraints { make in
make.bottom.equalToSuperview().offset(-bottomMargin) make.bottom.equalToSuperview().offset(-bottomMargin)
} }
......
...@@ -12,7 +12,6 @@ import UIKit ...@@ -12,7 +12,6 @@ import UIKit
class YHTopicItemCell: UICollectionViewCell { class YHTopicItemCell: UICollectionViewCell {
static let cellReuseIdentifier = "YHTopicItemCell" static let cellReuseIdentifier = "YHTopicItemCell"
lazy var titleLabel: UILabel = { lazy var titleLabel: UILabel = {
var label = UILabel() var label = UILabel()
label.font = .PFSC_R(ofSize: 12) label.font = .PFSC_R(ofSize: 12)
...@@ -50,7 +49,7 @@ class YHMyInterestTopicCell: UITableViewCell { ...@@ -50,7 +49,7 @@ class YHMyInterestTopicCell: UITableViewCell {
typealias EditBlock = () -> () typealias EditBlock = () -> ()
var editBlock: EditBlock? var editBlock: EditBlock?
static let cellReuseIdentifier = "YHMyInterestTopicCell" static let cellReuseIdentifier = "YHMyInterestTopicCell"
weak var tableView: UITableView?
var topicArr:[String] = [] var topicArr:[String] = []
var userModel:YHUserNameCardInfo = YHUserNameCardInfo() { var userModel:YHUserNameCardInfo = YHUserNameCardInfo() {
didSet { didSet {
...@@ -72,24 +71,23 @@ class YHMyInterestTopicCell: UITableViewCell { ...@@ -72,24 +71,23 @@ class YHMyInterestTopicCell: UITableViewCell {
if self.userModel.topics.count > 0 { if self.userModel.topics.count > 0 {
self.topicArr.append(contentsOf: self.userModel.topics) self.topicArr.append(contentsOf: self.userModel.topics)
} }
self.collectionView.snp.remakeConstraints { make in
make.left.equalTo(16)
make.right.equalTo(-16)
make.bottom.equalTo(-16)
make.height.equalTo(24)
make.top.equalTo(titleLabel.snp.bottom).offset(12)
}
self.detailLabel.snp.remakeConstraints { make in
make.edges.equalTo(self.collectionView)
}
self.collectionView.reloadData { self.collectionView.reloadData {
let height = self.collectionView.contentSize.height DispatchQueue.main.asyncAfter(deadline: .now() + 0.5, execute: {
self.collectionView.snp.updateConstraints { make in let height = self.collectionView.contentSize.height
make.height.equalTo(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.removeConstraints()
self.superview?.setNeedsLayout()
self.superview?.layoutIfNeeded()
})
} }
} else { } else {
self.detailLabel.snp.remakeConstraints { make in self.detailLabel.snp.remakeConstraints { make in
...@@ -98,10 +96,10 @@ class YHMyInterestTopicCell: UITableViewCell { ...@@ -98,10 +96,10 @@ class YHMyInterestTopicCell: UITableViewCell {
make.bottom.equalTo(-16) make.bottom.equalTo(-16)
make.top.equalTo(titleLabel.snp.bottom).offset(12) make.top.equalTo(titleLabel.snp.bottom).offset(12)
} }
self.collectionView.snp.remakeConstraints { make in self.collectionView.snp.removeConstraints()
make.edges.equalTo(self.detailLabel)
}
} }
self.setNeedsLayout()
self.layoutIfNeeded()
} }
} }
......
...@@ -71,7 +71,7 @@ class YHMyNameCardAvatarInfoCell: UITableViewCell { ...@@ -71,7 +71,7 @@ class YHMyNameCardAvatarInfoCell: UITableViewCell {
lazy var headImgV:UIImageView = { lazy var headImgV:UIImageView = {
let view = UIImageView() let view = UIImageView()
view.image = UIImage(named: "people_head_default") view.image = UIImage(named: "people_head_default")
view.layer.cornerRadius = 74.0/2.0 view.layer.cornerRadius = headWidth/2.0
view.clipsToBounds = true view.clipsToBounds = true
return view return view
}() }()
......
...@@ -21,7 +21,32 @@ class YHNameCardInfoView: DragCardView { ...@@ -21,7 +21,32 @@ class YHNameCardInfoView: DragCardView {
self.headImgV.kf.setImage(with: url, placeholder: UIImage(named: "people_head_default")) self.headImgV.kf.setImage(with: url, placeholder: UIImage(named: "people_head_default"))
} }
self.nameLabel.text = self.userModel.username self.nameLabel.text = self.userModel.username
self.professionalLabel.text = self.userModel.position var result = ""
var isFirst = true
if !self.userModel.address.city.isEmpty {
if isFirst {
result += self.userModel.address.city
isFirst = false
}
}
if !self.userModel.position.isEmpty {
if isFirst {
result += self.userModel.position
isFirst = false
} else {
result += " | " + self.userModel.position
}
}
if !self.userModel.industry.isEmpty {
if isFirst {
result += self.userModel.industry
isFirst = false
} else {
result += " | " + self.userModel.industry
}
}
self.professionalLabel.text = result
self.detailLabel.text = self.userModel.signature self.detailLabel.text = self.userModel.signature
self.signImgV.isHidden = (self.userModel.isSign != 1) self.signImgV.isHidden = (self.userModel.isSign != 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