Commit fa161b67 authored by pete谢兆麟's avatar pete谢兆麟

Merge commit '7a12fce3' into xiezhaolin

parents 54634e6a 7a12fce3
......@@ -237,6 +237,7 @@
A51044182B493675006B60BB /* README.md in Resources */ = {isa = PBXBuildFile; fileRef = A51044172B493675006B60BB /* README.md */; };
A510441A2B495DD0006B60BB /* UIView+Extension.swift in Sources */ = {isa = PBXBuildFile; fileRef = A51044192B495DD0006B60BB /* UIView+Extension.swift */; };
A514E5DC2B60A2B700C93951 /* YHServiceCenterSecondViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = A514E5DB2B60A2B700C93951 /* YHServiceCenterSecondViewController.swift */; };
A525D2302BA83B87001A84F5 /* YHFileListBottomView.swift in Sources */ = {isa = PBXBuildFile; fileRef = A525D22F2BA83B87001A84F5 /* YHFileListBottomView.swift */; };
A53026902B4E6F2700F35102 /* YHHomeCustomCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = A530268F2B4E6F2700F35102 /* YHHomeCustomCell.swift */; };
A554A5122B99715000EA5973 /* YHConstantArrayData.swift in Sources */ = {isa = PBXBuildFile; fileRef = A554A5112B99715000EA5973 /* YHConstantArrayData.swift */; };
A5551FFE2B4C26CE00510980 /* YHBaseViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = A5551FFD2B4C26CE00510980 /* YHBaseViewModel.swift */; };
......@@ -605,6 +606,7 @@
A51044172B493675006B60BB /* README.md */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = net.daringfireball.markdown; path = README.md; sourceTree = "<group>"; };
A51044192B495DD0006B60BB /* UIView+Extension.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "UIView+Extension.swift"; sourceTree = "<group>"; };
A514E5DB2B60A2B700C93951 /* YHServiceCenterSecondViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHServiceCenterSecondViewController.swift; sourceTree = "<group>"; };
A525D22F2BA83B87001A84F5 /* YHFileListBottomView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHFileListBottomView.swift; sourceTree = "<group>"; };
A530268F2B4E6F2700F35102 /* YHHomeCustomCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHHomeCustomCell.swift; sourceTree = "<group>"; };
A554A5112B99715000EA5973 /* YHConstantArrayData.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHConstantArrayData.swift; sourceTree = "<group>"; };
A5551FFD2B4C26CE00510980 /* YHBaseViewModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHBaseViewModel.swift; sourceTree = "<group>"; };
......@@ -1522,6 +1524,7 @@
A525D22C2BA837C5001A84F5 /* FileList(文件清单) */ = {
isa = PBXGroup;
children = (
A525D22E2BA83B58001A84F5 /* V */,
A525D22D2BA837DF001A84F5 /* C */,
);
path = "FileList(文件清单)";
......@@ -1535,6 +1538,14 @@
path = C;
sourceTree = "<group>";
};
A525D22E2BA83B58001A84F5 /* V */ = {
isa = PBXGroup;
children = (
A525D22F2BA83B87001A84F5 /* YHFileListBottomView.swift */,
);
path = V;
sourceTree = "<group>";
};
A5573EC52B317BFF00D98EC0 = {
isa = PBXGroup;
children = (
......@@ -2321,6 +2332,7 @@
045EEE8A2B9F171A0022A143 /* YHPreviewOtherInformationViewController.swift in Sources */,
A5FD63C72B638CA000D1D9DA /* YHSubmintAllInfoSuccessTipView.swift in Sources */,
A5ACE9402B4564F7002C94D2 /* String+Extension.swift in Sources */,
A525D2302BA83B87001A84F5 /* YHFileListBottomView.swift in Sources */,
045EEEE42B9F171A0022A143 /* YHMySignatureDetailModel.swift in Sources */,
A58A8C8F2BA6978100632765 /* YHMineCertificateEntryViewController.swift in Sources */,
045EEF1B2B9F171A0022A143 /* YHAddressPickViewTableViewCell.swift in Sources */,
......@@ -2611,7 +2623,7 @@
CODE_SIGN_IDENTITY = "Apple Development";
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
CODE_SIGN_STYLE = Manual;
CURRENT_PROJECT_VERSION = 2;
CURRENT_PROJECT_VERSION = 1;
DEVELOPMENT_TEAM = "";
"DEVELOPMENT_TEAM[sdk=iphoneos*]" = RXHYW88XR7;
ENABLE_USER_SCRIPT_SANDBOXING = NO;
......@@ -2631,7 +2643,7 @@
"$(inherited)",
"@executable_path/Frameworks",
);
MARKETING_VERSION = 0.2.1;
MARKETING_VERSION = 0.2.2;
PRODUCT_BUNDLE_IDENTIFIER = com.intelligence.galaxy;
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = "";
......@@ -2653,7 +2665,7 @@
CODE_SIGN_IDENTITY = "Apple Development";
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
CODE_SIGN_STYLE = Manual;
CURRENT_PROJECT_VERSION = 2;
CURRENT_PROJECT_VERSION = 1;
DEVELOPMENT_TEAM = "";
"DEVELOPMENT_TEAM[sdk=iphoneos*]" = RXHYW88XR7;
ENABLE_USER_SCRIPT_SANDBOXING = NO;
......@@ -2673,7 +2685,7 @@
"$(inherited)",
"@executable_path/Frameworks",
);
MARKETING_VERSION = 0.2.1;
MARKETING_VERSION = 0.2.2;
PRODUCT_BUNDLE_IDENTIFIER = com.intelligence.galaxy;
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = "";
......
......@@ -24,8 +24,33 @@ class YHFileListViewController: YHBaseViewController {
}()
private lazy var headView : UIView = {
let view = UIView()
view.backgroundColor = .clear
return view
}()
private lazy var myScrollView : UIScrollView = {
let view = UIScrollView()
view.backgroundColor = .red
return view
}()
private lazy var myContentView : UIView = {
let view = UIView()
view.backgroundColor = .yellow
view.layer.cornerRadius = kCornerRadius6
view.clipsToBounds = true
return view
}()
let bottomView : YHCertificateEntryBottomView = YHCertificateEntryBottomView()
let bottomView : YHFileListBottomView = YHFileListBottomView()
override func viewDidLoad() {
super.viewDidLoad()
......@@ -61,16 +86,60 @@ extension YHFileListViewController {
gk_navBarAlpha = 1.0
gk_navBackgroundColor = .white
view.addSubview(topBkg)
view.addSubview(bottomView)
bottomView.snp.makeConstraints { make in
make.left.right.bottom.equalToSuperview()
make.height.equalTo(YHFileListBottomView.viewH)
}
bottomView.block = { flag in
if flag == 1 {
printLog("生成清单")
}
}
view.addSubview(myScrollView)
myScrollView.snp.makeConstraints { make in
make.top.equalToSuperview().offset(k_Height_NavigationtBarAndStatuBar)
make.left.right.equalToSuperview()
make.bottom.equalTo(bottomView.snp.top)
}
myScrollView.addSubview(topBkg)
topBkg.snp.makeConstraints { make in
make.top.left.right.equalToSuperview()
make.top.equalToSuperview()
make.left.equalToSuperview()
make.width.equalTo(KScreenWidth)
make.height.equalTo(312)
}
view.addSubview(bottomView)
bottomView.snp.makeConstraints { make in
make.left.right.bottom.equalToSuperview()
make.height.equalTo(YHCertificateEntryBottomView.viewH)
myScrollView.addSubview(myContentView)
myContentView.snp.makeConstraints { make in
make.top.equalTo(217)
make.left.equalTo(kMargin)
make.width.equalTo(KScreenWidth - 2*kMargin)
make.height.equalTo(1700) //for test hjl
// make.bottom.equalToSuperview().offset(-50)
}
let footLable = UILabel()
footLable.text = "*感谢您对银河移民的信赖,以上信息均用于香港优才签证申 请银河移民承诺对您所提供的信息将绝对保密"
footLable.textColor = .white
footLable.font = UIFont.PFSC_R(ofSize: 12)
footLable.numberOfLines = 0
footLable.lineBreakMode = .byWordWrapping
myScrollView.addSubview(footLable)
footLable.snp.makeConstraints { make in
make.top.equalTo(myContentView.snp.bottom).offset(29)
make.left.equalTo(28)
make.width.equalTo(KScreenWidth - 2*28)
make.bottom.equalToSuperview().offset(-41)
}
myScrollView.layoutIfNeeded()
printLog(myScrollView.contentSize)
return
}
}
//
// YHFileListBottomView.swift
// galaxy
//
// Created by davidhuangA on 2024/3/18.
// Copyright © 2024 https://www.galaxy-immi.com. All rights reserved.
//
import UIKit
class YHFileListBottomView: UIView {
static let viewH : CGFloat = 98.0
override init(frame: CGRect) {
super.init(frame: CGRect(x: 0, y: 0, width: KScreenWidth, height: YHBasicInfoFillBottomView.viewH))
setupUI()
}
required init?(coder: NSCoder) {
fatalError("init(coder:) has not been implemented")
}
typealias Block = (Int) -> ()
var block: Block?
var saveButton: UIButton!
var nextButton: UIButton!
}
private extension YHFileListBottomView {
func setupUI() {
backgroundColor = .white
// saveButton = {
// let button = UIButton(type: .custom)
// button.backgroundColor = UIColor.contentBkgColor
// button.titleLabel?.font = UIFont.PFSC_M(ofSize: 15)
// button.contentHorizontalAlignment = .center
// button.setTitle("问题答疑", for: .normal)
// button.setTitleColor(UIColor.mainTextColor, for: .normal)
// button.layer.cornerRadius = kCornerRadius6
// button.addTarget(self, action: #selector(save), for: .touchUpInside)
// return button
// }()
// addSubview(saveButton)
// saveButton.snp.makeConstraints { make in
// make.left.equalTo(kMargin)
// make.top.equalTo(12)
// make.height.equalTo(44)
// make.width.equalTo(86)
// }
nextButton = {
let button = UIButton(type: .custom)
button.titleLabel?.font = UIFont.PFSC_M(ofSize: 15)
button.contentHorizontalAlignment = .center
button.setTitle("保存清单图", for: .normal)
button.setTitleColor(.white, for: .normal)
button.layer.cornerRadius = kCornerRadius6
button.clipsToBounds = true
button.addTarget(self, action: #selector(submit), for: .touchUpInside)
return button
}()
addSubview(nextButton)
nextButton.snp.makeConstraints { make in
make.right.equalTo(-kMargin)
make.top.equalTo(8)
make.height.equalTo(44)
make.left.equalTo(kMargin)
}
nextButton.layoutIfNeeded()
nextButton.addYinHeGradualLayer()
}
@objc func save() {
block?(0)
}
@objc func submit() {
block?(1)
}
}
......@@ -14,8 +14,10 @@ import IQKeyboardManagerSwift
class YHCertificateResourceUploadVC: YHBaseViewController {
var orderId : Int?
var status: YHCertificateUploadStatus = .all
var items:[YHSupplementInfo] = []
var viewModel: YHCertificateViewModel = YHCertificateViewModel()
var categoryInfo: YHCategoryData = YHCategoryData()
lazy var tableView: UITableView = {
......@@ -114,8 +116,8 @@ extension YHCertificateResourceUploadVC {
let params = [
"order_id" : orderId ?? 0,
"node": "1",
"state": "1",
"category_id": "20",
"state": String(status.rawValue),
"category_id": categoryInfo.categoryId,
"status_all": "",
"keywork": "",
"template_cate_id": "",
......
......@@ -10,9 +10,25 @@ import UIKit
import JXSegmentedView
class YHCertificateCategoryItem {
var type : YHCertificateUploadStatus = .unknown
var title : String = ""
var type : YHCertificateUploadStatus = .all
var title : String {
switch type {
case .all:
return "全部".local
case .review:
return "审核中".local
case .rejected:
return "已驳回".local
case .preUpload:
return "待上传".local
case .finish:
return "已通过".local
}
}
init(type: YHCertificateUploadStatus) {
self.type = type
}
}
class YHMaterialListViewController: YHBaseViewController {
......@@ -20,7 +36,7 @@ class YHMaterialListViewController: YHBaseViewController {
static let segmentHeight = 53.0
var orderId : Int?
var categoryInfo: YHCategoryData = YHCategoryData()
lazy var navBar: YHCustomNavigationBar = {
let bar = YHCustomNavigationBar.navBar()
bar.title = "资料上传".local
......@@ -39,7 +55,12 @@ class YHMaterialListViewController: YHBaseViewController {
return bar
}()
let categoryItems = ["全部".local, "待上传".local, "已驳回".local, "审核中".local, "已通过".local]
var titles = ["全部".local, "待上传".local, "已驳回".local, "审核中".local, "已通过".local]
let categoryItems = [ YHCertificateCategoryItem(type: .all),
YHCertificateCategoryItem(type: .preUpload),
YHCertificateCategoryItem(type: .rejected),
YHCertificateCategoryItem(type: .review),
YHCertificateCategoryItem(type: .finish)]
var itemVCs:[YHCertificateResourceUploadVC] = []
lazy var segmentedView : JXSegmentedView = {
......@@ -59,7 +80,7 @@ class YHMaterialListViewController: YHBaseViewController {
lazy var segmentedDataSource: JXSegmentedBaseDataSource = {
let dataSource = JXSegmentedTitleDataSource()
dataSource.isTitleColorGradientEnabled = true
dataSource.titles = categoryItems
dataSource.titles = titles
dataSource.titleNormalFont = UIFont.PFSC_R(ofSize: 14)
dataSource.titleNormalColor = .labelTextColor2
dataSource.titleSelectedFont = UIFont.PFSC_M(ofSize: 16)
......@@ -95,8 +116,13 @@ class YHMaterialListViewController: YHBaseViewController {
super.viewDidLoad()
self.gk_navigationBar.isHidden = true
for _ in categoryItems {
titles.removeAll()
for item in categoryItems {
titles.append(item.title)
let vc = YHCertificateResourceUploadVC()
vc.orderId = orderId
vc.status = item.type
vc.categoryInfo = categoryInfo
itemVCs.append(vc)
}
view.addSubview(navBar)
......
......@@ -118,9 +118,8 @@ extension YHMineCertificateEntryViewController {
// MARK: - UITableViewDelegate 和 UITableViewDataSource
extension YHMineCertificateEntryViewController : UITableViewDelegate,UITableViewDataSource {
func numberOfSections(in tableView: UITableView) -> Int {
// guard let model = certificateReqVM.certificateEntryModel else { return 0 }
// return model.category_data.count
return 3
guard let model = certificateReqVM.certificateEntryModel else { return 0 }
return model.category_data.count
}
func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
......@@ -153,9 +152,11 @@ extension YHMineCertificateEntryViewController : UITableViewDelegate,UITableView
let cell0 = tableView.dequeueReusableCell(withClass: YHCertificateEntryCell.self)
cell0.selectionStyle = .none
// if indexPath.section < self.serviceCenterMainReqVM.arrContactList.count {
// cell0.dataModel = self.serviceCenterMainReqVM.arrContactList[indexPath.section]
// }
guard let model = certificateReqVM.certificateEntryModel else { return cell0 }
if indexPath.section < model.category_data.count {
cell0.dataModel = model.category_data[indexPath.section]
}
return cell0
}
......@@ -163,18 +164,13 @@ extension YHMineCertificateEntryViewController : UITableViewDelegate,UITableView
tableView.deselectRow(at: indexPath, animated: true)
printLog("点击了 tableView Cell \(indexPath.section)")
guard let model = certificateReqVM.certificateEntryModel else { return }
let vc = YHMaterialListViewController()
vc.orderId = orderId
if indexPath.section < model.category_data.count {
vc.categoryInfo = model.category_data[indexPath.section]
}
self.navigationController?.pushViewController(vc)
// //获取订单号
// let orderId = serviceCenterMainReqVM.arrContactList[indexPath.section].id
// UserDefaults.standard.set(orderId, forKey: "orderIdForPreview")
// UserDefaults.standard.synchronize()
//
// let vc = YHServiceCenterSecondViewController()
// vc.orderId = orderId
// self.navigationController?.pushViewController(vc)
}
}
......@@ -14,10 +14,10 @@ class YHUploadContentVC: YHBaseViewController {
var orderId : Int?
var viewModel: YHCertificateViewModel = YHCertificateViewModel()
var items:[String] = ["1", "2", "2", "2", "2", "2", "2", "2"]
var items:[YHContentUrl] = []
var renameInputView: YHFileRenameInputView = {
let view = YHFileRenameInputView.inputView(defalutText:"adfasfsf", editBlock: {
let view = YHFileRenameInputView.inputView(defalutText:"请输入名称", editBlock: {
text in
print("\(text)")
})
......@@ -149,7 +149,7 @@ extension YHUploadContentVC: UITableViewDelegate, UITableViewDataSource {
func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
let item = items[indexPath.row]
let cell = tableView.dequeueReusableCell(withIdentifier: YHCertificateNameCell.cellReuseIdentifier, for: indexPath)
let cell = tableView.dequeueReusableCell(withIdentifier: YHCertificateNameCell.cellReuseIdentifier, for: indexPath) as! YHCertificateNameCell
return cell
}
......@@ -293,16 +293,19 @@ extension YHUploadContentVC {
[weak self] listInfo, error in
guard let self = self else { return }
// items.removeAll()
// if let listInfo = listInfo {
// let arr = listInfo.supplementList
// items.append(contentsOf: arr)
// self.tableView.reloadData()
// }
//
// if let errorMsg = error?.errorMsg, errorMsg.count > 0 {
// YHHUD.flash(message: errorMsg, duration:3)
// }
items.removeAll()
if let listInfo = listInfo {
let arr = listInfo.supplementList
if let info = arr.first {
let arr = info.contentUrl
items.append(contentsOf: arr)
}
self.tableView.reloadData()
}
if let errorMsg = error?.errorMsg, errorMsg.count > 0 {
YHHUD.flash(message: errorMsg, duration:3)
}
}
}
}
......
......@@ -15,6 +15,11 @@ class YHCertificateEntryModel: SmartCodable {
var to_be_audit_num : Int = 0 //待审核
var to_be_submit_num : Int = 0 //待提交
var category_data : [YHCategoryData] = []
var sex : Int = 0 //1-男 2-女
var user_name : String = ""
required init() {
}
}
......@@ -34,10 +34,15 @@ class YHCategoryData: SmartCodable {
var categoryId: Int = 0
var checkStatus: Int = 0
var sex: String = ""
var userName: String = ""
enum CodingKeys: String, CodingKey {
case applicantName = "applicant_name"
case categoryId = "category_id"
case checkStatus = "check_status"
case sex = "sex"
case userName = "user_name"
}
required init() {
......
......@@ -49,8 +49,34 @@ class YHCertificateEntryCell: UITableViewCell {
extension YHCertificateEntryCell {
func updateUI() {
guard let dataModel = dataModel else { return }
contractNameLable.text = dataModel.applicantName
contractIdLable.text = String(dataModel.checkStatus)
var name = ""
if dataModel.userName.isEmpty == false {
name = "(" + dataModel.userName + ")"
}
contractNameLable.text = dataModel.applicantName + name
//0:未审核,1:通过 2:驳回,3:未提交',
var title = ""
var color : UIColor = .failColor
if dataModel.checkStatus == 0 {
title = "未审核"
color = UIColor.labelTextColor2
} else if dataModel.checkStatus == 1 {
title = "已完成"
color = UIColor.labelTextColor2
} else if dataModel.checkStatus == 2 {
title = "已驳回"
color = UIColor.failColor
} else if dataModel.checkStatus == 3 {
title = "待上传"
color = UIColor.brandMainColor
} else {
title = "--"
color = UIColor.brandMainColor
}
contractIdLable.text = title
contractIdLable.textColor = color
}
func setupUI() {
......
......@@ -84,8 +84,42 @@ private extension YHCertificateEntryHeadView {
}
func updateUI() {
guard let dataModel = dataModel else { return }
var tmp = ""
if dataModel.user_name.isEmpty {
tmp = "尊敬的用户"
} else {
tmp = dataModel.user_name
if dataModel.sex == 1 {
tmp = tmp + "先生"
} else if dataModel.sex == 2 {
tmp = tmp + "女士"
} else {
}
}
nameLable.text = "您好," + tmp
let a: ASAttributedString = .init("待上传", .font(UIFont.PFSC_R(ofSize: 13)),.foreground(UIColor.mainTextColor))
let aa: ASAttributedString = .init(NSAttributedString(string: String(dataModel.to_be_submit_num)), .font(UIFont.PFSC_B(ofSize: 17)),.foreground(UIColor.warnColor))
let b: ASAttributedString = .init("件,已驳回", .font(UIFont.PFSC_R(ofSize: 13)),.foreground(UIColor.mainTextColor))
let bb: ASAttributedString = .init(NSAttributedString(string: String(dataModel.reject_num)), .font(UIFont.PFSC_B(ofSize: 17)),.foreground(UIColor.warnColor))
let c: ASAttributedString = .init("件,审核中", .font(UIFont.PFSC_R(ofSize: 13)),.foreground(UIColor.mainTextColor))
let cc: ASAttributedString = .init(NSAttributedString(string: String(dataModel.to_be_audit_num)), .font(UIFont.PFSC_B(ofSize: 17)),.foreground(UIColor.warnColor))
let d: ASAttributedString = .init("件,已通过", .font(UIFont.PFSC_R(ofSize: 13)),.foreground(UIColor.mainTextColor))
let dd: ASAttributedString = .init(NSAttributedString(string: String(dataModel.pass_num)), .font(UIFont.PFSC_B(ofSize: 17)),.foreground(UIColor.warnColor))
let e: ASAttributedString = .init("件", .font(UIFont.PFSC_R(ofSize: 13)),.foreground(UIColor.mainTextColor))
statiticLable.attributed.text = a + aa + b + bb + c + cc + d + dd + e
}
}
......@@ -9,20 +9,13 @@
import UIKit
import AttributedString
enum YHCertificateUploadStatus : Int {
case unknown = 0
case preUpload = 1
case review = 2
case rejected = 3
case finish = 4
}
class YHCertificateInfoCell: UITableViewCell {
static let cellReuseIdentifier = "YHCertificateNameCell"
var status : YHCertificateUploadStatus = .unknown
var status : YHCertificateUploadStatus = .preUpload
var whiteView: UIView!
var nameTextView: UITextView!
var infoLabel: UILabel!
......@@ -50,23 +43,32 @@ class YHCertificateInfoCell: UITableViewCell {
setupUI()
}
func update() {
func updateModel(_ model: YHSupplementInfo) {
if let status = YHCertificateUploadStatus(rawValue: model.checkStatus) {
var titleColor: UIColor = .labelTextColor2
var title = ""
switch status {
case .preUpload:
titleColor = .brandMainColor
title = "待上传".local
case .rejected:
titleColor = .failColor
case .review, .finish:
title = "已驳回".local
case .review:
titleColor = .labelTextColor2
case .unknown:
title = "审核中".local
case .finish:
titleColor = .labelTextColor2
title = "已通过".local
case .all:
titleColor = .labelTextColor2
}
statusBtn.setTitleColor(titleColor, for:.normal)
statusBtn.setTitle(title, for: .normal)
}
func updateModel(_ model: YHSupplementInfo) {
if model.templateInfo.materialPath.isEmpty {
nameTextView.attributed.text = """
......@@ -120,7 +122,7 @@ class YHCertificateInfoCell: UITableViewCell {
statusBtn.imageEdgeInsets = UIEdgeInsets(top: 0, left: titleWidth, bottom: 0, right: -titleWidth)
statusBtn.setImage(UIImage(named:"my_cer_arrow_right"), for:.normal)
statusBtn.setTitle("待上传", for:.normal)
statusBtn.setTitleColor(.blue, for:.normal)
statusBtn.setTitleColor(.labelTextColor2, for:.normal)
whiteView.addSubview(statusBtn)
whiteView.snp.makeConstraints { make in
......
......@@ -28,6 +28,11 @@ class YHCertificateNameCell: UITableViewCell {
setupUI()
}
func updateModel(_ model: YHContentUrl) {
nameLabel.text = model.name
timeLabel.text = "上传于\(model.updatedAt)"
}
func setupUI() {
self.selectionStyle = .none
......
......@@ -10,6 +10,29 @@
import UIKit
import SmartCodable
enum YHCertificateCategoryId: Int {
// 子女
case child = 18
// 配偶
case spouse = 19
// 主申请人
case mainApplicant = 20
}
enum YHCertificateUploadStatus : Int {
// 全部
case all = -1
// 审核中
case review = 0
// 已完成
case finish = 1
// 审核中
case rejected = 2
// 待上传
case preUpload = 3
}
class YHCertificateViewModel: YHBaseViewModel {
var certificateEntryModel : YHCertificateEntryModel?
var arrQuestionAndAnswer : [YHQuestionAndAnswerModel?] = []
......@@ -66,6 +89,7 @@ class YHCertificateViewModel: YHBaseViewModel {
return
}
self.certificateEntryModel = resultModel
callBackBlock(true,nil)
} else {
let err = YHErrorModel(errorCode: Int32(json.code), errorMsg: json.msg.isEmpty ? "" : json.msg)
......
......@@ -86,7 +86,7 @@ class YHCertificateInfoController: YHBaseViewController, YHFamilyMemberProtol {
// 港澳通行证 非必须
if familyMember.isNeedHandleHKPassPort() {
let title1 = YHFormTitleItem(type: .hkAndMacaoPassport)
let item10 = YHFormDetailItem(type: .traverlPassportNumber, value: familyMember.certificates.hkMacaoPass.number, tips:"请输入旅行证件号码".local)
let item10 = YHFormDetailItem(type: .traverlPassportNumber, value: familyMember.certificates.hkMacaoPass.number, tips:"请输入证件号码".local)
let item11 = YHFormDetailItem(type: .certificateSignPlace, value: familyMember.certificates.hkMacaoPass.issueAt, tips:"请输入签发地".local)
let item12 = YHFormDetailItem(type: .certificateSignDate, value: familyMember.certificates.hkMacaoPass.issueDateStartAt, tips:"请选择签发日期".local)
let item13 = YHFormDetailItem(type: .certificateValidDate, value: familyMember.certificates.hkMacaoPass.issueDateEndAt, tips:"请选择届满日期".local)
......@@ -138,8 +138,35 @@ extension YHCertificateInfoController : UITableViewDelegate, UITableViewDataSour
let item:YHFormItemProtocol = arr[indexPath.row]
if item is YHFormTitleItem { // 标题
let titleItem = item as! YHFormTitleItem
let cell = tableView.dequeueReusableCell(withIdentifier: YHFormItemTitleCell.cellReuseIdentifier, for: indexPath) as! YHFormItemTitleCell
cell.setTitleAndSubTitle(title:item.getTitle())
var isNeedText = ""
if titleItem.type == .chinaIdCardInfo {
if let familyMember = familyMember {
let isChinaCardMust = familyMember.isChinese() && familyMember.relationType != .child
isNeedText = isChinaCardMust ? "(必填)" : "(选填)"
}
} else if titleItem.type == .hkAndMacaoPassport {
if let familyMember = familyMember {
isNeedText = familyMember.isNeedHandleHKPassPort() ? "(必填)" : "(选填)"
}
} else if titleItem.type == .passPortOrTravelInfo {
if let familyMember = familyMember {
let isPassPortMust = !familyMember.isChinese()
isNeedText = isPassPortMust ? "(必填)" : "(选填)"
}
}
var title = ""
if isNeedText.isEmpty {
title = item.getTitle()
} else {
title = "\(item.getTitle())\(isNeedText)"
}
cell.setTitleAndSubTitle(title: title)
return cell
}
......@@ -235,7 +262,8 @@ extension YHCertificateInfoController : UITableViewDelegate, UITableViewDataSour
[weak self] isLongTime in
guard let self = self else { return }
if title.type == .chinaIdCardInfo {
self.familyMember?.certificates.cnIdentityCard.issueDateEndAt = (isLongTime ? YHCNIdentityCard.longTime : "")
guard let familyMember = familyMember else { return }
familyMember.certificates.cnIdentityCard.issueDateEndAt = (isLongTime ? YHCNIdentityCard.longTime : familyMember.certificates.cnIdentityCard.lastIssueDateEndAt)
loadInfo()
save()
}
......
......@@ -85,10 +85,6 @@ class YHChildBasicInfoVC: YHBaseViewController, YHFamilyMemberProtol {
let item04 = YHFormDetailItem(type: .marriageState)
item04.value = child.married
item04.tips = "请选择婚姻状况".local
let item05 = YHFormDetailItem(type: .birthday)
item05.value = child.birthday
item05.tips = "请选择出生日期".local
item05.placeHolder = "请选择出生日期".local
let item06 = YHFormDetailItem(type: .birthNation)
item06.value = String(child.isBirthOverSeas())
item06.tips = "请选择出生国家/地区".local
......@@ -105,7 +101,7 @@ class YHChildBasicInfoVC: YHBaseViewController, YHFamilyMemberProtol {
item07.tips = "请选择出生城市".local
}
let arr0:[YHFormItemProtocol] = [title0, item00, item01, item02, item03, item04, item05, item06, item07]
let arr0:[YHFormItemProtocol] = [title0, item00, item01, item02, item03, item04, item06, item07]
// 职业信息
let title1 = YHFormTitleItem(type: .occupationInfo)
......@@ -122,7 +118,9 @@ class YHChildBasicInfoVC: YHBaseViewController, YHFamilyMemberProtol {
item11.placeHolder = "请输入职业名称".local
arr1.append(item11)
}
items.append(contentsOf: [arr0, arr1])
if child.isFollow() {
// 是否前次婚姻子女
let title2 = YHFormTitleItem(type: .isPreviousMarriageChild)
......@@ -130,6 +128,7 @@ class YHChildBasicInfoVC: YHBaseViewController, YHFamilyMemberProtol {
item20.value = String(child.isPreviousMarriageChild())
item20.tips = "请选择是否前次婚姻子女".local
let arr2:[YHFormItemProtocol] = [title2, item20]
items.append(arr2)
// 在港信息
let title3 = YHFormTitleItem(type: .inHongKongInfo)
......@@ -153,6 +152,9 @@ class YHChildBasicInfoVC: YHBaseViewController, YHFamilyMemberProtol {
arr3.append(contentsOf: [item31, item32])
}
items.append(arr3)
}
// 香港身份证
let title4 = YHFormTitleItem(type: .hkIdentityCardInfo)
......@@ -167,8 +169,7 @@ class YHChildBasicInfoVC: YHBaseViewController, YHFamilyMemberProtol {
item41.tips = "请输入香港身份证号".local
arr4.append(item41)
}
items.append(contentsOf: [arr0, arr1, arr2, arr3, arr4])
items.append(arr4)
tableView.reloadData()
}
......@@ -200,8 +201,7 @@ class YHChildBasicInfoVC: YHBaseViewController, YHFamilyMemberProtol {
{
return .inputText
}
if detailItem.type == .birthday
|| detailItem.type == .occupation
if detailItem.type == .occupation
|| detailItem.type == .stayHKDate
|| detailItem.type == .roleInHK
|| detailItem.type == .ownDegree
......@@ -445,31 +445,15 @@ extension YHChildBasicInfoVC : UITableViewDelegate, UITableViewDataSource {
if item is YHFormDetailItem {
let detailItem = item as! YHFormDetailItem
if detailItem.type == .birthday || detailItem.type == .stayHKDate { // 出生日期/获准滞留至
if detailItem.type == .stayHKDate { // 出生日期/获准滞留至
var title = ""
if detailItem.type == .birthday {
title = "选择出生日期"
} else if detailItem.type == .stayHKDate {
if detailItem.type == .stayHKDate {
title = "选择逗留日期"
}
YHDatePickView.show(type: .yyyymmdd, title:title) { [weak self] dateStr in
guard let self = self else { return }
if detailItem.type == .birthday {
let format = DateFormatter()
format.dateFormat = "yyyy-MM-dd"
if let selectDate = format.date(from:dateStr) {
let selectTimeInterval = selectDate.timeIntervalSince1970
let currentTimeInterval = Date().timeIntervalSince1970
// 出生日期须早于当前日期
if selectTimeInterval > currentTimeInterval {
YHHUD.flash(message: "出生日期须早于当前日期".local)
return
}
}
self.child?.birthday = dateStr
} else if detailItem.type == .stayHKDate {
if detailItem.type == .stayHKDate {
self.child?.childInHk.info = dateStr
}
loadInfo()
......@@ -574,8 +558,7 @@ extension YHChildBasicInfoVC {
guard let child = child else { return false}
if isEmptyString(child.subsetName)
|| child.sex == 0
|| isEmptyString(child.married)
|| isEmptyString(child.birthday){
|| isEmptyString(child.married){
return false
}
......@@ -597,11 +580,13 @@ extension YHChildBasicInfoVC {
return false
}
if child.isFollow() {
if child.isNowInHK() {
if isEmptyString(child.childInHk.info) || isEmptyString(child.hkIdentity) {
return false
}
}
}
if child.isHaveHKIdentityCard() {
if isEmptyString(child.hkIdentityCard) {
......
......@@ -406,7 +406,7 @@ extension YHChildPrimaryInfoVC : UITableViewDelegate, UITableViewDataSource {
// 子女选择年满18岁则【是否随行至香港】默认选择否,不可修改
// 如果未年满18岁则【是否随行至香港】可选择【是/否】,可修改
YHDatePickView.show(type: .yyyymmdd) { [weak self] date in
YHDatePickView.show(type: .yyyymmdd, title:"选择出生日期".local) { [weak self] date in
guard let self = self else { return }
if detailItem.type == .birthday {
......
......@@ -143,7 +143,7 @@ class YHSpouseBasicInfoVC: YHBaseViewController, YHFamilyMemberProtol {
let item20 = YHFormDetailItem(type: .ownDegree)
item20.placeHolder = "请选择".local
item20.value = spouse.hasDegreeName()
item20.tips = "请选择".local
item20.tips = "请选择是否拥有学位".local
var arr2:[YHFormItemProtocol] = [title2, item20]
......@@ -163,16 +163,15 @@ class YHSpouseBasicInfoVC: YHBaseViewController, YHFamilyMemberProtol {
let item = YHFormAddItem(type: .addDegree)
arr2.append(item)
}
items.append(contentsOf: [arr0, arr1, arr2])
if spouse.isFollow() {
// 在港信息
let title3 = YHFormTitleItem(type: .inHongKongInfo)
let item30 = YHFormDetailItem(type: .isNowInHK)
item30.value = String(spouse.isNowInHK())
var arr3:[YHFormItemProtocol] = [title3, item30]
if spouse.isNowInHK() { // 目前在港才显示 逗留期限和在港身份
let item31 = YHFormDetailItem(type: .stayHKDate)
item31.placeHolder = "请选择".local
......@@ -186,6 +185,9 @@ class YHSpouseBasicInfoVC: YHBaseViewController, YHFamilyMemberProtol {
arr3.append(contentsOf: [item31, item32])
}
items.append(arr3)
}
// 香港身份证
let title4 = YHFormTitleItem(type: .hkIdentityCardInfo)
......@@ -199,7 +201,7 @@ class YHSpouseBasicInfoVC: YHBaseViewController, YHFamilyMemberProtol {
item41.tips = "请输入正确的香港身份证号码".local
arr4.append(item41)
}
items.append(contentsOf: [arr0, arr1, arr2, arr3, arr4])
items.append(arr4)
tableView.reloadData()
}
......@@ -233,6 +235,10 @@ class YHSpouseBasicInfoVC: YHBaseViewController, YHFamilyMemberProtol {
return false
}
if spouse.hasDegree.isEmpty {
return false
}
if spouse.isHaveDegree() { // 选择了有学位
if !spouse.hasDegreeJson.isEmpty {
for degreeInfo in spouse.hasDegreeJson {
......@@ -243,11 +249,13 @@ class YHSpouseBasicInfoVC: YHBaseViewController, YHFamilyMemberProtol {
}
}
if spouse.isFollow() {
if spouse.isNowInHK() {
if isEmptyString(spouse.childInHk.info) || isEmptyString(spouse.hkIdentity) {
return false
}
}
}
if spouse.isHaveHKIdentityCard() {
if isEmptyString(spouse.hkIdentityCard) {
......
......@@ -265,7 +265,7 @@ class YHFormTitleItem : YHFormItemProtocol {
case .chinaIdCardInfo:
return "中国身份证".local
case .passPortOrTravelInfo:
return String(format: "%@(%@)", "护照及其他旅行证件".local, "选填".local)
return "护照及其他旅行证件".local
case .spouseInfo:
return "配偶信息".local
case .occupationInfo:
......@@ -432,7 +432,7 @@ class YHFormDetailItem : YHFormItemProtocol {
case .chinaIdentityCardNumber:
return "中国身份证号".local
case .traverlPassportNumber:
return "旅行证件号码".local
return "证件号码".local
case .certificateSignDate:
return "签发日期".local
case .certificateValidDate:
......@@ -645,9 +645,9 @@ class YHFamilyMember: SmartCodable, YHFormItemProtocol {
func checkDefaultValue() -> Self {
if hasDegree.isEmpty { // 默认无学位
hasDegree = "0"
}
// if hasDegree.isEmpty { // 默认无学位
// hasDegree = "0"
// }
if childHasHkId.has.isEmpty { // 默认未办理过香港身份证
childHasHkId.has = "N"
}
......@@ -798,9 +798,11 @@ class YHFamilyMember: SmartCodable, YHFormItemProtocol {
func hasDegreeName() -> String {
if hasDegree == "1" {
return "有学位".local
}
} else if hasDegree == "0" {
return "无学位".local
}
return ""
}
func isHaveDegree() ->Bool {
return self.hasDegree == "1"
......@@ -1070,7 +1072,14 @@ class YHCNIdentityCard: SmartCodable {
var number: String = ""
var issueAt: String = ""
var issueDateStartAt: String = ""
var issueDateEndAt: String = ""
var issueDateEndAt: String = "" {
didSet {
if !issueDateEndAt.isEmpty && issueDateEndAt != Self.longTime {
lastIssueDateEndAt = issueDateEndAt
}
}
}
var lastIssueDateEndAt: String = ""
var imgFront: String = ""
var imgBack: String = ""
var passPortType: Int = 0
......
......@@ -175,8 +175,8 @@ class YHSheetPickerView: UIView {
// 婚姻
.marriage:
[YHSheetPickerViewItem(title:"未婚".local, index:0),
YHSheetPickerViewItem(title:"已婚".local, index:1),
[YHSheetPickerViewItem(title:"已婚".local, index:1),
YHSheetPickerViewItem(title:"未婚".local, index:0),
YHSheetPickerViewItem(title:"分居".local, index:2),
YHSheetPickerViewItem(title:"离婚".local, index:3),
YHSheetPickerViewItem(title:"丧偶".local, index:4),
......@@ -186,7 +186,8 @@ class YHSheetPickerView: UIView {
.educationStyle:
[YHSheetPickerViewItem(title:"全日制".local, index:0),
YHSheetPickerViewItem(title:"兼职制".local, index:1),
YHSheetPickerViewItem(title:"遥距课程".local, index:2),
YHSheetPickerViewItem(title:"全日制(遥距课程)".local, index:2),
YHSheetPickerViewItem(title:"兼职制(遥距课程)".local, index:3),
],
// 职业
......@@ -360,7 +361,7 @@ extension YHSheetPickerView {
case .marriage:
return "选择婚姻状况"
case .educationStyle:
return "选择学位"
return "选择授课形式"
case .occupation:
return "选择职业"
case .gender:
......
......@@ -15,7 +15,7 @@ class YHFormItemExpireDateCell: UITableViewCell {
private let horizonalGap = 18.0
private let detailColor = UIColor.mainTextColor
private let placeHolderColor = UIColor.placeHolderColor
let longTimeBtnWidth = 40.0
let longTimeBtnWidth = 44.0
// 是否必填 如必填title会展示红色*
var isMust = false
var placeHolder:String? = "请选择"
......@@ -91,6 +91,12 @@ class YHFormItemExpireDateCell: UITableViewCell {
btn.iconInLeft(spacing: 6)
btn.setImage(UIImage(named: "form_square_unselect"), for: .normal)
btn.setImage(UIImage(named: "form_square_select"), for: .selected)
return btn
}()
// 增大点击区域
lazy var longAreaBtn: UIButton = {
let btn = UIButton()
btn.addTarget(self, action: #selector(didClickLongTimeBtn), for: .touchUpInside)
return btn
}()
......@@ -130,6 +136,7 @@ class YHFormItemExpireDateCell: UITableViewCell {
contentView.addSubview(titleLabel)
contentView.addSubview(detailLabel)
contentView.addSubview(longTimeBtn)
contentView.addSubview(longAreaBtn)
contentView.addSubview(tipsLabel)
contentView.addSubview(topLine)
......@@ -151,6 +158,11 @@ class YHFormItemExpireDateCell: UITableViewCell {
make.centerY.equalTo(titleLabel)
}
longAreaBtn.snp.makeConstraints { make in
make.center.equalTo(longTimeBtn.snp.center)
make.size.equalTo(CGSizeMake(longTimeBtnWidth+20, 40))
}
topLine.snp.makeConstraints { make in
make.left.equalToSuperview().offset(horizonalGap)
make.right.equalToSuperview().offset(-horizonalGap)
......
......@@ -170,6 +170,8 @@ class YHFormItemSelectSheetCell: UITableViewCell {
}
setTips("", isShow: false)
tipsButton.YH_clickEdgeInsets = UIEdgeInsets(top: 20, left: 20, bottom: 20, right: 20)
}
@objc func didTipsButtonClicked() {
......
......@@ -504,7 +504,7 @@ extension YHItemView: UITextFieldDelegate {
return false
}
if (dataSource?.id == .id12 || dataSource?.id == .id17 || dataSource?.id == .id30 ||
if (dataSource?.id == .id12 || dataSource?.id == .id17 ||
dataSource?.id == .id9 || dataSource?.id == .id13 || dataSource?.id == .id18) && newText.count > 50 {
return false
}
......
......@@ -973,7 +973,7 @@ private extension YHPreviewViewModel {
//配偶信息
let tmp0 = YHPreviewQuestionAndAnswerModel(question: "配偶姓名:", answer: model.subsetName)
let tmp1 = YHPreviewQuestionAndAnswerModel(question: "曾用名:", answer: model.usedName.defaultStringIfEmpty())
let tmp2 = YHPreviewQuestionAndAnswerModel(question: "婚前姓氏:", answer: model.surname)
let tmp2 = YHPreviewQuestionAndAnswerModel(question: "婚前姓氏:", answer: model.surname.defaultStringIfEmpty())
let tmp3 = YHPreviewQuestionAndAnswerModel(question: "出生日期:", answer: model.birthday)
var city = ""
if model.birthPlaceAboard == 0 {
......@@ -1006,9 +1006,9 @@ private extension YHPreviewViewModel {
let addationIndex = model.hasDegreeJson.count > 1 ? String(index + 1) : ""
let title = "学位证" + addationIndex + ":"
let tmp8 = YHPreviewQuestionAndAnswerModel(question: title, answer: item.degree)
let tmp8 = YHPreviewQuestionAndAnswerModel(question: title, answer: YHConstantArrayData.getShowNameBy(indexStr: item.degree, type: .degree))
arr.append(tmp8)
let tmp9 = YHPreviewQuestionAndAnswerModel(question: "学位证颁发地区:", answer: item.address)
let tmp9 = YHPreviewQuestionAndAnswerModel(question: "学位证颁发地区:", answer: YHConstantArrayData.getShowNameBy(indexStr: item.address, type: .degreeAddress))
arr.append(tmp9)
}
}
......@@ -1083,7 +1083,7 @@ private extension YHPreviewViewModel {
//配偶信息-否
let tmp0 = YHPreviewQuestionAndAnswerModel(question: "配偶姓名:", answer: model.subsetName)
let tmp1 = YHPreviewQuestionAndAnswerModel(question: "曾用名:", answer: model.usedName.defaultStringIfEmpty())
let tmp2 = YHPreviewQuestionAndAnswerModel(question: "婚前姓氏:", answer: model.surname)
let tmp2 = YHPreviewQuestionAndAnswerModel(question: "婚前姓氏:", answer: model.surname.defaultStringIfEmpty())
let tmp3 = YHPreviewQuestionAndAnswerModel(question: "出生日期:", answer: model.birthday)
var city = ""
if model.birthPlaceAboard == 0 {
......@@ -1254,7 +1254,7 @@ private extension YHPreviewViewModel {
//子女信息
let tmp0 = YHPreviewQuestionAndAnswerModel(question: "子女姓名:", answer: model.subsetName)
let tmp1 = YHPreviewQuestionAndAnswerModel(question: "曾用名:", answer: model.usedName.defaultStringIfEmpty())
let tmp2 = YHPreviewQuestionAndAnswerModel(question: "婚前姓氏:", answer: model.surname)
let tmp2 = YHPreviewQuestionAndAnswerModel(question: "婚前姓氏:", answer: model.surname.defaultStringIfEmpty())
let sexStr = YHConstantArrayData.getShowNameBy(indexStr: String(model.sex), type: .sex)
let tmp22 = YHPreviewQuestionAndAnswerModel(question: "性别:", answer: sexStr)
......
......@@ -31,6 +31,10 @@ enum YHOtherPickerViewType: Int {
case sex
// 婚姻状况
case marry
//学位
case degree
//学位地址
case degreeAddress
}
......@@ -323,7 +327,7 @@ class YHConstantArrayData {
]
]
//婚姻状态
static let arrMarry : [[String : String]] = [
["title": "已婚",
"id": "1"
......@@ -342,6 +346,28 @@ class YHConstantArrayData {
]
]
//学位
static let arrDegree = [
[
"id":"1",
"title" : "学士学位",
],
[
"id" : "2",
"title" : "硕士学位",
],
[
"id" : "3",
"title" : "博士学位",
],
]
//学位颁发地
static let arrDegreeAddress = [
[ "id": "0", "title": "国内(颁发)" ],
[ "id": "1", "title": "国外(颁发)" ],
]
//通过 id 获取 title
static func getShowNameBy(indexStr:String,type : YHOtherPickerViewType) -> String {
if indexStr.isEmpty {
......@@ -359,6 +385,10 @@ class YHConstantArrayData {
arrData = YHConstantArrayData.arrStructure
case .level:
arrData = YHConstantArrayData.arrLevel
case .degree:
arrData = YHConstantArrayData.arrDegree
case .degreeAddress:
arrData = YHConstantArrayData.arrDegreeAddress
default:
arrData = [[:]]
}
......
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