Commit 43f6466d authored by pete谢兆麟's avatar pete谢兆麟

国家

parent 93677158
...@@ -207,6 +207,7 @@ extension YHImagePickerView: UINavigationControllerDelegate, UIImagePickerContro ...@@ -207,6 +207,7 @@ extension YHImagePickerView: UINavigationControllerDelegate, UIImagePickerContro
func imagePickerController(_ picker: UIImagePickerController, didFinishPickingMediaWithInfo info: [UIImagePickerController.InfoKey : Any]) { func imagePickerController(_ picker: UIImagePickerController, didFinishPickingMediaWithInfo info: [UIImagePickerController.InfoKey : Any]) {
if let image = info[UIImagePickerController.InfoKey.originalImage] as? UIImage { if let image = info[UIImagePickerController.InfoKey.originalImage] as? UIImage {
uploadImage(image: image) uploadImage(image: image)
self.dismiss()
} else { } else {
printLog("pick image wrong") printLog("pick image wrong")
} }
...@@ -265,6 +266,7 @@ extension YHImagePickerView: UINavigationControllerDelegate, UIImagePickerContro ...@@ -265,6 +266,7 @@ extension YHImagePickerView: UINavigationControllerDelegate, UIImagePickerContro
} }
} }
// Alamofire上传
func uploadImage(image: UIImage) { func uploadImage(image: UIImage) {
// 获取图片的二进制数据 // 获取图片的二进制数据
guard let imageData = image.jpegData(compressionQuality: 1) else { return } guard let imageData = image.jpegData(compressionQuality: 1) else { return }
......
...@@ -14,8 +14,11 @@ class YHSelectCountryViewModel: NSObject { ...@@ -14,8 +14,11 @@ class YHSelectCountryViewModel: NSObject {
} }
func requestCountry(_ key: String, callBackBlock:@escaping (_ success: [YHCountryMessage?]?, _ error:YHErrorModel?)->()) { func requestCountry(_ key: String, callBackBlock:@escaping (_ success: [YHCountryMessage?]?, _ error:YHErrorModel?)->()) {
let strUrl = YHBaseUrlManager.shared.curURL() + "frontend/country?keyword=\(key)" let strUrl = YHBaseUrlManager.shared.curURL() + YHAllApiName.OrderInformation.countryInformation
YHNetRequest.getRequest(url: strUrl) { [weak self] json, code in // "frontend/country?keyword=\(key)"
let params: [String : Any] = ["keyword": key]
YHNetRequest.getRequest(url: strUrl, params: params) { [weak self] json, code in
//1. json字符串 转 对象 //1. json字符串 转 对象
guard let self = self else { return } guard let self = self else { return }
guard let model = NetBaseModel.deserialize(dict: json) else { guard let model = NetBaseModel.deserialize(dict: json) else {
......
...@@ -99,5 +99,7 @@ class YHAllApiName { ...@@ -99,5 +99,7 @@ class YHAllApiName {
static let getInformation = "infoflow/order-information/get_information" static let getInformation = "infoflow/order-information/get_information"
// 主申请人信息更新 // 主申请人信息更新
static let updateInformation = "infoflow/order-information/update_information" static let updateInformation = "infoflow/order-information/update_information"
// 主申请人国家信息
static let countryInformation = "infoflow/country"
} }
} }
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