Commit 3b3cf36d 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 4883d228 4fcd7286
......@@ -152,7 +152,7 @@ extension YHCertificateInfoController : UITableViewDelegate, UITableViewDataSour
cell.placeHolder = detailItem.placeHolder
cell.title = detailItem.getTitle()
cell.text = detailItem.value
cell.setTips(detailItem.tips, isShow: isNeedShowError && detailItem.isShowTips)
cell.setTips(detailItem.tips, isShow: isNeedShowError && detailItem.isNeed && detailItem.isShowTips)
cell.textInputCondtion = {
textField in
......@@ -212,7 +212,7 @@ extension YHCertificateInfoController : UITableViewDelegate, UITableViewDataSour
cell.isMust = detailItem.isNeed
cell.title = detailItem.getTitle()
cell.detail = detailItem.value
cell.setTips(detailItem.tips, isShow: isNeedShowError && detailItem.isShowTips)
cell.setTips(detailItem.tips, isShow: isNeedShowError && detailItem.isNeed && detailItem.isShowTips)
return cell
}
......@@ -233,7 +233,7 @@ extension YHCertificateInfoController : UITableViewDelegate, UITableViewDataSour
save()
}
}
cell.setTips(detailItem.tips, isShow: isNeedShowError && detailItem.isShowTips)
cell.setTips(detailItem.tips, isShow: isNeedShowError && detailItem.isNeed && detailItem.isShowTips)
return cell
}
......
......@@ -429,7 +429,13 @@ extension YHChildBasicInfoVC : UITableViewDelegate, UITableViewDataSource {
let detailItem = item as! YHFormDetailItem
if detailItem.type == .birthday || detailItem.type == .stayHKDate { // 出生日期/获准滞留至
YHDatePickView.show(type: .yyyymmdd) { [weak self] date in
var title = ""
if detailItem.type == .birthday {
title = "选择出生日期"
} else if detailItem.type == .stayHKDate {
title = "选择逗留日期"
}
YHDatePickView.show(type: .yyyymmdd, title:title) { [weak self] date in
guard let self = self else { return }
if detailItem.type == .birthday {
......@@ -437,7 +443,7 @@ extension YHChildBasicInfoVC : UITableViewDelegate, UITableViewDataSource {
} else if detailItem.type == .stayHKDate {
self.child?.childInHk.info = date
}
self.loadInfo()
loadInfo()
save()
}
......
......@@ -220,8 +220,7 @@ extension YHChildPrimaryInfoVC : UITableViewDelegate, UITableViewDataSource {
}
if detailItem.type == .isAccompanyToHK, let child = child, child.is18YearsOld() { // 是否随行至香港
// 年满18岁不能随行
select = false
// 年满18岁不能随行 随行按钮不可编辑固定为否
cell.isCanEdit = isFollowCanEdit
}
......@@ -364,6 +363,7 @@ extension YHChildPrimaryInfoVC : UITableViewDelegate, UITableViewDataSource {
}
self.loadInfo()
save()
}
self.navigationController?.pushViewController(vc)
......@@ -383,6 +383,7 @@ extension YHChildPrimaryInfoVC : UITableViewDelegate, UITableViewDataSource {
}
self.child?.address.area = citys
self.loadInfo()
save()
}
self.present(vc, animated: true)
......@@ -397,8 +398,15 @@ extension YHChildPrimaryInfoVC : UITableViewDelegate, UITableViewDataSource {
guard let child = child else { return }
child.birthday = date
isFollowCanEdit = !child.is18YearsOld()
if child.is18YearsOld() {
child.setFollow(false)
}
if let delegate = delegate, delegate.responds(to: #selector(YHSpouseInfoVCProtocol.updateStepView)) {
delegate.updateStepView()
}
}
self.loadInfo()
save()
}
}
}
......@@ -444,14 +452,19 @@ extension YHChildPrimaryInfoVC {
if isEmptyString(child.nationality) {
return false
}
if isEmptyString(child.address.country) {
return false
}
if isEmptyString(child.address.details) {
return false
}
if child.isBirthOverSeas(), isEmptyArray(child.address.area) {
return false
if !child.isLiveTother() { // 没有与主申请人同住
if isEmptyString(child.address.country) {
return false
}
if isEmptyString(child.address.details) {
return false
}
if child.address.isInChina() {
if isEmptyArray(child.address.area) {
return false
}
}
}
return true
}
......
......@@ -617,7 +617,13 @@ extension YHSpouseBasicInfoVC : UITableViewDelegate, UITableViewDataSource {
let detailItem = item as! YHFormDetailItem
if detailItem.type == .birthday || detailItem.type == .stayHKDate { // 出生日期/获准滞留至
YHDatePickView.show(type: .yyyymmdd) { [weak self] date in
var title = ""
if detailItem.type == .birthday {
title = "选择出生日期"
} else if detailItem.type == .stayHKDate {
title = "选择逗留日期"
}
YHDatePickView.show(type: .yyyymmdd, title:title) { [weak self] date in
guard let self = self else { return }
if detailItem.type == .birthday {
......
......@@ -90,7 +90,7 @@ class YHSpousePrimaryInfoVC: YHBaseViewController, YHFamilyMemberProtol {
if !spouse.address.area.isEmpty {
value = spouse.address.area.joined(separator: ",")
}
let item22 = YHFormDetailItem(type:.liveCity, value:value, placeHolder:"请选择城市".local, tips:"请请选择城市".local)
let item22 = YHFormDetailItem(type:.liveCity, value:value, tips:"请选择省市地区".local)
arr2.append(item22)
}
......
......@@ -890,7 +890,7 @@ class YHFamilyMember: SmartCodable, YHFormItemProtocol {
var relation: String = ""
var hasDegree: String = ""
var hasDegreeJson: [YHHasDegreeJson] = []
var follow: Int = 0
var follow: Int = 1
var statement: Int = 0
var subsetName: String = ""
var subsetNamePinyin: YHSubsetNamePinyin = YHSubsetNamePinyin()
......@@ -1258,11 +1258,16 @@ class YHAddress: SmartCodable {
class YHChildStepchildClass: SmartCodable {
var has: String = ""
var info: String = ""
var number: String = ""
var year: String = ""
var month: String = ""
// 龙哥所加字段
var number:String = ""
enum CodingKeys: String, CodingKey {
case has = "has"
case info = "info"
case year = "year"
case month = "month"
case number = "number"
}
......
......@@ -66,7 +66,10 @@ class YHFamilyMemberViewModel : YHBaseViewModel{
mainModel.subsetName = model.name
}
if model.birth.count != 0 {
mainModel.birthday = model.birth.toTimeString()
if mainModel.relationType != .child {
// 孩子生日设置大于18岁后必须设置为不能随行 导致证件上传和证件信息页面隐藏 会产生异常
mainModel.birthday = model.birth.toTimeString()
}
}
if model.gender.count != 0 {
if model.gender == "女" {
......@@ -95,7 +98,10 @@ class YHFamilyMemberViewModel : YHBaseViewModel{
mainModel.subsetName = model.name
}
if model.birth.count != 0 {
mainModel.birthday = model.birth.toTimeString()
if mainModel.relationType != .child {
// 孩子生日设置大于18岁后必须设置为不能随行 导致证件上传和证件信息页面隐藏 会产生异常
mainModel.birthday = model.birth.toTimeString()
}
}
if model.gender.count != 0 {
if model.gender == "女" {
......
......@@ -155,32 +155,36 @@ class YHWorkExperienceViewController: YHBaseViewController {
}
@objc func keyboardWillShow(_ notification: Notification) {
// 当键盘将要显示时调用此函数
stepView.snp.remakeConstraints { make in
make.top.equalTo(k_Height_NavigationtBarAndStatuBar)
make.left.right.equalTo(view)
make.height.equalTo(0)
}
stepView.isHidden = true
tableView.snp.remakeConstraints { make in
make.top.equalTo(k_Height_NavigationtBarAndStatuBar)
make.bottom.equalTo(-k_Height_safeAreaInsetsBottom() - 64)
make.left.right.bottom.equalTo(view)
if stepView.currentIndex != 0 {
// 当键盘将要显示时调用此函数
stepView.snp.remakeConstraints { make in
make.top.equalTo(k_Height_NavigationtBarAndStatuBar)
make.left.right.equalTo(view)
make.height.equalTo(0)
}
stepView.isHidden = true
tableView.snp.remakeConstraints { make in
make.top.equalTo(k_Height_NavigationtBarAndStatuBar)
make.bottom.equalTo(-k_Height_safeAreaInsetsBottom() - 64)
make.left.right.bottom.equalTo(view)
}
}
}
@objc func keyboardWillHide(_ notification: Notification) {
// 当键盘将要隐藏时调用此函数
stepView.snp.remakeConstraints { make in
make.top.equalTo(k_Height_NavigationtBarAndStatuBar)
make.left.right.equalTo(view)
make.height.equalTo(104)
}
stepView.isHidden = false
tableView.snp.remakeConstraints { make in
make.top.equalTo(k_Height_NavigationtBarAndStatuBar + YHStepView.height)
make.bottom.equalTo(-k_Height_safeAreaInsetsBottom() - 64)
make.left.right.bottom.equalTo(view)
if stepView.currentIndex != 0 {
// 当键盘将要隐藏时调用此函数
stepView.snp.remakeConstraints { make in
make.top.equalTo(k_Height_NavigationtBarAndStatuBar)
make.left.right.equalTo(view)
make.height.equalTo(104)
}
stepView.isHidden = false
tableView.snp.remakeConstraints { make in
make.top.equalTo(k_Height_NavigationtBarAndStatuBar + YHStepView.height)
make.bottom.equalTo(-k_Height_safeAreaInsetsBottom() - 64)
make.left.right.bottom.equalTo(view)
}
}
}
......
......@@ -18,6 +18,7 @@ class YHWorkExperienceItemView: UIView {
var leftButton: UIButton!
var rightButton: UIButton!
var showPromptLabel: UILabel!
var longTimeButton:UIButton!
var dataSource: YHWorkExperienceModel? {
didSet {
......@@ -133,10 +134,51 @@ class YHWorkExperienceItemView: UIView {
make.height.equalTo(32)
make.width.equalTo(74)
}
longTimeButton = {
let button = UIButton(type: .custom)
button.setImage(UIImage(named: "main_time_normal"), for: .normal)
button.setImage(UIImage(named: "main_time_select"), for: .selected)
button.setTitleColor(UIColor.mainTextColor, for: .normal)
button.setTitle("至今", for: .normal)
button.titleLabel?.font = UIFont.PFSC_M(ofSize: 14)
button.contentHorizontalAlignment = .right
button.addTarget(self, action: #selector(longTimeButtonClick), for: .touchUpInside)
button.imageEdgeInsets = UIEdgeInsets(top: 10, left: 0, bottom: 10, right: 30)
button.isSelected = false
return button
}()
addSubview(longTimeButton)
longTimeButton.snp.makeConstraints { make in
make.right.equalToSuperview()
make.centerY.equalToSuperview()
make.height.equalTo(32)
make.width.equalTo(43)
}
}
@objc func longTimeButtonClick() {
longTimeButton.isSelected = !longTimeButton.isSelected
if longTimeButton.isSelected {
self.dataSource?.message = "至今"
self.updateAllViews()
if let block = self.block {
block(self.dataSource ?? YHWorkExperienceModel())
}
} else {
self.dataSource?.message = ""
self.updateAllViews()
if let block = self.block {
block(self.dataSource ?? YHWorkExperienceModel())
}
}
}
func updateAllViews() {
guard let dataSource = dataSource else { return }
if dataSource.id == .id14 || dataSource.id == .id16 || dataSource.id == .id17 {
messageTextField.keyboardType = .numberPad
}
if dataSource.isNeed ?? false {
let str = "*" + (dataSource.title ?? "")
let attributes: [NSAttributedString.Key: Any] = [
......@@ -236,6 +278,34 @@ class YHWorkExperienceItemView: UIView {
} else {
showPromptLabel.isHidden = true
}
if dataSource.id == .id10 {
longTimeButton.isHidden = false
nextStepImageView.isHidden = true
if dataSource.message == "至今" {
longTimeButton.isSelected = true
longTimeButton.snp.remakeConstraints { make in
make.left.equalTo(messageTextField.snp.left)
make.centerY.equalToSuperview()
make.height.equalTo(32)
make.width.equalTo(43)
}
centerButton.isHidden = true
messageTextField.isHidden = true
} else {
longTimeButton.isSelected = false
longTimeButton.snp.remakeConstraints { make in
make.right.equalToSuperview()
make.centerY.equalToSuperview()
make.height.equalTo(32)
make.width.equalTo(43)
}
centerButton.isHidden = false
messageTextField.isHidden = false
}
} else {
longTimeButton.isHidden = true
}
}
func buttonState(isLeft: Bool) {
......@@ -312,7 +382,14 @@ class YHWorkExperienceItemView: UIView {
}
UIViewController.current?.present(addressPicker, animated: true, completion: nil)
case .time:
YHDatePickView.show(type: .yyyymm) { date in
var title = ""
if dataSource?.id == .id9 {
title = "请选择入职日期"
}
if dataSource?.id == .id10 {
title = "请选择离职日期"
}
YHDatePickView.show(type: .yyyymm, title: title) { date in
self.dataSource?.message = date
self.updateAllViews()
if let block = self.block {
......
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