Commit 223f6186356ce0e7ea5d3771b8133ad31d5d54a6

Authored by “张旭”
1 parent b2907526

证书数据关联 , 上传证书等页面

Showing 24 changed files with 1182 additions and 4 deletions
metaCode.xcodeproj/project.pbxproj
... ... @@ -83,6 +83,10 @@
83 83 192ED4742C521F4D0057244C /* CNLiveVocationalCertifiteCollectionViewLayout.swift in Sources */ = {isa = PBXBuildFile; fileRef = 192ED4732C521F4D0057244C /* CNLiveVocationalCertifiteCollectionViewLayout.swift */; };
84 84 192ED4762C524EA10057244C /* CNLiveVitaeCertificateModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 192ED4752C524EA10057244C /* CNLiveVitaeCertificateModel.swift */; };
85 85 192ED4782C5339D50057244C /* CNLiveCertificateCollectionCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 192ED4772C5339D50057244C /* CNLiveCertificateCollectionCell.swift */; };
  86 + 192ED47A2C5383340057244C /* CNLiveVitaeAddCertificateController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 192ED4792C5383340057244C /* CNLiveVitaeAddCertificateController.swift */; };
  87 + 192ED47C2C538C970057244C /* CNLiveVitaeCertificateAddPhotoCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 192ED47B2C538C970057244C /* CNLiveVitaeCertificateAddPhotoCell.swift */; };
  88 + 192ED47E2C538CA30057244C /* CNLiveVitaeCertificateAddInfoCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 192ED47D2C538CA30057244C /* CNLiveVitaeCertificateAddInfoCell.swift */; };
  89 + 192ED4802C5488AD0057244C /* CNLiveVitaeCerAddPhotoController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 192ED47F2C5488AD0057244C /* CNLiveVitaeCerAddPhotoController.swift */; };
86 90 1938BD172B3D6C7F00390A34 /* CNLiveAuthViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1938BD162B3D6C7F00390A34 /* CNLiveAuthViewController.swift */; };
87 91 1938BD202B46799A00390A34 /* CNLivePlayletHomePageController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1938BD1F2B46799A00390A34 /* CNLivePlayletHomePageController.swift */; };
88 92 1938BD222B467C1700390A34 /* CNLivePlayletHomePageCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1938BD212B467C1700390A34 /* CNLivePlayletHomePageCell.swift */; };
... ... @@ -408,6 +412,10 @@
408 412 192ED4732C521F4D0057244C /* CNLiveVocationalCertifiteCollectionViewLayout.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CNLiveVocationalCertifiteCollectionViewLayout.swift; sourceTree = "<group>"; };
409 413 192ED4752C524EA10057244C /* CNLiveVitaeCertificateModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CNLiveVitaeCertificateModel.swift; sourceTree = "<group>"; };
410 414 192ED4772C5339D50057244C /* CNLiveCertificateCollectionCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CNLiveCertificateCollectionCell.swift; sourceTree = "<group>"; };
  415 + 192ED4792C5383340057244C /* CNLiveVitaeAddCertificateController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CNLiveVitaeAddCertificateController.swift; sourceTree = "<group>"; };
  416 + 192ED47B2C538C970057244C /* CNLiveVitaeCertificateAddPhotoCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CNLiveVitaeCertificateAddPhotoCell.swift; sourceTree = "<group>"; };
  417 + 192ED47D2C538CA30057244C /* CNLiveVitaeCertificateAddInfoCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CNLiveVitaeCertificateAddInfoCell.swift; sourceTree = "<group>"; };
  418 + 192ED47F2C5488AD0057244C /* CNLiveVitaeCerAddPhotoController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CNLiveVitaeCerAddPhotoController.swift; sourceTree = "<group>"; };
411 419 1938BD162B3D6C7F00390A34 /* CNLiveAuthViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CNLiveAuthViewController.swift; sourceTree = "<group>"; };
412 420 1938BD1F2B46799A00390A34 /* CNLivePlayletHomePageController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CNLivePlayletHomePageController.swift; sourceTree = "<group>"; };
413 421 1938BD212B467C1700390A34 /* CNLivePlayletHomePageCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CNLivePlayletHomePageCell.swift; sourceTree = "<group>"; };
... ... @@ -781,6 +789,8 @@
781 789 192ED46F2C5217CF0057244C /* CNLiveVocationalCertificateFirCell.swift */,
782 790 192ED4732C521F4D0057244C /* CNLiveVocationalCertifiteCollectionViewLayout.swift */,
783 791 192ED4772C5339D50057244C /* CNLiveCertificateCollectionCell.swift */,
  792 + 192ED47B2C538C970057244C /* CNLiveVitaeCertificateAddPhotoCell.swift */,
  793 + 192ED47D2C538CA30057244C /* CNLiveVitaeCertificateAddInfoCell.swift */,
784 794 );
785 795 path = Vitae;
786 796 sourceTree = "<group>";
... ... @@ -1166,6 +1176,8 @@
1166 1176 192ED4642C4DF6340057244C /* CNLiveDigitalResumeInfoSelectAddressController.swift */,
1167 1177 192ED4662C4F47E50057244C /* CNLiveSelectHangYeController.swift */,
1168 1178 192ED46C2C51FA360057244C /* CNLiveVitaeVocationalCertificateController.swift */,
  1179 + 192ED4792C5383340057244C /* CNLiveVitaeAddCertificateController.swift */,
  1180 + 192ED47F2C5488AD0057244C /* CNLiveVitaeCerAddPhotoController.swift */,
1169 1181 );
1170 1182 path = DigitalAuth;
1171 1183 sourceTree = "<group>";
... ... @@ -1984,6 +1996,7 @@
1984 1996 1938BD172B3D6C7F00390A34 /* CNLiveAuthViewController.swift in Sources */,
1985 1997 19864E412BF6090400586E72 /* CNLiveDuanJuDetailCell.swift in Sources */,
1986 1998 79F4B11C2A33036E00993C03 /* CNLiveMineInfoAlertView.swift in Sources */,
  1999 + 192ED47C2C538C970057244C /* CNLiveVitaeCertificateAddPhotoCell.swift in Sources */,
1987 2000 79BB96A82AF223FB00AEA4AC /* CNLiveConfigAlertManager.swift in Sources */,
1988 2001 19BB1FF02AF0E5B30094D962 /* CNLiveShopDetailModel.swift in Sources */,
1989 2002 1938BD382B4BDC2500390A34 /* CNLiveAlbumImageCell.swift in Sources */,
... ... @@ -2096,6 +2109,7 @@
2096 2109 19B153CB2BC3E1870018906C /* CNLiveShopPayController.swift in Sources */,
2097 2110 191733662B39237D007BCC04 /* CNLiveShopGoodsManageListTableViewCell.swift in Sources */,
2098 2111 793CAF522A58FCA200882EF4 /* CNLiveMineExchangeViewController.swift in Sources */,
  2112 + 192ED4802C5488AD0057244C /* CNLiveVitaeCerAddPhotoController.swift in Sources */,
2099 2113 1917334E2B2C1A08007BCC04 /* CNLiveSelectCouponTapView.swift in Sources */,
2100 2114 19C0F76F2BDB4CE10097CC8F /* CNBindingManageModel.swift in Sources */,
2101 2115 191733272B148BB1007BCC04 /* CNLivePlayerFastForwardPreviewView.swift in Sources */,
... ... @@ -2193,6 +2207,7 @@
2193 2207 79396EED2A319F220053E1AF /* NSObject+CNLiveExtensions.swift in Sources */,
2194 2208 1917331B2B10A0EF007BCC04 /* CNLivePlayerLoadingView.swift in Sources */,
2195 2209 19FA201B2AE60423001F7186 /* CNLiveDownSlideModelLayout.swift in Sources */,
  2210 + 192ED47E2C538CA30057244C /* CNLiveVitaeCertificateAddInfoCell.swift in Sources */,
2196 2211 7C4931312A2F142F000E44B4 /* CNHomePageBackgroupView.swift in Sources */,
2197 2212 19BB1FF22AF21A950094D962 /* CNLliveShopDetailBannerCell.swift in Sources */,
2198 2213 1938BD432B4E34B200390A34 /* CNHomepageDuanJuDetailViewController.swift in Sources */,
... ... @@ -2259,6 +2274,7 @@
2259 2274 191733192B10A05D007BCC04 /* CNLivePlayerProgressView.swift in Sources */,
2260 2275 79803E272AD68D3100F05F68 /* CNLiveMineShopViewController.swift in Sources */,
2261 2276 197325D22BB11C18002E41A3 /* DatabaseManager.swift in Sources */,
  2277 + 192ED47A2C5383340057244C /* CNLiveVitaeAddCertificateController.swift in Sources */,
