Commit a2fc1004 authored by pete谢兆麟's avatar pete谢兆麟

人脉首页逻辑

parent 65304481
...@@ -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,12 @@ class YHPeopleViewController: YHBaseViewController { ...@@ -148,13 +170,12 @@ class YHPeopleViewController: YHBaseViewController {
@objc func didMatchBtnClicked() { @objc func didMatchBtnClicked() {
if true { if informationAuthorizeViewModel.model.is_fillin == 1 {
startMatchUsers() startMatchUsers()
return } else {
let vc = YHInformationAuthorizationStepOneViewController()
self.navigationController?.pushViewController(vc)
} }
let vc = YHInformationAuthorizationStepOneViewController()
self.navigationController?.pushViewController(vc)
} }
func resetAnimation() { func resetAnimation() {
......
...@@ -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 {
......
...@@ -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 }
} }
......
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