Commit 2fd39f3a 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:
  首次提示
  //  我的名片
  细节调整
  //  好友未读消息
  //  人脉
  //  人脉
  人脉信息成功页面
  人脉首页逻辑
  //  人脉
  编辑接口调试
  // 人脉
parents 44f4e65a 3ada6188
...@@ -72,6 +72,7 @@ ...@@ -72,6 +72,7 @@
044D0C1C2C22C30B00C5CF5E /* YHEditSchoolViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 044D0C1B2C22C30B00C5CF5E /* YHEditSchoolViewController.swift */; }; 044D0C1C2C22C30B00C5CF5E /* YHEditSchoolViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 044D0C1B2C22C30B00C5CF5E /* YHEditSchoolViewController.swift */; };
044D0C1E2C22CFBF00C5CF5E /* YHEditWorkViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 044D0C1D2C22CFBF00C5CF5E /* YHEditWorkViewController.swift */; }; 044D0C1E2C22CFBF00C5CF5E /* YHEditWorkViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 044D0C1D2C22CFBF00C5CF5E /* YHEditWorkViewController.swift */; };
044D0C202C22D37500C5CF5E /* YHEditHonorViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 044D0C1F2C22D37500C5CF5E /* YHEditHonorViewController.swift */; }; 044D0C202C22D37500C5CF5E /* YHEditHonorViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 044D0C1F2C22D37500C5CF5E /* YHEditHonorViewController.swift */; };
045A7E672C2ACB1A008F995B /* YHLoginOneLeadView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 045A7E662C2ACB1A008F995B /* YHLoginOneLeadView.swift */; };
045EEE792B9F171A0022A143 /* YHPreviewViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 045EED9A2B9F171A0022A143 /* YHPreviewViewModel.swift */; }; 045EEE792B9F171A0022A143 /* YHPreviewViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 045EED9A2B9F171A0022A143 /* YHPreviewViewModel.swift */; };
045EEE7A2B9F171A0022A143 /* YHPreviewForOtherInfoModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 045EED9C2B9F171A0022A143 /* YHPreviewForOtherInfoModel.swift */; }; 045EEE7A2B9F171A0022A143 /* YHPreviewForOtherInfoModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 045EED9C2B9F171A0022A143 /* YHPreviewForOtherInfoModel.swift */; };
045EEE7B2B9F171A0022A143 /* YHPersonInfoCellModel2.swift in Sources */ = {isa = PBXBuildFile; fileRef = 045EED9D2B9F171A0022A143 /* YHPersonInfoCellModel2.swift */; }; 045EEE7B2B9F171A0022A143 /* YHPersonInfoCellModel2.swift in Sources */ = {isa = PBXBuildFile; fileRef = 045EED9D2B9F171A0022A143 /* YHPersonInfoCellModel2.swift */; };
...@@ -636,6 +637,7 @@ ...@@ -636,6 +637,7 @@
044D0C1B2C22C30B00C5CF5E /* YHEditSchoolViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHEditSchoolViewController.swift; sourceTree = "<group>"; }; 044D0C1B2C22C30B00C5CF5E /* YHEditSchoolViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHEditSchoolViewController.swift; sourceTree = "<group>"; };
044D0C1D2C22CFBF00C5CF5E /* YHEditWorkViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHEditWorkViewController.swift; sourceTree = "<group>"; }; 044D0C1D2C22CFBF00C5CF5E /* YHEditWorkViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHEditWorkViewController.swift; sourceTree = "<group>"; };
044D0C1F2C22D37500C5CF5E /* YHEditHonorViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHEditHonorViewController.swift; sourceTree = "<group>"; }; 044D0C1F2C22D37500C5CF5E /* YHEditHonorViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHEditHonorViewController.swift; sourceTree = "<group>"; };
045A7E662C2ACB1A008F995B /* YHLoginOneLeadView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHLoginOneLeadView.swift; sourceTree = "<group>"; };
045EED9A2B9F171A0022A143 /* YHPreviewViewModel.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = YHPreviewViewModel.swift; sourceTree = "<group>"; }; 045EED9A2B9F171A0022A143 /* YHPreviewViewModel.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = YHPreviewViewModel.swift; sourceTree = "<group>"; };
045EED9C2B9F171A0022A143 /* YHPreviewForOtherInfoModel.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = YHPreviewForOtherInfoModel.swift; sourceTree = "<group>"; }; 045EED9C2B9F171A0022A143 /* YHPreviewForOtherInfoModel.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = YHPreviewForOtherInfoModel.swift; sourceTree = "<group>"; };
045EED9D2B9F171A0022A143 /* YHPersonInfoCellModel2.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = YHPersonInfoCellModel2.swift; sourceTree = "<group>"; }; 045EED9D2B9F171A0022A143 /* YHPersonInfoCellModel2.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = YHPersonInfoCellModel2.swift; sourceTree = "<group>"; };
...@@ -2595,6 +2597,7 @@ ...@@ -2595,6 +2597,7 @@
0468D4212B493A5E00CFB916 /* YHPhoneMessageView.swift */, 0468D4212B493A5E00CFB916 /* YHPhoneMessageView.swift */,
0468D4272B50D4AF00CFB916 /* YHPrivacyAlertView.swift */, 0468D4272B50D4AF00CFB916 /* YHPrivacyAlertView.swift */,
044D0BF72C21572B00C5CF5E /* YHAllowSettingTableViewCell.swift */, 044D0BF72C21572B00C5CF5E /* YHAllowSettingTableViewCell.swift */,
045A7E662C2ACB1A008F995B /* YHLoginOneLeadView.swift */,
); );
path = V; path = V;
sourceTree = "<group>"; sourceTree = "<group>";
...@@ -3450,6 +3453,7 @@ ...@@ -3450,6 +3453,7 @@
04A6715E2B9FFCA700C1FB91 /* YHCertificateNameCell.swift in Sources */, 04A6715E2B9FFCA700C1FB91 /* YHCertificateNameCell.swift in Sources */,
A5787E3C2C23DEE500B021D7 /* YHActivityTitleItemView.swift in Sources */, A5787E3C2C23DEE500B021D7 /* YHActivityTitleItemView.swift in Sources */,
A567E5AF2BD7643D00D5D5A0 /* YHHomeWebViewBottomForSavePicView.swift in Sources */, A567E5AF2BD7643D00D5D5A0 /* YHHomeWebViewBottomForSavePicView.swift in Sources */,
045A7E672C2ACB1A008F995B /* YHLoginOneLeadView.swift in Sources */,
048787D72BCE96F50036E221 /* YHServiceOrderProgressTableViewCell.swift in Sources */, 048787D72BCE96F50036E221 /* YHServiceOrderProgressTableViewCell.swift in Sources */,
04AD31792C23FFC700DF5655 /* YHInterestModel.swift in Sources */, 04AD31792C23FFC700DF5655 /* YHInterestModel.swift in Sources */,
04EA23082BB50753009DA928 /* YHDocumentMessageTableViewCell.swift in Sources */, 04EA23082BB50753009DA928 /* YHDocumentMessageTableViewCell.swift in Sources */,
......
...@@ -11,7 +11,7 @@ import JXSegmentedView ...@@ -11,7 +11,7 @@ import JXSegmentedView
class YHCommunityViewController: YHBaseViewController { class YHCommunityViewController: YHBaseViewController {
var defaltIndex: Int = 0 var defaltIndex: Int = 0
let friendViewModel = YHMatchUserViewModel()
let arrItemTitles = ["人脉","活动"] let arrItemTitles = ["人脉","活动"]
var arrItemVCs : [YHBaseViewController] = [] var arrItemVCs : [YHBaseViewController] = []
...@@ -56,16 +56,58 @@ class YHCommunityViewController: YHBaseViewController { ...@@ -56,16 +56,58 @@ class YHCommunityViewController: YHBaseViewController {
btn.setImage(UIImage(named: "people_friends_btn"), for: .normal) btn.setImage(UIImage(named: "people_friends_btn"), for: .normal)
btn.setTitle("好友", for: .normal) btn.setTitle("好友", for: .normal)
btn.setTitleColor(UIColor.white, for: .normal) btn.setTitleColor(UIColor.white, for: .normal)
btn.iconInLeft(spacing: 4.0)
btn.titleLabel?.font = UIFont.PFSC_R(ofSize:15) btn.titleLabel?.font = UIFont.PFSC_R(ofSize:15)
btn.YH_clickEdgeInsets = UIEdgeInsets(top: 20, left: 20, bottom: 20, right: 20)
btn.addTarget(self, action: #selector(didFriendsBtnClicked), for: .touchUpInside) btn.addTarget(self, action: #selector(didFriendsBtnClicked), for: .touchUpInside)
return btn return btn
}() }()
let unreadHeight = 16.0
lazy var unreadLabel:UILabel = {
let label = UILabel()
label.textColor = .white
label.textAlignment = .center
label.backgroundColor = .failColor
label.font = .PFSC_M(ofSize: 10)
label.layer.cornerRadius = unreadHeight/2.0
label.clipsToBounds = true
label.isHidden = true
return label
}()
var unreadCount:Int = 0 {
didSet {
self.unreadLabel.isHidden = (self.unreadCount <= 0)
if 0 < self.unreadCount && self.unreadCount < 100 {
self.unreadLabel.text = "\(self.unreadCount)"
} else if self.unreadCount >= 100 {
self.unreadLabel.text = "99+"
}
var width = unreadHeight
var leftMargin = -8
if 10 <= self.unreadCount && self.unreadCount < 100 {
width = 22.0
} else if self.unreadCount >= 100 {
width = 30.0
leftMargin = -14
}
self.unreadLabel.snp.updateConstraints { make in
make.width.equalTo(width)
make.left.equalTo(self.friendsBtn.snp.right).offset(leftMargin)
}
}
}
@objc func didBackBtnClicked() { @objc func didBackBtnClicked() {
self.navigationController?.popViewController(animated: true) self.navigationController?.popViewController(animated: true)
} }
@objc func didFriendsBtnClicked() { @objc func didFriendsBtnClicked() {
if !YHLoginManager.shared.isLogin() {
YHOneKeyLoginManager.shared.oneKeyLogin()
return
}
let vc = YHMyGoodFriendsVC() let vc = YHMyGoodFriendsVC()
self.navigationController?.pushViewController(vc) self.navigationController?.pushViewController(vc)
} }
...@@ -111,16 +153,23 @@ class YHCommunityViewController: YHBaseViewController { ...@@ -111,16 +153,23 @@ class YHCommunityViewController: YHBaseViewController {
self.view.addSubview(friendsBtn) self.view.addSubview(friendsBtn)
friendsBtn.snp.makeConstraints { make in friendsBtn.snp.makeConstraints { make in
make.width.equalTo(82.0) make.width.equalTo(54.0)
make.height.equalTo(48) make.height.equalTo(21)
make.right.equalToSuperview() make.right.equalTo(-20)
make.top.equalTo(k_Height_safeAreaInsetsTop()) make.top.equalTo(12+k_Height_safeAreaInsetsTop())
}
self.view.addSubview(self.unreadLabel)
self.unreadLabel.snp.makeConstraints { make in
make.width.height.equalTo(unreadHeight)
make.left.equalTo(self.friendsBtn.snp.right).offset(-8)
make.top.equalTo(self.friendsBtn.snp.top).offset(-8)
} }
} }
override func viewWillAppear(_ animated: Bool) { override func viewWillAppear(_ animated: Bool) {
super.viewWillAppear(animated) super.viewWillAppear(animated)
requestFriendRequest()
//处于第一个item的时候,才允许屏幕边缘手势返回 //处于第一个item的时候,才允许屏幕边缘手势返回
navigationController?.interactivePopGestureRecognizer?.isEnabled = (segmentedView.selectedIndex == 0) navigationController?.interactivePopGestureRecognizer?.isEnabled = (segmentedView.selectedIndex == 0)
} }
...@@ -138,6 +187,17 @@ class YHCommunityViewController: YHBaseViewController { ...@@ -138,6 +187,17 @@ class YHCommunityViewController: YHBaseViewController {
segmentedView.frame = CGRect(x: 0, y: k_Height_safeAreaInsetsTop(), width: view.bounds.size.width, height: 48) segmentedView.frame = CGRect(x: 0, y: k_Height_safeAreaInsetsTop(), width: view.bounds.size.width, height: 48)
listContainerView.frame = CGRect(x: 0, y: k_Height_safeAreaInsetsTop() + 48, width: view.bounds.size.width, height: view.bounds.size.height - 48 - k_Height_safeAreaInsetsTop()) listContainerView.frame = CGRect(x: 0, y: k_Height_safeAreaInsetsTop() + 48, width: view.bounds.size.width, height: view.bounds.size.height - 48 - k_Height_safeAreaInsetsTop())
} }
func requestFriendRequest() {
if YHLoginManager.shared.isLogin() {
self.friendViewModel.getMyFriendList { success, error in
let unreadCount = self.friendViewModel.friendListModel.applyFriends.count
self.unreadCount = unreadCount
}
} else {
self.unreadCount = 0
}
}
} }
extension YHCommunityViewController: JXSegmentedViewDelegate { extension YHCommunityViewController: JXSegmentedViewDelegate {
......
...@@ -116,11 +116,15 @@ class YHInformationAuthorizationStepTwoViewController: UIViewController { ...@@ -116,11 +116,15 @@ class YHInformationAuthorizationStepTwoViewController: UIViewController {
@objc func nextStep() { @objc func nextStep() {
viewModel.requestAuthorizationSubmit {[weak self] success, error in viewModel.requestAuthorizationSubmit {[weak self] success, error in
guard let self = self else { return } guard let self = self else { return }
self.navigationController?.popToRootViewController(animated: true) if self.stepFlag {
let view = YHPeopleSuccessView(frame: CGRect(x: 0, y: 0, width: KScreenWidth, height: KScreenHeight)) self.navigationController?.popToRootViewController(animated: true)
view.titleLabel.text = "Hi,\(self.name)\n您的人脉网络已激活" let view = YHPeopleSuccessView(frame: CGRect(x: 0, y: 0, width: KScreenWidth, height: KScreenHeight))
let window = UIApplication.shared.yhKeyWindow() view.titleLabel.text = "Hi,\(self.name)\n您的人脉网络已激活"
window?.addSubview(view) let window = UIApplication.shared.yhKeyWindow()
window?.addSubview(view)
} else {
self.navigationController?.popViewController(animated: true)
}
} }
} }
} }
......
...@@ -101,11 +101,31 @@ extension YHMyGoodFriendsVC: UITableViewDelegate, UITableViewDataSource { ...@@ -101,11 +101,31 @@ extension YHMyGoodFriendsVC: UITableViewDelegate, UITableViewDataSource {
if indexPath.section == 0 { if indexPath.section == 0 {
let cell = tableView.dequeueReusableCell(withIdentifier: YHAddFriendCardCell.cellReuseIdentifier, for: indexPath) as! YHAddFriendCardCell let cell = tableView.dequeueReusableCell(withIdentifier: YHAddFriendCardCell.cellReuseIdentifier, for: indexPath) as! YHAddFriendCardCell
cell.cardCount = self.friendRequestArr.count cell.cardCount = self.friendRequestArr.count
if self.friendRequestArr.count > 0 {
cell.friendModel = self.friendRequestArr[0]
}
cell.acceptBlock = { cell.acceptBlock = {
[weak self] accept in [weak self] accept in
guard let self = self else { return } guard let self = self else { return }
self.friendRequestArr.removeFirst() if self.friendRequestArr.count > 0 {
self.tableView.reloadData() let user = self.friendRequestArr[0]
YHHUD.show(.progress(message: "加载中..."))
self.viewModel.receiveFriendApply(userId: user.yhId, isReceive: accept) {
[weak self] success, error in
YHHUD.hide()
guard let self = self else { return }
if success {
self.friendRequestArr.removeFirst()
self.tableView.reloadData()
} else {
var msg = "处理失败"
if let errMsg = error?.errorMsg, !errMsg.isEmpty {
msg = errMsg
}
YHHUD.flash(message: msg)
}
}
}
} }
return cell return cell
} }
......
...@@ -158,6 +158,11 @@ extension YHMyNameCardViewController: UITableViewDelegate, UITableViewDataSource ...@@ -158,6 +158,11 @@ extension YHMyNameCardViewController: UITableViewDelegate, UITableViewDataSource
if cardInfo.type == .education { if cardInfo.type == .education {
let eduCell = tableView.dequeueReusableCell(withIdentifier: YHMyEducationCell.cellReuseIdentifier, for: indexPath) as! YHMyEducationCell let eduCell = tableView.dequeueReusableCell(withIdentifier: YHMyEducationCell.cellReuseIdentifier, for: indexPath) as! YHMyEducationCell
eduCell.userModel = cardInfo eduCell.userModel = cardInfo
eduCell.hiddenBtnBlock = {
[weak self] in
guard let self = self else { return }
YHWholeScreenTipsView.show(type: .nameCardEducation, targetView: eduCell.hiddenBtn)
}
eduCell.editBlock = { [weak self] in eduCell.editBlock = { [weak self] in
guard let self = self else { return } guard let self = self else { return }
let vc = YHEditSchoolViewController() let vc = YHEditSchoolViewController()
...@@ -170,6 +175,11 @@ extension YHMyNameCardViewController: UITableViewDelegate, UITableViewDataSource ...@@ -170,6 +175,11 @@ extension YHMyNameCardViewController: UITableViewDelegate, UITableViewDataSource
if cardInfo.type == .workExperience { if cardInfo.type == .workExperience {
let workCell = tableView.dequeueReusableCell(withIdentifier: YHMyWorkExperienceCell.cellReuseIdentifier, for: indexPath) as! YHMyWorkExperienceCell let workCell = tableView.dequeueReusableCell(withIdentifier: YHMyWorkExperienceCell.cellReuseIdentifier, for: indexPath) as! YHMyWorkExperienceCell
workCell.userModel = cardInfo workCell.userModel = cardInfo
workCell.hiddenBtnBlock = {
[weak self] in
guard let self = self else { return }
YHWholeScreenTipsView.show(type: .nameCardWorkExperience, targetView: workCell.hiddenBtn)
}
workCell.editBlock = { [weak self] in workCell.editBlock = { [weak self] in
guard let self = self else { return } guard let self = self else { return }
let vc = YHEditWorkViewController() let vc = YHEditWorkViewController()
......
...@@ -12,6 +12,8 @@ import Lottie ...@@ -12,6 +12,8 @@ import Lottie
class YHPeopleViewController: YHBaseViewController { class YHPeopleViewController: YHBaseViewController {
let viewModel = YHMatchUserViewModel() let viewModel = YHMatchUserViewModel()
var informationAuthorizeViewModel: YHInformationAuthorizeViewModel = YHInformationAuthorizeViewModel()
lazy var topLabel:UILabel = { lazy var topLabel:UILabel = {
let label = UILabel() let label = UILabel()
label.textAlignment = .center label.textAlignment = .center
...@@ -77,6 +79,26 @@ class YHPeopleViewController: YHBaseViewController { ...@@ -77,6 +79,26 @@ class YHPeopleViewController: YHBaseViewController {
resetAnimation() resetAnimation()
} }
override func viewWillAppear(_ animated: Bool) {
super.viewWillAppear(animated)
informationAuthorizeViewModel.requestUserInfo {[weak self] success, error in
guard let self = self else { return }
if informationAuthorizeViewModel.model.is_fillin != 1 {
self.firstImageView.isHidden = false
self.bottomLabel.isHidden = false
self.headLottieView.isHidden = true
self.launchLottieView.isHidden = true
self.rotateLottieView.isHidden = true
} else {
self.firstImageView.isHidden = true
self.bottomLabel.isHidden = true
self.headLottieView.isHidden = false
self.launchLottieView.isHidden = false
self.rotateLottieView.isHidden = true
}
}
}
func createUI() { func createUI() {
let wingLeftImgV = UIImageView(image: UIImage(named: "people_match_wing_left")) let wingLeftImgV = UIImageView(image: UIImage(named: "people_match_wing_left"))
...@@ -148,13 +170,16 @@ class YHPeopleViewController: YHBaseViewController { ...@@ -148,13 +170,16 @@ class YHPeopleViewController: YHBaseViewController {
@objc func didMatchBtnClicked() { @objc func didMatchBtnClicked() {
if true { if !YHLoginManager.shared.isLogin() {
startMatchUsers() YHOneKeyLoginManager.shared.oneKeyLogin()
return return
} }
if informationAuthorizeViewModel.model.is_fillin == 1 {
let vc = YHInformationAuthorizationStepOneViewController() startMatchUsers()
self.navigationController?.pushViewController(vc) } else {
let vc = YHInformationAuthorizationStepOneViewController()
self.navigationController?.pushViewController(vc)
}
} }
func resetAnimation() { func resetAnimation() {
......
...@@ -51,7 +51,7 @@ class YHMatchUserAddress: SmartCodable { ...@@ -51,7 +51,7 @@ class YHMatchUserAddress: SmartCodable {
class YHAuthorizationModel: SmartCodable { class YHAuthorizationModel: SmartCodable {
var educationExperience: Int = 0 var educationExperience: Int = 0
var workExperience = 0 var workExperience:Int = 0
required init() { required init() {
...@@ -95,17 +95,18 @@ class YHUserNameCardInfo: SmartCodable { ...@@ -95,17 +95,18 @@ class YHUserNameCardInfo: SmartCodable {
// 自定义属性 // 自定义属性
var type:YHNameCardInfoType = .unknown var type:YHNameCardInfoType = .unknown
var isCurrentUser = false
var isHiddenEducation : Bool { var isHiddenEducation : Bool {
get { get {
return self.authorization.educationExperience != 2 return self.authorization.educationExperience == 2
} }
} }
var isHiddenWorkExperience: Bool { var isHiddenWorkExperience: Bool {
get { get {
return self.authorization.educationExperience != 2 return self.authorization.workExperience == 2
} }
} }
var isCurrentUser = false
required init() { required init() {
...@@ -130,6 +131,8 @@ class YHUserNameCardInfo: SmartCodable { ...@@ -130,6 +131,8 @@ class YHUserNameCardInfo: SmartCodable {
self.position = model.position self.position = model.position
self.industry = model.industry self.industry = model.industry
self.honor = model.honor self.honor = model.honor
self.authorization.educationExperience = model.authorization.educationExperience
self.authorization.workExperience = model.authorization.workExperience
self.topics.removeAll() self.topics.removeAll()
self.topics.append(contentsOf: model.topics) self.topics.append(contentsOf: model.topics)
} }
...@@ -137,7 +140,10 @@ class YHUserNameCardInfo: SmartCodable { ...@@ -137,7 +140,10 @@ class YHUserNameCardInfo: SmartCodable {
enum CodingKeys: String, CodingKey { enum CodingKeys: String, CodingKey {
case yhId = "yh_id" case yhId = "yh_id"
case isSigned = "is_signed" case isSigned = "is_signed"
case id, avatar, username, address, zodiac, signature, bio, college, major, background, authorization, position, industry, honor, topics
case companyName = "company_name" case companyName = "company_name"
case id, avatar, username, zodiac, signature, bio, college, major, background, position, industry, honor
case topics
case address
case authorization
} }
} }
...@@ -71,6 +71,7 @@ class YHUserInformationDetailModel: YHBaseModel { ...@@ -71,6 +71,7 @@ class YHUserInformationDetailModel: YHBaseModel {
var college: String = "" var college: String = ""
var industry: String = "" var industry: String = ""
var position: String = "" var position: String = ""
var is_fillin: Int = 0
} }
class YHUserInformationDetailAddressModel: YHBaseModel { class YHUserInformationDetailAddressModel: YHBaseModel {
......
...@@ -48,6 +48,11 @@ class YHAddFriendCardCell: UITableViewCell { ...@@ -48,6 +48,11 @@ class YHAddFriendCardCell: UITableViewCell {
self.professionalLabel.text = self.friendModel.position self.professionalLabel.text = self.friendModel.position
self.msgLabel.text = self.friendModel.verifyInfo self.msgLabel.text = self.friendModel.verifyInfo
self.signImgV.isHidden = !self.friendModel.isSign self.signImgV.isHidden = !self.friendModel.isSign
self.scrollView.snp.updateConstraints { make in
let msgHeight = self.getHeight(text: self.friendModel.verifyInfo, font: self.msgLabel.font!, width: KScreenWidth-40.0*2)
make.height.equalTo(msgHeight >= 55.0 ? 52+12 : msgHeight+12)
}
} }
} }
...@@ -188,11 +193,6 @@ class YHAddFriendCardCell: UITableViewCell { ...@@ -188,11 +193,6 @@ class YHAddFriendCardCell: UITableViewCell {
cardView.addSubview(ignoreBtn) cardView.addSubview(ignoreBtn)
cardView.addSubview(acceptBtn) cardView.addSubview(acceptBtn)
self.headImgV.backgroundColor = .red
self.nameLabel.text = "XASAFSDFASDXASAFSDFASDXASAFSDFASDXASAFSDFASD"
self.professionalLabel.text = "咨询副总监 | 资讯科技及电讯"
self.msgLabel.text = "资讯科技及电讯资资讯科技及电讯资资讯科技及电讯资资讯科技及讯科技及电讯资资讯科技及电讯资资讯科技及电讯资资讯科技及科技及电讯资资讯科技及讯科技及电讯资资讯科技及科技及电讯资资讯科技及讯科技及电讯资资讯科技及"
cardView.snp.makeConstraints { make in cardView.snp.makeConstraints { make in
make.left.right.top.equalToSuperview() make.left.right.top.equalToSuperview()
make.bottom.equalTo(self.secondCardView).offset(-6) make.bottom.equalTo(self.secondCardView).offset(-6)
...@@ -234,9 +234,7 @@ class YHAddFriendCardCell: UITableViewCell { ...@@ -234,9 +234,7 @@ class YHAddFriendCardCell: UITableViewCell {
make.right.equalTo(-16) make.right.equalTo(-16)
make.top.equalTo(self.headImgV.snp.bottom).offset(16) make.top.equalTo(self.headImgV.snp.bottom).offset(16)
make.bottom.equalTo(self.ignoreBtn.snp.top).offset(-16) make.bottom.equalTo(self.ignoreBtn.snp.top).offset(-16)
make.height.equalTo(62)
let msgHeight = self.getHeight(text: self.msgLabel.text!, font: self.msgLabel.font!, width: KScreenWidth-40.0*2)
make.height.equalTo(msgHeight >= 55.0 ? 52+12 : msgHeight+12)
} }
self.scrollContentView.snp.makeConstraints { make in self.scrollContentView.snp.makeConstraints { make in
......
...@@ -11,8 +11,8 @@ import UIKit ...@@ -11,8 +11,8 @@ import UIKit
class YHMyEducationCell: UITableViewCell { class YHMyEducationCell: UITableViewCell {
typealias EditBlock = () -> () typealias EditBlock = () -> ()
var editBlock: EditBlock? var editBlock: EditBlock?
var hiddenBtnBlock:(()->())?
static let cellReuseIdentifier = "YHMyEducationCell" static let cellReuseIdentifier = "YHMyEducationCell"
var userModel:YHUserNameCardInfo = YHUserNameCardInfo() { var userModel:YHUserNameCardInfo = YHUserNameCardInfo() {
didSet { didSet {
...@@ -42,7 +42,7 @@ class YHMyEducationCell: UITableViewCell { ...@@ -42,7 +42,7 @@ class YHMyEducationCell: UITableViewCell {
} }
if self.userModel.isCurrentUser { if self.userModel.isCurrentUser {
self.hiddenBtn.isHidden = (self.userModel.authorization.educationExperience == 1) self.hiddenBtn.isHidden = self.userModel.isHiddenEducation
} else { } else {
self.hiddenBtn.isHidden = true self.hiddenBtn.isHidden = true
...@@ -104,6 +104,7 @@ class YHMyEducationCell: UITableViewCell { ...@@ -104,6 +104,7 @@ class YHMyEducationCell: UITableViewCell {
btn.titleLabel?.font = UIFont.PFSC_R(ofSize:10) btn.titleLabel?.font = UIFont.PFSC_R(ofSize:10)
btn.titleEdgeInsets = UIEdgeInsets(top: 0, left: -11, bottom: 0, right: 11) btn.titleEdgeInsets = UIEdgeInsets(top: 0, left: -11, bottom: 0, right: 11)
btn.imageEdgeInsets = UIEdgeInsets(top: 0, left: 31, bottom: 0, right: -31) btn.imageEdgeInsets = UIEdgeInsets(top: 0, left: 31, bottom: 0, right: -31)
btn.addTarget(self, action: #selector(didHiddenBtnClicked), for: .touchUpInside)
return btn return btn
}() }()
...@@ -116,6 +117,10 @@ class YHMyEducationCell: UITableViewCell { ...@@ -116,6 +117,10 @@ class YHMyEducationCell: UITableViewCell {
setupUI() setupUI()
} }
@objc func didHiddenBtnClicked() {
self.hiddenBtnBlock?()
}
func setupUI() { func setupUI() {
self.selectionStyle = .none self.selectionStyle = .none
......
...@@ -59,7 +59,7 @@ class YHMyInterestTopicCell: UITableViewCell { ...@@ -59,7 +59,7 @@ class YHMyInterestTopicCell: UITableViewCell {
var isShowList = true var isShowList = true
if self.userModel.isCurrentUser { if self.userModel.isCurrentUser {
if self.topicArr.count <= 0 { if self.userModel.topics.count <= 0 {
isShowList = false isShowList = false
} }
} }
......
...@@ -56,6 +56,7 @@ class YHExperienceItemView: UIView { ...@@ -56,6 +56,7 @@ class YHExperienceItemView: UIView {
class YHMyWorkExperienceCell: UITableViewCell { class YHMyWorkExperienceCell: UITableViewCell {
typealias EditBlock = () -> () typealias EditBlock = () -> ()
var editBlock: EditBlock? var editBlock: EditBlock?
var hiddenBtnBlock:(()->())?
static let cellReuseIdentifier = "YHMyWorkExperienceCell" static let cellReuseIdentifier = "YHMyWorkExperienceCell"
var userModel:YHUserNameCardInfo = YHUserNameCardInfo() { var userModel:YHUserNameCardInfo = YHUserNameCardInfo() {
...@@ -98,7 +99,7 @@ class YHMyWorkExperienceCell: UITableViewCell { ...@@ -98,7 +99,7 @@ class YHMyWorkExperienceCell: UITableViewCell {
} }
if self.userModel.isCurrentUser { if self.userModel.isCurrentUser {
self.hiddenBtn.isHidden = (self.userModel.authorization.workExperience == 1) self.hiddenBtn.isHidden = self.userModel.isHiddenWorkExperience
} else { } else {
self.hiddenBtn.isHidden = true self.hiddenBtn.isHidden = true
...@@ -142,6 +143,7 @@ class YHMyWorkExperienceCell: UITableViewCell { ...@@ -142,6 +143,7 @@ class YHMyWorkExperienceCell: UITableViewCell {
btn.titleLabel?.font = UIFont.PFSC_R(ofSize:10) btn.titleLabel?.font = UIFont.PFSC_R(ofSize:10)
btn.titleEdgeInsets = UIEdgeInsets(top: 0, left: -11, bottom: 0, right: 11) btn.titleEdgeInsets = UIEdgeInsets(top: 0, left: -11, bottom: 0, right: 11)
btn.imageEdgeInsets = UIEdgeInsets(top: 0, left: 31, bottom: 0, right: -31) btn.imageEdgeInsets = UIEdgeInsets(top: 0, left: 31, bottom: 0, right: -31)
btn.addTarget(self, action: #selector(didHiddenBtnClicked), for: .touchUpInside)
return btn return btn
}() }()
...@@ -240,4 +242,8 @@ class YHMyWorkExperienceCell: UITableViewCell { ...@@ -240,4 +242,8 @@ class YHMyWorkExperienceCell: UITableViewCell {
block() block()
} }
} }
@objc func didHiddenBtnClicked() {
self.hiddenBtnBlock?()
}
} }
...@@ -9,7 +9,6 @@ ...@@ -9,7 +9,6 @@
import UIKit import UIKit
class YHInformationAuthorizeViewModel: YHBaseViewModel { class YHInformationAuthorizeViewModel: YHBaseViewModel {
var mainModel: YHMainUserInformationModel = YHMainUserInformationModel()
var setModel: YHMainUserInformationSetModel = YHMainUserInformationSetModel() var setModel: YHMainUserInformationSetModel = YHMainUserInformationSetModel()
var model: YHUserInformationDetailModel = YHUserInformationDetailModel() var model: YHUserInformationDetailModel = YHUserInformationDetailModel()
override init() { override init() {
...@@ -28,7 +27,7 @@ class YHInformationAuthorizeViewModel: YHBaseViewModel { ...@@ -28,7 +27,7 @@ class YHInformationAuthorizeViewModel: YHBaseViewModel {
let item4 = YHUserInformationModel(id: .id3, title: "毕业院校", isUserKeyBoard: true, prompts: "请输入您的毕业院校", message: model.college) let item4 = YHUserInformationModel(id: .id3, title: "毕业院校", isUserKeyBoard: true, prompts: "请输入您的毕业院校", message: model.college)
let item5 = YHUserInformationModel(id: .id4, title: "所属行业", isUserKeyBoard: false, prompts: "请选择您的所属行业", message: model.industry, type: .id) let item5 = YHUserInformationModel(id: .id4, title: "所属行业", isUserKeyBoard: false, prompts: "请选择您的所属行业", message: model.industry, type: .id)
let item6 = YHUserInformationModel(id: .id5, title: "职位", isUserKeyBoard: true, prompts: "请输入您的职位", message: model.position) let item6 = YHUserInformationModel(id: .id5, title: "职位", isUserKeyBoard: true, prompts: "请输入您的职位", message: model.position)
if mainModel.country.contains("中国") { if model.address.country.contains("中国") {
return [item1, item2, item3, item4, item5, item6] return [item1, item2, item3, item4, item5, item6]
} }
return [item1, item2, item4, item5, item6] return [item1, item2, item4, item5, item6]
...@@ -68,7 +67,7 @@ class YHInformationAuthorizeViewModel: YHBaseViewModel { ...@@ -68,7 +67,7 @@ class YHInformationAuthorizeViewModel: YHBaseViewModel {
guard industry.count > 0 else { return false } guard industry.count > 0 else { return false }
guard position.count > 0 else { return false } guard position.count > 0 else { return false }
guard country.count > 0 else { return false } guard country.count > 0 else { return false }
if mainModel.country.contains("中国") { if model.address.country.contains("中国") {
guard provice.count > 0 else { return false } guard provice.count > 0 else { return false }
guard city.count > 0 else { return false } guard city.count > 0 else { return false }
} }
...@@ -140,11 +139,16 @@ class YHInformationAuthorizeViewModel: YHBaseViewModel { ...@@ -140,11 +139,16 @@ class YHInformationAuthorizeViewModel: YHBaseViewModel {
} }
func requestSaveUserInfo(callBackBlock:@escaping (_ success: Bool, _ error: YHErrorModel?)->()) { func requestSaveUserInfo(callBackBlock:@escaping (_ success: Bool, _ error: YHErrorModel?)->()) {
let username = model.username.trimmingCharacters(in: .whitespaces)
if username.count == 0 {
YHHUD.flash(message: "名字不合法")
return
}
let address: [String: Any] = ["country": model.address.country, let address: [String: Any] = ["country": model.address.country,
"province": model.address.province, "province": model.address.province,
"city": model.address.city] "city": model.address.city]
let params: [String: Any] = ["avatar": model.avatar, let params: [String: Any] = ["avatar": model.avatar,
"username": model.username, "username": username,
"college": model.college, "college": model.college,
"industry": model.industry, "industry": model.industry,
"position": model.position, "position": model.position,
......
...@@ -129,5 +129,27 @@ class YHMatchUserViewModel: NSObject { ...@@ -129,5 +129,27 @@ class YHMatchUserViewModel: NSObject {
} }
} }
func receiveFriendApply(userId:String, isReceive:Bool, callBack: @escaping (_ success: Bool,_ error: YHErrorModel?)->()) {
let act = isReceive ? 2 : 1
let params = ["act": act,
"yh_id": userId] as [String : Any]
let strUrl = YHBaseUrlManager.shared.curURL() + YHAllApiName.People.receiveFriendRequestApi
let _ = YHNetRequest.postRequest(url: strUrl, params: params) {
[weak self] json, code in
//1. json字符串 转 对象
guard let self = self else { return }
printLog(json)
if json.code == 200 {
callBack(true, nil)
} else {
let error : YHErrorModel = YHErrorModel(errorCode:Int32(json.code), errorMsg: json.msg)
callBack(false, error)
}
} failBlock: { err in
callBack(false, err)
}
}
} }
...@@ -75,7 +75,11 @@ class YHAllowUseMyInfoViewController: YHBaseViewController { ...@@ -75,7 +75,11 @@ class YHAllowUseMyInfoViewController: YHBaseViewController {
guard let self = self else { return } guard let self = self else { return }
viewModel.requestBusinessCardAuthorize {[weak self] success, error in viewModel.requestBusinessCardAuthorize {[weak self] success, error in
guard let self = self else { return } guard let self = self else { return }
self.dismiss(animated: true) self.dismiss(animated: true) {
let view = YHLoginOneLeadView(frame: CGRect(x: 0, y: 0, width: KScreenWidth, height: KScreenHeight))
let window = UIApplication.shared.yhKeyWindow()
window?.addSubview(view)
}
} }
} }
} }
......
...@@ -151,8 +151,13 @@ class YHUserInfoSettingViewController: YHBaseViewController { ...@@ -151,8 +151,13 @@ class YHUserInfoSettingViewController: YHBaseViewController {
return return
} }
self.name = nameTextField.text ?? "" self.name = nameTextField.text ?? ""
let username = name.trimmingCharacters(in: .whitespaces)
if username.count == 0 {
YHHUD.flash(message: "名字不合法")
return
}
// 请求接口逻辑 // 请求接口逻辑
viewModel.requestSaveUserInfo(head: headUrl, name: name) {[weak self] success, error in viewModel.requestSaveUserInfo(head: headUrl, name: username) {[weak self] success, error in
guard let self = self else { return } guard let self = self else { return }
let vc = YHAllowUseMyInfoViewController() let vc = YHAllowUseMyInfoViewController()
self.navigationController?.pushViewController(vc) self.navigationController?.pushViewController(vc)
......
//
// YHLoginOneLeadView.swift
// galaxy
//
// Created by EDY on 2024/6/25.
// Copyright © 2024 https://www.galaxy-immi.com. All rights reserved.
//
import UIKit
class YHLoginOneLeadView: UIView {
var centerView: UIView!
var bottomImageView: UIImageView!
var bottomButton: UIButton!
override init(frame: CGRect) {
super.init(frame: frame)
backgroundColor = UIColor(white: 0.5, alpha: 0.1)
let tap = UITapGestureRecognizer(target: self, action: #selector(handleTap))
tap.delegate = self
addGestureRecognizer(tap)
setView()
}
required init?(coder: NSCoder) {
fatalError("init(coder:) has not been implemented")
}
func setView() {
backgroundColor = UIColor(hex: 0x000000, alpha: 0.5)
centerView = {
let view = UIView()
view.backgroundColor = .white
view.layer.cornerRadius = kCornerRadius6
return view
}()
addSubview(centerView)
centerView.snp.makeConstraints { make in
make.left.right.top.bottom.equalToSuperview()
}
bottomImageView = {
let imageView = UIImageView()
imageView.image = UIImage(named: "my_card_lead")
return imageView
}()
centerView.addSubview(bottomImageView)
bottomImageView.snp.makeConstraints { make in
make.left.right.top.bottom.equalToSuperview()
}
bottomButton = {
let button = UIButton(type: .custom)
button.addTarget(self, action: #selector(dismiss), for: .touchUpInside)
return button
}()
centerView.addSubview(bottomButton)
bottomButton.snp.makeConstraints { make in
make.left.right.top.bottom.equalToSuperview()
}
}
@objc private func handleTap(_ sender: AnyObject?) {
print("处理点击手势")
dismiss()
}
@objc func dismiss() {
removeFromSuperview()
}
}
extension YHLoginOneLeadView: UIGestureRecognizerDelegate {
func gestureRecognizer(_ gestureRecognizer:UIGestureRecognizer, shouldReceive touch:UITouch) -> Bool {
if touch.view == self {
return true
}
return false
}
}
...@@ -32,6 +32,13 @@ class YHEditBaseUserInfoViewController: YHBaseViewController { ...@@ -32,6 +32,13 @@ class YHEditBaseUserInfoViewController: YHBaseViewController {
photoImageView.kf.setImage(with: url) photoImageView.kf.setImage(with: url)
footView.dataSource = self.viewModel.model.signature footView.dataSource = self.viewModel.model.signature
tableView.reloadData() tableView.reloadData()
if self.viewModel.isCanNext(step: 1) {
nextButton.isEnabled = true
nextButton.backgroundColor = UIColor.brandMainColor
} else {
nextButton.isEnabled = false
nextButton.backgroundColor = UIColor.brandMainColor.withAlphaComponent(0.4)
}
} }
func setView() { func setView() {
...@@ -173,6 +180,13 @@ extension YHEditBaseUserInfoViewController: UITableViewDelegate, UITableViewData ...@@ -173,6 +180,13 @@ extension YHEditBaseUserInfoViewController: UITableViewDelegate, UITableViewData
if model.id != .id1 { if model.id != .id1 {
self.getData() self.getData()
} }
if self.viewModel.isCanNext(step: 1) {
nextButton.isEnabled = true
nextButton.backgroundColor = UIColor.brandMainColor
} else {
nextButton.isEnabled = false
nextButton.backgroundColor = UIColor.brandMainColor.withAlphaComponent(0.4)
}
} }
return cell return cell
} }
......
...@@ -196,6 +196,9 @@ extension YHEditInterestViewController: UICollectionViewDelegate, UICollectionVi ...@@ -196,6 +196,9 @@ extension YHEditInterestViewController: UICollectionViewDelegate, UICollectionVi
if section == 0 { if section == 0 {
return normalItems.count return normalItems.count
} else { } else {
if likeItems.count > 20 {
return 20
}
return likeItems.count return likeItems.count
} }
} }
......
...@@ -25,6 +25,13 @@ class YHEditSchoolViewController: YHBaseViewController { ...@@ -25,6 +25,13 @@ class YHEditSchoolViewController: YHBaseViewController {
viewModel.model = model viewModel.model = model
items = viewModel.getBaseSchoolDataSource() items = viewModel.getBaseSchoolDataSource()
tableView.reloadData() tableView.reloadData()
if self.viewModel.isCanNext(step: 3) {
nextButton.isEnabled = true
nextButton.backgroundColor = UIColor.brandMainColor
} else {
nextButton.isEnabled = false
nextButton.backgroundColor = UIColor.brandMainColor.withAlphaComponent(0.4)
}
} }
func setView() { func setView() {
...@@ -96,6 +103,13 @@ extension YHEditSchoolViewController: UITableViewDelegate, UITableViewDataSource ...@@ -96,6 +103,13 @@ extension YHEditSchoolViewController: UITableViewDelegate, UITableViewDataSource
if model.id != .id8 { if model.id != .id8 {
self.getData() self.getData()
} }
if self.viewModel.isCanNext(step: 3) {
nextButton.isEnabled = true
nextButton.backgroundColor = UIColor.brandMainColor
} else {
nextButton.isEnabled = false
nextButton.backgroundColor = UIColor.brandMainColor.withAlphaComponent(0.4)
}
} }
return cell return cell
} }
......
...@@ -25,6 +25,13 @@ class YHEditWorkViewController: YHBaseViewController { ...@@ -25,6 +25,13 @@ class YHEditWorkViewController: YHBaseViewController {
viewModel.model = model viewModel.model = model
items = viewModel.getBaseWorkDataSource() items = viewModel.getBaseWorkDataSource()
tableView.reloadData() tableView.reloadData()
if self.viewModel.isCanNext(step: 4) {
nextButton.isEnabled = true
nextButton.backgroundColor = UIColor.brandMainColor
} else {
nextButton.isEnabled = false
nextButton.backgroundColor = UIColor.brandMainColor.withAlphaComponent(0.4)
}
} }
func setView() { func setView() {
...@@ -96,6 +103,13 @@ extension YHEditWorkViewController: UITableViewDelegate, UITableViewDataSource { ...@@ -96,6 +103,13 @@ extension YHEditWorkViewController: UITableViewDelegate, UITableViewDataSource {
if model.id != .id5 || model.id != .id10 { if model.id != .id5 || model.id != .id10 {
self.getData() self.getData()
} }
if self.viewModel.isCanNext(step: 4) {
nextButton.isEnabled = true
nextButton.backgroundColor = UIColor.brandMainColor
} else {
nextButton.isEnabled = false
nextButton.backgroundColor = UIColor.brandMainColor.withAlphaComponent(0.4)
}
} }
return cell return cell
} }
......
...@@ -96,14 +96,20 @@ class YHEditViewModel: YHBaseViewModel { ...@@ -96,14 +96,20 @@ class YHEditViewModel: YHBaseViewModel {
} }
func requestSaveUserInfo(callBackBlock:@escaping (_ success: Bool, _ error: YHErrorModel?)->()) { func requestSaveUserInfo(callBackBlock:@escaping (_ success: Bool, _ error: YHErrorModel?)->()) {
let username = model.username.trimmingCharacters(in: .whitespaces)
if username.count == 0 {
YHHUD.flash(message: "名字不合法")
return
}
let address: [String: Any] = ["country": model.address.country, let address: [String: Any] = ["country": model.address.country,
"province": model.address.province, "province": model.address.province,
"city": model.address.city] "city": model.address.city]
let basic: [String: Any] = ["avatar": model.avatar, let basic: [String: Any] = ["avatar": model.avatar,
"username": model.username, "username": username,
"zodiac": model.zodiac, "zodiac": model.zodiac,
"address": address, "address": address,
"signature": model.signature] "signature": model.signature,
"is_update": true]
let params: [String: Any] = ["basic_info": basic] let params: [String: Any] = ["basic_info": basic]
let strUrl = YHBaseUrlManager.shared.curURL() + YHAllApiName.People.cardSave let strUrl = YHBaseUrlManager.shared.curURL() + YHAllApiName.People.cardSave
let _ = YHNetRequest.postRequest(url: strUrl, params: params) { [weak self] json, code in let _ = YHNetRequest.postRequest(url: strUrl, params: params) { [weak self] json, code in
...@@ -121,7 +127,7 @@ class YHEditViewModel: YHBaseViewModel { ...@@ -121,7 +127,7 @@ class YHEditViewModel: YHBaseViewModel {
} }
func requestSavePersonalProfile(callBackBlock:@escaping (_ success: Bool, _ error: YHErrorModel?)->()) { func requestSavePersonalProfile(callBackBlock:@escaping (_ success: Bool, _ error: YHErrorModel?)->()) {
let introduction: [String: Any] = ["bio": model.bio] let introduction: [String: Any] = ["bio": model.bio, "is_update": true]
let params: [String: Any] = ["introduction": introduction] let params: [String: Any] = ["introduction": introduction]
let strUrl = YHBaseUrlManager.shared.curURL() + YHAllApiName.People.cardSave let strUrl = YHBaseUrlManager.shared.curURL() + YHAllApiName.People.cardSave
let _ = YHNetRequest.postRequest(url: strUrl, params: params) { [weak self] json, code in let _ = YHNetRequest.postRequest(url: strUrl, params: params) { [weak self] json, code in
...@@ -141,7 +147,8 @@ class YHEditViewModel: YHBaseViewModel { ...@@ -141,7 +147,8 @@ class YHEditViewModel: YHBaseViewModel {
func requestSaveWork(callBackBlock:@escaping (_ success: Bool, _ error: YHErrorModel?)->()) { func requestSaveWork(callBackBlock:@escaping (_ success: Bool, _ error: YHErrorModel?)->()) {
let work: [String: Any] = ["company_name": model.companyName, let work: [String: Any] = ["company_name": model.companyName,
"position": model.position, "position": model.position,
"industry": model.industry] "industry": model.industry,
"is_update": true]
let params: [String: Any] = ["work": work] let params: [String: Any] = ["work": work]
let strUrl = YHBaseUrlManager.shared.curURL() + YHAllApiName.People.cardSave let strUrl = YHBaseUrlManager.shared.curURL() + YHAllApiName.People.cardSave
let _ = YHNetRequest.postRequest(url: strUrl, params: params) { [weak self] json, code in let _ = YHNetRequest.postRequest(url: strUrl, params: params) { [weak self] json, code in
...@@ -161,7 +168,8 @@ class YHEditViewModel: YHBaseViewModel { ...@@ -161,7 +168,8 @@ class YHEditViewModel: YHBaseViewModel {
func requestSaveSchool(callBackBlock:@escaping (_ success: Bool, _ error: YHErrorModel?)->()) { func requestSaveSchool(callBackBlock:@escaping (_ success: Bool, _ error: YHErrorModel?)->()) {
let education: [String: Any] = ["college": model.college, let education: [String: Any] = ["college": model.college,
"major": model.major, "major": model.major,
"background": model.background] "background": model.background,
"is_update": true]
let params: [String: Any] = ["education": education] let params: [String: Any] = ["education": education]
let strUrl = YHBaseUrlManager.shared.curURL() + YHAllApiName.People.cardSave let strUrl = YHBaseUrlManager.shared.curURL() + YHAllApiName.People.cardSave
let _ = YHNetRequest.postRequest(url: strUrl, params: params) { [weak self] json, code in let _ = YHNetRequest.postRequest(url: strUrl, params: params) { [weak self] json, code in
...@@ -179,7 +187,7 @@ class YHEditViewModel: YHBaseViewModel { ...@@ -179,7 +187,7 @@ class YHEditViewModel: YHBaseViewModel {
} }
func requestSaveAward(callBackBlock:@escaping (_ success: Bool, _ error: YHErrorModel?)->()) { func requestSaveAward(callBackBlock:@escaping (_ success: Bool, _ error: YHErrorModel?)->()) {
let award: [String: Any] = ["honor": model.honor] let award: [String: Any] = ["honor": model.honor, "is_update": true]
let params: [String: Any] = ["award": award] let params: [String: Any] = ["award": award]
let strUrl = YHBaseUrlManager.shared.curURL() + YHAllApiName.People.cardSave let strUrl = YHBaseUrlManager.shared.curURL() + YHAllApiName.People.cardSave
let _ = YHNetRequest.postRequest(url: strUrl, params: params) { [weak self] json, code in let _ = YHNetRequest.postRequest(url: strUrl, params: params) { [weak self] json, code in
...@@ -197,7 +205,7 @@ class YHEditViewModel: YHBaseViewModel { ...@@ -197,7 +205,7 @@ class YHEditViewModel: YHBaseViewModel {
} }
func requestSaveTopics(topics: [String], callBackBlock:@escaping (_ success: Bool, _ error: YHErrorModel?)->()) { func requestSaveTopics(topics: [String], callBackBlock:@escaping (_ success: Bool, _ error: YHErrorModel?)->()) {
let interest: [String: Any] = ["topics": topics] let interest: [String: Any] = ["topics": topics, "is_update": true]
let params: [String: Any] = ["interest": interest] let params: [String: Any] = ["interest": interest]
let strUrl = YHBaseUrlManager.shared.curURL() + YHAllApiName.People.cardSave let strUrl = YHBaseUrlManager.shared.curURL() + YHAllApiName.People.cardSave
let _ = YHNetRequest.postRequest(url: strUrl, params: params) { [weak self] json, code in let _ = YHNetRequest.postRequest(url: strUrl, params: params) { [weak self] json, code in
...@@ -213,4 +221,33 @@ class YHEditViewModel: YHBaseViewModel { ...@@ -213,4 +221,33 @@ class YHEditViewModel: YHBaseViewModel {
callBackBlock(false, err) callBackBlock(false, err)
} }
} }
func isCanNext(step: Int = 1) -> Bool {
if step == 1 {
let avatar = model.avatar
let username = model.username
let country = model.address.country
let provice = model.address.province
let city = model.address.city
guard avatar.count > 0 else { return false }
guard country.count > 0 else { return false }
guard username.count > 0 else { return false }
if country.contains("中国") {
guard provice.count > 0 else { return false }
guard city.count > 0 else { return false }
}
}
if step == 3 {
let college = model.college
guard college.count > 0 else { return false }
}
if step == 4 {
let position = model.position
let industry = model.industry
guard position.count > 0 else { return false }
guard industry.count > 0 else { return false }
}
return true
}
} }
...@@ -14,6 +14,8 @@ enum YHWholeScreenTipsViewType : Int { ...@@ -14,6 +14,8 @@ enum YHWholeScreenTipsViewType : Int {
case degreeType //学位类型 case degreeType //学位类型
case company //用人单位介绍 case company //用人单位介绍
case officialWebsite //用人单位官网 case officialWebsite //用人单位官网
case nameCardEducation // 匹配我的名片教育经验
case nameCardWorkExperience // 匹配我的名片工作经验
case hkPlanQ1 //赴港计划书问题1 case hkPlanQ1 //赴港计划书问题1
case hkPlanQ2 //赴港计划书问题2 case hkPlanQ2 //赴港计划书问题2
...@@ -74,6 +76,10 @@ class YHWholeScreenTipsView: UIView { ...@@ -74,6 +76,10 @@ class YHWholeScreenTipsView: UIView {
return "可先填写用人单位名称,选择指定的用人单位后,系统将为您自动填写单位介绍" return "可先填写用人单位名称,选择指定的用人单位后,系统将为您自动填写单位介绍"
case .officialWebsite: case .officialWebsite:
return "可先填写用人单位名称,选择指定的用人单位后,系统将为您自动填写单位官网" return "可先填写用人单位名称,选择指定的用人单位后,系统将为您自动填写单位官网"
case .nameCardEducation:
return "该栏目已对好友隐藏,若需重新开启,请前往信息授权处更新设置"
case .nameCardWorkExperience:
return "可先填写用人单位名称,选择指定的用人单位后,系统将为您自动填写单位官网"
case .hkPlanQ1: case .hkPlanQ1:
return "请以不超过100字简介你的主要事业成就,包括你在主要工作项目上曾担当的角色、你工作期间曾服务的知名机构/单位或你对有关工作项目及机构的重大贡献" return "请以不超过100字简介你的主要事业成就,包括你在主要工作项目上曾担当的角色、你工作期间曾服务的知名机构/单位或你对有关工作项目及机构的重大贡献"
case .hkPlanQ2: case .hkPlanQ2:
......
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "my_card_lead@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "my_card_lead@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