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
} }
} }
...@@ -183,12 +183,20 @@ extension YHActivityDetailViewController { ...@@ -183,12 +183,20 @@ extension YHActivityDetailViewController {
vc.activityName = self.viewModel.activityDetailModel?.name ?? "" vc.activityName = self.viewModel.activityDetailModel?.name ?? ""
self.navigationController?.pushViewController(vc) self.navigationController?.pushViewController(vc)
} }
} else {
if error?.errorCode == 10001 {
let vc = YHApplyActivityResultViewController()
vc.isSuccessFlag = false
vc.activityTravelId = self.viewModel.travelModel?.id ?? ""
vc.activityName = self.viewModel.activityDetailModel?.name ?? ""
self.navigationController?.pushViewController(vc)
} else { } else {
let msg = error?.errorMsg ?? "报名失败,请重试" let msg = error?.errorMsg ?? "报名失败,请重试"
YHHUD.flash(message: msg) YHHUD.flash(message: msg)
} }
} }
} }
}
} }
extension YHActivityDetailViewController: UITableViewDelegate, UITableViewDataSource { extension YHActivityDetailViewController: UITableViewDelegate, UITableViewDataSource {
......
...@@ -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,6 +27,7 @@ class YHInformationAuthorizationStepOneViewController: YHBaseViewController { ...@@ -27,6 +27,7 @@ class YHInformationAuthorizationStepOneViewController: YHBaseViewController {
} }
func getData() { func getData() {
if YHLoginManager.shared.isLogin() {
viewModel.requestUserInfo {[weak self] success, error in viewModel.requestUserInfo {[weak self] success, error in
guard let self = self else { return } guard let self = self else { return }
self.items = viewModel.getBaseDataSource() self.items = viewModel.getBaseDataSource()
...@@ -42,6 +43,7 @@ class YHInformationAuthorizationStepOneViewController: YHBaseViewController { ...@@ -42,6 +43,7 @@ class YHInformationAuthorizationStepOneViewController: YHBaseViewController {
} }
} }
} }
}
func setView() { func setView() {
gk_navTitle = "设置" gk_navTitle = "设置"
......
...@@ -76,6 +76,8 @@ class YHMatchUserViewController: YHBaseViewController { ...@@ -76,6 +76,8 @@ class YHMatchUserViewController: YHBaseViewController {
override func viewWillAppear(_ animated: Bool) { override func viewWillAppear(_ animated: Bool) {
super.viewWillAppear(animated) super.viewWillAppear(animated)
if YHLoginManager.shared.isLogin() {
informationAuthorizeViewModel.requestUserInfo {[weak self] success, error in informationAuthorizeViewModel.requestUserInfo {[weak self] success, error in
guard let self = self else { return } guard let self = self else { return }
if informationAuthorizeViewModel.model.is_fillin != 1 { if informationAuthorizeViewModel.model.is_fillin != 1 {
...@@ -94,6 +96,8 @@ class YHMatchUserViewController: YHBaseViewController { ...@@ -94,6 +96,8 @@ class YHMatchUserViewController: YHBaseViewController {
self.bottomBtn.setTitle("AI人脉雷达匹配", for: .normal) 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,6 +27,7 @@ class YHUserInfoSettingViewController: YHBaseViewController { ...@@ -27,6 +27,7 @@ class YHUserInfoSettingViewController: YHBaseViewController {
} }
func getData() { func getData() {
if YHLoginManager.shared.isLogin() {
userViewModel.requestUserInfo {[weak self] success, error in userViewModel.requestUserInfo {[weak self] success, error in
guard let self = self else { return } guard let self = self else { return }
let url = URL(string: self.userViewModel.model.avatar) let url = URL(string: self.userViewModel.model.avatar)
...@@ -41,6 +42,8 @@ class YHUserInfoSettingViewController: YHBaseViewController { ...@@ -41,6 +42,8 @@ class YHUserInfoSettingViewController: YHBaseViewController {
} }
} }
} }
}
func setView() { func setView() {
gk_navTitle = "设置" gk_navTitle = "设置"
......
...@@ -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