Commit 8e312416 authored by pete谢兆麟's avatar pete谢兆麟

调试主申请人接口

parent 316c9140
......@@ -325,6 +325,7 @@ extension YHInformationPerfectListVC : UITableViewDelegate,UITableViewDataSource
if indexPath.row == 0 {
//主申请人信息
let vc = YHMainApplicantInformationViewController()
vc.orderId = orderId ?? 0
navigationController?.pushViewController(vc)
} else if indexPath.row == 1 {
//家庭程序信息
......
......@@ -16,6 +16,7 @@ class YHMainApplicantInformationViewController: YHBaseViewController {
var viewModel: YHMainApplicantInformationViewModel!
var dataSource: [YHSectionItemModel]?
var isShowPrompt: Bool = false
var orderId: Int = 0
override func viewDidLoad() {
super.viewDidLoad()
......@@ -27,7 +28,7 @@ class YHMainApplicantInformationViewController: YHBaseViewController {
}
func getData() {
viewModel.requestMainInformation("133969") {[weak self] success, error in
viewModel.requestMainInformation("\(orderId)") {[weak self] success, error in
guard let self = self else { return }
self.stepView.currentIndex = self.viewModel.mainModel.step ?? 0
self.updateDataSource()
......
......@@ -19,8 +19,8 @@ struct YHMainInformationModel: SmartCodable {
var birthday: String?
var age: String?
var birth_place_aboard: Int?
var sex: String?
var married: String?
var sex: Int?
var married: Int?
var mobile: String?
var email: String?
var address_aboard: Int?
......
......@@ -7,6 +7,7 @@
//
import UIKit
import SmartCodable
enum YHSaveType: Int {
case save = 0
......@@ -93,8 +94,8 @@ class YHMainApplicantInformationViewModel: YHBaseViewModel {
}
let item5 = YHItemModel(id: .id26, isNeed: true, title: "出生城市", isUserKeyBoard: false, prompts: "请选择", message: string, type: .address, isShowPrompts: isShowPrompt)
let item55 = YHItemModel(id: .id34, isNeed: true, title: "出生城市", isUserKeyBoard: true, prompts: "请输入", message: mainModel.birth_place?.foreign, isShowPrompts: isShowPrompt)
let item6 = YHItemModel(id: .id27, isNeed: true, title: "性别", isUserKeyBoard: false, prompts: "请选择", message: mainModel.sex, type: .sex)
let item7 = YHItemModel(id: .id28, isNeed: true, title: "婚姻状况", isUserKeyBoard: false, prompts: "请选择", message: mainModel.married, type: .marry, isShowPrompts: isShowPrompt)
let item6 = YHItemModel(id: .id27, isNeed: true, title: "性别", isUserKeyBoard: false, prompts: "请选择", message: "\(mainModel.sex ?? 0)", type: .sex)
let item7 = YHItemModel(id: .id28, isNeed: true, title: "婚姻状况", isUserKeyBoard: false, prompts: "请选择", message: "\(mainModel.married ?? 0)", type: .marry, isShowPrompts: isShowPrompt)
var item555 = item5
if mainModel.birth_place_aboard == 1 {
item555 = item55
......@@ -185,9 +186,9 @@ class YHMainApplicantInformationViewModel: YHBaseViewModel {
case .id26:
mainModel.birth_place?.area = item.value
case .id27:
mainModel.sex = item.value?.first
mainModel.sex = item.value?.first?.int
case .id28:
mainModel.married = item.value?.first
mainModel.married = item.value?.first?.int
case .id29:
mainModel.mobile = item.message
case .id30:
......@@ -207,7 +208,9 @@ class YHMainApplicantInformationViewModel: YHBaseViewModel {
func requestMainInformation(_ orderID: String, callBackBlock:@escaping (_ success: YHMainInformationModel?, _ error:YHErrorModel?)->()) {
// /infoflow/order-information/get_information?order_id=9402
let strUrl = YHBaseUrlManager.shared.curURL() + YHAllApiName.OrderInformation.getInformation
// let strUrl = "http://192.168.25.48:18088/" + YHAllApiName.OrderInformation.getInformation
let params: [String : Any] = ["order_id": orderID]
let _ = YHNetRequest.getRequest(url: strUrl, params: params) { [weak self] json, code in
//1. json字符串 转 对象
......@@ -355,14 +358,14 @@ class YHMainApplicantInformationViewModel: YHBaseViewModel {
let birth_place_aboard = mainModel.birth_place_aboard ?? 0
let birth_place_area = mainModel.birth_place?.area ?? []
let birth_place_foreign = mainModel.birth_place?.foreign ?? ""
let sex = mainModel.sex ?? ""
let married = mainModel.married ?? ""
let sex = mainModel.sex ?? 0
let married = mainModel.married ?? 0
let mobile = mainModel.mobile ?? ""
let email = mainModel.email ?? ""
let has_hk_id = mainModel.has_hk_id ?? 0
let hk_id_numbe = mainModel.hk_id_number ?? ""
if birth_place_aboard == 1 {
if username.count != 0 && birthday.count != 0 && birth_place_foreign.count != 0 && sex.count != 0 && married.count != 0 && mobile.count != 0 && email.count != 0 {
if username.count != 0 && birthday.count != 0 && birth_place_foreign.count != 0 && mobile.count != 0 && email.count != 0 {
if has_hk_id == 1 {
if hk_id_numbe.count != 0 {
return true
......@@ -376,7 +379,7 @@ class YHMainApplicantInformationViewModel: YHBaseViewModel {
return false
}
} else {
if username.count != 0 && birthday.count != 0 && birth_place_area.count != 0 && sex.count != 0 && married.count != 0 && mobile.count != 0 && email.count != 0 {
if username.count != 0 && birthday.count != 0 && birth_place_area.count != 0 && mobile.count != 0 && email.count != 0 {
if has_hk_id == 1 {
if hk_id_numbe.count != 0 {
return true
......
......@@ -155,45 +155,50 @@ extension YHMyViewController : UITableViewDelegate, UITableViewDataSource {
}
func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
if (indexPath.row >= items.count) { return }
let vc = YHMainApplicantInformationViewController()
vc.orderId = 134438
navigationController?.pushViewController(vc)
if !checkLogin() {
let vc = UINavigationController(rootVC: YHPhoneLoginViewController())
vc.modalPresentationStyle = .custom
self.navigationController?.present(vc, animated: true)
} else {
YHHUD.flash(message: "已登录: 功能完善中...")
}
return //for test hjl
let item: PersonalModuleItem = items[indexPath.row];
if item.title == "关于我们" {
let vc = YHAboutUsViewController()
self.navigationController?.pushViewController(vc)
} else if item.title == "我的设置" {
let account = "duyu"
let token = "123456"
let vc = ConversationController()
self.navigationController?.pushViewController(vc)
IMKitClient.instance.loginIM(account, token) { error in
if let err = error {
print("login error in app : ", err.localizedDescription)
}else {
let _ = NEAtMessageManager.instance
}
}
} else {
// let vc = YHLoginViewController()
// if (indexPath.row >= items.count) { return }
//
// if !checkLogin() {
// let vc = UINavigationController(rootVC: YHPhoneLoginViewController())
// vc.modalPresentationStyle = .custom
// self.navigationController?.present(vc, animated: true)
// } else {
// YHHUD.flash(message: "已登录: 功能完善中...")
// }
// return //for test hjl
//
// let item: PersonalModuleItem = items[indexPath.row];
//
// if item.title == "关于我们" {
// let vc = YHAboutUsViewController()
// self.navigationController?.pushViewController(vc)
}
//
// } else if item.title == "我的设置" {
//
// let account = "duyu"
// let token = "123456"
// let vc = ConversationController()
// self.navigationController?.pushViewController(vc)
//
// IMKitClient.instance.loginIM(account, token) { error in
// if let err = error {
// print("login error in app : ", err.localizedDescription)
// }else {
// let _ = NEAtMessageManager.instance
//
// }
// }
//
//
//
// } else {
//// let vc = YHLoginViewController()
//// self.navigationController?.pushViewController(vc)
// }
}
}
......
......@@ -232,6 +232,7 @@ class YHNetRequest: NSObject {
let dittt = self.handleJsonObjectNullValue(serverDict)
suclock(dittt as? [String : Any] ?? [:], statusCode)
// suclock(serverDict, statusCode)
} else {
guard let errorBlock = self.failure else { return }
......
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