Commit f581c820 authored by pete谢兆麟's avatar pete谢兆麟

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

parents e513af05 ad60d466
......@@ -490,6 +490,8 @@
047AA3FA2C60739E009C4554 /* YHInvitationWithGiftsSelectItemView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 047AA3F92C60739E009C4554 /* YHInvitationWithGiftsSelectItemView.swift */; };
047AA3FC2C61EE7F009C4554 /* YHSignAppendStepView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 047AA3FB2C61EE7F009C4554 /* YHSignAppendStepView.swift */; };
047AB5E62CD083CE002A3573 /* YHButlerMessageReportHandler.swift in Sources */ = {isa = PBXBuildFile; fileRef = 047AB5E52CD083CE002A3573 /* YHButlerMessageReportHandler.swift */; };
047F3DD92CE601D1001B2A6D /* YHEducationCertificateConfirmCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 047F3DD82CE601D1001B2A6D /* YHEducationCertificateConfirmCell.swift */; };
047F3DDB2CE6DE91001B2A6D /* YHEducationMarkView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 047F3DDA2CE6DE91001B2A6D /* YHEducationMarkView.swift */; };
0480582F2C7CA77900502CAA /* YHDisappointHKAlertView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0480582E2C7CA77900502CAA /* YHDisappointHKAlertView.swift */; };
048058312C7DBDC900502CAA /* YHTravelCertificateTipsView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 048058302C7DBDC900502CAA /* YHTravelCertificateTipsView.swift */; };
048058332C7DC0CF00502CAA /* YHTravelCertificateTipsCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 048058322C7DC0CF00502CAA /* YHTravelCertificateTipsCell.swift */; };
......@@ -1465,6 +1467,8 @@
047AA3F92C60739E009C4554 /* YHInvitationWithGiftsSelectItemView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHInvitationWithGiftsSelectItemView.swift; sourceTree = "<group>"; };
047AA3FB2C61EE7F009C4554 /* YHSignAppendStepView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHSignAppendStepView.swift; sourceTree = "<group>"; };
047AB5E52CD083CE002A3573 /* YHButlerMessageReportHandler.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHButlerMessageReportHandler.swift; sourceTree = "<group>"; };
047F3DD82CE601D1001B2A6D /* YHEducationCertificateConfirmCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHEducationCertificateConfirmCell.swift; sourceTree = "<group>"; };
047F3DDA2CE6DE91001B2A6D /* YHEducationMarkView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHEducationMarkView.swift; sourceTree = "<group>"; };
0480582E2C7CA77900502CAA /* YHDisappointHKAlertView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHDisappointHKAlertView.swift; sourceTree = "<group>"; };
048058302C7DBDC900502CAA /* YHTravelCertificateTipsView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHTravelCertificateTipsView.swift; sourceTree = "<group>"; };
048058322C7DC0CF00502CAA /* YHTravelCertificateTipsCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHTravelCertificateTipsCell.swift; sourceTree = "<group>"; };
......@@ -3027,6 +3031,8 @@
children = (
045EEE152B9F171A0022A143 /* YHCollegeNameCell.swift */,
045EEE162B9F171A0022A143 /* YHEducationInfoCell.swift */,
047F3DD82CE601D1001B2A6D /* YHEducationCertificateConfirmCell.swift */,
047F3DDA2CE6DE91001B2A6D /* YHEducationMarkView.swift */,
045EEE172B9F171A0022A143 /* YHCollegeSearchBar.swift */,
);
path = V;
......@@ -5701,11 +5707,13 @@
A567E5A02BD7643D00D5D5A0 /* YHHomeWebViewController.swift in Sources */,
044D0BF42C21247100C5CF5E /* YHUserInfoSettingViewController.swift in Sources */,
A567E5942BD7643D00D5D5A0 /* YHHomeListModel.swift in Sources */,
047F3DDB2CE6DE91001B2A6D /* YHEducationMarkView.swift in Sources */,
04CE1AD82C2AD91F001CB80A /* YHActivityListViewController.swift in Sources */,
A5ACE94E2B4564F7002C94D2 /* AlignedCollectionViewFlowLayout.swift in Sources */,
A567E5B32BD7643D00D5D5A0 /* YHServiceOrderAlertView.swift in Sources */,
A592FE932BA6CFFC0062FACA /* YHCertificateEntryBottomView.swift in Sources */,
A5ACE93B2B4564F7002C94D2 /* UIFont+Extension.swift in Sources */,
047F3DD92CE601D1001B2A6D /* YHEducationCertificateConfirmCell.swift in Sources */,
044EE2232C8FE1D000A2FE3A /* YHServiceCenterViewController.swift in Sources */,
A567E5A92BD7643D00D5D5A0 /* YHSearchInfoHistoryView.swift in Sources */,
045EEE802B9F171A0022A143 /* YHAcademicPreviewModel.swift in Sources */,
......
......@@ -214,13 +214,15 @@ extension YHInformationPerfectListVC {
}
}
//我的评分 -> 我的方案
@objc func goScoreVC() {
//我的评分
let vc = YHScoreDetailViewController()
vc.orderId = orderId
vc.model = serviceCenterMainReqVM.allInfoScoreModel
navigationController?.pushViewController(vc)
// //我的评分
// let vc = YHScoreDetailViewController()
// vc.orderId = orderId
// vc.model = serviceCenterMainReqVM.allInfoScoreModel
// navigationController?.pushViewController(vc)
YHHUD.flash(message: "这里跳转 杜宇 新的我的方案")
}
@objc func goInfoListVC( ) {
......@@ -261,17 +263,19 @@ extension YHInformationPerfectListVC {
serviceCenterMainReqVM.submitAllInfoOp(params: ["orderId" : orderId]) { [weak self] success, error in
YHHUD.hide()
if success == true {
let model = self?.serviceCenterMainReqVM.allInfoScoreModel
YHSubmitAllInfoSuccessAlertView.showCheckView(model: model) { agree in
//1、刷新当前界面
self?.loadData()
//2、跳转其他界面
if agree == true {
self?.goScoreVC()
}
}
// let model = self?.serviceCenterMainReqVM.allInfoScoreModel
// YHSubmitAllInfoSuccessAlertView.showCheckView(model: model) { agree in
//
// //1、刷新当前界面
// self?.loadData()
//
// //2、跳转其他界面
// if agree == true {
// self?.goScoreVC()
// }
// }
//1、刷新当前界面
self?.loadData()
} else {
let msg = error?.errorMsg ?? "操作失败"
YHHUD.flash(message: msg)
......@@ -331,13 +335,13 @@ extension YHInformationPerfectListVC {
make.height.equalTo(48)
}
//我的积分 -> 我的方案
let scoreButton = {
let button = UIButton(type: .custom)
button.backgroundColor = UIColor(hex:0xffffff)
button.titleLabel?.font = UIFont.PFSC_M(ofSize: 16)
button.contentHorizontalAlignment = .center
button.setTitle("我的评分", for: .normal)
button.setTitle("我的方案", for: .normal)
button.setTitleColor(UIColor.brandMainColor, for: .normal)
button.layer.cornerRadius = kCornerRadius3
button.layer.borderWidth = 1
......
......@@ -200,18 +200,20 @@ extension YHBasicInfoFillViewController {
arr.append(applicant)
param.updateValue(arr, forKey: "child")
} else if item.sessionTitle == "家庭背景" {
var applicant : [String : Any] = [:]
for (index0,item0) in item.arrQuestionItem.enumerated() {
if index0 == 0 {
let value = ["has":item0.answer,"info":item0.answer == "Y" ? item0.info : ""]
applicant.updateValue(value, forKey: "background_member")
} else {
printLog("其他数据没有处理")
}
}
param.updateValue(applicant, forKey: "background")
} else {
}
// else if item.sessionTitle == "家庭背景" {
// var applicant : [String : Any] = [:]
// for (index0,item0) in item.arrQuestionItem.enumerated() {
// if index0 == 0 {
// let value = ["has":item0.answer,"info":item0.answer == "Y" ? item0.info : ""]
// applicant.updateValue(value, forKey: "background_member")
// } else {
// printLog("其他数据没有处理")
// }
// }
// param.updateValue(applicant, forKey: "background")
// }
else {
}
}
......
......@@ -60,14 +60,14 @@ extension YHBasicInfoFillViewModel {
}
do {
//家庭背景
let model1 = YHBasicInfoCellModel(question:"1、至少一名直系家庭成员(已婚配偶、父母、兄弟姊妹、子女)是现居于香港的香港永久性居民", answer: "", info: "")
let arr = [model1]
let sessionModel = YHBasicInfoSessionModel(sessionTitle: "家庭背景", arrQuestionItem: arr)
arrData.append(sessionModel)
}
// do {
// //家庭背景
// let model1 = YHBasicInfoCellModel(question:"1、至少一名直系家庭成员(已婚配偶、父母、兄弟姊妹、子女)是现居于香港的香港永久性居民", answer: "", info: "")
// let arr = [model1]
//
// let sessionModel = YHBasicInfoSessionModel(sessionTitle: "家庭背景", arrQuestionItem: arr)
// arrData.append(sessionModel)
// }
arrBasicInfoSessionDataForEdit = arrData
}
......@@ -132,17 +132,17 @@ extension YHBasicInfoFillViewModel {
do {
//家庭背景
if let model = dataModelForBasicInfo.background {
let model1 = YHBasicInfoCellModel(question:"1、至少一名直系家庭成员(已婚配偶、父母、兄弟姊妹、子女)是现居于香港的香港永久性居民", answer: model.background_member?.has ?? "", info: model.background_member?.info ?? "",type: 1)
model1.model = model
let arr = [model1]
let sessionModel = YHBasicInfoSessionModel(sessionTitle: "家庭背景", arrQuestionItem: arr)
arrData.append(sessionModel)
}
}
// do {
// //家庭背景
// if let model = dataModelForBasicInfo.background {
// let model1 = YHBasicInfoCellModel(question:"1、至少一名直系家庭成员(已婚配偶、父母、兄弟姊妹、子女)是现居于香港的香港永久性居民", answer: model.background_member?.has ?? "", info: model.background_member?.info ?? "",type: 1)
// model1.model = model
// let arr = [model1]
// let sessionModel = YHBasicInfoSessionModel(sessionTitle: "家庭背景", arrQuestionItem: arr)
// arrData.append(sessionModel)
// }
//
// }
arrBasicInfoSessionDataForEdit = arrData
}
}
......
......@@ -21,8 +21,7 @@ class YHEducationDetailVC: YHBaseViewController {
var isNeedShowError = false
let educationRequest:YHEducationRequestViewModel = YHEducationRequestViewModel()
var detailInfo: YHEducationDetailInfo = YHEducationDetailInfo()
var isChildsEditMode: YHFormTitleItemEditType = .none
var isBrothersEditMode: YHFormTitleItemEditType = .none
var isCerConfirm: Bool? = nil
var items:[[YHFormItemProtocol]] = []
......@@ -45,6 +44,7 @@ class YHEducationDetailVC: YHBaseViewController {
tableView.register(YHFormItemAddCell.self, forCellReuseIdentifier: YHFormItemAddCell.cellReuseIdentifier)
tableView.register(YHFormItemInputTextCell.self, forCellReuseIdentifier: YHFormItemInputTextCell.cellReuseIdentifier)
tableView.register(YHFormItemSelectSheetCell.self, forCellReuseIdentifier: YHFormItemSelectSheetCell.cellReuseIdentifier)
tableView.register(YHEducationCertificateConfirmCell.self, forCellReuseIdentifier: YHEducationCertificateConfirmCell.cellReuseIdentifier)
return tableView
}()
......@@ -152,6 +152,11 @@ class YHEducationDetailVC: YHBaseViewController {
let arr0:[YHFormItemProtocol] = [title0, item05, item00, item01, item02, item03, item04, item07]
items.append(arr0)
let item10 = YHFormDetailItem(type: .cerConfirm)
let arr1:[YHFormItemProtocol] = [item10]
items.append(arr1)
self.tableView.reloadData()
}
}
......@@ -258,6 +263,31 @@ extension YHEducationDetailVC : UITableViewDelegate, UITableViewDataSource {
}
cell.setTips(detailItem.tips, isShow: (isNeedShowError && !isValueValid))
return cell
} else if cellType == .cerConfirm {
let cell = tableView.dequeueReusableCell(withIdentifier: YHEducationCertificateConfirmCell.cellReuseIdentifier, for: indexPath) as! YHEducationCertificateConfirmCell
var isSelectTrue = false
var isSelectFalse = false
if let isCerConfirm = isCerConfirm {
isSelectTrue = isCerConfirm
isSelectFalse = !isCerConfirm
}
let answers = [YHFormChoiceItem(title: "是".local, isSelect: isSelectTrue),
YHFormChoiceItem(title: "否".local, isSelect: isSelectFalse)]
cell.answerArr = answers
cell.answerBlock = {
[weak self] (arr, selectIndex) in
guard let self = self else { return }
let selectItem:YHFormChoiceItem = arr[selectIndex]
let option = (selectItem.title == "是".local ? true : false)
self.isCerConfirm = option
self.tableView.reloadData()
}
return cell
}
}
......@@ -448,17 +478,28 @@ extension YHEducationDetailVC : UITableViewDelegate, UITableViewDataSource {
func createCorner(cell:UITableViewCell, arr:Array<Any>, indexPath:IndexPath) {
// 设置每块section圆角
if indexPath.row == 0, indexPath.row == arr.count-1 {
let corner = UIRectCorner(rawValue: UIRectCorner.topLeft.rawValue |
UIRectCorner.topRight.rawValue |
UIRectCorner.bottomLeft.rawValue |
UIRectCorner.bottomRight.rawValue)
cell.createCorner(CGSizeMake(12.0, 12.0), corner)
return
}
if (indexPath.row == 0) {
let corner = UIRectCorner(rawValue: UIRectCorner.topLeft.rawValue | UIRectCorner.topRight.rawValue)
cell.createCorner(CGSizeMake(12.0, 12.0), corner)
} else if (indexPath.row == arr.count-1) {
return
}
if (indexPath.row == arr.count-1) {
let corner = UIRectCorner(rawValue: UIRectCorner.bottomLeft.rawValue | UIRectCorner.bottomRight.rawValue)
cell.createCorner(CGSizeMake(12.0, 12.0), corner)
} else {
cell.layer.mask = nil
return
}
cell.layer.mask = nil
}
func getCellType(_ item: Any) ->HKFormItemCellType {
......@@ -469,6 +510,10 @@ extension YHEducationDetailVC : UITableViewDelegate, UITableViewDataSource {
if item is YHFormDetailItem {
let detailItem = item as! YHFormDetailItem
if detailItem.type == .cerConfirm {
return .cerConfirm
}
if detailItem.type == .educationCity {
if detailInfo.isSchoolInAboard() {
return .inputText
......@@ -532,19 +577,18 @@ extension YHEducationDetailVC {
|| detailInfo.graduateTime.isEmpty
|| detailInfo.major.isEmpty
|| detailInfo.degree.isEmpty
|| detailInfo.degreeType.isEmpty
|| detailInfo.schoolAddress.country.isEmpty
{
return false
}
if detailInfo.isSchoolInAboard(), detailInfo.schoolAddress.foreign.isEmpty {
return false
}
// if detailInfo.isSchoolInAboard(), detailInfo.schoolAddress.foreign.isEmpty {
// return false
// }
if !detailInfo.isSchoolInAboard(), detailInfo.schoolAddress.area.count <= 0 {
return false
}
// if !detailInfo.isSchoolInAboard(), detailInfo.schoolAddress.area.count <= 0 {
// return false
// }
return true
}
......
//
// YHEducationCertificateConfirmCell.swift
// galaxy
//
// Created by Dufet on 2024/11/14.
// Copyright © 2024 https://www.galaxy-immi.com. All rights reserved.
//
import UIKit
import AttributedString
class YHEducationCertificateConfirmCell: UITableViewCell {
static let cellReuseIdentifier = "YHEducationCertificateConfirmCell"
private let btnWidth = 70.0
private let btnHeight = 32.0
private let titleFont = UIFont.PFSC_R(ofSize: 14)
private let btnTitleSelectColor = UIColor.brandMainColor
private let btnTitleDefaultColor = UIColor.mainTextColor
private let btnBgDefaultColor = UIColor.contentBkgColor
private let btnBgSelectColor = UIColor.brandMainColor.withAlphaComponent(0.08)
private let answerBaseTag = 9527
// 是否必须字段
var isMust:Bool = false
var answerBlock:(([YHFormChoiceItem], Int)->Void)?
// 必须传2个item的arr
var answerArr:[YHFormChoiceItem]? {
didSet {
if let answerArr = answerArr, answerArr.count == 2 {
var isSelectTrue:Bool? = nil
for i in 0...1 {
let answerBtn = self.viewWithTag(answerBaseTag+i) as! UIButton
let item = answerArr[i]
answerBtn.setTitle(item.title, for: .normal)
updateAnswerButton(answerBtn, item.isSelect)
if item.isSelect {
isSelectTrue = (i == 0)
}
}
if let isSelectTrue = isSelectTrue { // 进行过选择
if isSelectTrue == false {
let a: ASAttributedString = .init("若不能提供以上证明材料,将导致您的该收入", .font(UIFont.PFSC_R(ofSize: 12)),.foreground(UIColor.init(hex: 0x8993A2)))
let b: ASAttributedString = .init("不被认可不予加分", .font(UIFont.PFSC_R(ofSize: 12)),.foreground(UIColor.failColor))
let c: ASAttributedString = .init(",请尽可能准备以上材料并修改此选项。", .font(UIFont.PFSC_R(ofSize: 12)),.foreground(UIColor.init(hex: 0x8993A2)))
tipsLabel.attributed.text = a+b+c
isNeedShowTips(true)
} else {
tipsLabel.attributed.text = ""
isNeedShowTips(false)
}
} else { // 没有选择
let tips: ASAttributedString = .init("请选择", .font(UIFont.PFSC_R(ofSize: 12)),.foreground(UIColor.failColor))
tipsLabel.attributed.text = tips
isNeedShowTips(true)
}
} else {
// 重置所有答案状态
for i in 0...1 {
let answerBtn = self.viewWithTag(answerBaseTag+i) as! UIButton
answerBtn.setTitle("", for: .normal)
updateAnswerButton(answerBtn, false)
}
}
}
}
private lazy var topLine:UIView = {
let view = UIView()
view.backgroundColor = .separatorColor
return view
}()
private lazy var titleLabel: UILabel = {
let label = UILabel()
label.textColor = .mainTextColor
label.textAlignment = .left
label.numberOfLines = 0
label.font = UIFont.PFSC_M(ofSize: 17)
label.lineBreakMode = .byCharWrapping
label.text = "证件提供确认"
return label
}()
private lazy var questionContentView: UIView = {
let view = UIView()
return view
}()
private lazy var questionLabel: UILabel = {
let label = UILabel()
label.textAlignment = .left
label.numberOfLines = 0
let a: ASAttributedString = .init("*", .font(UIFont.PFSC_R(ofSize: 14)),.foreground(UIColor.failColor))
let b: ASAttributedString = .init("您是否可以提供以下所有证明文件", .font(UIFont.PFSC_R(ofSize: 14)),.foreground(UIColor.mainTextColor))
label.attributed.text = a+b
return label
}()
private lazy var answer1Btn: UIButton = {
let btn = UIButton()
btn.setTitle("", for: .normal)
btn.titleLabel?.font = UIFont.PFSC_R(ofSize: 14)
btn.setTitleColor(btnTitleDefaultColor, for: .normal)
btn.backgroundColor = btnBgDefaultColor
btn.layer.cornerRadius = btnHeight/2.0
btn.layer.masksToBounds = true
btn.layer.borderWidth = 1
btn.layer.borderColor = UIColor.clear.cgColor
btn.tag = answerBaseTag
btn.addTarget(self, action: #selector(didClickResponseBtn(btn:)), for: .touchUpInside)
return btn
}()
private lazy var answer2Btn: UIButton = {
let btn = UIButton()
btn.setTitle("", for: .normal)
btn.titleLabel?.font = UIFont.PFSC_R(ofSize: 14)
btn.setTitleColor(btnTitleDefaultColor, for: .normal)
btn.backgroundColor = btnBgDefaultColor
btn.layer.cornerRadius = btnHeight/2.0
btn.layer.masksToBounds = true
btn.layer.borderWidth = 1
btn.layer.borderColor = UIColor.clear.cgColor
btn.tag = answerBaseTag+1
btn.addTarget(self, action: #selector(didClickResponseBtn(btn:)), for: .touchUpInside)
return btn
}()
private lazy var markContentView: UIView = {
let view = UIView()
view.backgroundColor = UIColor.init(hex: 0xF8F9FB)
return view
}()
private lazy var tipsLabel: UILabel = {
let label = UILabel()
label.numberOfLines = 0
let a: ASAttributedString = .init("若不能提供以上证明材料,将导致您的该收入", .font(UIFont.PFSC_R(ofSize: 12)),.foreground(UIColor.init(hex: 0x8993A2)))
let b: ASAttributedString = .init("不被认可不予加分", .font(UIFont.PFSC_R(ofSize: 12)),.foreground(UIColor.failColor))
let c: ASAttributedString = .init(",请尽可能准备以上材料并修改此选项。", .font(UIFont.PFSC_R(ofSize: 12)),.foreground(UIColor.init(hex: 0x8993A2)))
label.attributed.text = a+b+c
return label
}()
var tipsArr:[String] = ["国内院校需提供:学位证+毕业证+学位认证报告",
"国外院校需提供:学位证+成绩单+留服认证报告"]
required init?(coder: NSCoder) {
super.init(coder: coder)
}
override init(style: UITableViewCell.CellStyle, reuseIdentifier: String?) {
super.init(style: style, reuseIdentifier: reuseIdentifier)
setupUI()
}
func setupUI() {
self.selectionStyle = .none
contentView.backgroundColor = .white
contentView.addSubview(titleLabel)
contentView.addSubview(topLine)
contentView.addSubview(questionContentView)
questionContentView.addSubview(questionLabel)
questionContentView.addSubview(answer1Btn)
questionContentView.addSubview(answer2Btn)
contentView.addSubview(markContentView)
contentView.addSubview(tipsLabel)
titleLabel.snp.makeConstraints { make in
make.left.equalTo(18)
make.right.equalTo(-18)
make.top.equalTo(16)
make.height.equalTo(24)
}
topLine.snp.makeConstraints { make in
make.top.equalTo(titleLabel.snp.bottom).offset(12)
make.left.right.equalToSuperview()
make.height.equalTo(0.5)
}
questionContentView.snp.makeConstraints { make in
make.top.equalTo(topLine.snp.bottom).offset(0)
make.left.equalTo(18)
make.right.equalTo(-18)
}
questionLabel.snp.makeConstraints { make in
make.left.equalTo(0)
make.right.equalTo(answer1Btn.snp.left).offset(-15)
make.top.equalTo(16)
make.bottom.equalTo(-16)
}
answer1Btn.snp.makeConstraints { make in
make.centerY.equalTo(questionLabel)
make.width.equalTo(74)
make.height.equalTo(32)
make.right.equalTo(answer2Btn.snp.left).offset(-12)
}
answer2Btn.snp.makeConstraints { make in
make.centerY.equalTo(questionLabel)
make.width.equalTo(74)
make.height.equalTo(32)
make.right.equalTo(0)
}
markContentView.snp.makeConstraints { make in
make.left.equalTo(18)
make.right.equalTo(-18)
make.top.equalTo(questionContentView.snp.bottom).offset(0)
}
tipsLabel.snp.makeConstraints { make in
make.left.equalTo(18)
make.right.equalTo(-18)
make.top.equalTo(markContentView.snp.bottom).offset(16)
make.bottom.equalTo(-16)
}
var lastTipsView: YHEducationMarkView? = nil
for (index, tips) in tipsArr.enumerated() {
let tipsView = YHEducationMarkView(frame: .zero)
tipsView.title = tips
markContentView.addSubview(tipsView)
tipsView.snp.makeConstraints { make in
make.left.equalTo(16)
make.right.equalTo(-16)
if let lastTipsView = lastTipsView {
make.top.equalTo(lastTipsView.snp.bottom).offset(12)
} else {
make.top.equalTo(16)
}
if index == tipsArr.count-1 {
make.bottom.equalTo(-16)
}
}
lastTipsView = tipsView
}
}
// 更新答案按钮选中状态
private func updateAnswerButton(_ btn:UIButton, _ isSelect:Bool) {
btn.layer.borderColor = (isSelect ? btnTitleSelectColor : .clear).cgColor
btn.setTitleColor((isSelect ? btnTitleSelectColor : btnTitleDefaultColor), for: .normal)
btn.backgroundColor = (isSelect ? btnBgSelectColor : btnBgDefaultColor)
}
@objc func didClickResponseBtn(btn: UIButton) {
let selectIndex = btn.tag-answerBaseTag
if let resultArr = answerArr, resultArr.count == 2 {
for i in 0...1 {
let item = resultArr[i]
item.isSelect = (i == selectIndex)
}
answerArr = resultArr
if let answerBlock = answerBlock {
answerBlock(resultArr, selectIndex)
}
}
}
func isNeedShowTips(_ isShow: Bool) {
tipsLabel.isHidden = !isShow
tipsLabel.snp.remakeConstraints { make in
make.left.equalTo(18)
make.right.equalTo(-18)
make.top.equalTo(markContentView.snp.bottom).offset(16)
make.bottom.equalTo(isShow ? -16 : 0)
if !isShow {
make.height.equalTo(0)
}
}
self.setNeedsLayout()
self.layoutIfNeeded()
}
}
//
// YHEducationMarkView.swift
// galaxy
//
// Created by Dufet on 2024/11/15.
// Copyright © 2024 https://www.galaxy-immi.com. All rights reserved.
//
import UIKit
class YHEducationMarkView: UIView {
var title: String = "" {
didSet {
titleLabel.text = title
}
}
var dotView: UIView = {
let view = UIView()
view.backgroundColor = UIColor.init(hex: 0xB3C8E9)
view.layer.cornerRadius = 1.0
return view
}()
lazy var titleLabel: UILabel = {
let label = UILabel()
label.textColor = .mainTextColor
label.textAlignment = .left
label.numberOfLines = 0
label.font = UIFont.PFSC_R(ofSize: 14)
return label
}()
override init(frame: CGRect) {
super.init(frame: frame)
createUI()
}
required init?(coder: NSCoder) {
fatalError("init(coder:) has not been implemented")
}
func createUI() {
self.addSubview(dotView)
self.addSubview(titleLabel)
dotView.snp.makeConstraints { make in
make.left.equalTo(0)
make.top.equalTo(8)
make.width.height.equalTo(5)
}
titleLabel.snp.makeConstraints { make in
make.left.equalTo(dotView.snp.right).offset(10)
make.top.right.bottom.equalToSuperview()
}
}
}
......@@ -100,7 +100,7 @@ class YHCertificateInfoController: YHBaseViewController, YHFamilyMemberProtol {
if familyMember.nationality.contains("中国") { // 中国国籍
let isLiveInChina = familyMember.address.country.contains("中国".local)
if isLiveInChina { // 居住国内
if !familyMember.certificates.hkMacaoPass.number.isEmpty { // 没办理过港澳通行证
if familyMember.isHandled == 0 { // 没办理过港澳通行证
// 证件信息:港澳通行证非必填(无身份证、护照)
showHK = true
isHKMust = false
......@@ -113,7 +113,7 @@ class YHCertificateInfoController: YHBaseViewController, YHFamilyMemberProtol {
} else { // 居住国外
if !familyMember.isOverSeasOver1Year() { // 居住国外不满一年
if !familyMember.certificates.hkMacaoPass.number.isEmpty { // 没办理过港澳通行证
if familyMember.isHandled == 0 { // 没办理过港澳通行证
// 证件信息:港澳通行证非必填(无身份证、护照)
showHK = true
isHKMust = false
......
......@@ -78,20 +78,29 @@ extension YHCertificateUploadVC: UITableViewDelegate, UITableViewDataSource {
}
func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
let cell = tableView.dequeueReusableCell(withClass: YHIdentityCardCell.self)
cell.type = YHCardType(rawValue: indexPath.row) ?? .identity
cell.viewModel = viewModel
cell.backSurfaceDeleteButton.isHidden = true
cell.frontDeleteButton.isHidden = true
cell.informationBlock = {[weak self] type, image, isLeft in
guard let self = self else { return }
let dataSource = viewModel.getIDCardDataSource(false)
if indexPath.row < dataSource.count {
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.backSurfaceDeleteButton.isHidden = true
cell.frontDeleteButton.isHidden = true
}
return cell
}
func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat {
return UITableView.automaticDimension
return 217
}
}
......@@ -21,6 +21,8 @@ enum HKFormItemCellType: Int {
case onlyTwoChoice = 8
case question = 9
case cerConfirm = 10
}
class YHSpouseBasicInfoVC: YHBaseViewController, YHFamilyMemberProtol {
......
......@@ -190,6 +190,8 @@ enum YHFormDetailItemType:Int {
case educationCountry
// 上课城市
case educationCity
// 证件提供确认
case cerConfirm
// 证书信息
case certificateInfo
......@@ -523,7 +525,10 @@ class YHFormDetailItem : YHFormItemProtocol {
return "颁授国家/地区".local
case .conferCity:
return "颁授城市".local
case .cerConfirm:
return "证件提供确认".local
}
}
......@@ -632,7 +637,7 @@ class YHFamilyMember: SmartCodable, YHFormItemProtocol {
var birthPlaceAboard: Int = 0
// 是否与主申请人同住 1:是 0:否
var nows: Int = 0
// 是否要办理港澳通行证 1:是 0:否
// 是否办理过港澳通行证 1:是 0:否
var isHandled: Int = 0
// notFillNumber = -1 表示还没开始填写任意数据项
var notFillNumber: Int = -1
......
......@@ -20,10 +20,21 @@ class YHFamilyMemberViewModel : YHBaseViewModel{
let section = YHSectionItemModel(title: "中国身份证(选填)", models: [item])
let item1 = YHItemModel(id: .id6, isNeed: true, title: "港澳通行证(选填)", isUserKeyBoard: false, prompts: "请输入", message: nil, isShowPrompts: isShowPrompt)
let section1 = YHSectionItemModel(title: "中国身份证(选填)", models: [item1])
if mainModel.isNeedHandleHKPassPort() {
return [section, section1]
let item2 = YHItemModel(id: .id7, isNeed: true, title: "护照(选填)", isUserKeyBoard: false, prompts: "请输入", message: nil, isShowPrompts: isShowPrompt)
let section2 = YHSectionItemModel(title: "护照(选填)", models: [item2])
let addressCountry = mainModel.address.country
let nationality = mainModel.nationality
let is_live_oversea_year = mainModel.isOverSeasOver1Year()
if (nationality.contains("中国") && addressCountry.contains("中国")) || (nationality.contains("中国") && !is_live_oversea_year) {
if mainModel.isHandled == 1 {
return [section, section1]
} else {
return [section]
}
} else if nationality.contains("中国") && is_live_oversea_year {
return [section, section2]
} else {
return [section]
return [section2]
}
}
......
......@@ -7,6 +7,8 @@
// YHMainInformationCardTableViewCell
import UIKit
import Alamofire
import Kingfisher
class YHIdentityCardCell: UITableViewCell {
typealias InformationBlock = (_ type: YHCardType, _ image: UIImage, _ isleft: Bool) -> ()
......@@ -44,7 +46,7 @@ class YHIdentityCardCell: UITableViewCell {
self.backSurfaceImageButton.setContent("", "")
}
}
} else {
} else if type == .passport {
if viewModel.mainModel.certificates.hkMacaoPass.imgFront.count != 0 {
self.viewModel.getPublicImageUrl(viewModel.mainModel.certificates.hkMacaoPass.imgFront) {[weak self] success, error in
guard let self = self else { return }
......@@ -65,6 +67,17 @@ class YHIdentityCardCell: UITableViewCell {
self.backSurfaceImageButton.setContent("", "")
}
}
} else {
if viewModel.mainModel.certificates.passport.imgFront.count != 0 {
self.viewModel.getPublicImageUrl(viewModel.mainModel.certificates.passport.imgFront) {[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("", "")
}
}
}
}
}
......@@ -77,14 +90,22 @@ class YHIdentityCardCell: UITableViewCell {
backSurfaceLabel.text = "身份证国徽面"
frontImageButton.setBackgroundImage(UIImage(named: "service_cn_card_front"), for: .normal)
backSurfaceImageButton.setBackgroundImage(UIImage(named: "service_cn_card_back"), for: .normal)
backSurfaceLabel.isHidden = false
backSurfaceImageButton.isHidden = false
case .passport:
titleLabel.text = "港澳通行证(选填)"
frontLabel.text = "港澳通行证正面"
backSurfaceLabel.text = "港澳通行证反面"
frontImageButton.setBackgroundImage(UIImage(named: "service_hk_card_front"), for: .normal)
backSurfaceImageButton.setBackgroundImage(UIImage(named: "service_hk_card_back"), for: .normal)
backSurfaceLabel.isHidden = false
backSurfaceImageButton.isHidden = false
case .other:
break
titleLabel.text = "护照(选填)"
frontLabel.text = "护照资料页"
backSurfaceLabel.isHidden = true
frontImageButton.setBackgroundImage(UIImage(named: "service_hk_card_front"), for: .normal)
backSurfaceImageButton.isHidden = true
}
}
}
......@@ -123,10 +144,10 @@ class YHIdentityCardCell: UITableViewCell {
contentView.addSubview(centerView)
centerView.snp.makeConstraints { make in
make.left.equalToSuperview().offset(16)
make.right.equalToSuperview().offset(-16)
make.top.equalToSuperview().offset(14)
make.bottom.equalToSuperview()
make.left.equalTo(16)
make.right.equalTo(-16)
make.top.equalTo(7)
make.bottom.equalTo(-16)
}
titleLabel = {
......@@ -169,7 +190,7 @@ class YHIdentityCardCell: UITableViewCell {
centerView.addSubview(lineView)
lineView.snp.makeConstraints { make in
make.left.equalTo(18)
make.top.equalTo(titleLabel.snp.bottom).offset(12)
make.top.equalTo(52)
make.height.equalTo(1)
make.right.equalTo(-18)
}
......@@ -185,7 +206,7 @@ class YHIdentityCardCell: UITableViewCell {
frontLabel.snp.makeConstraints { make in
make.left.equalTo(18)
make.right.equalTo(centerView.snp.centerX)
make.top.equalTo(lineView.snp.bottom).offset(12)
make.top.equalTo(64)
make.height.equalTo(20)
}
......@@ -200,7 +221,7 @@ class YHIdentityCardCell: UITableViewCell {
backSurfaceLabel.snp.makeConstraints { make in
make.right.equalTo(-18)
make.left.equalTo(centerView.snp.centerX)
make.top.equalTo(lineView.snp.bottom).offset(12)
make.top.equalTo(64)
make.height.equalTo(20)
}
......@@ -216,10 +237,9 @@ class YHIdentityCardCell: UITableViewCell {
centerView.addSubview(frontImageButton)
frontImageButton.snp.makeConstraints { make in
make.left.equalTo(18)
make.top.equalTo(frontLabel.snp.bottom).offset(12)
make.top.equalTo(96)
make.height.equalTo(91)
make.width.equalTo(147)
make.bottom.equalToSuperview().offset(-16)
}
frontDeleteButton = {
......@@ -249,7 +269,7 @@ class YHIdentityCardCell: UITableViewCell {
centerView.addSubview(backSurfaceImageButton)
backSurfaceImageButton.snp.makeConstraints { make in
make.right.equalTo(-18)
make.top.equalTo(frontLabel.snp.bottom).offset(12)
make.top.equalTo(96)
make.height.equalTo(91)
make.width.equalTo(147)
}
......@@ -280,13 +300,19 @@ class YHIdentityCardCell: UITableViewCell {
make.height.equalTo(25)
make.width.equalTo(25)
}
exampleButton.YH_clickEdgeInsets = UIEdgeInsets(top: 50, left: 50, bottom: 50, right: 50)
}
@objc func exampleClick() {
let view = YHCardExampleView(frame: CGRect(x: 0, y: 0, width: KScreenWidth, height: KScreenHeight))
view.type = type
let window = UIApplication.shared.yhKeyWindow()
window?.addSubview(view)
if type == .other {
YHAdopterCardExampleView.exampleView(type: .chinaTravel).show()
} else {
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() {
......@@ -296,7 +322,6 @@ class YHIdentityCardCell: UITableViewCell {
// vc.imgString = viewModel.mainModel.certificates.cnIdentityCard.imgFront
// UIViewController.current?.navigationController?.pushViewController(vc)
if viewModel.mainModel.certificates.cnIdentityCard.imgFront.isEmpty == false {
let vc = YHImageViewController()
vc.imgString = viewModel.mainModel.certificates.cnIdentityCard.imgFront
......@@ -304,19 +329,29 @@ class YHIdentityCardCell: UITableViewCell {
}
return
}
} else {
} else if type == .passport {
if viewModel.mainModel.certificates.hkMacaoPass.imgFront.count != 0 {
// let vc = YHImageViewController()
// vc.imgString = viewModel.mainModel.certificates.hkMacaoPass.imgFront
// UIViewController.current?.navigationController?.pushViewController(vc)
if viewModel.mainModel.certificates.hkMacaoPass.imgFront.isEmpty == false {
let vc = YHImageViewController()
vc.imgString = viewModel.mainModel.certificates.hkMacaoPass.imgFront
UIViewController.current?.navigationController?.pushViewController(vc)
}
return
}
} else {
if viewModel.mainModel.certificates.passport.imgFront.count != 0 {
if viewModel.mainModel.certificates.passport.imgFront.isEmpty == false {
let vc = YHImageViewController()
vc.imgString = viewModel.mainModel.certificates.passport.imgFront
UIViewController.current?.navigationController?.pushViewController(vc)
}
return
}
}
......@@ -333,17 +368,16 @@ class YHIdentityCardCell: UITableViewCell {
self.viewModel.updateModel(self.type, isFront: true, url: url)
self.frontImageButton.setBackgroundImage(image, for: .normal)
self.frontDeleteButton.isHidden = false
self.viewModel.getPublicImageUrl(url) {[weak self] success, error in
guard let self = self else { return }
guard let url = success else { return }
if self.type == .identity {
self.viewModel.requestCnIDCardMessage(url, isBack: 0) {[weak self] success, error in
guard self != nil else { return }
}
} else {
} else if self.type == .passport {
self.viewModel.requestHkIDCardMessage(url, isBack: 0) {[weak self] success, error in
guard self != nil else { return }
}
}
}
......@@ -398,11 +432,9 @@ class YHIdentityCardCell: UITableViewCell {
guard let url = success else { return }
if self.type == .identity {
self.viewModel.requestCnIDCardMessage(url, isBack: 1) {[weak self] success, error in
guard self != nil else { return }
}
} else {
self.viewModel.requestHkIDCardMessage(url, isBack: 1 ) {[weak self] success, error in
guard self != nil else { return }
}
}
}
......@@ -425,7 +457,7 @@ class YHIdentityCardCell: UITableViewCell {
case .passport:
frontImageButton.setBackgroundImage(UIImage(named: "service_hk_card_front"), for: .normal)
case .other:
break
frontImageButton.setBackgroundImage(UIImage(named: "service_hk_card_front"), for: .normal)
}
frontImageButton.setContent("card_upload", "点击上传")
}
......@@ -439,7 +471,7 @@ class YHIdentityCardCell: UITableViewCell {
case .passport:
backSurfaceImageButton.setBackgroundImage(UIImage(named: "service_hk_card_back"), for: .normal)
case .other:
break
backSurfaceImageButton.setBackgroundImage(UIImage(named: "service_hk_card_back"), for: .normal)
}
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