Commit 8d93d41c authored by Steven杜宇's avatar Steven杜宇

// 名片

parent ecc5dafd
......@@ -67,17 +67,14 @@ class YHMatchUserAddress: SmartCodable {
class YHAuthorizationModel: SmartCodable {
var educationExperience: Int = 0
var workExperience: Int = 0
var public_education_experience: Int = 0
var public_work_experience: Int = 0
var friend_education_experience: Int = 0
var friend_work_experience: Int = 0
required init() {
}
enum CodingKeys: String, CodingKey {
case educationExperience = "public_education_experience"
case workExperience = "public_work_experience"
}
}
enum YHNameCardInfoType: Int {
......@@ -118,12 +115,12 @@ class YHUserNameCardInfo: SmartCodable {
var isHiddenEducation: Bool {
get {
return self.authorization.educationExperience != 2
return self.authorization.public_education_experience != 2 || self.authorization.friend_education_experience != 2
}
}
var isHiddenWorkExperience: Bool {
get {
return self.authorization.workExperience != 2
return self.authorization.public_work_experience != 2 || self.authorization.friend_work_experience != 2
}
}
......@@ -150,8 +147,8 @@ class YHUserNameCardInfo: SmartCodable {
self.position = model.position
self.industry = model.industry
self.honor = model.honor
self.authorization.educationExperience = model.authorization.educationExperience
self.authorization.workExperience = model.authorization.workExperience
self.authorization.public_education_experience = model.authorization.public_education_experience
self.authorization.public_work_experience = model.authorization.public_work_experience
self.topics.removeAll()
self.topics.append(contentsOf: model.topics)
}
......
......@@ -103,7 +103,9 @@ class YHNameCardHomePageViewController: YHBaseViewController {
// 教育经历信息
var isShowEducation = true
if !self.isCurrentUser {
isShowEducation = !self.viewModel.nameCardInfo.isHiddenEducation
let isFriend = self.viewModel.nameCardInfo.type == YHContactRelation.friend.rawValue
isShowEducation = (isFriend && self.viewModel.nameCardInfo.authorization.friend_education_experience == 2) || (!isFriend && self.viewModel.nameCardInfo.authorization.public_education_experience == 2)
if isShowEducation {
isShowEducation = (!self.viewModel.nameCardInfo.college.isEmpty || !self.viewModel.nameCardInfo.background.isEmpty || !self.viewModel.nameCardInfo.major.isEmpty)
}
......@@ -119,7 +121,9 @@ class YHNameCardHomePageViewController: YHBaseViewController {
// 工作经历信息
var isShowWorkExperience = true
if !self.isCurrentUser {
isShowWorkExperience = !self.viewModel.nameCardInfo.isHiddenWorkExperience
let isFriend = self.viewModel.nameCardInfo.type == YHContactRelation.friend.rawValue
isShowWorkExperience = (isFriend && self.viewModel.nameCardInfo.authorization.friend_work_experience == 2) || (!isFriend && self.viewModel.nameCardInfo.authorization.public_work_experience == 2)
if isShowWorkExperience {
isShowWorkExperience = (!self.viewModel.nameCardInfo.companyName.isEmpty || !self.viewModel.nameCardInfo.position.isEmpty || !self.viewModel.nameCardInfo.industry.isEmpty)
}
......
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