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

省市区改成省市

parent e99d7f85
......@@ -10,6 +10,7 @@
04010B952B6A1DE90093F3BB /* YHSaveAndSubmitView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04010B942B6A1DE90093F3BB /* YHSaveAndSubmitView.swift */; };
040ED45F2B91711A005CA3F8 /* YHCNIDCardModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 040ED45E2B91711A005CA3F8 /* YHCNIDCardModel.swift */; };
040ED4612B9173DE005CA3F8 /* YHHKIDCardModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 040ED4602B9173DE005CA3F8 /* YHHKIDCardModel.swift */; };
040ED4632B91BC33005CA3F8 /* area.plist in Resources */ = {isa = PBXBuildFile; fileRef = 040ED4622B91BC33005CA3F8 /* area.plist */; };
0413A6D82B8C76290006D154 /* YHCertificateUploadVC.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0413A6D72B8C76290006D154 /* YHCertificateUploadVC.swift */; };
041B52872B5657B3007EBCEB /* IMAppKey.swift in Sources */ = {isa = PBXBuildFile; fileRef = 041B52862B5657B3007EBCEB /* IMAppKey.swift */; };
041B528D2B5E58FA007EBCEB /* YHFormItemDoubleChoiceCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 041B528C2B5E58FA007EBCEB /* YHFormItemDoubleChoiceCell.swift */; };
......@@ -65,7 +66,6 @@
0468D4512B67721700CFB916 /* YHMainInformationCardTableViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0468D4502B67721700CFB916 /* YHMainInformationCardTableViewCell.swift */; };
0468D4532B6782BE00CFB916 /* YHCardExampleView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0468D4522B6782BE00CFB916 /* YHCardExampleView.swift */; };
0468D4552B6889A500CFB916 /* YHDatePickView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0468D4542B6889A500CFB916 /* YHDatePickView.swift */; };
0468D4772B68A08600CFB916 /* area.plist in Resources */ = {isa = PBXBuildFile; fileRef = 0468D4712B68A08600CFB916 /* area.plist */; };
0468D4782B68A08600CFB916 /* YHAddressModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0468D4722B68A08600CFB916 /* YHAddressModel.swift */; };
0468D4792B68A08600CFB916 /* YHAddressViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0468D4732B68A08600CFB916 /* YHAddressViewController.swift */; };
0468D47A2B68A08600CFB916 /* YHAddressPickViewTableViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0468D4742B68A08600CFB916 /* YHAddressPickViewTableViewCell.swift */; };
......@@ -309,6 +309,7 @@
04010B942B6A1DE90093F3BB /* YHSaveAndSubmitView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHSaveAndSubmitView.swift; sourceTree = "<group>"; };
040ED45E2B91711A005CA3F8 /* YHCNIDCardModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHCNIDCardModel.swift; sourceTree = "<group>"; };
040ED4602B9173DE005CA3F8 /* YHHKIDCardModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHHKIDCardModel.swift; sourceTree = "<group>"; };
040ED4622B91BC33005CA3F8 /* area.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = area.plist; sourceTree = "<group>"; };
0413A6D72B8C76290006D154 /* YHCertificateUploadVC.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHCertificateUploadVC.swift; sourceTree = "<group>"; };
041B52862B5657B3007EBCEB /* IMAppKey.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = IMAppKey.swift; sourceTree = "<group>"; };
041B528C2B5E58FA007EBCEB /* YHFormItemDoubleChoiceCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHFormItemDoubleChoiceCell.swift; sourceTree = "<group>"; };
......@@ -364,7 +365,6 @@
0468D4502B67721700CFB916 /* YHMainInformationCardTableViewCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHMainInformationCardTableViewCell.swift; sourceTree = "<group>"; };
0468D4522B6782BE00CFB916 /* YHCardExampleView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHCardExampleView.swift; sourceTree = "<group>"; };
0468D4542B6889A500CFB916 /* YHDatePickView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHDatePickView.swift; sourceTree = "<group>"; };
0468D4712B68A08600CFB916 /* area.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = area.plist; sourceTree = "<group>"; };
0468D4722B68A08600CFB916 /* YHAddressModel.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = YHAddressModel.swift; sourceTree = "<group>"; };
0468D4732B68A08600CFB916 /* YHAddressViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = YHAddressViewController.swift; sourceTree = "<group>"; };
0468D4742B68A08600CFB916 /* YHAddressPickViewTableViewCell.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = YHAddressPickViewTableViewCell.swift; sourceTree = "<group>"; };
......@@ -771,7 +771,7 @@
0468D4702B68A08600CFB916 /* YHAddressPicker */ = {
isa = PBXGroup;
children = (
0468D4712B68A08600CFB916 /* area.plist */,
040ED4622B91BC33005CA3F8 /* area.plist */,
0468D4722B68A08600CFB916 /* YHAddressModel.swift */,
0468D4732B68A08600CFB916 /* YHAddressViewController.swift */,
0468D4742B68A08600CFB916 /* YHAddressPickViewTableViewCell.swift */,
......@@ -1681,7 +1681,7 @@
A5C5B2EE2B4F9B8800A7C5D1 /* Localizable.xcstrings in Resources */,
042F88952B84AFC7008B60BD /* YHQuestionList.plist in Resources */,
A58951C52B398D1000225C19 /* Launch Screen.storyboard in Resources */,
0468D4772B68A08600CFB916 /* area.plist in Resources */,
040ED4632B91BC33005CA3F8 /* area.plist in Resources */,
A51044182B493675006B60BB /* README.md in Resources */,
A5573EDB2B317C0000D98EC0 /* Assets.xcassets in Resources */,
);
......
......@@ -29,7 +29,8 @@ class YHMainApplicantInformationViewController: YHBaseViewController {
func getData() {
viewModel.requestMainInformation("\(orderId)") {[weak self] success, error in
guard let self = self else { return }
self.stepView.currentIndex = self.viewModel.mainModel.step ?? 0
self.stepView.maxIndex = self.viewModel.mainModel.step
self.stepView.currentIndex = self.viewModel.mainModel.step
self.updateDataSource()
}
}
......@@ -148,7 +149,7 @@ extension YHMainApplicantInformationViewController: UITableViewDelegate, UITable
guard let self = self else { return }
self.viewModel.updateModel(model)
let id = model.id
if id != .id32 && id != .id4 && id != .id8 && id != .id9 && id != .id12 && id != .id13 && id != .id21 && id != .id22 && id != .id23 && id != .id34 && id != .id29 && id != .id30 && id != .id35 {
if id != .id32 && id != .id4 && id != .id8 && id != .id9 && id != .id12 && id != .id13 && id != .id17 && id != .id18 && id != .id21 && id != .id22 && id != .id23 && id != .id34 && id != .id29 && id != .id30 && id != .id35 {
self.updateDataSource()
}
}
......
......@@ -10,7 +10,7 @@ import Foundation
struct YHCountryModel {
var provincesArray: [YHProvincesModel] = []
init(dic: [String:[String:[String]]]) {
init(dic: [String:[String]]) {
for (key,value) in dic {
let model = YHProvincesModel(name: key, dic: value)
provincesArray.append(model)
......@@ -24,26 +24,18 @@ struct YHCountryModel {
struct YHProvincesModel {
var provincesName: String = ""
var cityArray: [YHCityModel] = []
init(name : String ,dic:[String: [String]]) {
init(name : String ,dic:[String]) {
provincesName = name
for (key,value) in dic {
let model = YHCityModel(name: key, Arr: value)
for value in dic {
let model = YHCityModel(name: value)
cityArray.append(model)
cityArray.sort { a, b in
a.cityName < b.cityName
}
}
}
}
struct YHCityModel {
var cityName: String = ""
var areaArray: [String] = []
init(name: String,Arr: [String]) {
init(name: String) {
cityName = name
for str in Arr {
areaArray.append(str)
}
areaArray.sort(by: <)
}
}
......@@ -12,7 +12,6 @@ import UIKit
enum YHLocationPickViewTableViewType {
case provinces //省份
case city //城市
case area //地区
}
class YHAddressPickView: UIView {
......@@ -80,25 +79,6 @@ class YHAddressPickView: UIView {
model.cityName
})
self.tableView.reloadData()
case .area:
/// 选择地区时没有上方热门城市View,有titleSV
self.tableView.tableHeaderView = UIView()
self.tableView.frame = CGRect(x: 0, y: 136, width: UIScreen.main.bounds.width, height: 367)
self.titleSV.isHidden = false
self.leftLabel.isHidden = false
/// 通过修改titleSV中button的选中状态来修改它的颜色
for button in buttonArr {
button.isSelected = false
if button.tag == 2 {
button.isSelected = true
}
}
/// 滚动titleSV中button下滚动的Line
UIView.animate(withDuration: 0.3, animations: {() -> Void in
self.underLine.center = CGPoint(x: self.buttonArr[2].center.x, y: self.underLine.center.y)
})
self.dataArray = cityModel?.areaArray
self.tableView.reloadData()
}
}
}
......@@ -206,8 +186,8 @@ class YHAddressPickView: UIView {
titleSV = UIScrollView(frame: CGRect(x: 0, y: 72, width: UIScreen.main.bounds.width, height: 44))
self.underLine = UIView(frame: CGRect(x: 0, y: 40, width: 30, height: 2))
self.underLine.backgroundColor = selectColor
for i in 0..<3 {
let button = UIButton(frame: CGRect(x: 24 + CGFloat(i) * (UIScreen.main.bounds.width - 47) / 3, y: 0, width: UIScreen.main.bounds.width / 3, height: 44))
for i in 0..<2 {
let button = UIButton(frame: CGRect(x: 24 + CGFloat(i) * (UIScreen.main.bounds.width - 47) / 2, y: 0, width: UIScreen.main.bounds.width / 3, height: 44))
button.tag = Int(i)
if i == 1 {
button.isSelected = true
......@@ -250,8 +230,6 @@ class YHAddressPickView: UIView {
let hotCity = ["北京市","上海市","广州市","深圳市","杭州市","南京市","苏州市","天津市","武汉市","长沙市","重庆市","成都市"]
let tag = sender.tag
setHotCityData(province: hotProvince[tag], city: hotCity[tag])
self.tableViewType = .area
}
/// 选择view.type
@objc private func onClickTitlebutton(sender: UIButton) {
......@@ -280,16 +258,19 @@ class YHAddressPickView: UIView {
}) {
self.cityModel = cityModel
self.selectedCity = city
self.tableViewType = .area
}
}
}
}
let selectLocation = selectedProvince + " " + selectedCity + " " + selectedArea
if backLocationString != nil {
backLocationString!(selectLocation,selectedProvince,selectedCity,selectedArea)
}
}
/// 从area.plist获取全部地区数据
private func initLocationData() {
guard let dic = NSDictionary(contentsOfFile: Bundle.main.path(forResource: "area", ofType: "plist") ?? "") as? [String:[String:[String]]] else {
guard let dic = NSDictionary(contentsOfFile: Bundle.main.path(forResource: "area", ofType: "plist") ?? "") as? [String:[String]] else {
return
}
locationModel = YHCountryModel(dic: dic)
......@@ -330,10 +311,6 @@ extension YHAddressPickView: UITableViewDelegate,UITableViewDataSource {
/// 当前为选择城市状态时,保存选中城市,刷新状态为选择地区
selectedCity = (self.provincesModel?.cityArray[indexPath.row - 1])?.cityName ?? ""
self.cityModel = self.provincesModel?.cityArray.first(where: {$0.cityName == selectedCity})
self.tableViewType = .area
case .area:
/// 当前为选择地区状态时,保存选中地区,执行回调block.将选中数据回调
selectedArea = self.dataArray![indexPath.row - 1]
let selectLocation = selectedProvince + " " + selectedCity + " " + selectedArea
if backLocationString != nil {
backLocationString!(selectLocation,selectedProvince,selectedCity,selectedArea)
......
......@@ -167,12 +167,27 @@ class YHItemView: UIView {
case .time: break
case .image: break
case .id:
messageTextField.text = YHFormPickerViewSubType.certificate(YHPickerViewCertificateType(rawValue: dataSource.message?.int ?? 0) ?? .chineseStatelessTravelPassport).title
let arr = YHOtherInfoFillViewModel.arrIdType
arr.forEach { item in
if item["id"] == dataSource.message {
messageTextField.text = item["title"]
}
}
case .country: break
case .sex:
messageTextField.text = YHFormPickerViewSubType.gender(YHPickerViewGenderType(rawValue: dataSource.message?.int ?? 0) ?? .female).title
let arr = YHOtherInfoFillViewModel.arrSex
arr.forEach { item in
if item["id"] == dataSource.message {
messageTextField.text = item["title"]
}
}
case .marry:
messageTextField.text = YHFormPickerViewSubType.marriage(YHPickerViewMarriageType(rawValue: dataSource.message?.int ?? 0) ?? .unmarriage).title
let arr = YHOtherInfoFillViewModel.arrMarry
arr.forEach { item in
if item["id"] == dataSource.message {
messageTextField.text = item["title"]
}
}
}
}
nextStepImageView.isHidden = false
......@@ -278,15 +293,16 @@ class YHItemView: UIView {
}
@objc func centerClick() {
UIViewController.current?.view.endEditing(true) // 收起键盘
guard let type = dataSource?.type else { return }
switch type {
case .normal:
printLog("不需要跳转")
case .address:
let addressPicker = YHAddressViewController( selectProvince: "上海市", selectCity: "" )
let addressPicker = YHAddressViewController()
addressPicker.backLocationStringController = { (address,province,city,area) in
self.dataSource?.message = address
self.dataSource?.value = [province, city, area]
self.dataSource?.value = [province, city]
self.updateAllViews()
if let block = self.block {
block(self.dataSource ?? YHItemModel())
......@@ -315,10 +331,10 @@ class YHItemView: UIView {
let window = UIApplication.shared.yhKeyWindow()
window?.addSubview(view)
case .id:
YHFormPickerView.show(type: .certificate, selectTitle: "公务通行证") { selectType in
// 选择类型的标题
self.dataSource?.message = selectType.title
self.dataSource?.value = ["\(selectType.index)"]
YHOtherPickerView.show(type: .idType) {[weak self] data in
guard let self = self else { return }
self.dataSource?.message = data.title
self.dataSource?.value = [data.index]
self.updateAllViews()
if let block = self.block {
block(self.dataSource ?? YHItemModel())
......@@ -335,20 +351,20 @@ class YHItemView: UIView {
}
UIViewController.current?.navigationController?.pushViewController(vc)
case .sex:
YHFormPickerView.show(type: .gender, selectType: .gender(.female)) { selectType in
// 选择类型的标题
self.dataSource?.message = selectType.title
self.dataSource?.value = ["\(selectType.index)"]
YHOtherPickerView.show(type: .sex) {[weak self] data in
guard let self = self else { return }
self.dataSource?.message = data.title
self.dataSource?.value = [data.index]
self.updateAllViews()
if let block = self.block {
block(self.dataSource ?? YHItemModel())
}
}
case .marry:
YHFormPickerView.show(type: .marriage, selectType: .marriage(.divorced)) { selectType in
// 选择类型的标题
self.dataSource?.message = selectType.title
self.dataSource?.value = ["\(selectType.index)"]
YHOtherPickerView.show(type: .marry) {[weak self] data in
guard let self = self else { return }
self.dataSource?.message = data.title
self.dataSource?.value = [data.index]
self.updateAllViews()
if let block = self.block {
block(self.dataSource ?? YHItemModel())
......
......@@ -23,6 +23,7 @@ class YHStepView: UIScrollView {
updateView(dataSource ?? [])
}
}
var maxIndex: Int = 0
var stepSpace: CGFloat = 6
var lineWidth: CGFloat {
guard let dataSource = dataSource else { return 0 }
......@@ -141,7 +142,7 @@ class YHStepView: UIScrollView {
@objc func buttonClick(_ button: UIButton) {
let tag = button.tag
if tag - 1000 < currentIndex {
if tag - 1000 <= maxIndex {
currentIndex = tag - 1000
if let block = block {
block(currentIndex)
......
......@@ -61,18 +61,24 @@ class YHMainApplicantInformationViewModel: YHBaseViewModel {
let item3 = YHItemModel(id: .id11, isNeed: flag, title: "届满日期", isUserKeyBoard: false, prompts: "请选择", message: mainModel.certificates.cn_identity_card.issue_date_end_at, type: .time, isShowPrompts: isShowPrompt)
let section = YHSectionItemModel(title: "中国身份证", models: [item, item1, item2, item3])
let item10 = YHItemModel(id: .id12, isNeed: true, title: "身份证号码", isUserKeyBoard: true, prompts: "请输入", message: mainModel.certificates.hk_macao_pass.number, isShowPrompts: isShowPrompt)
let item10 = YHItemModel(id: .id12, isNeed: true, title: "旅行证件号码", isUserKeyBoard: true, prompts: "请输入", message: mainModel.certificates.hk_macao_pass.number, isShowPrompts: isShowPrompt)
let item11 = YHItemModel(id: .id13, isNeed: true, title: "签发地", isUserKeyBoard: true, prompts: "请输入", message: mainModel.certificates.hk_macao_pass.issue_at, isShowPrompts: isShowPrompt)
let item12 = YHItemModel(id: .id14, isNeed: true, title: "签发日期", isUserKeyBoard: false, prompts: "请选择", message: mainModel.certificates.hk_macao_pass.issue_date_start_at, type: .time, isShowPrompts: isShowPrompt)
let item13 = YHItemModel(id: .id15, isNeed: true, title: "届满日期", isUserKeyBoard: false, prompts: "请选择", message: mainModel.certificates.hk_macao_pass.issue_date_end_at, type: .time, isShowPrompts: isShowPrompt)
let section1 = YHSectionItemModel(title: "港澳通行证", models: [item10, item11, item12, item13])
let item4 = YHItemModel(id: .id16, isNeed: false, title: "证件类别", isUserKeyBoard: false, prompts: "请选择", message: mainModel.certificates.passport.passport_type, type: .id, isShowPrompts: isShowPrompt)
let item5 = YHItemModel(id: .id17, isNeed: false, title: "证件号码", isUserKeyBoard: true, prompts: "请输入", message: mainModel.certificates.passport.number, isShowPrompts: isShowPrompt)
let item6 = YHItemModel(id: .id18, isNeed: false, title: "签发地", isUserKeyBoard: true, prompts: "请输入", message: mainModel.certificates.passport.issue_at, isShowPrompts: isShowPrompt)
let item7 = YHItemModel(id: .id19, isNeed: false, title: "签发日期", isUserKeyBoard: false, prompts: "请选择", message: mainModel.certificates.passport.issue_date_start_at, type: .time, isShowPrompts: isShowPrompt)
let item8 = YHItemModel(id: .id20, isNeed: false, title: "届满日期", isUserKeyBoard: false, prompts: "请选择", message: mainModel.certificates.passport.issue_date_end_at, type: .time, isShowPrompts: isShowPrompt)
let section2 = YHSectionItemModel(title: "护照及其他旅行证件(选填)", models: [item4, item5, item6, item7, item8])
let item4 = YHItemModel(id: .id16, isNeed: !flag, title: "证件类别", isUserKeyBoard: false, prompts: "请选择", message: mainModel.certificates.passport.passport_type, type: .id, isShowPrompts: isShowPrompt)
let item5 = YHItemModel(id: .id17, isNeed: !flag, title: "证件号码", isUserKeyBoard: true, prompts: "请输入", message: mainModel.certificates.passport.number, isShowPrompts: isShowPrompt)
let item6 = YHItemModel(id: .id18, isNeed: !flag, title: "签发地", isUserKeyBoard: true, prompts: "请输入", message: mainModel.certificates.passport.issue_at, isShowPrompts: isShowPrompt)
let item7 = YHItemModel(id: .id19, isNeed: !flag, title: "签发日期", isUserKeyBoard: false, prompts: "请选择", message: mainModel.certificates.passport.issue_date_start_at, type: .time, isShowPrompts: isShowPrompt)
let item8 = YHItemModel(id: .id20, isNeed: !flag, title: "届满日期", isUserKeyBoard: false, prompts: "请选择", message: mainModel.certificates.passport.issue_date_end_at, type: .time, isShowPrompts: isShowPrompt)
var section2String = ""
if flag {
section2String = "护照及其他旅行证件(选填)"
} else {
section2String = "护照及其他旅行证件"
}
let section2 = YHSectionItemModel(title: section2String, models: [item4, item5, item6, item7, item8])
if mainModel.has_hk_id == 1 {
return [section, section1, section2]
} else {
......@@ -490,14 +496,28 @@ class YHMainApplicantInformationViewModel: YHBaseViewModel {
let hk_macao_pass_issue_at = mainModel.certificates.hk_macao_pass.issue_at
let hk_macao_pass_issue_date_start_at = mainModel.certificates.hk_macao_pass.issue_date_start_at
let hk_macao_pass_issue_date_end_at = mainModel.certificates.hk_macao_pass.issue_date_end_at
if mainModel.has_hk_id == 1 {
if cn_identity_card_number.count != 0 && cn_identity_card_issue_at.count != 0 && cn_identity_card_issue_date_start_at.count != 0 && cn_identity_card_issue_date_end_at.count != 0 && hk_macao_pass_number.count != 0 && hk_macao_pass_issue_at.count != 0 && hk_macao_pass_issue_date_start_at.count != 0 && hk_macao_pass_issue_date_end_at.count != 0 {
return true
let passport_type = mainModel.certificates.passport.passport_type
let passport_number = mainModel.certificates.passport.number
let passport_issue_at = mainModel.certificates.passport.issue_at
let passport_issue_date_start_at = mainModel.certificates.passport.issue_date_start_at
let passport_issue_date_end_at = mainModel.certificates.passport.issue_date_end_at
let nationality = mainModel.nationality
if nationality.contains("中国") {
if mainModel.has_hk_id == 1 {
if cn_identity_card_number.count != 0 && cn_identity_card_issue_at.count != 0 && cn_identity_card_issue_date_start_at.count != 0 && cn_identity_card_issue_date_end_at.count != 0 && hk_macao_pass_number.count != 0 && hk_macao_pass_issue_at.count != 0 && hk_macao_pass_issue_date_start_at.count != 0 && hk_macao_pass_issue_date_end_at.count != 0 {
return true
} else {
return false
}
} else {
return false
if cn_identity_card_number.count != 0 && cn_identity_card_issue_at.count != 0 && cn_identity_card_issue_date_start_at.count != 0 && cn_identity_card_issue_date_end_at.count != 0 {
return true
} else {
return false
}
}
} else {
if cn_identity_card_number.count != 0 && cn_identity_card_issue_at.count != 0 && cn_identity_card_issue_date_start_at.count != 0 && cn_identity_card_issue_date_end_at.count != 0 {
if passport_type.count != 0 && passport_number.count != 0 && passport_issue_at.count != 0 && passport_issue_date_start_at.count != 0 && passport_issue_date_end_at.count != 0 {
return true
} else {
return false
......
......@@ -26,6 +26,12 @@ enum YHOtherPickerViewType: Int {
case level
// 高管证明文件
case prove
// 证件类别
case idType
// 性别
case sex
// 婚姻状况
case marry
}
......@@ -248,6 +254,12 @@ class YHOtherPickerView: UIView {
return "职位水平类别"
case .prove:
return "高管证明文件"
case .idType:
return "选择证件类别"
case .sex:
return "选择性别"
case .marry:
return "选择婚姻状况"
default:
return "请选择"
}
......@@ -283,7 +295,7 @@ extension YHOtherPickerView: UIPickerViewDelegate, UIPickerViewDataSource {
func pickerView(_ pickerView: UIPickerView, rowHeightForComponent component: Int) -> CGFloat {
switch type {
case .nature,.certificate,.structure,.level,.prove:
case .nature,.certificate,.structure,.level,.prove,.idType,.sex,.marry:
return 50
default:
return 70
......@@ -293,7 +305,7 @@ extension YHOtherPickerView: UIPickerViewDelegate, UIPickerViewDataSource {
func pickerView(_ pickerView: UIPickerView, viewForRow row: Int, forComponent component: Int, reusing view: UIView?) -> UIView {
switch type {
case .nature,.certificate,.structure,.level,.prove:
case .nature,.certificate,.structure,.level,.prove,.idType,.sex,.marry:
let label = UILabel()
label.textColor = UIColor.mainTextColor
label.font = UIFont.PFSC_M(ofSize: 14)
......@@ -403,6 +415,30 @@ extension YHOtherPickerView {
arrData.append(model)
}
title = getTitle(type: type)
case .idType:
let arr = YHOtherInfoFillViewModel.arrIdType
arrData.removeAll()
arr.forEach { item in
let model = YHOtherPickerViewItemData(title: item["title"] ?? "-", subTitle: "", index: item["id"] ?? "-")
arrData.append(model)
}
title = getTitle(type: type)
case .sex:
let arr = YHOtherInfoFillViewModel.arrSex
arrData.removeAll()
arr.forEach { item in
let model = YHOtherPickerViewItemData(title: item["title"] ?? "-", subTitle: "", index: item["id"] ?? "-")
arrData.append(model)
}
title = getTitle(type: type)
case .marry:
let arr = YHOtherInfoFillViewModel.arrMarry
arrData.removeAll()
arr.forEach { item in
let model = YHOtherPickerViewItemData(title: item["title"] ?? "-", subTitle: "", index: item["id"] ?? "-")
arrData.append(model)
}
title = getTitle(type: type)
default:
return
}
......
......@@ -246,6 +246,60 @@ class YHOtherInfoFillViewModel: YHBaseViewModel {
"id": "盖章且签字的组织架构图和审计报告"
]
]
static let arrIdType : [[String : String]] = [
["title": "护照",
"id": "3"
],
["title": "外交护照",
"id": "4"
],
["title": "公务护照",
"id": "5"
],
["title": "中国发无国籍旅游证件",
"id": "6"
],
["title": "旅游通行证",
"id": "7"
],
["title": "联合国通行证",
"id": "8"
],
["title": "其他无国籍旅行证件",
"id": "9"
],
["title": "其他",
"id": "10"
]
]
static let arrSex : [[String : String]] = [
["title": "男",
"id": "1"
],
["title": "女",
"id": "2"
]
]
static let arrMarry : [[String : String]] = [
["title": "已婚",
"id": "0"
],
["title": "未婚",
"id": "1"
],
["title": "离婚",
"id": "2"
],
["title": "分居",
"id": "3"
],
["title": "丧偶",
"id": "4"
]
]
}
extension YHOtherInfoFillViewModel {
......
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