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 {
}
func getData() {
items = viewModel.getBaseDataSource()
tableView.reloadData()
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)
}
}
}
func setView() {
......@@ -164,17 +176,28 @@ class YHInformationAuthorizationStepOneViewController: YHBaseViewController {
YHImagePickerView.show() {[weak self] image in
guard let self = self else { return }
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() {
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() {
viewModel.requestSaveUserInfo {[weak self] success, error in
guard let self = self else { return }
let vc = YHInformationAuthorizationStepTwoViewController()
self.navigationController?.pushViewController(vc)
}
}
}
extension YHInformationAuthorizationStepOneViewController: UITableViewDelegate, UITableViewDataSource {
......@@ -196,7 +219,8 @@ extension YHInformationAuthorizationStepOneViewController: UITableViewDelegate,
nextButton.backgroundColor = UIColor.brandMainColor.withAlphaComponent(0.4)
}
if model.id != .id1 && model.id != .id3 && model.id != .id5 {
self.getData()
self.items = viewModel.getBaseDataSource()
self.tableView.reloadData()
}
}
return cell
......
......@@ -24,8 +24,16 @@ class YHInformationAuthorizationStepTwoViewController: UIViewController {
}
func getData() {
if stepFlag {
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() {
......@@ -106,7 +114,10 @@ class YHInformationAuthorizationStepTwoViewController: UIViewController {
}
@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 {
return
}
let view = YHPeopleSuccessView(frame: CGRect(x: 0, y: 0, width: KScreenWidth, height: KScreenHeight))
let window = UIApplication.shared.yhKeyWindow()
window?.addSubview(view)
// let view = YHPeopleSuccessView(frame: CGRect(x: 0, y: 0, width: KScreenWidth, height: KScreenHeight))
// let window = UIApplication.shared.yhKeyWindow()
// window?.addSubview(view)
let vc = YHInformationAuthorizationStepOneViewController()
self.navigationController?.pushViewController(vc)
}
func resetAnimation() {
......
......@@ -56,8 +56,26 @@ class YHMainUserInformationModel: YHBaseModel {
}
class YHMainUserInformationSetModel: YHBaseModel {
var isRea: Bool = true
var isWork: Bool = true
var isSchool: Bool = true
var uid: String = ""
var information_to_card: Int = 2
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 {
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 userAuthorization = "super-app/user/authorization"
}
}
......@@ -69,7 +69,7 @@ class YHOSSManager: NSObject, URLSessionDelegate {
}
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)
guard let imageData = image.compressOriginalImage(size) else {
callBackBlock(nil, YHErrorModel())
......@@ -87,6 +87,7 @@ class YHOSSManager: NSObject, URLSessionDelegate {
let currentDateMMdd = dateFormatter.string(from: Date())
self.fileName.append(name)
if isPublic {
request.acl = "public-read-write"
request.objectKey = "5000000" + "/" + currentDateMMdd + "/" + "\(name)"
} else {
request.objectKey = "4001001" + "/" + currentDateMMdd + "/" + "\(name)"
......@@ -121,7 +122,7 @@ class YHOSSManager: NSObject, URLSessionDelegate {
}
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 {
callBackBlock(nil, YHErrorModel())
return
......@@ -138,6 +139,7 @@ class YHOSSManager: NSObject, URLSessionDelegate {
dateFormatter.dateFormat = "yyyyMMdd"
let currentDateMMdd = dateFormatter.string(from: Date())
if isPublic {
request.acl = "public-read-write"
request.objectKey = "5000000" + "/" + currentDateMMdd + "/" + "\(name)"
} else {
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