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

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

* 'qmas-1130' of http://gitlab.galaxy-immi.com/mobile-group/galaxy-iOS:
  主申请人 修改逻辑
parents ac26e5dd bbf153c1
...@@ -149,6 +149,8 @@ class YHFamilyMemberViewModel : YHBaseViewModel{ ...@@ -149,6 +149,8 @@ class YHFamilyMemberViewModel : YHBaseViewModel{
} else { } else {
mainModel.certificates.hkMacaoPass.imgBack = url mainModel.certificates.hkMacaoPass.imgBack = url
} }
case .other:
mainModel.certificates.passport.imgFront = url
} }
if let saveInfoSilentBlock = saveInfoSilentBlock { if let saveInfoSilentBlock = saveInfoSilentBlock {
saveInfoSilentBlock() saveInfoSilentBlock()
......
...@@ -83,6 +83,8 @@ class YHIdentityCardCell: UITableViewCell { ...@@ -83,6 +83,8 @@ class YHIdentityCardCell: UITableViewCell {
backSurfaceLabel.text = "港澳通行证反面" backSurfaceLabel.text = "港澳通行证反面"
frontImageButton.setBackgroundImage(UIImage(named: "service_hk_card_front"), for: .normal) frontImageButton.setBackgroundImage(UIImage(named: "service_hk_card_front"), for: .normal)
backSurfaceImageButton.setBackgroundImage(UIImage(named: "service_hk_card_back"), for: .normal) backSurfaceImageButton.setBackgroundImage(UIImage(named: "service_hk_card_back"), for: .normal)
case .other:
break
} }
} }
} }
...@@ -422,6 +424,8 @@ class YHIdentityCardCell: UITableViewCell { ...@@ -422,6 +424,8 @@ class YHIdentityCardCell: UITableViewCell {
frontImageButton.setBackgroundImage(UIImage(named: "service_cn_card_front"), for: .normal) frontImageButton.setBackgroundImage(UIImage(named: "service_cn_card_front"), for: .normal)
case .passport: case .passport:
frontImageButton.setBackgroundImage(UIImage(named: "service_hk_card_front"), for: .normal) frontImageButton.setBackgroundImage(UIImage(named: "service_hk_card_front"), for: .normal)
case .other:
break
} }
frontImageButton.setContent("card_upload", "点击上传") frontImageButton.setContent("card_upload", "点击上传")
} }
...@@ -434,6 +438,8 @@ class YHIdentityCardCell: UITableViewCell { ...@@ -434,6 +438,8 @@ class YHIdentityCardCell: UITableViewCell {
backSurfaceImageButton.setBackgroundImage(UIImage(named: "service_cn_card_back"), for: .normal) backSurfaceImageButton.setBackgroundImage(UIImage(named: "service_cn_card_back"), for: .normal)
case .passport: case .passport:
backSurfaceImageButton.setBackgroundImage(UIImage(named: "service_hk_card_back"), for: .normal) backSurfaceImageButton.setBackgroundImage(UIImage(named: "service_hk_card_back"), for: .normal)
case .other:
break
} }
backSurfaceImageButton.setContent("card_upload", "点击上传") backSurfaceImageButton.setContent("card_upload", "点击上传")
} }
......
...@@ -166,14 +166,18 @@ extension YHMainApplicantInformationViewController: UITableViewDelegate, UITable ...@@ -166,14 +166,18 @@ extension YHMainApplicantInformationViewController: UITableViewDelegate, UITable
func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell { func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
if stepView.currentIndex == 1 { if stepView.currentIndex == 1 {
let cell = tableView.dequeueReusableCell(withClass: YHMainInformationCardTableViewCell.self) let cell = tableView.dequeueReusableCell(withClass: YHMainInformationCardTableViewCell.self)
cell.type = YHCardType(rawValue: indexPath.row) ?? .identity if dataSource?[indexPath.row].models?.first?.id == .id5 {
cell.type = .identity
}
if dataSource?[indexPath.row].models?.first?.id == .id6 {
cell.type = .passport
}
if dataSource?[indexPath.row].models?.first?.id == .id7 {
cell.type = .other
}
cell.viewModel = viewModel cell.viewModel = viewModel
cell.backSurfaceDeleteButton.isHidden = true cell.backSurfaceDeleteButton.isHidden = true
cell.frontDeleteButton.isHidden = true cell.frontDeleteButton.isHidden = true
cell.informationBlock = {[weak self] type, image, isLeft in
guard let self = self else { return }
}
return cell return cell
} else { } else {
let cell = tableView.dequeueReusableCell(withClass: YHMainInformationTableViewCell.self) let cell = tableView.dequeueReusableCell(withClass: YHMainInformationTableViewCell.self)
......
...@@ -38,6 +38,7 @@ class YHCardExampleView: UIView { ...@@ -38,6 +38,7 @@ class YHCardExampleView: UIView {
make.height.equalTo(207) make.height.equalTo(207)
make.top.equalTo(109) make.top.equalTo(109)
} }
case .other: break
} }
} }
} }
......
...@@ -13,6 +13,7 @@ import Kingfisher ...@@ -13,6 +13,7 @@ import Kingfisher
enum YHCardType: Int { enum YHCardType: Int {
case identity = 0 //中国身份证 case identity = 0 //中国身份证
case passport = 1 //港澳通行证 case passport = 1 //港澳通行证
case other = 2 //护照
} }
class YHMainInformationCardTableViewCell: UITableViewCell { class YHMainInformationCardTableViewCell: UITableViewCell {
...@@ -51,7 +52,7 @@ class YHMainInformationCardTableViewCell: UITableViewCell { ...@@ -51,7 +52,7 @@ class YHMainInformationCardTableViewCell: UITableViewCell {
self.backSurfaceImageButton.setContent("", "") self.backSurfaceImageButton.setContent("", "")
} }
} }
} else { } else if type == .passport {
if viewModel.mainModel.certificates.hk_macao_pass.img_front.count != 0 { if viewModel.mainModel.certificates.hk_macao_pass.img_front.count != 0 {
self.viewModel.getPublicImageUrl(viewModel.mainModel.certificates.hk_macao_pass.img_front) {[weak self] success, error in self.viewModel.getPublicImageUrl(viewModel.mainModel.certificates.hk_macao_pass.img_front) {[weak self] success, error in
guard let self = self else { return } guard let self = self else { return }
...@@ -72,6 +73,17 @@ class YHMainInformationCardTableViewCell: UITableViewCell { ...@@ -72,6 +73,17 @@ class YHMainInformationCardTableViewCell: UITableViewCell {
self.backSurfaceImageButton.setContent("", "") self.backSurfaceImageButton.setContent("", "")
} }
} }
} else {
if viewModel.mainModel.certificates.passport.img_front.count != 0 {
self.viewModel.getPublicImageUrl(viewModel.mainModel.certificates.passport.img_front) {[weak self] success, error in
guard let self = self else { return }
guard let url = success else { return }
self.frontImageButton.kf.setBackgroundImage(with: URL(string: url), for: .normal, completionHandler: { _ in
self.frontDeleteButton.isHidden = false
})
self.frontImageButton.setContent("", "")
}
}
} }
} }
} }
...@@ -84,12 +96,22 @@ class YHMainInformationCardTableViewCell: UITableViewCell { ...@@ -84,12 +96,22 @@ class YHMainInformationCardTableViewCell: UITableViewCell {
backSurfaceLabel.text = "身份证国徽面" backSurfaceLabel.text = "身份证国徽面"
frontImageButton.setBackgroundImage(UIImage(named: "service_cn_card_front"), for: .normal) frontImageButton.setBackgroundImage(UIImage(named: "service_cn_card_front"), for: .normal)
backSurfaceImageButton.setBackgroundImage(UIImage(named: "service_cn_card_back"), for: .normal) backSurfaceImageButton.setBackgroundImage(UIImage(named: "service_cn_card_back"), for: .normal)
backSurfaceLabel.isHidden = false
backSurfaceImageButton.isHidden = false
case .passport: case .passport:
titleLabel.text = "港澳通行证(选填)" titleLabel.text = "港澳通行证(选填)"
frontLabel.text = "港澳通行证正面" frontLabel.text = "港澳通行证正面"
backSurfaceLabel.text = "港澳通行证反面" backSurfaceLabel.text = "港澳通行证反面"
frontImageButton.setBackgroundImage(UIImage(named: "service_hk_card_front"), for: .normal) frontImageButton.setBackgroundImage(UIImage(named: "service_hk_card_front"), for: .normal)
backSurfaceImageButton.setBackgroundImage(UIImage(named: "service_hk_card_back"), for: .normal) backSurfaceImageButton.setBackgroundImage(UIImage(named: "service_hk_card_back"), for: .normal)
backSurfaceLabel.isHidden = false
backSurfaceImageButton.isHidden = false
case .other:
titleLabel.text = "护照(选填)"
frontLabel.text = "护照资料页"
backSurfaceLabel.isHidden = true
frontImageButton.setBackgroundImage(UIImage(named: "service_hk_card_front"), for: .normal)
backSurfaceImageButton.isHidden = true
} }
} }
} }
...@@ -289,10 +311,14 @@ class YHMainInformationCardTableViewCell: UITableViewCell { ...@@ -289,10 +311,14 @@ class YHMainInformationCardTableViewCell: UITableViewCell {
} }
@objc func exampleClick() { @objc func exampleClick() {
let view = YHCardExampleView(frame: CGRect(x: 0, y: 0, width: KScreenWidth, height: KScreenHeight)) if type == .other {
view.type = type YHAdopterCardExampleView.exampleView(type: .chinaTravel).show()
let window = UIApplication.shared.yhKeyWindow() } else {
window?.addSubview(view) let view = YHCardExampleView(frame: CGRect(x: 0, y: 0, width: KScreenWidth, height: KScreenHeight))
view.type = type
let window = UIApplication.shared.yhKeyWindow()
window?.addSubview(view)
}
} }
@objc func frontImageClick() { @objc func frontImageClick() {
...@@ -309,7 +335,7 @@ class YHMainInformationCardTableViewCell: UITableViewCell { ...@@ -309,7 +335,7 @@ class YHMainInformationCardTableViewCell: UITableViewCell {
} }
return return
} }
} else { } else if type == .passport {
if viewModel.mainModel.certificates.hk_macao_pass.img_front.count != 0 { if viewModel.mainModel.certificates.hk_macao_pass.img_front.count != 0 {
// let vc = YHImageViewController() // let vc = YHImageViewController()
// vc.imgString = viewModel.mainModel.certificates.hk_macao_pass.img_front // vc.imgString = viewModel.mainModel.certificates.hk_macao_pass.img_front
...@@ -321,6 +347,17 @@ class YHMainInformationCardTableViewCell: UITableViewCell { ...@@ -321,6 +347,17 @@ class YHMainInformationCardTableViewCell: UITableViewCell {
UIViewController.current?.navigationController?.pushViewController(vc) UIViewController.current?.navigationController?.pushViewController(vc)
} }
return
}
} else {
if viewModel.mainModel.certificates.passport.img_front.count != 0 {
if viewModel.mainModel.certificates.passport.img_front.isEmpty == false {
let vc = YHImageViewController()
vc.imgString = viewModel.mainModel.certificates.passport.img_front
UIViewController.current?.navigationController?.pushViewController(vc)
}
return return
} }
} }
...@@ -345,7 +382,7 @@ class YHMainInformationCardTableViewCell: UITableViewCell { ...@@ -345,7 +382,7 @@ class YHMainInformationCardTableViewCell: UITableViewCell {
if self.type == .identity { if self.type == .identity {
self.viewModel.requestCnIDCardMessage(url, isBack: 0) {[weak self] success, error in self.viewModel.requestCnIDCardMessage(url, isBack: 0) {[weak self] success, error in
} }
} else { } else if self.type == .passport {
self.viewModel.requestHkIDCardMessage(url, isBack: 0) {[weak self] success, error in self.viewModel.requestHkIDCardMessage(url, isBack: 0) {[weak self] success, error in
} }
} }
...@@ -425,6 +462,8 @@ class YHMainInformationCardTableViewCell: UITableViewCell { ...@@ -425,6 +462,8 @@ class YHMainInformationCardTableViewCell: UITableViewCell {
frontImageButton.setBackgroundImage(UIImage(named: "service_cn_card_front"), for: .normal) frontImageButton.setBackgroundImage(UIImage(named: "service_cn_card_front"), for: .normal)
case .passport: case .passport:
frontImageButton.setBackgroundImage(UIImage(named: "service_hk_card_front"), for: .normal) frontImageButton.setBackgroundImage(UIImage(named: "service_hk_card_front"), for: .normal)
case .other:
frontImageButton.setBackgroundImage(UIImage(named: "service_hk_card_front"), for: .normal)
} }
frontImageButton.setContent("card_upload", "点击上传") frontImageButton.setContent("card_upload", "点击上传")
} }
...@@ -437,6 +476,8 @@ class YHMainInformationCardTableViewCell: UITableViewCell { ...@@ -437,6 +476,8 @@ class YHMainInformationCardTableViewCell: UITableViewCell {
backSurfaceImageButton.setBackgroundImage(UIImage(named: "service_cn_card_back"), for: .normal) backSurfaceImageButton.setBackgroundImage(UIImage(named: "service_cn_card_back"), for: .normal)
case .passport: case .passport:
backSurfaceImageButton.setBackgroundImage(UIImage(named: "service_hk_card_back"), for: .normal) backSurfaceImageButton.setBackgroundImage(UIImage(named: "service_hk_card_back"), for: .normal)
case .other:
backSurfaceImageButton.setBackgroundImage(UIImage(named: "service_hk_card_back"), for: .normal)
} }
backSurfaceImageButton.setContent("card_upload", "点击上传") backSurfaceImageButton.setContent("card_upload", "点击上传")
} }
......
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