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

图片点击放大

parent b22fcea8
......@@ -45,6 +45,7 @@
044CC6292B8741AC0083FF76 /* YHSearchBar.swift in Sources */ = {isa = PBXBuildFile; fileRef = 044CC6282B8741AC0083FF76 /* YHSearchBar.swift */; };
044CC62B2B876A230083FF76 /* YHSheetPickerView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 044CC62A2B876A230083FF76 /* YHSheetPickerView.swift */; };
044CC62D2B876C980083FF76 /* YHSheetPickerViewType.swift in Sources */ = {isa = PBXBuildFile; fileRef = 044CC62C2B876C980083FF76 /* YHSheetPickerViewType.swift */; };
045DBF782B96FF5900992CAF /* YHImageViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 045DBF772B96FF5900992CAF /* YHImageViewController.swift */; };
0468D4202B49320900CFB916 /* YHVerificationCodeLoginController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0468D41F2B49320900CFB916 /* YHVerificationCodeLoginController.swift */; };
0468D4222B493A5E00CFB916 /* YHPhoneMessageView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0468D4212B493A5E00CFB916 /* YHPhoneMessageView.swift */; };
0468D4242B494BEA00CFB916 /* YHCodeResultViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0468D4232B494BEA00CFB916 /* YHCodeResultViewController.swift */; };
......@@ -353,6 +354,7 @@
044CC6282B8741AC0083FF76 /* YHSearchBar.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHSearchBar.swift; sourceTree = "<group>"; };
044CC62A2B876A230083FF76 /* YHSheetPickerView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHSheetPickerView.swift; sourceTree = "<group>"; };
044CC62C2B876C980083FF76 /* YHSheetPickerViewType.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHSheetPickerViewType.swift; sourceTree = "<group>"; };
045DBF772B96FF5900992CAF /* YHImageViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHImageViewController.swift; sourceTree = "<group>"; };
0468D41F2B49320900CFB916 /* YHVerificationCodeLoginController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHVerificationCodeLoginController.swift; sourceTree = "<group>"; };
0468D4212B493A5E00CFB916 /* YHPhoneMessageView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHPhoneMessageView.swift; sourceTree = "<group>"; };
0468D4232B494BEA00CFB916 /* YHCodeResultViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHCodeResultViewController.swift; sourceTree = "<group>"; };
......@@ -930,6 +932,7 @@
04E86E692B87352600A35F4B /* YHCompanySelectViewController.swift */,
0469750D2B96C0B900A0CB66 /* YHImageClipperViewController.swift */,
046975152B96EB2200A0CB66 /* YHImageResultViewController.swift */,
045DBF772B96FF5900992CAF /* YHImageViewController.swift */,
);
path = C;
sourceTree = "<group>";
......@@ -1976,6 +1979,7 @@
A5ACE9492B4564F7002C94D2 /* YHHUDSuccessView.swift in Sources */,
A58556BA2B6BCF1A003746B2 /* YHPersonInfoFillStepModel.swift in Sources */,
A5FD63D42B65F99500D1D9DA /* YHScoreItemCell.swift in Sources */,
045DBF782B96FF5900992CAF /* YHImageViewController.swift in Sources */,
A5ACE9432B4564F7002C94D2 /* UILable+Extension.swift in Sources */,
A596C3A02B84D9100067BBB8 /* YHOtherInfoFillCell.swift in Sources */,
A5ACE9382B4564F7002C94D2 /* UIApplication+Extension.swift in Sources */,
......
......@@ -279,10 +279,16 @@ class YHMainInformationCardTableViewCell: UITableViewCell {
@objc func frontImageClick() {
if type == .identity {
if viewModel.mainModel.certificates.cn_identity_card.img_front.count != 0 {
let vc = YHImageViewController()
vc.imgString = viewModel.mainModel.certificates.cn_identity_card.img_front
UIViewController.current?.navigationController?.pushViewController(vc)
return
}
} else {
if viewModel.mainModel.certificates.hk_macao_pass.img_front.count != 0 {
let vc = YHImageViewController()
vc.imgString = viewModel.mainModel.certificates.hk_macao_pass.img_front
UIViewController.current?.navigationController?.pushViewController(vc)
return
}
}
......@@ -334,10 +340,16 @@ class YHMainInformationCardTableViewCell: UITableViewCell {
@objc func backSurfaceImageClick() {
if type == .identity {
if viewModel.mainModel.certificates.cn_identity_card.img_back.count != 0 {
let vc = YHImageViewController()
vc.imgString = viewModel.mainModel.certificates.cn_identity_card.img_back
UIViewController.current?.navigationController?.pushViewController(vc)
return
}
} else {
if viewModel.mainModel.certificates.hk_macao_pass.img_back.count != 0 {
let vc = YHImageViewController()
vc.imgString = viewModel.mainModel.certificates.hk_macao_pass.img_back
UIViewController.current?.navigationController?.pushViewController(vc)
return
}
}
......
//
// YHImageViewController.swift
// galaxy
//
// Created by EDY on 2024/3/5.
// Copyright © 2024 https://www.galaxy-immi.com. All rights reserved.
//
import UIKit
class YHImageViewController: YHBaseViewController {
var resultView: UIImageView!
var resultButton: UIButton!
var imgString: String!
var viewModel: YHWorkExperienceViewModel!
override func viewDidLoad() {
super.viewDidLoad()
viewModel = YHWorkExperienceViewModel()
view.backgroundColor = .black
self.hidesBottomBarWhenPushed = true
if #available(iOS 11.0, *) {
} else {
self.automaticallyAdjustsScrollViewInsets = false
}
setView()
getData()
}
override func viewWillAppear(_ animated: Bool) {
super.viewWillAppear(animated)
navigationController?.isNavigationBarHidden = false
}
func setView() {
resultView = {
let step = UIImageView()
step.contentMode = .scaleAspectFit
return step
}()
view.addSubview(resultView)
resultView.snp.makeConstraints { make in
make.top.equalTo(k_Height_NavigationtBarAndStatuBar)
make.left.right.equalTo(view)
make.bottom.equalTo(-k_Height_safeAreaInsetsBottom() - 54)
}
resultButton = {
let button = UIButton(type: .custom)
button.addTarget(self, action: #selector(back), for: .touchUpInside)
return button
}()
view.addSubview(resultButton)
resultButton.snp.makeConstraints { make in
make.top.equalTo(k_Height_NavigationtBarAndStatuBar)
make.left.right.equalTo(view)
make.bottom.equalTo(-k_Height_safeAreaInsetsBottom() - 54)
}
}
@objc func back() {
self.navigationController?.popViewController()
}
func getData() {
self.viewModel.getPublicImageUrl(imgString) {[weak self] success, error in
guard let self = self else { return }
guard let url = success else { return }
self.resultView.kf.setImage(with: URL(string: success))
}
}
/*
// MARK: - Navigation
// In a storyboard-based application, you will often want to do a little preparation before navigation
override func prepare(for segue: UIStoryboardSegue, sender: Any?) {
// Get the new view controller using segue.destination.
// Pass the selected object to the new view controller.
}
*/
}
......@@ -429,6 +429,10 @@ extension YHWorkExperienceViewController: UITableViewDelegate, UITableViewDataSo
return
}
}
} else {
let vc = YHImageViewController()
vc.imgString = model.fileUrl
UIViewController.current?.navigationController?.pushViewController(vc)
}
}
return cell
......
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