Commit 6139bc19 authored by David黄金龙's avatar David黄金龙

登录接口 判断登录使用

parent a408d40d
...@@ -136,7 +136,7 @@ extension YHActivityDetailViewController { ...@@ -136,7 +136,7 @@ extension YHActivityDetailViewController {
YHOneKeyLoginManager.shared.oneKeyLogin() YHOneKeyLoginManager.shared.oneKeyLogin()
YHLoginManager.shared.loginSuccessActionBlock = {[weak self] in YHLoginManager.shared.loginSuccessActionBlock = {[weak self] in
guard self != nil else { return } guard self != nil else { return }
self?.gotoTheRightVcForStatus() self?.loadData()
YHLoginManager.shared.loginSuccessActionBlock = nil YHLoginManager.shared.loginSuccessActionBlock = nil
} }
} }
...@@ -184,8 +184,16 @@ extension YHActivityDetailViewController { ...@@ -184,8 +184,16 @@ extension YHActivityDetailViewController {
self.navigationController?.pushViewController(vc) self.navigationController?.pushViewController(vc)
} }
} else { } else {
let msg = error?.errorMsg ?? "报名失败,请重试" if error?.errorCode == 10001 {
YHHUD.flash(message: msg) let vc = YHApplyActivityResultViewController()
vc.isSuccessFlag = false
vc.activityTravelId = self.viewModel.travelModel?.id ?? ""
vc.activityName = self.viewModel.activityDetailModel?.name ?? ""
self.navigationController?.pushViewController(vc)
} else {
let msg = error?.errorMsg ?? "报名失败,请重试"
YHHUD.flash(message: msg)
}
} }
} }
} }
......
...@@ -110,9 +110,11 @@ extension YHApplyActivityResultViewController { ...@@ -110,9 +110,11 @@ extension YHApplyActivityResultViewController {
} }
if isSuccessFlag { if isSuccessFlag {
statusImageV.image = UIImage(named: "activity_apply_result_success")
nameLabel.text = "已报名成功活动【" + activityName + "】,记得准时参加哦" nameLabel.text = "已报名成功活动【" + activityName + "】,记得准时参加哦"
} else { } else {
statusImageV.image = UIImage(named: "activity_apply_result_fail")
nameLabel.text = "活动【" + activityName + "】,活动时间已结束,请您看看其他活动~"
} }
} }
......
...@@ -160,7 +160,7 @@ extension YHActivityTitleItemView { ...@@ -160,7 +160,7 @@ extension YHActivityTitleItemView {
} }
nameTextView.attributed.text = """ nameTextView.attributed.text = """
\("哈佛爸爸线哈 ", .foreground(UIColor.mainTextColor), .font(UIFont.PFSC_B(ofSize:24)))\(.image(UIImage(named: "activity_vip_icon2")!,.custom(.offset(CGPoint(x: 0, y: -7)), size: .init(width: 44, height: 34)))) \("", .foreground(UIColor.mainTextColor), .font(UIFont.PFSC_B(ofSize:24)))\(.image(UIImage(named: "activity_vip_icon2")!,.custom(.offset(CGPoint(x: 0, y: -7)), size: .init(width: 44, height: 34))))
""" """
} }
} }
...@@ -37,8 +37,9 @@ class YHActivityTravelitemView: UIView { ...@@ -37,8 +37,9 @@ class YHActivityTravelitemView: UIView {
label.textColor = UIColor.mainTextColor label.textColor = UIColor.mainTextColor
label.textAlignment = .left label.textAlignment = .left
label.font = UIFont.PFSC_M(ofSize:18) label.font = UIFont.PFSC_M(ofSize:18)
label.text = "哈佛爸爸线下教育沙龙哈佛爸爸线下教育沙龙哈佛爸爸线下教育沙龙哈佛爸爸线下教育沙龙" label.text = ""
label.numberOfLines = 2 label.numberOfLines = 0
label.lineBreakMode = .byCharWrapping
return label return label
}() }()
...@@ -77,7 +78,7 @@ class YHActivityTravelitemView: UIView { ...@@ -77,7 +78,7 @@ class YHActivityTravelitemView: UIView {
label.textColor = UIColor.mainTextColor label.textColor = UIColor.mainTextColor
label.textAlignment = .left label.textAlignment = .left
label.font = UIFont.PFSC_R(ofSize:14) label.font = UIFont.PFSC_R(ofSize:14)
label.text = "深圳市本元大厦26A银河集团体验中心深圳市本元大厦26A银河集团体验中心深圳市本元大厦26A银河集团体验中心深圳市本元大厦26A银河集团体验中心深圳市本元大厦26A银河集团体验中心" label.text = ""
label.numberOfLines = 0 label.numberOfLines = 0
return label return label
}() }()
...@@ -88,7 +89,7 @@ class YHActivityTravelitemView: UIView { ...@@ -88,7 +89,7 @@ class YHActivityTravelitemView: UIView {
label.textColor = UIColor.mainTextColor50 label.textColor = UIColor.mainTextColor50
label.textAlignment = .left label.textAlignment = .left
label.font = UIFont.PFSC_R(ofSize:14) label.font = UIFont.PFSC_R(ofSize:14)
label.text = "距地铁10号线亮马站D口步行62距地铁10号线亮马站D口步行62距地铁10号线亮马站D口步行62距地铁10号线亮马站D口步行62" label.text = ""
label.numberOfLines = 0 label.numberOfLines = 0
return label return label
}() }()
......
...@@ -27,18 +27,20 @@ class YHInformationAuthorizationStepOneViewController: YHBaseViewController { ...@@ -27,18 +27,20 @@ class YHInformationAuthorizationStepOneViewController: YHBaseViewController {
} }
func getData() { func getData() {
viewModel.requestUserInfo {[weak self] success, error in if YHLoginManager.shared.isLogin() {
guard let self = self else { return } viewModel.requestUserInfo {[weak self] success, error in
self.items = viewModel.getBaseDataSource() guard let self = self else { return }
self.tableView.reloadData() self.items = viewModel.getBaseDataSource()
let url = URL(string: self.viewModel.model.avatar) self.tableView.reloadData()
self.photoImageView.kf.setImage(with: url) let url = URL(string: self.viewModel.model.avatar)
if self.viewModel.isCanNext() { self.photoImageView.kf.setImage(with: url)
nextButton.isEnabled = true if self.viewModel.isCanNext() {
nextButton.backgroundColor = UIColor.brandMainColor nextButton.isEnabled = true
} else { nextButton.backgroundColor = UIColor.brandMainColor
nextButton.isEnabled = false } else {
nextButton.backgroundColor = UIColor.brandMainColor.withAlphaComponent(0.4) nextButton.isEnabled = false
nextButton.backgroundColor = UIColor.brandMainColor.withAlphaComponent(0.4)
}
} }
} }
} }
......
...@@ -76,24 +76,28 @@ class YHMatchUserViewController: YHBaseViewController { ...@@ -76,24 +76,28 @@ class YHMatchUserViewController: YHBaseViewController {
override func viewWillAppear(_ animated: Bool) { override func viewWillAppear(_ animated: Bool) {
super.viewWillAppear(animated) super.viewWillAppear(animated)
informationAuthorizeViewModel.requestUserInfo {[weak self] success, error in
guard let self = self else { return } if YHLoginManager.shared.isLogin() {
if informationAuthorizeViewModel.model.is_fillin != 1 { informationAuthorizeViewModel.requestUserInfo {[weak self] success, error in
self.firstImageView.isHidden = false guard let self = self else { return }
self.bottomLabel.isHidden = false if informationAuthorizeViewModel.model.is_fillin != 1 {
self.headLottieView.isHidden = true self.firstImageView.isHidden = false
self.launchLottieView.isHidden = true self.bottomLabel.isHidden = false
self.rotateLottieView.isHidden = true self.headLottieView.isHidden = true
self.bottomBtn.setTitle("开启AI人脉雷达", for: .normal) self.launchLottieView.isHidden = true
} else { self.rotateLottieView.isHidden = true
self.firstImageView.isHidden = true self.bottomBtn.setTitle("开启AI人脉雷达", for: .normal)
self.bottomLabel.isHidden = true } else {
self.headLottieView.isHidden = false self.firstImageView.isHidden = true
self.launchLottieView.isHidden = false self.bottomLabel.isHidden = true
self.rotateLottieView.isHidden = true self.headLottieView.isHidden = false
self.bottomBtn.setTitle("AI人脉雷达匹配", for: .normal) self.launchLottieView.isHidden = false
self.rotateLottieView.isHidden = true
self.bottomBtn.setTitle("AI人脉雷达匹配", for: .normal)
}
} }
} }
viewModel.requestUserAuthorization { success, error in } viewModel.requestUserAuthorization { success, error in }
} }
......
...@@ -95,7 +95,7 @@ class YHInformationAuthorizeViewModel: YHBaseViewModel { ...@@ -95,7 +95,7 @@ class YHInformationAuthorizeViewModel: YHBaseViewModel {
} }
func requestUserInfo(callBackBlock:@escaping (_ success: Bool, _ error: YHErrorModel?)->()) { func requestUserInfo(callBackBlock:@escaping (_ success: Bool, _ error: YHErrorModel?)->()) {
let strUrl = YHBaseUrlManager.shared.curURL() + YHAllApiName.People.userInfo let strUrl = YHBaseUrlManager.shared.curURL() + YHAllApiName.People.userInfoApi
let _ = YHNetRequest.getRequest(url: strUrl) { [weak self] json, code in let _ = YHNetRequest.getRequest(url: strUrl) { [weak self] json, code in
//1. json字符串 转 对象 //1. json字符串 转 对象
guard let self = self else { return } guard let self = self else { return }
......
...@@ -27,21 +27,24 @@ class YHUserInfoSettingViewController: YHBaseViewController { ...@@ -27,21 +27,24 @@ class YHUserInfoSettingViewController: YHBaseViewController {
} }
func getData() { func getData() {
userViewModel.requestUserInfo {[weak self] success, error in if YHLoginManager.shared.isLogin() {
guard let self = self else { return } userViewModel.requestUserInfo {[weak self] success, error in
let url = URL(string: self.userViewModel.model.avatar) guard let self = self else { return }
self.photoImageView.kf.setImage(with: url) let url = URL(string: self.userViewModel.model.avatar)
self.nameTextField.text = self.userViewModel.model.username self.photoImageView.kf.setImage(with: url)
if self.nameTextField.text?.count != 0 { self.nameTextField.text = self.userViewModel.model.username
self.nextButton.isEnabled = true if self.nameTextField.text?.count != 0 {
self.nextButton.backgroundColor = UIColor.brandMainColor self.nextButton.isEnabled = true
} else { self.nextButton.backgroundColor = UIColor.brandMainColor
self.nextButton.isEnabled = false } else {
self.nextButton.backgroundColor = UIColor.brandMainColor.withAlphaComponent(0.4) self.nextButton.isEnabled = false
self.nextButton.backgroundColor = UIColor.brandMainColor.withAlphaComponent(0.4)
}
} }
} }
} }
func setView() { func setView() {
gk_navTitle = "设置" gk_navTitle = "设置"
gk_navLeftBarButtonItems = [] gk_navLeftBarButtonItems = []
......
...@@ -346,7 +346,7 @@ class YHAllApiName { ...@@ -346,7 +346,7 @@ class YHAllApiName {
static let change = "super-app/avatar/change" static let change = "super-app/avatar/change"
static let userSubmit = "super-app/user-base/submit" static let userSubmit = "super-app/user-base/submit"
static let authorizationSubmit = "super-app/authorization/submit" static let authorizationSubmit = "super-app/authorization/submit"
static let userInfo = "super-app/user-base/info" static let userInfoApi = "super-app/user-base/info"
static let userAuthorization = "super-app/user/authorization" static let userAuthorization = "super-app/user/authorization"
static let cardSave = "super-app/business-card/save" static let cardSave = "super-app/business-card/save"
static let businessCardAuthorize = "super-app/business-card/authorize" static let businessCardAuthorize = "super-app/business-card/authorize"
......
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