Commit b0d19ba9 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:
  //  人脉
  //  人脉
  //  model 找不到
  // 人脉
parents 21333ce7 cdffd9d4
This diff is collapsed.
...@@ -16,6 +16,7 @@ protocol YHMatchProtocol: NSObjectProtocol { ...@@ -16,6 +16,7 @@ protocol YHMatchProtocol: NSObjectProtocol {
class YHMatchPeopleViewController: YHBaseViewController { class YHMatchPeopleViewController: YHBaseViewController {
let viewModel = YHMatchUserViewModel() let viewModel = YHMatchUserViewModel()
let loginViewModel = YHLoginViewModel()
var matchUsersArr:[YHMatchUserInfo?] = [] var matchUsersArr:[YHMatchUserInfo?] = []
weak var delegate: YHMatchProtocol? weak var delegate: YHMatchProtocol?
lazy var bgImgV:UIImageView = { lazy var bgImgV:UIImageView = {
...@@ -151,12 +152,30 @@ class YHMatchPeopleViewController: YHBaseViewController { ...@@ -151,12 +152,30 @@ class YHMatchPeopleViewController: YHBaseViewController {
} }
@objc func didMyCardBtnClicked() { @objc func didMyCardBtnClicked() {
let vc = YHMyNameCardViewController()
if !YHLoginManager.shared.isLogin() {
YHOneKeyLoginManager.shared.oneKeyLogin()
return
}
if let userId = YHLoginManager.shared.userModel?.id, !userId.isEmpty { if let userId = YHLoginManager.shared.userModel?.id, !userId.isEmpty {
let vc = YHMyNameCardViewController()
vc.userId = userId vc.userId = userId
self.navigationController?.pushViewController(vc)
} else {
YHHUD.show(.progress(message: "加载中..."))
self.loginViewModel.getUserId {
[weak self] uid in
YHHUD.hide()
guard let self = self else { return }
if !uid.isEmpty {
YHLoginManager.shared.userModel?.id = uid
let vc = YHMyNameCardViewController()
vc.userId = uid
self.navigationController?.pushViewController(vc)
}
}
} }
self.navigationController?.pushViewController(vc)
} }
@objc func didRematchBtnClicked() { @objc func didRematchBtnClicked() {
......
...@@ -115,8 +115,7 @@ extension YHMyGoodFriendsVC: UITableViewDelegate, UITableViewDataSource { ...@@ -115,8 +115,7 @@ extension YHMyGoodFriendsVC: UITableViewDelegate, UITableViewDataSource {
YHHUD.hide() YHHUD.hide()
guard let self = self else { return } guard let self = self else { return }
if success { if success {
self.friendRequestArr.removeFirst() self.requestFriendList()
self.tableView.reloadData()
} else { } else {
var msg = "处理失败" var msg = "处理失败"
if let errMsg = error?.errorMsg, !errMsg.isEmpty { if let errMsg = error?.errorMsg, !errMsg.isEmpty {
......
...@@ -69,6 +69,7 @@ class YHMyNameCardViewController: YHBaseViewController { ...@@ -69,6 +69,7 @@ class YHMyNameCardViewController: YHBaseViewController {
vc.stepFlag = false vc.stepFlag = false
self.navigationController?.pushViewController(vc) self.navigationController?.pushViewController(vc)
} }
bar.rightButton.isHidden = !self.isCurrentUser
return bar return bar
}() }()
......
...@@ -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()
}
} }
} }
......
...@@ -45,6 +45,7 @@ class YHFriendRequestView: UIView { ...@@ -45,6 +45,7 @@ class YHFriendRequestView: UIView {
lazy var headImgV:UIImageView = { lazy var headImgV:UIImageView = {
let view = UIImageView() let view = UIImageView()
view.layer.cornerRadius = 23.0 view.layer.cornerRadius = 23.0
view.clipsToBounds = true
return view return view
}() }()
...@@ -266,7 +267,7 @@ class YHFriendRequestView: UIView { ...@@ -266,7 +267,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)
...@@ -51,6 +76,15 @@ class YHNameCardInfoView: DragCardView { ...@@ -51,6 +76,15 @@ class YHNameCardInfoView: DragCardView {
return view return view
}() }()
lazy var headBgImgV:UIImageView = {
let view = UIImageView()
view.image = UIImage(named: "people_user_head_bg")
view.layer.cornerRadius = (98.0+10)/2.0
return view
}()
lazy var signImgV:UIImageView = { lazy var signImgV:UIImageView = {
let view = UIImageView() let view = UIImageView()
view.image = UIImage(named: "people_sign") view.image = UIImage(named: "people_sign")
...@@ -142,6 +176,7 @@ class YHNameCardInfoView: DragCardView { ...@@ -142,6 +176,7 @@ class YHNameCardInfoView: DragCardView {
private func setupUI() { private func setupUI() {
self.contentView.addSubview(self.bgImgV) self.contentView.addSubview(self.bgImgV)
self.contentView.addSubview(self.headBgImgV)
self.contentView.addSubview(self.headImgV) self.contentView.addSubview(self.headImgV)
self.contentView.addSubview(self.signImgV) self.contentView.addSubview(self.signImgV)
self.contentView.addSubview(self.nameLabel) self.contentView.addSubview(self.nameLabel)
...@@ -160,6 +195,10 @@ class YHNameCardInfoView: DragCardView { ...@@ -160,6 +195,10 @@ class YHNameCardInfoView: DragCardView {
make.centerX.equalToSuperview() make.centerX.equalToSuperview()
make.bottom.equalTo(self.bgImgV).offset(20) make.bottom.equalTo(self.bgImgV).offset(20)
} }
self.headBgImgV.snp.makeConstraints { make in
make.width.height.equalTo(98+6)
make.center.equalTo(self.headImgV)
}
self.signImgV.snp.makeConstraints { make in self.signImgV.snp.makeConstraints { make in
make.centerX.equalTo(self.headImgV) make.centerX.equalTo(self.headImgV)
......
...@@ -185,4 +185,23 @@ extension YHLoginViewModel { ...@@ -185,4 +185,23 @@ extension YHLoginViewModel {
callBackBlock(false,err) callBackBlock(false,err)
} }
} }
func getUserId(callBack: ((String)->())?) {
let strUrl = YHBaseUrlManager.shared.curURL() + YHAllApiName.Auth.getUidApi
let _ = YHNetRequest.getRequest(url: strUrl) {
[weak self] json, code in
//1. json字符串 转 对象
guard let self = self else { return }
printLog(json)
if let dic = json.data as? [AnyHashable : Any] {
if let uid = dic["id"] as? String {
callBack?(uid)
return
}
}
callBack?("")
} failBlock: { err in
callBack?("")
}
}
} }
...@@ -53,7 +53,8 @@ class YHMyViewController: YHBaseViewController, ConstraintRelatableTarget { ...@@ -53,7 +53,8 @@ class YHMyViewController: YHBaseViewController, ConstraintRelatableTarget {
let likeViewModel: YHMyLikeViewModel = YHMyLikeViewModel() let likeViewModel: YHMyLikeViewModel = YHMyLikeViewModel()
let msgViewModel: YHMsgViewModel = YHMsgViewModel() let msgViewModel: YHMsgViewModel = YHMsgViewModel()
let loginViewModel = YHLoginViewModel()
lazy var tableView: UITableView = { lazy var tableView: UITableView = {
let tableView = UITableView(frame: CGRect.zero, style:.grouped) let tableView = UITableView(frame: CGRect.zero, style:.grouped)
tableView.contentInsetAdjustmentBehavior = .never tableView.contentInsetAdjustmentBehavior = .never
...@@ -287,11 +288,24 @@ extension YHMyViewController : UITableViewDelegate, UITableViewDataSource { ...@@ -287,11 +288,24 @@ extension YHMyViewController : UITableViewDelegate, UITableViewDataSource {
let item: PersonalModuleItem = items[indexPath.row] let item: PersonalModuleItem = items[indexPath.row]
switch item.type { switch item.type {
case .myCard://我的名片 case .myCard://我的名片
let vc = YHMyNameCardViewController()
if let userId = YHLoginManager.shared.userModel?.id, !userId.isEmpty { if let userId = YHLoginManager.shared.userModel?.id, !userId.isEmpty {
let vc = YHMyNameCardViewController()
vc.userId = userId vc.userId = userId
self.navigationController?.pushViewController(vc)
} else {
YHHUD.show(.progress(message: "加载中..."))
self.loginViewModel.getUserId {
[weak self] uid in
YHHUD.hide()
guard let self = self else { return }
if !uid.isEmpty {
YHLoginManager.shared.userModel?.id = uid
let vc = YHMyNameCardViewController()
vc.userId = uid
self.navigationController?.pushViewController(vc)
}
}
} }
self.navigationController?.pushViewController(vc)
case .myMessage://我的消息 case .myMessage://我的消息
printLog("我的消息") printLog("我的消息")
let vc = YHMessageListVC() let vc = YHMessageListVC()
......
...@@ -204,6 +204,7 @@ class YHAllApiName { ...@@ -204,6 +204,7 @@ class YHAllApiName {
static let appleLogin = "infoflow/auth/apple-login" static let appleLogin = "infoflow/auth/apple-login"
static let oneKeySecretKeyInfo = "infoflow/auth/sdk-info" static let oneKeySecretKeyInfo = "infoflow/auth/sdk-info"
static let logout = "infoflow/auth/logout" static let logout = "infoflow/auth/logout"
static let getUidApi = "super-app/get-uid"
//注销app //注销app
static let unregisterApi = "infoflow/auth/cancellation" static let unregisterApi = "infoflow/auth/cancellation"
} }
......
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "image 1760@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "image 1760@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