Commit 4483f9f0 authored by Steven杜宇's avatar Steven杜宇

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

parents c339aefb 07bba4c0
This diff is collapsed.
//
// YHAdopterBirthViewController.swift
// galaxy
//
// Created by EDY on 2024/8/20.
// Copyright © 2024 https://www.galaxy-immi.com. All rights reserved.
//
import UIKit
class YHAdopterBirthViewController: YHBaseViewController {
var tableView: UITableView!
var nextButton: UIButton!
var clickIndex = -1
var data: [YHItemModel] = []
var viewModel = YHYHAdopterTravelViewModel()
override func viewDidLoad() {
super.viewDidLoad()
gk_navTitle = "上传出生医学证明"
gk_navBackgroundColor = .white
gk_navBarAlpha = 1
setView()
getData()
}
func getData() {
data = viewModel.getChinaDataSource(false)
tableView.reloadData()
}
func setView() {
view.backgroundColor = .white
tableView = {
let tableView = UITableView(frame:.zero, style:.plain)
tableView.contentInsetAdjustmentBehavior = .never
tableView.backgroundColor = .white
tableView.separatorStyle = .none
tableView.delegate = self
tableView.dataSource = self
tableView.register(cellWithClass: YHAdopterExampleTableViewCell.self)
tableView.register(cellWithClass: YHAdopterResidentTableViewCell.self)
tableView.register(cellWithClass: YHAdopterCardExplainTableViewCell.self)
return tableView
}()
view.addSubview(tableView)
tableView.snp.makeConstraints { make in
make.top.equalTo(k_Height_NavigationtBarAndStatuBar + 8)
make.bottom.left.right.equalTo(view)
}
nextButton = {
let button = UIButton(type: .custom)
button.backgroundColor = UIColor.brandMainColor
button.titleLabel?.font = UIFont.PFSC_M(ofSize: 16)
button.contentHorizontalAlignment = .center
button.setTitle("确认上传", for: .normal)
button.setTitleColor( UIColor(hex:0xffffff), for: .normal)
button.layer.cornerRadius = kCornerRadius3
button.addTarget(self, action: #selector(nextStep), for: .touchUpInside)
return button
}()
view.addSubview(nextButton)
nextButton.snp.makeConstraints { make in
make.left.equalTo(16)
make.right.equalTo(-16)
make.bottom.equalTo(-8 - k_Height_safeAreaInsetsBottom())
make.height.equalTo(48)
}
}
@objc func nextStep() {
}
@objc func submit() {
}
}
extension YHAdopterBirthViewController: UITableViewDelegate, UITableViewDataSource {
func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
return 3
}
func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
if indexPath.row == 0 {
let cell = tableView.dequeueReusableCell(withClass: YHAdopterExampleTableViewCell.self)
return cell
}
if indexPath.row == 1 {
let cell = tableView.dequeueReusableCell(withClass: YHAdopterCardExplainTableViewCell.self)
return cell
}
if indexPath.row == 2 {
let cell = tableView.dequeueReusableCell(withClass: YHAdopterResidentTableViewCell.self)
return cell
}
return UITableViewCell()
}
func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat {
if indexPath.row == 0 {
return 118
}
if indexPath.row == 1 {
return 58
}
if indexPath.row == 2 {
return 173
}
return 0
}
func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
}
}
//
// YHAdopterChinaViewController.swift
// galaxy
//
// Created by EDY on 2024/8/20.
// Copyright © 2024 https://www.galaxy-immi.com. All rights reserved.
//
import UIKit
class YHAdopterChinaViewController: YHBaseViewController {
var tableView: UITableView!
var nextButton: UIButton!
var clickIndex = -1
var data: [YHItemModel] = []
var viewModel = YHYHAdopterTravelViewModel()
override func viewDidLoad() {
super.viewDidLoad()
gk_navTitle = "上传中国身份证"
gk_navBackgroundColor = .white
gk_navBarAlpha = 1
setView()
getData()
}
func getData() {
data = viewModel.getChinaDataSource(false)
tableView.reloadData()
}
func setView() {
view.backgroundColor = .white
tableView = {
let tableView = UITableView(frame:.zero, style:.plain)
tableView.contentInsetAdjustmentBehavior = .never
tableView.backgroundColor = .white
tableView.separatorStyle = .none
tableView.delegate = self
tableView.dataSource = self
tableView.register(cellWithClass: YHAdopterExampleTableViewCell.self)
tableView.register(cellWithClass: YHAdopterTravelCardTableViewCell.self)
tableView.register(cellWithClass: YHAdopterTravelItemTableViewCell.self)
tableView.register(cellWithClass: YHAdopterCardExplainTableViewCell.self)
return tableView
}()
view.addSubview(tableView)
tableView.snp.makeConstraints { make in
make.top.equalTo(k_Height_NavigationtBarAndStatuBar + 8)
make.bottom.left.right.equalTo(view)
}
nextButton = {
let button = UIButton(type: .custom)
button.backgroundColor = UIColor.brandMainColor
button.titleLabel?.font = UIFont.PFSC_M(ofSize: 16)
button.contentHorizontalAlignment = .center
button.setTitle("确认上传", for: .normal)
button.setTitleColor( UIColor(hex:0xffffff), for: .normal)
button.layer.cornerRadius = kCornerRadius3
button.addTarget(self, action: #selector(nextStep), for: .touchUpInside)
return button
}()
view.addSubview(nextButton)
nextButton.snp.makeConstraints { make in
make.left.equalTo(16)
make.right.equalTo(-16)
make.bottom.equalTo(-8 - k_Height_safeAreaInsetsBottom())
make.height.equalTo(48)
}
}
@objc func nextStep() {
}
@objc func submit() {
}
}
extension YHAdopterChinaViewController: UITableViewDelegate, UITableViewDataSource {
func numberOfSections(in tableView: UITableView) -> Int {
return 2
}
func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
if section == 0 {
return 3
}
return data.count
}
func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
if indexPath.section == 0 {
if indexPath.row == 0 {
let cell = tableView.dequeueReusableCell(withClass: YHAdopterExampleTableViewCell.self)
return cell
}
if indexPath.row == 1 {
let cell = tableView.dequeueReusableCell(withClass: YHAdopterCardExplainTableViewCell.self)
return cell
}
if indexPath.row == 2 {
let cell = tableView.dequeueReusableCell(withClass: YHAdopterTravelCardTableViewCell.self)
return cell
}
}
let cell = tableView.dequeueReusableCell(withClass: YHAdopterTravelItemTableViewCell.self)
cell.dataSource = data[indexPath.row]
cell.informationBlock = {[weak self] model in
guard let self = self else { return }
// self.viewModel.updateModel(model)
// let id = model.id
// if id != .id32 && id != .id4 && id != .id8 && id != .id9 && id != .id12 && id != .id13 && id != .id17 && id != .id18 && id != .id21 && id != .id22 && id != .id23 && id != .id34 && id != .id29 && id != .id30 && id != .id35 {
// self.updateDataSource()
// }
}
return cell
}
func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat {
if indexPath.section == 0 {
if indexPath.row == 0 {
return 118
}
if indexPath.row == 1 {
return 58
}
if indexPath.row == 2 {
return 173
}
}
let model = data[indexPath.row]
let isShow = model.isShowPrompts ?? false
let message = model.message ?? ""
let isNeed = model.isNeed ?? false
if isShow && message.count == 0 && isNeed {
return 52 + 20
} else {
return 52
}
}
func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
}
}
//
// YHAdopterIdCardViewController.swift
// galaxy
//
// Created by EDY on 2024/8/20.
// Copyright © 2024 https://www.galaxy-immi.com. All rights reserved.
//
import UIKit
class YHAdopterIdCardViewController: YHBaseViewController {
var tableView: UITableView!
var nextButton: UIButton!
var clickIndex = -1
var data: [YHItemModel] = []
var viewModel = YHYHAdopterTravelViewModel()
override func viewDidLoad() {
super.viewDidLoad()
gk_navTitle = "上传证件照片"
gk_navBackgroundColor = .white
gk_navBarAlpha = 1
setView()
getData()
}
func getData() {
data = viewModel.getChinaDataSource(false)
tableView.reloadData()
}
func setView() {
view.backgroundColor = .white
tableView = {
let tableView = UITableView(frame:.zero, style:.plain)
tableView.contentInsetAdjustmentBehavior = .never
tableView.backgroundColor = .white
tableView.separatorStyle = .none
tableView.delegate = self
tableView.dataSource = self
tableView.register(cellWithClass: YHAdopterExampleTableViewCell.self)
tableView.register(cellWithClass: YHAdopterResidentTableViewCell.self)
tableView.register(cellWithClass: YHAdopterCardExplainTableViewCell.self)
return tableView
}()
view.addSubview(tableView)
tableView.snp.makeConstraints { make in
make.top.equalTo(k_Height_NavigationtBarAndStatuBar + 8)
make.bottom.left.right.equalTo(view)
}
nextButton = {
let button = UIButton(type: .custom)
button.backgroundColor = UIColor.brandMainColor
button.titleLabel?.font = UIFont.PFSC_M(ofSize: 16)
button.contentHorizontalAlignment = .center
button.setTitle("确认上传", for: .normal)
button.setTitleColor( UIColor(hex:0xffffff), for: .normal)
button.layer.cornerRadius = kCornerRadius3
button.addTarget(self, action: #selector(nextStep), for: .touchUpInside)
return button
}()
view.addSubview(nextButton)
nextButton.snp.makeConstraints { make in
make.left.equalTo(16)
make.right.equalTo(-16)
make.bottom.equalTo(-8 - k_Height_safeAreaInsetsBottom())
make.height.equalTo(48)
}
}
@objc func nextStep() {
}
@objc func submit() {
}
}
extension YHAdopterIdCardViewController: UITableViewDelegate, UITableViewDataSource {
func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
return 2
}
func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
if indexPath.row == 0 {
let cell = tableView.dequeueReusableCell(withClass: YHAdopterCardExplainTableViewCell.self)
cell.alertLabel.text = "要求:2寸白底照"
return cell
}
if indexPath.row == 1 {
let cell = tableView.dequeueReusableCell(withClass: YHAdopterResidentTableViewCell.self)
return cell
}
return UITableViewCell()
}
func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat {
if indexPath.row == 0 {
return 84
}
if indexPath.row == 1 {
return 173
}
return 0
}
func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
}
}
//
// YHAdopterMarryViewController.swift
// galaxy
//
// Created by EDY on 2024/8/20.
// Copyright © 2024 https://www.galaxy-immi.com. All rights reserved.
//
import UIKit
class YHAdopterMarryViewController: YHBaseViewController {
var tableView: UITableView!
var nextButton: UIButton!
var clickIndex = -1
var data: [YHItemModel] = []
var viewModel = YHYHAdopterTravelViewModel()
override func viewDidLoad() {
super.viewDidLoad()
gk_navTitle = "上传结婚证"
gk_navBackgroundColor = .white
gk_navBarAlpha = 1
setView()
getData()
}
func getData() {
data = viewModel.getChinaDataSource(false)
tableView.reloadData()
}
func setView() {
view.backgroundColor = .white
tableView = {
let tableView = UITableView(frame:.zero, style:.plain)
tableView.contentInsetAdjustmentBehavior = .never
tableView.backgroundColor = .white
tableView.separatorStyle = .none
tableView.delegate = self
tableView.dataSource = self
tableView.register(cellWithClass: YHAdopterExampleTableViewCell.self)
tableView.register(cellWithClass: YHAdopterMarryCardTableViewCell.self)
tableView.register(cellWithClass: YHAdopterCardExplainTableViewCell.self)
return tableView
}()
view.addSubview(tableView)
tableView.snp.makeConstraints { make in
make.top.equalTo(k_Height_NavigationtBarAndStatuBar + 8)
make.bottom.left.right.equalTo(view)
}
nextButton = {
let button = UIButton(type: .custom)
button.backgroundColor = UIColor.brandMainColor
button.titleLabel?.font = UIFont.PFSC_M(ofSize: 16)
button.contentHorizontalAlignment = .center
button.setTitle("确认上传", for: .normal)
button.setTitleColor( UIColor(hex:0xffffff), for: .normal)
button.layer.cornerRadius = kCornerRadius3
button.addTarget(self, action: #selector(nextStep), for: .touchUpInside)
return button
}()
view.addSubview(nextButton)
nextButton.snp.makeConstraints { make in
make.left.equalTo(16)
make.right.equalTo(-16)
make.bottom.equalTo(-8 - k_Height_safeAreaInsetsBottom())
make.height.equalTo(48)
}
}
@objc func nextStep() {
}
@objc func submit() {
}
}
extension YHAdopterMarryViewController: UITableViewDelegate, UITableViewDataSource {
func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
return 3
}
func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
if indexPath.row == 0 {
let cell = tableView.dequeueReusableCell(withClass: YHAdopterExampleTableViewCell.self)
return cell
}
if indexPath.row == 1 {
let cell = tableView.dequeueReusableCell(withClass: YHAdopterCardExplainTableViewCell.self)
cell.alertLabel.text = "提供主申人的信息页,复婚情况提供最新的结婚证"
return cell
}
if indexPath.row == 2 {
let cell = tableView.dequeueReusableCell(withClass: YHAdopterMarryCardTableViewCell.self)
return cell
}
return UITableViewCell()
}
func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat {
if indexPath.row == 0 {
return 118
}
if indexPath.row == 1 {
return 84
}
if indexPath.row == 2 {
return 318
}
return 0
}
func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
}
}
...@@ -211,17 +211,22 @@ extension YHAdopterNewPeopleViewController: UITableViewDelegate, UITableViewData ...@@ -211,17 +211,22 @@ extension YHAdopterNewPeopleViewController: UITableViewDelegate, UITableViewData
let vc = YHAdopterTravelViewController() let vc = YHAdopterTravelViewController()
self.navigationController?.pushViewController(vc) self.navigationController?.pushViewController(vc)
case .china: case .china:
break let vc = YHAdopterChinaViewController()
self.navigationController?.pushViewController(vc)
case .resident: case .resident:
break let vc = YHAdopterResidentViewController()
self.navigationController?.pushViewController(vc)
case .birth: case .birth:
break let vc = YHAdopterBirthViewController()
self.navigationController?.pushViewController(vc)
case .id: case .id:
break let vc = YHAdopterIdCardViewController()
self.navigationController?.pushViewController(vc)
case .other: case .other:
break break
case .marry: case .marry:
break let vc = YHAdopterMarryViewController()
self.navigationController?.pushViewController(vc)
} }
} }
} }
......
//
// YHAdopterResidentViewController.swift
// galaxy
//
// Created by EDY on 2024/8/20.
// Copyright © 2024 https://www.galaxy-immi.com. All rights reserved.
//
import UIKit
class YHAdopterResidentViewController: YHBaseViewController {
var tableView: UITableView!
var nextButton: UIButton!
var clickIndex = -1
var data: [YHItemModel] = []
var viewModel = YHYHAdopterTravelViewModel()
override func viewDidLoad() {
super.viewDidLoad()
gk_navTitle = "上传户口信息页"
gk_navBackgroundColor = .white
gk_navBarAlpha = 1
setView()
getData()
}
func getData() {
data = viewModel.getChinaDataSource(false)
tableView.reloadData()
}
func setView() {
view.backgroundColor = .white
tableView = {
let tableView = UITableView(frame:.zero, style:.plain)
tableView.contentInsetAdjustmentBehavior = .never
tableView.backgroundColor = .white
tableView.separatorStyle = .none
tableView.delegate = self
tableView.dataSource = self
tableView.register(cellWithClass: YHAdopterExampleTableViewCell.self)
tableView.register(cellWithClass: YHAdopterResidentTableViewCell.self)
tableView.register(cellWithClass: YHAdopterCardExplainTableViewCell.self)
return tableView
}()
view.addSubview(tableView)
tableView.snp.makeConstraints { make in
make.top.equalTo(k_Height_NavigationtBarAndStatuBar + 8)
make.bottom.left.right.equalTo(view)
}
nextButton = {
let button = UIButton(type: .custom)
button.backgroundColor = UIColor.brandMainColor
button.titleLabel?.font = UIFont.PFSC_M(ofSize: 16)
button.contentHorizontalAlignment = .center
button.setTitle("确认上传", for: .normal)
button.setTitleColor( UIColor(hex:0xffffff), for: .normal)
button.layer.cornerRadius = kCornerRadius3
button.addTarget(self, action: #selector(nextStep), for: .touchUpInside)
return button
}()
view.addSubview(nextButton)
nextButton.snp.makeConstraints { make in
make.left.equalTo(16)
make.right.equalTo(-16)
make.bottom.equalTo(-8 - k_Height_safeAreaInsetsBottom())
make.height.equalTo(48)
}
}
@objc func nextStep() {
}
@objc func submit() {
}
}
extension YHAdopterResidentViewController: UITableViewDelegate, UITableViewDataSource {
func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
return 3
}
func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
if indexPath.row == 0 {
let cell = tableView.dequeueReusableCell(withClass: YHAdopterExampleTableViewCell.self)
return cell
}
if indexPath.row == 1 {
let cell = tableView.dequeueReusableCell(withClass: YHAdopterCardExplainTableViewCell.self)
cell.alertLabel.text = "要求:提供户口的个人页,无需户口本首页"
return cell
}
if indexPath.row == 2 {
let cell = tableView.dequeueReusableCell(withClass: YHAdopterResidentTableViewCell.self)
return cell
}
return UITableViewCell()
}
func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat {
if indexPath.row == 0 {
return 118
}
if indexPath.row == 1 {
return 84
}
if indexPath.row == 2 {
return 173
}
return 0
}
func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
}
}
...@@ -18,7 +18,7 @@ class YHAdopterTravelViewController: YHBaseViewController { ...@@ -18,7 +18,7 @@ class YHAdopterTravelViewController: YHBaseViewController {
override func viewDidLoad() { override func viewDidLoad() {
super.viewDidLoad() super.viewDidLoad()
gk_navTitle = "上传存款证明" gk_navTitle = "上传旅行证件"
gk_navBackgroundColor = .white gk_navBackgroundColor = .white
gk_navBarAlpha = 1 gk_navBarAlpha = 1
setView() setView()
......
...@@ -16,6 +16,8 @@ enum YHAdopterCardType { ...@@ -16,6 +16,8 @@ enum YHAdopterCardType {
case id case id
case other case other
case marry case marry
case chinaTravel
case chinaLife
} }
struct YHAdopterCardModel { struct YHAdopterCardModel {
......
//
// YHAdopterCardExplainTableViewCell.swift
// galaxy
//
// Created by EDY on 2024/8/20.
// Copyright © 2024 https://www.galaxy-immi.com. All rights reserved.
//
import UIKit
class YHAdopterCardExplainTableViewCell: UITableViewCell {
var titleLabel: UILabel!
var subTitleLabel: UILabel!
var alertLabel: UILabel!
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
titleLabel = {
let label = UILabel()
label.font = UIFont.PFSC_R(ofSize: 17)
label.textColor = UIColor.mainTextColor
label.text = "中国身份证"
return label
}()
contentView.addSubview(titleLabel)
titleLabel.snp.makeConstraints { make in
make.left.equalTo(18)
make.top.equalTo(34)
make.height.equalTo(24)
}
subTitleLabel = {
let label = UILabel()
label.text = "已完成"
label.font = UIFont.PFSC_R(ofSize: 10)
label.textColor = UIColor(hex: 0x3cc694)
label.backgroundColor = UIColor(hex: 0xf0fbf7)
//带上传
// label.textColor = UIColor.brandMainColor
// label.backgroundColor = UIColor(hex: 0xf0f4fb)
//审核中
// label.textColor = UIColor(hex: 0xff8000)
// label.backgroundColor = UIColor(hex: 0xfff5eb)
//已驳回
// label.textColor = UIColor(hex: 0xf81d22)
// label.backgroundColor = UIColor(hex: 0xfff2f2)
return label
}()
contentView.addSubview(subTitleLabel)
subTitleLabel.snp.makeConstraints { make in
make.left.equalTo(titleLabel.snp.right).offset(4)
make.width.equalTo(38)
make.height.equalTo(16)
make.centerY.equalTo(titleLabel.snp.centerY)
}
alertLabel = {
let label = UILabel()
// label.text = "存款证明有效期为3个月,并且存款金额为每个成员(包括额外新增受养人)最低为12万"
label.font = UIFont.PFSC_R(ofSize: 14)
label.textColor = UIColor.mainTextColor50
label.numberOfLines = 0
return label
}()
contentView.addSubview(alertLabel)
alertLabel.snp.makeConstraints { make in
make.left.equalTo(18)
make.top.equalTo(64)
make.right.equalTo(-18)
}
}
}
//
// YHAdopterExampleTableViewCell.swift
// galaxy
//
// Created by EDY on 2024/8/20.
// Copyright © 2024 https://www.galaxy-immi.com. All rights reserved.
//
import UIKit
class YHAdopterExampleTableViewCell: UITableViewCell {
typealias ExampleBlock = () -> ()
var exampleBlock: ExampleBlock?
var titleLabel: UILabel!
var templateView: YHCertificateSampleTemplateView!
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() {
contentView.backgroundColor = .clear
backgroundColor = .clear
titleLabel = {
let label = UILabel()
label.font = UIFont.PFSC_R(ofSize: 17)
label.textColor = UIColor.mainTextColor
label.text = "中国身份证示例模版"
return label
}()
contentView.addSubview(titleLabel)
titleLabel.snp.makeConstraints { make in
make.left.equalTo(20)
make.right.equalTo(-20)
make.top.equalTo(16)
make.height.equalTo(24)
}
templateView = {
let view = YHCertificateSampleTemplateView()
return view
}()
contentView.addSubview(templateView)
templateView.snp.makeConstraints { make in
make.left.equalTo(20)
make.right.equalTo(-20)
make.top.equalTo(56)
make.height.equalTo(62)
}
let tapGesture = UITapGestureRecognizer(target: self, action: #selector(tapAction))
// 给视图添加手势识别器
templateView.addGestureRecognizer(tapGesture)
}
@objc func tapAction(gesture: UITapGestureRecognizer) {
if let block = exampleBlock {
block()
}
}
}
//
// YHAdopterResidentTableViewCell.swift
// galaxy
//
// Created by EDY on 2024/8/20.
// Copyright © 2024 https://www.galaxy-immi.com. All rights reserved.
//
import UIKit
class YHAdopterResidentTableViewCell: UITableViewCell {
typealias InformationBlock = (_ type: YHCardType, _ image: UIImage, _ isleft: Bool) -> ()
var informationBlock: InformationBlock?
var frontLabel: UILabel!
var frontImageButton: YHCardButton!
var frontDeleteButton: UIButton!
var activityIndicator: UIActivityIndicatorView!
var viewModel: YHMainApplicantInformationViewModel! {
didSet {
if viewModel.mainModel.certificates.cn_identity_card.img_front.count != 0 {
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: url), for: .normal, completionHandler: { _ in
self.frontDeleteButton.isHidden = false
})
self.frontImageButton.setContent("", "")
}
}
}
}
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() {
contentView.backgroundColor = .clear
backgroundColor = .clear
let lineView = {
let view = UIView()
view.backgroundColor = UIColor.separatorColor
return view
}()
contentView.addSubview(lineView)
lineView.snp.makeConstraints { make in
make.left.equalTo(18)
make.top.equalTo(16)
make.height.equalTo(1)
make.right.equalTo(-18)
}
frontLabel = {
let label = UILabel()
label.font = UIFont.PFSC_R(ofSize: 12)
label.textColor = UIColor.subTextColor
label.text = "证件页1"
label.textAlignment = .center
return label
}()
contentView.addSubview(frontLabel)
frontLabel.snp.makeConstraints { make in
make.left.equalTo(18)
make.right.equalTo(self.snp.centerX)
make.top.equalTo(28)
make.height.equalTo(20)
}
frontImageButton = {
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
}()
contentView.addSubview(frontImageButton)
frontImageButton.snp.makeConstraints { make in
make.left.equalTo(20)
make.top.equalTo(60)
make.height.equalTo(99)
make.width.equalTo(160)
}
frontDeleteButton = {
let button = UIButton(type: .custom)
button.setBackgroundImage(UIImage(named: "service_card_delete"), for: .normal)
button.addTarget(self, action: #selector(frontDeleteClick), for: .touchUpInside)
button.isHidden = true
return button
}()
contentView.addSubview(frontDeleteButton)
frontDeleteButton.snp.makeConstraints { make in
make.centerX.equalTo(frontImageButton.snp.right)
make.centerY.equalTo(frontImageButton.snp.top)
make.height.equalTo(21)
make.width.equalTo(21)
}
activityIndicator = {
let view = UIActivityIndicatorView()
view.style = .medium
return view
}()
contentView.addSubview(activityIndicator)
activityIndicator.snp.makeConstraints { make in
make.center.equalTo(frontImageButton.snp.center)
make.height.equalTo(25)
make.width.equalTo(25)
}
}
@objc func frontImageClick() {
// if viewModel.mainModel.certificates.cn_identity_card.img_front.count != 0 {
// if viewModel.mainModel.certificates.cn_identity_card.img_front.isEmpty == false {
// let vc = YHImageViewController()
// vc.imgString = viewModel.mainModel.certificates.cn_identity_card.img_front
// UIViewController.current?.navigationController?.pushViewController(vc)
// }
// return
// }
// YHImagePickerView.show() {[weak self] image in
// guard let self = self else { return }
// self.frontImageButton.setContent("card_loading", "上传中")
// self.frontImageButton.startRotationAnimation()
// self.viewModel.uploadImage(image) {[weak self] success, error in
// guard let self = self else { return }
// self.frontImageButton.stopRotationAnimation()
// self.frontImageButton.setContent("", "")
//
// guard let url = success else { return }
//// self.viewModel.updateModel(self.type, isFront: true, url: url)
// self.frontImageButton.setBackgroundImage(image, for: .normal)
// self.frontDeleteButton.isHidden = false
//
// self.viewModel.getPublicImageUrl(url) {[weak self] success, error in
// guard let self = self else { return }
// guard let url = success else { return }
//
//
// self.viewModel.requestHkIDCardMessage(url, isBack: 0) {[weak self] success, error in
// }
// }
// }
// }
}
@objc func frontDeleteClick() {
frontDeleteButton.isHidden = true
frontImageButton.setBackgroundImage(UIImage(named: "service_hk_card_front"), for: .normal)
frontImageButton.setContent("card_upload", "点击上传")
}
}
...@@ -30,7 +30,9 @@ class YHAdopterNewPeopleViewModel: YHBaseViewModel { ...@@ -30,7 +30,9 @@ class YHAdopterNewPeopleViewModel: YHBaseViewModel {
let item4 = YHAdopterCardModel(type: .id, title: "2寸白底证件照片", state: 0) let item4 = YHAdopterCardModel(type: .id, title: "2寸白底证件照片", state: 0)
let item5 = YHAdopterCardModel(type: .other, title: "其他相关证件", state: 0) let item5 = YHAdopterCardModel(type: .other, title: "其他相关证件", state: 0)
let item6 = YHAdopterCardModel(type: .marry, title: "结婚证", state: 0) let item6 = YHAdopterCardModel(type: .marry, title: "结婚证", state: 0)
return [item, item1, item2, item3, item4, item5, item6] let item7 = YHAdopterCardModel(type: .chinaTravel, title: "中国旅行证", state: 0)
let item8 = YHAdopterCardModel(type: .chinaLife, title: "中国居留许可证", state: 0)
return [item, item1, item2, item3, item4, item5, item6, item7, item8]
} }
} }
...@@ -24,4 +24,13 @@ class YHYHAdopterTravelViewModel: YHBaseViewModel { ...@@ -24,4 +24,13 @@ class YHYHAdopterTravelViewModel: YHBaseViewModel {
let item5 = YHItemModel(id: .id1, isNeed: true, title: "届满日期", isUserKeyBoard: false, prompts: "请选择", message: "", type: .time, isShowPrompts: isShowPrompt, alertMessage:"请选择届满日期") let item5 = YHItemModel(id: .id1, isNeed: true, title: "届满日期", isUserKeyBoard: false, prompts: "请选择", message: "", type: .time, isShowPrompts: isShowPrompt, alertMessage:"请选择届满日期")
return [item, item1, item2, item3, item4, item5] return [item, item1, item2, item3, item4, item5]
} }
func getChinaDataSource(_ isShowPrompt: Bool) -> [YHItemModel] {
let item = YHItemModel(id: .id1, isNeed: true, title: "姓名", isUserKeyBoard: true, prompts: "请输入", message: "", type: .id, isShowPrompts: isShowPrompt, alertMessage:"请输入姓名")
let item1 = YHItemModel(id: .id1, isNeed: true, title: "身份证号码", isUserKeyBoard: true, prompts: "请输入", message: "", isShowPrompts: isShowPrompt, alertMessage:"请输入身份证号码")
let item2 = YHItemModel(id: .id1, isNeed: true, title: "出生日期", isUserKeyBoard: false, prompts: "请选择", message: "", type: .time, isShowPrompts: isShowPrompt, alertMessage:"请选择出生日期")
let item3 = YHItemModel(id: .id1, isNeed: true, title: "出生地点", isUserKeyBoard: true, prompts: "请输入", message: "", isShowPrompts: isShowPrompt, alertMessage:"请输入出生地点")
let item4 = YHItemModel(id: .id1, isNeed: true, title: "性别", isUserKeyBoard: false, prompts: "请选择", message: "", type: .sex, isShowPrompts: isShowPrompt, alertMessage:"请选择性别")
return [item, item1, item2, item3, item4]
}
} }
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