Commit 69d6d19a authored by Steven杜宇's avatar Steven杜宇

Merge branch '630-dev' of http://gitlab.galaxy-immi.com/mobile-group/galaxy-iOS into 630-dev

parents 0f3df602 cab92121
...@@ -27,8 +27,20 @@ class YHInformationAuthorizationStepOneViewController: YHBaseViewController { ...@@ -27,8 +27,20 @@ class YHInformationAuthorizationStepOneViewController: YHBaseViewController {
} }
func getData() { func getData() {
items = viewModel.getBaseDataSource() viewModel.requestUserInfo {[weak self] success, error in
tableView.reloadData() 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)
}
}
} }
func setView() { func setView() {
...@@ -164,16 +176,27 @@ class YHInformationAuthorizationStepOneViewController: YHBaseViewController { ...@@ -164,16 +176,27 @@ class YHInformationAuthorizationStepOneViewController: YHBaseViewController {
YHImagePickerView.show() {[weak self] image in YHImagePickerView.show() {[weak self] image in
guard let self = self else { return } guard let self = self else { return }
self.photoImageView.image = image self.photoImageView.image = image
self.viewModel.uploadImage(image, true) {[weak self] success, error in
guard let self = self else { return }
self.viewModel.model.avatar = success ?? ""
}
} }
} }
@objc func changeHead() { @objc func changeHead() {
viewModel.requestChangeHead {[weak self] success, error in
guard let self = self else { return }
let url = URL(string: self.viewModel.model.avatar)
self.photoImageView.kf.setImage(with: url)
}
} }
@objc func nextStep() { @objc func nextStep() {
let vc = YHInformationAuthorizationStepTwoViewController() viewModel.requestSaveUserInfo {[weak self] success, error in
self.navigationController?.pushViewController(vc) guard let self = self else { return }
let vc = YHInformationAuthorizationStepTwoViewController()
self.navigationController?.pushViewController(vc)
}
} }
} }
...@@ -196,7 +219,8 @@ extension YHInformationAuthorizationStepOneViewController: UITableViewDelegate, ...@@ -196,7 +219,8 @@ extension YHInformationAuthorizationStepOneViewController: UITableViewDelegate,
nextButton.backgroundColor = UIColor.brandMainColor.withAlphaComponent(0.4) nextButton.backgroundColor = UIColor.brandMainColor.withAlphaComponent(0.4)
} }
if model.id != .id1 && model.id != .id3 && model.id != .id5 { if model.id != .id1 && model.id != .id3 && model.id != .id5 {
self.getData() self.items = viewModel.getBaseDataSource()
self.tableView.reloadData()
} }
} }
return cell return cell
......
...@@ -24,8 +24,16 @@ class YHInformationAuthorizationStepTwoViewController: UIViewController { ...@@ -24,8 +24,16 @@ class YHInformationAuthorizationStepTwoViewController: UIViewController {
} }
func getData() { func getData() {
items = viewModel.getBaseSetDataSource() if stepFlag {
tableView.reloadData() items = viewModel.getBaseSetDataSource()
tableView.reloadData()
} else {
viewModel.requestUserAuthorization {[weak self] success, error in
guard let self = self else { return }
items = viewModel.getBaseSetDataSource()
tableView.reloadData()
}
}
} }
func setView() { func setView() {
...@@ -106,7 +114,10 @@ class YHInformationAuthorizationStepTwoViewController: UIViewController { ...@@ -106,7 +114,10 @@ class YHInformationAuthorizationStepTwoViewController: UIViewController {
} }
@objc func nextStep() { @objc func nextStep() {
viewModel.requestAuthorizationSubmit {[weak self] success, error in
guard let self = self else { return }
self.navigationController?.popViewController(animated: true)
}
} }
} }
......
...@@ -153,9 +153,11 @@ class YHPeopleViewController: YHBaseViewController { ...@@ -153,9 +153,11 @@ class YHPeopleViewController: YHBaseViewController {
return return
} }
let view = YHPeopleSuccessView(frame: CGRect(x: 0, y: 0, width: KScreenWidth, height: KScreenHeight)) // let view = YHPeopleSuccessView(frame: CGRect(x: 0, y: 0, width: KScreenWidth, height: KScreenHeight))
let window = UIApplication.shared.yhKeyWindow() // let window = UIApplication.shared.yhKeyWindow()
window?.addSubview(view) // window?.addSubview(view)
let vc = YHInformationAuthorizationStepOneViewController()
self.navigationController?.pushViewController(vc)
} }
func resetAnimation() { func resetAnimation() {
......
...@@ -56,8 +56,26 @@ class YHMainUserInformationModel: YHBaseModel { ...@@ -56,8 +56,26 @@ class YHMainUserInformationModel: YHBaseModel {
} }
class YHMainUserInformationSetModel: YHBaseModel { class YHMainUserInformationSetModel: YHBaseModel {
var isRea: Bool = true var uid: String = ""
var isWork: Bool = true var information_to_card: Int = 2
var isSchool: Bool = true var authorization_basic_information: Int = 2
var public_education_experience: Int = 2
var public_work_experience: Int = 2
var isclick_card: Int = 2
}
class YHUserInformationDetailModel: YHBaseModel {
var username: String = ""
var avatar: String = ""
var address: YHUserInformationDetailAddressModel = YHUserInformationDetailAddressModel()
var college: String = ""
var industry: String = ""
var position: String = ""
}
class YHUserInformationDetailAddressModel: YHBaseModel {
var country: String = ""
var province: String = ""
var city: String = ""
} }
...@@ -322,6 +322,8 @@ class YHAllApiName { ...@@ -322,6 +322,8 @@ 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 userAuthorization = "super-app/user/authorization"
} }
} }
...@@ -69,7 +69,7 @@ class YHOSSManager: NSObject, URLSessionDelegate { ...@@ -69,7 +69,7 @@ class YHOSSManager: NSObject, URLSessionDelegate {
} }
func putObject(image: UIImage, _ isPublic: Bool = false, callBackBlock:@escaping (_ success: String?, _ error:YHErrorModel?)->()) { func putObject(image: UIImage, _ isPublic: Bool = false, callBackBlock:@escaping (_ success: String?, _ error:YHErrorModel?)->()) {
let request = OSSPutObjectRequest() let request = OSSPutObjectACLRequest()
let size = Int(2 * 1024 * 1024) let size = Int(2 * 1024 * 1024)
guard let imageData = image.compressOriginalImage(size) else { guard let imageData = image.compressOriginalImage(size) else {
callBackBlock(nil, YHErrorModel()) callBackBlock(nil, YHErrorModel())
...@@ -87,6 +87,7 @@ class YHOSSManager: NSObject, URLSessionDelegate { ...@@ -87,6 +87,7 @@ class YHOSSManager: NSObject, URLSessionDelegate {
let currentDateMMdd = dateFormatter.string(from: Date()) let currentDateMMdd = dateFormatter.string(from: Date())
self.fileName.append(name) self.fileName.append(name)
if isPublic { if isPublic {
request.acl = "public-read-write"
request.objectKey = "5000000" + "/" + currentDateMMdd + "/" + "\(name)" request.objectKey = "5000000" + "/" + currentDateMMdd + "/" + "\(name)"
} else { } else {
request.objectKey = "4001001" + "/" + currentDateMMdd + "/" + "\(name)" request.objectKey = "4001001" + "/" + currentDateMMdd + "/" + "\(name)"
...@@ -121,7 +122,7 @@ class YHOSSManager: NSObject, URLSessionDelegate { ...@@ -121,7 +122,7 @@ class YHOSSManager: NSObject, URLSessionDelegate {
} }
func putFile(file: String, _ isPublic: Bool = false, callBackBlock:@escaping (_ success: String?, _ error:YHErrorModel?)->()) { func putFile(file: String, _ isPublic: Bool = false, callBackBlock:@escaping (_ success: String?, _ error:YHErrorModel?)->()) {
let request = OSSPutObjectRequest() let request = OSSPutObjectACLRequest()
guard let fileData = try? Data(contentsOf: URL(string: file) ?? URL(fileURLWithPath: "")) else { guard let fileData = try? Data(contentsOf: URL(string: file) ?? URL(fileURLWithPath: "")) else {
callBackBlock(nil, YHErrorModel()) callBackBlock(nil, YHErrorModel())
return return
...@@ -138,6 +139,7 @@ class YHOSSManager: NSObject, URLSessionDelegate { ...@@ -138,6 +139,7 @@ class YHOSSManager: NSObject, URLSessionDelegate {
dateFormatter.dateFormat = "yyyyMMdd" dateFormatter.dateFormat = "yyyyMMdd"
let currentDateMMdd = dateFormatter.string(from: Date()) let currentDateMMdd = dateFormatter.string(from: Date())
if isPublic { if isPublic {
request.acl = "public-read-write"
request.objectKey = "5000000" + "/" + currentDateMMdd + "/" + "\(name)" request.objectKey = "5000000" + "/" + currentDateMMdd + "/" + "\(name)"
} else { } else {
request.objectKey = "4001001" + "/" + currentDateMMdd + "/" + "\(name)" request.objectKey = "4001001" + "/" + currentDateMMdd + "/" + "\(name)"
......
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