Commit 6fa6dd95 authored by pete谢兆麟's avatar pete谢兆麟

修复一些细节和bug

parent c12fe4fa
......@@ -71,7 +71,7 @@ class YHInformationAuthorizationStepTwoViewController: UIViewController {
button.backgroundColor = UIColor.brandMainColor
button.titleLabel?.font = UIFont.PFSC_M(ofSize: 16)
button.contentHorizontalAlignment = .center
button.setTitle("下一步", for: .normal)
button.setTitle("完成", for: .normal)
button.setTitleColor( UIColor(hex:0xffffff), for: .normal)
button.layer.cornerRadius = kCornerRadius3
button.addTarget(self, action: #selector(nextStep), for: .touchUpInside)
......@@ -110,6 +110,7 @@ class YHInformationAuthorizationStepTwoViewController: UIViewController {
make.bottom.equalTo(-k_Height_safeAreaInsetsBottom() - 64)
make.left.right.equalTo(view)
}
nextButton.setTitle("保存", for: .normal)
}
}
......
......@@ -92,6 +92,7 @@ class YHMatchUserViewController: YHBaseViewController {
self.rotateLottieView.isHidden = true
}
}
viewModel.requestUserAuthorization { success, error in }
}
func createUI() {
......@@ -169,8 +170,19 @@ class YHMatchUserViewController: YHBaseViewController {
YHOneKeyLoginManager.shared.oneKeyLogin()
return
}
if informationAuthorizeViewModel.model.is_fillin == 1 {
startMatchUsers()
if viewModel.setModel.authorization_basic_information == 2 {
startMatchUsers()
} else {
YHCommonAlertView.show("", "您暂未开启AI人脉匹配授权", "取消", "去开启") {
} callBack: {
let vc = YHInformationAuthorizationStepTwoViewController()
vc.stepFlag = false
self.navigationController?.pushViewController(vc)
}
}
} else {
let vc = YHInformationAuthorizationStepOneViewController()
self.navigationController?.pushViewController(vc)
......
......@@ -234,7 +234,7 @@ extension YHNameCardViewController {
func requestAuthorization() {
self.authorModel.requestUserAuthorization { success, error in
if self.authorModel.setModel.isclick_card != 2 {
if self.authorModel.setModel.isclick_card != 2 && self.authorModel.setModel.information_to_card != 2 {
YHCommonAlertView.show("", "授权信息同步至您的名片并对您的好友可见", "取消", "确认",fullGuestureEnable: false) {
self.authorModel.requestInformationToCardSubmit(agress: 1) { success, error in
self.requestNameCardInfo()
......
......@@ -13,6 +13,7 @@ class YHMatchUserViewModel: NSObject {
var matchUserArr:[YHMatchUserInfo?] = []
var nameCardInfo: YHUserNameCardInfo = YHUserNameCardInfo()
var friendListModel:YHFriendListModel = YHFriendListModel()
var setModel: YHMainUserInformationSetModel = YHMainUserInformationSetModel()
func getMatchUserlist(_ callBack: @escaping (_ success: Bool,_ error: YHErrorModel?)->()) {
let params = ["page_size" : 20]
......@@ -151,5 +152,26 @@ class YHMatchUserViewModel: NSObject {
}
}
func requestUserAuthorization(callBackBlock:@escaping (_ success: Bool, _ error: YHErrorModel?)->()) {
let strUrl = YHBaseUrlManager.shared.curURL() + YHAllApiName.People.userAuthorization
let _ = YHNetRequest.getRequest(url: strUrl) { [weak self] json, code in
//1. json字符串 转 对象
guard let self = self else { return }
if json.code == 200 {
let dic = json.data
guard let result = YHMainUserInformationSetModel.deserialize(from: dic as? Dictionary) else {
callBackBlock(false,nil)
return
}
self.setModel = result
callBackBlock(true, nil)
} else {
let error : YHErrorModel = YHErrorModel(errorCode:Int32(json.code), errorMsg: json.msg)
callBackBlock(false, error)
}
} failBlock: { err in
callBackBlock(false, err)
}
}
}
......@@ -88,6 +88,7 @@ class YHUserInfoSettingViewController: YHBaseViewController {
nameTextField = {
let textField = UITextField()
textField.delegate = self
textField.textColor = UIColor.mainTextColor
textField.font = UIFont.PFSC_M(ofSize: 15)
textField.adjustsFontSizeToFitWidth = true
......@@ -106,13 +107,15 @@ class YHUserInfoSettingViewController: YHBaseViewController {
nextButton = {
let button = UIButton(type: .custom)
button.backgroundColor = UIColor.brandMainColor
// button.backgroundColor = UIColor.brandMainColor
button.titleLabel?.font = UIFont.PFSC_M(ofSize: 16)
button.contentHorizontalAlignment = .center
button.setTitle("下一步", for: .normal)
button.setTitleColor( UIColor(hex:0xffffff), for: .normal)
button.layer.cornerRadius = kCornerRadius3
button.addTarget(self, action: #selector(nextStep), for: .touchUpInside)
button.isEnabled = false
button.backgroundColor = UIColor.brandMainColor.withAlphaComponent(0.4)
return button
}()
view.addSubview(nextButton)
......@@ -164,3 +167,26 @@ class YHUserInfoSettingViewController: YHBaseViewController {
}
}
}
extension YHUserInfoSettingViewController: UITextFieldDelegate {
func textFieldDidEndEditing(_ textField: UITextField) {
}
func textField(_ textField: UITextField, shouldChangeCharactersIn range: NSRange, replacementString string: String) -> Bool {
let newText = (textField.text! as NSString).replacingCharacters(in: range, with: string)
if newText.count > 0 {
nextButton.isEnabled = true
nextButton.backgroundColor = UIColor.brandMainColor
} else {
nextButton.isEnabled = false
nextButton.backgroundColor = UIColor.brandMainColor.withAlphaComponent(0.4)
}
if newText.count > 20 {
return false
}
return true
}
}
......@@ -100,7 +100,7 @@ extension YHEditWorkViewController: UITableViewDelegate, UITableViewDataSource {
cell.block = { [weak self] model in
guard let self = self else { return }
self.viewModel.updateModel(model)
if model.id != .id5 || model.id != .id10 {
if model.id != .id5 && model.id != .id10 {
self.getData()
}
if self.viewModel.isCanNext(step: 4) {
......
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