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

主申请人UI走查修改

parent 420cfea6
......@@ -10,6 +10,7 @@
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 */; };
0435FA832BA2DEB100024EAE /* YHCardButton.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0435FA822BA2DEB100024EAE /* YHCardButton.swift */; };
044867B42BA1953B00DFAD4A /* YHCertificateFilterView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 044867B32BA1953B00DFAD4A /* YHCertificateFilterView.swift */; };
044867B62BA1A03800DFAD4A /* YHCertificateFilterItemCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 044867B52BA1A03800DFAD4A /* YHCertificateFilterItemCell.swift */; };
045EEE792B9F171A0022A143 /* YHPreviewViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 045EED9A2B9F171A0022A143 /* YHPreviewViewModel.swift */; };
......@@ -352,6 +353,7 @@
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>"; };
0435FA822BA2DEB100024EAE /* YHCardButton.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHCardButton.swift; sourceTree = "<group>"; };
044867B32BA1953B00DFAD4A /* YHCertificateFilterView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHCertificateFilterView.swift; sourceTree = "<group>"; };
044867B52BA1A03800DFAD4A /* YHCertificateFilterItemCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHCertificateFilterItemCell.swift; sourceTree = "<group>"; };
045EED9A2B9F171A0022A143 /* YHPreviewViewModel.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = YHPreviewViewModel.swift; sourceTree = "<group>"; };
......@@ -1265,6 +1267,7 @@
045EEE762B9F171A0022A143 /* YHItemView.swift */,
045EEE772B9F171A0022A143 /* YHStepView.swift */,
045EEE782B9F171A0022A143 /* YHMainInformationCardTableViewCell.swift */,
0435FA822BA2DEB100024EAE /* YHCardButton.swift */,
);
path = V;
sourceTree = "<group>";
......@@ -2255,6 +2258,7 @@
A5C5B32B2B57D17600A7C5D1 /* YHDavidCell5.swift in Sources */,
045EEEB82B9F171A0022A143 /* YHWorkExampleMessageView.swift in Sources */,
045EEEA22B9F171A0022A143 /* YHWorkExperienceProjectModel.swift in Sources */,
0435FA832BA2DEB100024EAE /* YHCardButton.swift in Sources */,
045EEECA2B9F171A0022A143 /* YHMyDocumentsListViewController.swift in Sources */,
04E86E0B2B70C13300A35F4B /* YHCodeSueecssViewController.swift in Sources */,
045EEF052B9F171A0022A143 /* YHFormItemExpireDateCell.swift in Sources */,
......
......@@ -21,6 +21,8 @@ class YHMainApplicantInformationViewController: YHBaseViewController {
super.viewDidLoad()
viewModel = YHMainApplicantInformationViewModel()
gk_navTitle = "主申请人信息填写"
gk_navBackgroundColor = .white
gk_navBarAlpha = 1
setView()
getData()
// Do any additional setup after loading the view.
......@@ -68,7 +70,7 @@ class YHMainApplicantInformationViewController: YHBaseViewController {
}
tableView = {
let tableView = UITableView(frame:.zero, style:.plain)
let tableView = UITableView(frame:.zero, style:.grouped)
if #available(iOS 11.0, *) {
tableView.contentInsetAdjustmentBehavior = .never
}
......@@ -194,4 +196,21 @@ extension YHMainApplicantInformationViewController: UITableViewDelegate, UITable
return CGFloat(h + 52 + 14)
}
}
func tableView(_ tableView: UITableView, viewForHeaderInSection section: Int) -> UIView? {
let view = UIView(frame: CGRect(x: 0, y: 0, width: KScreenWidth, height: 7))
return view
}
func tableView(_ tableView: UITableView, heightForHeaderInSection section: Int) -> CGFloat {
return 7
}
func tableView(_ tableView: UITableView, viewForFooterInSection section: Int) -> UIView? {
return UIView()
}
func tableView(_ tableView: UITableView, heightForFooterInSection section: Int) -> CGFloat {
return 0.01
}
}
......@@ -28,7 +28,7 @@ class YHAddressPickView: UIView {
case .provinces:
/// 选择省份时,有上面的热门城市view.没有滚动选择type的titleScrollView.没有已选择label.
self.tableView.tableHeaderView = tableViewHeaderView
self.tableView.frame = CGRect(x: 0, y: 42, width: UIScreen.main.bounds.width, height: 458)
self.tableView.frame = CGRect(x: 0, y: 52, width: UIScreen.main.bounds.width, height: 526)
self.titleSV.isHidden = true
self.leftLabel.isHidden = true
/// 将所有选中数据清空
......@@ -46,7 +46,7 @@ class YHAddressPickView: UIView {
button.isSelected = true
}
}
self.underLine.center = CGPoint(x: self.buttonArr[1].center.x, y: self.underLine.center.y)
// self.underLine.center = CGPoint(x: self.buttonArr[1].center.x, y: self.underLine.center.y)
self.dataArray = locationModel?.provincesArray.map({ model in
model.provincesName
})
......@@ -54,7 +54,7 @@ class YHAddressPickView: UIView {
case .city:
/// 选择城市时没有热门城市view,并将titleSV显示出来
self.tableView.tableHeaderView = UIView()
self.tableView.frame = CGRect(x: 0, y: 136, width: UIScreen.main.bounds.width, height: 367)
self.tableView.frame = CGRect(x: 0, y: 136, width: UIScreen.main.bounds.width, height: 427)
self.titleSV.isHidden = false
self.leftLabel.isHidden = false
/// 将省份选择保留,将城市与地区数据清空
......@@ -73,7 +73,7 @@ class YHAddressPickView: UIView {
}
/// 滚动titleSV中button下滚动的Line
UIView.animate(withDuration: 0.3, animations: {() -> Void in
self.underLine.center = CGPoint(x: self.buttonArr[1].center.x, y: self.underLine.center.y)
// self.underLine.center = CGPoint(x: self.buttonArr[1].center.x, y: self.underLine.center.y)
})
self.dataArray = provincesModel?.cityArray.map({ model in
model.cityName
......@@ -112,41 +112,43 @@ class YHAddressPickView: UIView {
/// 当前tableView使用的数据源
private var dataArray: [String]?
private let titleLabel: UILabel = {
let label = UILabel(frame: CGRect(x: (UIScreen.main.bounds.width - 100) / 2, y: 9, width: 100, height: 24))
label.textColor = UIColor(red: 51/255, green: 51/255, blue: 51/255, alpha: 1)
let label = UILabel(frame: CGRect(x: (UIScreen.main.bounds.width - 150) / 2, y: 16, width: 150, height: 24))
label.textColor = UIColor.mainTextColor
label.text = "选择国家地区"
label.textAlignment = .center
label.font = UIFont.boldSystemFont(ofSize: 16)
label.font = UIFont.PFSC_M(ofSize: 17)
return label
}()
private let rightCancelButton: UIButton = {
let button = UIButton(frame: CGRect(x: UIScreen.main.bounds.width - 42, y: 11, width: 18, height: 18))
button.setImage(UIImage(named: "BaseVC_cancel"), for: .normal)
let button = UIButton(frame: CGRect(x: UIScreen.main.bounds.width - 43, y: 16, width: 24, height: 24))
button.setImage(UIImage(named: "address_close"), for: .normal)
return button
}()
private let leftLabel: UILabel = {
let label = UILabel(frame: CGRect(x: 24, y: 43, width: 40, height: 18))
let label = UILabel(frame: CGRect(x: 24, y: 52, width: 100, height: 18))
label.text = "已选择"
label.textColor = UIColor(red: 102/255, green: 102/255, blue: 102/255, alpha: 1)
label.font = UIFont.systemFont(ofSize: 12)
label.textColor = UIColor.mainTextColor
label.font = UIFont.PFSC_M(ofSize: 14)
label.isHidden = true
return label
}()
/// 热门城市数组,可修改,若修改数量需要修改下方tableViewHeaderView.frame;若修改城市需要修改onClickHotCity()方法来实现点击跳转功能
private let hotCityArray = ["北京","上海","广州","深圳","杭州","南京","苏州","天津","武汉","长沙","重庆","成都"]
private let hotCityArray = ["北京","上海","广州","深圳","东莞","杭州","成都","南京"]
private lazy var tableViewHeaderView: UIView = {
let view = UIView(frame: CGRect(x: 0, y: 0, width: UIScreen.main.bounds.width, height: 160))
let label = UILabel(frame: CGRect(x: 24, y: 0, width: 50, height: 18))
label.textColor = UIColor(red: 102/255, green: 102/255, blue: 102/255, alpha: 1)
label.font = UIFont.systemFont(ofSize: 12)
let view = UIView(frame: CGRect(x: 0, y: 0, width: UIScreen.main.bounds.width, height: 120))
let label = UILabel(frame: CGRect(x: 24, y: 0, width: 100, height: 18))
label.textColor = UIColor.mainTextColor
label.font = UIFont.PFSC_M(ofSize: 14)
label.text = "热门城市"
view.addSubview(label)
for i in 0..<12 {
let button: UIButton = UIButton(frame: CGRect(x: CGFloat(24 + 80 * (i % 4)), y: CGFloat(28 + 40 * (i / 4)), width: 80, height: 40))
for i in 0..<8 {
let button: UIButton = UIButton(frame: CGRect(x: CGFloat(20 + 86 * (i % 4)), y: CGFloat(28 + 40 * (i / 4)), width: 74, height: 32))
button.setTitle(hotCityArray[i], for: .normal)
button.setTitleColor(UIColor(red: 102/255, green: 102/255, blue: 102/255, alpha: 1), for: .normal)
button.titleLabel?.font = UIFont.systemFont(ofSize: 12)
button.setTitleColor(UIColor.mainTextColor, for: .normal)
button.titleLabel?.font = UIFont.PFSC_R(ofSize: 13)
button.addTarget(self, action: #selector(onClickHotCity(sender:)), for: .touchUpInside)
button.layer.cornerRadius = 16
button.backgroundColor = UIColor.contentBkgColor
button.tag = i
view.addSubview(button)
}
......@@ -155,8 +157,8 @@ class YHAddressPickView: UIView {
/// 上方选择省份城市地区的滚动scrollView
private var titleSV: UIScrollView!
/// titleSV上button下的滚动线
private var underLine = UIView()
private var tableView = UITableView(frame: CGRect(x: 0, y:42 , width: UIScreen.main.bounds.width, height: 458))
// private var underLine = UIView()
private var tableView = UITableView(frame: CGRect(x: 0, y:52 , width: UIScreen.main.bounds.width, height: 526))
init(frame: CGRect, selectColor: UIColor, selectedProvince: String? = nil, selectedCity: String? = nil) {
self.selectColor = selectColor
......@@ -183,27 +185,33 @@ class YHAddressPickView: UIView {
titleSV.removeFromSuperview()
}
buttonArr = []
titleSV = UIScrollView(frame: CGRect(x: 0, y: 72, width: UIScreen.main.bounds.width, height: 44))
self.underLine = UIView(frame: CGRect(x: 0, y: 40, width: 30, height: 2))
self.underLine.backgroundColor = selectColor
titleSV = UIScrollView(frame: CGRect(x: 0, y: 92, width: UIScreen.main.bounds.width, height: 44))
// self.underLine = UIView(frame: CGRect(x: 0, y: 40, width: 30, height: 2))
// self.underLine.backgroundColor = UIColor.brandMainColor
for i in 0..<2 {
let button = UIButton(frame: CGRect(x: 24 + CGFloat(i) * (UIScreen.main.bounds.width - 47) / 2, y: 0, width: UIScreen.main.bounds.width / 3, height: 44))
let button = UIButton(frame: CGRect(x: 21 + CGFloat(i) * 86, y: 0, width: 74, height: 32))
button.tag = Int(i)
if i == 1 {
button.isSelected = true
underLine.center.x = button.center.x
}
button.setTitle("请选择", for: .normal)
button.setTitleColor(UIColor(red: 51/255, green: 51/255, blue: 51/255, alpha: 1), for: .normal)
button.setTitleColor(selectColor, for: .selected)
button.titleLabel?.font = UIFont.systemFont(ofSize: 12)
button.setTitleColor(UIColor.mainTextColor, for: .normal)
button.setTitleColor(UIColor.brandMainColor, for: .selected)
button.titleLabel?.font = UIFont.PFSC_R(ofSize: 13)
button.titleLabel?.adjustsFontSizeToFitWidth = true
button.setBackgroundColor(color: UIColor.contentBkgColor, forState: .normal)
button.setBackgroundColor(color: UIColor.brandMainColor.withAlphaComponent(0.08), forState: .selected)
button.layer.borderColor = UIColor.brandMainColor.cgColor
button.layer.borderWidth = 0
button.layer.cornerRadius = 16
button.addTarget(self, action: #selector(onClickTitlebutton(sender:)), for: .touchUpInside)
if i == 1 {
button.isSelected = true
button.layer.borderWidth = 1
// underLine.center.x = button.center.x
}
buttonArr.append(button)
titleSV.addSubview(button)
}
titleSV.showsVerticalScrollIndicator = false
titleSV.addSubview(self.underLine)
// titleSV.addSubview(self.underLine)
titleSV.contentSize = CGSize(width: UIScreen.main.bounds.width, height: 44)
titleSV.isHidden = true
self.addSubview(titleSV)
......@@ -225,9 +233,8 @@ class YHAddressPickView: UIView {
}
}
@objc private func onClickHotCity(sender: UIButton) {
let hotProvince = ["北京市","上海市","广东省","广东省","浙江省","江苏省","江苏省","天津市","湖北省","湖南省","重庆市","四川省"]
let hotCity = ["市辖区","市辖区","广州市","深圳市","杭州市","南京市","苏州市","天津市","武汉市","长沙市","市辖区","成都市"]
let hotProvince = ["北京市","上海市","广东省","广东省","广东省","浙江省","四川省","江苏省"]
let hotCity = ["市辖区","市辖区","广州市","深圳市","东莞市","杭州市","成都市","南京市"]
let tag = sender.tag
setHotCityData(province: hotProvince[tag], city: hotCity[tag])
}
......
......@@ -13,9 +13,9 @@ class YHAddressPickViewTableViewCell: UITableViewCell {
static let identifier = "YHAddressPickViewTableViewCell"
let label: UILabel = {
let label = UILabel(frame: CGRect(x: 42, y: 8, width: 200, height: 24))
label.font = UIFont.systemFont(ofSize: 14)
label.textColor = UIColor(red: 51/255, green: 51/255, blue: 51/255, alpha: 1)
let label = UILabel(frame: CGRect(x: 20, y: 8, width: 200, height: 24))
label.font = UIFont.PFSC_R(ofSize: 14)
label.textColor = UIColor.mainTextColor
return label
}()
override init(style: UITableViewCell.CellStyle, reuseIdentifier: String?) {
......@@ -36,9 +36,9 @@ class YHAddressPickViewFirstTableViewCell: UITableViewCell {
static let identifier = "YHAddressPickViewFirstTableViewCell"
let label: UILabel = {
let label = UILabel(frame: CGRect(x: 24, y: 11.5, width: 100, height: 17))
label.font = UIFont.systemFont(ofSize: 12)
label.textColor = UIColor(red: 102/255, green: 102/255, blue: 102/255, alpha: 1)
let label = UILabel(frame: CGRect(x: 20, y: 11.5, width: 100, height: 17))
label.font = UIFont.PFSC_M(ofSize: 14)
label.textColor = UIColor.mainTextColor
return label
}()
......
......@@ -32,7 +32,7 @@ class YHAddressViewController: UIViewController {
public var selectCity: String?
public lazy var containV: YHAddressPickView = {
let view = YHAddressPickView(frame: CGRect(x: 0, y: UIScreen.main.bounds.height - 550, width: UIScreen.main.bounds.width, height: 550),selectColor: selectColor,selectedProvince: selectProvince,selectedCity: selectCity)
let view = YHAddressPickView(frame: CGRect(x: 0, y: UIScreen.main.bounds.height - 628, width: UIScreen.main.bounds.width, height: 628),selectColor: selectColor,selectedProvince: selectProvince,selectedCity: selectCity)
view.backOnClickCancel = {
[weak self] in
self?.onClickCancel()
......@@ -44,6 +44,7 @@ class YHAddressViewController: UIViewController {
self?.onClickCancel()
}
}
view.layer.cornerRadius = kCornerRadius8
return view
}()
public var backgroundView:UIView = {
......
//
// YHCardButton.swift
// galaxy
//
// Created by EDY on 2024/3/14.
// Copyright © 2024 https://www.galaxy-immi.com. All rights reserved.
//
import UIKit
class YHCardButton: UIButton {
var topImageView: UIImageView!
var bottomTitleLabel: UILabel!
override init(frame: CGRect) {
super.init(frame: frame)
setView()
}
required init?(coder: NSCoder) {
fatalError("init(coder:) has not been implemented")
}
func setView() {
topImageView = {
let view = UIImageView()
return view
}()
addSubview(topImageView)
topImageView.snp.makeConstraints { make in
make.centerX.equalToSuperview()
make.top.equalTo(22)
make.width.height.equalTo(24)
}
bottomTitleLabel = {
let label = UILabel()
label.font = UIFont.PFSC_M(ofSize: 12)
label.textAlignment = .center
label.textColor = UIColor.brandMainColor
return label
}()
addSubview(bottomTitleLabel)
bottomTitleLabel.snp.makeConstraints { make in
make.left.right.equalToSuperview()
make.height.equalTo(20)
make.bottom.equalTo(-15)
}
}
func setContent(_ image: String, _ title: String) {
topImageView.removeFromSuperview()
topImageView = nil
topImageView = {
let view = UIImageView()
return view
}()
addSubview(topImageView)
topImageView.snp.makeConstraints { make in
make.centerX.equalToSuperview()
make.top.equalTo(22)
make.width.height.equalTo(24)
}
bottomTitleLabel.text = title
topImageView.image = UIImage(named: image)
}
// 开始旋转动画的函数
func startRotationAnimation() {
let rotationAnimation = CAKeyframeAnimation(keyPath: "transform.rotation")
rotationAnimation.values = [0, Double.pi / 2, Double.pi, 3 * Double.pi / 2, 2 * Double.pi]
rotationAnimation.duration = 1
rotationAnimation.repeatCount = Float.infinity
topImageView.layer.add(rotationAnimation, forKey: "rotationAnimation")
}
// 停止旋转动画的函数
func stopRotationAnimation() {
topImageView.removeFromSuperview()
}
}
......@@ -74,7 +74,7 @@ class YHCardExampleView: UIView {
label.text = "身份证示例模板"
label.font = UIFont.PFSC_M(ofSize: 17)
label.textColor = UIColor.mainTextColor
label.textAlignment = .left
label.textAlignment = .center
return label
}()
centerView.addSubview(titleLabel)
......@@ -130,6 +130,8 @@ class YHCardExampleView: UIView {
topImageView = {
let imageView = UIImageView()
imageView.image = UIImage(named: "service_card_id_back")
imageView.layer.cornerRadius = kCornerRadius6
imageView.clipsToBounds = true
return imageView
}()
centerView.addSubview(topImageView)
......@@ -143,6 +145,8 @@ class YHCardExampleView: UIView {
bottomImageView = {
let imageView = UIImageView()
imageView.image = UIImage(named: "service_card_passport_back")
imageView.layer.cornerRadius = kCornerRadius6
imageView.clipsToBounds = true
return imageView
}()
centerView.addSubview(bottomImageView)
......@@ -161,6 +165,7 @@ class YHCardExampleView: UIView {
button.setTitle("知道了", for: .normal)
button.setTitleColor( UIColor(hex:0xffffff), for: .normal)
button.layer.cornerRadius = kCornerRadius6
button.clipsToBounds = true
button.addTarget(self, action: #selector(dismiss), for: .touchUpInside)
return button
}()
......@@ -171,6 +176,9 @@ class YHCardExampleView: UIView {
make.bottom.equalTo(-42)
make.height.equalTo(48)
}
bottomButton.layoutIfNeeded()
bottomButton.addYinHeGradualLayer()
let array = ["四角完整", "照片清晰", "亮度均匀"]
for i in 0 ..< array.count {
......
......@@ -228,7 +228,7 @@ extension YHImagePickerView: UIGestureRecognizerDelegate {
extension YHImagePickerView: UINavigationControllerDelegate, UIImagePickerControllerDelegate {
func imagePickerController(_ picker: UIImagePickerController, didFinishPickingMediaWithInfo info: [UIImagePickerController.InfoKey : Any]) {
if let image = info[UIImagePickerController.InfoKey.originalImage] as? UIImage {
uploadImage(image: image)
// uploadImage(image: image)
if let block = backImage {
block(image)
self.dismiss()
......
......@@ -23,8 +23,8 @@ class YHMainInformationCardTableViewCell: UITableViewCell {
var exampleButton: UIButton!
var frontLabel: UILabel!
var backSurfaceLabel: UILabel!
var frontImageButton: UIButton!
var backSurfaceImageButton: UIButton!
var frontImageButton: YHCardButton!
var backSurfaceImageButton: YHCardButton!
var frontDeleteButton: UIButton!
var backSurfaceDeleteButton: UIButton!
var activityIndicator: UIActivityIndicatorView!
......@@ -35,16 +35,18 @@ class YHMainInformationCardTableViewCell: UITableViewCell {
self.viewModel.getPublicImageUrl(viewModel.mainModel.certificates.cn_identity_card.img_front) {[weak self] success, error in
guard let self = self else { return }
guard let url = success else { return }
self.frontImageButton.kf.setBackgroundImage(with: URL(string: success), for: .normal)
self.frontImageButton.kf.setBackgroundImage(with: URL(string: url), for: .normal)
self.frontDeleteButton.isHidden = false
self.frontImageButton.setContent("", "")
}
}
if viewModel.mainModel.certificates.cn_identity_card.img_back.count != 0 {
self.viewModel.getPublicImageUrl(viewModel.mainModel.certificates.cn_identity_card.img_back) {[weak self] success, error in
guard let self = self else { return }
guard let url = success else { return }
self.backSurfaceImageButton.kf.setBackgroundImage(with: URL(string: success), for: .normal)
self.backSurfaceImageButton.kf.setBackgroundImage(with: URL(string: url), for: .normal)
self.backSurfaceDeleteButton.isHidden = false
self.backSurfaceImageButton.setContent("", "")
}
}
} else {
......@@ -52,16 +54,18 @@ class YHMainInformationCardTableViewCell: UITableViewCell {
self.viewModel.getPublicImageUrl(viewModel.mainModel.certificates.hk_macao_pass.img_front) {[weak self] success, error in
guard let self = self else { return }
guard let url = success else { return }
self.frontImageButton.kf.setBackgroundImage(with: URL(string: success), for: .normal)
self.frontImageButton.kf.setBackgroundImage(with: URL(string: url), for: .normal)
self.frontDeleteButton.isHidden = false
self.frontImageButton.setContent("", "")
}
}
if viewModel.mainModel.certificates.hk_macao_pass.img_back.count != 0 {
self.viewModel.getPublicImageUrl(viewModel.mainModel.certificates.hk_macao_pass.img_back) {[weak self] success, error in
guard let self = self else { return }
guard let url = success else { return }
self.backSurfaceImageButton.kf.setBackgroundImage(with: URL(string: success), for: .normal)
self.backSurfaceImageButton.kf.setBackgroundImage(with: URL(string: url), for: .normal)
self.backSurfaceDeleteButton.isHidden = false
self.backSurfaceImageButton.setContent("", "")
}
}
}
......@@ -74,11 +78,14 @@ class YHMainInformationCardTableViewCell: UITableViewCell {
titleLabel.text = "中国身份证(选填)"
frontLabel.text = "身份证人像面"
backSurfaceLabel.text = "身份证国徽面"
frontImageButton.setBackgroundImage(UIImage(named: "service_cn_card_front"), for: .normal)
backSurfaceImageButton.setBackgroundImage(UIImage(named: "service_cn_card_back"), for: .normal)
case .passport:
titleLabel.text = "港澳通行证(选填)"
frontLabel.text = "港澳通行证正面"
backSurfaceLabel.text = "港澳通行证反面"
frontImageButton.setBackgroundImage(UIImage(named: "service_hk_card_front"), for: .normal)
backSurfaceImageButton.setBackgroundImage(UIImage(named: "service_hk_card_back"), for: .normal)
}
}
}
......@@ -149,7 +156,7 @@ class YHMainInformationCardTableViewCell: UITableViewCell {
}()
centerView.addSubview(exampleButton)
exampleButton.snp.makeConstraints { make in
make.left.equalTo(titleLabel.snp.right)
make.left.equalTo(titleLabel.snp.right).offset(8)
make.centerY.equalTo(titleLabel.snp.centerY)
make.height.equalTo(14)
make.width.equalTo(48)
......@@ -199,9 +206,12 @@ class YHMainInformationCardTableViewCell: UITableViewCell {
}
frontImageButton = {
let button = UIButton(type: .custom)
button.setBackgroundImage(UIImage(named: "service_card_front"), for: .normal)
let button = YHCardButton()
button.setContent("card_upload", "点击上传")
button.setBackgroundImage(UIImage(named: "service_cn_card_front"), for: .normal)
button.addTarget(self, action: #selector(frontImageClick), for: .touchUpInside)
button.layer.cornerRadius = 4
button.clipsToBounds = true
return button
}()
centerView.addSubview(frontImageButton)
......@@ -228,9 +238,12 @@ class YHMainInformationCardTableViewCell: UITableViewCell {
}
backSurfaceImageButton = {
let button = UIButton(type: .custom)
button.setBackgroundImage(UIImage(named: "service_card_back"), for: .normal)
let button = YHCardButton()
button.setContent("card_upload", "点击上传")
button.setBackgroundImage(UIImage(named: "service_cn_card_back"), for: .normal)
button.addTarget(self, action: #selector(backSurfaceImageClick), for: .touchUpInside)
button.layer.cornerRadius = 4
button.clipsToBounds = true
return button
}()
centerView.addSubview(backSurfaceImageButton)
......@@ -294,12 +307,8 @@ class YHMainInformationCardTableViewCell: UITableViewCell {
}
YHImagePickerView.show() {[weak self] image in
guard let self = self else { return }
self.activityIndicator.snp.remakeConstraints { make in
make.center.equalTo(self.frontImageButton.snp.center)
make.height.equalTo(25)
make.width.equalTo(25)
}
self.activityIndicator.startAnimating()
self.frontImageButton.setContent("card_loading", "上传中")
self.frontImageButton.startRotationAnimation()
self.viewModel.uploadImage(image) {[weak self] success, error in
guard let self = self else { return }
guard let url = success else { return }
......@@ -312,7 +321,8 @@ class YHMainInformationCardTableViewCell: UITableViewCell {
if self.type == .identity {
self.viewModel.requestCnIDCardMessage(url, isBack: 0) {[weak self] success, error in
guard let self = self else { return }
self.activityIndicator.stopAnimating()
self.frontImageButton.stopRotationAnimation()
self.frontImageButton.setContent("", "")
if success {
} else {
YHHUD.flash(message: error?.errorMsg ?? "")
......@@ -321,7 +331,8 @@ class YHMainInformationCardTableViewCell: UITableViewCell {
} else {
self.viewModel.requestHkIDCardMessage(url, isBack: 0) {[weak self] success, error in
guard let self = self else { return }
self.activityIndicator.stopAnimating()
self.frontImageButton.stopRotationAnimation()
self.frontImageButton.setContent("", "")
if success {
} else {
......@@ -352,12 +363,8 @@ class YHMainInformationCardTableViewCell: UITableViewCell {
}
YHImagePickerView.show() {[weak self] image in
guard let self = self else { return }
self.activityIndicator.snp.remakeConstraints { make in
make.center.equalTo(self.backSurfaceImageButton.snp.center)
make.height.equalTo(25)
make.width.equalTo(25)
}
self.activityIndicator.startAnimating()
self.backSurfaceImageButton.setContent("card_loading", "上传中")
self.backSurfaceImageButton.startRotationAnimation()
self.viewModel.uploadImage(image) {[weak self] success, error in
guard let self = self else { return }
guard let url = success else { return }
......@@ -370,7 +377,8 @@ class YHMainInformationCardTableViewCell: UITableViewCell {
if self.type == .identity {
self.viewModel.requestCnIDCardMessage(url, isBack: 1) {[weak self] success, error in
guard let self = self else { return }
self.activityIndicator.stopAnimating()
self.backSurfaceImageButton.stopRotationAnimation()
self.backSurfaceImageButton.setContent("", "")
if success {
} else {
......@@ -380,7 +388,8 @@ class YHMainInformationCardTableViewCell: UITableViewCell {
} else {
self.viewModel.requestHkIDCardMessage(url, isBack: 1 ) {[weak self] success, error in
guard let self = self else { return }
self.activityIndicator.stopAnimating()
self.backSurfaceImageButton.stopRotationAnimation()
self.backSurfaceImageButton.setContent("", "")
if success {
} else {
......@@ -402,12 +411,24 @@ class YHMainInformationCardTableViewCell: UITableViewCell {
@objc func frontDeleteClick() {
viewModel.updateModel(self.type, isFront: true, url: "")
frontDeleteButton.isHidden = true
frontImageButton.setBackgroundImage(UIImage(named: "service_card_front"), for: .normal)
switch type {
case .identity:
frontImageButton.setBackgroundImage(UIImage(named: "service_cn_card_front"), for: .normal)
case .passport:
frontImageButton.setBackgroundImage(UIImage(named: "service_hk_card_front"), for: .normal)
}
frontImageButton.setContent("card_upload", "点击上传")
}
@objc func backSurfaceDeleteClick() {
viewModel.updateModel(self.type, isFront: false, url: "")
backSurfaceDeleteButton.isHidden = true
backSurfaceImageButton.setBackgroundImage(UIImage(named: "service_card_back"), for: .normal)
switch type {
case .identity:
backSurfaceImageButton.setBackgroundImage(UIImage(named: "service_cn_card_back"), for: .normal)
case .passport:
backSurfaceImageButton.setBackgroundImage(UIImage(named: "service_hk_card_back"), for: .normal)
}
backSurfaceImageButton.setContent("card_upload", "点击上传")
}
}
......@@ -27,14 +27,22 @@ class YHStepView: UIScrollView {
var stepSpace: CGFloat = 6
var lineWidth: CGFloat {
guard let dataSource = dataSource else { return 0 }
let lineCount = dataSource.count - 1
if dataSource.count <= 2 {
return 157
let contentWidth = 89 * 2 + Int(stepSpace) * 2 * lineCount + 14 * dataSource.count
let width = (KScreenWidth - CGFloat(contentWidth)) / lineCount.cgFloat
return width
} else if dataSource.count <= 4 {
return 75
let contentWidth = 43 * 2 + Int(stepSpace) * 2 * lineCount + 14 * dataSource.count
let width = (KScreenWidth - CGFloat(contentWidth)) / lineCount.cgFloat
return width
} else {
return 55
let contentWidth = 43 * 2 + Int(stepSpace) * 2 * 3 + 14 * 4
let width = (KScreenWidth - CGFloat(contentWidth)) / lineCount.cgFloat
return width
}
}
var spaceWidth: CGFloat {
guard let dataSource = dataSource else { return 0 }
if dataSource.count <= 2 {
......@@ -63,9 +71,10 @@ class YHStepView: UIScrollView {
button.tag = 1000 + i
button.addTarget(self, action: #selector(buttonClick(_:)), for: .touchUpInside)
addSubview(button)
printLog("\(lineWidth)")
button.snp.makeConstraints { make in
make.top.equalTo(28)
make.left.equalTo(spaceWidth + i.cgFloat * (lineWidth + stepSpace * 2 + 14))
make.left.equalTo(spaceWidth + i.cgFloat * (lineWidth + stepSpace * 2) + 14 * i.cgFloat)
make.width.height.equalTo(14)
}
button.YH_clickEdgeInsets = UIEdgeInsets(top: 50, left: 50, bottom: 50, right: 50)
......
......@@ -38,7 +38,7 @@ class YHMainApplicantInformationViewModel: YHBaseViewModel {
let item22 = YHItemModel(id: .id33, isNeed: true, title: "是否在海外居住一年及以上", isUserKeyBoard: false, prompts: "", message: "\(mainModel.is_live_oversea_year)", leftButtonString: "是", rightButtonString: "否", isShowPrompts: isShowPrompt, alertMessage:"请选择是否在海外居住满1年及以上")
let section1 = YHSectionItemModel(title: "现居住地址", models: [item4, item1, item2])
let section11 = YHSectionItemModel(title: "现居住地址", models: [item4, item11, item22])
let item3 = YHItemModel(id: .id5, isNeed: true, title: "是否办理", isUserKeyBoard: false, prompts: "", message: "\(mainModel.is_handled)", leftButtonString: "是", rightButtonString: "否", isShowPrompts: isShowPrompt, alertMessage:"请选择是否办理过港澳通行证")
let item3 = YHItemModel(id: .id5, isNeed: true, title: "是否办理", isUserKeyBoard: false, prompts: "", message: "\(mainModel.is_handled)", leftButtonString: "是", rightButtonString: "否", isShowPrompts: isShowPrompt, alertMessage:"请选择是否办理过港澳通行证")
let section2 = YHSectionItemModel(title: "港澳通行证", models: [item3])
let addressCountry = mainModel.address.country
if addressCountry.contains("中国") {
......
......@@ -5,12 +5,12 @@
"scale" : "1x"
},
{
"filename" : "service_card_back@2x.png",
"filename" : "address_close@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "service_card_back@3x.png",
"filename" : "address_close@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
......
......@@ -5,12 +5,12 @@
"scale" : "1x"
},
{
"filename" : "service_card_front@2x.png",
"filename" : "card_loading@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "service_card_front@3x.png",
"filename" : "card_loading@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
......
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "card_upload@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "card_upload@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "service_cn_card_back@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "service_cn_card_back@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "service_cn_card_front@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "service_cn_card_front@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "service_hk_card_back@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "service_hk_card_back@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "service_hk_card_front@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "service_hk_card_front@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
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