Commit 2f548844 authored by Steven杜宇's avatar Steven杜宇

// 人脉

parent f07d7667
This diff is collapsed.
...@@ -131,7 +131,7 @@ class YHCommunityViewController: YHBaseViewController { ...@@ -131,7 +131,7 @@ class YHCommunityViewController: YHBaseViewController {
let vc = YHActivityListViewController() let vc = YHActivityListViewController()
arrItemVCs.append(vc) arrItemVCs.append(vc)
} else { } else {
let vc = YHPeopleViewController() let vc = YHMatchUserViewController()
arrItemVCs.append(vc) arrItemVCs.append(vc)
} }
} }
......
...@@ -13,7 +13,7 @@ protocol YHMatchProtocol: NSObjectProtocol { ...@@ -13,7 +13,7 @@ protocol YHMatchProtocol: NSObjectProtocol {
func startMatchUsers() func startMatchUsers()
} }
class YHMatchPeopleViewController: YHBaseViewController { class YHMatchResultListViewController: YHBaseViewController {
let viewModel = YHMatchUserViewModel() let viewModel = YHMatchUserViewModel()
let loginViewModel = YHLoginViewModel() let loginViewModel = YHLoginViewModel()
...@@ -159,7 +159,7 @@ class YHMatchPeopleViewController: YHBaseViewController { ...@@ -159,7 +159,7 @@ class YHMatchPeopleViewController: YHBaseViewController {
} }
if let userId = YHLoginManager.shared.userModel?.id, !userId.isEmpty { if let userId = YHLoginManager.shared.userModel?.id, !userId.isEmpty {
let vc = YHMyNameCardViewController() let vc = YHNameCardViewController()
vc.userId = userId vc.userId = userId
self.navigationController?.pushViewController(vc) self.navigationController?.pushViewController(vc)
} else { } else {
...@@ -170,7 +170,7 @@ class YHMatchPeopleViewController: YHBaseViewController { ...@@ -170,7 +170,7 @@ class YHMatchPeopleViewController: YHBaseViewController {
guard let self = self else { return } guard let self = self else { return }
if !uid.isEmpty { if !uid.isEmpty {
YHLoginManager.shared.userModel?.id = uid YHLoginManager.shared.userModel?.id = uid
let vc = YHMyNameCardViewController() let vc = YHNameCardViewController()
vc.userId = uid vc.userId = uid
self.navigationController?.pushViewController(vc) self.navigationController?.pushViewController(vc)
} }
...@@ -347,7 +347,7 @@ class YHMatchPeopleViewController: YHBaseViewController { ...@@ -347,7 +347,7 @@ class YHMatchPeopleViewController: YHBaseViewController {
} }
} }
extension YHMatchPeopleViewController: DragCardDataSource { extension YHMatchResultListViewController: DragCardDataSource {
public func numberOfCards(_ dragCard: DragCardContainer) -> Int { public func numberOfCards(_ dragCard: DragCardContainer) -> Int {
return matchUsersArr.count return matchUsersArr.count
...@@ -384,7 +384,7 @@ extension YHMatchPeopleViewController: DragCardDataSource { ...@@ -384,7 +384,7 @@ extension YHMatchPeopleViewController: DragCardDataSource {
} }
} }
extension YHMatchPeopleViewController: DragCardDelegate { extension YHMatchResultListViewController: DragCardDelegate {
public func dragCard(_ dragCard: DragCardContainer, displayTopCardAt index: Int, with cardView: DragCardView) { public func dragCard(_ dragCard: DragCardContainer, displayTopCardAt index: Int, with cardView: DragCardView) {
print("displayTopCardAt: \(index)") print("displayTopCardAt: \(index)")
......
...@@ -10,7 +10,7 @@ import UIKit ...@@ -10,7 +10,7 @@ import UIKit
import JXSegmentedView import JXSegmentedView
import Lottie import Lottie
class YHPeopleViewController: YHBaseViewController { class YHMatchUserViewController: YHBaseViewController {
let viewModel = YHMatchUserViewModel() let viewModel = YHMatchUserViewModel()
var informationAuthorizeViewModel: YHInformationAuthorizeViewModel = YHInformationAuthorizeViewModel() var informationAuthorizeViewModel: YHInformationAuthorizeViewModel = YHInformationAuthorizeViewModel()
...@@ -186,13 +186,13 @@ class YHPeopleViewController: YHBaseViewController { ...@@ -186,13 +186,13 @@ class YHPeopleViewController: YHBaseViewController {
} }
} }
extension YHPeopleViewController: JXSegmentedListContainerViewListDelegate { extension YHMatchUserViewController: JXSegmentedListContainerViewListDelegate {
func listView() -> UIView { func listView() -> UIView {
return view return view
} }
} }
extension YHPeopleViewController: YHMatchProtocol { extension YHMatchUserViewController: YHMatchProtocol {
func startMatchUsers() { func startMatchUsers() {
self.headLottieView.isHidden = true self.headLottieView.isHidden = true
self.launchLottieView.isHidden = false self.launchLottieView.isHidden = false
...@@ -209,13 +209,13 @@ extension YHPeopleViewController: YHMatchProtocol { ...@@ -209,13 +209,13 @@ extension YHPeopleViewController: YHMatchProtocol {
} }
} }
extension YHPeopleViewController { extension YHMatchUserViewController {
func requestMatchUserList() { func requestMatchUserList() {
self.viewModel.getMatchUserlist { self.viewModel.getMatchUserlist {
success, error in success, error in
if success, self.viewModel.matchUserArr.count > 0 { if success, self.viewModel.matchUserArr.count > 0 {
let vc = YHMatchPeopleViewController() let vc = YHMatchResultListViewController()
vc.delegate = self vc.delegate = self
vc.matchUsersArr = self.viewModel.matchUserArr vc.matchUsersArr = self.viewModel.matchUserArr
self.navigationController?.pushViewController(vc) self.navigationController?.pushViewController(vc)
......
...@@ -151,7 +151,7 @@ extension YHMyGoodFriendsVC: UITableViewDelegate, UITableViewDataSource { ...@@ -151,7 +151,7 @@ extension YHMyGoodFriendsVC: UITableViewDelegate, UITableViewDataSource {
if indexPath.section == 1 { if indexPath.section == 1 {
if 0 <= indexPath.row && indexPath.row < friendsArr.count { if 0 <= indexPath.row && indexPath.row < friendsArr.count {
let friend = self.friendsArr[indexPath.row] let friend = self.friendsArr[indexPath.row]
let vc = YHMyNameCardViewController() let vc = YHNameCardViewController()
vc.userId = friend.yhId vc.userId = friend.yhId
self.navigationController?.pushViewController(vc) self.navigationController?.pushViewController(vc)
} }
......
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
import UIKit import UIKit
class YHMyNameCardViewController: YHBaseViewController { class YHNameCardViewController: YHBaseViewController {
var userId: String = "" var userId: String = ""
var cardInfoArr:[YHUserNameCardInfo] = [] var cardInfoArr:[YHUserNameCardInfo] = []
...@@ -46,7 +46,7 @@ class YHMyNameCardViewController: YHBaseViewController { ...@@ -46,7 +46,7 @@ class YHMyNameCardViewController: YHBaseViewController {
lazy var navBar: YHCustomNavigationBar = { lazy var navBar: YHCustomNavigationBar = {
let bar = YHCustomNavigationBar.navBar() let bar = YHCustomNavigationBar.navBar()
bar.backgroundColor = .clear bar.backgroundColor = .clear
bar.title = "我的名片" bar.title = self.isCurrentUser ? "我的名片" : "好友名片"
bar.titleColor = .white bar.titleColor = .white
bar.rightButton.setImage(UIImage(named: "people_card_authorized"), for: .normal) bar.rightButton.setImage(UIImage(named: "people_card_authorized"), for: .normal)
bar.rightButton.setTitle("授权", for: .normal) bar.rightButton.setTitle("授权", for: .normal)
...@@ -111,7 +111,7 @@ class YHMyNameCardViewController: YHBaseViewController { ...@@ -111,7 +111,7 @@ class YHMyNameCardViewController: YHBaseViewController {
} }
} }
extension YHMyNameCardViewController: UITableViewDelegate, UITableViewDataSource { extension YHNameCardViewController: UITableViewDelegate, UITableViewDataSource {
func numberOfSections(in tableView: UITableView) -> Int { func numberOfSections(in tableView: UITableView) -> Int {
return self.cardInfoArr.count return self.cardInfoArr.count
...@@ -230,7 +230,7 @@ extension YHMyNameCardViewController: UITableViewDelegate, UITableViewDataSource ...@@ -230,7 +230,7 @@ extension YHMyNameCardViewController: UITableViewDelegate, UITableViewDataSource
} }
extension YHMyNameCardViewController { extension YHNameCardViewController {
func requestAuthorization() { func requestAuthorization() {
self.authorModel.requestUserAuthorization { success, error in self.authorModel.requestUserAuthorization { success, error in
...@@ -258,18 +258,21 @@ extension YHMyNameCardViewController { ...@@ -258,18 +258,21 @@ extension YHMyNameCardViewController {
self.cardInfoArr.removeAll() self.cardInfoArr.removeAll()
// 姓名头像信息
let model1 = YHUserNameCardInfo() let model1 = YHUserNameCardInfo()
model1.type = .avatar model1.type = .avatar
model1.isCurrentUser = self.isCurrentUser model1.isCurrentUser = self.isCurrentUser
model1.updateModel(self.viewModel.nameCardInfo) model1.updateModel(self.viewModel.nameCardInfo)
self.cardInfoArr.append(model1) self.cardInfoArr.append(model1)
// 个人简介信息
let model2 = YHUserNameCardInfo() let model2 = YHUserNameCardInfo()
model2.type = .introduce model2.type = .introduce
model2.isCurrentUser = self.isCurrentUser model2.isCurrentUser = self.isCurrentUser
model2.updateModel(self.viewModel.nameCardInfo) model2.updateModel(self.viewModel.nameCardInfo)
self.cardInfoArr.append(model2) self.cardInfoArr.append(model2)
// 教育经历信息
if !self.isCurrentUser { if !self.isCurrentUser {
if !self.viewModel.nameCardInfo.isHiddenEducation { if !self.viewModel.nameCardInfo.isHiddenEducation {
let model3 = YHUserNameCardInfo() let model3 = YHUserNameCardInfo()
...@@ -286,6 +289,8 @@ extension YHMyNameCardViewController { ...@@ -286,6 +289,8 @@ extension YHMyNameCardViewController {
self.cardInfoArr.append(model3) self.cardInfoArr.append(model3)
} }
// 工作经历信息
if !self.isCurrentUser { if !self.isCurrentUser {
if !self.viewModel.nameCardInfo.isHiddenWorkExperience { if !self.viewModel.nameCardInfo.isHiddenWorkExperience {
let model4 = YHUserNameCardInfo() let model4 = YHUserNameCardInfo()
...@@ -302,12 +307,14 @@ extension YHMyNameCardViewController { ...@@ -302,12 +307,14 @@ extension YHMyNameCardViewController {
self.cardInfoArr.append(model4) self.cardInfoArr.append(model4)
} }
// 荣誉奖项信息
let model5 = YHUserNameCardInfo() let model5 = YHUserNameCardInfo()
model5.type = .honor model5.type = .honor
model5.isCurrentUser = self.isCurrentUser model5.isCurrentUser = self.isCurrentUser
model5.updateModel(self.viewModel.nameCardInfo) model5.updateModel(self.viewModel.nameCardInfo)
self.cardInfoArr.append(model5) self.cardInfoArr.append(model5)
// 兴趣话题
let model6 = YHUserNameCardInfo() let model6 = YHUserNameCardInfo()
model6.type = .topics model6.type = .topics
model6.isCurrentUser = self.isCurrentUser model6.isCurrentUser = self.isCurrentUser
......
...@@ -289,7 +289,7 @@ extension YHMyViewController : UITableViewDelegate, UITableViewDataSource { ...@@ -289,7 +289,7 @@ extension YHMyViewController : UITableViewDelegate, UITableViewDataSource {
switch item.type { switch item.type {
case .myCard://我的名片 case .myCard://我的名片
if let userId = YHLoginManager.shared.userModel?.id, !userId.isEmpty { if let userId = YHLoginManager.shared.userModel?.id, !userId.isEmpty {
let vc = YHMyNameCardViewController() let vc = YHNameCardViewController()
vc.userId = userId vc.userId = userId
self.navigationController?.pushViewController(vc) self.navigationController?.pushViewController(vc)
} else { } else {
...@@ -300,7 +300,7 @@ extension YHMyViewController : UITableViewDelegate, UITableViewDataSource { ...@@ -300,7 +300,7 @@ extension YHMyViewController : UITableViewDelegate, UITableViewDataSource {
guard let self = self else { return } guard let self = self else { return }
if !uid.isEmpty { if !uid.isEmpty {
YHLoginManager.shared.userModel?.id = uid YHLoginManager.shared.userModel?.id = uid
let vc = YHMyNameCardViewController() let vc = YHNameCardViewController()
vc.userId = uid vc.userId = uid
self.navigationController?.pushViewController(vc) 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