Commit 92dabbb5 authored by pete谢兆麟's avatar pete谢兆麟

协助后台编程

parent f095a76c
...@@ -93,7 +93,7 @@ class YHMainApplicantInformationViewController: YHBaseViewController { ...@@ -93,7 +93,7 @@ class YHMainApplicantInformationViewController: YHBaseViewController {
guard let self = self else { return } guard let self = self else { return }
if self.viewModel.isCanNext(self.stepView.currentIndex) { if self.viewModel.isCanNext(self.stepView.currentIndex) {
self.stepView.currentIndex = self.stepView.currentIndex + 1 self.stepView.currentIndex = self.stepView.currentIndex + 1
self.viewModel.updateMainInformation(.submit) {[weak self] success in self.viewModel.updateMainInformation(.submit, self.orderId) {[weak self] success in
guard let self = self else { return } guard let self = self else { return }
self.isShowPrompt = false self.isShowPrompt = false
self.stepView.currentIndex = self.stepView.currentIndex self.stepView.currentIndex = self.stepView.currentIndex
...@@ -112,7 +112,7 @@ class YHMainApplicantInformationViewController: YHBaseViewController { ...@@ -112,7 +112,7 @@ class YHMainApplicantInformationViewController: YHBaseViewController {
} }
bottom.saveBlock = { [weak self] in bottom.saveBlock = { [weak self] in
guard let self = self else { return } guard let self = self else { return }
self.viewModel.updateMainInformation(.save) {[weak self] success in self.viewModel.updateMainInformation(.save, self.orderId) {[weak self] success in
guard let self = self else { return } guard let self = self else { return }
} }
} }
......
...@@ -209,10 +209,10 @@ class YHMainApplicantInformationViewModel: YHBaseViewModel { ...@@ -209,10 +209,10 @@ class YHMainApplicantInformationViewModel: YHBaseViewModel {
func requestMainInformation(_ orderID: String, callBackBlock:@escaping (_ success: YHMainInformationModel?, _ error:YHErrorModel?)->()) { func requestMainInformation(_ orderID: String, callBackBlock:@escaping (_ success: YHMainInformationModel?, _ error:YHErrorModel?)->()) {
// /infoflow/order-information/get_information?order_id=9402 // /infoflow/order-information/get_information?order_id=9402
let strUrl = YHBaseUrlManager.shared.curURL() + YHAllApiName.OrderInformation.getInformation let strUrl = YHBaseUrlManager.shared.curURL() + YHAllApiName.OrderInformation.getInformation + "?order_id=\(orderID)"
// let strUrl = "http://192.168.25.48:18088/" + YHAllApiName.OrderInformation.getInformation // let strUrl = "http://192.168.25.48:18088/" + YHAllApiName.OrderInformation.getInformation + "?order_id=\(orderID)"
let params: [String : Any] = ["order_id": orderID] // let params: [String : Any] = ["order_id": orderID]
let _ = YHNetRequest.getRequest(url: strUrl, params: params) { [weak self] json, code in let _ = YHNetRequest.getRequest(url: strUrl) { [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 {
...@@ -233,7 +233,7 @@ class YHMainApplicantInformationViewModel: YHBaseViewModel { ...@@ -233,7 +233,7 @@ class YHMainApplicantInformationViewModel: YHBaseViewModel {
} }
} }
func updateMainInformation(_ saveType: YHSaveType, callBackBlock:@escaping (_ success: Bool)->()) { func updateMainInformation(_ saveType: YHSaveType,_ orderID: Int, callBackBlock:@escaping (_ success: Bool)->()) {
var type = "" var type = ""
if saveType == .save { if saveType == .save {
type = "save" type = "save"
...@@ -279,12 +279,12 @@ class YHMainApplicantInformationViewModel: YHBaseViewModel { ...@@ -279,12 +279,12 @@ class YHMainApplicantInformationViewModel: YHBaseViewModel {
"has_hk_id": mainModel.has_hk_id ?? 0, "has_hk_id": mainModel.has_hk_id ?? 0,
"hk_id_number": mainModel.hk_id_number ?? "", "hk_id_number": mainModel.hk_id_number ?? "",
"id": mainModel.id ?? 0, "id": mainModel.id ?? 0,
"is_handled": mainModel.is_handled ?? "", "is_handled": mainModel.is_handled ?? 0,
"is_live_oversea_year": mainModel.is_live_oversea_year ?? 0, "is_live_oversea_year": mainModel.is_live_oversea_year ?? 0,
"married": mainModel.married ?? 0, "married": mainModel.married ?? 0,
"mobile": mainModel.mobile ?? "", "mobile": mainModel.mobile ?? "",
"nationality": mainModel.nationality ?? "", "nationality": mainModel.nationality ?? "",
"order_id": mainModel.order_id ?? "", "order_id": orderID,
"sex": mainModel.sex ?? 0, "sex": mainModel.sex ?? 0,
"step": mainModel.step ?? 0, "step": mainModel.step ?? 0,
"surname": mainModel.surname ?? "", "surname": mainModel.surname ?? "",
...@@ -297,9 +297,11 @@ class YHMainApplicantInformationViewModel: YHBaseViewModel { ...@@ -297,9 +297,11 @@ class YHMainApplicantInformationViewModel: YHBaseViewModel {
"hk_macao_pass": hkID, "hk_macao_pass": hkID,
"passport": passport] "passport": passport]
] ]
// let strUrl = "http://192.168.25.48:18088/" + YHAllApiName.OrderInformation.updateInformation
let strUrl = YHBaseUrlManager.shared.curURL() + YHAllApiName.OrderInformation.updateInformation let strUrl = YHBaseUrlManager.shared.curURL() + YHAllApiName.OrderInformation.updateInformation
let _ = YHNetRequest.postRequest(url: strUrl, params: params) { [weak self] json, code in let _ = YHNetRequest.postRequest(url: strUrl, params: params) { [weak self] json, code in
guard let self = self else { return } guard let self = self else { return }
printLog("code = \(json["code"]) ---- message =\(json["msg"])")
callBackBlock(true) callBackBlock(true)
} failBlock: { err in } failBlock: { err in
callBackBlock(false) callBackBlock(false)
......
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