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

登录接口 判断登录使用

parent a408d40d
......@@ -136,7 +136,7 @@ extension YHActivityDetailViewController {
YHOneKeyLoginManager.shared.oneKeyLogin()
YHLoginManager.shared.loginSuccessActionBlock = {[weak self] in
guard self != nil else { return }
self?.gotoTheRightVcForStatus()
self?.loadData()
YHLoginManager.shared.loginSuccessActionBlock = nil
}
}
......@@ -184,8 +184,16 @@ extension YHActivityDetailViewController {
self.navigationController?.pushViewController(vc)
}
} else {
let msg = error?.errorMsg ?? "报名失败,请重试"
YHHUD.flash(message: msg)
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 {
let msg = error?.errorMsg ?? "报名失败,请重试"
YHHUD.flash(message: msg)
}
}
}
}
......
......@@ -110,9 +110,11 @@ extension YHApplyActivityResultViewController {
}
if isSuccessFlag {
statusImageV.image = UIImage(named: "activity_apply_result_success")
nameLabel.text = "已报名成功活动【" + activityName + "】,记得准时参加哦"
} else {
statusImageV.image = UIImage(named: "activity_apply_result_fail")
nameLabel.text = "活动【" + activityName + "】,活动时间已结束,请您看看其他活动~"
}
}
......
......@@ -160,7 +160,7 @@ extension YHActivityTitleItemView {
}
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 {
label.textColor = UIColor.mainTextColor
label.textAlignment = .left
label.font = UIFont.PFSC_M(ofSize:18)
label.text = "哈佛爸爸线下教育沙龙哈佛爸爸线下教育沙龙哈佛爸爸线下教育沙龙哈佛爸爸线下教育沙龙"
label.numberOfLines = 2
label.text = ""
label.numberOfLines = 0
label.lineBreakMode = .byCharWrapping
return label
}()
......@@ -77,7 +78,7 @@ class YHActivityTravelitemView: UIView {
label.textColor = UIColor.mainTextColor
label.textAlignment = .left
label.font = UIFont.PFSC_R(ofSize:14)
label.text = "深圳市本元大厦26A银河集团体验中心深圳市本元大厦26A银河集团体验中心深圳市本元大厦26A银河集团体验中心深圳市本元大厦26A银河集团体验中心深圳市本元大厦26A银河集团体验中心"
label.text = ""
label.numberOfLines = 0
return label
}()
......@@ -88,7 +89,7 @@ class YHActivityTravelitemView: UIView {
label.textColor = UIColor.mainTextColor50
label.textAlignment = .left
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
return label
}()
......
......@@ -27,18 +27,20 @@ class YHInformationAuthorizationStepOneViewController: YHBaseViewController {
}
func getData() {
viewModel.requestUserInfo {[weak self] success, error in
guard let self = self else { return }
self.items = viewModel.getBaseDataSource()
self.tableView.reloadData()
let url = URL(string: self.viewModel.model.avatar)
self.photoImageView.kf.setImage(with: url)
if self.viewModel.isCanNext() {
nextButton.isEnabled = true
nextButton.backgroundColor = UIColor.brandMainColor
} else {
nextButton.isEnabled = false
nextButton.backgroundColor = UIColor.brandMainColor.withAlphaComponent(0.4)
if YHLoginManager.shared.isLogin() {
viewModel.requestUserInfo {[weak self] success, error in
guard let self = self else { return }
self.items = viewModel.getBaseDataSource()
self.tableView.reloadData()
let url = URL(string: self.viewModel.model.avatar)
self.photoImageView.kf.setImage(with: url)
if self.viewModel.isCanNext() {
nextButton.isEnabled = true
nextButton.backgroundColor = UIColor.brandMainColor
} else {
nextButton.isEnabled = false
nextButton.backgroundColor = UIColor.brandMainColor.withAlphaComponent(0.4)
}
}
}
}
......
......@@ -76,24 +76,28 @@ class YHMatchUserViewController: YHBaseViewController {
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
self.bottomBtn.setTitle("开启AI人脉雷达", for: .normal)
} else {
self.firstImageView.isHidden = true
self.bottomLabel.isHidden = true
self.headLottieView.isHidden = false
self.launchLottieView.isHidden = false
self.rotateLottieView.isHidden = true
self.bottomBtn.setTitle("AI人脉雷达匹配", for: .normal)
if YHLoginManager.shared.isLogin() {
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
self.bottomBtn.setTitle("开启AI人脉雷达", for: .normal)
} else {
self.firstImageView.isHidden = true
self.bottomLabel.isHidden = true
self.headLottieView.isHidden = false
self.launchLottieView.isHidden = false
self.rotateLottieView.isHidden = true
self.bottomBtn.setTitle("AI人脉雷达匹配", for: .normal)
}
}
}
viewModel.requestUserAuthorization { success, error in }
}
......
......@@ -95,7 +95,7 @@ class YHInformationAuthorizeViewModel: YHBaseViewModel {
}
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
//1. json字符串 转 对象
guard let self = self else { return }
......
......@@ -27,21 +27,24 @@ class YHUserInfoSettingViewController: YHBaseViewController {
}
func getData() {
userViewModel.requestUserInfo {[weak self] success, error in
guard let self = self else { return }
let url = URL(string: self.userViewModel.model.avatar)
self.photoImageView.kf.setImage(with: url)
self.nameTextField.text = self.userViewModel.model.username
if self.nameTextField.text?.count != 0 {
self.nextButton.isEnabled = true
self.nextButton.backgroundColor = UIColor.brandMainColor
} else {
self.nextButton.isEnabled = false
self.nextButton.backgroundColor = UIColor.brandMainColor.withAlphaComponent(0.4)
if YHLoginManager.shared.isLogin() {
userViewModel.requestUserInfo {[weak self] success, error in
guard let self = self else { return }
let url = URL(string: self.userViewModel.model.avatar)
self.photoImageView.kf.setImage(with: url)
self.nameTextField.text = self.userViewModel.model.username
if self.nameTextField.text?.count != 0 {
self.nextButton.isEnabled = true
self.nextButton.backgroundColor = UIColor.brandMainColor
} else {
self.nextButton.isEnabled = false
self.nextButton.backgroundColor = UIColor.brandMainColor.withAlphaComponent(0.4)
}
}
}
}
func setView() {
gk_navTitle = "设置"
gk_navLeftBarButtonItems = []
......
......@@ -346,7 +346,7 @@ class YHAllApiName {
static let change = "super-app/avatar/change"
static let userSubmit = "super-app/user-base/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 cardSave = "super-app/business-card/save"
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