Commit 3ff8dd7a authored by David黄金龙's avatar David黄金龙

Merge branch 'develop' of http://gitlab.galaxy-immi.com/mobile-group/galaxy-iOS into develop

* 'develop' of http://gitlab.galaxy-immi.com/mobile-group/galaxy-iOS:
  // 我的tab UI走查
  主申请人UI走查修改
parents a7e6b985 1959e805
...@@ -10,6 +10,7 @@ ...@@ -10,6 +10,7 @@
041B52872B5657B3007EBCEB /* IMAppKey.swift in Sources */ = {isa = PBXBuildFile; fileRef = 041B52862B5657B3007EBCEB /* IMAppKey.swift */; }; 041B52872B5657B3007EBCEB /* IMAppKey.swift in Sources */ = {isa = PBXBuildFile; fileRef = 041B52862B5657B3007EBCEB /* IMAppKey.swift */; };
0435FA7F2BA178C100024EAE /* YHCommonAlertView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0435FA7E2BA178C100024EAE /* YHCommonAlertView.swift */; }; 0435FA7F2BA178C100024EAE /* YHCommonAlertView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0435FA7E2BA178C100024EAE /* YHCommonAlertView.swift */; };
0435FA812BA186D600024EAE /* YHMyFileMethodTableViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0435FA802BA186D600024EAE /* YHMyFileMethodTableViewCell.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 */; }; 044867B42BA1953B00DFAD4A /* YHCertificateFilterView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 044867B32BA1953B00DFAD4A /* YHCertificateFilterView.swift */; };
044867B62BA1A03800DFAD4A /* YHCertificateFilterItemCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 044867B52BA1A03800DFAD4A /* YHCertificateFilterItemCell.swift */; }; 044867B62BA1A03800DFAD4A /* YHCertificateFilterItemCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 044867B52BA1A03800DFAD4A /* YHCertificateFilterItemCell.swift */; };
044867B82BA1C75700DFAD4A /* YHCertificateUploadFailTipsView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 044867B72BA1C75700DFAD4A /* YHCertificateUploadFailTipsView.swift */; }; 044867B82BA1C75700DFAD4A /* YHCertificateUploadFailTipsView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 044867B72BA1C75700DFAD4A /* YHCertificateUploadFailTipsView.swift */; };
...@@ -354,6 +355,7 @@ ...@@ -354,6 +355,7 @@
041B52862B5657B3007EBCEB /* IMAppKey.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = IMAppKey.swift; sourceTree = "<group>"; }; 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>"; }; 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>"; }; 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>"; }; 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>"; }; 044867B52BA1A03800DFAD4A /* YHCertificateFilterItemCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHCertificateFilterItemCell.swift; sourceTree = "<group>"; };
044867B72BA1C75700DFAD4A /* YHCertificateUploadFailTipsView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHCertificateUploadFailTipsView.swift; sourceTree = "<group>"; }; 044867B72BA1C75700DFAD4A /* YHCertificateUploadFailTipsView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHCertificateUploadFailTipsView.swift; sourceTree = "<group>"; };
...@@ -1269,6 +1271,7 @@ ...@@ -1269,6 +1271,7 @@
045EEE762B9F171A0022A143 /* YHItemView.swift */, 045EEE762B9F171A0022A143 /* YHItemView.swift */,
045EEE772B9F171A0022A143 /* YHStepView.swift */, 045EEE772B9F171A0022A143 /* YHStepView.swift */,
045EEE782B9F171A0022A143 /* YHMainInformationCardTableViewCell.swift */, 045EEE782B9F171A0022A143 /* YHMainInformationCardTableViewCell.swift */,
0435FA822BA2DEB100024EAE /* YHCardButton.swift */,
); );
path = V; path = V;
sourceTree = "<group>"; sourceTree = "<group>";
...@@ -2271,6 +2274,7 @@ ...@@ -2271,6 +2274,7 @@
A5C5B32B2B57D17600A7C5D1 /* YHDavidCell5.swift in Sources */, A5C5B32B2B57D17600A7C5D1 /* YHDavidCell5.swift in Sources */,
045EEEB82B9F171A0022A143 /* YHWorkExampleMessageView.swift in Sources */, 045EEEB82B9F171A0022A143 /* YHWorkExampleMessageView.swift in Sources */,
045EEEA22B9F171A0022A143 /* YHWorkExperienceProjectModel.swift in Sources */, 045EEEA22B9F171A0022A143 /* YHWorkExperienceProjectModel.swift in Sources */,
0435FA832BA2DEB100024EAE /* YHCardButton.swift in Sources */,
045EEECA2B9F171A0022A143 /* YHMyDocumentsListViewController.swift in Sources */, 045EEECA2B9F171A0022A143 /* YHMyDocumentsListViewController.swift in Sources */,
04E86E0B2B70C13300A35F4B /* YHCodeSueecssViewController.swift in Sources */, 04E86E0B2B70C13300A35F4B /* YHCodeSueecssViewController.swift in Sources */,
045EEF052B9F171A0022A143 /* YHFormItemExpireDateCell.swift in Sources */, 045EEF052B9F171A0022A143 /* YHFormItemExpireDateCell.swift in Sources */,
......
...@@ -21,6 +21,8 @@ class YHMainApplicantInformationViewController: YHBaseViewController { ...@@ -21,6 +21,8 @@ class YHMainApplicantInformationViewController: YHBaseViewController {
super.viewDidLoad() super.viewDidLoad()
viewModel = YHMainApplicantInformationViewModel() viewModel = YHMainApplicantInformationViewModel()
gk_navTitle = "主申请人信息填写" gk_navTitle = "主申请人信息填写"
gk_navBackgroundColor = .white
gk_navBarAlpha = 1
setView() setView()
getData() getData()
// Do any additional setup after loading the view. // Do any additional setup after loading the view.
...@@ -68,7 +70,7 @@ class YHMainApplicantInformationViewController: YHBaseViewController { ...@@ -68,7 +70,7 @@ class YHMainApplicantInformationViewController: YHBaseViewController {
} }
tableView = { tableView = {
let tableView = UITableView(frame:.zero, style:.plain) let tableView = UITableView(frame:.zero, style:.grouped)
if #available(iOS 11.0, *) { if #available(iOS 11.0, *) {
tableView.contentInsetAdjustmentBehavior = .never tableView.contentInsetAdjustmentBehavior = .never
} }
...@@ -194,4 +196,21 @@ extension YHMainApplicantInformationViewController: UITableViewDelegate, UITable ...@@ -194,4 +196,21 @@ extension YHMainApplicantInformationViewController: UITableViewDelegate, UITable
return CGFloat(h + 52 + 14) 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
}
} }
...@@ -13,9 +13,9 @@ class YHAddressPickViewTableViewCell: UITableViewCell { ...@@ -13,9 +13,9 @@ class YHAddressPickViewTableViewCell: UITableViewCell {
static let identifier = "YHAddressPickViewTableViewCell" static let identifier = "YHAddressPickViewTableViewCell"
let label: UILabel = { let label: UILabel = {
let label = UILabel(frame: CGRect(x: 42, y: 8, width: 200, height: 24)) let label = UILabel(frame: CGRect(x: 20, y: 8, width: 200, height: 24))
label.font = UIFont.systemFont(ofSize: 14) label.font = UIFont.PFSC_R(ofSize: 14)
label.textColor = UIColor(red: 51/255, green: 51/255, blue: 51/255, alpha: 1) label.textColor = UIColor.mainTextColor
return label return label
}() }()
override init(style: UITableViewCell.CellStyle, reuseIdentifier: String?) { override init(style: UITableViewCell.CellStyle, reuseIdentifier: String?) {
...@@ -36,9 +36,9 @@ class YHAddressPickViewFirstTableViewCell: UITableViewCell { ...@@ -36,9 +36,9 @@ class YHAddressPickViewFirstTableViewCell: UITableViewCell {
static let identifier = "YHAddressPickViewFirstTableViewCell" static let identifier = "YHAddressPickViewFirstTableViewCell"
let label: UILabel = { let label: UILabel = {
let label = UILabel(frame: CGRect(x: 24, y: 11.5, width: 100, height: 17)) let label = UILabel(frame: CGRect(x: 20, y: 11.5, width: 100, height: 17))
label.font = UIFont.systemFont(ofSize: 12) label.font = UIFont.PFSC_M(ofSize: 14)
label.textColor = UIColor(red: 102/255, green: 102/255, blue: 102/255, alpha: 1) label.textColor = UIColor.mainTextColor
return label return label
}() }()
......
...@@ -32,7 +32,7 @@ class YHAddressViewController: UIViewController { ...@@ -32,7 +32,7 @@ class YHAddressViewController: UIViewController {
public var selectCity: String? public var selectCity: String?
public lazy var containV: YHAddressPickView = { 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 = { view.backOnClickCancel = {
[weak self] in [weak self] in
self?.onClickCancel() self?.onClickCancel()
...@@ -44,6 +44,7 @@ class YHAddressViewController: UIViewController { ...@@ -44,6 +44,7 @@ class YHAddressViewController: UIViewController {
self?.onClickCancel() self?.onClickCancel()
} }
} }
view.layer.cornerRadius = kCornerRadius8
return view return view
}() }()
public var backgroundView:UIView = { 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 { ...@@ -74,7 +74,7 @@ class YHCardExampleView: UIView {
label.text = "身份证示例模板" label.text = "身份证示例模板"
label.font = UIFont.PFSC_M(ofSize: 17) label.font = UIFont.PFSC_M(ofSize: 17)
label.textColor = UIColor.mainTextColor label.textColor = UIColor.mainTextColor
label.textAlignment = .left label.textAlignment = .center
return label return label
}() }()
centerView.addSubview(titleLabel) centerView.addSubview(titleLabel)
...@@ -130,6 +130,8 @@ class YHCardExampleView: UIView { ...@@ -130,6 +130,8 @@ class YHCardExampleView: UIView {
topImageView = { topImageView = {
let imageView = UIImageView() let imageView = UIImageView()
imageView.image = UIImage(named: "service_card_id_back") imageView.image = UIImage(named: "service_card_id_back")
imageView.layer.cornerRadius = kCornerRadius6
imageView.clipsToBounds = true
return imageView return imageView
}() }()
centerView.addSubview(topImageView) centerView.addSubview(topImageView)
...@@ -143,6 +145,8 @@ class YHCardExampleView: UIView { ...@@ -143,6 +145,8 @@ class YHCardExampleView: UIView {
bottomImageView = { bottomImageView = {
let imageView = UIImageView() let imageView = UIImageView()
imageView.image = UIImage(named: "service_card_passport_back") imageView.image = UIImage(named: "service_card_passport_back")
imageView.layer.cornerRadius = kCornerRadius6
imageView.clipsToBounds = true
return imageView return imageView
}() }()
centerView.addSubview(bottomImageView) centerView.addSubview(bottomImageView)
...@@ -161,6 +165,7 @@ class YHCardExampleView: UIView { ...@@ -161,6 +165,7 @@ class YHCardExampleView: UIView {
button.setTitle("知道了", for: .normal) button.setTitle("知道了", for: .normal)
button.setTitleColor( UIColor(hex:0xffffff), for: .normal) button.setTitleColor( UIColor(hex:0xffffff), for: .normal)
button.layer.cornerRadius = kCornerRadius6 button.layer.cornerRadius = kCornerRadius6
button.clipsToBounds = true
button.addTarget(self, action: #selector(dismiss), for: .touchUpInside) button.addTarget(self, action: #selector(dismiss), for: .touchUpInside)
return button return button
}() }()
...@@ -171,6 +176,9 @@ class YHCardExampleView: UIView { ...@@ -171,6 +176,9 @@ class YHCardExampleView: UIView {
make.bottom.equalTo(-42) make.bottom.equalTo(-42)
make.height.equalTo(48) make.height.equalTo(48)
} }
bottomButton.layoutIfNeeded()
bottomButton.addYinHeGradualLayer()
let array = ["四角完整", "照片清晰", "亮度均匀"] let array = ["四角完整", "照片清晰", "亮度均匀"]
for i in 0 ..< array.count { for i in 0 ..< array.count {
......
...@@ -228,7 +228,7 @@ extension YHImagePickerView: UIGestureRecognizerDelegate { ...@@ -228,7 +228,7 @@ extension YHImagePickerView: UIGestureRecognizerDelegate {
extension YHImagePickerView: UINavigationControllerDelegate, UIImagePickerControllerDelegate { extension YHImagePickerView: UINavigationControllerDelegate, UIImagePickerControllerDelegate {
func imagePickerController(_ picker: UIImagePickerController, didFinishPickingMediaWithInfo info: [UIImagePickerController.InfoKey : Any]) { func imagePickerController(_ picker: UIImagePickerController, didFinishPickingMediaWithInfo info: [UIImagePickerController.InfoKey : Any]) {
if let image = info[UIImagePickerController.InfoKey.originalImage] as? UIImage { if let image = info[UIImagePickerController.InfoKey.originalImage] as? UIImage {
uploadImage(image: image) // uploadImage(image: image)
if let block = backImage { if let block = backImage {
block(image) block(image)
self.dismiss() self.dismiss()
......
...@@ -27,14 +27,22 @@ class YHStepView: UIScrollView { ...@@ -27,14 +27,22 @@ class YHStepView: UIScrollView {
var stepSpace: CGFloat = 6 var stepSpace: CGFloat = 6
var lineWidth: CGFloat { var lineWidth: CGFloat {
guard let dataSource = dataSource else { return 0 } guard let dataSource = dataSource else { return 0 }
let lineCount = dataSource.count - 1
if dataSource.count <= 2 { 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 { } 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 { } 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 { var spaceWidth: CGFloat {
guard let dataSource = dataSource else { return 0 } guard let dataSource = dataSource else { return 0 }
if dataSource.count <= 2 { if dataSource.count <= 2 {
...@@ -63,9 +71,10 @@ class YHStepView: UIScrollView { ...@@ -63,9 +71,10 @@ class YHStepView: UIScrollView {
button.tag = 1000 + i button.tag = 1000 + i
button.addTarget(self, action: #selector(buttonClick(_:)), for: .touchUpInside) button.addTarget(self, action: #selector(buttonClick(_:)), for: .touchUpInside)
addSubview(button) addSubview(button)
printLog("\(lineWidth)")
button.snp.makeConstraints { make in button.snp.makeConstraints { make in
make.top.equalTo(28) 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) make.width.height.equalTo(14)
} }
button.YH_clickEdgeInsets = UIEdgeInsets(top: 50, left: 50, bottom: 50, right: 50) button.YH_clickEdgeInsets = UIEdgeInsets(top: 50, left: 50, bottom: 50, right: 50)
......
...@@ -38,7 +38,7 @@ class YHMainApplicantInformationViewModel: YHBaseViewModel { ...@@ -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 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 section1 = YHSectionItemModel(title: "现居住地址", models: [item4, item1, item2])
let section11 = YHSectionItemModel(title: "现居住地址", models: [item4, item11, item22]) 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 section2 = YHSectionItemModel(title: "港澳通行证", models: [item3])
let addressCountry = mainModel.address.country let addressCountry = mainModel.address.country
if addressCountry.contains("中国") { if addressCountry.contains("中国") {
......
...@@ -42,14 +42,16 @@ struct PersonalModuleItem { ...@@ -42,14 +42,16 @@ struct PersonalModuleItem {
class YHMyViewController: YHBaseViewController, ConstraintRelatableTarget { class YHMyViewController: YHBaseViewController, ConstraintRelatableTarget {
lazy var tableView: UITableView = { lazy var tableView: UITableView = {
let tableView = UITableView(frame: CGRect.zero, style:.plain) let tableView = UITableView(frame: CGRect.zero, style:.grouped)
if #available(iOS 11.0, *) { if #available(iOS 11.0, *) {
tableView.contentInsetAdjustmentBehavior = .never tableView.contentInsetAdjustmentBehavior = .never
} }
tableView.estimatedSectionHeaderHeight = 1.0
tableView.showsVerticalScrollIndicator = false tableView.showsVerticalScrollIndicator = false
tableView.tableHeaderView = headerView tableView.tableHeaderView = headerView
tableView.backgroundColor = .clear tableView.backgroundColor = .clear
tableView.separatorStyle = .none tableView.separatorStyle = .none
tableView.bounces = false
tableView.register(YHPersonalCenterCell.self, forCellReuseIdentifier: YHPersonalCenterCell.cellReuseIdentifier) tableView.register(YHPersonalCenterCell.self, forCellReuseIdentifier: YHPersonalCenterCell.cellReuseIdentifier)
tableView.delegate = self tableView.delegate = self
tableView.dataSource = self tableView.dataSource = self
...@@ -67,7 +69,6 @@ class YHMyViewController: YHBaseViewController, ConstraintRelatableTarget { ...@@ -67,7 +69,6 @@ class YHMyViewController: YHBaseViewController, ConstraintRelatableTarget {
PersonalModuleItem(icon: "mine_item_poster", title: "我的海报".local, type:.myPoster), PersonalModuleItem(icon: "mine_item_poster", title: "我的海报".local, type:.myPoster),
PersonalModuleItem(icon: "mine_item_code", title: "我的测评码".local, type:.myTestCode), PersonalModuleItem(icon: "mine_item_code", title: "我的测评码".local, type:.myTestCode),
PersonalModuleItem(icon: "mine_item_appoint", title: "预约银河湾".local, type:.appointGalaxyBay), PersonalModuleItem(icon: "mine_item_appoint", title: "预约银河湾".local, type:.appointGalaxyBay),
PersonalModuleItem(icon: "mine_item_appoint", title: version, type:.appointGalaxyBay), PersonalModuleItem(icon: "mine_item_appoint", title: version, type:.appointGalaxyBay),
] ]
}() }()
...@@ -98,11 +99,6 @@ class YHMyViewController: YHBaseViewController, ConstraintRelatableTarget { ...@@ -98,11 +99,6 @@ class YHMyViewController: YHBaseViewController, ConstraintRelatableTarget {
} }
return view return view
}() }()
private lazy var bgImgView:UIImageView = {
let img = UIImageView(image: UIImage(named: "mine_header_bg"))
return img
}()
override func viewDidLoad() { override func viewDidLoad() {
super.viewDidLoad() super.viewDidLoad()
...@@ -127,15 +123,10 @@ class YHMyViewController: YHBaseViewController, ConstraintRelatableTarget { ...@@ -127,15 +123,10 @@ class YHMyViewController: YHBaseViewController, ConstraintRelatableTarget {
func initView() { func initView() {
gk_navigationBar.isHidden = true gk_navigationBar.isHidden = true
view.addSubview(bgImgView)
view.addSubview(tableView) view.addSubview(tableView)
updateUserUI() updateUserUI()
bgImgView.snp.makeConstraints { make in
make.left.right.top.equalTo(view)
make.height.equalTo(bgImgView.snp.width).multipliedBy(YHUserInfoHeaderView.bgRatio)
}
tableView.snp.makeConstraints { make in tableView.snp.makeConstraints { make in
make.left.right.top.equalToSuperview() make.left.right.top.equalToSuperview()
make.bottom.equalToSuperview().offset(-k_Height_TabBar) make.bottom.equalToSuperview().offset(-k_Height_TabBar)
......
...@@ -9,9 +9,6 @@ ...@@ -9,9 +9,6 @@
import UIKit import UIKit
class YHUserInfoHeaderView: UIView { class YHUserInfoHeaderView: UIView {
static let bgRatio = 312.0/375.0 // 背景图高宽比
static let height = (KScreenWidth*bgRatio + 24)
var settingBlock:(()->Void)? var settingBlock:(()->Void)?
var evaluateBlock:(()->Void)? var evaluateBlock:(()->Void)?
...@@ -34,7 +31,6 @@ class YHUserInfoHeaderView: UIView { ...@@ -34,7 +31,6 @@ class YHUserInfoHeaderView: UIView {
private lazy var bgImgView:UIImageView = { private lazy var bgImgView:UIImageView = {
let imgView = UIImageView(image: UIImage(named: "mine_header_bg")) let imgView = UIImageView(image: UIImage(named: "mine_header_bg"))
imgView.isHidden = true
return imgView return imgView
}() }()
...@@ -66,14 +62,14 @@ class YHUserInfoHeaderView: UIView { ...@@ -66,14 +62,14 @@ class YHUserInfoHeaderView: UIView {
let label = UILabel() let label = UILabel()
label.textColor = UIColor(hexString:"#242424") label.textColor = UIColor(hexString:"#242424")
label.textAlignment = NSTextAlignment.left label.textAlignment = NSTextAlignment.left
label.font = UIFont.PFSC_M(ofSize: 17) label.font = UIFont.PFSC_R(ofSize: 17)
return label return label
}() }()
private lazy var evaluateBtn: UIButton = { private lazy var evaluateBtn: UIButton = {
let btn = UIButton() let btn = UIButton()
btn.setTitle("免费测评", for: .normal) btn.setTitle("免费测评", for: .normal)
btn.titleLabel?.font = UIFont.PFSC_M(ofSize: 12) btn.titleLabel?.font = UIFont.PFSC_R(ofSize: 12)
btn.setTitleColor(.white, for: .normal) btn.setTitleColor(.white, for: .normal)
btn.backgroundColor = UIColor(hexString:"#242424") btn.backgroundColor = UIColor(hexString:"#242424")
btn.layer.cornerRadius = 6.0 btn.layer.cornerRadius = 6.0
...@@ -110,12 +106,13 @@ class YHUserInfoHeaderView: UIView { ...@@ -110,12 +106,13 @@ class YHUserInfoHeaderView: UIView {
} }
static func createView() -> YHUserInfoHeaderView { static func createView() -> YHUserInfoHeaderView {
let view = YHUserInfoHeaderView(frame: CGRect(x: 0, y: 0, width: KScreenWidth, height: Self.height)) let view = YHUserInfoHeaderView(frame: CGRect(x: 0, y: 0, width: KScreenWidth, height:310+k_Height_StatusBar))
return view return view
} }
private func createUI() { private func createUI() {
self.addSubview(bgImgView) self.addSubview(bgImgView)
self.addSubview(settingView) self.addSubview(settingView)
settingView.addSubview(settingBtn) settingView.addSubview(settingBtn)
...@@ -134,8 +131,10 @@ class YHUserInfoHeaderView: UIView { ...@@ -134,8 +131,10 @@ class YHUserInfoHeaderView: UIView {
evaluateLabel.text = "香港身份20秒极速测评".local evaluateLabel.text = "香港身份20秒极速测评".local
bgImgView.snp.makeConstraints { make in bgImgView.snp.makeConstraints { make in
make.left.right.top.equalToSuperview() make.left.right.equalTo(self)
make.height.equalTo(bgImgView.snp.width).multipliedBy(Self.bgRatio) let topMargin = (k_Height_StatusBar > 20.0 ? 0 : -24)
make.top.equalToSuperview().offset(topMargin)
make.height.equalTo(312.0)
} }
settingView.snp.makeConstraints { make in settingView.snp.makeConstraints { make in
...@@ -145,7 +144,7 @@ class YHUserInfoHeaderView: UIView { ...@@ -145,7 +144,7 @@ class YHUserInfoHeaderView: UIView {
} }
settingBtn.snp.makeConstraints { make in settingBtn.snp.makeConstraints { make in
make.size.equalTo(CGSize(width: 21, height: 21)) make.width.height.equalTo(21.0)
make.right.equalToSuperview().offset(-21) make.right.equalToSuperview().offset(-21)
make.centerY.equalToSuperview() make.centerY.equalToSuperview()
} }
...@@ -160,21 +159,21 @@ class YHUserInfoHeaderView: UIView { ...@@ -160,21 +159,21 @@ class YHUserInfoHeaderView: UIView {
make.left.equalTo(avarImgView) make.left.equalTo(avarImgView)
make.top.equalTo(avarImgView.snp.bottom).offset(16) make.top.equalTo(avarImgView.snp.bottom).offset(16)
make.right.equalToSuperview().offset(-30) make.right.equalToSuperview().offset(-30)
make.height.equalTo(30.0) make.height.equalTo(25.0)
} }
infoLabel.snp.makeConstraints { make in infoLabel.snp.makeConstraints { make in
make.left.equalTo(avarImgView) make.left.equalTo(avarImgView)
make.right.equalToSuperview().offset(-30) make.right.equalToSuperview().offset(-30)
make.height.equalTo(18.0) make.height.equalTo(15.0)
make.top.equalTo(userNameLabel.snp.bottom).offset(6) make.top.equalTo(userNameLabel.snp.bottom).offset(10)
} }
evaluateView.snp.makeConstraints { make in evaluateView.snp.makeConstraints { make in
make.left.equalToSuperview().offset(18) make.left.equalToSuperview().offset(10)
make.right.equalToSuperview().offset(-18) make.right.equalToSuperview().offset(-7)
make.height.equalTo(evaluateView.snp.width).multipliedBy(98.0/357.0) make.height.equalTo(98)
make.top.equalTo(infoLabel.snp.bottom).offset(9.0) make.top.equalTo(infoLabel.snp.bottom).offset(17.0)
} }
evaluateBgImgView.snp.makeConstraints { make in evaluateBgImgView.snp.makeConstraints { make in
...@@ -182,15 +181,15 @@ class YHUserInfoHeaderView: UIView { ...@@ -182,15 +181,15 @@ class YHUserInfoHeaderView: UIView {
} }
evaluateLabel.snp.makeConstraints { make in evaluateLabel.snp.makeConstraints { make in
make.left.equalToSuperview().offset(20+13) make.left.equalToSuperview().offset(32)
make.centerY.equalToSuperview() make.top.equalToSuperview().offset(33)
make.height.equalTo(24.0) make.height.equalTo(20.0)
} }
evaluateBtn.snp.makeConstraints { make in evaluateBtn.snp.makeConstraints { make in
make.right.equalToSuperview().offset(-20) make.right.equalToSuperview().offset(-35)
make.centerY.equalToSuperview() make.centerY.equalTo(evaluateLabel)
make.size.equalTo(CGSize(width: 72, height: 30)) make.size.equalTo(CGSize(width: 72, height: 32))
} }
} }
......
...@@ -5,12 +5,12 @@ ...@@ -5,12 +5,12 @@
"scale" : "1x" "scale" : "1x"
}, },
{ {
"filename" : "测评测评@2x.png", "filename" : "Group 2033194041 1@2x.png",
"idiom" : "universal", "idiom" : "universal",
"scale" : "2x" "scale" : "2x"
}, },
{ {
"filename" : "测评测评@3x.png", "filename" : "Group 2033194041 1@3x.png",
"idiom" : "universal", "idiom" : "universal",
"scale" : "3x" "scale" : "3x"
} }
......
...@@ -5,12 +5,12 @@ ...@@ -5,12 +5,12 @@
"scale" : "1x" "scale" : "1x"
}, },
{ {
"filename" : "service_card_back@2x.png", "filename" : "address_close@2x.png",
"idiom" : "universal", "idiom" : "universal",
"scale" : "2x" "scale" : "2x"
}, },
{ {
"filename" : "service_card_back@3x.png", "filename" : "address_close@3x.png",
"idiom" : "universal", "idiom" : "universal",
"scale" : "3x" "scale" : "3x"
} }
......
...@@ -5,12 +5,12 @@ ...@@ -5,12 +5,12 @@
"scale" : "1x" "scale" : "1x"
}, },
{ {
"filename" : "service_card_front@2x.png", "filename" : "card_loading@2x.png",
"idiom" : "universal", "idiom" : "universal",
"scale" : "2x" "scale" : "2x"
}, },
{ {
"filename" : "service_card_front@3x.png", "filename" : "card_loading@3x.png",
"idiom" : "universal", "idiom" : "universal",
"scale" : "3x" "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