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

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

# Conflicts:
#	galaxy/galaxy/Classes/Modules/IntelligentService(服务中心)/C/YHServiceOrderListViewController.swift
parents 862cfdaf 70b5e937
......@@ -52,6 +52,154 @@ class YHServiceOrderListView: YHBaseViewController {
NotificationCenter.default.addObserver(self, selector: #selector(endDragging), name:Notification.Name(rawValue: "scrollViewDidEndDragging0"), object: nil)
}
class func jumpToMessageController(type: Int, orderId: Int, _ stepId: Int = 0) {
if type == 1 {
//我的证件
let vc = YHMineCertificateEntryViewController()
vc.orderId = orderId
UIViewController.current?.navigationController?.pushViewController(vc)
} else if type == 2 {
//我的信息
let vc = YHInformationPerfectListVC()
vc.orderId = orderId
UIViewController.current?.navigationController?.pushViewController(vc)
} else if type == 3 {
//我的评分
let vc = YHScoreDetailViewController()
vc.orderId = orderId
// vc.model = serviceCenterMainReqVM.allInfoScoreModel
UIViewController.current?.navigationController?.pushViewController(vc)
} else if type == 4 { // 方案
//我的方案
let vc = YHMineSchemeViewController()
UIViewController.current?.navigationController?.pushViewController(vc)
} else if type == 5 {
//我的签字
let vc = YHMySignatureListViewController()
vc.orderId = orderId
UIViewController.current?.navigationController?.pushViewController(vc)
} else if type == 6 {
//我的文书
let vc = YHMyDocumentsListViewController()
vc.orderId = orderId
UIViewController.current?.navigationController?.pushViewController(vc)
} else if type == 11 || type == 12 || type == 14 {
// 11 原则批等待结果
// 12 原则批待补件
// 14 原则批未获批准
let vc = YHPrincipleWaitResultViewController()
vc.status = type
vc.orderId = orderId
UIViewController.current?.navigationController?.pushViewController(vc)
} else if type == 13 {
//原则批已获批~
let vc = YHPrincipleApprovedResultVC()
vc.orderId = orderId
UIViewController.current?.navigationController?.pushViewController(vc)
} else if type == 15 {
//正式批已获批~
let vc = YHOfficialApprovalResultVC()
UIViewController.current?.navigationController?.pushViewController(vc)
} else if type == 21 {
//新增受养人
let vc = YHAddAdoptersViewController()
vc.orderId = orderId
UIViewController.current?.navigationController?.pushViewController(vc)
} else if type == 22 {
//家庭信息确认
let vc = YHFamilyInfoConfirmViewController()
vc.orderId = orderId
UIViewController.current?.navigationController?.pushViewController(vc)
} else if type == 23 {
//电子签字缴费
let vc = YHVisaPaymentVC()
vc.orderID = orderId
UIViewController.current?.navigationController?.pushViewController(vc)
} else if type == 24 {
//赴港时间预约
let vc = YHCertificateAppointViewController()
vc.orderId = orderId
UIViewController.current?.navigationController?.pushViewController(vc)
} else if type == 25 {
// 赴港行程指引
YHHUD.show(.progress(message: "加载中..."))
let appointViewModel = YHCerAppointViewModel()
appointViewModel.getIsNeedGoToHK(orderId: orderId) {
// needGoHK 1需要赴港 0不需要 2没有选择
// reservationToHK 0 没有预约 1 已经预約
needGoHK, reservationToHK in
YHHUD.hide()
var isNeedAppoint = true
if needGoHK == 1, reservationToHK == 1 { // 选择赴港且已预约
isNeedAppoint = false
} else if needGoHK == 0 { // 赴港选择否
isNeedAppoint = false
}
if isNeedAppoint {
//预约弹窗
let alert = YHDisappointHKAlertView.alertView()
alert.confirmBlock = {
let vc = YHCertificateAppointViewController()
vc.orderId = orderId
UIViewController.current?.navigationController?.pushViewController(vc)
}
alert.show()
} else { // 已预约过直接进入赴港行程指引
if var token = YHLoginManager.shared.userModel?.token {
var url = YHBaseUrlManager.shared.curH5URL() + "superAppBridge.html#/tohkList"
let addtionString = String.randomAlphaNumericStringT(6)//随机6个字母或者数字
let indexToInsert = token.index(token.startIndex, offsetBy: 6) //插入位置,这里以第六个字符后面为例
token.insert(contentsOf: addtionString, at: indexToInsert)
url = url + "?paramO=\(orderId)" + "&param=" + token
url = url + "&app_platform=ios" + "&app_version=" + UIDevice.appVersion()
printLog("UURL: \(url)")
let vc = YHH5WebViewVC()
vc.url = url
vc.isFullScreenFlag = false
vc.navTitle = "赴港行程指引"
vc.isNeedRefreshDataFlag = true
UIViewController.current?.navigationController?.pushViewController(vc)
}
}
}
} else if type == 26 {
//旅行证件准备
let vc = YHTravelDocsPreparationListViewController()
vc.orderId = orderId
UIViewController.current?.navigationController?.pushViewController(vc)
} else if type == 27 {
//上传过关证件
let vc = YHUploadCertificateVC()
vc.orderId = orderId
UIViewController.current?.navigationController?.pushViewController(vc)
} else if type == 31 {
//续签资料管理
let vc = YHResinMaterialManageContainerVC()
vc.orderId = orderId
vc.batchId = stepId
UIViewController.current?.navigationController?.pushViewController(vc)
} else if type == 32 {
//续签文书管理
let vc = YHResignDocumentManagementVC(orderId: orderId, id: stepId)
UIViewController.current?.navigationController?.pushViewController(vc)
}
}
}
extension YHServiceOrderListView {
......@@ -224,27 +372,10 @@ extension YHServiceOrderListView : UITableViewDelegate,UITableViewDataSource {
if model.status == 1 || model.status == 4 {
return
} else {
//1 我的证件 2 我的信息 3 我的评分 4 我的方案 5 我的签字 6我的文书
if model.type == 1 {
//我的证件
let vc = YHMineCertificateEntryViewController()
vc.orderId = orderID
UIViewController.current?.navigationController?.pushViewController(vc)
} else if model.type == 2 {
//我的信息
let vc = YHInformationPerfectListVC()
vc.orderId = orderID
UIViewController.current?.navigationController?.pushViewController(vc)
} else if model.type == 3 {
YHServiceOrderListView.jumpToMessageController(type: model.type, orderId: orderID, stepID)
if model.type == 3 {
//我的评分
handleRedPointFor(key: kMyScoreRedPointInfoKey, model: model)
let vc = YHScoreDetailViewController()
vc.orderId = orderID
// vc.model = serviceCenterMainReqVM.allInfoScoreModel
UIViewController.current?.navigationController?.pushViewController(vc)
} else if model.type == 4 { // 方案
//我的方案
handleRedPointFor(key: kMyPlanRedPointInfoKey, model: model)
......
......@@ -246,9 +246,9 @@ extension YHResignCertificateDetailHkViewController: UITableViewDelegate, UITabl
cell.lastImageName = "service_adopter_card_travel_back"
cell.firstLabelName = "港澳通行证正面"
cell.lastLabelName = "港澳通行证倍面"
cell.dataModel = dataModel
cell.failString = failString
cell.data = data
cell.dataModel = dataModel
cell.urls = urls
cell.urlBlock = { [weak self] url, index in
guard let self = self else { return }
......
......@@ -163,9 +163,15 @@ class YHResignCertificateHKTableViewCell: UITableViewCell {
}
}
if self.compareDates(dateString1: item.message ?? "", dateString2: self.dataModel.valid_date) {
failString = ""
if failString == "签注有效期不足,需要为\(self.dataModel.sign_valid_date)或以后" {
failString = ""
}
} else {
failString = "签注有效期不足,需要为\(self.dataModel.sign_valid_date)或以后"
if failString == "卡片有效期不足,需要为\(self.dataModel.valid_date)或以后" {
} else {
failString = "签注有效期不足,需要为\(self.dataModel.sign_valid_date)或以后"
}
}
}
}
......@@ -429,7 +435,9 @@ class YHResignCertificateHKTableViewCell: UITableViewCell {
if let block = self.block {
block(model)
if self.compareDates(dateString1: model.message ?? "", dateString2: self.dataModel.valid_date) {
failString = ""
if failString == "卡片有效期不足,需要为\(self.dataModel.valid_date)或以后" {
failString = ""
}
} else {
failString = "卡片有效期不足,需要为\(self.dataModel.valid_date)或以后"
}
......@@ -485,9 +493,11 @@ class YHResignCertificateHKTableViewCell: UITableViewCell {
if let block = self.block {
block(model)
if self.compareDates(dateString1: model.message ?? "", dateString2: self.dataModel.sign_valid_date) {
failString = ""
if failString == "签注有效期不足,需要为\(self.dataModel.sign_valid_date)或以后" {
failString = ""
}
} else {
failString = "签注卡片有效期不足,需要为\(self.dataModel.sign_valid_date)或以后"
failString = "签注有效期不足,需要为\(self.dataModel.sign_valid_date)或以后"
}
}
}
......
......@@ -170,13 +170,26 @@ extension YHResignDocumentDetailViewController {
var config = YHResignDocumentStatusCell.ButtonsConfig()
var actions: [(() -> Void)] = []
editEvent = { [weak self] in
guard model.link.count > 0, let url = URL(string: model.link) else {
guard let self = self else {
return
}
let safariViewController = SFSafariViewController(url: url)
safariViewController.dismissButtonStyle = .close
safariViewController.modalPresentationStyle = .fullScreen
self?.present(safariViewController, animated: true, completion: nil)
YHHUD.show(.progress(message: "加载中..."))
self.viewModel.getResginDocumentUrl(docId: model.docId, isEditable: true) { [weak self] model, error in
guard let self = self else {
return
}
YHHUD.hide()
if let urlString = model?.url, let url = URL(string: urlString) {
let safariViewController = SFSafariViewController(url: url)
safariViewController.dismissButtonStyle = .close
safariViewController.modalPresentationStyle = .fullScreen
self.present(safariViewController, animated: true, completion: nil)
} else if let error = error {
let errorMsg = error.errorMsg
YHHUD.show(.error(message: errorMsg))
YHHUD.hide(afterDelay: 1)
}
}
printLog("###editEvent")
}
......@@ -234,7 +247,7 @@ extension YHResignDocumentDetailViewController {
return
}
YHHUD.show(.progress(message: "加载中..."))
self.viewModel.previewResginDocument(docId: model.docId) { [weak self] model, error in
self.viewModel.getResginDocumentUrl(docId: model.docId, isEditable: false) { [weak self] model, error in
guard let self = self else {
return
}
......
......@@ -131,4 +131,29 @@ class YHResignDocumentViewModel: YHBaseViewModel {
}
}
func getResginDocumentUrl(docId: Int, isEditable: Bool, callback: @escaping (_ documentModel: YHResignDocumentPreviewModel?, _ error: YHErrorModel?) -> ()) {
let params: [String : Any] = ["id": docId, "type": isEditable ? 1 : 0]
let strUrl = YHBaseUrlManager.shared.curURL() + YHAllApiName.ResignDocument.getResginDocumentUrl
let _ = YHNetRequest.getRequest(url: strUrl, params: params) { json, code in
//1. json字符串 转 对象
printLog("model 是 ==> \(json)")
if json.code == 200 {
guard let dic = json.data?.peel as? [String : Any], let resultModel = YHResignDocumentPreviewModel.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)
}
}
}
......@@ -544,6 +544,8 @@ class YHAllApiName {
static let resginDocumentSignature = "super-app/renewal/signature"
// 预览签字文档
static let previewResginDocument = "super-app/renewal/views"
// 获取临时链接
static let getResginDocumentUrl = "super-app/renewal/doc/url"
}
// 在港记录
......
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