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

// 人脉

parent 2fd39f3a
......@@ -219,10 +219,21 @@ extension YHPeopleViewController {
success, error in
self.rotateLottieView.stop()
let vc = YHMatchPeopleViewController()
vc.delegate = self
vc.matchUsersArr = self.viewModel.matchUserArr
self.navigationController?.pushViewController(vc)
if success, self.viewModel.matchUserArr.count > 0 {
let vc = YHMatchPeopleViewController()
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 {
guard let keyboardFrame = (notification.userInfo?[UIResponder.keyboardFrameEndUserInfoKey] as AnyObject).cgRectValue else {return }
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
make.bottom.equalToSuperview().offset(-bottomMargin)
}
......
......@@ -12,7 +12,6 @@ import UIKit
class YHTopicItemCell: UICollectionViewCell {
static let cellReuseIdentifier = "YHTopicItemCell"
lazy var titleLabel: UILabel = {
var label = UILabel()
label.font = .PFSC_R(ofSize: 12)
......@@ -50,7 +49,7 @@ class YHMyInterestTopicCell: UITableViewCell {
typealias EditBlock = () -> ()
var editBlock: EditBlock?
static let cellReuseIdentifier = "YHMyInterestTopicCell"
weak var tableView: UITableView?
var topicArr:[String] = []
var userModel:YHUserNameCardInfo = YHUserNameCardInfo() {
didSet {
......@@ -72,24 +71,23 @@ class YHMyInterestTopicCell: UITableViewCell {
if self.userModel.topics.count > 0 {
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 {
let height = self.collectionView.contentSize.height
self.collectionView.snp.updateConstraints { make in
make.height.equalTo(height)
}
DispatchQueue.main.asyncAfter(deadline: .now() + 0.5, execute: {
let height = self.collectionView.contentSize.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 {
self.detailLabel.snp.remakeConstraints { make in
......@@ -98,10 +96,10 @@ class YHMyInterestTopicCell: UITableViewCell {
make.bottom.equalTo(-16)
make.top.equalTo(titleLabel.snp.bottom).offset(12)
}
self.collectionView.snp.remakeConstraints { make in
make.edges.equalTo(self.detailLabel)
}
self.collectionView.snp.removeConstraints()
}
self.setNeedsLayout()
self.layoutIfNeeded()
}
}
......
......@@ -71,7 +71,7 @@ class YHMyNameCardAvatarInfoCell: UITableViewCell {
lazy var headImgV:UIImageView = {
let view = UIImageView()
view.image = UIImage(named: "people_head_default")
view.layer.cornerRadius = 74.0/2.0
view.layer.cornerRadius = headWidth/2.0
view.clipsToBounds = true
return view
}()
......
......@@ -21,7 +21,32 @@ class YHNameCardInfoView: DragCardView {
self.headImgV.kf.setImage(with: url, placeholder: UIImage(named: "people_head_default"))
}
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.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