Commit e9e1ff43 authored by David黄金龙's avatar David黄金龙

Merge branch 'develop' of http://gitlab.galaxy-immi.com/mobile-group/galaxy-iOS into develop

* 'develop' of http://gitlab.galaxy-immi.com/mobile-group/galaxy-iOS:
  //  港澳台地址选择器适配
parents e8266351 94c4f7c9
...@@ -367,11 +367,13 @@ extension YHChildPrimaryInfoVC : UITableViewDelegate, UITableViewDataSource { ...@@ -367,11 +367,13 @@ extension YHChildPrimaryInfoVC : UITableViewDelegate, UITableViewDataSource {
[weak self] country in [weak self] country in
guard let self = self else { return } guard let self = self else { return }
let title = arr[0] as! YHFormTitleItem let title = arr[0] as! YHFormTitleItem
if title.type == .nationality { if title.type == .nationality { // 选国籍
self.child?.nationality = country self.child?.nationality = country
} else if title.type == .liveInfo { } else if title.type == .liveInfo { // // 居住信息选国家地区
self.child?.address.country = country self.child?.address.country = country
// 选择国家地区后需清空城市
self.child?.address.area = []
} }
self.loadInfo() self.loadInfo()
...@@ -381,23 +383,36 @@ extension YHChildPrimaryInfoVC : UITableViewDelegate, UITableViewDataSource { ...@@ -381,23 +383,36 @@ extension YHChildPrimaryInfoVC : UITableViewDelegate, UITableViewDataSource {
} else if detailItem.type == .liveCity { } else if detailItem.type == .liveCity {
let vc = YHAddressViewController() var provice = ""
vc.backLocationStringController = { if let country = self.child?.address.country {
[weak self] (string1, string2, string3, string4) in if country.contains("台湾") {
guard let self = self else { return } provice = "台湾省"
print("\(string1)\n\(string2)\n\(string3)\n\(string4)") }
if country.contains("香港") {
provice = "香港特别行政区"
}
if country.contains("澳门") {
provice = "澳门特别行政区"
}
}
let addressPicker = YHAddressViewController(selectProvince: provice)
addressPicker.backLocationStringController = {
[weak self] (address,province,city,area) in
guard let self = self else { return }
print("\(address)\n\(province)\n\(city)\n\(area)")
var citys:[String] = [] var citys:[String] = []
if !isEmptyString(string2) { if !isEmptyString(province) {
citys.append(string2) citys.append(province)
} }
if !isEmptyString(string3) { if !isEmptyString(city) {
citys.append(string3) citys.append(city)
} }
self.child?.address.area = citys self.child?.address.area = citys
self.loadInfo() self.loadInfo()
save() save()
} }
self.present(vc, animated: true) UIViewController.current?.present(addressPicker, animated: true, completion: nil)
} else if detailItem.type == .birthday { // 出生日期 } else if detailItem.type == .birthday { // 出生日期
......
...@@ -326,11 +326,13 @@ extension YHSpousePrimaryInfoVC : UITableViewDelegate, UITableViewDataSource { ...@@ -326,11 +326,13 @@ extension YHSpousePrimaryInfoVC : UITableViewDelegate, UITableViewDataSource {
[weak self] country in [weak self] country in
guard let self = self else { return } guard let self = self else { return }
let title = arr[0] as! YHFormTitleItem let title = arr[0] as! YHFormTitleItem
if title.type == .nationality { if title.type == .nationality { // 选国籍
self.spouse?.nationality = country self.spouse?.nationality = country
} else if title.type == .liveInfo { } else if title.type == .liveInfo {// 居住信息选国家地区
self.spouse?.address.country = country self.spouse?.address.country = country
// 选择国家地区后需清空城市
self.spouse?.address.area = []
} }
self.loadInfo() self.loadInfo()
...@@ -340,23 +342,36 @@ extension YHSpousePrimaryInfoVC : UITableViewDelegate, UITableViewDataSource { ...@@ -340,23 +342,36 @@ extension YHSpousePrimaryInfoVC : UITableViewDelegate, UITableViewDataSource {
} else if detailItem.type == .liveCity { } else if detailItem.type == .liveCity {
let vc = YHAddressViewController() var provice = ""
vc.backLocationStringController = { if let country = self.spouse?.address.country {
[weak self] (string1, string2, string3, string4) in if country.contains("台湾") {
guard let self = self else { return } provice = "台湾省"
print("\(string1)\n\(string2)\n\(string3)\n\(string4)") }
var citys:[String] = [] if country.contains("香港") {
if !isEmptyString(string2) { provice = "香港特别行政区"
citys.append(string2) }
} if country.contains("澳门") {
if !isEmptyString(string3) { provice = "澳门特别行政区"
citys.append(string3) }
} }
self.spouse?.address.area = citys
self.loadInfo() let addressPicker = YHAddressViewController(selectProvince: provice)
save() addressPicker.backLocationStringController = {
} [weak self] (address,province,city,area) in
self.present(vc, animated: true) guard let self = self else { return }
print("\(address)\n\(province)\n\(city)\n\(area)")
var citys:[String] = []
if !isEmptyString(province) {
citys.append(province)
}
if !isEmptyString(city) {
citys.append(city)
}
self.spouse?.address.area = citys
self.loadInfo()
save()
}
UIViewController.current?.present(addressPicker, animated: true, completion: nil)
} }
} }
......
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