Commit f627d194 authored by Steven杜宇's avatar Steven杜宇

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

parents 877d41f0 54d65845
......@@ -214,6 +214,8 @@
044EE24C2C94396E00A2FE3A /* YHResignCertificatePassportTableViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 044EE24B2C94396D00A2FE3A /* YHResignCertificatePassportTableViewCell.swift */; };
044EE2512C955CDE00A2FE3A /* YHResignGuidelinesExampleViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 044EE2502C955CDD00A2FE3A /* YHResignGuidelinesExampleViewController.swift */; };
044EE2532C9565FF00A2FE3A /* YHResignGuidelinesExampleShareViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 044EE2522C9565FF00A2FE3A /* YHResignGuidelinesExampleShareViewController.swift */; };
044EE2562C9D0E4500A2FE3A /* YHResignGuidelinesModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 044EE2552C9D0E4500A2FE3A /* YHResignGuidelinesModel.swift */; };
044EE2592C9D0F2800A2FE3A /* YHResignGuidelinesViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 044EE2582C9D0F2800A2FE3A /* YHResignGuidelinesViewModel.swift */; };
04506F552C6F57E600738EA1 /* YHFamilyMemberInfoCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04506F542C6F57E600738EA1 /* YHFamilyMemberInfoCell.swift */; };
045A08C02C37ABF500BCBABA /* YHSegmentView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 045A08BF2C37ABF500BCBABA /* YHSegmentView.swift */; };
045A08C22C37EB8B00BCBABA /* YHMyFileListNoneCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 045A08C12C37EB8B00BCBABA /* YHMyFileListNoneCell.swift */; };
......@@ -1039,6 +1041,8 @@
044EE24B2C94396D00A2FE3A /* YHResignCertificatePassportTableViewCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHResignCertificatePassportTableViewCell.swift; sourceTree = "<group>"; };
044EE2502C955CDD00A2FE3A /* YHResignGuidelinesExampleViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHResignGuidelinesExampleViewController.swift; sourceTree = "<group>"; };
044EE2522C9565FF00A2FE3A /* YHResignGuidelinesExampleShareViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHResignGuidelinesExampleShareViewController.swift; sourceTree = "<group>"; };
044EE2552C9D0E4500A2FE3A /* YHResignGuidelinesModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHResignGuidelinesModel.swift; sourceTree = "<group>"; };
044EE2582C9D0F2800A2FE3A /* YHResignGuidelinesViewModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHResignGuidelinesViewModel.swift; sourceTree = "<group>"; };
04506F542C6F57E600738EA1 /* YHFamilyMemberInfoCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHFamilyMemberInfoCell.swift; sourceTree = "<group>"; };
045A08BF2C37ABF500BCBABA /* YHSegmentView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHSegmentView.swift; sourceTree = "<group>"; };
045A08C12C37EB8B00BCBABA /* YHMyFileListNoneCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHMyFileListNoneCell.swift; sourceTree = "<group>"; };
......@@ -2282,6 +2286,8 @@
044EE24D2C955C4300A2FE3A /* ResignGuidelines(续期身份指引) */ = {
isa = PBXGroup;
children = (
044EE2572C9D0F0E00A2FE3A /* VM */,
044EE2542C9D0DEB00A2FE3A /* M */,
044EE24F2C955CA700A2FE3A /* C */,
044EE24E2C955C9900A2FE3A /* V */,
);
......@@ -2304,6 +2310,22 @@
path = C;
sourceTree = "<group>";
};
044EE2542C9D0DEB00A2FE3A /* M */ = {
isa = PBXGroup;
children = (
044EE2552C9D0E4500A2FE3A /* YHResignGuidelinesModel.swift */,
);
path = M;
sourceTree = "<group>";
};
044EE2572C9D0F0E00A2FE3A /* VM */ = {
isa = PBXGroup;
children = (
044EE2582C9D0F2800A2FE3A /* YHResignGuidelinesViewModel.swift */,
);
path = VM;
sourceTree = "<group>";
};
045EED972B9F171A0022A143 /* ServiceProcess(我的信息流程) */ = {
isa = PBXGroup;
children = (
......@@ -5350,6 +5372,7 @@
045EEED52B9F171A0022A143 /* YHEducationRequestViewModel.swift in Sources */,
04256DE22C72E1EA00A37BA4 /* YHCertificateAppointOptionCell.swift in Sources */,
0430E6702C749BCF000511E2 /* YHAdopterResidentTableViewCell.swift in Sources */,
044EE2592C9D0F2800A2FE3A /* YHResignGuidelinesViewModel.swift in Sources */,
045EEEB62B9F171A0022A143 /* YHWorkExperienceItemView.swift in Sources */,
047AA3E42C4A6ADC009C4554 /* YHLifeHeadView.swift in Sources */,
A58A8C942BA6C7C600632765 /* YHCertificateEntryModel.swift in Sources */,
......@@ -5391,6 +5414,7 @@
0414BDAD2BC7F02C00225367 /* YHMyNotifySettingVC.swift in Sources */,
0425E6402BA9357D00A5E763 /* YHScemeItemModel.swift in Sources */,
044EE22D2C9184CD00A2FE3A /* YHServiceMoreAlertView.swift in Sources */,
044EE2562C9D0E4500A2FE3A /* YHResignGuidelinesModel.swift in Sources */,
A5D335F92BCE51E700236F21 /* YHServiceCenterProgressModel.swift in Sources */,
045EEECC2B9F171A0022A143 /* YHScoreResultModel.swift in Sources */,
A5DF9C672C78B7E600CE48E6 /* YHUploadCertificateListModel.swift in Sources */,
......
......@@ -28,6 +28,10 @@ class YHCardOcrModel: SmartCodable {
var issuing_authority: String = ""
var card_num: String = ""
var is_back: String = ""
var back_term_begins: String = ""
var back_end_of_term: String = ""
var back_hk_type: String = ""
var back_round_trip_number: String = ""
required init() {
}
......@@ -68,7 +72,7 @@ class YHBaseViewModel {
//2.2、ocr识别 港澳通行证 背面
func getHKCardBackInfoByOcr(_ url: String, isBack: Int, callBackBlock:@escaping (_ success: Bool, _ model:YHCardOcrModel?)->()) {
let strUrl = YHBaseUrlManager.shared.curOssURL() + YHAllApiName.OCR.hkmacowBackInfoApi
let strUrl = YHBaseUrlManager.shared.curURL() + YHAllApiName.OCR.hkmacowBackInfoApi
let params: [String : Any] = ["url": url,
"is_back": isBack]
let _ = YHNetRequest.postRequest(url: strUrl, params: params) { [weak self] json, code in
......
......@@ -229,6 +229,12 @@ extension YHServiceCenterViewController {
}
@objc func pushOrderView() {
// let vc = YHResignGuidelinesExampleViewController()
// self.navigationController?.pushViewController(vc)
// return
var flag = true
if self.state == 1 || self.state == 3 {
flag = false
......
......@@ -178,13 +178,14 @@ private extension YHResignCertificateDetailHkViewController {
//2、保存旅行证件
func saveAllTravelCertificate() {
let hkPassPort: [String: Any] = ["name": "护照",
let hkPassPort: [String: Any] = ["name": "港澳通行证",
"issue_start": self.viewModel.dataModel.cert_info.issue_start,
"issue_end": self.viewModel.dataModel.cert_info.issue_end,
"img_front": urls[0],
"img_back": urls[1],
"validate_start": self.viewModel.dataModel.cert_info.validate_start,
"validate_end": self.viewModel.dataModel.cert_info.validate_end]
"validate_end": self.viewModel.dataModel.cert_info.validate_end,
"sign_type": "D"]
let params : [String : Any] = [
"hkPassPort": hkPassPort,
"id": dataModel.id
......@@ -193,7 +194,6 @@ private extension YHResignCertificateDetailHkViewController {
if success {
YHHUD.flash(message: "保存成功")
self.navigationController?.popViewController()
} else {
let msg = error?.errorMsg ?? "保存失败,请重试"
YHHUD.flash(message: msg)
......@@ -236,22 +236,30 @@ extension YHResignCertificateDetailHkViewController: UITableViewDelegate, UITabl
self.viewModel.getPublicImageUrl(url) {[weak self] success, error in
guard let self = self else { return }
guard let url = success else { return }
self.viewModel.getHKCardBackInfoByOcr(url, isBack: index) { success, result in
if index == 0 {
self.viewModel.getHKCardInfoByOcr(url, isBack: 0) { success, result in
YHHUD.hide()
if success, let result = result {
if !result.term_begins.isEmpty {
if index == 0 {
self.dataModel.cert_info.issue_start = result.term_begins
} else {
self.dataModel.cert_info.validate_start = result.term_begins
}
}
if !result.end_of_term.isEmpty {
if index == 0 {
self.dataModel.cert_info.issue_end = result.end_of_term
}
} else {
// OCR 无法识别
self.failString = "非逗留(D)签证,请检查文件"
}
self.updateData()
}
} else {
self.dataModel.cert_info.validate_end = result.term_begins
self.viewModel.getHKCardBackInfoByOcr(url, isBack: 1) { success, result in
YHHUD.hide()
if success, let result = result {
if !result.back_term_begins.isEmpty { self.dataModel.cert_info.validate_start = result.back_term_begins
}
if !result.back_end_of_term.isEmpty {
self.dataModel.cert_info.validate_end = result.back_end_of_term
}
} else {
// OCR 无法识别
......@@ -261,6 +269,7 @@ extension YHResignCertificateDetailHkViewController: UITableViewDelegate, UITabl
}
}
}
}
cell.deleteBlock = { [weak self] url, index in
guard let self = self else { return }
self.urls[index] = url
......
......@@ -146,7 +146,7 @@ class YHResignCertificatePassportTableViewCell: UITableViewCell {
titleLabel = {
let label = UILabel()
let str = "* " + "港澳通行证 (逗留D签注)"
let str = "* " + "护照信息"
let attributes: [NSAttributedString.Key: Any] = [
.font: UIFont.PFSC_M(ofSize: 17),
.foregroundColor: UIColor.mainTextColor
......
......@@ -22,7 +22,7 @@ class YHResignGuidelinesExampleViewController: YHBaseViewController {
var imageName: String = ""
var type: YHResignGuidelinesExampleType = .house
// var viewModel = YHResignCertificateListViewModel()
var viewModel = YHResignGuidelinesViewModel()
override func viewDidLoad() {
super.viewDidLoad()
gk_navTitle = "银河续签案例分享"
......@@ -46,6 +46,11 @@ class YHResignGuidelinesExampleViewController: YHBaseViewController {
} else {
imageName = "resign_guidelines_example_nowork"
}
viewModel.getResignDetail(Id: 3473) {[weak self] success, error in
guard let self = self else { return }
}
tableView.reloadData()
}
......
//
// YHResignGuidelinesModel.swift
// galaxy
//
// Created by EDY on 2024/9/20.
// Copyright © 2024 https://www.galaxy-immi.com. All rights reserved.
//
import UIKit
import SmartCodable
class YHResignGuidelinesModel: SmartCodable {
var id: Int = 0
var title: String = ""
var content: String = ""
var img_url: String = ""
var release_time: String = ""
var view_count: Int = 0
var collect_count: Int = 0
var media_transcode_url: String = ""
var is_finished_transcode: Int = 0
var img_url_compress: String = ""
var clue_classify_img_url: String = ""
required init() {
}
}
//
// YHResignGuidelinesViewModel.swift
// galaxy
//
// Created by EDY on 2024/9/20.
// Copyright © 2024 https://www.galaxy-immi.com. All rights reserved.
//
import UIKit
class YHResignGuidelinesViewModel: YHBaseViewModel {
var mainModel: YHResignGuidelinesModel = YHResignGuidelinesModel()
func getResignDetail(Id: Int, callBackBlock:@escaping (_ success: Bool,_ error:YHErrorModel?)->()) {
let param = ["id": Id]
let strUrl = YHBaseUrlManager.shared.curURL() + YHAllApiName.ResignCertificate.detail
let _ = YHNetRequest.getRequest(url: strUrl, params: param) { [weak self] json, code in
//1. json字符串 转 对象
guard self != nil else { return }
if json.code == 200 {
guard let dic = json.data?.peel as? [String : Any], let data = dic["data"] as? [String: Any], let result = YHResignGuidelinesModel.deserialize(from: data) else {
callBackBlock(false,nil)
return
}
self?.mainModel = result
callBackBlock(true, nil)
} else {
let error : YHErrorModel = YHErrorModel(errorCode:Int32(json.code),errorMsg: json.msg.count > 0 ? json.msg : "数据错误")
callBackBlock(false,error)
}
} failBlock: { err in
callBackBlock(false,err)
}
}
}
......@@ -529,5 +529,6 @@ class YHAllApiName {
struct ResignCertificate {
static let resignCertificateList = "super-app/certificate/list"
static let update = "super-app/certificate/update"
static let detail = "infoflow/article/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