Commit 6f289476 authored by pete谢兆麟's avatar pete谢兆麟

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

parents 84ced02c 34bf945a
...@@ -304,6 +304,7 @@ ...@@ -304,6 +304,7 @@
0480976D2BA158A1000B9DCA /* YHCertificateListVC.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0480976C2BA158A1000B9DCA /* YHCertificateListVC.swift */; }; 0480976D2BA158A1000B9DCA /* YHCertificateListVC.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0480976C2BA158A1000B9DCA /* YHCertificateListVC.swift */; };
048097712BA18D66000B9DCA /* YHCertificateSearchBar.swift in Sources */ = {isa = PBXBuildFile; fileRef = 048097702BA18D66000B9DCA /* YHCertificateSearchBar.swift */; }; 048097712BA18D66000B9DCA /* YHCertificateSearchBar.swift in Sources */ = {isa = PBXBuildFile; fileRef = 048097702BA18D66000B9DCA /* YHCertificateSearchBar.swift */; };
0485DFD42C649A2500B50293 /* YHPrincipleUploadModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0485DFD32C649A2500B50293 /* YHPrincipleUploadModel.swift */; }; 0485DFD42C649A2500B50293 /* YHPrincipleUploadModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0485DFD32C649A2500B50293 /* YHPrincipleUploadModel.swift */; };
0485DFD62C64E70200B50293 /* YHPrincipleApprovedWaitSubmitVC.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0485DFD52C64E70200B50293 /* YHPrincipleApprovedWaitSubmitVC.swift */; };
048787D12BCE61B20036E221 /* YHServiceNoOrderView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 048787D02BCE61B20036E221 /* YHServiceNoOrderView.swift */; }; 048787D12BCE61B20036E221 /* YHServiceNoOrderView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 048787D02BCE61B20036E221 /* YHServiceNoOrderView.swift */; };
048787D52BCE880B0036E221 /* YHServiceOrderListViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 048787D42BCE880B0036E221 /* YHServiceOrderListViewController.swift */; }; 048787D52BCE880B0036E221 /* YHServiceOrderListViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 048787D42BCE880B0036E221 /* YHServiceOrderListViewController.swift */; };
048787D72BCE96F50036E221 /* YHServiceOrderProgressTableViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 048787D62BCE96F50036E221 /* YHServiceOrderProgressTableViewCell.swift */; }; 048787D72BCE96F50036E221 /* YHServiceOrderProgressTableViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 048787D62BCE96F50036E221 /* YHServiceOrderProgressTableViewCell.swift */; };
...@@ -953,6 +954,7 @@ ...@@ -953,6 +954,7 @@
0480976C2BA158A1000B9DCA /* YHCertificateListVC.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHCertificateListVC.swift; sourceTree = "<group>"; }; 0480976C2BA158A1000B9DCA /* YHCertificateListVC.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHCertificateListVC.swift; sourceTree = "<group>"; };
048097702BA18D66000B9DCA /* YHCertificateSearchBar.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHCertificateSearchBar.swift; sourceTree = "<group>"; }; 048097702BA18D66000B9DCA /* YHCertificateSearchBar.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHCertificateSearchBar.swift; sourceTree = "<group>"; };
0485DFD32C649A2500B50293 /* YHPrincipleUploadModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHPrincipleUploadModel.swift; sourceTree = "<group>"; }; 0485DFD32C649A2500B50293 /* YHPrincipleUploadModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHPrincipleUploadModel.swift; sourceTree = "<group>"; };
0485DFD52C64E70200B50293 /* YHPrincipleApprovedWaitSubmitVC.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHPrincipleApprovedWaitSubmitVC.swift; sourceTree = "<group>"; };
048787D02BCE61B20036E221 /* YHServiceNoOrderView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHServiceNoOrderView.swift; sourceTree = "<group>"; }; 048787D02BCE61B20036E221 /* YHServiceNoOrderView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHServiceNoOrderView.swift; sourceTree = "<group>"; };
048787D42BCE880B0036E221 /* YHServiceOrderListViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHServiceOrderListViewController.swift; sourceTree = "<group>"; }; 048787D42BCE880B0036E221 /* YHServiceOrderListViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHServiceOrderListViewController.swift; sourceTree = "<group>"; };
048787D62BCE96F50036E221 /* YHServiceOrderProgressTableViewCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHServiceOrderProgressTableViewCell.swift; sourceTree = "<group>"; }; 048787D62BCE96F50036E221 /* YHServiceOrderProgressTableViewCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHServiceOrderProgressTableViewCell.swift; sourceTree = "<group>"; };
...@@ -2207,6 +2209,7 @@ ...@@ -2207,6 +2209,7 @@
0472CB9C2C5A11640096F48F /* YHPrincipleReviewListVC.swift */, 0472CB9C2C5A11640096F48F /* YHPrincipleReviewListVC.swift */,
04B360F22C636525001EB053 /* YHPrincipleWaitResultViewController.swift */, 04B360F22C636525001EB053 /* YHPrincipleWaitResultViewController.swift */,
04B360F42C646844001EB053 /* YHPrincipleApprovedMailViewController.swift */, 04B360F42C646844001EB053 /* YHPrincipleApprovedMailViewController.swift */,
0485DFD52C64E70200B50293 /* YHPrincipleApprovedWaitSubmitVC.swift */,
); );
path = C; path = C;
sourceTree = "<group>"; sourceTree = "<group>";
...@@ -3677,6 +3680,7 @@ ...@@ -3677,6 +3680,7 @@
04B360ED2C61F157001EB053 /* YHPrincipleEnvelopeCell.swift in Sources */, 04B360ED2C61F157001EB053 /* YHPrincipleEnvelopeCell.swift in Sources */,
04B9EE5B2C06CC3100A4018D /* YHOtherLoginViewController.swift in Sources */, 04B9EE5B2C06CC3100A4018D /* YHOtherLoginViewController.swift in Sources */,
045EEF0C2B9F171A0022A143 /* YHBasicInfoFillBottomView.swift in Sources */, 045EEF0C2B9F171A0022A143 /* YHBasicInfoFillBottomView.swift in Sources */,
0485DFD62C64E70200B50293 /* YHPrincipleApprovedWaitSubmitVC.swift in Sources */,
A5ACE93D2B4564F7002C94D2 /* UIButton+Extension.swift in Sources */, A5ACE93D2B4564F7002C94D2 /* UIButton+Extension.swift in Sources */,
0472CBA92C5A11640096F48F /* YHPrincleGroupModel.swift in Sources */, 0472CBA92C5A11640096F48F /* YHPrincleGroupModel.swift in Sources */,
04213B232C48B7F700797900 /* YHIdentityTabBar.swift in Sources */, 04213B232C48B7F700797900 /* YHIdentityTabBar.swift in Sources */,
...@@ -4278,7 +4282,7 @@ ...@@ -4278,7 +4282,7 @@
CODE_SIGN_ENTITLEMENTS = galaxy/galaxyTestEnv.entitlements; CODE_SIGN_ENTITLEMENTS = galaxy/galaxyTestEnv.entitlements;
CODE_SIGN_IDENTITY = "Apple Development"; CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic; CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 2; CURRENT_PROJECT_VERSION = 4;
DEVELOPMENT_TEAM = RXHYW88XR7; DEVELOPMENT_TEAM = RXHYW88XR7;
ENABLE_USER_SCRIPT_SANDBOXING = NO; ENABLE_USER_SCRIPT_SANDBOXING = NO;
FRAMEWORK_SEARCH_PATHS = ( FRAMEWORK_SEARCH_PATHS = (
...@@ -4419,7 +4423,7 @@ ...@@ -4419,7 +4423,7 @@
CODE_SIGN_ENTITLEMENTS = galaxy/galaxy.entitlements; CODE_SIGN_ENTITLEMENTS = galaxy/galaxy.entitlements;
CODE_SIGN_IDENTITY = "Apple Development"; CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic; CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 2; CURRENT_PROJECT_VERSION = 4;
DEVELOPMENT_TEAM = RXHYW88XR7; DEVELOPMENT_TEAM = RXHYW88XR7;
ENABLE_USER_SCRIPT_SANDBOXING = NO; ENABLE_USER_SCRIPT_SANDBOXING = NO;
FRAMEWORK_SEARCH_PATHS = ( FRAMEWORK_SEARCH_PATHS = (
...@@ -4623,7 +4627,7 @@ ...@@ -4623,7 +4627,7 @@
CODE_SIGN_ENTITLEMENTS = galaxy/galaxyDebug.entitlements; CODE_SIGN_ENTITLEMENTS = galaxy/galaxyDebug.entitlements;
CODE_SIGN_IDENTITY = "Apple Development"; CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic; CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 2; CURRENT_PROJECT_VERSION = 4;
DEVELOPMENT_TEAM = RXHYW88XR7; DEVELOPMENT_TEAM = RXHYW88XR7;
ENABLE_USER_SCRIPT_SANDBOXING = NO; ENABLE_USER_SCRIPT_SANDBOXING = NO;
FRAMEWORK_SEARCH_PATHS = ( FRAMEWORK_SEARCH_PATHS = (
...@@ -4669,7 +4673,7 @@ ...@@ -4669,7 +4673,7 @@
CODE_SIGN_ENTITLEMENTS = galaxy/galaxy.entitlements; CODE_SIGN_ENTITLEMENTS = galaxy/galaxy.entitlements;
CODE_SIGN_IDENTITY = "Apple Development"; CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic; CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 2; CURRENT_PROJECT_VERSION = 4;
DEVELOPMENT_TEAM = RXHYW88XR7; DEVELOPMENT_TEAM = RXHYW88XR7;
ENABLE_USER_SCRIPT_SANDBOXING = NO; ENABLE_USER_SCRIPT_SANDBOXING = NO;
FRAMEWORK_SEARCH_PATHS = ( FRAMEWORK_SEARCH_PATHS = (
......
...@@ -22,6 +22,7 @@ class AppDelegate: UIResponder, UIApplicationDelegate, WXApiDelegate { ...@@ -22,6 +22,7 @@ class AppDelegate: UIResponder, UIApplicationDelegate, WXApiDelegate {
Thread.sleep(forTimeInterval: 0.5) // 应产品同学Nick要求 启动页时间展示长点 Thread.sleep(forTimeInterval: 0.5) // 应产品同学Nick要求 启动页时间展示长点
setupAudionConfig() setupAudionConfig()
//初始化 神策sdk //初始化 神策sdk
......
...@@ -12,9 +12,6 @@ import Photos ...@@ -12,9 +12,6 @@ import Photos
import dsBridge import dsBridge
class YHHomeWebViewController: YHBaseViewController, WKUIDelegate, WKNavigationDelegate { class YHHomeWebViewController: YHBaseViewController, WKUIDelegate, WKNavigationDelegate {
var operationFlag:Bool = false var operationFlag:Bool = false
typealias Block = (YHWebModel) -> () typealias Block = (YHWebModel) -> ()
......
...@@ -107,6 +107,10 @@ private extension YHStartPageViewController { ...@@ -107,6 +107,10 @@ private extension YHStartPageViewController {
NotificationCenter.default.addObserver(self, selector: #selector(forceUpdateOp), name: YhConstant.YhNotification.didForceUpgradeNotifiction, object: nil) NotificationCenter.default.addObserver(self, selector: #selector(forceUpdateOp), name: YhConstant.YhNotification.didForceUpgradeNotifiction, object: nil)
if let key = UserDefaults.standard.value(forKey: "userAgreeProtocal") as? String,key.contains("true") { if let key = UserDefaults.standard.value(forKey: "userAgreeProtocal") as? String,key.contains("true") {
let dateString = Date().dateString(ofStyle: .short)
UserDefaults.standard.set(dateString, forKey: "todayShowStartPageViewFlag")
UserDefaults.standard.synchronize()
startTimer() startTimer()
} else { } else {
agreeAlertView.isHidden = false agreeAlertView.isHidden = false
......
...@@ -11,6 +11,8 @@ import JXSegmentedView ...@@ -11,6 +11,8 @@ import JXSegmentedView
class YHServiceOrderListView: YHBaseViewController { class YHServiceOrderListView: YHBaseViewController {
private let viewModel : YHServiceCenterMainViewModel = YHServiceCenterMainViewModel() private let viewModel : YHServiceCenterMainViewModel = YHServiceCenterMainViewModel()
let principleViewModel: YHPrincleViewModel = YHPrincleViewModel()
typealias Block = (Int,Int,Bool) -> () typealias Block = (Int,Int,Bool) -> ()
var block: Block? var block: Block?
var orderID: Int = 0 var orderID: Int = 0
...@@ -221,9 +223,23 @@ extension YHServiceOrderListView : UITableViewDelegate,UITableViewDataSource { ...@@ -221,9 +223,23 @@ extension YHServiceOrderListView : UITableViewDelegate,UITableViewDataSource {
vc.orderId = orderID vc.orderId = orderID
navigationController?.pushViewController(vc) navigationController?.pushViewController(vc)
} else if model.type == 13 { } else if model.type == 13 { //原则批已获批~
principleViewModel.requestIsSendMail(orderId: orderID) { isSend in
if isSend {
// 已发送邮件
let vc = YHPrincipleApprovedMailViewController()
vc.status = model.type
vc.orderId = self.orderID
self.navigationController?.pushViewController(vc)
return
}
// 未发送邮件
}
//原则批已获批~
let vc = YHPrincipleWaitResultViewController() let vc = YHPrincipleWaitResultViewController()
vc.status = model.type vc.status = model.type
vc.orderId = orderID vc.orderId = orderID
......
...@@ -73,7 +73,6 @@ extension YHPrincipleApprovedMailViewController { ...@@ -73,7 +73,6 @@ extension YHPrincipleApprovedMailViewController {
func requestData() { func requestData() {
let group = DispatchGroup() let group = DispatchGroup()
group.enter() group.enter()
let params: [String : Any] = ["order_id" : orderId, let params: [String : Any] = ["order_id" : orderId,
"search_type" : 1] "search_type" : 1]
......
//
// YHPrincipleApprovedWaitSubmitVC.swift
// galaxy
//
// Created by edy on 2024/8/8.
// Copyright © 2024 https://www.galaxy-immi.com. All rights reserved.
//
import UIKit
import AttributedString
// 原则批已获批 - 待提交
class YHPrincipleApprovedWaitSubmitVC: YHBaseViewController {
var orderId: Int = -1
var items: [YHPrincipleEnvelopeModel] = []
let viewModel = YHPrincleViewModel()
lazy var tableView: UITableView = {
let tableView = UITableView(frame:.zero, style:.grouped)
tableView.contentInsetAdjustmentBehavior = .never
tableView.estimatedSectionHeaderHeight = 24.0
tableView.estimatedSectionFooterHeight = 1.0
tableView.showsVerticalScrollIndicator = false
tableView.separatorStyle = .none
tableView.delegate = self
tableView.dataSource = self
tableView.backgroundColor = .clear
tableView.register(UITableViewCell.self, forCellReuseIdentifier: "UITableViewCell")
tableView.register(YHPrincipleUnapprovedCell.self, forCellReuseIdentifier: YHPrincipleUnapprovedCell.cellReuseIdentifier)
tableView.register(YHPrincipleEnvelopeCell.self, forCellReuseIdentifier: YHPrincipleEnvelopeCell.cellReuseIdentifier)
return tableView
}()
lazy var bgView:UIView = {
let view = UIView()
view.backgroundColor = UIColor.init(hex: 0xF8F8F8)
let imgView = UIImageView(image: UIImage(named: "principle_detail_head_bg"))
view.addSubview(imgView)
imgView.snp.makeConstraints { make in
make.left.right.top.equalToSuperview()
make.height.equalTo(imgView.snp.width)
}
return view
}()
lazy var uploadBtn:UIButton = {
let btn = UIButton()
btn.setTitle("去上传".local, for: .normal)
btn.titleLabel?.font = UIFont.PFSC_M(ofSize: 16)
btn.setTitleColor(.white, for: .normal)
btn.backgroundColor = UIColor.brandMainColor
btn.layer.cornerRadius = kCornerRadius3
btn.addTarget(self, action: #selector(didUploadBtnClicked), for: .touchUpInside)
return btn
}()
override func viewDidLoad() {
super.viewDidLoad()
self.view.backgroundColor = .white
self.gk_navTitle = "原则批"
gk_navigationBar.backgroundColor = .clear
createUI()
requestData()
}
func createUI() {
view.addSubview(bgView)
view.addSubview(tableView)
view.addSubview(uploadBtn)
bgView.snp.makeConstraints { make in
make.top.left.right.equalToSuperview()
make.bottom.equalToSuperview()
}
tableView.snp.makeConstraints { make in
make.top.equalToSuperview().offset(k_Height_NavigationtBarAndStatuBar)
make.left.right.equalToSuperview()
make.bottom.equalTo(uploadBtn.snp.top).offset(-8)
}
uploadBtn.snp.makeConstraints { make in
make.left.equalTo(16)
make.right.equalTo(-16)
make.bottom.equalTo(-42)
make.height.equalTo(48.0)
}
}
@objc func didUploadBtnClicked() {
let vc = YHPrincipleReviewListVC()
vc.orderId = 12345
navigationController?.pushViewController(vc)
}
func requestData() {
viewModel.getEnvelopeInfo(orderId: orderId) { success, error in
self.items.removeAll()
// 已获得港府甄选名额
self.items.append(self.viewModel.envelopModel)
self.tableView.reloadData()
}
}
}
extension YHPrincipleApprovedWaitSubmitVC: UITableViewDelegate, UITableViewDataSource {
func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
return items.count
}
func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
let cell = tableView.dequeueReusableCell(withIdentifier: YHPrincipleEnvelopeCell.cellReuseIdentifier, for: indexPath) as! YHPrincipleEnvelopeCell
if 0 <= indexPath.row && indexPath.row < items.count {
let model = items[indexPath.row]
cell.updateModel(model)
cell.expandClick = {
[weak self] isUnfold in
guard let self = self else { return }
model.isUnfold = isUnfold
self.tableView.reloadData()
}
}
return cell
}
func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat {
return UITableView.automaticDimension
}
func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
if 0 <= indexPath.section && indexPath.section < items.count {
}
}
private func tableView(_ tableView: UITableView, viewForHeaderInSection section: Int) -> CGFloat {
return UITableView.automaticDimension
}
private func tableView(_ tableView: UITableView, viewForFooterInSection section: Int) -> CGFloat {
return 0.01
}
func tableView(_ tableView: UITableView, viewForHeaderInSection section: Int) -> UIView? {
return self.getApproveHeaderView()
}
func tableView(_ tableView: UITableView, viewForFooterInSection section: Int) -> UIView? {
return UIView()
}
}
extension YHPrincipleApprovedWaitSubmitVC {
func getApproveHeaderView() -> UIView {
let view = UIView()
let titleLabel = UILabel()
titleLabel.numberOfLines = 0
let title: ASAttributedString = .init("祝贺您,\(self.viewModel.waitResultModel.applicant.userName)先生!", .font(UIFont.PFSC_M(ofSize: 24)),.foreground(UIColor.mainTextColor))
titleLabel.attributed.text = title
view.addSubview(titleLabel)
let detailLabel = UILabel()
detailLabel.numberOfLines = 0
let str1: ASAttributedString = .init("您【与家人】申请的【优秀人才入境计划】,", .font(UIFont.PFSC_R(ofSize: 14)),.foreground(UIColor.mainTextColor(alpha: 0.7)))
let str2: ASAttributedString = .init("已获得港府的甄选名额", .font(UIFont.PFSC_B(ofSize: 14)),.foreground(UIColor.brandMainColor))
let str3: ASAttributedString = .init(",请您于", .font(UIFont.PFSC_R(ofSize: 14)),.foreground(UIColor.mainTextColor(alpha: 0.7)))
let time: ASAttributedString = .init("\(self.viewModel.envelopModel.date)", .font(UIFont.PFSC_B(ofSize: 14)),.foreground(UIColor.brandMainColor))
let str4: ASAttributedString = .init("前补充更多文件,即可等待获得港府的正式批准!", .font(UIFont.PFSC_R(ofSize: 14)),.foreground(UIColor.mainTextColor(alpha: 0.7)))
detailLabel.attributed.text = str1 + str2 + str3 + time + str4
view.addSubview(detailLabel)
titleLabel.snp.makeConstraints { make in
make.top.equalTo(12)
make.left.equalTo(20)
make.right.equalTo(-20)
make.height.equalTo(34)
}
detailLabel.snp.makeConstraints { make in
make.top.equalTo(titleLabel.snp.bottom).offset(12)
make.left.equalTo(20)
make.right.equalTo(-20)
make.bottom.equalTo(-36)
}
return view
}
}
...@@ -7,12 +7,26 @@ ...@@ -7,12 +7,26 @@
// //
import UIKit import UIKit
import SmartCodable
enum YHPrincipleUploadStatus : Int {
// 全部
case all = -1
// 审核中
case review = 0
// 已完成
case finish = 1
// 已驳回
case rejected = 2
// 待上传
case preUpload = 3
}
class YHPrincipleReviewListVC: YHBaseViewController { class YHPrincipleReviewListVC: YHBaseViewController {
var orderId: Int = 0 var orderId: Int = 0
var status: Int = 0 var items: [SmartCodable] = []
var items: [YHPrincipleWaitResultModel] = []
let viewModel = YHPrincleViewModel() let viewModel = YHPrincleViewModel()
lazy var tableView: UITableView = { lazy var tableView: UITableView = {
...@@ -26,8 +40,9 @@ class YHPrincipleReviewListVC: YHBaseViewController { ...@@ -26,8 +40,9 @@ class YHPrincipleReviewListVC: YHBaseViewController {
tableView.dataSource = self tableView.dataSource = self
tableView.backgroundColor = .clear tableView.backgroundColor = .clear
tableView.register(UITableViewCell.self, forCellReuseIdentifier: "UITableViewCell") tableView.register(UITableViewCell.self, forCellReuseIdentifier: "UITableViewCell")
tableView.register(YHPrinciplePhotoCollectCell.self, forCellReuseIdentifier: YHPrinciplePhotoCollectCell.cellReuseIdentifier) tableView.register(YHPrincipleUploadStatusCell.self, forCellReuseIdentifier: YHPrincipleUploadStatusCell.cellReuseIdentifier)
tableView.register(YHPrincipleUnapprovedCell.self, forCellReuseIdentifier: YHPrincipleUnapprovedCell.cellReuseIdentifier) tableView.register(YHPrincipleUnapprovedCell.self, forCellReuseIdentifier: YHPrincipleUnapprovedCell.cellReuseIdentifier)
tableView.register(YHPrincipleEnvelopeCell.self, forCellReuseIdentifier: YHPrincipleEnvelopeCell.cellReuseIdentifier)
return tableView return tableView
}() }()
...@@ -50,12 +65,13 @@ class YHPrincipleReviewListVC: YHBaseViewController { ...@@ -50,12 +65,13 @@ class YHPrincipleReviewListVC: YHBaseViewController {
gk_navigationBar.backgroundColor = .clear gk_navigationBar.backgroundColor = .clear
createUI() createUI()
items.removeAll() items.removeAll()
requestData()
} }
func createUI() { func createUI() {
view.addSubview(bgView) view.addSubview(bgView)
view.addSubview(tableView) view.addSubview(tableView)
bgView.snp.makeConstraints { make in bgView.snp.makeConstraints { make in
make.top.left.right.equalToSuperview() make.top.left.right.equalToSuperview()
make.bottom.equalToSuperview() make.bottom.equalToSuperview()
...@@ -68,9 +84,74 @@ class YHPrincipleReviewListVC: YHBaseViewController { ...@@ -68,9 +84,74 @@ class YHPrincipleReviewListVC: YHBaseViewController {
func requestData() { func requestData() {
// viewModel.getPrincipleUploadDetail(orderId: orderId) { <#Bool#>, <#YHErrorModel?#> in let group = DispatchGroup()
// <#code#> group.enter()
// } // 请求上传信息(《赴港居留同意书》、申请人意见访问、其他证明材料)
viewModel.getPrincipleUploadDetail(orderId: orderId) { success, error in
// self.viewModel.uploadDetailModel
group.leave()
}
group.enter()
let params: [String : Any] = ["order_id" : orderId,
"search_type" : 1]
// 请求 入境处已认收受理 和 申请资料已递交港府留档
viewModel.getPrincipleWaitReviewResult(params: params) { success, error in
group.leave()
}
group.enter()
viewModel.getEnvelopeInfo(orderId: orderId) { success, error in
group.leave()
}
group.notify(queue: .main) {
self.updateData()
}
}
func updateData() {
self.items.removeAll()
// 赴港居留同意书
let agreementModel = self.viewModel.uploadDetailModel.file_data.agreement
agreementModel.customType = YHPrincipleAgreementType.agreement.rawValue
agreementModel.title = "《赴港居留同意书》"
agreementModel.isMust = true
agreementModel.isNeedTemplate = true
self.items.append(agreementModel)
// 申请人意见访问
let opinionModel = self.viewModel.uploadDetailModel.file_data.agreement
opinionModel.customType = YHPrincipleAgreementType.agreement.rawValue
opinionModel.title = "申请人意见访问"
opinionModel.isMust = true
opinionModel.isNeedTemplate = true
self.items.append(self.viewModel.uploadDetailModel.file_data.opinion)
// 其他证明条件
self.items.append(self.viewModel.uploadDetailModel.file_data.other)
// 已获得港府甄选名额
self.items.append(self.viewModel.envelopModel)
let waitResultModel = self.viewModel.waitResultModel
// 入境处已认收受理
let model2 = waitResultModel.copy()
model2.type = .entry
model2.title = "入境处已认收受理"
model2.subTitle = "申请确认通知书:(来自香港入境处)"
model2.isUnfold = false
self.items.append(model2)
// 申请资料已递交港府留档
let model3 = waitResultModel.copy()
model3.type = .profile
model3.title = "申请资料已递交港府留档"
model3.subTitle = "档案号:"
model3.isUnfold = false
self.items.append(model3)
self.tableView.reloadData()
} }
} }
...@@ -87,37 +168,53 @@ extension YHPrincipleReviewListVC: UITableViewDelegate, UITableViewDataSource { ...@@ -87,37 +168,53 @@ extension YHPrincipleReviewListVC: UITableViewDelegate, UITableViewDataSource {
func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell { func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
// YHPrinciplePhotoCell let cell = tableView.dequeueReusableCell(withIdentifier: "UITableViewCell", for: indexPath) as! UITableViewCell
// YHPrincipleUnapprovedCell
// if indexPath.row%2 == 0 { if 0 <= indexPath.row && indexPath.row < items.count {
let m = items[indexPath.row]
if m is YHPrincipleWaitResultModel {
// 入境处已认收受理 和 申请资料已递交港府留档 cell
let cell = tableView.dequeueReusableCell(withIdentifier: YHPrincipleUnapprovedCell.cellReuseIdentifier, for: indexPath) as! YHPrincipleUnapprovedCell let cell = tableView.dequeueReusableCell(withIdentifier: YHPrincipleUnapprovedCell.cellReuseIdentifier, for: indexPath) as! YHPrincipleUnapprovedCell
let model = m as! YHPrincipleWaitResultModel
cell.updateModel(model)
cell.expandClick = {
[weak self] isUnfold in
guard let self = self else { return }
model.isUnfold = isUnfold
self.tableView.reloadData()
}
return cell
}
if 0 <= indexPath.row && indexPath.row < items.count { if m is YHPrincipleEnvelopeModel {
let model = items[indexPath.row] // 已获得港府甄选名额 信封cell
let cell = tableView.dequeueReusableCell(withIdentifier: YHPrincipleEnvelopeCell.cellReuseIdentifier, for: indexPath) as! YHPrincipleEnvelopeCell
let model = m as! YHPrincipleEnvelopeModel
cell.updateModel(model) cell.updateModel(model)
cell.expandClick = { cell.expandClick = {
[weak self] isExpand in [weak self] isUnfold in
guard let self = self else { return } guard let self = self else { return }
model.isUnfold = isExpand model.isUnfold = isUnfold
self.tableView.reloadData() self.tableView.reloadData()
} }
return cell
} }
// return cell
// }
// let cell = tableView.dequeueReusableCell(withIdentifier: YHPrincipleUploadStatusCell.cellReuseIdentifier, for: indexPath) as! YHPrincipleUploadStatusCell if m is YHPrincipleAgreementModel {
// // 上传文件 cell
// if 0 <= indexPath.row && indexPath.row < items.count { let cell = tableView.dequeueReusableCell(withIdentifier: YHPrincipleUploadStatusCell.cellReuseIdentifier, for: indexPath) as! YHPrincipleUploadStatusCell
// let model = items[indexPath.row] let model = m as! YHPrincipleAgreementModel
// cell.updateModel(model) cell.updateModel(model)
// cell.expandClick = { cell.expandClick = {
// [weak self] isExpand in [weak self] isUnfold in
// guard let self = self else { return } guard let self = self else { return }
// model.isUnfold = isExpand model.isUnfold = isUnfold
// self.tableView.reloadData() self.tableView.reloadData()
// } }
// } return cell
}
}
return cell return cell
} }
......
...@@ -11,8 +11,8 @@ import AttributedString ...@@ -11,8 +11,8 @@ import AttributedString
class YHPrincipleWaitResultViewController: YHBaseViewController { class YHPrincipleWaitResultViewController: YHBaseViewController {
var orderId: Int = 0 var orderId: Int = -1
var status: Int = 11 var status: Int = -1
var items: [YHPrincipleWaitResultModel] = [] var items: [YHPrincipleWaitResultModel] = []
let viewModel = YHPrincleViewModel() let viewModel = YHPrincleViewModel()
lazy var tableView: UITableView = { lazy var tableView: UITableView = {
...@@ -84,20 +84,24 @@ extension YHPrincipleWaitResultViewController { ...@@ -84,20 +84,24 @@ extension YHPrincipleWaitResultViewController {
} }
// 入境处已认收受理 // 入境处已认收受理
if !waitResultModel.applicationFileNumberAttachment.isEmpty {
let model2 = waitResultModel.copy() let model2 = waitResultModel.copy()
model2.type = .entry model2.type = .entry
model2.title = "入境处已认收受理" model2.title = "入境处已认收受理"
model2.subTitle = "申请确认通知书:(来自香港入境处)" model2.subTitle = "申请确认通知书:(来自香港入境处)"
model2.isUnfold = false model2.isUnfold = true
self.items.append(model2) self.items.append(model2)
}
// 申请资料已递交港府留档 // 申请资料已递交港府留档
if waitResultModel.fileNumberList.count > 0 {
let model3 = waitResultModel.copy() let model3 = waitResultModel.copy()
model3.type = .profile model3.type = .profile
model3.title = "申请资料已递交港府留档" model3.title = "申请资料已递交港府留档"
model3.subTitle = "档案号:" model3.subTitle = "档案号:"
model3.isUnfold = false model3.isUnfold = true
self.items.append(model3) self.items.append(model3)
}
self.tableView.reloadData() self.tableView.reloadData()
} }
...@@ -175,7 +179,12 @@ extension YHPrincipleWaitResultViewController: UITableViewDelegate, UITableViewD ...@@ -175,7 +179,12 @@ extension YHPrincipleWaitResultViewController: UITableViewDelegate, UITableViewD
var titleLabel = UILabel() var titleLabel = UILabel()
titleLabel.numberOfLines = 0 titleLabel.numberOfLines = 0
let title: ASAttributedString = .init("您好,\(self.viewModel.waitResultModel.applicant.userName)先生!", .font(UIFont.PFSC_M(ofSize: 24)),.foreground(UIColor.mainTextColor)) var name = self.viewModel.waitResultModel.applicant.userName
if name.count > 5 {
name = String(name.prefix(5)) + "..."
}
var callName = self.viewModel.waitResultModel.applicant.sex == 2 ? "女士" : "先生"
let title: ASAttributedString = .init("您好,\(name)\(callName)!", .font(UIFont.PFSC_M(ofSize: 24)),.foreground(UIColor.mainTextColor))
titleLabel.attributed.text = title titleLabel.attributed.text = title
view.addSubview(titleLabel) view.addSubview(titleLabel)
......
...@@ -8,6 +8,7 @@ ...@@ -8,6 +8,7 @@
import UIKit import UIKit
import SmartCodable import SmartCodable
import AttributedString
class YHPrincipleUploadDetailModel: SmartCodable { class YHPrincipleUploadDetailModel: SmartCodable {
...@@ -70,7 +71,15 @@ class YHPrincipleContentUrlModel: SmartCodable { ...@@ -70,7 +71,15 @@ class YHPrincipleContentUrlModel: SmartCodable {
} }
} }
enum YHPrincipleAgreementType: Int {
case none = 0
case agreement = 1 // 同意书
case opinion = 2 // 申请人意见访问
case other = 3 // 其他证明条件
}
class YHPrincipleAgreementModel: SmartCodable { class YHPrincipleAgreementModel: SmartCodable {
var id: Int = 0 var id: Int = 0
var order_id: Int = 0 var order_id: Int = 0
var plan_id: Int = 0 var plan_id: Int = 0
...@@ -145,6 +154,33 @@ class YHPrincipleAgreementModel: SmartCodable { ...@@ -145,6 +154,33 @@ class YHPrincipleAgreementModel: SmartCodable {
var handle_remark: String = "" var handle_remark: String = ""
var rejection_confirmation: Int = 0 var rejection_confirmation: Int = 0
// 自定义属性
var customType: Int = YHPrincipleAgreementType.none.rawValue
var isMust: Bool = false // 是否必须
var title: String = ""
var isNeedTemplate: Bool = true
var isNeedUploadBtn: Bool = true
// 灰色或红色提示语
var tips: String = ""
// 黑色或富文本
var tips1: String = ""
// 最底部红色提示语
var redTips: String = ""
// 是否展开
var isUnfold: Bool = false
//
var fileList:[String] = []
// static func getTips() -> ASAttributedString {
// let a: ASAttributedString = .init("请【下载模板】,填写信息,贵单位", .font(UIFont.PFSC_R(ofSize: 12)),.foreground(UIColor.mainTextColor))
// let b: ASAttributedString = .init("签字盖章", .font(UIFont.PFSC_R(ofSize: 12)),.foreground(UIColor.init(hex: 0x3570DC)))
// let c: ASAttributedString = .init("后,拍照or扫描上传", .font(UIFont.PFSC_R(ofSize: 12)),.foreground(UIColor.mainTextColor))
// return a + b + c
// }
required init() { required init() {
} }
......
...@@ -101,6 +101,8 @@ class YHPrincipleUnapprovedCell: UITableViewCell { ...@@ -101,6 +101,8 @@ class YHPrincipleUnapprovedCell: UITableViewCell {
var items: [YHPrincipleFileModel] = [] var items: [YHPrincipleFileModel] = []
var expandClick:((Bool)->())? var expandClick:((Bool)->())?
let viewModel = YHPrincleViewModel()
lazy var titleLabel: UILabel = { lazy var titleLabel: UILabel = {
let label = UILabel() let label = UILabel()
label.font = UIFont.PFSC_R(ofSize: 15) label.font = UIFont.PFSC_R(ofSize: 15)
...@@ -136,6 +138,11 @@ class YHPrincipleUnapprovedCell: UITableViewCell { ...@@ -136,6 +138,11 @@ class YHPrincipleUnapprovedCell: UITableViewCell {
return btn return btn
}() }()
lazy var previewFileTool:YHFilePreviewTool = {
let tool = YHFilePreviewTool(targetVC: UIViewController.current)
return tool
}()
func updateModel(_ model:YHPrincipleWaitResultModel) { func updateModel(_ model:YHPrincipleWaitResultModel) {
itemModel = model itemModel = model
...@@ -200,6 +207,11 @@ class YHPrincipleUnapprovedCell: UITableViewCell { ...@@ -200,6 +207,11 @@ class YHPrincipleUnapprovedCell: UITableViewCell {
itemView.btnClick = { itemView.btnClick = {
YHHUD.flash(message: "查看文件") YHHUD.flash(message: "查看文件")
// 私链转公链 // 私链转公链
self.viewModel.getPublicImageUrl(item.value) { success, error in
if let success = success {
self.previewFileTool.openXLSXRemoteFile(urlString: success, fileName:"申请确认通知书")
}
}
} }
} else if model.type == .profile { } else if model.type == .profile {
......
...@@ -23,7 +23,7 @@ class YHPrincipleUploadStatusCell: UITableViewCell { ...@@ -23,7 +23,7 @@ class YHPrincipleUploadStatusCell: UITableViewCell {
static let cellReuseIdentifier = "YHPrincipleUploadStatusCell" static let cellReuseIdentifier = "YHPrincipleUploadStatusCell"
var itemModel:YHPrincleGroupModel? var itemModel:YHPrincipleAgreementModel?
var items: [String] = [] var items: [String] = []
var expandClick:((Bool)->())? var expandClick:((Bool)->())?
...@@ -168,11 +168,11 @@ class YHPrincipleUploadStatusCell: UITableViewCell { ...@@ -168,11 +168,11 @@ class YHPrincipleUploadStatusCell: UITableViewCell {
self.backgroundColor = .clear self.backgroundColor = .clear
} }
func updateModel(_ model:YHPrincleGroupModel) { func updateModel(_ model: YHPrincipleAgreementModel) {
itemModel = model itemModel = model
items.removeAll() items.removeAll()
items.append(contentsOf: model.fileList) // items.append(contentsOf: model.fileList)
contentView.removeSubviews() contentView.removeSubviews()
self.dotLineLayer.removeFromSuperlayer() self.dotLineLayer.removeFromSuperlayer()
...@@ -188,7 +188,7 @@ class YHPrincipleUploadStatusCell: UITableViewCell { ...@@ -188,7 +188,7 @@ class YHPrincipleUploadStatusCell: UITableViewCell {
whiteView.addSubview(redTipsLabel) whiteView.addSubview(redTipsLabel)
grayLabel.text = model.tips grayLabel.text = model.tips
detailLabel.attributed.text = model.tips1 // detailLabel.attributed.text = model.tips1
templateButton.isHidden = !model.isNeedTemplate templateButton.isHidden = !model.isNeedTemplate
uploadBtn.isHidden = !model.isNeedUploadBtn uploadBtn.isHidden = !model.isNeedUploadBtn
if model.isNeedUploadBtn { if model.isNeedUploadBtn {
...@@ -236,10 +236,10 @@ class YHPrincipleUploadStatusCell: UITableViewCell { ...@@ -236,10 +236,10 @@ class YHPrincipleUploadStatusCell: UITableViewCell {
} }
detailLabel.snp.remakeConstraints { make in detailLabel.snp.remakeConstraints { make in
make.top.equalTo(grayLabel.snp.bottom).offset(model.tips1.length <= 0 ? 0 : 16) make.top.equalTo(grayLabel.snp.bottom).offset(model.tips1.isEmpty ? 0 : 16)
make.left.equalTo(16) make.left.equalTo(16)
make.right.equalTo(-16) make.right.equalTo(-16)
if model.tips1.length <= 0 { if model.tips1.isEmpty {
make.height.equalTo(0) make.height.equalTo(0)
} }
} }
...@@ -275,25 +275,6 @@ class YHPrincipleUploadStatusCell: UITableViewCell { ...@@ -275,25 +275,6 @@ class YHPrincipleUploadStatusCell: UITableViewCell {
} }
make.bottom.equalTo(-16) make.bottom.equalTo(-16)
} }
// if status == .preSubmit { // 待提交
//
//
// } else {
//
// self.titleLabel.attributed.text = mustTag + title + status
//
// if status == .review {
//
// } else if status == .rejected {
//
// } else if status == .pass {
//
// } else if status == .mail {
//
// }
// }
} }
func getUploadBgColor(status: YHPrincipleStatus) -> UIColor { func getUploadBgColor(status: YHPrincipleStatus) -> UIColor {
......
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
import UIKit import UIKit
class YHPrincleViewModel: NSObject { class YHPrincleViewModel: YHBaseViewModel {
var waitResultModel = YHPrincipleWaitResultModel() var waitResultModel = YHPrincipleWaitResultModel()
var envelopModel = YHPrincipleEnvelopeModel() var envelopModel = YHPrincipleEnvelopeModel()
...@@ -62,14 +62,17 @@ class YHPrincleViewModel: NSObject { ...@@ -62,14 +62,17 @@ class YHPrincleViewModel: NSObject {
return return
} }
self.envelopModel = resultModel self.envelopModel = resultModel
self.envelopModel = self.getEnvelopModel()
callback?(true, nil) callback?(true, nil)
} 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)
self.envelopModel = self.getEnvelopModel()
callback?(false, err) callback?(false, err)
} }
} failBlock: { err in } failBlock: { err in
self.envelopModel = self.getEnvelopModel()
callback?(false, err) callback?(false, err)
} }
} }
...@@ -104,6 +107,31 @@ class YHPrincleViewModel: NSObject { ...@@ -104,6 +107,31 @@ class YHPrincleViewModel: NSObject {
} }
} }
func requestIsSendMail(orderId:Int, callback:((_ isSend: Bool)->())?) {
let strUrl = YHBaseUrlManager.shared.curURL() + YHAllApiName.Principle.getIsSendMail
let params: [String : Any] = ["order_id": orderId]
let _ = YHNetRequest.getRequest(url: strUrl,params: params) { [weak self] json, code in
//1. json字符串 转 对象
guard let self = self else { return }
printLog("model 是 ==> \(json)")
if json.code == 200 {
if let isSend = json.data as? Bool {
callback?(isSend)
} else {
callback?(false)
}
} else {
callback?(false)
}
} failBlock: { err in
callback?(false)
}
}
func getEnvelopModel() -> YHPrincipleEnvelopeModel { func getEnvelopModel() -> YHPrincipleEnvelopeModel {
let model = YHPrincipleEnvelopeModel() let model = YHPrincipleEnvelopeModel()
model.name = "黄金龙" model.name = "黄金龙"
......
...@@ -22,6 +22,7 @@ class YHWorkExperienceViewController: YHBaseViewController { ...@@ -22,6 +22,7 @@ class YHWorkExperienceViewController: YHBaseViewController {
var isMore: Bool = false var isMore: Bool = false
var isShowPrompt: Bool = false var isShowPrompt: Bool = false
var isShowMessageSelect: Bool = true var isShowMessageSelect: Bool = true
var isKeyboardShow: Bool = false
var selectEditItem = YHWorkExperienceFileModel() var selectEditItem = YHWorkExperienceFileModel()
var renameInputView: YHFileRenameInputView = { var renameInputView: YHFileRenameInputView = {
let view = YHFileRenameInputView.inputView(defalutText: "请输入名称") let view = YHFileRenameInputView.inputView(defalutText: "请输入名称")
...@@ -250,6 +251,12 @@ class YHWorkExperienceViewController: YHBaseViewController { ...@@ -250,6 +251,12 @@ class YHWorkExperienceViewController: YHBaseViewController {
make.bottom.equalTo(-k_Height_safeAreaInsetsBottom() - 64) make.bottom.equalTo(-k_Height_safeAreaInsetsBottom() - 64)
make.left.right.bottom.equalTo(view) make.left.right.bottom.equalTo(view)
} }
isKeyboardShow = true
let rightButtonItem = UIBarButtonItem(title: "下一步", style: .plain, target: self, action: #selector(nextStep))
rightButtonItem.setTitleTextAttributes([.foregroundColor: UIColor.brandMainColor], for: .normal)
rightButtonItem.setTitleTextAttributes([.foregroundColor: UIColor.brandMainColor], for: .highlighted)
gk_navRightBarButtonItem = rightButtonItem
gk_navItemRightSpace = 16
} }
} }
...@@ -267,6 +274,34 @@ class YHWorkExperienceViewController: YHBaseViewController { ...@@ -267,6 +274,34 @@ class YHWorkExperienceViewController: YHBaseViewController {
make.bottom.equalTo(-k_Height_safeAreaInsetsBottom() - 64) make.bottom.equalTo(-k_Height_safeAreaInsetsBottom() - 64)
make.left.right.bottom.equalTo(view) make.left.right.bottom.equalTo(view)
} }
isKeyboardShow = false
gk_navRightBarButtonItems = []
}
}
@objc func nextStep() {
self.view.endEditing(true)
if self.viewModel.isCanNext(self.stepView.currentIndex) {
self.viewModel.mainModel.step = self.stepView.currentIndex
self.viewModel.saveWorkDetail(1, orderID: self.orderID, callBackBlock: {[weak self] flag, error in
guard let self = self else { return }
if let error = error {
YHHUD.flash(message: error.errorMsg )
} else {
YHHUD.hideFlashMessage()
if self.stepView.currentIndex == 4 || (self.stepView.currentIndex == 3 && self.viewModel.mainModel.is_project_introduction == 0) {
YHHUD.flash(message: "提交成功")
self.navigationController?.popViewController()
} else {
self.stepView.currentIndex = self.stepView.currentIndex + 1
self.updateDataSource()
}
}
})
} else {
self.isShowPrompt = true
self.updateDataSource()
YHHUD.flash(message: "您还有信息未填写")
} }
} }
...@@ -859,3 +894,13 @@ extension YHWorkExperienceViewController: UITableViewDelegate, UITableViewDataSo ...@@ -859,3 +894,13 @@ extension YHWorkExperienceViewController: UITableViewDelegate, UITableViewDataSo
return 0.01 return 0.01
} }
} }
extension YHWorkExperienceViewController: UIScrollViewDelegate {
func scrollViewDidScroll(_ scrollView: UIScrollView) {
if isKeyboardShow {
if stepView.currentIndex != 0 {
self.view.endEditing(true)
}
}
}
}
...@@ -238,3 +238,9 @@ extension YHWorkHighlightsTableViewCell: UITextViewDelegate { ...@@ -238,3 +238,9 @@ extension YHWorkHighlightsTableViewCell: UITextViewDelegate {
return newLength <= 2000 return newLength <= 2000
} }
} }
extension YHWorkHighlightsTableViewCell: UIScrollViewDelegate {
func scrollViewDidScroll(_ scrollView: UIScrollView) {
UIViewController.current().view.endEditing(true)
}
}
...@@ -190,3 +190,9 @@ extension YHWorkResponsibilitiesTableViewCell: UITextViewDelegate { ...@@ -190,3 +190,9 @@ extension YHWorkResponsibilitiesTableViewCell: UITextViewDelegate {
return newLength <= 2000 return newLength <= 2000
} }
} }
extension YHWorkResponsibilitiesTableViewCell: UIScrollViewDelegate {
func scrollViewDidScroll(_ scrollView: UIScrollView) {
UIViewController.current().view.endEditing(true)
}
}
...@@ -301,12 +301,6 @@ extension YHH5WebViewVC { ...@@ -301,12 +301,6 @@ extension YHH5WebViewVC {
} }
} }
func webViewDidScrollView(_ offset: CGFloat) {
//补充 导航栏 逻辑逻辑
}
func saveImage(_ image: UIImage) { func saveImage(_ image: UIImage) {
// 确保应用有权访问相册 // 确保应用有权访问相册
PHPhotoLibrary.requestAuthorization { status in PHPhotoLibrary.requestAuthorization { status in
......
...@@ -26,7 +26,6 @@ extension YHJsApi { ...@@ -26,7 +26,6 @@ extension YHJsApi {
if curIndex > -1,arrPics.count > 0 { if curIndex > -1,arrPics.count > 0 {
DispatchQueue.main.async { DispatchQueue.main.async {
// let arr = ["https://img1.baidu.com/it/u=2032777443,4245182967&fm=253&fmt=auto&app=138&f=JPEG?w=800&h=1422","http://img0.baidu.com/it/u=594725074,698294204&fm=253&app=138&f=JPEG?w=800&h=1422"]
YHPictureReviewManager.shared.showNetWorkPicturs(curIndex: curIndex, arrPicturs: arrPics) YHPictureReviewManager.shared.showNetWorkPicturs(curIndex: curIndex, arrPicturs: arrPics)
} }
} }
......
...@@ -344,7 +344,7 @@ extension YHMyViewController : UITableViewDelegate, UITableViewDataSource { ...@@ -344,7 +344,7 @@ extension YHMyViewController : UITableViewDelegate, UITableViewDataSource {
// YHPrincipleCongratulationAlertView.alertView().show() // YHPrincipleCongratulationAlertView.alertView().show()
// YHPrincipleWaitResultViewController // YHPrincipleWaitResultViewController
let vc = YHPrincipleApprovedMailViewController() let vc = YHPrincipleApprovedWaitSubmitVC()
self.navigationController?.pushViewController(vc) self.navigationController?.pushViewController(vc)
return return
} }
......
...@@ -11,7 +11,9 @@ import PhotosUI ...@@ -11,7 +11,9 @@ import PhotosUI
class YHLongtapPictureSheetView: UIView { class YHLongtapPictureSheetView: UIView {
private var uploadTypeArr = ["分享图片","保存图片","取消"] private var uploadTypeArr = ["分享图片","保存图片","取消"]
private let testUrl = "https://img1.baidu.com/it/u=2032777443,4245182967&fm=253&fmt=auto&app=138&f=JPEG?w=800&h=1422" // private let testUrl = "https://img1.baidu.com/it/u=2032777443,4245182967&fm=253&fmt=auto&app=138&f=JPEG?w=800&h=1422"
var myUrl : String = ""
lazy var blackMaskView: UIView = { lazy var blackMaskView: UIView = {
let view = UIView() let view = UIView()
view.backgroundColor = UIColor(hex: 0x0F1214, alpha: 0.5) view.backgroundColor = UIColor(hex: 0x0F1214, alpha: 0.5)
...@@ -213,7 +215,7 @@ extension YHLongtapPictureSheetView { ...@@ -213,7 +215,7 @@ extension YHLongtapPictureSheetView {
private extension YHLongtapPictureSheetView { private extension YHLongtapPictureSheetView {
@objc func share() { @objc func share() {
self.dismiss() self.dismiss()
guard let url = URL(string: testUrl) else { guard let url = URL(string: myUrl) else {
return return
} }
let task = URLSession.shared.dataTask(with: url) { data, response, error in let task = URLSession.shared.dataTask(with: url) { data, response, error in
...@@ -230,7 +232,7 @@ private extension YHLongtapPictureSheetView { ...@@ -230,7 +232,7 @@ private extension YHLongtapPictureSheetView {
} }
@objc func save() { @objc func save() {
saveLocalPictureSyn(testUrl) saveLocalPictureSyn(myUrl)
self.dismiss() self.dismiss()
} }
......
...@@ -62,7 +62,11 @@ extension YHPictureReviewManager { ...@@ -62,7 +62,11 @@ extension YHPictureReviewManager {
extension YHPictureReviewManager { extension YHPictureReviewManager {
private func longPress(cell: JXPhotoBrowserImageCell) { private func longPress(cell: JXPhotoBrowserImageCell) {
let index = cell.index
if index < self.arrPics.count,index > -1 {
let view = YHLongtapPictureSheetView.sheetView() let view = YHLongtapPictureSheetView.sheetView()
view.myUrl = self.arrPics[index]
view.show() view.show()
} }
}
} }
...@@ -70,6 +70,8 @@ enum YHUatModules: Int { ...@@ -70,6 +70,8 @@ enum YHUatModules: Int {
class YHUatHelper: NSObject { class YHUatHelper: NSObject {
static let shared = YHUatHelper() static let shared = YHUatHelper()
private var isDataOk : Bool = false
private lazy var viewModel: YHUatHelperViewModel = { private lazy var viewModel: YHUatHelperViewModel = {
let vm = YHUatHelperViewModel() let vm = YHUatHelperViewModel()
return vm return vm
...@@ -91,7 +93,7 @@ class YHUatHelper: NSObject { ...@@ -91,7 +93,7 @@ class YHUatHelper: NSObject {
private extension YHUatHelper { private extension YHUatHelper {
@objc func loginSuccess() { @objc func loginSuccess() {
viewModel.isDataOk = false isDataOk = false
loadUatData() loadUatData()
} }
...@@ -119,7 +121,6 @@ extension YHUatHelper { ...@@ -119,7 +121,6 @@ extension YHUatHelper {
} }
} }
//2.返回默认值 //2.返回默认值
return module.defaultValue return module.defaultValue
} }
...@@ -127,20 +128,23 @@ extension YHUatHelper { ...@@ -127,20 +128,23 @@ extension YHUatHelper {
//加载服务器的uat配置 //加载服务器的uat配置
func loadUatData() { func loadUatData() {
if !YHNetworkStatusManager.shared.isNetWorkOK { if !YHNetworkStatusManager.shared.isNetWorkOK {
printLog("网络不可用") printLog("网络不可用")
return return
} }
if !YHLoginManager.shared.isLogin() {
printLog("未登录 不请求")
return
}
if !isDataOk {
if !viewModel.isDataOk {
viewModel.getUatList { success, error in viewModel.getUatList { success, error in
if success { if success {
self.isDataOk = true
NotificationCenter.default.post(name: YhConstant.YhNotification.didRevUatParam, object: nil) NotificationCenter.default.post(name: YhConstant.YhNotification.didRevUatParam, object: nil)
} else { } else {
self.isDataOk = false
} }
} }
} }
......
...@@ -49,7 +49,6 @@ class YHUatListModel : HandyJSON { ...@@ -49,7 +49,6 @@ class YHUatListModel : HandyJSON {
class YHUatHelperViewModel : YHBaseViewModel { class YHUatHelperViewModel : YHBaseViewModel {
var dataList : YHUatListModel? var dataList : YHUatListModel?
var isDataOk : Bool = false
} }
// MARK: - 共有方法 // MARK: - 共有方法
...@@ -62,7 +61,7 @@ extension YHUatHelperViewModel { ...@@ -62,7 +61,7 @@ extension YHUatHelperViewModel {
return return
} }
let params: [String] = ["1", "2","3", "4","5","6", "7","9"] let params: [String] = ["1", "2","3", "4","5","6","9"]
var strUrl = YHBaseUrlManager.shared.curURL() + YHAllApiName.Uat.uatListApi var strUrl = YHBaseUrlManager.shared.curURL() + YHAllApiName.Uat.uatListApi
for (index,item) in params.enumerated() { for (index,item) in params.enumerated() {
if index == 0 { if index == 0 {
...@@ -80,15 +79,12 @@ extension YHUatHelperViewModel { ...@@ -80,15 +79,12 @@ extension YHUatHelperViewModel {
callBackBlock(false,nil) callBackBlock(false,nil)
return return
} }
self.isDataOk = true
self.dataList = resultModel self.dataList = resultModel
callBackBlock(true,nil) callBackBlock(true,nil)
} failBlock: { err in } failBlock: { err in
self.isDataOk = false
callBackBlock(false,err) callBackBlock(false,err)
} }
} }
......
...@@ -380,8 +380,12 @@ class YHAllApiName { ...@@ -380,8 +380,12 @@ class YHAllApiName {
struct Principle { struct Principle {
// 原则批审批结果 // 原则批审批结果
static let getReviewResult = "super-app/order/approval/principle" static let getReviewResult = "super-app/order/approval/principle"
// ApprovalInfo 获取档案号 // 获取档案号列表
static let getProfileList = "super-app/order/approval/info" static let getProfileList = "super-app/order/approval/info"
// 原则批详情
static let getUploadDetail = "super-app/order/approval/uploadInfo"
// 原则批已获批 是否发送邮件
static let getIsSendMail = "super-app/order/customer/service/interview/is-send-email"
} }
} }
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