Commit 8a2342c1 authored by pete谢兆麟's avatar pete谢兆麟

passporttype 修改

parent b33b8e54
......@@ -8,6 +8,8 @@
/* Begin PBXBuildFile section */
041B52872B5657B3007EBCEB /* IMAppKey.swift in Sources */ = {isa = PBXBuildFile; fileRef = 041B52862B5657B3007EBCEB /* IMAppKey.swift */; };
0435FA7F2BA178C100024EAE /* YHCommonAlertView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0435FA7E2BA178C100024EAE /* YHCommonAlertView.swift */; };
0435FA812BA186D600024EAE /* YHMyFileMethodTableViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0435FA802BA186D600024EAE /* YHMyFileMethodTableViewCell.swift */; };
045EEE792B9F171A0022A143 /* YHPreviewViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 045EED9A2B9F171A0022A143 /* YHPreviewViewModel.swift */; };
045EEE7A2B9F171A0022A143 /* YHPreviewForOtherInfoModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 045EED9C2B9F171A0022A143 /* YHPreviewForOtherInfoModel.swift */; };
045EEE7B2B9F171A0022A143 /* YHPersonInfoCellModel2.swift in Sources */ = {isa = PBXBuildFile; fileRef = 045EED9D2B9F171A0022A143 /* YHPersonInfoCellModel2.swift */; };
......@@ -341,6 +343,8 @@
/* Begin PBXFileReference section */
041B52862B5657B3007EBCEB /* IMAppKey.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = IMAppKey.swift; sourceTree = "<group>"; };
0435FA7E2BA178C100024EAE /* YHCommonAlertView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHCommonAlertView.swift; sourceTree = "<group>"; };
0435FA802BA186D600024EAE /* YHMyFileMethodTableViewCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHMyFileMethodTableViewCell.swift; sourceTree = "<group>"; };
045EED9A2B9F171A0022A143 /* YHPreviewViewModel.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = YHPreviewViewModel.swift; sourceTree = "<group>"; };
045EED9C2B9F171A0022A143 /* YHPreviewForOtherInfoModel.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = YHPreviewForOtherInfoModel.swift; sourceTree = "<group>"; };
045EED9D2B9F171A0022A143 /* YHPersonInfoCellModel2.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = YHPersonInfoCellModel2.swift; sourceTree = "<group>"; };
......@@ -1043,6 +1047,8 @@
isa = PBXGroup;
children = (
045EEE262B9F171A0022A143 /* YHMySignatureListTableViewCell.swift */,
0435FA802BA186D600024EAE /* YHMyFileMethodTableViewCell.swift */,
0435FA7E2BA178C100024EAE /* YHCommonAlertView.swift */,
);
path = V;
sourceTree = "<group>";
......@@ -2033,6 +2039,7 @@
A5FD63C52B637EE000D1D9DA /* YHSubmitAllInfoCheckView.swift in Sources */,
045EEF222B9F171A0022A143 /* YHImagePickerView.swift in Sources */,
A5ACE9442B4564F7002C94D2 /* Array+Extension.swift in Sources */,
0435FA812BA186D600024EAE /* YHMyFileMethodTableViewCell.swift in Sources */,
0468D4282B50D4AF00CFB916 /* YHPrivacyAlertView.swift in Sources */,
045EEEB22B9F171A0022A143 /* YHWorkActionView.swift in Sources */,
045EEE8C2B9F171A0022A143 /* YHPreviewMainViewController.swift in Sources */,
......@@ -2164,6 +2171,7 @@
045EEEA92B9F171A0022A143 /* YHWorkExperienceListViewController.swift in Sources */,
A5ACE9432B4564F7002C94D2 /* UILable+Extension.swift in Sources */,
045EEE882B9F171A0022A143 /* YHPreviewAcademicAndProfessionalQualificationViewController.swift in Sources */,
0435FA7F2BA178C100024EAE /* YHCommonAlertView.swift in Sources */,
A5ACE9382B4564F7002C94D2 /* UIApplication+Extension.swift in Sources */,
041B52872B5657B3007EBCEB /* IMAppKey.swift in Sources */,
0468D42B2B55019900CFB916 /* YHAnalytics.swift in Sources */,
......
......@@ -132,8 +132,8 @@ extension AppDelegate {
v0.tabBarItem = ESTabBarItem.init(YHBasicContentView(),title: "首页", image: UIImage(named: "photo"), selectedImage: UIImage(named: "photo_1"))
v1.tabBarItem = ESTabBarItem.init(YHBasicContentView(),title: "服务中心", image: UIImage(named: "home"), selectedImage: UIImage(named: "home_1"))
v2.tabBarItem = ESTabBarItem.init(YHBasicContentView(),title: "我的", image: UIImage(named: "find"), selectedImage: UIImage(named: "find_1"))
// tabBarController.viewControllers = [v0,v1,v2]
tabBarController.viewControllers = [v1,v2] //for test hjl 配合测试同学做自动化测试 Moon 2023.03.12
tabBarController.viewControllers = [v0,v1,v2]
// tabBarController.viewControllers = [v1,v2] for test hjl 配合测试同学做自动化测试 Moon 2023.03.12
tabBarController.tabBar.backgroundColor = .white
window = UIWindow(frame: UIScreen.main.bounds)
......
......@@ -9,6 +9,7 @@
import Foundation
import GKNavigationBarSwift
import JXSegmentedView
import SafariServices
class YHHomeViewController: YHBaseViewController {
......@@ -403,9 +404,20 @@ extension YHHomeViewController : UITableViewDelegate,UITableViewDataSource {
func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
tableView.deselectRow(at: indexPath, animated: true)
printLog("点击了 tableView Cell \(indexPath.row)")
// let vc = YHNewWebViewController()
// vc.url = "https://cloudapi.qiyuesuo.cn/contract/share/3203196638675878889?openPageToken=1c9e8a62-eeb5-4651-9a13-adf335ae3dbe"
// self.navigationController?.pushViewController(vc)
// let vc = YHWebViewViewController()
// vc.url = "https://auth.qiyuesuo.cn?ticket=bQngrvjj1TPHPnaOt91wKNtzO5iBNDfcwtMtgZdpdZxKIiDgW914qVqxQfloCUVT&channel=OPEN_V2"
let url = URL(string: "https://auth.qiyuesuo.cn?ticket=mw5mqO2qx5y%2F%2BqZuOKet7ct3JhAtlFkH4ar9JyyMas0gQ4YYg28iV43Cs8QqqvN8&channel=OPEN_V2")!
// 创建SFSafariViewController
let safariViewController = SFSafariViewController(url: url)
safariViewController.dismissButtonStyle = .close
// 设置代理
safariViewController.delegate = self
// 显示
// present(safariViewController, animated: true, completion: nil)
self.navigationController?.pushViewController(safariViewController)
// https://cloudapi.qiyuesuo.cn/contract/share/3202449385770287813?openPageToken=d004e5af-aab9-43e4-b813-c5a6a8c16497
}
}
......@@ -430,3 +442,20 @@ extension YHHomeViewController: UIScrollViewDelegate {
}
}
extension YHHomeViewController: SFSafariViewControllerDelegate {
// MARK: 点击左上角的完成
func safariViewControllerDidFinish(_ controller: SFSafariViewController) {
print(#function)
}
// MARK: 加载完成
func safariViewController(_ controller: SFSafariViewController, didCompleteInitialLoad didLoadSuccessfully: Bool) {
print(#function)
}
// MARK: 点击右下角调用Safari浏览器打开
func safariViewControllerWillOpenInBrowser(_ controller: SFSafariViewController) {
print(#function)
}
}
......@@ -62,5 +62,5 @@ class YHCertificatesModel: YHBaseModel {
var issue_date_end_at: String = ""
var img_front: String = ""
var img_back: String = ""
var pass_port_type: String = ""
var passport_type: Int = 0
}
......@@ -67,7 +67,7 @@ class YHMainApplicantInformationViewModel: YHBaseViewModel {
let item13 = YHItemModel(id: .id15, isNeed: true, title: "届满日期", isUserKeyBoard: false, prompts: "请选择", message: mainModel.certificates.hk_macao_pass.issue_date_end_at, type: .time, isShowPrompts: isShowPrompt, alertMessage:"请选择届满日期")
let section1 = YHSectionItemModel(title: "港澳通行证", models: [item10, item11, item12, item13])
let item4 = YHItemModel(id: .id16, isNeed: !flag, title: "证件类别", isUserKeyBoard: false, prompts: "请选择", message: mainModel.certificates.passport.pass_port_type, type: .id, isShowPrompts: isShowPrompt, alertMessage:"请选择件类别")
let item4 = YHItemModel(id: .id16, isNeed: !flag, title: "证件类别", isUserKeyBoard: false, prompts: "请选择", message: "\(mainModel.certificates.passport.passport_type)", type: .id, isShowPrompts: isShowPrompt, alertMessage:"请选择件类别")
let item5 = YHItemModel(id: .id17, isNeed: !flag, title: "证件号码", isUserKeyBoard: true, prompts: "请输入", message: mainModel.certificates.passport.number, isShowPrompts: isShowPrompt, alertMessage:"请输入证件号码")
let item6 = YHItemModel(id: .id18, isNeed: !flag, title: "签发地", isUserKeyBoard: true, prompts: "请输入", message: mainModel.certificates.passport.issue_at, isShowPrompts: isShowPrompt, alertMessage:"请输入签发地")
let item7 = YHItemModel(id: .id19, isNeed: !flag, title: "签发日期", isUserKeyBoard: false, prompts: "请选择", message: mainModel.certificates.passport.issue_date_start_at, type: .time, isShowPrompts: isShowPrompt, alertMessage:"请选择签发日期")
......@@ -170,7 +170,7 @@ class YHMainApplicantInformationViewModel: YHBaseViewModel {
case .id15:
mainModel.certificates.hk_macao_pass.issue_date_end_at = item.message ?? ""
case .id16:
mainModel.certificates.passport.pass_port_type = item.value?.first ?? ""
mainModel.certificates.passport.passport_type = item.value?.first?.int ?? 0
case .id17:
mainModel.certificates.passport.number = item.message ?? ""
case .id18:
......@@ -346,7 +346,7 @@ class YHMainApplicantInformationViewModel: YHBaseViewModel {
"issue_date_end_at": mainModel.certificates.passport.issue_date_end_at,
"issue_date_start_at": mainModel.certificates.passport.issue_date_start_at,
"number": mainModel.certificates.passport.number,
"passport_type": mainModel.certificates.passport.pass_port_type] as [String : Any]
"passport_type": mainModel.certificates.passport.passport_type] as [String : Any]
let params: [String : Any] = ["address": address,
"address_aboard": mainModel.address_aboard,
"age":mainModel.age,
......@@ -466,7 +466,7 @@ class YHMainApplicantInformationViewModel: YHBaseViewModel {
let hk_macao_pass_issue_at = mainModel.certificates.hk_macao_pass.issue_at
let hk_macao_pass_issue_date_start_at = mainModel.certificates.hk_macao_pass.issue_date_start_at
let hk_macao_pass_issue_date_end_at = mainModel.certificates.hk_macao_pass.issue_date_end_at
let passport_type = mainModel.certificates.passport.pass_port_type
let passport_type = mainModel.certificates.passport.passport_type
let passport_number = mainModel.certificates.passport.number
let passport_issue_at = mainModel.certificates.passport.issue_at
let passport_issue_date_start_at = mainModel.certificates.passport.issue_date_start_at
......@@ -484,7 +484,7 @@ class YHMainApplicantInformationViewModel: YHBaseViewModel {
guard cn_identity_card_issue_date_start_at.count > 0 else { return false }
guard cn_identity_card_issue_date_end_at.count > 0 else { return false }
} else {
guard passport_type.count > 0 else { return false }
guard passport_type > 0 else { return false }
guard passport_number.count > 0 else { return false }
guard passport_issue_at.count > 0 else { return false }
guard passport_issue_date_start_at.count > 0 else { return false }
......
......@@ -7,6 +7,7 @@
//
import UIKit
import SafariServices
class YHMySignatureDetailViewController: YHBaseViewController {
......@@ -73,7 +74,7 @@ class YHMySignatureDetailViewController: YHBaseViewController {
tableView.separatorStyle = .none
tableView.delegate = self
tableView.dataSource = self
tableView.register(cellWithClass: YHMySignatureListTableViewCell.self)
tableView.register(cellWithClass: YHMyFileMethodTableViewCell.self)
return tableView
}()
view.addSubview(tableView)
......@@ -119,7 +120,11 @@ class YHMySignatureDetailViewController: YHBaseViewController {
}
@objc func submit() {
let url = URL(string: "https://baidu.com/")!
let safariViewController = SFSafariViewController(url: url)
safariViewController.dismissButtonStyle = .close
safariViewController.delegate = self
self.navigationController?.pushViewController(safariViewController)
}
}
......@@ -129,38 +134,85 @@ extension YHMySignatureDetailViewController: UITableViewDelegate, UITableViewDat
}
func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
let cell = tableView.dequeueReusableCell(withClass: YHMySignatureListTableViewCell.self)
let cell = tableView.dequeueReusableCell(withClass: YHMyFileMethodTableViewCell.self)
cell.block = {[weak self] type in
guard let self = self else { return }
switch type {
case .sign:
viewModel?.requestSignaturePageURL("\(id)", callBackBlock: {[weak self] success, error in
guard let self = self else { return }
if error?.errorCode == 1008611 {
YHCommonAlertView.show("实名认证", "为保证签署有效,请先实名认证", "取消", "去认证") {
self.viewModel?.requestSignaturePersonalURL(callBackBlock: {[weak self] success, error in
guard let self = self else { return }
let url = URL(string: self.viewModel?.personalUrl)!
let safariViewController = SFSafariViewController(url: url)
safariViewController.dismissButtonStyle = .close
safariViewController.delegate = self
self.navigationController?.pushViewController(safariViewController)
// let vc = YHNewWebViewController()
// vc.url = self.viewModel?.personalUrl ?? ""
// self.navigationController?.pushViewController(vc)
})
}
} else {
if success ?? false {
// self.startTimer()
let url = URL(string: self.viewModel?.pageUrl)!
let safariViewController = SFSafariViewController(url: url)
safariViewController.dismissButtonStyle = .close
safariViewController.delegate = self
self.navigationController?.pushViewController(safariViewController)
// let vc = YHNewWebViewController()
// vc.url = self.viewModel?.pageUrl ?? ""
// self.navigationController?.pushViewController(vc)
} else {
YHHUD.flash(message: error?.errorMsg ?? "")
}
}
})
case .downLoad:
printLog("下载")
case .look:
printLog("查看")
}
}
cell.backgroundColor = .clear
cell.contentView.backgroundColor = .clear
return cell
}
func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat {
return CGFloat(82)
return CGFloat(180)
}
func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
viewModel?.requestSignaturePageURL("\(id)", callBackBlock: {[weak self] success, error in
}
}
extension YHMySignatureDetailViewController: SFSafariViewControllerDelegate {
// MARK: 点击左上角的完成
func safariViewControllerDidFinish(_ controller: SFSafariViewController) {
viewModel?.requestSignCallBack("\(id)", callBackBlock: {[weak self] success, error in
guard let self = self else { return }
if error?.errorCode == 1008611 {
//实名逻辑
self.viewModel?.requestSignaturePersonalURL(callBackBlock: {[weak self] success, error in
guard let self = self else { return }
let vc = YHNewWebViewController()
vc.url = self.viewModel?.personalUrl ?? ""
self.navigationController?.pushViewController(vc)
})
} else {
if success ?? false {
self.startTimer()
let vc = YHNewWebViewController()
vc.url = self.viewModel?.pageUrl ?? ""
self.navigationController?.pushViewController(vc)
} else {
YHHUD.flash(message: error?.errorMsg ?? "")
}
if success ?? false {
// timer.invalidate()
//刷新文件状态
}
controller.navigationController?.popViewController()
})
}
}
// MARK: 加载完成
func safariViewController(_ controller: SFSafariViewController, didCompleteInitialLoad didLoadSuccessfully: Bool) {
print(#function)
}
// MARK: 点击右下角调用Safari浏览器打开
func safariViewControllerWillOpenInBrowser(_ controller: SFSafariViewController) {
print(#function)
}
}
......@@ -97,7 +97,9 @@ class YHMySignatureListViewController: YHBaseViewController {
}
@objc func submit() {
YHCommonAlertView.show("实名认证", "为保证签署有效,请先实名认证", "取消", "去认证") {
}
}
}
......
//
// YHCommonAlertView.swift
// galaxy
//
// Created by EDY on 2024/3/13.
// Copyright © 2024 https://www.galaxy-immi.com. All rights reserved.
//
import UIKit
class YHCommonAlertView: UIView {
typealias AgreeBlock = () -> ()
var agreeBlock: AgreeBlock?
var centerView: UIView!
var titleLabel: UILabel!
var messageLabel: UILabel!
var agreeButton: UIButton!
var disAgressButton: UIButton!
static func show(_ title: String? = nil, _ message: String? = nil, _ leftButtonString: String? = nil, _ rightButtonString: String? = nil, callBack: @escaping (() -> Void)) {
let view = YHCommonAlertView(frame: CGRect(x: 0, y: 0, width: KScreenWidth, height: KScreenHeight))
view.agreeBlock = callBack
view.setContent(title, message, leftButtonString, rightButtonString)
let window = UIApplication.shared.yhKeyWindow()
window?.addSubview(view)
}
override init(frame: CGRect) {
super.init(frame: frame)
backgroundColor = UIColor(white: 0.5, alpha: 0.1)
let tap = UITapGestureRecognizer(target: self, action: #selector(handleTap))
tap.delegate = self
addGestureRecognizer(tap)
setView()
}
func setContent(_ title: String? = nil, _ message: String? = nil, _ leftButtonString: String? = nil, _ rightButtonString: String? = nil) {
self.titleLabel.text = title
self.messageLabel.text = message
self.disAgressButton.setTitle(leftButtonString, for: .normal)
self.agreeButton.setTitle(rightButtonString, for: .normal)
}
required init?(coder: NSCoder) {
fatalError("init(coder:) has not been implemented")
}
func setView() {
backgroundColor = UIColor(hex: 0x0000, alpha: 0.5)
centerView = {
let view = UIView()
view.backgroundColor = .white
view.layer.cornerRadius = kCornerRadius6
return view
}()
addSubview(centerView)
centerView.snp.makeConstraints { make in
make.center.equalToSuperview()
make.width.equalTo(299)
make.height.equalTo(187)
}
titleLabel = {
let label = UILabel()
label.textAlignment = .center
label.textColor = UIColor.mainTextColor
label.font = UIFont.PFSC_M(ofSize: 17)
label.numberOfLines = 0
return label
}()
centerView.addSubview(titleLabel)
titleLabel.snp.makeConstraints { make in
make.left.equalTo(22)
make.right.equalTo(-22)
make.height.equalTo(20)
make.top.equalTo(16)
}
messageLabel = {
let label = UILabel()
label.textAlignment = .center
label.textColor = UIColor.mainTextColor
label.font = UIFont.PFSC_M(ofSize: 16)
label.numberOfLines = 0
return label
}()
centerView.addSubview(messageLabel)
messageLabel.snp.makeConstraints { make in
make.left.equalTo(22)
make.right.equalTo(-22)
make.height.equalTo(42)
make.top.equalTo(63)
}
disAgressButton = {
let button = UIButton(type: .custom)
button.backgroundColor = UIColor(hex:0xffffff)
button.titleLabel?.font = UIFont.PFSC_M(ofSize: 15)
button.contentHorizontalAlignment = .center
button.setTitle("不同意", for: .normal)
button.setTitleColor( UIColor(hex:0x3c86f8), for: .normal)
button.layer.cornerRadius = kCornerRadius6
button.layer.borderWidth = 1
button.layer.borderColor = UIColor(hex: 0x3c86f8).cgColor
button.addTarget(self, action: #selector(disagree), for: .touchUpInside)
return button
}()
centerView.addSubview(disAgressButton)
disAgressButton.snp.makeConstraints { make in
make.left.equalTo(16)
make.bottom.equalTo(-21)
make.width.equalTo(128)
make.height.equalTo(45)
}
agreeButton = {
let button = UIButton(type: .custom)
button.backgroundColor = UIColor(hex:0x3c86f8)
button.titleLabel?.font = UIFont.PFSC_M(ofSize: 15)
button.contentHorizontalAlignment = .center
button.setTitle("同意", for: .normal)
button.setTitleColor( UIColor(hex:0xffffff), for: .normal)
button.layer.cornerRadius = kCornerRadius6
button.addTarget(self, action: #selector(agree), for: .touchUpInside)
return button
}()
centerView.addSubview(agreeButton)
agreeButton.snp.makeConstraints { make in
make.right.equalTo(-16)
make.bottom.equalTo(-21)
make.width.equalTo(128)
make.height.equalTo(45)
}
}
@objc func agree() {
if let block = self.agreeBlock {
block()
}
dismiss()
}
@objc private func handleTap(_ sender: AnyObject?) {
print("处理点击手势")
dismiss()
}
@objc func disagree() {
dismiss()
}
func dismiss() {
removeFromSuperview()
}
}
extension YHCommonAlertView: UIGestureRecognizerDelegate {
func gestureRecognizer(_ gestureRecognizer:UIGestureRecognizer, shouldReceive touch:UITouch) -> Bool {
if touch.view == self {
return true
}
return false
}
}
//
// YHMyFileMethodTableViewCell.swift
// galaxy
//
// Created by EDY on 2024/3/13.
// Copyright © 2024 https://www.galaxy-immi.com. All rights reserved.
//
import UIKit
enum YHMyFileMethodType: Int {
case sign = 0 // 签署
case downLoad = 1 // 下载
case look = 2 // 查看
}
class YHMyFileMethodTableViewCell: UITableViewCell {
typealias Block = (YHMyFileMethodType) -> ()
var block: Block?
var centerView: UIView!
var titleLabel: UILabel!
var subTitleLabel: UILabel!
var signButton: UIButton!
var lookButton: UIButton!
var downLoadButton: UIButton!
var dataSource: YHMySignatureModel? {
didSet {
updateAllViews()
}
}
override func awakeFromNib() {
super.awakeFromNib()
// Initialization code
}
override func setSelected(_ selected: Bool, animated: Bool) {
super.setSelected(selected, animated: animated)
// Configure the view for the selected state
}
required init?(coder: NSCoder) {
super.init(coder: coder)
}
override init(style: UITableViewCell.CellStyle, reuseIdentifier: String?) {
super.init(style: style, reuseIdentifier: reuseIdentifier)
selectionStyle = .none
setupUI()
}
func setupUI() {
backgroundColor = .clear
centerView = {
let view = UIView()
view.backgroundColor = .white
view.layer.cornerRadius = kCornerRadius6
return view
}()
contentView.addSubview(centerView)
centerView.snp.makeConstraints { make in
make.left.equalTo(16)
make.right.equalTo(-16)
make.top.equalTo(7)
make.bottom.equalTo(-7)
}
titleLabel = {
let label = UILabel()
label.font = UIFont.PFSC_M(ofSize: 18)
label.textColor = UIColor.mainTextColor
label.text = "电子签"
return label
}()
centerView.addSubview(titleLabel)
titleLabel.snp.makeConstraints { make in
make.left.equalTo(18)
make.right.equalTo(-18)
make.top.equalTo(16)
make.height.equalTo(21)
}
subTitleLabel = {
let label = UILabel()
label.font = UIFont.PFSC_R(ofSize: 16)
label.textColor = UIColor.labelTextColor2
label.textAlignment = .left
label.text = "申明书.doc"
return label
}()
centerView.addSubview(subTitleLabel)
subTitleLabel.snp.makeConstraints { make in
make.height.equalTo(20)
make.left.equalTo(18)
make.right.equalTo(-18)
make.top.equalTo(80)
}
downLoadButton = {
let button = UIButton(type: .custom)
button.backgroundColor = UIColor.brandMainColor.withAlphaComponent(0.08)
button.setTitleColor(UIColor.brandMainColor, for: .normal)
button.layer.cornerRadius = 4
button.layer.borderWidth = 1
button.layer.borderColor = UIColor.brandMainColor.cgColor
button.isSelected = true
button.titleLabel?.font = UIFont.PFSC_M(ofSize: 14)
button.setTitle("下载", for: .normal)
button.addTarget(self, action: #selector(downLoadButtonClick), for: .touchUpInside)
return button
}()
addSubview(downLoadButton)
downLoadButton.snp.makeConstraints { make in
make.right.bottom.equalTo(-25)
make.height.equalTo(20)
make.width.equalTo(55)
}
lookButton = {
let button = UIButton(type: .custom)
button.backgroundColor = UIColor.brandMainColor.withAlphaComponent(0.08)
button.setTitleColor(UIColor.brandMainColor, for: .selected)
button.setTitleColor(UIColor.mainTextColor, for: .normal)
button.layer.cornerRadius = 4
button.layer.borderWidth = 1
button.layer.borderColor = UIColor.brandMainColor.cgColor
button.titleLabel?.font = UIFont.PFSC_M(ofSize: 14)
button.isSelected = true
button.setTitle("查看", for: .normal)
button.addTarget(self, action: #selector(lookButtonClick), for: .touchUpInside)
return button
}()
addSubview(lookButton)
lookButton.snp.makeConstraints { make in
make.right.equalTo(downLoadButton.snp.left).offset(-6)
make.centerY.equalTo(downLoadButton.snp.centerY)
make.height.equalTo(20)
make.width.equalTo(55)
}
signButton = {
let button = UIButton(type: .custom)
button.backgroundColor = UIColor.brandMainColor.withAlphaComponent(0.08)
button.setTitleColor(UIColor.brandMainColor, for: .selected)
button.setTitleColor(UIColor.mainTextColor, for: .normal)
button.layer.cornerRadius = 4
button.layer.borderWidth = 1
button.layer.borderColor = UIColor.brandMainColor.cgColor
button.isSelected = true
button.titleLabel?.font = UIFont.PFSC_M(ofSize: 14)
button.setTitle("签署", for: .normal)
button.addTarget(self, action: #selector(signButtonClick), for: .touchUpInside)
return button
}()
addSubview(signButton)
signButton.snp.makeConstraints { make in
make.right.equalTo(lookButton.snp.left).offset(-6)
make.centerY.equalTo(lookButton.snp.centerY)
make.height.equalTo(20)
make.width.equalTo(55)
}
}
func updateAllViews() {
guard let dataSource = dataSource else { return }
titleLabel.text = dataSource.doc_name
subTitleLabel.text = "\(dataSource.doc_type)"
}
@objc func downLoadButtonClick() {
if let block = block {
block(.downLoad)
}
}
@objc func lookButtonClick() {
if let block = block {
block(.look)
}
}
@objc func signButtonClick() {
if let block = block {
block(.sign)
}
}
}
......@@ -130,7 +130,7 @@ class YHCompanySelectViewController: YHBaseViewController {
@objc func submit() {
if let backLocationStringController = backLocationStringController {
var model = YHCompanyModelListModel()
let model = YHCompanyModelListModel()
model.company_name = searchView.text
backLocationStringController(model)
self.navigationController?.popViewController()
......
......@@ -72,6 +72,8 @@ class YHNewWebViewController: YHBaseViewController, WKUIDelegate, WKNavigationDe
}
func webView(_ webView: WKWebView, decidePolicyFor navigationAction: WKNavigationAction, decisionHandler: @escaping (WKNavigationActionPolicy) -> Void) {
printLog("\(navigationAction.request.url?.absoluteString ?? "")")
// https://www.galaxy-immi.com/
decisionHandler(.allow)
}
......
......@@ -46,7 +46,7 @@ class YHWebViewViewController: YHBaseViewController, WKUIDelegate, WKNavigationD
}
override func viewWillDisappear(_ animated: Bool) {
deinit {
webview.removeObserver(self, forKeyPath: "estimatedProgress")
}
......
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