2262 2278 79803E292AD6991200F05F68 /* CNLiveMineInputMessageView.swift in Sources */,
2263 2279 79282A462A2F457D00B5F8CF /* CNLiveMineViewController.swift in Sources */,
2264 2280 19AB90642BB412C700B6A79B /* CNLiveDownslideOperationManager.swift in Sources */,
... ...
metaCode/Classes/Main/HomePage/Controller/DigitalAuth/CNLiveDigitalResumeController.swift
... ... @@ -20,6 +20,8 @@ enum CNLiveResumeType {
20 20 class CNLiveDigitalResumeController:CNLiveBaseViewController,UITableViewDataSource, UITableViewDelegate{
21 21  
22 22 var resumeType:CNLiveResumeType = .normal
  23 + var certificatesCount:Int = 0//证书数量
  24 +
23 25 //简历model
24 26 var vitaeModel:CNLiveVitaeModel?
25 27 lazy var moreNavBtn: UIButton = {
... ... @@ -67,6 +69,7 @@ class CNLiveDigitalResumeController:CNLiveBaseViewController,UITableViewDataSour
67 69 override func viewWillAppear(_ animated: Bool) {
68 70 super.viewWillAppear(animated)
69 71 self.getVitae()
  72 + self.getCetList()
70 73 }
71 74  
72 75 override func viewDidLoad() {
... ... @@ -117,6 +120,7 @@ class CNLiveDigitalResumeController:CNLiveBaseViewController,UITableViewDataSour
117 120 let cell = CNLiveDigitalResumeCell()
118 121 return cell
119 122 }
  123 + cell.certificatesCount = self.certificatesCount
120 124 if self.vitaeModel?.vitae?.id ?? 0 > 0{
121 125 cell.vitaeModel = self.vitaeModel!
122 126 }
... ... @@ -150,6 +154,21 @@ class CNLiveDigitalResumeController:CNLiveBaseViewController,UITableViewDataSour
150 154 self.show17Alert()
151 155 }
152 156  
  157 + // MARK: - 获取证书数量
  158 + func getCetList(){
  159 + let vsid = UserInfoManager.shared.userInfo.currentUser?.vsid ?? ""
  160 + CNLiveVitaeViewModel.getCerList(vsid: vsid, page: 1, pageSize: 100){ result, respStatue in
  161 + if respStatue == .success{
  162 + if let res = result as? [CNLiveVitaeCertificateModel]{
  163 + self.certificatesCount = res.count
  164 + self.tableView.reloadData()
  165 + }
  166 + }else{
  167 + showMessage(message: "数据异常")
  168 + }
  169 +
  170 + }
  171 + }
153 172 // MARK: - 获取简历数据
154 173 func getVitae(){
155 174  
... ...
metaCode/Classes/Main/HomePage/Controller/DigitalAuth/CNLiveVitaeAddCertificateController.swift 0 → 100644
  1 +//
  2 +// CNLiveVitaeAddCertificateController.swift
  3 +// metaCode
  4 +//
  5 +// Created by zx on 2024/7/26.
  6 +// 数字简历-添加证书页面
  7 +
  8 +import Foundation
  9 +import SnapKit
  10 +
  11 +class CNLiveVitaeAddCertificateController:CNLiveBaseViewController,UITableViewDataSource, UITableViewDelegate{
  12 +
  13 + var isAddCerPhoto = true//true为增加证书图片 false为增加证书信息
  14 + var seleImage:UIImage?
  15 + var seleImageUrl:String = ""
  16 + lazy var dataArray :NSMutableArray = {
  17 + let dataArray = NSMutableArray()
  18 + return dataArray
  19 + }()
  20 +
  21 + let kCNLiveVitaeCertificateAddPhotoCellIdentifier = "kCNLiveVitaeCertificateAddPhotoCellIdentifier"
  22 + let kCNLiveVitaeCertificateAddInfoCellIdentifier = "kCNLiveVitaeCertificateAddInfoCellIdentifier"
  23 +
  24 + lazy var tableView : UITableView = {
  25 + let tableView = UITableView(frame: .zero, style: .plain)
  26 + tableView.dataSource = self
  27 + tableView.delegate = self
  28 + tableView.separatorStyle = .none
  29 + tableView.tableFooterView = UIView.init()
  30 + tableView.register(CNLiveVitaeCertificateAddPhotoCell.self, forCellReuseIdentifier: kCNLiveVitaeCertificateAddPhotoCellIdentifier)
  31 + tableView.register(CNLiveVitaeCertificateAddInfoCell.self, forCellReuseIdentifier: kCNLiveVitaeCertificateAddInfoCellIdentifier)
  32 + tableView.backgroundColor = .clear
  33 + return tableView
  34 + }()
  35 + lazy var bottomZhiNanWhiteView :UIView = {
  36 + let bottomNavView = UIView()
  37 + bottomNavView.backgroundColor = .white
  38 + return bottomNavView
  39 + }()
  40 + lazy var addCertificateBtn: UIButton = {
  41 + let nextBtn = UIButton(type: .custom)
  42 + nextBtn.setTitle("确认提交", for: .normal)
  43 + nextBtn.setTitleColor(.white, for: .normal)
  44 + nextBtn.backgroundColor = HexColor("#1961FE")
  45 + nextBtn.layer.cornerRadius = 20
  46 + nextBtn.clipsToBounds = true
  47 + nextBtn.addTarget(self, action: #selector(addCertificateBtnAction), for: .touchUpInside)
  48 + return nextBtn
  49 + }()
  50 + lazy var chengNuoTitleLabel: UILabel = {
  51 + let titleLabel = UILabel()
  52 + titleLabel.textColor = HexColor("#B4B4B4")
  53 + titleLabel.textAlignment = .center
  54 + titleLabel.numberOfLines = 2
  55 + titleLabel.text = "我承诺以上所填写资料均完全真实,如被证实有虚假成分,本人愿意承担一切责任"
  56 + titleLabel.font = Font_12
  57 + return titleLabel
  58 + }()
  59 +
  60 + override func viewDidLoad() {
  61 + super.viewDidLoad()
  62 + titleName = "个人证书"
  63 + navigationBarHidden = false
  64 + self.initUI()
  65 + }
  66 +
  67 + deinit {}
  68 + func initUI(){
  69 + self.view.backgroundColor = HexColor("#F9F9F9")
  70 +
  71 + self.view.addSubview(self.tableView)
  72 + self.tableView.snp.makeConstraints { make in
  73 + make.top.equalTo(KNavigationHeight)
  74 + make.left.right.equalToSuperview()
  75 + make.height.equalToSuperview().offset(-KNavigationHeight-60-63)
  76 + }
  77 +
  78 + self.view.addSubview(self.chengNuoTitleLabel)
  79 + self.chengNuoTitleLabel.snp.makeConstraints { make in
  80 + make.top.equalTo(self.tableView.snp.bottom).offset(15)
  81 + make.left.equalTo(15)
  82 + make.right.equalToSuperview().offset(-15)
  83 + make.bottom.equalToSuperview().offset(-75)
  84 + }
  85 +
  86 + self.view.addSubview(self.bottomZhiNanWhiteView)
  87 + self.bottomZhiNanWhiteView.snp.makeConstraints { make in
  88 + make.height.equalTo(60)
  89 + make.bottom.left.right.equalToSuperview()
  90 + }
  91 + self.bottomZhiNanWhiteView.isHidden = true
  92 +
  93 + self.bottomZhiNanWhiteView.addSubview(self.addCertificateBtn)
  94 + self.addCertificateBtn.snp.makeConstraints { make in
  95 + make.left.equalTo(15)
  96 + make.right.equalToSuperview().offset(-15)
  97 + make.top.equalTo(10)
  98 + make.height.equalTo(40)
  99 + }
  100 +
  101 +
  102 + }
  103 +
  104 + func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
  105 + return 1
  106 + }
  107 +
  108 + func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
  109 + if self.isAddCerPhoto == true{
  110 + guard let cell = tableView.dequeueReusableCell(withIdentifier: kCNLiveVitaeCertificateAddPhotoCellIdentifier) as? CNLiveVitaeCertificateAddPhotoCell
  111 + else {
  112 + let cell = CNLiveVitaeCertificateAddPhotoCell()
  113 + return cell
  114 + }
  115 + cell.selectImageBlock = { image,key,url in
  116 + self.isAddCerPhoto = false
  117 + self.tableView.reloadData()
  118 + self.seleImage = image
  119 + self.seleImageUrl = url
  120 + self.bottomZhiNanWhiteView.isHidden = false
  121 + }
  122 + return cell
  123 + }else{
  124 + guard let cell = tableView.dequeueReusableCell(withIdentifier: kCNLiveVitaeCertificateAddInfoCellIdentifier) as? CNLiveVitaeCertificateAddInfoCell
  125 + else {
  126 + let cell = CNLiveVitaeCertificateAddInfoCell()
  127 + return cell
  128 + }
  129 + cell.uploadImage = self.seleImage
  130 + cell.tfReturnBlock = {
  131 + self.view.endEditing(true)
  132 + }
  133 + return cell
  134 + }
  135 + }
  136 +
  137 + func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
  138 +
  139 + }
  140 +
  141 + func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat {
  142 + if isAddCerPhoto == true{
  143 + return 351
  144 + }else{
  145 + return 620
  146 + }
  147 + }
  148 +
  149 + //确认提交证书
  150 + @objc func addCertificateBtnAction(){
  151 + let cell = self.tableView.cellForRow(at: IndexPath(row: 0, section: 0)) as! CNLiveVitaeCertificateAddInfoCell
  152 + //判断非空
  153 + if self.seleImage == nil{
  154 + showMessage(message: "请上传图片")
  155 + return
  156 + }
  157 + if cell.cerNameTF.text?.count == 0{
  158 + showMessage(message: "请填写证书名称")
  159 + return
  160 + }
  161 + if cell.cerNumberTF.text?.count == 0{
  162 + showMessage(message: "请填写资格证编号")
  163 + return
  164 + }
  165 + if cell.cerJiGouTF.text?.count == 0{
  166 + showMessage(message: "请填写发证机构")
  167 + return
  168 + }
  169 + let vsid = UserInfoManager.shared.userInfo.currentUser?.vsid ?? ""
  170 + //提交证书
  171 + CNLiveVitaeViewModel.saveCertificate(img: self.seleImageUrl, lv: cell.cerLevelTF.text ?? "", number: cell.cerNumberTF.text ?? "", organization: cell.cerJiGouTF.text ?? "", time: cell.cerTimeTF.text ?? "", title: cell.cerNameTF.text ?? "", uploadTime: "", validity: cell.cerYouXiaoTF.text ?? "", vsid: vsid){result, respStatue in
  172 + if respStatue == .success{
  173 + self.navigationController?.viewControllers.forEach({ item in
  174 + if (item.isKind(of: CNLiveVitaeVocationalCertificateController.self)) {
  175 + self.navigationController?.popToViewController(item, animated: true)
  176 + }
  177 + })
  178 + }
  179 +
  180 + }
  181 + }
  182 +}
... ...
metaCode/Classes/Main/HomePage/Controller/DigitalAuth/CNLiveVitaeCerAddPhotoController.swift 0 → 100644
  1 +//
  2 +// CNLiveVitaeCerAddPhotoController.swift
  3 +// metaCode
  4 +//
  5 +// Created by zx on 2024/7/27.
  6 +// 数字简历-添加证书示例页面
  7 +
  8 +import Foundation
  9 +import SnapKit
  10 +
  11 +class CNLiveVitaeCerAddPhotoController:CNLiveBaseViewController{
  12 +
  13 + var isYuanJian = true//原件 or 截图
  14 + lazy var cerYuanJianBtn: UIButton = {
  15 + let closeBtn = UIButton(type: .custom)
  16 + closeBtn.setTitle("证书原件拍照", for: .normal)
  17 + closeBtn.setTitleColor(HexColor("#1961FE"), for: .normal)
  18 + closeBtn.addTarget(self, action: #selector(cerYuanJianBtnAction), for: .touchUpInside)
  19 + return closeBtn
  20 + }()
  21 + lazy var cerZhengMingBtn: UIButton = {
  22 + let closeBtn = UIButton(type: .custom)
  23 + closeBtn.setTitle("证书证明截图", for: .normal)
  24 + closeBtn.setTitleColor(HexColor("#333333"), for: .normal)
  25 + closeBtn.addTarget(self, action: #selector(cerZhengMingBtnAction), for: .touchUpInside)
  26 + return closeBtn
  27 + }()
  28 + lazy var lineView :UIView = {
  29 + let bottomNavView = UIView()
  30 + bottomNavView.backgroundColor = HexColor("#1961FE")
  31 + bottomNavView.layer.cornerRadius = 2
  32 + bottomNavView.clipsToBounds = true
  33 + return bottomNavView
  34 + }()
  35 + lazy var whiteBgView :UIView = {
  36 + let bottomNavView = UIView()
  37 + bottomNavView.backgroundColor = HexColor("#FFFFFF")
  38 + bottomNavView.layer.cornerRadius = 9
  39 + bottomNavView.clipsToBounds = true
  40 + return bottomNavView
  41 + }()
  42 + lazy var uploadTitleLabel: UILabel = {
  43 + let titleLabel = UILabel()
  44 + titleLabel.textColor = HexColor("#333333")
  45 + titleLabel.textAlignment = .left
  46 + titleLabel.text = "证书原件拍照上传"
  47 + titleLabel.font = BoldFont_15
  48 + return titleLabel
  49 + }()
  50 +
  51 + lazy var uploadRealBgView :UIView = {
  52 + let bottomNavView = UIView()
  53 + bottomNavView.backgroundColor = HexColor("#F7F8FA")
  54 + return bottomNavView
  55 + }()
  56 +
  57 + lazy var uploadRealTitleLabel: UILabel = {
  58 + let titleLabel = UILabel()
  59 + titleLabel.textColor = HexColor("#999999")
  60 + titleLabel.textAlignment = .left
  61 + titleLabel.numberOfLines = 3
  62 + titleLabel.text = "·证书图片需包含证书名称、证书编号、发证机构等字段信息\n·拍摄保持全面清晰完整\n·上传图片时请保持文字方向朝上"
  63 + titleLabel.font = Font_11
  64 + return titleLabel
  65 + }()
  66 + lazy var cerYuanJianImgView :UIImageView = {
  67 + let iconImgView = UIImageView()
  68 + iconImgView.image = UIImage(named: "mine_jianli_cerYuanJian")
  69 + return iconImgView
  70 + }()
  71 +
  72 +
  73 +
  74 + override func viewDidLoad() {
  75 + super.viewDidLoad()
  76 + titleName = "证书上传正确示例"
  77 + navigationBarHidden = false
  78 + self.initUI()
  79 + }
  80 +
  81 + deinit {}
  82 + func initUI(){
  83 + self.view.backgroundColor = HexColor("#F6F7FB")
  84 +
  85 + self.view.addSubview(self.cerYuanJianBtn)
  86 + self.cerYuanJianBtn.snp.makeConstraints { make in
  87 + make.left.equalTo(0)
  88 + make.top.equalTo(KNavigationHeight+15)
  89 + make.height.equalTo(21)
  90 + make.width.equalTo(KSreenWidth/2)
  91 + }
  92 + self.view.addSubview(self.cerZhengMingBtn)
  93 + self.cerZhengMingBtn.snp.makeConstraints { make in
  94 + make.top.equalTo(KNavigationHeight+15)
  95 + make.height.equalTo(21)
  96 + make.width.equalTo(KSreenWidth/2)
  97 + make.right.equalToSuperview()
  98 + }
  99 + self.view.addSubview(self.lineView)
  100 + self.lineView.snp.makeConstraints { make in
  101 + make.top.equalTo(self.cerYuanJianBtn.snp.bottom).offset(5)
  102 + make.height.equalTo(4)
  103 + make.width.equalTo(25)
  104 + make.centerX.equalTo(self.cerYuanJianBtn.snp.centerX)
  105 + }
  106 +
  107 + self.view.addSubview(self.whiteBgView)
  108 + self.whiteBgView.snp.makeConstraints { make in
  109 + make.top.equalTo(self.lineView.snp.bottom).offset(15)
  110 + make.height.equalTo(322)
  111 + make.left.equalTo(15)
  112 + make.right.equalToSuperview().offset(-15)
  113 + }
  114 +
  115 + self.whiteBgView.addSubview(self.uploadTitleLabel)
  116 + self.uploadTitleLabel.snp.makeConstraints { make in
  117 + make.top.equalTo(15)
  118 + make.left.equalTo(15)
  119 + }
  120 +
  121 + self.whiteBgView.addSubview(self.uploadRealBgView)
  122 + self.uploadRealBgView.snp.makeConstraints { make in
  123 + make.top.equalTo(self.uploadTitleLabel.snp.bottom).offset(10)
  124 + make.left.equalTo(15)
  125 + make.height.equalTo(65)
  126 + make.right.equalToSuperview().offset(-15)
  127 + }
  128 +
  129 + self.uploadRealBgView.addSubview(self.uploadRealTitleLabel)
  130 + self.uploadRealTitleLabel.snp.makeConstraints { make in
  131 + make.left.equalTo(10)
  132 + make.right.equalToSuperview().offset(-10)
  133 + make.centerY.equalToSuperview()
  134 + }
  135 +
  136 + self.whiteBgView.addSubview(self.cerYuanJianImgView)
  137 + self.cerYuanJianImgView.snp.makeConstraints { make in
  138 + make.top.equalTo(self.uploadRealBgView.snp.bottom).offset(15)
  139 + make.left.equalTo(15)
  140 + make.right.equalToSuperview().offset(-15)
  141 + make.bottom.equalToSuperview().offset(-15)
  142 + }
  143 +
  144 + }
  145 +
  146 + @objc func cerYuanJianBtnAction(){
  147 + self.isYuanJian = true
  148 + self.updateUI()
  149 + }
  150 +
  151 + @objc func cerZhengMingBtnAction(){
  152 + self.isYuanJian = false
  153 + self.updateUI()
  154 + }
  155 + func updateUI(){
  156 + if self.isYuanJian == true{
  157 + self.cerYuanJianBtn.setTitleColor(HexColor("#1961FE"), for: .normal)
  158 + self.cerZhengMingBtn.setTitleColor(HexColor("#333333"), for: .normal)
  159 + self.lineView.snp.remakeConstraints { make in
  160 + make.top.equalTo(self.cerYuanJianBtn.snp.bottom).offset(5)
  161 + make.height.equalTo(4)
  162 + make.width.equalTo(25)
  163 + make.centerX.equalTo(self.cerYuanJianBtn.snp.centerX)
  164 + }
  165 + self.uploadTitleLabel.text = "证书原件拍照上传"
  166 + self.uploadRealTitleLabel.text = "·证书图片需包含证书名称、证书编号、发证机构等字段信息\n·拍摄保持全面清晰完整\n·上传图片时请保持文字方向朝上"
  167 + self.uploadRealTitleLabel.numberOfLines = 3
  168 + self.cerYuanJianImgView.image = UIImage(named: "mine_jianli_cerYuanJian")
  169 + }else{
  170 + self.cerYuanJianBtn.setTitleColor(HexColor("#333333"), for: .normal)
  171 + self.cerZhengMingBtn.setTitleColor(HexColor("#1961FE"), for: .normal)
  172 + self.lineView.snp.remakeConstraints { make in
  173 + make.top.equalTo(self.cerYuanJianBtn.snp.bottom).offset(5)
  174 + make.height.equalTo(4)
  175 + make.width.equalTo(25)
  176 + make.centerX.equalTo(self.cerZhengMingBtn.snp.centerX)
  177 + }
  178 + self.uploadTitleLabel.text = "截图/拍照证书信息上传"
  179 + self.uploadRealTitleLabel.text = "·拍照上传支持截图、纸条等\n ·包含字段需要带有证书名、身份证号、姓名等"
  180 + self.uploadRealTitleLabel.numberOfLines = 2
  181 + self.cerYuanJianImgView.image = UIImage(named: "mine_jianli_cerJieTu")
  182 + }
  183 + }
  184 +}
... ...
metaCode/Classes/Main/HomePage/Controller/DigitalAuth/CNLiveVitaeVocationalCertificateController.swift
... ... @@ -47,12 +47,15 @@ class CNLiveVitaeVocationalCertificateController:CNLiveBaseViewController,UITabl
47 47 return dataArray
48 48 }()
49 49  
  50 + override func viewWillAppear(_ animated: Bool) {
  51 + super.viewWillAppear(animated)
  52 + self.getCetList()
  53 + }
50 54 override func viewDidLoad() {
51 55 super.viewDidLoad()
52 56 titleName = "职业证书"
53 57 navigationBarHidden = false
54 58 self.initUI()
55   - self.getCetList()
56 59 }
57 60  
58 61 deinit {}
... ... @@ -106,7 +109,7 @@ class CNLiveVitaeVocationalCertificateController:CNLiveBaseViewController,UITabl
106 109  
107 110  
108 111 @objc func addCertificateBtnAction(){
109   -
  112 + self.navigationController?.pushViewController(CNLiveVitaeAddCertificateController(), animated: true)
110 113 }
111 114  
112 115 func getCetList(){
... ...
metaCode/Classes/Main/HomePage/View/DigitalAuthViews/DigitalResume/CNLiveDigitalResumeCell.swift
... ... @@ -10,6 +10,7 @@ import Kingfisher
10 10 import SnapKit
11 11  
12 12 class CNLiveDigitalResumeCell: UITableViewCell {
  13 + var certificatesCount:Int = 0//证书数量
13 14 //简历Model
14 15 var _vitaeModel : CNLiveVitaeModel?
15 16 var vitaeModel : CNLiveVitaeModel? {
... ... @@ -584,7 +585,7 @@ class CNLiveDigitalResumeCell: UITableViewCell {
584 585 }else{
585 586 self.renzhengDetailTitleLabel.text = "添加职业技能身份 0 >"
586 587 }
587   - self.zhengshuDetailTitleLabel.text = "上传证书 \(model.certificates.count) >"
  588 + self.zhengshuDetailTitleLabel.text = "上传证书 \(self.certificatesCount) >"
588 589 self.gongzuoDetailTitleLabel.text = "补充工作记录 \(model.works.count) >"
589 590 self.huojiangDetailTitleLabel.text = "展示获奖情况 \(model.awards.count) >"
590 591 }
... ...
metaCode/Classes/Main/HomePage/View/DigitalAuthViews/Vitae/CNLiveVitaeCertificateAddInfoCell.swift 0 → 100644
  1 +//
  2 +// CNLiveVitaeCertificateAddInfoCell.swift
  3 +// metaCode
  4 +//
  5 +// Created by zx on 2024/7/26.
  6 +//
  7 +
  8 +import Foundation
  9 +
  10 +class CNLiveVitaeCertificateAddInfoCell: UITableViewCell, UITextFieldDelegate{
  11 +
  12 + var tfReturnBlock:TFReturnBlock?
  13 +
  14 + var _uploadImage : UIImage?
  15 + var uploadImage : UIImage? {
  16 + get{
  17 + _uploadImage
  18 + }
  19 + set{
  20 + _uploadImage = newValue!
  21 + self.uploadPhotoImgView.image = _uploadImage
  22 + }
  23 + }
  24 + lazy var whiteBgView :UIView = {
  25 + let whiteBgView = UIView()
  26 + whiteBgView.backgroundColor = .white
  27 + whiteBgView.layer.cornerRadius = 12
  28 + whiteBgView.clipsToBounds = true
  29 + return whiteBgView
  30 + }()
  31 + lazy var cerDetailTitleLabel: UILabel = {
  32 + let titleLabel = UILabel()
  33 + titleLabel.textColor = HexColor("#333333")
  34 + titleLabel.textAlignment = .left
  35 + titleLabel.text = "证书图片"
  36 + titleLabel.font = BoldFont_15
  37 + return titleLabel
  38 + }()
  39 + lazy var uploadPhotoImgView :UIImageView = {
  40 + let iconImgView = UIImageView()
  41 + iconImgView.backgroundColor = HexColor("#F7F8FA")
  42 + iconImgView.contentMode = .scaleAspectFit
  43 + iconImgView.layer.cornerRadius = 9
  44 + iconImgView.clipsToBounds = true
  45 + return iconImgView
  46 + }()
  47 +
  48 + lazy var line1View :UIView = {
  49 + let bottomNavView = UIView()
  50 + bottomNavView.backgroundColor = HexColor("#EBEBEB")
  51 + return bottomNavView
  52 + }()
  53 + lazy var cerNameXingImgView :UIImageView = {
  54 + let iconImgView = UIImageView()
  55 + iconImgView.image = UIImage(named: "mine_jianli_cer_xing")
  56 + return iconImgView
  57 + }()
  58 + lazy var cerNameTitleLabel: UILabel = {
  59 + let titleLabel = UILabel()
  60 + titleLabel.textColor = HexColor("#333333")
  61 + titleLabel.textAlignment = .left
  62 + titleLabel.text = "证书名称"
  63 + titleLabel.font = BoldFont_15
  64 + return titleLabel
  65 + }()
  66 + lazy var cerNameTF :UITextField = {
  67 + let searchTF = UITextField()
  68 + searchTF.textAlignment = .right
  69 + searchTF.clearButtonMode = .always
  70 + searchTF.textColor = HexColor("#333333")
  71 + searchTF.font = Font_15
  72 + searchTF.placeholder = "证书名称"
  73 + searchTF.delegate = self
  74 + searchTF.returnKeyType = .done
  75 + return searchTF
  76 + }()
  77 +
  78 + lazy var lineNumberView :UIView = {
  79 + let bottomNavView = UIView()
  80 + bottomNavView.backgroundColor = HexColor("#EBEBEB")
  81 + return bottomNavView
  82 + }()
  83 + lazy var cerNumberXingImgView :UIImageView = {
  84 + let iconImgView = UIImageView()
  85 + iconImgView.image = UIImage(named: "mine_jianli_cer_xing")
  86 + return iconImgView
  87 + }()
  88 + lazy var cerNumberTitleLabel: UILabel = {
  89 + let titleLabel = UILabel()
  90 + titleLabel.textColor = HexColor("#333333")
  91 + titleLabel.textAlignment = .left
  92 + titleLabel.text = "资格证编号"
  93 + titleLabel.font = BoldFont_15
  94 + return titleLabel
  95 + }()
  96 + lazy var cerNumberTF :UITextField = {
  97 + let searchTF = UITextField()
  98 + searchTF.textAlignment = .right
  99 + searchTF.clearButtonMode = .always
  100 + searchTF.textColor = HexColor("#333333")
  101 + searchTF.font = Font_15
  102 + searchTF.placeholder = "填写可提高验证通过率"
  103 + searchTF.delegate = self
  104 + searchTF.returnKeyType = .done
  105 + return searchTF
  106 + }()
  107 +
  108 + lazy var lineLevelView :UIView = {
  109 + let bottomNavView = UIView()
  110 + bottomNavView.backgroundColor = HexColor("#EBEBEB")
  111 + return bottomNavView
  112 + }()
  113 + lazy var cerLevelTitleLabel: UILabel = {
  114 + let titleLabel = UILabel()
  115 + titleLabel.textColor = HexColor("#333333")
  116 + titleLabel.textAlignment = .left
  117 + titleLabel.text = "证书级别"
  118 + titleLabel.font = BoldFont_15
  119 + return titleLabel
  120 + }()
  121 + lazy var cerLevelTF :UITextField = {
  122 + let searchTF = UITextField()
  123 + searchTF.textAlignment = .right
  124 + searchTF.clearButtonMode = .always
  125 + searchTF.textColor = HexColor("#333333")
  126 + searchTF.font = Font_15
  127 + searchTF.placeholder = "有等级时,填写证书等级"
  128 + searchTF.delegate = self
  129 + searchTF.returnKeyType = .done
  130 + return searchTF
  131 + }()
  132 +
  133 + lazy var lineTimeView :UIView = {
  134 + let bottomNavView = UIView()
  135 + bottomNavView.backgroundColor = HexColor("#EBEBEB")
  136 + return bottomNavView
  137 + }()
  138 + lazy var cerTimeTitleLabel: UILabel = {
  139 + let titleLabel = UILabel()
  140 + titleLabel.textColor = HexColor("#333333")
  141 + titleLabel.textAlignment = .left
  142 + titleLabel.text = "发证时间"
  143 + titleLabel.font = BoldFont_15
  144 + return titleLabel
  145 + }()
  146 + lazy var cerTimeTF :UITextField = {
  147 + let searchTF = UITextField()
  148 + searchTF.textAlignment = .right
  149 + searchTF.clearButtonMode = .always
  150 + searchTF.textColor = HexColor("#333333")
  151 + searchTF.font = Font_15
  152 + searchTF.placeholder = "有发证时间,填写发证时间"
  153 + searchTF.delegate = self
  154 + searchTF.returnKeyType = .done
  155 + return searchTF
  156 + }()
  157 +
  158 + lazy var lineYouXiaoView :UIView = {
  159 + let bottomNavView = UIView()
  160 + bottomNavView.backgroundColor = HexColor("#EBEBEB")
  161 + return bottomNavView
  162 + }()
  163 + lazy var cerYouXiaoTitleLabel: UILabel = {
  164 + let titleLabel = UILabel()
  165 + titleLabel.textColor = HexColor("#333333")
  166 + titleLabel.textAlignment = .left
  167 + titleLabel.text = "有效期至"
  168 + titleLabel.font = BoldFont_15
  169 + return titleLabel
  170 + }()
  171 + lazy var cerYouXiaoTF :UITextField = {
  172 + let searchTF = UITextField()
  173 + searchTF.textAlignment = .right
  174 + searchTF.clearButtonMode = .always
  175 + searchTF.textColor = HexColor("#333333")
  176 + searchTF.font = Font_15
  177 + searchTF.placeholder = "有效期至,填写有效期至"
  178 + searchTF.delegate = self
  179 + searchTF.returnKeyType = .done
  180 + return searchTF
  181 + }()
  182 +
  183 + lazy var lineJiGouView :UIView = {
  184 + let bottomNavView = UIView()
  185 + bottomNavView.backgroundColor = HexColor("#EBEBEB")
  186 + return bottomNavView
  187 + }()
  188 + lazy var cerJiGouXingImgView :UIImageView = {
  189 + let iconImgView = UIImageView()
  190 + iconImgView.image = UIImage(named: "mine_jianli_cer_xing")
  191 + return iconImgView
  192 + }()
  193 + lazy var cerJiGouTitleLabel: UILabel = {
  194 + let titleLabel = UILabel()
  195 + titleLabel.textColor = HexColor("#333333")
  196 + titleLabel.textAlignment = .left
  197 + titleLabel.text = "发证机构"
  198 + titleLabel.font = BoldFont_15
  199 + return titleLabel
  200 + }()
  201 + lazy var cerJiGouTF :UITextField = {
  202 + let searchTF = UITextField()
  203 + searchTF.textAlignment = .right
  204 + searchTF.clearButtonMode = .always
  205 + searchTF.textColor = HexColor("#333333")
  206 + searchTF.font = Font_15
  207 + searchTF.placeholder = "填写正确,提高验证通过率"
  208 + searchTF.delegate = self
  209 + searchTF.returnKeyType = .done
  210 + return searchTF
  211 + }()
  212 +
  213 + override init(style: UITableViewCell.CellStyle, reuseIdentifier: String?) {
  214 + super.init(style: style, reuseIdentifier: reuseIdentifier)
  215 + self.selectionStyle = .none
  216 + self.backgroundColor = .clear
  217 + self.contentView.backgroundColor = .clear
  218 +
  219 + self.contentView.addSubview(self.whiteBgView)
  220 + self.whiteBgView.snp.makeConstraints { make in
  221 + make.top.equalTo(15)
  222 + make.height.equalTo(700)
  223 + make.left.equalTo(15)
  224 + make.right.equalToSuperview().offset(-15)
  225 + }
  226 + self.whiteBgView.addSubview(self.cerDetailTitleLabel)
  227 + self.cerDetailTitleLabel.snp.makeConstraints { make in
  228 + make.top.equalTo(20)
  229 + make.left.equalTo(15)
  230 + }
  231 + self.whiteBgView.addSubview(self.uploadPhotoImgView)
  232 + self.uploadPhotoImgView.snp.makeConstraints { make in
  233 + make.top.equalTo(self.cerDetailTitleLabel.snp.bottom).offset(10)
  234 + make.left.equalTo(15)
  235 + make.right.equalToSuperview().offset(-15)
  236 + make.height.equalTo(180)
  237 + }
  238 +
  239 + self.whiteBgView.addSubview(self.line1View)
  240 + self.line1View.snp.makeConstraints { make in
  241 + make.top.equalTo(self.uploadPhotoImgView.snp.bottom).offset(20)
  242 + make.left.equalTo(15)
  243 + make.right.equalToSuperview().offset(-15)
  244 + make.height.equalTo(0.5)
  245 + }
  246 + self.whiteBgView.addSubview(self.cerNameXingImgView)
  247 + self.cerNameXingImgView.snp.makeConstraints { make in
  248 + make.width.height.equalTo(5)
  249 + make.left.equalTo(6)
  250 + make.top.equalTo(self.line1View.snp.bottom).offset(28)
  251 + }
  252 + self.whiteBgView.addSubview(self.cerNameTitleLabel)
  253 + self.cerNameTitleLabel.snp.makeConstraints { make in
  254 + make.top.equalTo(self.line1View.snp.bottom).offset(20)
  255 + make.left.equalTo(self.cerNameXingImgView.snp.right).offset(5)
  256 + make.width.equalTo(70)
  257 + make.height.equalTo(21)
  258 + }
  259 + self.whiteBgView.addSubview(self.cerNameTF)
  260 + self.cerNameTF.snp.makeConstraints { make in
  261 + make.centerY.equalTo(self.cerNameTitleLabel.snp.centerY)
  262 + make.left.greaterThanOrEqualTo(self.cerNameTitleLabel.snp.right).offset(10)
  263 + make.right.equalToSuperview().offset(-15)
  264 + make.height.equalTo(21)
  265 + }
  266 +
  267 + self.whiteBgView.addSubview(self.lineNumberView)
  268 + self.lineNumberView.snp.makeConstraints { make in
  269 + make.top.equalTo(self.cerNameTitleLabel.snp.bottom).offset(20)
  270 + make.left.equalTo(15)
  271 + make.right.equalToSuperview().offset(-15)
  272 + make.height.equalTo(0.5)
  273 + }
  274 + self.whiteBgView.addSubview(self.cerNumberXingImgView)
  275 + self.cerNumberXingImgView.snp.makeConstraints { make in
  276 + make.width.height.equalTo(5)
  277 + make.left.equalTo(6)
  278 + make.top.equalTo(self.lineNumberView.snp.bottom).offset(28)
  279 + }
  280 + self.whiteBgView.addSubview(self.cerNumberTitleLabel)
  281 + self.cerNumberTitleLabel.snp.makeConstraints { make in
  282 + make.top.equalTo(self.lineNumberView.snp.bottom).offset(20)
  283 + make.left.equalTo(self.cerNumberXingImgView.snp.right).offset(5)
  284 + make.width.equalTo(90)
  285 + make.height.equalTo(21)
  286 + }
  287 + self.whiteBgView.addSubview(self.cerNumberTF)
  288 + self.cerNumberTF.snp.makeConstraints { make in
  289 + make.centerY.equalTo(self.cerNumberTitleLabel.snp.centerY)
  290 + make.left.greaterThanOrEqualTo(self.cerNumberTitleLabel.snp.right).offset(10)
  291 + make.right.equalToSuperview().offset(-15)
  292 + make.height.equalTo(21)
  293 + }
  294 +
  295 + self.whiteBgView.addSubview(self.lineLevelView)
  296 + self.lineLevelView.snp.makeConstraints { make in
  297 + make.top.equalTo(self.cerNumberTitleLabel.snp.bottom).offset(20)
  298 + make.left.equalTo(15)
  299 + make.right.equalToSuperview().offset(-15)
  300 + make.height.equalTo(0.5)
  301 + }
  302 + self.whiteBgView.addSubview(self.cerLevelTitleLabel)
  303 + self.cerLevelTitleLabel.snp.makeConstraints { make in
  304 + make.top.equalTo(self.lineLevelView.snp.bottom).offset(20)
  305 + make.left.equalTo(self.cerNameTitleLabel.snp.left)
  306 + make.width.equalTo(70)
  307 + make.height.equalTo(21)
  308 + }
  309 + self.whiteBgView.addSubview(self.cerLevelTF)
  310 + self.cerLevelTF.snp.makeConstraints { make in
  311 + make.centerY.equalTo(self.cerLevelTitleLabel.snp.centerY)
  312 + make.left.greaterThanOrEqualTo(self.cerLevelTitleLabel.snp.right).offset(10)
  313 + make.right.equalToSuperview().offset(-15)
  314 + make.height.equalTo(21)
  315 + }
  316 +
  317 + self.whiteBgView.addSubview(self.lineTimeView)
  318 + self.lineTimeView.snp.makeConstraints { make in
  319 + make.top.equalTo(self.cerLevelTitleLabel.snp.bottom).offset(20)
  320 + make.left.equalTo(15)
  321 + make.right.equalToSuperview().offset(-15)
  322 + make.height.equalTo(0.5)
  323 + }
  324 + self.whiteBgView.addSubview(self.cerTimeTitleLabel)
  325 + self.cerTimeTitleLabel.snp.makeConstraints { make in
  326 + make.top.equalTo(self.lineTimeView.snp.bottom).offset(20)
  327 + make.left.equalTo(self.cerNameTitleLabel.snp.left)
  328 + make.width.equalTo(70)
  329 + make.height.equalTo(21)
  330 + }
  331 + self.whiteBgView.addSubview(self.cerTimeTF)
  332 + self.cerTimeTF.snp.makeConstraints { make in
  333 + make.centerY.equalTo(self.cerTimeTitleLabel.snp.centerY)
  334 + make.left.greaterThanOrEqualTo(self.cerTimeTitleLabel.snp.right).offset(10)
  335 + make.right.equalToSuperview().offset(-15)
  336 + make.height.equalTo(21)
  337 + }
  338 +
  339 + self.whiteBgView.addSubview(self.lineYouXiaoView)
  340 + self.lineYouXiaoView.snp.makeConstraints { make in
  341 + make.top.equalTo(self.cerTimeTitleLabel.snp.bottom).offset(20)
  342 + make.left.equalTo(15)
  343 + make.right.equalToSuperview().offset(-15)
  344 + make.height.equalTo(0.5)
  345 + }
  346 + self.whiteBgView.addSubview(self.cerYouXiaoTitleLabel)
  347 + self.cerYouXiaoTitleLabel.snp.makeConstraints { make in
  348 + make.top.equalTo(self.lineYouXiaoView.snp.bottom).offset(20)
  349 + make.left.equalTo(self.cerNameTitleLabel.snp.left)
  350 + make.width.equalTo(70)
  351 + make.height.equalTo(21)
  352 + }
  353 + self.whiteBgView.addSubview(self.cerYouXiaoTF)
  354 + self.cerYouXiaoTF.snp.makeConstraints { make in
  355 + make.centerY.equalTo(self.cerYouXiaoTitleLabel.snp.centerY)
  356 + make.left.greaterThanOrEqualTo(self.cerYouXiaoTitleLabel.snp.right).offset(10)
  357 + make.right.equalToSuperview().offset(-15)
  358 + make.height.equalTo(21)
  359 + }
  360 +
  361 + self.whiteBgView.addSubview(self.lineJiGouView)
  362 + self.lineJiGouView.snp.makeConstraints { make in
  363 + make.top.equalTo(self.cerYouXiaoTitleLabel.snp.bottom).offset(20)
  364 + make.left.equalTo(15)
  365 + make.right.equalToSuperview().offset(-15)
  366 + make.height.equalTo(0.5)
  367 + }
  368 + self.whiteBgView.addSubview(self.cerJiGouXingImgView)
  369 + self.cerJiGouXingImgView.snp.makeConstraints { make in
  370 + make.width.height.equalTo(5)
  371 + make.left.equalTo(6)
  372 + make.top.equalTo(self.lineJiGouView.snp.bottom).offset(28)
  373 + }
  374 + self.whiteBgView.addSubview(self.cerJiGouTitleLabel)
  375 + self.cerJiGouTitleLabel.snp.makeConstraints { make in
  376 + make.top.equalTo(self.lineJiGouView.snp.bottom).offset(20)
  377 + make.left.equalTo(self.cerJiGouXingImgView.snp.right).offset(5)
  378 + make.width.equalTo(70)
  379 + make.height.equalTo(21)
  380 + }
  381 + self.whiteBgView.addSubview(self.cerJiGouTF)
  382 + self.cerJiGouTF.snp.makeConstraints { make in
  383 + make.centerY.equalTo(self.cerJiGouTitleLabel.snp.centerY)
  384 + make.left.greaterThanOrEqualTo(self.cerJiGouTitleLabel.snp.right).offset(10)
  385 + make.right.equalToSuperview().offset(-15)
  386 + make.height.equalTo(21)
  387 + }
  388 + }
  389 +
  390 + required init?(coder: NSCoder) {
  391 + fatalError("init(coder:) has not been implemented")
  392 + }
  393 +
  394 + func textFieldShouldReturn(_ textField: UITextField) -> Bool {
  395 + self.tfReturnBlock?()
  396 + return true
  397 + }
  398 +}
... ...
metaCode/Classes/Main/HomePage/View/DigitalAuthViews/Vitae/CNLiveVitaeCertificateAddPhotoCell.swift 0 → 100644
  1 +//
  2 +// CNLiveVitaeCertificateAddPhotoCell.swift
  3 +// metaCode
  4 +//
  5 +// Created by zx on 2024/7/26.
  6 +//
  7 +
  8 +import Foundation
  9 +import HXPHPicker
  10 +
  11 +typealias SelectUploadImageBlock = (_ uploadImage: UIImage,_ key: String,_ url: String) -> Void
  12 +
  13 +class CNLiveVitaeCertificateAddPhotoCell: UITableViewCell, PhotoPickerControllerDelegate{
  14 + var selectImageBlock:SelectUploadImageBlock?
  15 + lazy var whiteBgView :UIView = {
  16 + let whiteBgView = UIView()
  17 + whiteBgView.backgroundColor = .white
  18 + whiteBgView.layer.cornerRadius = 12
  19 + whiteBgView.clipsToBounds = true
  20 + return whiteBgView
  21 + }()
  22 + lazy var uploadTitleLabel: UILabel = {
  23 + let titleLabel = UILabel()
  24 + titleLabel.textColor = HexColor("#333333")
  25 + titleLabel.textAlignment = .left
  26 + titleLabel.text = "请上传个人证书图片"
  27 + titleLabel.font = BoldFont_15
  28 + return titleLabel
  29 + }()
  30 +
  31 + lazy var uploadRealBgView :UIView = {
  32 + let bottomNavView = UIView()
  33 + bottomNavView.backgroundColor = HexColor("#F7F8FA")
  34 + return bottomNavView
  35 + }()
  36 +
  37 + lazy var uploadRealTitleLabel: UILabel = {
  38 + let titleLabel = UILabel()
  39 + titleLabel.textColor = HexColor("#999999")
  40 + titleLabel.textAlignment = .left
  41 + titleLabel.numberOfLines = 2
  42 + titleLabel.text = "·请上传真实信息,否则可能会影响你的信用\n·图片只自己查询和做认证,对外不展示图片"
  43 + titleLabel.font = Font_11
  44 + return titleLabel
  45 + }()
  46 + lazy var uploadPhotoBgImgView :UIImageView = {
  47 + let iconImgView = UIImageView()
  48 + iconImgView.image = UIImage(named: "mine_jianli_cerPhotoBg")
  49 + iconImgView.isUserInteractionEnabled = true
  50 + iconImgView.addGestureRecognizer(UITapGestureRecognizer(target: self, action: #selector(uploadPhotoBgImgViewAction)))
  51 + return iconImgView
  52 + }()
  53 + lazy var uploadPhotoImgView :UIImageView = {
  54 + let iconImgView = UIImageView()
  55 + iconImgView.image = UIImage(named: "mine_jianli_cerPhoto")
  56 + return iconImgView
  57 + }()
  58 + lazy var uploadPhotoTitleLabel: UILabel = {
  59 + let titleLabel = UILabel()
  60 + titleLabel.textColor = HexColor("#333333")
  61 + titleLabel.textAlignment = .left
  62 + titleLabel.text = "上传图片"
  63 + titleLabel.font = BoldFont_16
  64 + return titleLabel
  65 + }()
  66 + lazy var chakanTitleLabel: UILabel = {
  67 + let titleLabel = UILabel()
  68 + titleLabel.textColor = HexColor("#666666")
  69 + titleLabel.textAlignment = .right
  70 + titleLabel.text = "点击查看"
  71 + titleLabel.font = Font_14
  72 + return titleLabel
  73 + }()
  74 + lazy var realTitleLabel: UILabel = {
  75 + let titleLabel = UILabel()
  76 + titleLabel.textColor = HexColor("#1961FE")
  77 + titleLabel.textAlignment = .left
  78 + titleLabel.text = "正确示意"
  79 + titleLabel.font = Font_14
  80 + titleLabel.isUserInteractionEnabled = true
  81 + titleLabel.addGestureRecognizer(UITapGestureRecognizer(target: self, action: #selector(uploadShiYiAction)))
  82 + return titleLabel
  83 + }()
  84 + lazy var realBgView :UIView = {
  85 + let bottomNavView = UIView()
  86 + bottomNavView.backgroundColor = .clear
  87 + bottomNavView.addGestureRecognizer(UITapGestureRecognizer(target: self, action: #selector(uploadShiYiAction)))
  88 + return bottomNavView
  89 + }()
  90 +
  91 + override init(style: UITableViewCell.CellStyle, reuseIdentifier: String?) {
  92 + super.init(style: style, reuseIdentifier: reuseIdentifier)
  93 + self.selectionStyle = .none
  94 + self.backgroundColor = .clear
  95 + self.contentView.backgroundColor = .clear
  96 +
  97 + self.contentView.addSubview(self.whiteBgView)
  98 + self.whiteBgView.snp.makeConstraints { make in
  99 + make.top.equalTo(15)
  100 + make.height.equalTo(351)
  101 + make.left.equalTo(15)
  102 + make.right.equalToSuperview().offset(-15)
  103 + }
  104 +
  105 + self.whiteBgView.addSubview(self.uploadTitleLabel)
  106 + self.uploadTitleLabel.snp.makeConstraints { make in
  107 + make.top.equalTo(20)
  108 + make.left.equalTo(15)
  109 + }
  110 +
  111 + self.whiteBgView.addSubview(self.uploadRealBgView)
  112 + self.uploadRealBgView.snp.makeConstraints { make in
  113 + make.top.equalTo(self.uploadTitleLabel.snp.bottom).offset(10)
  114 + make.left.equalTo(15)
  115 + make.height.equalTo(50)
  116 + make.right.equalToSuperview().offset(-15)
  117 + }
  118 +
  119 + self.uploadRealBgView.addSubview(self.uploadRealTitleLabel)
  120 + self.uploadRealTitleLabel.snp.makeConstraints { make in
  121 + make.left.equalTo(10)
  122 + make.centerY.equalToSuperview()
  123 + }
  124 +
  125 + self.whiteBgView.addSubview(self.uploadPhotoBgImgView)
  126 + self.uploadPhotoBgImgView.snp.makeConstraints { make in
  127 + make.top.equalTo(self.uploadRealBgView.snp.bottom).offset(15)
  128 + make.left.equalTo(15)
  129 + make.height.equalTo(180)
  130 + make.right.equalToSuperview().offset(-15)
  131 + }
  132 + self.uploadPhotoBgImgView.addSubview(self.uploadPhotoImgView)
  133 + self.uploadPhotoImgView.snp.makeConstraints { make in
  134 + make.top.equalTo(50)
  135 + make.width.height.equalTo(50)
  136 + make.centerX.equalToSuperview()
  137 + }
  138 + self.uploadPhotoBgImgView.addSubview(self.uploadPhotoTitleLabel)
  139 + self.uploadPhotoTitleLabel.snp.makeConstraints { make in
  140 + make.top.equalTo(self.uploadPhotoImgView.snp.bottom).offset(10)
  141 + make.centerX.equalToSuperview()
  142 + }
  143 +
  144 + self.whiteBgView.addSubview(self.chakanTitleLabel)
  145 + self.chakanTitleLabel.snp.makeConstraints { make in
  146 + make.right.equalTo(self.uploadPhotoBgImgView.snp.centerX).offset(-5)
  147 + make.top.equalTo(self.uploadPhotoBgImgView.snp.bottom).offset(15)
  148 + }
  149 +
  150 + self.whiteBgView.addSubview(self.realTitleLabel)
  151 + self.realTitleLabel.snp.makeConstraints { make in
  152 + make.left.equalTo(self.uploadPhotoBgImgView.snp.centerX).offset(5)
  153 + make.top.equalTo(self.uploadPhotoBgImgView.snp.bottom).offset(15)
  154 + }
  155 +
  156 + self.whiteBgView.addSubview(self.realBgView)
  157 + self.realBgView.snp.makeConstraints { make in
  158 + make.left.equalTo(self.uploadPhotoBgImgView.snp.centerX)
  159 + make.top.equalTo(self.uploadPhotoBgImgView.snp.bottom).offset(5)
  160 + make.width.equalTo(100)
  161 + make.bottom.equalToSuperview()
  162 + }
  163 + }
  164 +
  165 + required init?(coder: NSCoder) {
  166 + fatalError("init(coder:) has not been implemented")
  167 + }
  168 +
  169 + @objc func uploadPhotoBgImgViewAction(){
  170 + //上传图片
  171 + let config = PhotoTools.getWXPickerConfig()
  172 + config.selectMode = .single
  173 + config.selectOptions = .photo
  174 + config.maximumSelectedPhotoCount = 3
  175 + let pickerController = PhotoPickerController(picker: config)
  176 + pickerController.pickerDelegate = self
  177 + pickerController.isOriginal = false
  178 + currentViewController()!.present(pickerController, animated: true, completion: nil)
  179 +
  180 + }
  181 + @objc func uploadShiYiAction(){
  182 + //跳转上传示意图页面
  183 + navigationViewController().pushViewController(CNLiveVitaeCerAddPhotoController(), animated: true)
  184 + }
  185 +}
  186 +
  187 +extension CNLiveVitaeCertificateAddPhotoCell {
  188 +
  189 + func pickerController(_ pickerController: PhotoPickerController,
  190 + didFinishSelection result: PickerResult) {
  191 + result.getImage { [weak self] (image, photoAsset, index) in
  192 + if let image = image {
  193 + let uploadKey = UploadManager.uploadImage(imageData: image.jpegData(compressionQuality: 1.0)! as NSData, progressBlock: {key, progress in
  194 + print("获取进度==>\(progress)")
  195 + }, successBlock: { [weak self] key,url in
  196 + self?.selectImageBlock?(image,key,url)
  197 + })
  198 +
  199 + }else {
  200 + print("failed")
  201 + }
  202 + } completionHandler: { (images) in
  203 +
  204 + }
  205 + }
  206 +}
  207 +
... ...
metaCode/Classes/Main/HomePage/ViewModel/Vitae/CNLiveVitaeViewModel.swift
... ... @@ -110,7 +110,6 @@ class CNLiveVitaeViewModel:NSObject{
110 110  
111 111 }
112 112  
113   -
114 113 /// 获取省市区县列表
115 114 /// @param id
116 115 static func getCityListWithId(id:String,resultBlock: @escaping downSlideResultBlock){
... ... @@ -138,6 +137,65 @@ class CNLiveVitaeViewModel:NSObject{
138 137 }
139 138  
140 139 /*
  140 + 保存证书
  141 + 参数 vsid 实名对象id
  142 + */
  143 + static func saveCertificate(img:String,lv:String,number:String,organization:String,time:String,title:String,uploadTime:String,validity:String,vsid:String,resultBlock: @escaping downSlideResultBlock) {
  144 + let values = NSMutableDictionary()
  145 + values.addEntries(from: ["img":img])
  146 + values.addEntries(from: ["lv":lv])
  147 + values.addEntries(from: ["number":number])
  148 + values.addEntries(from: ["organization":organization])
  149 +// values.addEntries(from: ["status":status])
  150 + values.addEntries(from: ["time":time])
  151 + values.addEntries(from: ["title":title])
  152 + values.addEntries(from: ["uploadTime":uploadTime])
  153 + values.addEntries(from: ["validity":validity])
  154 + values.addEntries(from: ["vsid":vsid])
  155 + do {
  156 + let request = URLRequest.init(url: URL.init(string: APPBaseMCUrl+"/userApi/saveCertificate")!) as! NSMutableURLRequest
  157 + request.httpMethod = "POST"
  158 + request.timeoutInterval = 10
  159 + request.setValue("application/json", forHTTPHeaderField: "Content-Type")
  160 + let data = try JSONSerialization.data(withJSONObject: values, options: .prettyPrinted)
  161 + request.httpBody = data
  162 + showLoading(message: "")
  163 + let custom_param = NSMutableDictionary()
  164 + custom_param.setValue(CNLiveMCEnvironmentManager.shared.appId, forKey: "appId")
  165 + custom_param.setValue(CNLiveMCEnvironmentManager.shared.appKey, forKey: "appKey")
  166 + CNLiveNetworking.setupCustomParam(custom_param as? [String : String])
  167 + CNLiveNetworking.setAllowRequestDefaultArgument(false)
  168 + CNLiveNetworking.setupShowDataResult(false)
  169 + CNLiveNetworking.setBuildCustomUrlRequest(request as URLRequest) { task, result, error in
  170 + hiddenLoading()
  171 + if (error == nil) {
  172 + let resp = result as! NSDictionary
  173 + let errorCode = "\(resp["errorCode"] ?? "0")"
  174 + if (errorCode == "0") {
  175 + resultBlock(true,.success)
  176 + } else {
  177 + showMessage(message: resp["errorMessage"] as! String)
  178 + resultBlock(NSNull(),.failed)
  179 + }
  180 + } else {
  181 + if CNLiveNetworking.isNetworking() {
  182 + showMessage(message: "上传失败")
  183 + resultBlock(NSNull(),.failed)
  184 + } else {
  185 + showMessage(message: "似乎与网络断开链接")
  186 + resultBlock(NSNull(),.noNetwork)
  187 + }
  188 + }
  189 + }
  190 + } catch {
  191 + showMessage(message: "上传失败")
  192 + resultBlock(NSNull(),.failed)
  193 + }
  194 +
  195 + }
  196 +
  197 +
  198 + /*
141 199 获取证书列表
142 200 参数 vsid 实名对象id
143 201 参数 page NSInteger
... ...
metaCode/Supporting Files/Assets.xcassets/MinePage/jianli/mine_jianli_cerJieTu.imageset/Contents.json 0 → 100644
  1 +{
  2 + "images" : [
  3 + {
  4 + "idiom" : "universal",
  5 + "scale" : "1x"
  6 + },
  7 + {
  8 + "filename" : "mine_jianli_cerJieTu@2x.png",
  9 + "idiom" : "universal",
  10 + "scale" : "2x"
  11 + },
  12 + {
  13 + "filename" : "mine_jianli_cerJieTu@3x.png",
  14 + "idiom" : "universal",
  15 + "scale" : "3x"
  16 + }
  17 + ],
  18 + "info" : {
  19 + "author" : "xcode",
  20 + "version" : 1
  21 + }
  22 +}
... ...
metaCode/Supporting Files/Assets.xcassets/MinePage/jianli/mine_jianli_cerJieTu.imageset/mine_jianli_cerJieTu@2x.png 0 → 100644

152 KB

metaCode/Supporting Files/Assets.xcassets/MinePage/jianli/mine_jianli_cerJieTu.imageset/mine_jianli_cerJieTu@3x.png 0 → 100644

313 KB

metaCode/Supporting Files/Assets.xcassets/MinePage/jianli/mine_jianli_cerPhoto.imageset/Contents.json 0 → 100644
  1 +{
  2 + "images" : [
  3 + {
  4 + "idiom" : "universal",
  5 + "scale" : "1x"
  6 + },
  7 + {
  8 + "filename" : "mine_jianli_cerPhoto@2x.png",
  9 + "idiom" : "universal",
  10 + "scale" : "2x"
  11 + },
  12 + {
  13 + "filename" : "mine_jianli_cerPhoto@3x.png",
  14 + "idiom" : "universal",
  15 + "scale" : "3x"
  16 + }
  17 + ],
  18 + "info" : {
  19 + "author" : "xcode",
  20 + "version" : 1
  21 + }
  22 +}
... ...
metaCode/Supporting Files/Assets.xcassets/MinePage/jianli/mine_jianli_cerPhoto.imageset/mine_jianli_cerPhoto@2x.png 0 → 100644

4.98 KB

metaCode/Supporting Files/Assets.xcassets/MinePage/jianli/mine_jianli_cerPhoto.imageset/mine_jianli_cerPhoto@3x.png 0 → 100644

10.7 KB

metaCode/Supporting Files/Assets.xcassets/MinePage/jianli/mine_jianli_cerPhotoBg.imageset/Contents.json 0 → 100644
  1 +{
  2 + "images" : [
  3 + {
  4 + "idiom" : "universal",
  5 + "scale" : "1x"
  6 + },
  7 + {
  8 + "filename" : "mine_jianli_cerPhotoBg@2x.png",
  9 + "idiom" : "universal",
  10 + "scale" : "2x"
  11 + },
  12 + {
  13 + "filename" : "mine_jianli_cerPhotoBg@3x.png",
  14 + "idiom" : "universal",
  15 + "scale" : "3x"
  16 + }
  17 + ],
  18 + "info" : {
  19 + "author" : "xcode",
  20 + "version" : 1
  21 + }
  22 +}
... ...
metaCode/Supporting Files/Assets.xcassets/MinePage/jianli/mine_jianli_cerPhotoBg.imageset/mine_jianli_cerPhotoBg@2x.png 0 → 100644

41.4 KB

metaCode/Supporting Files/Assets.xcassets/MinePage/jianli/mine_jianli_cerPhotoBg.imageset/mine_jianli_cerPhotoBg@3x.png 0 → 100644

109 KB

metaCode/Supporting Files/Assets.xcassets/MinePage/jianli/mine_jianli_cerYuanJian.imageset/Contents.json 0 → 100644
  1 +{
  2 + "images" : [
  3 + {
  4 + "idiom" : "universal",
  5 + "scale" : "1x"
  6 + },
  7 + {
  8 + "filename" : "mine_jianli_cerYuanJian@2x.png",
  9 + "idiom" : "universal",
  10 + "scale" : "2x"
  11 + },
  12 + {
  13 + "filename" : "mine_jianli_cerYuanJian@3x.png",
  14 + "idiom" : "universal",
  15 + "scale" : "3x"
  16 + }
  17 + ],
  18 + "info" : {
  19 + "author" : "xcode",
  20 + "version" : 1
  21 + }
  22 +}
... ...
metaCode/Supporting Files/Assets.xcassets/MinePage/jianli/mine_jianli_cerYuanJian.imageset/mine_jianli_cerYuanJian@2x.png 0 → 100644

295 KB

metaCode/Supporting Files/Assets.xcassets/MinePage/jianli/mine_jianli_cerYuanJian.imageset/mine_jianli_cerYuanJian@3x.png 0 → 100644

616 KB

metaCode/Supporting Files/Assets.xcassets/MinePage/jianli/mine_jianli_cer_xing.imageset/Contents.json 0 → 100644
  1 +{
  2 + "images" : [
  3 + {
  4 + "idiom" : "universal",
  5 + "scale" : "1x"
  6 + },
  7 + {
  8 + "filename" : "mine_jianli_cer_xing@2x.png",
  9 + "idiom" : "universal",
  10 + "scale" : "2x"
  11 + },
  12 + {
  13 + "filename" : "mine_jianli_cer_xing@3x.png",
  14 + "idiom" : "universal",
  15 + "scale" : "3x"
  16 + }
  17 + ],
  18 + "info" : {
  19 + "author" : "xcode",
  20 + "version" : 1
  21 + }
  22 +}
... ...
metaCode/Supporting Files/Assets.xcassets/MinePage/jianli/mine_jianli_cer_xing.imageset/mine_jianli_cer_xing@2x.png 0 → 100644

317 Bytes

metaCode/Supporting Files/Assets.xcassets/MinePage/jianli/mine_jianli_cer_xing.imageset/mine_jianli_cer_xing@3x.png 0 → 100644

546 Bytes