Commit 09b9607b authored by Steven杜宇's avatar Steven杜宇

// 证件修改

parent d879dace
......@@ -33,7 +33,7 @@ platform :ios do
double11 = "double11"
#打包正使用的分支
myPack_branch = double11
myPack_branch = develop_branch
# 打adhoc包 执行命令 fastlane galaxyTest
lane :galaxyTest do
......
......@@ -16,8 +16,9 @@ class YHResignCertificateDetailHkViewController: YHBaseViewController {
return vm
}()
//上个界面传递过来的数据对象
var dataModel : YHResignCertificateModel = YHResignCertificateModel()
var cerId: Int = 0 // 证件ID
// 通过cerId请求 的数据对象
private var dataModel : YHResignCertificateModel = YHResignCertificateModel()
var orderId: Int = 0
var tipsArr: [ASAttributedString] = []
var urls: [String] = ["",""]
......@@ -170,6 +171,27 @@ class YHResignCertificateDetailHkViewController: YHBaseViewController {
override func viewWillAppear(_ animated: Bool) {
super.viewWillAppear(animated)
reuqestCertificateDetail()
}
func reuqestCertificateDetail() {
YHHUD.show(.progress(message: "加载中..."))
self.viewModel.getCertificateDetail(self.cerId) {
[weak self] model, error in
YHHUD.hide()
guard let self = self else { return }
guard let model = model else {
let msg = error?.errorMsg ?? ""
YHHUD.flash(message: msg)
return
}
self.dataModel = model
self.loadDetailInfo()
self.showExampleView()
}
}
func showExampleView() {
if dataModel.cert_info.is_show {
} else {
......
......@@ -16,8 +16,9 @@ class YHResignCertificateDetailPassPortViewController: YHBaseViewController {
return vm
}()
//上个界面传递过来的数据对象
var dataModel : YHResignCertificateModel = YHResignCertificateModel()
var cerId: Int = 0 // 证件ID
// 通过cerId请求 的数据对象
private var dataModel : YHResignCertificateModel = YHResignCertificateModel()
var orderId: Int = 0
var tipsArr: [ASAttributedString] = []
var urls: [String] = [""]
......@@ -155,6 +156,27 @@ class YHResignCertificateDetailPassPortViewController: YHBaseViewController {
override func viewWillAppear(_ animated: Bool) {
super.viewWillAppear(animated)
reuqestCertificateDetail()
}
func reuqestCertificateDetail() {
YHHUD.show(.progress(message: "加载中..."))
self.viewModel.getCertificateDetail(self.cerId) {
[weak self] model, error in
YHHUD.hide()
guard let self = self else { return }
guard let model = model else {
let msg = error?.errorMsg ?? ""
YHHUD.flash(message: msg)
return
}
self.dataModel = model
self.loadDetailInfo()
self.showExampleView()
}
}
func showExampleView() {
if dataModel.cert_info.is_show {
} else {
......
......@@ -88,11 +88,11 @@ extension YHResignCertificateListViewController: UITableViewDelegate, UITableVie
if indexPath.row == 0 {
if model.cert_type == "PASS_PORT" {
let vc = YHResignCertificateDetailPassPortViewController()
vc.dataModel = model
vc.cerId = model.id
self.navigationController?.pushViewController(vc)
} else {
let vc = YHResignCertificateDetailHkViewController()
vc.dataModel = model
vc.cerId = model.id
self.navigationController?.pushViewController(vc)
}
}
......
......@@ -29,6 +29,31 @@ class YHResignCertificateDetailViewModel: YHBaseViewModel {
}
}
func getCertificateDetail(_ cerId: Int, callback:((_ model: YHResignCertificateModel?, _ error:YHErrorModel?)->())?) {
let strUrl = YHBaseUrlManager.shared.curURL() + YHAllApiName.ResignCertificate.certificateDetail
let _ = YHNetRequest.getRequest(url: strUrl,params: ["id" : cerId]) { json, code in
//1. json字符串 转 对象
printLog("model 是 ==> \(json)")
if json.code == 200 {
guard let dic = json.data?.peel as? [String : Any], let resultModel = YHResignCertificateModel.deserialize(from: dic) else {
let err = YHErrorModel(errorCode: YHErrorCode.dictParseError.rawValue, errorMsg: YHErrorCode.dictParseError.description())
callback?(nil, err)
return
}
callback?(resultModel, nil)
} else {
let err = YHErrorModel(errorCode: Int32(json.code), errorMsg: json.msg.isEmpty ? "" : json.msg)
callback?(nil, err)
}
} failBlock: { err in
callback?(nil, err)
}
}
func getBaseDataSource(_ isShowPrompt: Bool) -> [YHItemModel] {
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:"请选择到期时间")
......
......@@ -188,6 +188,8 @@ extension YHResignInfoConfirmModifyViewController: UITableViewDelegate, UITableV
func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
let cell = tableView.dequeueReusableCell(withIdentifier: YHResignFamilyInfoListCell.cellReuseIdentifier, for: indexPath) as! YHResignFamilyInfoListCell
cell.familyInfo = self.detailMember
if indexPath.row == 0 {
// 标题
......@@ -195,7 +197,6 @@ extension YHResignInfoConfirmModifyViewController: UITableViewDelegate, UITableV
cell.titleLabel.attributed.text = title
cell.modifyBtn.isHidden = false
cell.isEditState = self.isInfoEditing
cell.familyInfo = self.detailMember
// 更改编辑状态
cell.editBlock = {
[weak self] isEdit in
......@@ -219,40 +220,31 @@ extension YHResignInfoConfirmModifyViewController: UITableViewDelegate, UITableV
guard let self = self else { return }
self.updateData()
}
} else {
let title: ASAttributedString = .init("递交证件信息", .font(UIFont.PFSC_M(ofSize: 17)),.foreground(UIColor.mainTextColor))
cell.titleLabel.attributed.text = title
cell.modifyBtn.isHidden = true
// 点击有效期不足去处理
cell.clickUnvalidTime = {
[weak self] in
guard let self = self else { return }
if let identity = self.detailMember.identity {
self.viewModel.getCertificateDetail(identity.id) { cerDetailModel, error in
guard let cerDetailModel = cerDetailModel else {
let msg = error?.errorMsg ?? "请求证件详情错误"
YHHUD.flash(message: msg)
return
}
if cerDetailModel.cert_type == "PASS_PORT" {
// 护照
let vc = YHResignCertificateDetailPassPortViewController()
vc.dataModel = cerDetailModel
self.navigationController?.pushViewController(vc)
} else {
// 港澳通行证
let vc = YHResignCertificateDetailHkViewController()
vc.dataModel = cerDetailModel
self.navigationController?.pushViewController(vc)
}
}
if identity.type == 2 {
// 港澳通行证
let vc = YHResignCertificateDetailHkViewController()
vc.cerId = identity.id
self.navigationController?.pushViewController(vc)
} else if identity.type == 3 {
// 护照
let vc = YHResignCertificateDetailPassPortViewController()
vc.cerId = identity.id
self.navigationController?.pushViewController(vc)
}
}
}
} else {
let title: ASAttributedString = .init("递交证件信息", .font(UIFont.PFSC_M(ofSize: 17)),.foreground(UIColor.mainTextColor))
cell.titleLabel.attributed.text = title
cell.modifyBtn.isHidden = true
}
if 0 <= indexPath.row && indexPath.row < items.count {
......
......@@ -151,6 +151,7 @@ class YHResignInfoValidTimeItemView: UIView {
var isNeedHiddenGrayView = true
if let identity = familyInfo.identity {
isNeedHiddenGrayView = identity.isValidDateEnough()
}
grayContentView.isHidden = isNeedHiddenGrayView
grayContentView.snp.updateConstraints { make in
......
......@@ -132,32 +132,6 @@ class YHResignInfoConfirmViewModel {
callback?("", "")
}
}
func getCertificateDetail(_ cerId: Int, callback:((_ model: YHResignCertificateModel?, _ error:YHErrorModel?)->())?) {
let strUrl = YHBaseUrlManager.shared.curURL() + YHAllApiName.ResignInfoConfirm.certificateDetail
let _ = YHNetRequest.getRequest(url: strUrl,params: ["id" : cerId]) { [weak self] json, code in
//1. json字符串 转 对象
guard let self = self else { return }
printLog("model 是 ==> \(json)")
if json.code == 200 {
guard let dic = json.data?.peel as? [String : Any], let resultModel = YHResignCertificateModel.deserialize(from: dic) else {
let err = YHErrorModel(errorCode: YHErrorCode.dictParseError.rawValue, errorMsg: YHErrorCode.dictParseError.description())
callback?(nil, err)
return
}
callback?(resultModel, nil)
} else {
let err = YHErrorModel(errorCode: Int32(json.code), errorMsg: json.msg.isEmpty ? "" : json.msg)
callback?(nil, err)
}
} failBlock: { err in
callback?(nil, err)
}
}
}
extension YHResignInfoConfirmViewModel {
......
......@@ -531,6 +531,8 @@ class YHAllApiName {
static let resignCertificateList = "super-app/certificate/list"
static let update = "super-app/certificate/update"
static let detail = "infoflow/article/detail"
static let certificateDetail = "super-app/renewal/certificate-detail"
}
// 续签文书
......@@ -572,7 +574,6 @@ class YHAllApiName {
// 信息确认成员列表点击确认
static let confirmInfo = "super-app/renewal/information-confirm"
static let update = "super-app/renewal/information-update"
static let certificateDetail = "/super-app/renewal/certificate-detail"
}
......
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