Commit 31d5e2fb 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:
  //  原则批
  1211
parents 5992265b 6f289476
......@@ -304,6 +304,7 @@
0480976D2BA158A1000B9DCA /* YHCertificateListVC.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0480976C2BA158A1000B9DCA /* YHCertificateListVC.swift */; };
048097712BA18D66000B9DCA /* YHCertificateSearchBar.swift in Sources */ = {isa = PBXBuildFile; fileRef = 048097702BA18D66000B9DCA /* YHCertificateSearchBar.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 */; };
048787D52BCE880B0036E221 /* YHServiceOrderListViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 048787D42BCE880B0036E221 /* YHServiceOrderListViewController.swift */; };
048787D72BCE96F50036E221 /* YHServiceOrderProgressTableViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 048787D62BCE96F50036E221 /* YHServiceOrderProgressTableViewCell.swift */; };
......@@ -952,6 +953,7 @@
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>"; };
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>"; };
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>"; };
......@@ -2205,6 +2207,7 @@
0472CB9C2C5A11640096F48F /* YHPrincipleReviewListVC.swift */,
04B360F22C636525001EB053 /* YHPrincipleWaitResultViewController.swift */,
04B360F42C646844001EB053 /* YHPrincipleApprovedMailViewController.swift */,
0485DFD52C64E70200B50293 /* YHPrincipleApprovedWaitSubmitVC.swift */,
);
path = C;
sourceTree = "<group>";
......@@ -3665,6 +3668,7 @@
04B360ED2C61F157001EB053 /* YHPrincipleEnvelopeCell.swift in Sources */,
04B9EE5B2C06CC3100A4018D /* YHOtherLoginViewController.swift in Sources */,
045EEF0C2B9F171A0022A143 /* YHBasicInfoFillBottomView.swift in Sources */,
0485DFD62C64E70200B50293 /* YHPrincipleApprovedWaitSubmitVC.swift in Sources */,
A5ACE93D2B4564F7002C94D2 /* UIButton+Extension.swift in Sources */,
0472CBA92C5A11640096F48F /* YHPrincleGroupModel.swift in Sources */,
04213B232C48B7F700797900 /* YHIdentityTabBar.swift in Sources */,
......
......@@ -175,6 +175,16 @@ class YHInvitationWithGiftsSelectItemView: UIView {
}
@objc func sure() {
if selectOne == 3 {
if startTime.count == 0 {
YHHUD.flash(message: "请选择开始时间")
return
}
if endTime.count == 0 {
YHHUD.flash(message: "请选择截止时间")
return
}
}
if let block = backDate {
block(selectOne ?? 100,selectTwo ?? 100,startTime,endTime)
}
......
......@@ -11,6 +11,8 @@ import JXSegmentedView
class YHServiceOrderListView: YHBaseViewController {
private let viewModel : YHServiceCenterMainViewModel = YHServiceCenterMainViewModel()
let principleViewModel: YHPrincleViewModel = YHPrincleViewModel()
typealias Block = (Int,Int,Bool) -> ()
var block: Block?
var orderID: Int = 0
......@@ -221,9 +223,23 @@ extension YHServiceOrderListView : UITableViewDelegate,UITableViewDataSource {
vc.orderId = orderID
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()
vc.status = model.type
vc.orderId = orderID
......
//
// 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
}
}
......@@ -9,10 +9,23 @@
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 {
var orderId: Int = 0
var status: Int = 0
var items: [SmartCodable] = []
let viewModel = YHPrincleViewModel()
......@@ -58,6 +71,7 @@ class YHPrincipleReviewListVC: YHBaseViewController {
func createUI() {
view.addSubview(bgView)
view.addSubview(tableView)
bgView.snp.makeConstraints { make in
make.top.left.right.equalToSuperview()
make.bottom.equalToSuperview()
......@@ -107,6 +121,11 @@ class YHPrincipleReviewListVC: YHBaseViewController {
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)
// 其他证明条件
......
......@@ -101,6 +101,8 @@ class YHPrincipleUnapprovedCell: UITableViewCell {
var items: [YHPrincipleFileModel] = []
var expandClick:((Bool)->())?
let viewModel = YHPrincleViewModel()
lazy var titleLabel: UILabel = {
let label = UILabel()
label.font = UIFont.PFSC_R(ofSize: 15)
......@@ -136,6 +138,11 @@ class YHPrincipleUnapprovedCell: UITableViewCell {
return btn
}()
lazy var previewFileTool:YHFilePreviewTool = {
let tool = YHFilePreviewTool(targetVC: UIViewController.current)
return tool
}()
func updateModel(_ model:YHPrincipleWaitResultModel) {
itemModel = model
......@@ -200,6 +207,11 @@ class YHPrincipleUnapprovedCell: UITableViewCell {
itemView.btnClick = {
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 {
......
......@@ -8,7 +8,7 @@
import UIKit
class YHPrincleViewModel: NSObject {
class YHPrincleViewModel: YHBaseViewModel {
var waitResultModel = YHPrincipleWaitResultModel()
var envelopModel = YHPrincipleEnvelopeModel()
......@@ -62,14 +62,17 @@ class YHPrincleViewModel: NSObject {
return
}
self.envelopModel = resultModel
self.envelopModel = self.getEnvelopModel()
callback?(true, nil)
} else {
let err = YHErrorModel(errorCode: Int32(json.code), errorMsg: json.msg.isEmpty ? "" : json.msg)
self.envelopModel = self.getEnvelopModel()
callback?(false, err)
}
} failBlock: { err in
self.envelopModel = self.getEnvelopModel()
callback?(false, err)
}
}
......@@ -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 {
let model = YHPrincipleEnvelopeModel()
model.name = "黄金龙"
......
......@@ -344,7 +344,7 @@ extension YHMyViewController : UITableViewDelegate, UITableViewDataSource {
// YHPrincipleCongratulationAlertView.alertView().show()
// YHPrincipleWaitResultViewController
let vc = YHPrincipleApprovedMailViewController()
let vc = YHPrincipleApprovedWaitSubmitVC()
self.navigationController?.pushViewController(vc)
return
}
......
......@@ -384,6 +384,8 @@ class YHAllApiName {
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