Commit 383d2e8f authored by pete谢兆麟's avatar pete谢兆麟

college_id逻辑添加

parent 2ea552a2
......@@ -196,7 +196,7 @@ class YHMyInformationItemCell: UITableViewCell {
case .school:
let vc = YHCollegeSearchViewController()
vc.searchCollegeName = self.dataSource?.message
vc.selectBlock = {[weak self] text in
vc.selectBlock = {[weak self] text, id in
guard let self = self else { return }
self.dataSource?.message = text
self.updateAllViews()
......
......@@ -12,7 +12,7 @@ class YHCollegeSearchViewController: YHBaseViewController {
var orderId:Int = 0
var searchCollegeName:String?
var selectBlock:((String?)->Void)?
var selectBlock:((String?, Int)->Void)?
var colleges:[YHCollegeInfo] = []
var isShowSureButton: Bool = true
let educationRequest:YHEducationRequestViewModel = YHEducationRequestViewModel()
......@@ -76,7 +76,7 @@ class YHCollegeSearchViewController: YHBaseViewController {
[weak self] in
guard let self = self else { return }
if let selectBlock = selectBlock {
selectBlock(searchBar.textField.text)
selectBlock(searchBar.textField.text, 0)
self.navigationController?.popViewController(animated: true)
}
}
......@@ -151,7 +151,7 @@ extension YHCollegeSearchViewController: UITableViewDelegate, UITableViewDataSou
if let selectBlock = selectBlock {
if indexPath.row < colleges.count {
let college:YHCollegeInfo = colleges[indexPath.row]
selectBlock(college.getCollegeName())
selectBlock(college.getCollegeName(), college.id)
self.navigationController?.popViewController(animated: true)
}
......
......@@ -349,13 +349,14 @@ extension YHGCEducationDetailVC : UITableViewDelegate, UITableViewDataSource {
vc.orderId = self.orderId
vc.searchCollegeName = detailInfo.college
vc.selectBlock = {
[weak self] text in
[weak self] text, id in
guard let self = self else { return }
if let text = text, !text.isEmpty {
detailInfo.college = text
} else {
detailInfo.college = ""
}
detailInfo.college_id = id
loadInfo()
saveInfoSilent()
}
......@@ -666,7 +667,8 @@ extension YHGCEducationDetailVC {
guard var dict:[String:Any] = detailInfo.toDictionary() else { return }
dict["order_id"] = self.orderId
dict["is_aboard_school"] = detailInfo.isSchoolInAboard()
dict["college_id"] = detailInfo.college_id
self.educationRequest.saveEducationInfo(params: dict, isSilent: !isShowToast) {
[weak self] success, error in
guard let self = self 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