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 {
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 item6 = YHItemModel(id: .id37, isNeed: true, title: "签发地", isUserKeyBoard: true, prompts: "请输入", message: getResultString(dataModel.cert_info.address), 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: 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 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 {
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 item4 = YHItemModel(id: .id37, isNeed: true, title: "签发地", isUserKeyBoard: true, prompts: "请输入", message: getResultString(dataModel.cert_info.address), 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: 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 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
}
sheetView.show()
} else if editType == .delete { // 删除
if let index = self.detailModel?.signedDocument.firstIndex(where: { model in
model.url == urlStr
}) {
self.detailModel?.signedDocument.remove(at: index)
self.updateUploadFilesSection()
// 增加二次弹窗确认
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))
let message2: ASAttributedString = .init(string: "吗?", .font(UIFont.PFSC_R(ofSize: 16)), .foreground(UIColor.mainTextColor))
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 { // 预览
self.previewUploadedFiles(urlStr, title: title)
}
......@@ -364,7 +375,15 @@ extension YHResignDocumentDetailViewController: UITableViewDelegate, UITableView
}
cell.sureButtonClickEvent = { [weak self] in
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
}
......
......@@ -39,8 +39,8 @@ class YHResignAppointScheduleListViewController: YHBaseViewController {
tableView.separatorStyle = .none
tableView.bounces = false
tableView.register(YHResignHaveAppointedMultipleInfoCell.self, forCellReuseIdentifier: YHResignHaveAppointedMultipleInfoCell.cellReuseIdentifier)
tableView.register(YHResignHaveAppointedSingleInfoCell.self, forCellReuseIdentifier: YHResignHaveAppointedSingleInfoCell.cellReuseIdentifier)
tableView.register(YHResignScheduleMultipleInfoCell.self, forCellReuseIdentifier: YHResignScheduleMultipleInfoCell.cellReuseIdentifier)
tableView.register(YHResignScheduleSingleInfoCell.self, forCellReuseIdentifier: YHResignScheduleSingleInfoCell.cellReuseIdentifier)
tableView.delegate = self
tableView.dataSource = self
return tableView
......@@ -360,7 +360,7 @@ extension YHResignAppointScheduleListViewController: UITableViewDelegate, UITabl
if 0 <= indexPath.row && indexPath.row < scheduleArr.count {
let model = scheduleArr[indexPath.row]
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.clickConfirmBtnBlock = {
......@@ -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
cell2.updateModel(model)
cell2.clickConfirmBtnBlock = {
......
......@@ -33,7 +33,7 @@ class YHResignAppointTimeModifyViewController: YHBaseViewController {
tableView.separatorStyle = .none
tableView.bounces = false
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.delegate = self
tableView.dataSource = self
......@@ -129,7 +129,7 @@ extension YHResignAppointTimeModifyViewController: UITableViewDelegate, UITableV
if 0 <= indexPath.row && indexPath.row < selectGroupArr.count {
let model = selectGroupArr[indexPath.row]
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)
return cell1
}
......
......@@ -84,7 +84,7 @@ class YHResignAppointTimeMultipleCell: UITableViewCell {
collectView.dataSource = self
collectView.backgroundColor = .clear
// 注册自定义单元格
collectView.register(YHResignAppointApplicantCell.self, forCellWithReuseIdentifier: YHResignAppointApplicantCell.cellReuseIdentifier)
collectView.register(YHResignSelectApplicantCollectCell.self, forCellWithReuseIdentifier: YHResignSelectApplicantCollectCell.cellReuseIdentifier)
return collectView
}()
......@@ -425,7 +425,7 @@ extension YHResignAppointTimeMultipleCell: UICollectionViewDelegate, UICollectio
// 返回自定义单元格
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 {
let applicant = arr[indexPath.item]
cell.updateApplicantInfo(applicant)
......
......@@ -44,7 +44,7 @@ class YHResignAppointedScheduleLineView: UIView {
let collectionView = UICollectionView(frame: .zero, collectionViewLayout: flowLayout)
collectionView.backgroundColor = .clear
collectionView.register(YHResignAppointedScheduleLineCollectCell.self, forCellWithReuseIdentifier:YHResignAppointedScheduleLineCollectCell.cellReuseIdentifier)
collectionView.register(YHResignScheduleLineCollectCell.self, forCellWithReuseIdentifier:YHResignScheduleLineCollectCell.cellReuseIdentifier)
collectionView.delegate = self
collectionView.dataSource = self
collectionView.bounces = false
......@@ -134,7 +134,7 @@ extension YHResignAppointedScheduleLineView: UICollectionViewDelegate, UICollect
// 返回自定义单元格
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 {
let model = steps[indexPath.item]
model.index = indexPath.item+1
......
//
// YHResignAppointApplicantInfoCell.swift
// YHResignHaveAppointedApplicantsInfoCell.swift
// galaxy
//
// Created by edy on 2024/10/10.
......@@ -9,9 +9,9 @@
import UIKit
import AttributedString
class YHResignAppointApplicantInfoCell: UITableViewCell {
class YHResignHaveAppointedApplicantsInfoCell: UITableViewCell {
static let cellReuseIdentifier = "YHResignAppointApplicantInfoCell"
static let cellReuseIdentifier = "YHResignHaveAppointedApplicantsInfoCell"
lazy var whiteContentView: UIView = {
let view = UIView()
......
//
// YHResignAppointedScheduleLineCell.swift
// YHResignScheduleLineCollectCell.swift
// galaxy
//
// Created by edy on 2024/10/10.
......@@ -8,9 +8,9 @@
import UIKit
class YHResignAppointedScheduleLineCollectCell: UICollectionViewCell {
class YHResignScheduleLineCollectCell: UICollectionViewCell {
static let cellReuseIdentifier = "YHResignAppointedScheduleLineCollectCell"
static let cellReuseIdentifier = "YHResignScheduleLineCollectCell"
lazy var numLabel: UILabel = {
var label = UILabel()
......
//
// YHResignHaveAppointedInfoCellTableViewCell.swift
// YHResignScheduleMultipleInfoCell.swift
// galaxy
//
// Created by edy on 2024/10/10.
......@@ -8,9 +8,9 @@
import UIKit
class YHResignHaveAppointedMultipleInfoCell: UITableViewCell {
class YHResignScheduleMultipleInfoCell: UITableViewCell {
static let cellReuseIdentifier = "YHResignHaveAppointedMultipleInfoCell"
static let cellReuseIdentifier = "YHResignScheduleMultipleInfoCell"
var confirmHKStatus: YHResignConfirmHKStatus = .waitConfirmHK
var clickConfirmBtnBlock: ((YHResignConfirmHKStatus)->())?
......
//
// YHResignHaveAppointedSingleInfoCell.swift
// YHResignScheduleSingleInfoCell.swift
// galaxy
//
// Created by edy on 2024/10/11.
......@@ -14,9 +14,9 @@ enum YHResignConfirmHKStatus: Int {
case haveConfirmHK = 2 // 已确认在港
}
class YHResignHaveAppointedSingleInfoCell: UITableViewCell {
class YHResignScheduleSingleInfoCell: UITableViewCell {
static let cellReuseIdentifier = "YHResignHaveAppointedSingleInfoCell"
static let cellReuseIdentifier = "YHResignScheduleSingleInfoCell"
var clickConfirmBtnBlock: ((YHResignConfirmHKStatus)->())?
var modifyBtnBlock: (()->())?
......
//
// YHResignAppointApplicantCell.swift
// YHResignSelectApplicantCollectCell.swift
// galaxy
//
// Created by edy on 2024/10/12.
......@@ -8,9 +8,9 @@
import UIKit
class YHResignAppointApplicantCell: UICollectionViewCell {
class YHResignSelectApplicantCollectCell: UICollectionViewCell {
static let cellReuseIdentifier = "YHResignAppointApplicantCell"
static let cellReuseIdentifier = "YHResignSelectApplicantCollectCell"
lazy var selectImgView:UIImageView = {
let view = UIImageView(image: UIImage(named: ""))
......
......@@ -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 {
......@@ -202,13 +217,21 @@ extension YHResignInfoConfirmModifyViewController: UITableViewDelegate, UITableV
self.isInfoEditing = true
self.detailMember.isNeedCheck = true
self.updateData()
self.requestNamePinYin()
return
}
}
self.isInfoEditing = isEdit
self.updateData()
self.requestNamePinYin()
}
cell.updateNamePinYinBlock = {
[weak self] in
guard let self = self else { return }
self.requestNamePinYin()
}
// 选择出生国家/地区
cell.selectBirthNation = {
[weak self] isInChina in
......
......@@ -143,6 +143,8 @@ class YHResignFamilyInfoListCell: UITableViewCell {
// 是否进入编辑模式
var editBlock:((Bool)->())?
// 更新姓名拼音
var updateNamePinYinBlock:(()->())?
// 选择出生国家
var selectBirthNation:((Bool)->())?
// 姓名更改
......@@ -249,32 +251,12 @@ class YHResignFamilyInfoListCell: UITableViewCell {
guard let self = self else { return }
self.updateList?()
}
// itemView.updateName = {
// [weak self] text in
// guard let self = self else { return }
// for subView in self.itemsContentView.subviews {
// 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()
//
// }
itemView.updateNamePinYinBlock = {
[weak self] in
guard let self = self else { return }
self.updateNamePinYinBlock?()
}
} else if let itemView = itemView as? YHResignInfoValidTimeItemView {
itemsContentView.addSubview(itemView)
itemView.updateItem(item, familyInfo: familyInfo)
......
......@@ -17,8 +17,8 @@ class YHResignInfoItemView: UIView {
var item: YHResignFamilyInfoItem = YHResignFamilyInfoItem()
var faimilyInfo = YHResignInfoConfirmFamilyModel()
// 姓名更改
var updateName:((String)->())?
// 更新姓名拼音
var updateNamePinYinBlock:(()->())?
var updateList:(()->())?
let rightBtnWidth = 22.0
......@@ -350,11 +350,8 @@ extension YHResignInfoItemView: UITextFieldDelegate {
func textFieldDidEndEditing(_ textField: UITextField) {
if self.item.id == .mainApplicantName || self.item.id == .spouseName || self.item.id == .childName {
// 名称编辑时需防抖请求拼音
debounceTimer?.invalidate()
debounceTimer = Timer.scheduledTimer(withTimeInterval: 1.0, repeats: false) { [weak self] _ in
self?.updateNamePinYin()
}
self.updateNamePinYin()
} else {
self.updateList?()
}
......@@ -371,17 +368,7 @@ extension YHResignInfoItemView: UITextFieldDelegate {
self.updateList?()
return
}
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?()
}
self.updateNamePinYinBlock?()
}
}
......@@ -395,6 +382,8 @@ extension YHResignInfoItemView: UITextFieldDelegate {
self.faimilyInfo.familyName = ""
self.faimilyInfo.givenName = ""
self.updateList?()
} else {
}
return
}
......
......@@ -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 _ = YHNetRequest.getRequest(url: strUrl,params: ["name" : name]) { [weak self] json, code in
......@@ -117,19 +117,19 @@ class YHResignInfoConfirmViewModel {
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())
callback?("", "")
callback("", "")
return
}
self.pinyinInfo = resultModel
callback?(resultModel.family_name, resultModel.given_name)
callback(resultModel.family_name, resultModel.given_name)
} else {
let err = YHErrorModel(errorCode: Int32(json.code), errorMsg: json.msg.isEmpty ? "" : json.msg)
callback?("", "")
callback("", "")
}
} failBlock: { err in
callback?("", "")
callback("", "")
}
}
}
......
......@@ -620,7 +620,7 @@ extension YHResignUploadDocDetailViewController: UITableViewDelegate, UITableVie
unavailableLabel.textAlignment = .left
unavailableLabel.numberOfLines = 0
unavailableLabel.text = self.materialModel.unavailable_reason
unavailableLabel.text = "原因:" + self.materialModel.unavailable_reason
bgView.addSubview(unavailableLabel)
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