Commit aa4c9692 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 f4ae7626 456de376
This diff is collapsed.
//
// YHCommonAlertView+AttributedMessage.swift
// galaxy
//
// Created by alexzzw on 2024/10/21.
// Copyright © 2024 https://www.galaxy-immi.com. All rights reserved.
//
import UIKit
import AttributedString
extension YHCommonAlertView {
static func show(title: String? = nil, attributedMessage: ASAttributedString? = nil, _ leftButtonString: String? = nil, _ rightButtonString: String? = nil,fullGuestureEnable : Bool = true,cancelCallBack: (() -> Void)? = nil, callBack: @escaping (() -> Void)) {
let view = YHCommonAlertView(frame: CGRect(x: 0, y: 0, width: KScreenWidth, height: KScreenHeight))
view.agreeBlock = callBack
view.cancelBlcok = cancelCallBack
view.setContent(title, attributedMessage?.value.string, leftButtonString, rightButtonString)
view.messageLabel.attributed.text = attributedMessage
view.messageLabel.lineBreakMode = .byCharWrapping
view.isFullGuestureEnabel = fullGuestureEnable
let window = UIApplication.shared.yhKeyWindow()
window?.addSubview(view)
}
}
...@@ -56,8 +56,8 @@ class YHResignCertificateDetailViewModel: YHBaseViewModel { ...@@ -56,8 +56,8 @@ class YHResignCertificateDetailViewModel: YHBaseViewModel {
func getBaseDatadSource(_ isShowPrompt: Bool) -> [YHItemModel] { func getBaseDatadSource(_ isShowPrompt: Bool) -> [YHItemModel] {
let item5 = YHItemModel(id: .id36, isNeed: true, title: "证件号码", isUserKeyBoard: true, prompts: "请输入", message: getResultString(dataModel.cert_info.number), isShowPrompts: isShowPrompt, alertMessage:"请输入证件号码") let item5 = YHItemModel(id: .id36, isNeed: true, title: "证件号码", isUserKeyBoard: true, prompts: "请输入", message: dataModel.cert_info.number, isShowPrompts: isShowPrompt, alertMessage:"请输入证件号码")
let item6 = YHItemModel(id: .id37, isNeed: true, title: "签发地", isUserKeyBoard: true, prompts: "请输入", message: getResultString(dataModel.cert_info.address), isShowPrompts: isShowPrompt, alertMessage:"请输入签发地") let item6 = YHItemModel(id: .id37, isNeed: true, title: "签发地", isUserKeyBoard: true, prompts: "请输入", message: dataModel.cert_info.address, isShowPrompts: isShowPrompt, alertMessage:"请输入签发地")
let item1 = YHItemModel(id: .id1, isNeed: true, title: "签发时间", isUserKeyBoard: false, prompts: "请选择", message: getResultString(dataModel.cert_info.issue_start), type: .time, isShowPrompts: isShowPrompt, alertMessage:"请选择开始时间") let item1 = YHItemModel(id: .id1, isNeed: true, title: "签发时间", isUserKeyBoard: false, prompts: "请选择", message: getResultString(dataModel.cert_info.issue_start), type: .time, isShowPrompts: isShowPrompt, alertMessage:"请选择开始时间")
let item2 = YHItemModel(id: .id2, isNeed: true, title: "届满时间", isUserKeyBoard: false, prompts: "请选择", message: getResultString(dataModel.cert_info.issue_end), type: .time, isShowPrompts: isShowPrompt, alertMessage:"请选择到期时间") let item2 = YHItemModel(id: .id2, isNeed: true, title: "届满时间", isUserKeyBoard: false, prompts: "请选择", message: getResultString(dataModel.cert_info.issue_end), type: .time, isShowPrompts: isShowPrompt, alertMessage:"请选择到期时间")
...@@ -68,8 +68,8 @@ class YHResignCertificateDetailViewModel: YHBaseViewModel { ...@@ -68,8 +68,8 @@ class YHResignCertificateDetailViewModel: YHBaseViewModel {
func getPassPortdDataSource(_ isShowPrompt: Bool) -> [YHItemModel] { func getPassPortdDataSource(_ isShowPrompt: Bool) -> [YHItemModel] {
let item3 = YHItemModel(id: .id36, isNeed: true, title: "证件号码", isUserKeyBoard: true, prompts: "请输入", message: getResultString(dataModel.cert_info.number), isShowPrompts: isShowPrompt, alertMessage:"请输入证件号码") let item3 = YHItemModel(id: .id36, isNeed: true, title: "证件号码", isUserKeyBoard: true, prompts: "请输入", message: dataModel.cert_info.number, isShowPrompts: isShowPrompt, alertMessage:"请输入证件号码")
let item4 = YHItemModel(id: .id37, isNeed: true, title: "签发地", isUserKeyBoard: true, prompts: "请输入", message: getResultString(dataModel.cert_info.address), isShowPrompts: isShowPrompt, alertMessage:"请输入签发地") let item4 = YHItemModel(id: .id37, isNeed: true, title: "签发地", isUserKeyBoard: true, prompts: "请输入", message: dataModel.cert_info.address, isShowPrompts: isShowPrompt, alertMessage:"请输入签发地")
let item1 = YHItemModel(id: .id5, isNeed: true, title: "签发日期", isUserKeyBoard: false, prompts: "请选择", message: getResultString(dataModel.cert_info.issue_start), type: .time, isShowPrompts: isShowPrompt, alertMessage:"请选择开始时间") let item1 = YHItemModel(id: .id5, isNeed: true, title: "签发日期", isUserKeyBoard: false, prompts: "请选择", message: getResultString(dataModel.cert_info.issue_start), type: .time, isShowPrompts: isShowPrompt, alertMessage:"请选择开始时间")
let item2 = YHItemModel(id: .id6, isNeed: true, title: "届满日期", isUserKeyBoard: false, prompts: "请选择", message: getResultString(dataModel.cert_info.issue_end), type: .time, isShowPrompts: isShowPrompt, alertMessage:"请选择到期时间") let item2 = YHItemModel(id: .id6, isNeed: true, title: "届满日期", isUserKeyBoard: false, prompts: "请选择", message: getResultString(dataModel.cert_info.issue_end), type: .time, isShowPrompts: isShowPrompt, alertMessage:"请选择到期时间")
......
...@@ -320,12 +320,23 @@ extension YHResignDocumentDetailViewController: UITableViewDelegate, UITableView ...@@ -320,12 +320,23 @@ extension YHResignDocumentDetailViewController: UITableViewDelegate, UITableView
} }
sheetView.show() sheetView.show()
} else if editType == .delete { // 删除 } else if editType == .delete { // 删除
if let index = self.detailModel?.signedDocument.firstIndex(where: { model in // 增加二次弹窗确认
model.url == urlStr let message0: ASAttributedString = .init(string: "您确定要删除文档", .font(UIFont.PFSC_R(ofSize: 16)), .foreground(UIColor.mainTextColor))
}) { let message1: ASAttributedString = .init(string: "\(title)", .font(UIFont.PFSC_M(ofSize: 16)), .foreground(UIColor.brandMainColor))
self.detailModel?.signedDocument.remove(at: index) let message2: ASAttributedString = .init(string: "吗?", .font(UIFont.PFSC_R(ofSize: 16)), .foreground(UIColor.mainTextColor))
self.updateUploadFilesSection() YHCommonAlertView.show(title: nil, attributedMessage: message0 + message1 + message2, "取消", "确认", fullGuestureEnable: false) {
} callBack: { [weak self] in
guard let self = self else {
return
}
if let index = self.detailModel?.signedDocument.firstIndex(where: { model in
model.url == urlStr
}) {
self.detailModel?.signedDocument.remove(at: index)
self.updateUploadFilesSection()
}
} }
} else if editType == .preview { // 预览 } else if editType == .preview { // 预览
self.previewUploadedFiles(urlStr, title: title) self.previewUploadedFiles(urlStr, title: title)
} }
...@@ -364,7 +375,15 @@ extension YHResignDocumentDetailViewController: UITableViewDelegate, UITableView ...@@ -364,7 +375,15 @@ extension YHResignDocumentDetailViewController: UITableViewDelegate, UITableView
} }
cell.sureButtonClickEvent = { [weak self] in cell.sureButtonClickEvent = { [weak self] in
guard let self = self else { return } guard let self = self else { return }
self.submitAllUploadFiles() // 产品说增加二次弹窗确认
YHCommonAlertView.show("", "确认提交?", "取消", "确认", fullGuestureEnable: false) {
} callBack: { [weak self] in
guard let self = self else {
return
}
self.submitAllUploadFiles()
}
} }
return cell return cell
} }
......
...@@ -39,8 +39,8 @@ class YHResignAppointScheduleListViewController: YHBaseViewController { ...@@ -39,8 +39,8 @@ class YHResignAppointScheduleListViewController: YHBaseViewController {
tableView.separatorStyle = .none tableView.separatorStyle = .none
tableView.bounces = false tableView.bounces = false
tableView.register(YHResignHaveAppointedMultipleInfoCell.self, forCellReuseIdentifier: YHResignHaveAppointedMultipleInfoCell.cellReuseIdentifier) tableView.register(YHResignScheduleMultipleInfoCell.self, forCellReuseIdentifier: YHResignScheduleMultipleInfoCell.cellReuseIdentifier)
tableView.register(YHResignHaveAppointedSingleInfoCell.self, forCellReuseIdentifier: YHResignHaveAppointedSingleInfoCell.cellReuseIdentifier) tableView.register(YHResignScheduleSingleInfoCell.self, forCellReuseIdentifier: YHResignScheduleSingleInfoCell.cellReuseIdentifier)
tableView.delegate = self tableView.delegate = self
tableView.dataSource = self tableView.dataSource = self
return tableView return tableView
...@@ -360,7 +360,7 @@ extension YHResignAppointScheduleListViewController: UITableViewDelegate, UITabl ...@@ -360,7 +360,7 @@ extension YHResignAppointScheduleListViewController: UITableViewDelegate, UITabl
if 0 <= indexPath.row && indexPath.row < scheduleArr.count { if 0 <= indexPath.row && indexPath.row < scheduleArr.count {
let model = scheduleArr[indexPath.row] let model = scheduleArr[indexPath.row]
if scheduleArr.count <= 1 { if scheduleArr.count <= 1 {
let cell = tableView.dequeueReusableCell(withIdentifier: YHResignHaveAppointedSingleInfoCell.cellReuseIdentifier, for: indexPath) as! YHResignHaveAppointedSingleInfoCell let cell = tableView.dequeueReusableCell(withIdentifier: YHResignScheduleSingleInfoCell.cellReuseIdentifier, for: indexPath) as! YHResignScheduleSingleInfoCell
cell.updateModel(model) cell.updateModel(model)
// 点击确认在港或未确认在港按钮 // 点击确认在港或未确认在港按钮
cell.clickConfirmBtnBlock = { cell.clickConfirmBtnBlock = {
...@@ -379,7 +379,7 @@ extension YHResignAppointScheduleListViewController: UITableViewDelegate, UITabl ...@@ -379,7 +379,7 @@ extension YHResignAppointScheduleListViewController: UITableViewDelegate, UITabl
} }
// 分组 // 分组
let cell2 = tableView.dequeueReusableCell(withIdentifier: YHResignHaveAppointedMultipleInfoCell.cellReuseIdentifier, for: indexPath) as! YHResignHaveAppointedMultipleInfoCell let cell2 = tableView.dequeueReusableCell(withIdentifier: YHResignScheduleMultipleInfoCell.cellReuseIdentifier, for: indexPath) as! YHResignScheduleMultipleInfoCell
model.batchIndex = indexPath.row+1 model.batchIndex = indexPath.row+1
cell2.updateModel(model) cell2.updateModel(model)
cell2.clickConfirmBtnBlock = { cell2.clickConfirmBtnBlock = {
......
...@@ -33,7 +33,7 @@ class YHResignAppointTimeModifyViewController: YHBaseViewController { ...@@ -33,7 +33,7 @@ class YHResignAppointTimeModifyViewController: YHBaseViewController {
tableView.separatorStyle = .none tableView.separatorStyle = .none
tableView.bounces = false tableView.bounces = false
tableView.register(YHResignAppointOptionResultCell.self, forCellReuseIdentifier: YHResignAppointOptionResultCell.cellReuseIdentifier) tableView.register(YHResignAppointOptionResultCell.self, forCellReuseIdentifier: YHResignAppointOptionResultCell.cellReuseIdentifier)
tableView.register(YHResignAppointApplicantInfoCell.self, forCellReuseIdentifier: YHResignAppointApplicantInfoCell.cellReuseIdentifier) tableView.register(YHResignHaveAppointedApplicantsInfoCell.self, forCellReuseIdentifier: YHResignHaveAppointedApplicantsInfoCell.cellReuseIdentifier)
tableView.register(YHResignAppointTimeMultipleCell.self, forCellReuseIdentifier: YHResignAppointTimeMultipleCell.cellReuseIdentifier) tableView.register(YHResignAppointTimeMultipleCell.self, forCellReuseIdentifier: YHResignAppointTimeMultipleCell.cellReuseIdentifier)
tableView.delegate = self tableView.delegate = self
tableView.dataSource = self tableView.dataSource = self
...@@ -129,7 +129,7 @@ extension YHResignAppointTimeModifyViewController: UITableViewDelegate, UITableV ...@@ -129,7 +129,7 @@ extension YHResignAppointTimeModifyViewController: UITableViewDelegate, UITableV
if 0 <= indexPath.row && indexPath.row < selectGroupArr.count { if 0 <= indexPath.row && indexPath.row < selectGroupArr.count {
let model = selectGroupArr[indexPath.row] let model = selectGroupArr[indexPath.row]
if model.isHaveAppointed { // 已确认在港 只展示信息 if model.isHaveAppointed { // 已确认在港 只展示信息
let cell1 = tableView.dequeueReusableCell(withIdentifier: YHResignAppointApplicantInfoCell.cellReuseIdentifier, for: indexPath) as! YHResignAppointApplicantInfoCell let cell1 = tableView.dequeueReusableCell(withIdentifier: YHResignHaveAppointedApplicantsInfoCell.cellReuseIdentifier, for: indexPath) as! YHResignHaveAppointedApplicantsInfoCell
cell1.updateModel(model) cell1.updateModel(model)
return cell1 return cell1
} }
......
...@@ -84,7 +84,7 @@ class YHResignAppointTimeMultipleCell: UITableViewCell { ...@@ -84,7 +84,7 @@ class YHResignAppointTimeMultipleCell: UITableViewCell {
collectView.dataSource = self collectView.dataSource = self
collectView.backgroundColor = .clear collectView.backgroundColor = .clear
// 注册自定义单元格 // 注册自定义单元格
collectView.register(YHResignAppointApplicantCell.self, forCellWithReuseIdentifier: YHResignAppointApplicantCell.cellReuseIdentifier) collectView.register(YHResignSelectApplicantCollectCell.self, forCellWithReuseIdentifier: YHResignSelectApplicantCollectCell.cellReuseIdentifier)
return collectView return collectView
}() }()
...@@ -425,7 +425,7 @@ extension YHResignAppointTimeMultipleCell: UICollectionViewDelegate, UICollectio ...@@ -425,7 +425,7 @@ extension YHResignAppointTimeMultipleCell: UICollectionViewDelegate, UICollectio
// 返回自定义单元格 // 返回自定义单元格
func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell { func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell {
let cell = collectionView.dequeueReusableCell(withReuseIdentifier: YHResignAppointApplicantCell.cellReuseIdentifier, for: indexPath) as! YHResignAppointApplicantCell let cell = collectionView.dequeueReusableCell(withReuseIdentifier: YHResignSelectApplicantCollectCell.cellReuseIdentifier, for: indexPath) as! YHResignSelectApplicantCollectCell
if 0 <= indexPath.item && indexPath.item < arr.count { if 0 <= indexPath.item && indexPath.item < arr.count {
let applicant = arr[indexPath.item] let applicant = arr[indexPath.item]
cell.updateApplicantInfo(applicant) cell.updateApplicantInfo(applicant)
......
...@@ -44,7 +44,7 @@ class YHResignAppointedScheduleLineView: UIView { ...@@ -44,7 +44,7 @@ class YHResignAppointedScheduleLineView: UIView {
let collectionView = UICollectionView(frame: .zero, collectionViewLayout: flowLayout) let collectionView = UICollectionView(frame: .zero, collectionViewLayout: flowLayout)
collectionView.backgroundColor = .clear collectionView.backgroundColor = .clear
collectionView.register(YHResignAppointedScheduleLineCollectCell.self, forCellWithReuseIdentifier:YHResignAppointedScheduleLineCollectCell.cellReuseIdentifier) collectionView.register(YHResignScheduleLineCollectCell.self, forCellWithReuseIdentifier:YHResignScheduleLineCollectCell.cellReuseIdentifier)
collectionView.delegate = self collectionView.delegate = self
collectionView.dataSource = self collectionView.dataSource = self
collectionView.bounces = false collectionView.bounces = false
...@@ -134,7 +134,7 @@ extension YHResignAppointedScheduleLineView: UICollectionViewDelegate, UICollect ...@@ -134,7 +134,7 @@ extension YHResignAppointedScheduleLineView: UICollectionViewDelegate, UICollect
// 返回自定义单元格 // 返回自定义单元格
func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell { func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell {
let cell = collectionView.dequeueReusableCell(withReuseIdentifier: YHResignAppointedScheduleLineCollectCell.cellReuseIdentifier, for: indexPath) as! YHResignAppointedScheduleLineCollectCell let cell = collectionView.dequeueReusableCell(withReuseIdentifier: YHResignScheduleLineCollectCell.cellReuseIdentifier, for: indexPath) as! YHResignScheduleLineCollectCell
if 0 <= indexPath.item && indexPath.item < steps.count { if 0 <= indexPath.item && indexPath.item < steps.count {
let model = steps[indexPath.item] let model = steps[indexPath.item]
model.index = indexPath.item+1 model.index = indexPath.item+1
......
// //
// YHResignAppointApplicantInfoCell.swift // YHResignHaveAppointedApplicantsInfoCell.swift
// galaxy // galaxy
// //
// Created by edy on 2024/10/10. // Created by edy on 2024/10/10.
...@@ -9,9 +9,9 @@ ...@@ -9,9 +9,9 @@
import UIKit import UIKit
import AttributedString import AttributedString
class YHResignAppointApplicantInfoCell: UITableViewCell { class YHResignHaveAppointedApplicantsInfoCell: UITableViewCell {
static let cellReuseIdentifier = "YHResignAppointApplicantInfoCell" static let cellReuseIdentifier = "YHResignHaveAppointedApplicantsInfoCell"
lazy var whiteContentView: UIView = { lazy var whiteContentView: UIView = {
let view = UIView() let view = UIView()
......
// //
// YHResignAppointedScheduleLineCell.swift // YHResignScheduleLineCollectCell.swift
// galaxy // galaxy
// //
// Created by edy on 2024/10/10. // Created by edy on 2024/10/10.
...@@ -8,9 +8,9 @@ ...@@ -8,9 +8,9 @@
import UIKit import UIKit
class YHResignAppointedScheduleLineCollectCell: UICollectionViewCell { class YHResignScheduleLineCollectCell: UICollectionViewCell {
static let cellReuseIdentifier = "YHResignAppointedScheduleLineCollectCell" static let cellReuseIdentifier = "YHResignScheduleLineCollectCell"
lazy var numLabel: UILabel = { lazy var numLabel: UILabel = {
var label = UILabel() var label = UILabel()
......
// //
// YHResignHaveAppointedInfoCellTableViewCell.swift // YHResignScheduleMultipleInfoCell.swift
// galaxy // galaxy
// //
// Created by edy on 2024/10/10. // Created by edy on 2024/10/10.
...@@ -8,9 +8,9 @@ ...@@ -8,9 +8,9 @@
import UIKit import UIKit
class YHResignHaveAppointedMultipleInfoCell: UITableViewCell { class YHResignScheduleMultipleInfoCell: UITableViewCell {
static let cellReuseIdentifier = "YHResignHaveAppointedMultipleInfoCell" static let cellReuseIdentifier = "YHResignScheduleMultipleInfoCell"
var confirmHKStatus: YHResignConfirmHKStatus = .waitConfirmHK var confirmHKStatus: YHResignConfirmHKStatus = .waitConfirmHK
var clickConfirmBtnBlock: ((YHResignConfirmHKStatus)->())? var clickConfirmBtnBlock: ((YHResignConfirmHKStatus)->())?
......
// //
// YHResignHaveAppointedSingleInfoCell.swift // YHResignScheduleSingleInfoCell.swift
// galaxy // galaxy
// //
// Created by edy on 2024/10/11. // Created by edy on 2024/10/11.
...@@ -14,9 +14,9 @@ enum YHResignConfirmHKStatus: Int { ...@@ -14,9 +14,9 @@ enum YHResignConfirmHKStatus: Int {
case haveConfirmHK = 2 // 已确认在港 case haveConfirmHK = 2 // 已确认在港
} }
class YHResignHaveAppointedSingleInfoCell: UITableViewCell { class YHResignScheduleSingleInfoCell: UITableViewCell {
static let cellReuseIdentifier = "YHResignHaveAppointedSingleInfoCell" static let cellReuseIdentifier = "YHResignScheduleSingleInfoCell"
var clickConfirmBtnBlock: ((YHResignConfirmHKStatus)->())? var clickConfirmBtnBlock: ((YHResignConfirmHKStatus)->())?
var modifyBtnBlock: (()->())? var modifyBtnBlock: (()->())?
......
// //
// YHResignAppointApplicantCell.swift // YHResignSelectApplicantCollectCell.swift
// galaxy // galaxy
// //
// Created by edy on 2024/10/12. // Created by edy on 2024/10/12.
...@@ -8,9 +8,9 @@ ...@@ -8,9 +8,9 @@
import UIKit import UIKit
class YHResignAppointApplicantCell: UICollectionViewCell { class YHResignSelectApplicantCollectCell: UICollectionViewCell {
static let cellReuseIdentifier = "YHResignAppointApplicantCell" static let cellReuseIdentifier = "YHResignSelectApplicantCollectCell"
lazy var selectImgView:UIImageView = { lazy var selectImgView:UIImageView = {
let view = UIImageView(image: UIImage(named: "")) let view = UIImageView(image: UIImage(named: ""))
......
...@@ -167,6 +167,21 @@ class YHResignInfoConfirmModifyViewController: YHBaseViewController { ...@@ -167,6 +167,21 @@ class YHResignInfoConfirmModifyViewController: YHBaseViewController {
} }
} }
} }
func requestNamePinYin() {
YHHUD.hide()
if !self.detailMember.name.isEmpty, self.detailMember.familyName.isEmpty {
YHHUD.show(.progress(message: "加载中..."))
self.viewModel.getPinYinFromName(self.detailMember.name) {
[weak self] firstName, lastName in
YHHUD.hide()
guard let self = self else { return }
self.detailMember.familyName = firstName
self.detailMember.givenName = lastName
self.updateData()
}
}
}
} }
extension YHResignInfoConfirmModifyViewController: UITableViewDelegate, UITableViewDataSource { extension YHResignInfoConfirmModifyViewController: UITableViewDelegate, UITableViewDataSource {
...@@ -202,13 +217,21 @@ extension YHResignInfoConfirmModifyViewController: UITableViewDelegate, UITableV ...@@ -202,13 +217,21 @@ extension YHResignInfoConfirmModifyViewController: UITableViewDelegate, UITableV
self.isInfoEditing = true self.isInfoEditing = true
self.detailMember.isNeedCheck = true self.detailMember.isNeedCheck = true
self.updateData() self.updateData()
self.requestNamePinYin()
return return
} }
} }
self.isInfoEditing = isEdit self.isInfoEditing = isEdit
self.updateData() self.updateData()
self.requestNamePinYin()
} }
cell.updateNamePinYinBlock = {
[weak self] in
guard let self = self else { return }
self.requestNamePinYin()
}
// 选择出生国家/地区 // 选择出生国家/地区
cell.selectBirthNation = { cell.selectBirthNation = {
[weak self] isInChina in [weak self] isInChina in
......
...@@ -143,6 +143,8 @@ class YHResignFamilyInfoListCell: UITableViewCell { ...@@ -143,6 +143,8 @@ class YHResignFamilyInfoListCell: UITableViewCell {
// 是否进入编辑模式 // 是否进入编辑模式
var editBlock:((Bool)->())? var editBlock:((Bool)->())?
// 更新姓名拼音
var updateNamePinYinBlock:(()->())?
// 选择出生国家 // 选择出生国家
var selectBirthNation:((Bool)->())? var selectBirthNation:((Bool)->())?
// 姓名更改 // 姓名更改
...@@ -249,32 +251,12 @@ class YHResignFamilyInfoListCell: UITableViewCell { ...@@ -249,32 +251,12 @@ class YHResignFamilyInfoListCell: UITableViewCell {
guard let self = self else { return } guard let self = self else { return }
self.updateList?() self.updateList?()
} }
// itemView.updateName = { itemView.updateNamePinYinBlock = {
// [weak self] text in [weak self] in
// guard let self = self else { return } guard let self = self else { return }
// for subView in self.itemsContentView.subviews { self.updateNamePinYinBlock?()
// if subView is YHResignInfoItemView { }
// let targetView = subView as! YHResignInfoItemView
// if targetView.item.id == .firstName {
// targetView.item.value = self.familyInfo.familyName
// }
// if targetView.item.id == .lastName {
// targetView.item.value = self.familyInfo.givenName
// targetView.updateItem(targetView.item, familyInfo: self.familyInfo)
// }
// targetView.updateItem(targetView.item, familyInfo: self.familyInfo)
// }
// }
// self.itemsContentView.snp.updateConstraints { make in
// make.top.equalTo(self.titleLabel.snp.bottom).offset(12)
// make.left.equalTo(18)
// make.right.equalTo(-18)
// make.bottom.equalTo(0)
// }
// self.setNeedsLayout()
// self.layoutIfNeeded()
//
// }
} else if let itemView = itemView as? YHResignInfoValidTimeItemView { } else if let itemView = itemView as? YHResignInfoValidTimeItemView {
itemsContentView.addSubview(itemView) itemsContentView.addSubview(itemView)
itemView.updateItem(item, familyInfo: familyInfo) itemView.updateItem(item, familyInfo: familyInfo)
......
...@@ -17,8 +17,8 @@ class YHResignInfoItemView: UIView { ...@@ -17,8 +17,8 @@ class YHResignInfoItemView: UIView {
var item: YHResignFamilyInfoItem = YHResignFamilyInfoItem() var item: YHResignFamilyInfoItem = YHResignFamilyInfoItem()
var faimilyInfo = YHResignInfoConfirmFamilyModel() var faimilyInfo = YHResignInfoConfirmFamilyModel()
// 姓名更改 // 更新姓名拼音
var updateName:((String)->())? var updateNamePinYinBlock:(()->())?
var updateList:(()->())? var updateList:(()->())?
let rightBtnWidth = 22.0 let rightBtnWidth = 22.0
...@@ -350,11 +350,8 @@ extension YHResignInfoItemView: UITextFieldDelegate { ...@@ -350,11 +350,8 @@ extension YHResignInfoItemView: UITextFieldDelegate {
func textFieldDidEndEditing(_ textField: UITextField) { func textFieldDidEndEditing(_ textField: UITextField) {
if self.item.id == .mainApplicantName || self.item.id == .spouseName || self.item.id == .childName { if self.item.id == .mainApplicantName || self.item.id == .spouseName || self.item.id == .childName {
// 名称编辑时需防抖请求拼音 self.updateNamePinYin()
debounceTimer?.invalidate()
debounceTimer = Timer.scheduledTimer(withTimeInterval: 1.0, repeats: false) { [weak self] _ in
self?.updateNamePinYin()
}
} else { } else {
self.updateList?() self.updateList?()
} }
...@@ -371,17 +368,7 @@ extension YHResignInfoItemView: UITextFieldDelegate { ...@@ -371,17 +368,7 @@ extension YHResignInfoItemView: UITextFieldDelegate {
self.updateList?() self.updateList?()
return return
} }
self.updateNamePinYinBlock?()
YHHUD.show(.progress(message: "加载中..."))
self.viewModel.getPinYinFromName(text) {
[weak self] firstNamePinYin, lastNamePinYin in
YHHUD.hide()
guard let self = self else { return }
self.faimilyInfo.familyName = firstNamePinYin
self.faimilyInfo.givenName = lastNamePinYin
self.updateList?()
}
} }
} }
...@@ -395,6 +382,8 @@ extension YHResignInfoItemView: UITextFieldDelegate { ...@@ -395,6 +382,8 @@ extension YHResignInfoItemView: UITextFieldDelegate {
self.faimilyInfo.familyName = "" self.faimilyInfo.familyName = ""
self.faimilyInfo.givenName = "" self.faimilyInfo.givenName = ""
self.updateList?() self.updateList?()
} else {
} }
return return
} }
......
...@@ -105,7 +105,7 @@ class YHResignInfoConfirmViewModel { ...@@ -105,7 +105,7 @@ class YHResignInfoConfirmViewModel {
} }
} }
func getPinYinFromName(_ name: String, callback:((String, String)->())?) { func getPinYinFromName(_ name: String, callback: @escaping ((String, String)->())) {
let strUrl = YHBaseUrlManager.shared.curURL() + YHAllApiName.FamilyInfoConfirm.pinyinInfo let strUrl = YHBaseUrlManager.shared.curURL() + YHAllApiName.FamilyInfoConfirm.pinyinInfo
let _ = YHNetRequest.getRequest(url: strUrl,params: ["name" : name]) { [weak self] json, code in let _ = YHNetRequest.getRequest(url: strUrl,params: ["name" : name]) { [weak self] json, code in
...@@ -117,19 +117,19 @@ class YHResignInfoConfirmViewModel { ...@@ -117,19 +117,19 @@ class YHResignInfoConfirmViewModel {
guard let dic = json.data?.peel as? [String : Any], let resultModel = YHFamilyNamePinYin.deserialize(from: dic) else { guard let dic = json.data?.peel as? [String : Any], let resultModel = YHFamilyNamePinYin.deserialize(from: dic) else {
let err = YHErrorModel(errorCode: YHErrorCode.dictParseError.rawValue, errorMsg: YHErrorCode.dictParseError.description()) let err = YHErrorModel(errorCode: YHErrorCode.dictParseError.rawValue, errorMsg: YHErrorCode.dictParseError.description())
callback?("", "") callback("", "")
return return
} }
self.pinyinInfo = resultModel self.pinyinInfo = resultModel
callback?(resultModel.family_name, resultModel.given_name) callback(resultModel.family_name, resultModel.given_name)
} else { } else {
let err = YHErrorModel(errorCode: Int32(json.code), errorMsg: json.msg.isEmpty ? "" : json.msg) let err = YHErrorModel(errorCode: Int32(json.code), errorMsg: json.msg.isEmpty ? "" : json.msg)
callback?("", "") callback("", "")
} }
} failBlock: { err in } failBlock: { err in
callback?("", "") callback("", "")
} }
} }
} }
......
...@@ -620,7 +620,7 @@ extension YHResignUploadDocDetailViewController: UITableViewDelegate, UITableVie ...@@ -620,7 +620,7 @@ extension YHResignUploadDocDetailViewController: UITableViewDelegate, UITableVie
unavailableLabel.textAlignment = .left unavailableLabel.textAlignment = .left
unavailableLabel.numberOfLines = 0 unavailableLabel.numberOfLines = 0
unavailableLabel.text = self.materialModel.unavailable_reason unavailableLabel.text = "原因:" + self.materialModel.unavailable_reason
bgView.addSubview(unavailableLabel) bgView.addSubview(unavailableLabel)
tipsLabel.snp.remakeConstraints { make in tipsLabel.snp.remakeConstraints { make in
......
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