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

Merge branch 'develop' into xiezhaolin

# Conflicts:
#	galaxy/galaxy/Classes/Tools/NetWork/YHNetRequest.swift
parents 9e6e938e 652eb077
......@@ -8,7 +8,7 @@ target 'galaxy' do
#网络检查
pod 'ReachabilitySwift','5.0.0'
#键盘处理
pod 'IQKeyboardManagerSwift','6.5.10'
pod 'IQKeyboardManagerSwift','7.0.1'
#网络请求
pod 'Alamofire','5.8.1'
#图片加载
......@@ -36,13 +36,13 @@ target 'galaxy' do
#提示框
pod 'PKHUD','5.3.0'
#日志 调试
pod 'CocoaDebug', '1.7.7'
# pod 'CocoaDebug', '1.7.7'
#date分类
pod 'SwiftDate','7.0.0'
#定时器
pod 'SwiftyTimer','2.1.0'
#UIColor 的扩展
pod 'Hue','5.0.0'
# pod 'Hue','5.0.0'
#内存泄漏
pod 'LifetimeTracker','1.8.1'
#控制台转换成中文
......
This diff is collapsed.
......@@ -35,7 +35,7 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
//2.通用UI设置
// setupWholeUI()
setupWholeUI()
//3.其他第三方sdk设置
thirdSetting()
......@@ -104,31 +104,12 @@ extension AppDelegate {
//异步延迟设置
DispatchQueue.main.asyncAfter(wallDeadline: .now() + 0.25) { [] in
//1、系统控件属性设置
//1.1
UITextField.appearance().tintColor = .mainColor
UITextView.appearance().tintColor = .mainColor
UITextField.appearance().tintColor = .brandMainColor
UITextView.appearance().tintColor = .brandMainColor
//1.2设置UINavigationBar title的字体和颜色
let titleTextAttributes = [NSAttributedString.Key.font : UIFont.PingFangScM(ofSize: 16) , NSAttributedString.Key.foregroundColor : UIColor.commonColor100]
UINavigationBar.appearance().titleTextAttributes = titleTextAttributes
UINavigationBar.appearance().tintColor = .white
//1.3UITabBar bar 的选中颜色
UITabBar.appearance().tintColor = UIColor.commonColor100
//1.4tabbar默认的背景色
UITabBar.appearance().barTintColor = UIColor.white
//2、一键登录初始化
// TXCommonHandler.sharedInstance().setAuthSDKInfo(BsConstant.kAliOnePressPhoneLoginKey)
//3.微信登录初始化
// BsWxLoginManager.shared.doWxInit()
//4.
IQKeyboardManager.shared.enable = true
IQKeyboardManager.shared.enableAutoToolbar = false
IQKeyboardManager.shared.shouldResignOnTouchOutside = true // 控制点击背景是否收起键盘
IQKeyboardManager.shared.enableAutoToolbar = true
IQKeyboardManager.shared.resignOnTouchOutside = true // 控制点击背景是否收起键盘
}
}
......
......@@ -8,16 +8,25 @@
import UIKit
import GKNavigationBarSwift
import IQKeyboardManagerSwift
class YHBaseViewController: UIViewController {
override func viewDidLoad() {
super.viewDidLoad()
view.backgroundColor = UIColor(hex:0xf8f8f8)
//背景色
view.backgroundColor = UIColor.pageBkgColor
//vc中导航栏默认透明,需要使用到的 在各自的vc中定制
gk_navBackgroundColor = .clear
gk_navLineHidden = true
gk_navBarAlpha = 0
//
#if DEBUG
IQKeyboardManager.shared.enable = true
#endif
}
override var prefersStatusBarHidden: Bool {
......@@ -29,8 +38,8 @@ class YHBaseViewController: UIViewController {
}
deinit {
#if DEBUG
#if DEBUG
printLog(#function)
#endif
#endif
}
}
......@@ -14,11 +14,11 @@ class YHBasicContentView: ESTabBarItemContentView {
override init(frame: CGRect) {
super.init(frame: frame)
textColor = UIColor.init(white: 175.0 / 255.0, alpha: 1.0)
highlightTextColor = .commonColor100
highlightTextColor = .brandMainColor
iconColor = UIColor.init(white: 175.0 / 255.0, alpha: 1.0)
highlightIconColor = .commonColor100
highlightIconColor = .brandMainColor
titleLabel.font = UIFont.PingFangScR(ofSize: 10)
titleLabel.font = UIFont.PFSC_R(ofSize: 10)
}
public required init?(coder aDecoder: NSCoder) {
......
......@@ -20,21 +20,21 @@ class YHNoDataTipView: UIView {
}()
private lazy var titleLabel: UILabel = {
let label = UILabel(text: "暂无数据", font: UIFont.PingFangScR(ofSize: 14), color: UIColor.commonColor45)
let label = UILabel(text: "暂无数据", font: UIFont.PFSC_R(ofSize: 14), color: UIColor.labelTextColor2)
return label
}()
private lazy var descLabel: UILabel = {
let label = UILabel(text: "", font: UIFont.PingFangScR(ofSize: 12), color: UIColor.commonColor45)
let label = UILabel(text: "", font: UIFont.PFSC_R(ofSize: 12), color: UIColor.labelTextColor2)
return label
}()
private lazy var reloadBtn: UIButton = {
let btn = UIButton.bs_button(title: "重新加载", font: UIFont.PingFangScM(ofSize: 12), normalColor: UIColor.commonColor100)
let btn = UIButton.bs_button(title: "重新加载", font: UIFont.PFSC_M(ofSize: 12), normalColor: UIColor.brandMainColor)
btn.layer.cornerRadius = 6
btn.layer.masksToBounds = true
btn.layer.borderWidth = 1
btn.layer.borderColor = UIColor.commonColor10.cgColor
btn.layer.borderColor = UIColor.labelTextColor2.cgColor
btn.addTarget(self, action: #selector(onReloadData), for: .touchUpInside)
return btn
}()
......
......@@ -108,11 +108,11 @@ class YHHomeViewController: YHBaseViewController {
dataSource.isTitleColorGradientEnabled = true
dataSource.titles = arrItemTitles
dataSource.titleNormalFont = UIFont.PingFangScM(ofSize: 16)
dataSource.titleNormalColor = .commonColor25
dataSource.titleNormalFont = UIFont.PFSC_M(ofSize: 16)
dataSource.titleNormalColor = UIColor(hexString: "#888F98")
dataSource.titleSelectedFont = UIFont.PingFangScM(ofSize: 18)
dataSource.titleSelectedColor = .commonColor100
dataSource.titleSelectedFont = UIFont.PFSC_M(ofSize: 18)
dataSource.titleSelectedColor = .brandMainColor
dataSource.isItemSpacingAverageEnabled = false
dataSource.itemWidth = JXSegmentedViewAutomaticDimension
......
......@@ -29,11 +29,11 @@ class YHMainContentBaseViewController: UIViewController {
dataSource.isTitleColorGradientEnabled = true
dataSource.titles = arrItemTitles
dataSource.titleNormalFont = UIFont.PingFangScM(ofSize: 16)
dataSource.titleNormalColor = .commonColor25
dataSource.titleNormalFont = UIFont.PFSC_M(ofSize: 16)
dataSource.titleNormalColor = .labelTextColor2
dataSource.titleSelectedFont = UIFont.PingFangScM(ofSize: 18)
dataSource.titleSelectedColor = .commonColor100
dataSource.titleSelectedFont = UIFont.PFSC_M(ofSize: 18)
dataSource.titleSelectedColor = .brandMainColor
dataSource.isItemSpacingAverageEnabled = false
dataSource.itemWidth = JXSegmentedViewAutomaticDimension
......
......@@ -127,7 +127,7 @@ extension YHDavidCell4: FSPagerViewDataSource, FSPagerViewDelegate {
// cell.textLabel?.text = model.title
}
cell.imageView?.contentMode = .scaleAspectFill
cell.backgroundColor = .commonColor3
cell.backgroundColor = .contentBkgColor
cell.contentView.layer.shadowColor = UIColor.clear.cgColor
return cell
......
......@@ -9,7 +9,7 @@
import Foundation
import FSPagerView
import Kingfisher
import SwifterSwift
//import SwifterSwift
class YHHomeBannerView: UIView {
......@@ -128,7 +128,7 @@ extension YHHomeBannerView: FSPagerViewDataSource, FSPagerViewDelegate {
}
cell.imageView?.contentMode = .scaleAspectFill
cell.backgroundColor = .commonColor3
cell.backgroundColor = .contentBkgColor
cell.contentView.layer.shadowColor = UIColor.clear.cgColor
return cell
......
......@@ -32,7 +32,7 @@ class YHInformationPerfectListVC: YHBaseViewController {
private lazy var headerTitleDesLable : UILabel = {
let titleLable = UILabel(text: "您好,黄先生")
titleLable.font = UIFont.PingFangScM(ofSize: 21)
titleLable.font = UIFont.PFSC_M(ofSize: 21)
return titleLable
}()
......@@ -270,7 +270,7 @@ extension YHInformationPerfectListVC {
}
let desLable = UILabel(text: "此表由主申请人填写,我们将会根据您的个人信息制作资料清单,请按顺序填写,提交后1-2个工作日内联系您哦~")
desLable.font = UIFont.PingFangScR(ofSize: 12)
desLable.font = UIFont.PFSC_R(ofSize: 12)
desLable.numberOfLines = 0
desLable.lineBreakMode = .byWordWrapping
......
......@@ -102,8 +102,8 @@ extension YHServiceCenterMainViewController {
// MARK: - UITableViewDelegate 和 UITableViewDataSource
extension YHServiceCenterMainViewController : UITableViewDelegate,UITableViewDataSource {
func numberOfSections(in tableView: UITableView) -> Int {
// return self.serviceCenterMainReqVM.arrContactList.count
return 1 //for test hjl
return self.serviceCenterMainReqVM.arrContactList.count
// return 1 //for test hjl
}
func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
......@@ -112,11 +112,11 @@ extension YHServiceCenterMainViewController : UITableViewDelegate,UITableViewDat
}
func tableView(_ tableView: UITableView, heightForHeaderInSection section: Int) -> CGFloat {
return 16
return kMargin
}
func tableView(_ tableView: UITableView, viewForHeaderInSection section: Int) -> UIView? {
let view = UIView(frame: CGRect(x: 0, y: 0, width: KScreenWidth, height: 16))
let view = UIView(frame: CGRect(x: 0, y: 0, width: KScreenWidth, height: kMargin))
return view
}
......@@ -142,8 +142,6 @@ extension YHServiceCenterMainViewController : UITableViewDelegate,UITableViewDat
tableView.deselectRow(at: indexPath, animated: true)
printLog("点击了 tableView Cell \(indexPath.row)")
let vc = YHServiceCenterSecondViewController()
// let vc = YHPersonInformMainViewController() //for test hjl
self.navigationController?.pushViewController(vc)
}
}
//
// YHMainApplicantInfoViewController.swift
// galaxy
//
// Created by davidhuangA on 2024/1/29.
// Copyright © 2024 https://www.galaxy-immi.com. All rights reserved.
//
import UIKit
import JXSegmentedView
/*
*主申请人信息
*/
class YHMainApplicantInfoViewController: YHBaseViewController {
override func viewDidLoad() {
super.viewDidLoad()
view.backgroundColor = .red// for test hjl
// Do any additional setup after loading the view.
}
/*
// MARK: - Navigation
// In a storyboard-based application, you will often want to do a little preparation before navigation
override func prepare(for segue: UIStoryboardSegue, sender: Any?) {
// Get the new view controller using segue.destination.
// Pass the selected object to the new view controller.
}
*/
}
// MARK: - JXSegmentedListContainerViewListDelegate
extension YHMainApplicantInfoViewController: JXSegmentedListContainerViewListDelegate {
func listView() -> UIView {
return view
}
}
......@@ -247,6 +247,25 @@ extension YHBrotherInfoVC : UITableViewDelegate, UITableViewDataSource {
func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
if !(0..<items.count).contains(indexPath.section) { return }
let arr:[YHFormItemProtocol] = items[indexPath.section]
if !(0..<arr.count).contains(indexPath.row) { return }
let item = arr[indexPath.row]
if item is YHFormDetailItem {
let detailItem = item as! YHFormDetailItem
if detailItem.type == .certificateValidDate ||
detailItem.type == .certificateSignDate { // 届满日期 签发日期
self.view?.endEditing(true)
YHDatePickView.show(type: .yyyymmdd) { date in
let dataArr = date.components(separatedBy: YHDatePickView.separator)
print(date)
}
}
return
}
}
func createCorner(cell:UITableViewCell, arr:Array<Any>, indexPath:IndexPath) {
......
......@@ -10,19 +10,21 @@ import UIKit
class YHCertificateViewController: YHBaseViewController {
var spouse:YHFamilyMember?
var familyMember:YHFamilyMember?
var cardInfo: YHCNIdentityCard?
var certificates:YHCertificates = YHCertificates()
var items:[[YHFormItemProtocol]] = [[YHFormItemProtocol]]()
lazy var tableView: UITableView = {
let tableView = UITableView(frame:.zero, style:.plain)
let tableView = UITableView(frame:.zero, style:.grouped)
if #available(iOS 11.0, *) {
tableView.contentInsetAdjustmentBehavior = .never
}
tableView.estimatedSectionHeaderHeight = 14.0
tableView.estimatedSectionFooterHeight = 1.0
tableView.showsVerticalScrollIndicator = false
tableView.backgroundColor = .clear
tableView.separatorStyle = .none
......@@ -50,32 +52,82 @@ class YHCertificateViewController: YHBaseViewController {
func createUI() {
view.addSubview(tableView);
let topHeight = k_Height_NavigationtBarAndStatuBar+YHStepView.height
let bottomHeight = k_Height_safeAreaInsetsBottom() + YHSaveAndSubmitView.height
tableView.snp.makeConstraints { make in
make.top.equalToSuperview().offset(k_Height_NavigationtBarAndStatuBar)
make.bottom.equalToSuperview().offset(-100)
make.top.equalToSuperview().offset(topHeight)
make.left.equalToSuperview().offset(16)
make.right.equalToSuperview().offset(-16)
make.bottom.equalToSuperview().offset(-bottomHeight)
}
guard let familyMember = familyMember else { return }
if let cer = familyMember.certificatesd {
certificates = cer
} else {
certificates.cnIdentityCard = YHCNIdentityCard()
certificates.passport = YHCNIdentityCard()
if familyMember.isHandled == 1 { // 要办理港澳通行证
certificates.hkMacaoPass = YHCNIdentityCard()
}
}
loadCertificateInfo()
}
func loadCertificateInfo() {
items.removeAll()
// 中国身份证 信息必有
let title0 = YHFormTitleItem(type: .chinaIdCardInfo)
let item01 = YHFormDetailItem(type: .certificateNumber)
let item01 = YHFormDetailItem(type: .chinaIdentityCardNumber)
let item02 = YHFormDetailItem(type: .certificateSignPlace)
let item03 = YHFormDetailItem(type: .certificateSignDate)
let item04 = YHFormDetailItem(type: .certificateValidDate)
let arr0:[YHFormItemProtocol] = [title0, item01, item02, item03, item04]
items.append(arr0)
if let cnIdentityCard = certificates.cnIdentityCard {
item01.value = cnIdentityCard.number
item02.value = cnIdentityCard.issueAt
item03.value = cnIdentityCard.issueDateStartAt
item04.value = cnIdentityCard.issueDateEndAt
}
let title1 = YHFormTitleItem(type: .passPortInfo)
let item10 = YHFormDetailItem(type: .cetificateType)
let item11 = YHFormDetailItem(type: .certificateNumber)
let item12 = YHFormDetailItem(type: .certificateSignPlace)
let item13 = YHFormDetailItem(type: .certificateSignDate)
let item14 = YHFormDetailItem(type: .certificateValidDate)
let arr1:[YHFormItemProtocol] = [title1, item10, item11, item12, item13, item14]
items.append(contentsOf: [arr0, arr1])
// 港澳通行证 非必须
if certificates.hkMacaoPass != nil {
let title1 = YHFormTitleItem(type: .hkAndMacaoPassport)
let item10 = YHFormDetailItem(type: .traverlPassportNumber)
let item11 = YHFormDetailItem(type: .certificateSignPlace)
let item12 = YHFormDetailItem(type: .certificateSignDate)
let item13 = YHFormDetailItem(type: .certificateValidDate)
let arr1:[YHFormItemProtocol] = [title1, item10, item11, item12, item13]
items.append(arr1)
if let hkMacaoPass = certificates.hkMacaoPass {
item10.value = hkMacaoPass.number
item11.value = hkMacaoPass.issueAt
item12.value = hkMacaoPass.issueDateStartAt
item13.value = hkMacaoPass.issueDateEndAt
}
}
// 护照及其他旅行证件 信息必有
let title2 = YHFormTitleItem(type: .passPortOrTravelInfo)
let item20 = YHFormDetailItem(type: .certificateType)
let item21 = YHFormDetailItem(type: .certificateNumber)
let item22 = YHFormDetailItem(type: .certificateSignPlace)
let item23 = YHFormDetailItem(type: .certificateSignDate)
let item24 = YHFormDetailItem(type: .certificateValidDate)
let arr2:[YHFormItemProtocol] = [title2, item20, item21, item22, item23, item24]
items.append(arr2)
if let passport = certificates.passport {
item20.value = String(passport.passportType)
item21.value = passport.number
item22.value = passport.issueAt
item23.value = passport.issueDateStartAt
item24.value = passport.issueDateEndAt
}
tableView.reloadData()
}
}
......@@ -112,10 +164,10 @@ extension YHCertificateViewController : UITableViewDelegate, UITableViewDataSour
let detailItem = item as! YHFormDetailItem
if detailItem.type == .certificateNumber || detailItem.type == .certificateSignPlace { // 证件号码和签发地需要填写
if detailItem.type == .chinaIdentityCardNumber || detailItem.type == .certificateSignPlace { // 证件号码和签发地需要填写
let cell = tableView.dequeueReusableCell(withIdentifier: YHFormItemInputTextCell.cellReuseIdentifier, for: indexPath) as! YHFormItemInputTextCell
let titleItem = arr[0] as! YHFormTitleItem
if detailItem.type == .certificateNumber {
if detailItem.type == .chinaIdentityCardNumber {
cell.titleLabel.text = (titleItem.type == .chinaIdCardInfo ? "中国身份证号" : "证件号码")
} else {
cell.titleLabel.text = detailItem.getTitle()
......@@ -123,7 +175,7 @@ extension YHCertificateViewController : UITableViewDelegate, UITableViewDataSour
return cell
}
if detailItem.type == .cetificateType || detailItem.type == .certificateSignDate {
if detailItem.type == .certificateType || detailItem.type == .certificateSignDate {
let cell = tableView.dequeueReusableCell(withIdentifier: YHFormItemSelectSheetCell.cellReuseIdentifier, for: indexPath) as! YHFormItemSelectSheetCell
cell.title = detailItem.getTitle()
......@@ -176,21 +228,30 @@ extension YHCertificateViewController : UITableViewDelegate, UITableViewDataSour
return 52.0
}
func tableView(_ tableView: UITableView, viewForHeaderInSection section: Int) -> UIView? {
return UIView()
}
func tableView(_ tableView: UITableView, viewForFooterInSection section: Int) -> UIView? {
return UIView()
}
private func tableView(_ tableView: UITableView, viewForFooterInSection section: Int) -> CGFloat {
return 1.0
}
private func tableView(_ tableView: UITableView, viewForHeaderInSection section: Int) -> CGFloat {
return 14.0
}
func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
if indexPath.section >= items.count { return }
let arr:[YHFormItemProtocol] = items[indexPath.section]
let vc = YHSpouseBasicInfoVC()
self.navigationController?.pushViewController(vc)
if indexPath.row >= arr.count || indexPath.row < 0 { return }
if !(0..<items.count).contains(indexPath.section) { return }
let arr:[YHFormItemProtocol] = items[indexPath.section]
if !(0..<arr.count).contains(indexPath.row) { return }
let item = arr[indexPath.row]
if item is YHFormTitleItem {
......@@ -201,19 +262,22 @@ extension YHCertificateViewController : UITableViewDelegate, UITableViewDataSour
if detailItem.type == .certificateValidDate ||
detailItem.type == .certificateSignDate { // 届满日期 签发日期
YHDatePickView.show(type: .yyyymmdd) { date in
let arr = date.components(separatedBy: YHDatePickView.separator)
// [yyyy, mm, dd] eg ["2024", "01", "20"]
print(date)
self.view?.endEditing(true)
YHDatePickView.show(type: .yyyymmdd) { [weak self] date in
let dataArr = date.components(separatedBy: YHDatePickView.separator)
print(dataArr)
if let familyMember = self?.familyMember {
if familyMember.relationType == .child {
}
}
}
}
return
}
let vc = YHSpouseBasicInfoVC()
self.navigationController?.pushViewController(vc)
}
func createCorner(cell:UITableViewCell, arr:Array<Any>, indexPath:IndexPath) {
......
......@@ -36,8 +36,6 @@ class YHChildBasicInfoVC: YHBaseViewController {
tableView.register(YHFormItemAddCell.self, forCellReuseIdentifier: YHFormItemAddCell.cellReuseIdentifier)
tableView.register(YHFormItemSelectSheetCell.self, forCellReuseIdentifier: YHFormItemSelectSheetCell.cellReuseIdentifier)
tableView.register(YHFormItemDegreeInfoCell.self, forCellReuseIdentifier: YHFormItemDegreeInfoCell.cellReuseIdentifier)
return tableView
}()
......
......@@ -41,7 +41,7 @@ class YHChildInitialInfoVC: YHBaseViewController {
lazy var submitBtn:UIButton = {
let btn = UIButton()
btn.setTitle("提交".local, for: .normal)
btn.titleLabel?.font = UIFont.PingFangScR(ofSize: 14)
btn.titleLabel?.font = UIFont.PFSC_R(ofSize: 14)
btn.setTitleColor(.white, for: .normal)
btn.backgroundColor = UIColor(hexString:"#4388FF")
btn.layer.cornerRadius = 8.0
......@@ -52,7 +52,7 @@ class YHChildInitialInfoVC: YHBaseViewController {
lazy var saveBtn:UIButton = {
let btn = UIButton()
btn.setTitle("保存", for: .normal)
btn.titleLabel?.font = UIFont.PingFangScR(ofSize: 14)
btn.titleLabel?.font = UIFont.PFSC_R(ofSize: 14)
btn.setTitleColor(UIColor(hexString:"#222222"), for: .normal)
btn.backgroundColor = UIColor(hexString:"#F8F9FB")
btn.layer.cornerRadius = 8.0
......@@ -86,11 +86,11 @@ class YHChildInitialInfoVC: YHBaseViewController {
let item00 = YHFormDetailItem(type: .ownCustody)
let item01 = YHFormDetailItem(type: .birthday)
let item02 = YHFormDetailItem(type: .isAccompanyToHK)
item02.isAccompany = (child.follow == 1)
item02.value = String(child.follow == 1)
let arr0:[YHFormItemProtocol] = [title0, item00, item01, item02]
items.append(arr0)
if item02.isAccompany { // 随行才加后面的信息
if child.isFollow() { // 随行才加后面的信息
// 国籍
let title1 = YHFormTitleItem(type: .country)
let item10 = YHFormDetailItem(type: .nationOrArea)
......@@ -99,7 +99,7 @@ class YHChildInitialInfoVC: YHBaseViewController {
// 居住信息
let title2 = YHFormTitleItem(type: .liveInfo)
let item20 = YHFormDetailItem(type: .isLiveTother)
item20.isLiveTogether = (child.finishFollow == 1)
item20.value = String(child.isLiveTother())
let item21 = YHFormDetailItem(type: .nationOrArea)
let item22 = YHFormDetailItem(type: .liveCity)
let item23 = YHFormDetailItem(type: .detailAddress)
......@@ -108,7 +108,7 @@ class YHChildInitialInfoVC: YHBaseViewController {
// 港澳通信证
let title3 = YHFormTitleItem(type: .hkAndMacaoPassport)
let item30 = YHFormDetailItem(type: .isHandleHKPassPort)
item30.isHandleHkPassport = (child.isHandled == 1)
item30.value = String(child.isNeedHandleHKPassPort())
let arr3:[YHFormItemProtocol] = [title3, item30]
items.append(contentsOf:[arr1, arr2, arr3])
......@@ -195,26 +195,14 @@ extension YHChildInitialInfoVC : UITableViewDelegate, UITableViewDataSource {
let cell = tableView.dequeueReusableCell(withIdentifier: YHFormItemDoubleChoiceCell.cellReuseIdentifier, for: indexPath) as! YHFormItemDoubleChoiceCell
cell.title = detailItem.getTitle()
let answers = [YHFormChoiceItem(title: "是".local, isSelect: true),YHFormChoiceItem(title: "否".local, isSelect: false)]
cell.answerArr = answers
if detailItem.type == .isAccompanyToHK {
let answers =
[YHFormChoiceItem(title: "是".local, isSelect: detailItem.isAccompany),
YHFormChoiceItem(title: "否".local, isSelect: !detailItem.isAccompany)]
cell.answerArr = answers
} else if detailItem.type == .isHandleHKPassPort {
let answers =
[YHFormChoiceItem(title: "是".local, isSelect: detailItem.isHandleHkPassport),
YHFormChoiceItem(title: "否".local, isSelect: !detailItem.isHandleHkPassport)]
cell.answerArr = answers
} else if detailItem.type == .isLiveTother {
let answers =
[YHFormChoiceItem(title: "是".local, isSelect: detailItem.isLiveTogether),
YHFormChoiceItem(title: "否".local, isSelect: !detailItem.isLiveTogether)]
cell.answerArr = answers
var select = false
if let value = detailItem.value {
select = Bool(value)!
}
let answers = [YHFormChoiceItem(title: "是".local, isSelect: select),YHFormChoiceItem(title: "否".local, isSelect: !select)]
cell.answerArr = answers
cell.answerBlock = {
......
......@@ -7,7 +7,6 @@
//
import UIKit
import IQKeyboardManagerSwift
enum YHFormTitleItemEditType:Int {
case none = 1
......@@ -17,6 +16,7 @@ enum YHFormTitleItemEditType:Int {
class YHFamilyMemberFormVC: YHBaseViewController {
let familyRequest:YHFamilyRequest = YHFamilyRequest()
var familyMemberInfo: YHFamilyMemberGroupInfo?
var isChildsEditMode: YHFormTitleItemEditType = .none
var isBrothersEditMode: YHFormTitleItemEditType = .none
......@@ -48,7 +48,7 @@ class YHFamilyMemberFormVC: YHBaseViewController {
let btn = UIButton()
btn.setTitle("提交".local, for: .normal)
btn.titleLabel?.font = UIFont.PingFangScR(ofSize: 14)
btn.titleLabel?.font = UIFont.PFSC_R(ofSize: 14)
btn.setTitleColor(.white, for: .normal)
btn.backgroundColor = UIColor(hexString:"#4388FF")
btn.layer.cornerRadius = 8.0
......@@ -105,6 +105,10 @@ class YHFamilyMemberFormVC: YHBaseViewController {
func loadData() {
self.familyRequest.getFamilyInfo(params: ["orderId": 133971]) { success, error in
}
let dic = [
"father": [
"id": 0,
......@@ -131,7 +135,12 @@ class YHFamilyMemberFormVC: YHBaseViewController {
"sex": 0,
"married": 0,
"nows": 0,
"address": [],
"address": [
"area": ["广东省", "深圳市"],
"country": "中国-China",
"details": "大新地铁站",
"foreign": ""
],
"child_stepchild": [],
"child_in_hk": [],
"country_identity": [],
......@@ -170,7 +179,12 @@ class YHFamilyMemberFormVC: YHBaseViewController {
"sex": 0,
"married": 0,
"nows": 0,
"address": [],
"address": [
"area": ["广东省", "深圳市"],
"country": "中国-China",
"details": "大新地铁站",
"foreign": ""
],
"child_stepchild": [],
"child_in_hk": [],
"country_identity": [],
......@@ -224,7 +238,7 @@ class YHFamilyMemberFormVC: YHBaseViewController {
"nows": 0,
"address": [
"area": ["广东省", "深圳市"],
"country": "中国-China",
"country": "",
"details": "大新地铁站",
"foreign": ""
],
......@@ -673,7 +687,7 @@ extension YHFamilyMemberFormVC : UITableViewDelegate, UITableViewDataSource {
// 配偶
if detailItem.relationType == .spouse {
let vc = YHSpouseInitialInfoVC()
let vc = YHSpouseInfoVC()
vc.spouse = detailItem
self.navigationController?.pushViewController(vc)
return
......
......@@ -32,11 +32,13 @@ class YHSpouseBasicInfoVC: YHBaseViewController {
lazy var tableView: UITableView = {
let tableView = UITableView(frame:.zero, style:.plain)
let tableView = UITableView(frame:.zero, style:.grouped)
if #available(iOS 11.0, *) {
tableView.contentInsetAdjustmentBehavior = .never
}
tableView.estimatedSectionHeaderHeight = 14.0
tableView.estimatedSectionFooterHeight = 1.0
tableView.showsVerticalScrollIndicator = false
tableView.backgroundColor = .clear
tableView.separatorStyle = .none
......@@ -65,11 +67,13 @@ class YHSpouseBasicInfoVC: YHBaseViewController {
func createUI() {
view.addSubview(tableView);
let topHeight = k_Height_NavigationtBarAndStatuBar+YHStepView.height
let bottomHeight = k_Height_safeAreaInsetsBottom() + YHSaveAndSubmitView.height
tableView.snp.makeConstraints { make in
make.top.equalToSuperview().offset(k_Height_NavigationtBarAndStatuBar)
make.bottom.equalToSuperview().offset(-100)
make.top.equalToSuperview().offset(topHeight)
make.left.equalToSuperview().offset(16)
make.right.equalToSuperview().offset(-16)
make.bottom.equalToSuperview().offset(-bottomHeight)
}
}
......@@ -249,12 +253,19 @@ extension YHSpouseBasicInfoVC : UITableViewDelegate, UITableViewDataSource {
return 52.0
}
func tableView(_ tableView: UITableView, viewForHeaderInSection section: Int) -> UIView? {
return UIView()
}
func tableView(_ tableView: UITableView, viewForFooterInSection section: Int) -> UIView? {
return UIView()
}
private func tableView(_ tableView: UITableView, viewForFooterInSection section: Int) -> CGFloat {
return 1.0
}
private func tableView(_ tableView: UITableView, viewForHeaderInSection section: Int) -> CGFloat {
return 14.0
}
......
//
// YHSpouseInfoVC.swift
// galaxy
//
// Created by edy on 2024/1/31.
// Copyright © 2024 https://www.galaxy-immi.com. All rights reserved.
//
import UIKit
class YHSpouseInfoVC: YHBaseViewController {
var spouse:YHFamilyMember? {
didSet {
initalInfoVC.spouse = spouse
passportInfoVC.familyMember = spouse
basicInfoVC.spouse = spouse
}
}
var currentIndex = 0 {
didSet {
currentIndex %= 4
stepView.currentIndex = currentIndex
for (i, vc) in self.children.enumerated() {
vc.view.isHidden = (currentIndex != i)
if currentIndex == i {
}
}
}
}
var stepView:YHStepView = {
let step = YHStepView()
step.dataSource = ["初始信息", "证件上传", "基本信息", "证件信息"]
step.block = { (index) in
// guard let self = self else { return }
}
return step
}()
var bottomView: YHSaveAndSubmitView = {
return YHSaveAndSubmitView.createView()
}()
let initalInfoVC = YHSpouseInitialInfoVC()
let uploadVC = UIViewController()
let passportInfoVC = YHCertificateViewController()
let basicInfoVC = YHSpouseBasicInfoVC()
override func viewDidLoad() {
super.viewDidLoad()
createUI()
}
func createUI() {
self.addChild(initalInfoVC)
self.addChild(uploadVC)
self.addChild(passportInfoVC)
self.addChild(basicInfoVC)
self.view.addSubview(basicInfoVC.view)
self.view.addSubview(passportInfoVC.view)
self.view.addSubview(uploadVC.view)
self.view.addSubview(initalInfoVC.view)
currentIndex = 0
view.addSubview(stepView)
view.addSubview(bottomView)
bottomView.submitBlock = {
[weak self] in
guard let self = self else { return }
self.didClickSubmitBtn()
}
bottomView.saveBlock = {
[weak self] in
guard let self = self else { return }
self.didClickSaveBtn()
}
stepView.snp.makeConstraints { make in
make.top.equalTo(k_Height_NavigationtBarAndStatuBar)
make.left.right.equalTo(view)
make.height.equalTo(YHStepView.height)
}
bottomView.snp.makeConstraints { make in
make.left.right.equalToSuperview()
make.bottom.equalToSuperview().offset(-k_Height_safeAreaInsetsBottom())
make.height.equalTo(YHSaveAndSubmitView.height)
}
}
func didClickSubmitBtn() {
currentIndex += 1;
}
func didClickSaveBtn() {
}
}
......@@ -38,8 +38,8 @@ enum YHFormTitleItemType:Int, CaseIterable {
// 中国身份证
case chinaIdCardInfo
// 护照
case passPortInfo
// 护照及其他旅行证件
case passPortOrTravelInfo
// 配偶信息
case spouseInfo
......@@ -92,9 +92,13 @@ enum YHFormDetailItemType:Int {
case isHandleHKPassPort
// 证件类别
case cetificateType
case certificateType
// 证件号码
case certificateNumber
// 中国身份证号
case chinaIdentityCardNumber
// 旅行证件号码
case traverlPassportNumber
// 签发日期
case certificateSignDate
// 届满日期
......@@ -187,7 +191,7 @@ class YHFormAddItem : YHFormItemProtocol
class YHFormTitleItem : YHFormItemProtocol {
var type: YHFormTitleItemType
init(type: YHFormTitleItemType) {
self.type = type
}
......@@ -212,7 +216,7 @@ class YHFormTitleItem : YHFormItemProtocol {
return "港澳通行证".local
case .chinaIdCardInfo:
return "中国身份证".local
case .passPortInfo:
case .passPortOrTravelInfo:
return String(format: "%@(%@)", "护照及其他旅行证件".local, "选填".local)
case .spouseInfo:
return "配偶信息".local
......@@ -262,7 +266,7 @@ class YHFormTitleItem : YHFormItemProtocol {
return "".local
case .chinaIdCardInfo:
return "".local
case .passPortInfo:
case .passPortOrTravelInfo:
return "".local
case .spouseInfo:
return "".local
......@@ -297,22 +301,8 @@ class YHFormDetailItem : YHFormItemProtocol {
// 是否是必填项
var isNeed: Bool = true
// 是否随行
var isAccompany:Bool = false
// 是否办理港澳通信证
var isHandleHkPassport:Bool = false
// 国籍
var country:String? = ""
/** 居住信息 **/
// 是否与主申请人同住
var isLiveTogether:Bool = false
// 现居住国家
var liveContry:String? = ""
// 现居住城市
var liveCity:String? = ""
// 现居住详细地址
var liveAddress:String? = ""
var value: String?
var placeHolder: String?
init(type: YHFormDetailItemType, isNeed:Bool = true) {
self.type = type
......@@ -336,12 +326,19 @@ class YHFormDetailItem : YHFormItemProtocol {
case .isHandleHKPassPort:
return "是否办理".local
// 证件类别
case .cetificateType:
case .certificateType:
return "证件类别".local
// 证件号码
case .certificateNumber:
return "证件号码".local
// 证件号码
case .chinaIdentityCardNumber:
return "中国身份证号".local
// 旅行证件号码
case .traverlPassportNumber:
return "旅行证件号码".local
// 签发日期
case .certificateSignDate:
return "签发日期".local
......@@ -476,6 +473,35 @@ enum YHFamilyMemberType: Int {
}
class YHFamilyMember: SmartCodable, YHFormItemProtocol {
// 是否随行
func isFollow() -> Bool {
return follow == 1
}
func setFollow(_ follow:Bool) {
self.follow = (follow ? 1 : 0)
}
// 是否要办理港澳通行证
func isNeedHandleHKPassPort() -> Bool {
return self.isHandled == 1
}
func setNeedHandleHKPassPort(_ need:Bool) {
self.isHandled = (need ? 1 : 0)
}
// 是否与主申请人同住
func isLiveTother() -> Bool {
return self.finishFollow == 1
}
func setLiveTother(_ together:Bool) {
self.finishFollow = (together ? 1 : 0)
}
var id: Int = 0
var deceased: Int = 0
var custody: Int = 0
......@@ -519,9 +545,7 @@ class YHFamilyMember: SmartCodable, YHFormItemProtocol {
var married: String?
var nows: Int = 0
// mark any
// var address: YHAddress?
var address: SmartAny?
var address: YHAddress?
// mark any
// var childStepchild: YHChildStepchildClass?
......@@ -547,6 +571,7 @@ class YHFamilyMember: SmartCodable, YHFormItemProtocol {
// mark any
// var certificates: YHCertificates?
var certificates: SmartAny?
var certificatesd: YHCertificates?
enum CodingKeys: String, CodingKey {
case id = "id"
......@@ -687,24 +712,31 @@ class YHSubsetNamePinyin: SmartCodable {
// MARK: - YHCertificates
class YHCertificates: SmartCodable {
required init() {
}
var cnIdentityCard: YHCNIdentityCard?
var passport: YHCNIdentityCard?
var hkMacaoPass: YHCNIdentityCard?
enum CodingKeys: String, CodingKey {
case cnIdentityCard = "cnIdentityCard"
case passport = "passport"
case hkMacaoPass = "hkMacaoPass"
}
required init() {
}
init(cnIdentityCard: YHCNIdentityCard?, passport: YHCNIdentityCard?, hkMacaoPass: YHCNIdentityCard?) {
self.cnIdentityCard = cnIdentityCard
self.passport = passport
self.hkMacaoPass = hkMacaoPass
}
}
// MARK: - YHCNIdentityCard
class YHCNIdentityCard: SmartCodable {
required init() {
}
var id: Int = 0
var number: String?
......@@ -725,6 +757,20 @@ class YHCNIdentityCard: SmartCodable {
case imgBack = "img_back"
case passportType = "passport_type"
}
required init() {
}
init(id:Int, number: String?, issueAt:String?, issueDateStartAt: String?, imgFront: String?, imgBack: String?, passportType: Int) {
self.id = id
self.number = number
self.issueAt = issueAt
self.issueDateStartAt = issueDateStartAt
self.imgFront = imgFront
self.imgBack = imgBack
self.passportType = passportType
}
}
// MARK: - YHHasDegreeJson
......
//
// YHFamilyRequest.swift
// galaxy
//
// Created by edy on 2024/2/1.
// Copyright © 2024 https://www.galaxy-immi.com. All rights reserved.
//
class YHFamilyRequest {
var familyInfo:YHFamilyMemberGroupInfo?
//请求所有家庭成员信息
func getFamilyInfo(params:[String:Any], callBackBlock:@escaping (_ success: Bool,_ error:YHErrorModel?)->()) {
let strUrl = YHBaseUrlManager.shared.curURL() + YHAllApiName.Order.familyInfoApi
let _ = YHNetRequest.getRequest(url: strUrl, params:params) {[weak self] json, code in
//1. json字符串 转 对象
guard let self = self else { return }
guard let model = NetBaseModel.deserialize(dict: json) else {
let error : YHErrorModel = YHErrorModel(errorCode:YHErrorCode.dictParseError.rawValue,errorMsg: YHErrorCode.dictParseError.description())
callBackBlock(false,error)
return
}
printLog("model 是 ==> \(model)")
let dic = model.data?.peel
guard let resultModel = YHFamilyMemberGroupInfo.deserialize(dict: dic as? [AnyHashable : Any]) else {
callBackBlock(false,nil)
return
}
familyInfo = resultModel
callBackBlock(true,nil)
} failBlock: { err in
callBackBlock(false,err)
}
}
}
......@@ -325,7 +325,7 @@ class YHFormPickerView: UIView {
let label = UILabel()
label.textColor = UIColor(hexString:"#222222")
label.textAlignment = .center
label.font = UIFont.PingFangScR(ofSize: 16)
label.font = UIFont.PFSC_R(ofSize: 16)
label.text = "请选择"
return label
}()
......@@ -333,7 +333,7 @@ class YHFormPickerView: UIView {
lazy var cancelBtn: UIButton = {
let btn = UIButton()
btn.setTitle("取消".local, for: .normal)
btn.titleLabel?.font = UIFont.PingFangScR(ofSize: 14)
btn.titleLabel?.font = UIFont.PFSC_R(ofSize: 14)
btn.setTitleColor(UIColor(hex: 0x222222), for: .normal)
btn.addTarget(self, action: #selector(didClickCancelButton), for: .touchUpInside)
return btn
......@@ -342,7 +342,7 @@ class YHFormPickerView: UIView {
lazy var confirmBtn: UIButton = {
let btn = UIButton()
btn.setTitle("确定".local, for: .normal)
btn.titleLabel?.font = UIFont.PingFangScR(ofSize: 14)
btn.titleLabel?.font = UIFont.PFSC_R(ofSize: 14)
btn.setTitleColor(UIColor(hex: 0x4487F9), for: .normal)
btn.addTarget(self, action: #selector(didClickConfirmButton), for: .touchUpInside)
return btn
......@@ -582,7 +582,7 @@ extension YHFormPickerView: UIPickerViewDelegate, UIPickerViewDataSource {
let label = UILabel()
label.textColor = UIColor(hexString:"#222222")
label.textAlignment = .center
label.font = UIFont.PingFangScR(ofSize: 14)
label.font = UIFont.PFSC_R(ofSize: 14)
label.text = ""
if let arr = dataDict[type] {
if 0 <= row && row < arr.count {
......
......@@ -27,7 +27,7 @@ class YHFormItemAddCell: UITableViewCell {
lazy var addBtn: UIButton = {
let btn = UIButton()
btn.setTitle("新增信息".local, for: .normal)
btn.titleLabel?.font = UIFont.PingFangScR(ofSize: 14)
btn.titleLabel?.font = UIFont.PFSC_R(ofSize: 14)
btn.setTitleColor(btnTitleColor, for: .normal)
btn.iconInLeft(spacing: 6)
......
......@@ -19,7 +19,7 @@ class YHFormItemDegreeInfoCell: UITableViewCell {
if let title = title {
let str = "*"+title
let attributes: [NSAttributedString.Key: Any] = [
.font: UIFont.PingFangScR(ofSize: 14),
.font: UIFont.PFSC_R(ofSize: 14),
.foregroundColor: UIColor(hex:0x222222)
]
let questionAttrStr = NSMutableAttributedString(string: str, attributes: attributes)
......@@ -36,7 +36,7 @@ class YHFormItemDegreeInfoCell: UITableViewCell {
label.textColor = UIColor(hexString:"#333333")
label.textAlignment = .left
label.numberOfLines = 0
label.font = UIFont.PingFangScR(ofSize: 16)
label.font = UIFont.PFSC_R(ofSize: 16)
return label
}()
......@@ -44,7 +44,7 @@ class YHFormItemDegreeInfoCell: UITableViewCell {
let btn = UIButton()
btn.setTitle("删除", for: .normal)
btn.titleLabel?.font = UIFont.PingFangScR(ofSize: 14)
btn.titleLabel?.font = UIFont.PFSC_R(ofSize: 14)
btn.setTitleColor(UIColor(hex: 0xF81D22), for: .normal)
btn.addTarget(self, action: #selector(didClickDeleteBtn(btn:)), for: .touchUpInside)
// btn.isHidden = true
......@@ -123,7 +123,7 @@ class HKDegreeInfoItemView: UIView {
label.textColor = UIColor(hexString:"#333333")
label.textAlignment = .left
label.numberOfLines = 0
label.font = UIFont.PingFangScR(ofSize: 14)
label.font = UIFont.PFSC_R(ofSize: 14)
return label
}()
......@@ -131,7 +131,7 @@ class HKDegreeInfoItemView: UIView {
let label = UILabel()
label.textColor = UIColor(hexString: "#222222")
label.textAlignment = .left
label.font = UIFont.PingFangScR(ofSize: 14)
label.font = UIFont.PFSC_R(ofSize: 14)
label.isHidden = true
return label
}()
......@@ -141,7 +141,7 @@ class HKDegreeInfoItemView: UIView {
label.textColor = UIColor(hexString: "#C0C0C0")
label.text = "请选择".local
label.textAlignment = .left
label.font = UIFont.PingFangScR(ofSize: 14)
label.font = UIFont.PFSC_R(ofSize: 14)
label.isHidden = false
return label
}()
......
......@@ -40,7 +40,7 @@ class YHFormItemDoubleChoiceCell: UITableViewCell {
if let question = title {
let str = "*"+question
let attributes: [NSAttributedString.Key: Any] = [
.font: UIFont.PingFangScR(ofSize: 14),
.font: UIFont.PFSC_R(ofSize: 14),
.foregroundColor: UIColor(hex:0x222222)
]
let questionAttrStr = NSMutableAttributedString(string: str, attributes: attributes)
......@@ -93,7 +93,7 @@ class YHFormItemDoubleChoiceCell: UITableViewCell {
let btn = UIButton()
btn.setTitle("", for: .normal)
btn.titleLabel?.font = UIFont.PingFangScR(ofSize: 14)
btn.titleLabel?.font = UIFont.PFSC_R(ofSize: 14)
btn.setTitleColor(btnTitleDefaultColor, for: .normal)
btn.backgroundColor = btnBgDefaultColor
btn.layer.cornerRadius = btnHeight/2.0
......@@ -108,7 +108,7 @@ class YHFormItemDoubleChoiceCell: UITableViewCell {
lazy var answer2Btn: UIButton = {
let btn = UIButton()
btn.setTitle("", for: .normal)
btn.titleLabel?.font = UIFont.PingFangScR(ofSize: 14)
btn.titleLabel?.font = UIFont.PFSC_R(ofSize: 14)
btn.setTitleColor(btnTitleDefaultColor, for: .normal)
btn.backgroundColor = btnBgDefaultColor
btn.layer.cornerRadius = btnHeight/2.0
......
......@@ -29,7 +29,7 @@ class YHFormItemEnterDetailCell: UITableViewCell {
if let title = title {
let str = (isMust ? ("*"+title) : title)
let attributes: [NSAttributedString.Key: Any] = [
.font: UIFont.PingFangScR(ofSize: 14),
.font: UIFont.PFSC_R(ofSize: 14),
.foregroundColor: UIColor(hex:0x222222)
]
let questionAttrStr = NSMutableAttributedString(string: str, attributes: attributes)
......@@ -48,17 +48,17 @@ class YHFormItemEnterDetailCell: UITableViewCell {
label.textColor = UIColor(hexString:"#333333")
label.textAlignment = .left
label.numberOfLines = 0
label.font = UIFont.PingFangScR(ofSize: 14)
label.font = UIFont.PFSC_R(ofSize: 14)
return label
}()
lazy var detailLabel: UILabel = {
let label = UILabel()
label.text = "XXXXXXX"
label.textColor = UIColor(hexString: "#888F98")
label.textColor = .labelTextColor2
label.textAlignment = .right
label.numberOfLines = 0
label.font = UIFont.PingFangScR(ofSize: 14)
label.font = UIFont.PFSC_R(ofSize: 14)
return label
}()
......@@ -71,7 +71,7 @@ class YHFormItemEnterDetailCell: UITableViewCell {
let btn = UIButton()
btn.setTitle("删除".local, for: .normal)
btn.titleLabel?.font = UIFont.PingFangScR(ofSize: 14)
btn.titleLabel?.font = UIFont.PFSC_R(ofSize: 14)
btn.setTitleColor(UIColor(hex: 0xF81D22), for: .normal)
btn.addTarget(self, action: #selector(didClickDeleteBtn(btn:)), for: .touchUpInside)
btn.isHidden = true
......
......@@ -23,7 +23,7 @@ class YHFormItemExpireDateCell: UITableViewCell {
if let title = title {
let str = (isMust ? ("*"+title) : title)
let attributes: [NSAttributedString.Key: Any] = [
.font: UIFont.PingFangScR(ofSize: 14),
.font: UIFont.PFSC_R(ofSize: 14),
.foregroundColor: UIColor(hex:0x222222)]
let questionAttrStr = NSMutableAttributedString(string: str, attributes: attributes)
if isMust {
......@@ -67,7 +67,7 @@ class YHFormItemExpireDateCell: UITableViewCell {
label.textColor = UIColor(hexString:"#333333")
label.textAlignment = .left
label.numberOfLines = 0
label.font = UIFont.PingFangScR(ofSize: 14)
label.font = UIFont.PFSC_R(ofSize: 14)
return label
}()
......@@ -75,7 +75,7 @@ class YHFormItemExpireDateCell: UITableViewCell {
let label = UILabel()
label.textColor = UIColor(hexString: "#222222")
label.textAlignment = .left
label.font = UIFont.PingFangScR(ofSize: 14)
label.font = UIFont.PFSC_R(ofSize: 14)
label.isHidden = true
return label
}()
......@@ -85,7 +85,7 @@ class YHFormItemExpireDateCell: UITableViewCell {
label.textColor = UIColor(hexString: "#C0C0C0")
label.text = "请选择".local
label.textAlignment = .left
label.font = UIFont.PingFangScR(ofSize: 14)
label.font = UIFont.PFSC_R(ofSize: 14)
label.isHidden = false
return label
}()
......@@ -93,7 +93,7 @@ class YHFormItemExpireDateCell: UITableViewCell {
lazy var longTimeBtn: UIButton = {
let btn = UIButton(type: .custom)
btn.setTitle("长期".local, for: .normal)
btn.titleLabel?.font = UIFont.PingFangScR(ofSize: 14)
btn.titleLabel?.font = UIFont.PFSC_R(ofSize: 14)
btn.setTitleColor(UIColor(hex: 0x222222), for: .normal)
btn.iconInLeft(spacing: 6)
btn.setImage(UIImage(named: "form_square_unselect"), for: .normal)
......
......@@ -14,6 +14,7 @@ class YHFormItemInputTextCell: UITableViewCell {
// 是否必填 如必填title会展示红色*
var isMust = false
var textChange:((String?)->Void)?
var title:String? {
didSet {
......@@ -21,7 +22,7 @@ class YHFormItemInputTextCell: UITableViewCell {
if let title = title {
let str = (isMust ? ("*"+title) : title)
let attributes: [NSAttributedString.Key: Any] = [
.font: UIFont.PingFangScR(ofSize: 14),
.font: UIFont.PFSC_R(ofSize: 14),
.foregroundColor: UIColor(hex:0x222222)
]
let questionAttrStr = NSMutableAttributedString(string: str, attributes: attributes)
......@@ -31,7 +32,6 @@ class YHFormItemInputTextCell: UITableViewCell {
}
titleLabel.attributedText = questionAttrStr
}
}
}
......@@ -40,7 +40,7 @@ class YHFormItemInputTextCell: UITableViewCell {
label.textColor = UIColor(hexString:"#333333")
label.textAlignment = .left
label.numberOfLines = 0
label.font = UIFont.PingFangScR(ofSize: 14)
label.font = UIFont.PFSC_R(ofSize: 14)
return label
}()
......@@ -48,11 +48,10 @@ class YHFormItemInputTextCell: UITableViewCell {
let textField = UITextField()
textField.backgroundColor = .clear
textField.placeholder = "请如实填写"
textField.font = UIFont.PingFangScR(ofSize: 14)
textField.font = UIFont.PFSC_R(ofSize: 14)
textField.tintColor = UIColor(hex: 0xC0C0C0)
textField.textColor = UIColor(hex: 0x222222)
// textField.delegate = self
// textField.addTarget(self, action: #selector(smsCodeInputChanged), for: .editingChanged)
textField.addTarget(self, action: #selector(textFieldChanged(textField:)), for: .editingChanged)
return textField
}()
......@@ -85,5 +84,11 @@ class YHFormItemInputTextCell: UITableViewCell {
make.left.equalTo(titleLabel.snp.right).offset(10)
}
}
@objc func textFieldChanged(textField:UITextField) {
if let textChange = textChange {
textChange(textField.text)
}
}
}
......@@ -54,7 +54,7 @@ class YHFormItemOnlyDoubleChoiceCell: UITableViewCell {
let btn = UIButton()
btn.setTitle("", for: .normal)
btn.titleLabel?.font = UIFont.PingFangScR(ofSize: 14)
btn.titleLabel?.font = UIFont.PFSC_R(ofSize: 14)
btn.setTitleColor(btnTitleDefaultColor, for: .normal)
btn.backgroundColor = btnBgDefaultColor
btn.layer.cornerRadius = btnHeight/2.0
......@@ -69,7 +69,7 @@ class YHFormItemOnlyDoubleChoiceCell: UITableViewCell {
lazy var answer2Btn: UIButton = {
let btn = UIButton()
btn.setTitle("", for: .normal)
btn.titleLabel?.font = UIFont.PingFangScR(ofSize: 14)
btn.titleLabel?.font = UIFont.PFSC_R(ofSize: 14)
btn.setTitleColor(btnTitleDefaultColor, for: .normal)
btn.backgroundColor = btnBgDefaultColor
btn.layer.cornerRadius = btnHeight/2.0
......
......@@ -30,7 +30,7 @@ class YHFormItemQuestionCell: UITableViewCell {
if let question = title {
let str = "*"+question
let attributes: [NSAttributedString.Key: Any] = [
.font: UIFont.PingFangScR(ofSize: 14),
.font: UIFont.PFSC_R(ofSize: 14),
.foregroundColor: UIColor(hex:0x222222)
]
let questionAttrStr = NSMutableAttributedString(string: str, attributes: attributes)
......@@ -52,7 +52,7 @@ class YHFormItemQuestionCell: UITableViewCell {
label.numberOfLines = 0
label.textColor = UIColor(hexString:"#333333")
label.textAlignment = .left
label.font = UIFont.PingFangScR(ofSize: 14)
label.font = UIFont.PFSC_R(ofSize: 14)
return label
}()
......@@ -60,7 +60,7 @@ class YHFormItemQuestionCell: UITableViewCell {
let btn = UIButton()
btn.setTitle("是".local, for: .normal)
btn.titleLabel?.font = UIFont.PingFangScR(ofSize: 14)
btn.titleLabel?.font = UIFont.PFSC_R(ofSize: 14)
btn.setTitleColor(btnTitleDefaultColor, for: .normal)
btn.backgroundColor = btnBgColor
btn.layer.cornerRadius = btnHeight/2.0
......@@ -74,7 +74,7 @@ class YHFormItemQuestionCell: UITableViewCell {
lazy var negativeBtn: UIButton = {
let btn = UIButton()
btn.setTitle("否".local, for: .normal)
btn.titleLabel?.font = UIFont.PingFangScR(ofSize: 14)
btn.titleLabel?.font = UIFont.PFSC_R(ofSize: 14)
btn.setTitleColor(btnTitleDefaultColor, for: .normal)
btn.backgroundColor = btnBgColor
btn.layer.cornerRadius = btnHeight/2.0
......
......@@ -21,7 +21,7 @@ class YHFormItemSelectSheetCell: UITableViewCell {
if let title = title {
let str = (isMust ? ("*"+title) : title)
let attributes: [NSAttributedString.Key: Any] = [
.font: UIFont.PingFangScR(ofSize: 14),
.font: UIFont.PFSC_R(ofSize: 14),
.foregroundColor: UIColor(hex:0x222222)
]
let questionAttrStr = NSMutableAttributedString(string: str, attributes: attributes)
......@@ -60,7 +60,7 @@ class YHFormItemSelectSheetCell: UITableViewCell {
label.textColor = UIColor(hexString:"#333333")
label.textAlignment = .left
label.numberOfLines = 0
label.font = UIFont.PingFangScR(ofSize: 14)
label.font = UIFont.PFSC_R(ofSize: 14)
return label
}()
......@@ -68,7 +68,7 @@ class YHFormItemSelectSheetCell: UITableViewCell {
let label = UILabel()
label.textColor = UIColor(hexString: "#222222")
label.textAlignment = .left
label.font = UIFont.PingFangScR(ofSize: 14)
label.font = UIFont.PFSC_R(ofSize: 14)
label.isHidden = true
return label
}()
......@@ -78,7 +78,7 @@ class YHFormItemSelectSheetCell: UITableViewCell {
label.textColor = UIColor(hexString: "#C0C0C0")
label.text = "请选择".local
label.textAlignment = .left
label.font = UIFont.PingFangScR(ofSize: 14)
label.font = UIFont.PFSC_R(ofSize: 14)
label.isHidden = false
return label
}()
......
......@@ -22,16 +22,16 @@ class YHFormItemTitleCell: UITableViewCell {
label.textColor = UIColor(hexString:"#333333")
label.textAlignment = .left
label.numberOfLines = 0
label.font = UIFont.PingFangScR(ofSize: 16)
label.font = UIFont.PFSC_R(ofSize: 16)
return label
}()
lazy var subTitleLabel: UILabel = {
let label = UILabel()
label.textColor = UIColor(hexString:"#888F98")
label.textColor = .labelTextColor2
label.textAlignment = .left
label.numberOfLines = 0
label.font = UIFont.PingFangScR(ofSize: 14)
label.font = UIFont.PFSC_R(ofSize: 14)
return label
}()
......@@ -39,7 +39,7 @@ class YHFormItemTitleCell: UITableViewCell {
let btn = UIButton()
btn.setTitle("取消操作".local, for: .normal)
btn.titleLabel?.font = UIFont.PingFangScR(ofSize: 14)
btn.titleLabel?.font = UIFont.PFSC_R(ofSize: 14)
btn.setTitleColor(UIColor(hex: 0x4487F9), for: .normal)
btn.tag = cancelTag
btn.addTarget(self, action: #selector(didClickOperatorBtn(btn:)), for: .touchUpInside)
......
//
// YHSaveAndSubmitView.swift
// galaxy
//
// Created by edy on 2024/1/31.
// Copyright © 2024 https://www.galaxy-immi.com. All rights reserved.
//
import UIKit
class YHSaveAndSubmitView: UIView {
static let submitBtnHeight = 48.0
static let gap = 8.0
static let height = submitBtnHeight+gap*2
var saveBlock:(()->Void)?
var submitBlock:(()->Void)?
lazy var submitBtn:UIButton = {
let btn = UIButton()
btn.setTitle("提交".local, for: .normal)
btn.titleLabel?.font = UIFont.PFSC_R(ofSize: 14)
btn.setTitleColor(.white, for: .normal)
btn.backgroundColor = UIColor(hexString:"#4388FF")
btn.layer.cornerRadius = 8.0
btn.addTarget(self, action: #selector(didClickSubmitBtn), for: .touchUpInside)
return btn
}()
lazy var saveBtn:UIButton = {
let btn = UIButton()
btn.setTitle("保存", for: .normal)
btn.titleLabel?.font = UIFont.PFSC_R(ofSize: 14)
btn.setTitleColor(UIColor(hexString:"#222222"), for: .normal)
btn.backgroundColor = UIColor(hexString:"#F8F9FB")
btn.layer.cornerRadius = 8.0
btn.addTarget(self, action: #selector(didClickSaveBtn), for: .touchUpInside)
return btn
}()
lazy var bottomView:UIView = {
let view = UIView()
view.backgroundColor = .white
view.addSubview(submitBtn)
view.addSubview(saveBtn)
return view
}()
static func createView() -> YHSaveAndSubmitView {
let view = YHSaveAndSubmitView(frame: CGRect(x: 0, y: 0, width: KScreenWidth, height: Self.height))
return view
}
override init(frame: CGRect) {
super.init(frame: frame)
self.createUI()
}
required init?(coder: NSCoder) {
super.init(coder: coder)
}
func createUI() {
self.backgroundColor = .white
self.addSubview(saveBtn)
self.addSubview(submitBtn)
saveBtn.snp.makeConstraints { make in
make.left.equalToSuperview().offset(16)
make.size.equalTo(CGSize(width: 86.0, height: Self.submitBtnHeight))
make.top.equalTo(Self.gap)
}
submitBtn.snp.makeConstraints { make in
make.left.equalTo(saveBtn.snp.right).offset(10)
make.right.equalToSuperview().offset(-16)
make.height.equalTo(Self.submitBtnHeight)
make.centerY.equalTo(saveBtn)
}
}
@objc func didClickSubmitBtn() {
if let submitBlock = submitBlock {
submitBlock()
}
}
@objc func didClickSaveBtn() {
if let saveBlock = saveBlock {
saveBlock()
}
}
}
......@@ -177,6 +177,7 @@ class YHDatePickView: UIView {
removeFromSuperview()
}
@objc func sure() {
guard let type = type else { return }
var date = ""
......@@ -191,6 +192,7 @@ class YHDatePickView: UIView {
if self.backDate != nil {
self.backDate!(date)
}
dismiss()
}
}
......
......@@ -9,6 +9,8 @@
import UIKit
class YHStepView: UIScrollView {
static let height = 104.0
typealias Block = (Int) -> ()
var block: Block?
var dataSource: [String]? {
......
......@@ -27,24 +27,14 @@ class YHScoreDetailViewController: YHBaseViewController {
var homeTableView: YHGestureTableView = {
let tableView = YHGestureTableView(frame: .zero, style:.plain)
let tableView = YHGestureTableView(frame: .zero, style:.grouped)
tableView.backgroundColor = .clear
tableView.separatorStyle = .none
tableView.showsHorizontalScrollIndicator = false
tableView.showsVerticalScrollIndicator = false
tableView.rowHeight = UITableView.automaticDimension
tableView.register(YHScorePersonInfoCell.self,forCellReuseIdentifier: YHScorePersonInfoCell.cellReuseIdentifier)
tableView.register(YHScoreItemCell.self,forCellReuseIdentifier: YHScoreItemCell.cellReuseIdentifier)
tableView.register(YHScoreItemCellForAge.self,forCellReuseIdentifier: YHScoreItemCellForAge.cellReuseIdentifier)
// tableView.register(YHDavidCell1.self,forCellReuseIdentifier: YHDavidCell1.cellReuseIdentifier)
// tableView.register(YHDavidCell3.self,forCellReuseIdentifier: YHDavidCell3.cellReuseIdentifier)
// tableView.register(YHDavidCell2.self,forCellReuseIdentifier: YHDavidCell2.cellReuseIdentifier)
// tableView.register(YHDavidCell4.self,forCellReuseIdentifier: YHDavidCell4.cellReuseIdentifier)
// tableView.register(YHDavidCell5.self,forCellReuseIdentifier: YHDavidCell5.cellReuseIdentifier)
return tableView
}()
......@@ -102,10 +92,13 @@ extension YHScoreDetailViewController {
extension YHScoreDetailViewController : UITableViewDelegate,UITableViewDataSource {
func numberOfSections(in tableView: UITableView) -> Int {
return 1
return 2
}
func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
if section == 0 {
return 1
}
return 6
}
......@@ -132,17 +125,12 @@ extension YHScoreDetailViewController : UITableViewDelegate,UITableViewDataSourc
func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
if indexPath.row == 0 {
if indexPath.section == 0 {
let cell = tableView.dequeueReusableCell(withClass: YHScorePersonInfoCell.self)
return cell
} else if indexPath.row == 1 {
let cell = tableView.dequeueReusableCell(withClass: YHScoreItemCellForAge.self)
cell.optionData = self.serviceCenterMainReqVM.localScoreData?[indexPath.row]
return cell
}
let cell = tableView.dequeueReusableCell(withClass: YHScoreItemCell.self)
cell.optionData = self.serviceCenterMainReqVM.localScoreData?[indexPath.row]
cell.optionData = self.serviceCenterMainReqVM.localScoreData?[indexPath.row + 1]
return cell
}
......
......@@ -24,16 +24,16 @@ class YHScoreDataModel: SmartCodable {
subscript(_ index : Int) -> YHScoreSessionModel? {
if index == 1 {
return age_score
} else if index == 2 {
return language_score
} else if index == 2 {
return education_score
} else if index == 3 {
return background_score
} else if index == 4 {
return work_experience_score
} else if index == 4 {
return talent_list_score
} else if index == 5 {
return education_score
return language_score
} else if index == 6 {
return talent_list_score
return background_score
}
return nil
}
......
......@@ -11,12 +11,6 @@ import AttributedString
class YHScoreItemCell: UITableViewCell {
static let cellReuseIdentifier = "YHScoreItemCell"
// var dataModel : YHContactItemModel? {
// didSet {
//// updateUI()
// }
// }
var optionData : YHScoreSessionModel? {
didSet {
updateUI()
......@@ -33,13 +27,10 @@ class YHScoreItemCell: UITableViewCell {
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
}
override init(style: UITableViewCell.CellStyle, reuseIdentifier: String?) {
......@@ -64,6 +55,17 @@ extension YHScoreItemCell {
func setupUI() {
backgroundColor = .clear
contentView.backgroundColor = .clear
}
func updateUI() {
guard let arrData = optionData?.options else {
return
}
for view in holdView.subviews {
view.removeFromSuperview()
}
holdView.removeFromSuperview()
contentView.addSubview(holdView)
......@@ -72,12 +74,6 @@ extension YHScoreItemCell {
make.bottom.equalToSuperview().offset(-14)
}
//
let view1 = UIView()
holdView.addSubview(view1)
view1.snp.makeConstraints { make in
make.top.left.right.equalToSuperview()
}
titleView = YHScoreTitleView()
holdView.addSubview(titleView)
......@@ -87,6 +83,7 @@ extension YHScoreItemCell {
make.right.equalTo(-18)
make.height.equalTo(YHScoreTitleView.viewH)
}
titleView.updateWith(optionData?.name, optionData?.score)
let resultView = YHScoreResultView()
......@@ -98,60 +95,35 @@ extension YHScoreItemCell {
make.height.equalTo(YHScoreTitleView.viewH)
}
scoreOptionsView1 = YHScoreOptionsView()
holdView.addSubview(scoreOptionsView1)
scoreOptionsView1.snp.makeConstraints { make in
make.top.equalTo(resultView.snp.bottom)
make.left.equalTo(titleView.snp.left)
make.right.equalTo(titleView.snp.right)
}
scoreOptionsView2 = YHScoreOptionsView()
holdView.addSubview(scoreOptionsView2)
scoreOptionsView2.snp.makeConstraints { make in
make.top.equalTo(scoreOptionsView1.snp.bottom)
make.left.equalTo(titleView.snp.left)
make.right.equalTo(titleView.snp.right)
}
scoreOptionsView3 = YHScoreOptionsView()
holdView.addSubview(scoreOptionsView3)
scoreOptionsView3.snp.makeConstraints { make in
make.top.equalTo(scoreOptionsView2.snp.bottom)
make.left.equalTo(titleView.snp.left)
make.right.equalTo(titleView.snp.right)
}
scoreOptionsView4 = YHScoreOptionsView()
holdView.addSubview(scoreOptionsView4)
scoreOptionsView4.snp.makeConstraints { make in
make.top.equalTo(scoreOptionsView3.snp.bottom)
make.left.equalTo(titleView.snp.left)
make.right.equalTo(titleView.snp.right)
make.bottom.equalToSuperview()
}
}
func updateUI() {
guard let arrData = optionData?.options else {
return
}
titleView.updateWith(optionData?.name, optionData?.score)
var tagView : UIView = resultView
for (index,item) in arrData.enumerated() {
if index == 0 {
scoreOptionsView1.dataModel = item
} else if index == 1 {
scoreOptionsView2.dataModel = item
} else if index == 2 {
scoreOptionsView3.dataModel = item
} else if index == 3 {
scoreOptionsView4.dataModel = item
let optionView = YHScoreOptionsView()
optionView.dataModel = item
holdView.addSubview(optionView)
if index == arrData.count - 1 {
optionView.snp.makeConstraints { make in
make.top.equalTo(tagView.snp.bottom)
make.left.equalTo(titleView.snp.left)
make.right.equalTo(titleView.snp.right)
make.bottom.equalToSuperview()
}
optionView.bottomLine.isHidden = true
} else {
optionView.snp.makeConstraints { make in
make.top.equalTo(tagView.snp.bottom)
make.left.equalTo(titleView.snp.left)
make.right.equalTo(titleView.snp.right)
}
optionView.bottomLine.isHidden = false
}
tagView = optionView
}
}
}
......@@ -19,19 +19,11 @@ class YHScoreOptionsView: UIView {
fatalError("init(coder:) has not been implemented")
}
// lazy var nameLable : UILabel = {
// let lable0 = UILabel()
// lable0.textColor = UIColor(hex: 0x4E4E4E)
// lable0.font = UIFont.PingFangScR(ofSize: 14)
// lable0.numberOfLines = 0
// lable0.lineBreakMode = .byWordWrapping
// return lable0
// }()
private lazy var nameTextView : UITextView = {
let lable0 = UITextView()
lable0.textColor = UIColor(hex: 0x4E4E4E)
lable0.font = UIFont.PingFangScR(ofSize: 14)
lable0.font = UIFont.PFSC_R(ofSize: 14)
lable0.isScrollEnabled = false
lable0.isEditable = false
lable0.isSelectable = false
......@@ -40,7 +32,7 @@ class YHScoreOptionsView: UIView {
}()
private lazy var bottomLine : UIView = {
lazy var bottomLine : UIView = {
let view = UIView()
view.backgroundColor = UIColor(hex:0xF0F0F0)
return view
......@@ -49,7 +41,7 @@ class YHScoreOptionsView: UIView {
private lazy var customLabel : UILabel = {
let customLabel = UILabel(frame: CGRect(x: 0, y: 0, width: 40, height: 20))
customLabel.text = "-"
customLabel.font = .PingFangScR(ofSize: 12)
customLabel.font = .PFSC_R(ofSize: 12)
customLabel.backgroundColor = UIColor(hex:0xF8F9FB)
customLabel.textColor = UIColor(hex: 0x888F98)
customLabel.layer.cornerRadius = 4
......@@ -74,13 +66,6 @@ private extension YHScoreOptionsView {
make.height.equalTo(0.5)
}
// addSubview(nameLable)
// nameLable.snp.makeConstraints { make in
// make.top.equalTo(16)
// make.left.right.equalToSuperview()
// make.bottom.equalTo(bottomLine.snp.top).offset(-16)
// }
addSubview(nameTextView)
nameTextView.snp.makeConstraints { make in
make.top.equalTo(16)
......@@ -101,14 +86,14 @@ private extension YHScoreOptionsView {
if model.isSelected == true {
nameTextView.attributed.text = """
\(model.scoreName, .foreground(UIColor(hex: 0x3C86F8)), .font(UIFont.PingFangScR(ofSize: 14))) \(.view(customLabel, .original(.center)))
\(model.scoreName, .foreground(UIColor(hex: 0x3C86F8)), .font(UIFont.PFSC_R(ofSize: 14))) \(.view(customLabel, .original(.center)))
"""
customLabel.backgroundColor = UIColor(hex:0x3C86F8,alpha:0.12)
customLabel.textColor = UIColor(hex: 0x3C86F8)
} else {
nameTextView.attributed.text = """
\(model.scoreName, .foreground(UIColor(hex: 0x4E4E4E)), .font(UIFont.PingFangScR(ofSize: 14))) \(.view(customLabel, .original(.center)))
\(model.scoreName, .foreground(UIColor(hex: 0x4E4E4E)), .font(UIFont.PFSC_R(ofSize: 14))) \(.view(customLabel, .original(.center)))
"""
customLabel.backgroundColor = UIColor(hex:0xF8F9FB)
customLabel.textColor = UIColor(hex: 0x888F98)
......
......@@ -12,12 +12,6 @@ import AttributedString
class YHScorePersonInfoCell: UITableViewCell {
static let cellReuseIdentifier = "YHScorePersonInfoCell"
// var dataModel : YHContactItemModel? {
// didSet {
//// updateUI()
// }
// }
//头像
private lazy var headImagV : UIImageView = {
let imageV = UIImageView(image: UIImage(named: "score_header_default"))
......@@ -29,7 +23,7 @@ class YHScorePersonInfoCell: UITableViewCell {
private lazy var nameLable : UILabel = {
let lable0 = UILabel(text: "DavidHuang")
lable0.textColor = UIColor(hex: 0x222222)
lable0.font = UIFont.PingFangScM(ofSize: 16)
lable0.font = UIFont.PFSC_M(ofSize: 16)
return lable0
}()
......@@ -37,7 +31,7 @@ class YHScorePersonInfoCell: UITableViewCell {
private lazy var phoneLable : UILabel = {
let lable0 = UILabel(text: "15818743775")
lable0.textColor = UIColor(hex: 0x888F98)
lable0.font = UIFont.PingFangScR(ofSize: 12)
lable0.font = UIFont.PFSC_R(ofSize: 12)
return lable0
}()
......@@ -46,7 +40,7 @@ class YHScorePersonInfoCell: UITableViewCell {
private lazy var scoreLable : UILabel = {
let lable0 = UILabel(text: "92 分")
lable0.textColor = UIColor(hex: 0x3C86F8)
lable0.font = UIFont.PingFangScB(ofSize: 43)
lable0.font = UIFont.PFSC_B(ofSize: 43)
lable0.textAlignment = .right
return lable0
}()
......@@ -82,7 +76,7 @@ extension YHScorePersonInfoCell {
let lable0 = UILabel(text: "香港优才评分报告")
lable0.textColor = .white
lable0.font = UIFont.PingFangScB(ofSize: 24)
lable0.font = UIFont.PFSC_B(ofSize: 24)
contentView.addSubview(lable0)
lable0.snp.makeConstraints { make in
make.top.equalTo(32)
......@@ -94,7 +88,7 @@ extension YHScorePersonInfoCell {
let lable1 = UILabel(text: "根据您填写的资料情况生成")
lable1.textColor = UIColor(hex: 0xffffff,alpha: 0.8)
lable1.font = UIFont.PingFangScR(ofSize: 12)
lable1.font = UIFont.PFSC_R(ofSize: 12)
contentView.addSubview(lable1)
lable1.snp.makeConstraints { make in
make.top.equalTo(lable0.snp.bottom).offset(6)
......@@ -172,8 +166,8 @@ extension YHScorePersonInfoCell {
make.height.equalTo(50)
}
let a: ASAttributedString = .init("95", .font(UIFont.PingFangScR(ofSize: 43)),.foreground(UIColor(hex:0x3C86F8)))
let b: ASAttributedString = .init("分", .font(UIFont.PingFangScR(ofSize: 12)),.foreground(UIColor(hex:0x3C86F8)))
let a: ASAttributedString = .init("95", .font(UIFont.PFSC_R(ofSize: 43)),.foreground(UIColor(hex:0x3C86F8)))
let b: ASAttributedString = .init("分", .font(UIFont.PFSC_R(ofSize: 12)),.foreground(UIColor(hex:0x3C86F8)))
scoreLable.attributed.text = a + b
......@@ -181,7 +175,7 @@ extension YHScorePersonInfoCell {
let lable3 = UILabel(text: "综合得分")
lable3.textColor = UIColor(hex: 0x888F98)
lable3.font = UIFont.PingFangScR(ofSize: 12)
lable3.font = UIFont.PFSC_R(ofSize: 12)
lable3.textAlignment = .right
contentView.addSubview(lable3)
lable3.snp.makeConstraints { make in
......
......@@ -36,7 +36,7 @@ class YHScoreResultView: UIView {
private lazy var nameLable : UILabel = {
let lable0 = UILabel(text: "年龄:32")
lable0.textColor = UIColor(hex: 0x4E4E4E)
lable0.font = UIFont.PingFangScM(ofSize: 14)
lable0.font = UIFont.PFSC_M(ofSize: 14)
return lable0
}()
......@@ -44,7 +44,7 @@ class YHScoreResultView: UIView {
private lazy var desLable : UILabel = {
let lable0 = UILabel(text: "得分:30分")
lable0.textColor = UIColor(hex: 0x4E4E4E)
lable0.font = UIFont.PingFangScM(ofSize: 14)
lable0.font = UIFont.PFSC_M(ofSize: 14)
return lable0
}()
......
......@@ -28,7 +28,7 @@ class YHScoreTitleView: UIView {
private lazy var nameLable : UILabel = {
let lable0 = UILabel(text: "年龄得分")
lable0.textColor = UIColor(hex: 0x222222)
lable0.font = UIFont.PingFangScM(ofSize: 17)
lable0.font = UIFont.PFSC_M(ofSize: 17)
return lable0
}()
......@@ -36,7 +36,7 @@ class YHScoreTitleView: UIView {
private lazy var desLable : UILabel = {
let lable0 = UILabel(text: "(最高30分)")
lable0.textColor = UIColor(hex: 0x888F98)
lable0.font = UIFont.PingFangScR(ofSize: 14)
lable0.font = UIFont.PFSC_R(ofSize: 14)
return lable0
}()
......
......@@ -7,12 +7,10 @@
//
import UIKit
import JXSegmentedView
/*
*家庭成员信息
*/
class YHFamilyMemberViewController: YHBaseViewController {
class YHFamilyMemberViewController: YHPersonInfoBaseViewController {
override func viewDidLoad() {
super.viewDidLoad()
......@@ -21,25 +19,6 @@ class YHFamilyMemberViewController: YHBaseViewController {
// Do any additional setup after loading the view.
}
/*
// MARK: - Navigation
// In a storyboard-based application, you will often want to do a little preparation before navigation
override func prepare(for segue: UIStoryboardSegue, sender: Any?) {
// Get the new view controller using segue.destination.
// Pass the selected object to the new view controller.
}
*/
}
// MARK: - JXSegmentedListContainerViewListDelegate
extension YHFamilyMemberViewController: JXSegmentedListContainerViewListDelegate {
func listView() -> UIView {
return view
}
}
//
// YHMainApplicantInfoViewController.swift
// galaxy
//
// Created by davidhuangA on 2024/1/29.
// Copyright © 2024 https://www.galaxy-immi.com. All rights reserved.
//
import UIKit
import JXSegmentedView
/*
*主申请人信息
*/
class YHMainApplicantInfoViewController: YHPersonInfoBaseViewController {
var arrData : [YHPersonInfoCellModel] = []
override func viewDidLoad() {
super.viewDidLoad()
setupUI()
}
}
private extension YHMainApplicantInfoViewController {
func fakeData() {
do {
//国家信息
let tmp0 = YHPersonInfoBaseModel(name: "国家/国籍:", description: "中国-China")
let tmp1 = YHPersonInfoBaseModel(name: "港澳通行证:", description: "未办理")
let arr = [tmp0,tmp1]
let model1 = YHPersonInfoCellModel(cellType: 0, cellTitle: "国籍信息", cellData0: arr)
arrData.append(model1)
}
do {
//基本信息
let tmp0 = YHPersonInfoBaseModel(name: "主申请人:", description: "DavidHuang")
let tmp1 = YHPersonInfoBaseModel(name: "曾用名:", description: "--")
let tmp2 = YHPersonInfoBaseModel(name: "婚前姓氏:", description: "--")
let tmp3 = YHPersonInfoBaseModel(name: "出生日期:", description: "1990年8月18日")
let tmp4 = YHPersonInfoBaseModel(name: "出生城市:", description: "国内 吉林省/吉林市")
let tmp5 = YHPersonInfoBaseModel(name: "性别:", description: "男")
let tmp6 = YHPersonInfoBaseModel(name: "婚姻状况:", description: "已婚")
let tmp7 = YHPersonInfoBaseModel(name: "手机号:", description: "13572984488")
let tmp8 = YHPersonInfoBaseModel(name: "邮箱:", description: "13572984488@nn.com")
let tmp9 = YHPersonInfoBaseModel(name: "现居住地址:", description: "现居住地址:现居住地址:现居住地址:现居住地址:现居住地址:现居住地址:")
let tmp10 = YHPersonInfoBaseModel(name: "详细地址:", description: "锐度公园世家北区10-1-701锐度公园世家北区10-1-701")
let tmp11 = YHPersonInfoBaseModel(name: "是否办理过香港身份证:", description: "是")
let tmp12 = YHPersonInfoBaseModel(name: "香港身份证:", description: "否")
let arr = [tmp0,tmp1,tmp2,tmp3,tmp4,tmp5,tmp6,tmp7,tmp8,tmp9,tmp10,tmp11,tmp12]
let model2 = YHPersonInfoCellModel(cellType: 0, cellTitle: "基本信息", cellData0: arr)
arrData.append(model2)
}
do {
//证件信息
let tmp0 = YHPersonInfoBaseModel(name: "中国身份证号码:", description: "2203381990287633390")
let tmp1 = YHPersonInfoBaseModel(name: "签发地:", description: "北京市分局")
let tmp2 = YHPersonInfoBaseModel(name: "签发日期:", description: "2018-07-17")
let tmp3 = YHPersonInfoBaseModel(name: "届满日期:", description: "2028-07-31")
let model0 = YHPersonInfoCellModel1(cellTitle: "中国身份证", cellData: [tmp0,tmp1,tmp2,tmp3])
let tmp4 = YHPersonInfoBaseModel(name: "旅行社证件号码:", description: "c2345639")
let tmp5 = YHPersonInfoBaseModel(name: "签发地:", description: "北京市分局")
let tmp6 = YHPersonInfoBaseModel(name: "签发日期:", description: "2018-07-17")
let tmp7 = YHPersonInfoBaseModel(name: "届满日期:", description: "2028-07-31")
let model1 = YHPersonInfoCellModel1(cellTitle: "港澳通行证", cellData: [tmp4,tmp5,tmp6,tmp7])
let tmp8 = YHPersonInfoBaseModel(name: "证件类别:", description: "护照")
let tmp9 = YHPersonInfoBaseModel(name: "证件号码:", description: "p2345639")
let tmp10 = YHPersonInfoBaseModel(name: "签发地:", description: "北京市分局")
let tmp11 = YHPersonInfoBaseModel(name: "签发日期:", description: "2028-07-31")
let tmp12 = YHPersonInfoBaseModel(name: "届满日期:", description: "2028-07-31")
let model2 = YHPersonInfoCellModel1(cellTitle: "护照及其他旅行证件", cellData: [tmp8,tmp9,tmp10,tmp11,tmp12])
let arr = [model0,model1,model2]
let model3 = YHPersonInfoCellModel(cellType: 1, cellTitle: "证件信息", cellData1: arr)
arrData.append(model3)
}
do {
//证件照片
let model1 = YHPersonInfoCellModel2(cellTitle: "中国身份证",frontUrl: "", backUrl: "", idType: 1)
let model2 = YHPersonInfoCellModel2(cellTitle: "港澳通行证",frontUrl: "", backUrl: "", idType: 2)
let arr = [model1,model2]
let model4 = YHPersonInfoCellModel(cellType: 2, cellTitle: "证件照片", cellData2: arr)
arrData.append(model4)
}
}
func setupUI() {
fakeData()
self.homeTableView.register(YHPersonInfoCommonCell.self,forCellReuseIdentifier: YHPersonInfoCommonCell.cellReuseIdentifier)
self.homeTableView.reloadData()
}
}
// MARK: - UITableViewDelegate 和 UITableViewDataSource
extension YHMainApplicantInfoViewController {
override func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
return arrData.count
}
override func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
let cell = tableView.dequeueReusableCell(withClass: YHPersonInfoCommonCell.self)
cell.model = arrData[indexPath.row]
return cell
}
}
//
// YHPersonInfoBaseViewController.swift
// galaxy
//
// Created by davidhuangA on 2024/1/31.
// Copyright © 2024 https://www.galaxy-immi.com. All rights reserved.
//
import UIKit
import JXSegmentedView
class YHPersonInfoBaseViewController: YHBaseViewController {
public var homeTableView: YHGestureTableView = {
let tableView = YHGestureTableView(frame: .zero, style: .grouped)
tableView.backgroundColor = .clear
tableView.separatorStyle = .none
tableView.showsHorizontalScrollIndicator = false
tableView.showsVerticalScrollIndicator = false
return tableView
}()
public var vcCanScroll : Bool = true
override func viewDidLoad() {
super.viewDidLoad()
homeTableView.delegate = self
homeTableView.dataSource = self
view.addSubview(homeTableView)
}
override func viewWillLayoutSubviews() {
super.viewWillLayoutSubviews()
homeTableView.snp.makeConstraints { make in
make.top.bottom.equalToSuperview()
make.left.equalTo(16)
make.right.equalTo(-16)
}
}
}
// MARK: - 滑动使用
extension YHPersonInfoBaseViewController: UIScrollViewDelegate {
//控制滑动交互
func scrollViewDidScroll(_ scrollView: UIScrollView) {
let scrollViewSet: CGFloat = scrollView.contentOffset.y
if vcCanScroll == false {//不能滚动时
scrollView.contentOffset = CGPoint(x: 0, y: 0)
} else {
if (scrollViewSet <= 0) {
scrollView.contentOffset = CGPoint(x: 0, y: 0)
vcCanScroll = false
NotificationCenter.default.post(name: Notification.Name(rawValue: "leaveTop0"), object: nil)
} else {
scrollView.contentOffset = CGPoint(x: 0, y: scrollViewSet)
}
}
}
}
// MARK: - JXSegmentedListContainerViewListDelegate
extension YHPersonInfoBaseViewController: JXSegmentedListContainerViewListDelegate {
func listView() -> UIView {
return view
}
}
// MARK: - UITableViewDelegate 和 UITableViewDataSource
extension YHPersonInfoBaseViewController : UITableViewDelegate,UITableViewDataSource {
func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
return 0
}
func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
return UITableViewCell()
}
func tableView(_ tableView: UITableView, heightForHeaderInSection section: Int) -> CGFloat {
return 0.001
}
func tableView(_ tableView: UITableView, viewForHeaderInSection section: Int) -> UIView? {
let view = UIView(frame: CGRect(x: 0, y: 0, width: KScreenWidth, height: 0.001))
return view
}
func tableView(_ tableView: UITableView, heightForFooterInSection section: Int) -> CGFloat {
return 0.001
}
func tableView(_ tableView: UITableView, viewForFooterInSection section: Int) -> UIView? {
let view = UIView(frame: CGRect(x: 0, y: 0, width: KScreenWidth, height: 0.001))
return view
}
func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat {
return UITableView.automaticDimension
}
}
......@@ -13,25 +13,24 @@ class YHPersonInfoControllerHoldViewController: UIViewController {
var canScroll : Bool = false {
didSet {
// for vc in arrItemVCs {
// vc.vcCanScroll = canScroll
// }
for vc in arrItemVCs {
vc.vcCanScroll = canScroll
}
}
}
let arrItemTitles = ["主申请人信息","家庭成员信息","基本资料","学历/专业资格","工作经验","其他信息"]
var arrItemVCs : [YHBaseViewController] = []
var arrItemVCs : [YHPersonInfoBaseViewController] = []
var segmentedView : JXSegmentedView = JXSegmentedView(frame: CGRect(x: 0, y: 0, width: KScreenWidth, height: 58))
lazy var segmentedDataSource: JXSegmentedBaseDataSource = {
let dataSource = JXSegmentedTitleDataSource()
dataSource.isTitleColorGradientEnabled = true
dataSource.titles = arrItemTitles
dataSource.titleNormalFont = UIFont.PingFangScR(ofSize: 16)
dataSource.titleNormalFont = UIFont.PFSC_R(ofSize: 16)
dataSource.titleSelectedColor = UIColor(hex: 0x888F98)
dataSource.titleSelectedFont = UIFont.PingFangScM(ofSize: 18)
dataSource.titleSelectedFont = UIFont.PFSC_M(ofSize: 18)
dataSource.titleSelectedColor = UIColor(hex: 0x4388FF)
dataSource.isItemSpacingAverageEnabled = false
......@@ -50,19 +49,40 @@ class YHPersonInfoControllerHoldViewController: UIViewController {
super.viewDidLoad()
// for _ in arrItemTitles {
// let vc = YHDavidTestViewController()
// let vc = YHMainApplicantInfoViewController()
// arrItemVCs.append(vc)
// }
do {
let vc = YHMainApplicantInfoViewController()
arrItemVCs.append(vc)
}
do {
let vc = YHFamilyMemberViewController()
arrItemVCs.append(vc)
}
do {
let vc = YHFamilyMemberViewController()
arrItemVCs.append(vc)
}
do {
let vc = YHFamilyMemberViewController()
arrItemVCs.append(vc)
}
do {
let vc = YHFamilyMemberViewController()
arrItemVCs.append(vc)
}
do {
let vc = YHFamilyMemberViewController()
arrItemVCs.append(vc)
}
arrItemVCs.append(YHMainApplicantInfoViewController())
arrItemVCs.append(YHFamilyMemberViewController())
arrItemVCs.append(YHMainApplicantInfoViewController())
arrItemVCs.append(YHFamilyMemberViewController())
arrItemVCs.append(YHMainApplicantInfoViewController())
arrItemVCs.append(YHFamilyMemberViewController())//for test hjl
//segmentedViewDataSource一定要通过属性强持有!!!!!!!!!
......@@ -107,12 +127,15 @@ class YHPersonInfoControllerHoldViewController: UIViewController {
segmentedView.frame = CGRect(x: 0, y: 0, width: view.bounds.size.width, height: 58)
listContainerView.frame = CGRect(x: 0, y: 58, width: view.bounds.size.width, height: view.bounds.size.height - 58)
segmentedView.backgroundColor = .white
view.backgroundColor = .yellow//for test hjl
}
}
extension YHPersonInfoControllerHoldViewController: JXSegmentedViewDelegate {
func segmentedView(_ segmentedView: JXSegmentedView, didSelectedItemAt index: Int) {
NotificationCenter.default.post(name: Notification.Name(rawValue: "scrollViewDidEndDragging"), object: nil)
NotificationCenter.default.post(name: Notification.Name(rawValue: "scrollViewDidEndDragging0"), object: nil)
}
/// 正在滚动中的回调
......@@ -123,7 +146,7 @@ extension YHPersonInfoControllerHoldViewController: JXSegmentedViewDelegate {
/// - rightIndex: 正在滚动中,相对位置处于右边的index
/// - percent: 从左往右计算的百分比
func segmentedView(_ segmentedView: JXSegmentedView, scrollingFrom leftIndex: Int, to rightIndex: Int, percent: CGFloat) {
NotificationCenter.default.post(name: Notification.Name(rawValue: "scrollViewWillBeginDragging"), object: nil)
NotificationCenter.default.post(name: Notification.Name(rawValue: "scrollViewWillBeginDragging0"), object: nil)
}
}
......@@ -136,6 +159,6 @@ extension YHPersonInfoControllerHoldViewController: JXSegmentedListContainerView
}
func listContainerView(_ listContainerView: JXSegmentedListContainerView, initListAt index: Int) -> JXSegmentedListContainerViewListDelegate {
return arrItemVCs[index] as! JXSegmentedListContainerViewListDelegate
return arrItemVCs[index] as JXSegmentedListContainerViewListDelegate
}
}
......@@ -8,7 +8,6 @@
import UIKit
import GKNavigationBarSwift
//import JXSegmentedView
class YHPersonInformMainViewController: YHBaseViewController {
var canScroll : Bool = true
......@@ -21,25 +20,18 @@ class YHPersonInformMainViewController: YHBaseViewController {
let cellView: YHPersonInfoControllerHoldViewController = YHPersonInfoControllerHoldViewController()
// //model 及网络请求
// lazy var homeReqVM : YHHomePageViewModel = {
// return YHHomePageViewModel()
// }()
var homeTableView: YHGestureTableView = {
let tableView = YHGestureTableView(frame: .zero, style: .grouped)
tableView.backgroundColor = .clear
tableView.separatorStyle = .none
tableView.showsHorizontalScrollIndicator = false
tableView.showsVerticalScrollIndicator = false
// tableView.register(YHDavidCell0.self,forCellReuseIdentifier: YHDavidCell0.cellReuseIdentifier)
return tableView
}()
var myHeadView : UIView = {
let view = UIView(frame: CGRect(x: 16, y: 0, width: KScreenWidth - 16 * 2, height: 128))
// view.backgroundColor = .yellow //for test hjl
return view
}()
......@@ -55,7 +47,7 @@ class YHPersonInformMainViewController: YHBaseViewController {
private lazy var nameLable : UILabel = {
let lable0 = UILabel(text: "DavidHuang")
lable0.textColor = UIColor(hex: 0x222222)
lable0.font = UIFont.PingFangScM(ofSize: 16)
lable0.font = UIFont.PFSC_M(ofSize: 16)
return lable0
}()
......@@ -63,7 +55,7 @@ class YHPersonInformMainViewController: YHBaseViewController {
private lazy var phoneLable : UILabel = {
let lable0 = UILabel(text: "15818743775")
lable0.textColor = UIColor(hex: 0x888F98)
lable0.font = UIFont.PingFangScR(ofSize: 12)
lable0.font = UIFont.PFSC_R(ofSize: 12)
return lable0
}()
......@@ -73,13 +65,13 @@ class YHPersonInformMainViewController: YHBaseViewController {
super.viewDidLoad()
NotificationCenter.default.addObserver(self, selector: #selector(leaveTopOp), name:Notification.Name(rawValue: "leaveTop"), object: nil)
NotificationCenter.default.addObserver(self, selector: #selector(leaveTopOp), name:Notification.Name(rawValue: "leaveTop0"), object: nil)
NotificationCenter.default.addObserver(self, selector: #selector(beginDragging), name:Notification.Name(rawValue: "scrollViewWillBeginDragging"), object: nil)
NotificationCenter.default.addObserver(self, selector: #selector(beginDragging), name:Notification.Name(rawValue: "scrollViewWillBeginDragging0"), object: nil)
NotificationCenter.default.addObserver(self, selector: #selector(endDragging), name:Notification.Name(rawValue: "scrollViewDidEndDragging"), object: nil)
NotificationCenter.default.addObserver(self, selector: #selector(endDragging), name:Notification.Name(rawValue: "scrollViewDidEndDragging0"), object: nil)
//1.UI
initView()
......@@ -148,7 +140,6 @@ extension YHPersonInformMainViewController {
make.left.right.bottom.equalToSuperview()
}
// homeTableView.backgroundColor = .red//for test hjl
homeTableView.tableHeaderView = myHeadView
......
//
// YHCertificateInfo.swift
// YHPersonInfoBaseModel.swift
// galaxy
//
// Created by edy on 2024/1/25.
// Created by davidhuangA on 2024/1/30.
// Copyright © 2024 https://www.galaxy-immi.com. All rights reserved.
//
import UIKit
import SmartCodable
class YHCertificateInfo: NSObject {
struct YHPersonInfoBaseModel: SmartCodable {
var name : String = ""
var description : String = ""
}
//
// YHPersonInfoCellModel.swift
// galaxy
//
// Created by davidhuangA on 2024/1/30.
// Copyright © 2024 https://www.galaxy-immi.com. All rights reserved.
//
import UIKit
import SmartCodable
struct YHPersonInfoCellModel: SmartCodable {
var cellType : Int = 0 // 0-国籍信息 类型 1-证件信息 类型 2-证件照片 类型
var cellTitle : String = ""
var cellData0 : [YHPersonInfoBaseModel]? = nil
var cellData1 : [YHPersonInfoCellModel1]? = nil
var cellData2 : [YHPersonInfoCellModel2]? = nil
}
//
// YHPersonInfoCellModel1.swift
// galaxy
//
// Created by davidhuangA on 2024/1/30.
// Copyright © 2024 https://www.galaxy-immi.com. All rights reserved.
//
import UIKit
import SmartCodable
struct YHPersonInfoCellModel1: SmartCodable {
var cellTitle : String = ""
var cellData : [YHPersonInfoBaseModel] = []
}
//
// YHPersonInfoCellModel1.swift
// galaxy
//
// Created by davidhuangA on 2024/1/30.
// Copyright © 2024 https://www.galaxy-immi.com. All rights reserved.
//
import UIKit
import SmartCodable
struct YHPersonInfoCellModel2: SmartCodable {
var cellTitle : String = ""
var frontUrl : String = "" //正面url
var backUrl : String = "" //反面url
//1- 中国身份证 2-港澳通行证
var idType: Int = 1 {
didSet {
if idType == 1 {
cellTitle = "中国身份证"
} else if idType == 2 {
cellTitle = "港澳通行证"
}
}
}
}
//
// YHPersonInfoIdentityCardModel.swift
// galaxy
//
// Created by davidhuangA on 2024/1/30.
// Copyright © 2024 https://www.galaxy-immi.com. All rights reserved.
//
import UIKit
import SmartCodable
struct YHPersonInfoIdentityCardModel: SmartCodable {
var frontUrl : String = "" //正面url
var backUrl : String = "" //反面url
}
//
// YHPersonInfoCellView.swift
// galaxy
//
// Created by davidhuangA on 2024/1/30.
// Copyright © 2024 https://www.galaxy-immi.com. All rights reserved.
//
import UIKit
class YHPersonInfoCellView: UIView {
override init(frame: CGRect) {
super.init(frame: frame)
setupUI()
}
required init?(coder: NSCoder) {
fatalError("init(coder:) has not been implemented")
}
//title
private lazy var nameLable : UILabel = {
let lable0 = UILabel(text: "--")
lable0.textColor = UIColor(hex: 0x888F98)
lable0.font = UIFont.PFSC_R(ofSize: 14)
lable0.numberOfLines = 0
lable0.lineBreakMode = .byCharWrapping
return lable0
}()
//title
private lazy var subtitleLable : UILabel = {
let lable0 = UILabel(text: "--")
lable0.textColor = UIColor(hex: 0x222222)
lable0.font = UIFont.PFSC_R(ofSize: 14)
lable0.numberOfLines = 0
lable0.lineBreakMode = .byWordWrapping
lable0.textAlignment = .right
return lable0
}()
private func setupUI() {
addSubview(nameLable)
nameLable.snp.makeConstraints { make in
make.top.equalToSuperview().offset(18)
make.left.equalToSuperview()
make.width.lessThanOrEqualTo(154)
make.height.equalTo(17)
}
nameLable.setContentCompressionResistancePriority(.required, for: .horizontal)
addSubview(subtitleLable)
subtitleLable.snp.makeConstraints { make in
make.top.equalTo(nameLable.snp.top)
make.right.equalToSuperview()
make.left.equalTo(nameLable.snp.right).offset(10)
make.bottom.equalToSuperview()
}
}
}
extension YHPersonInfoCellView {
func update(title : String,subtitle : String) {
nameLable.text = title
subtitleLable.text = subtitle
}
}
//
// YHPersonInfoIdentificationCardView.swift
// galaxy
//
// Created by davidhuangA on 2024/1/30.
// Copyright © 2024 https://www.galaxy-immi.com. All rights reserved.
//
import UIKit
class YHPersonInfoIdentificationCardView: UIView {
var dataModel : YHPersonInfoCellModel2? {
didSet {
updateUI()
}
}
override init(frame: CGRect) {
super.init(frame: frame)
setupUI()
}
required init?(coder: NSCoder) {
fatalError("init(coder:) has not been implemented")
}
private lazy var titleLable : UILabel = {
let lable = UILabel()
lable.textColor = UIColor(hex: 0x222222)
lable.font = UIFont.PFSC_M(ofSize: 14)
return lable
}()
private lazy var frontImagV : UIImageView = {
let lable = UIImageView()
lable.image = UIImage(named: "person_info_id_front")
lable.contentMode = .scaleAspectFit
lable.layer.cornerRadius = 6
lable.clipsToBounds = true
return lable
}()
private lazy var backImagV : UIImageView = {
let lable = UIImageView()
lable.image = UIImage(named: "person_info_id_back")
lable.contentMode = .scaleAspectFit
lable.layer.cornerRadius = 6
lable.clipsToBounds = true
return lable
}()
private lazy var subtitleFrontLable : UILabel = {
let lable = UILabel()
lable.textColor = UIColor(hex: 0x888F98)
lable.font = UIFont.PFSC_R(ofSize: 14)
lable.text = "身份证头像面"
lable.textAlignment = .center
return lable
}()
private lazy var subtitleBackLable : UILabel = {
let lable = UILabel()
lable.textColor = UIColor(hex: 0x888F98)
lable.font = UIFont.PFSC_R(ofSize: 14)
lable.text = "身份证国徽面"
lable.textAlignment = .center
return lable
}()
lazy var bottomLine : UIView = {
let lable = UIView()
lable.backgroundColor = UIColor(hex: 0xF0F0F0)
return lable
}()
}
extension YHPersonInfoIdentificationCardView {
func setupUI() {
addSubview(titleLable)
titleLable.snp.makeConstraints { make in
make.top.equalTo(18)
make.left.equalTo(18)
make.right.equalTo(-18)
make.height.equalTo(17)
}
addSubview(subtitleFrontLable)
subtitleFrontLable.snp.makeConstraints { make in
make.top.equalTo(titleLable.snp.bottom).offset(20)
make.height.equalTo(17)
make.left.equalTo(16)
make.right.equalTo(self.snp.centerX).offset(-4)
}
addSubview(frontImagV)
frontImagV.snp.makeConstraints { make in
make.top.equalTo(subtitleFrontLable.snp.bottom).offset(13)
make.height.equalTo(95)
make.left.equalTo(subtitleFrontLable.snp.left)
make.right.equalTo(subtitleFrontLable.snp.right)
}
addSubview(subtitleBackLable)
subtitleBackLable.snp.makeConstraints { make in
make.top.equalTo(titleLable.snp.bottom).offset(20)
make.height.equalTo(17)
make.right.equalTo(-18)
make.left.equalTo(self.snp.centerX).offset(4)
}
addSubview(backImagV)
backImagV.snp.makeConstraints { make in
make.top.equalTo(subtitleBackLable.snp.bottom).offset(13)
make.height.equalTo(95)
make.left.equalTo(subtitleBackLable.snp.left)
make.right.equalTo(subtitleBackLable.snp.right)
}
addSubview(bottomLine)
bottomLine.snp.makeConstraints { make in
make.top.equalTo(backImagV.snp.bottom).offset(15)
make.height.equalTo(0.5)
make.left.right.equalToSuperview()
make.bottom.equalToSuperview()
}
}
}
extension YHPersonInfoIdentificationCardView {
func updateUI() {
guard let dataModel = dataModel else { return }
titleLable.text = dataModel.cellTitle
subtitleFrontLable.text = dataModel.idType == 1 ? "身份证头像面" : "港澳通行证正面"
subtitleBackLable.text = dataModel.idType == 1 ? "身份证国徽面" : "港澳通行证反面"
}
}
//
// YHPersonInfoSessionHoldView.swift
// galaxy
//
// Created by davidhuangA on 2024/1/30.
// Copyright © 2024 https://www.galaxy-immi.com. All rights reserved.
//
import UIKit
class YHPersonInfoSessionHoldView: UIView {
override init(frame: CGRect) {
super.init(frame: frame)
backgroundColor = .white
layer.cornerRadius = 6
clipsToBounds = true
}
required init?(coder: NSCoder) {
fatalError("init(coder:) has not been implemented")
}
}
//
// YHPersonInfoSessionView.swift
// galaxy
//
// Created by davidhuangA on 2024/1/30.
// Copyright © 2024 https://www.galaxy-immi.com. All rights reserved.
//
import UIKit
class YHPersonInfoSessionView: UIView {
override init(frame: CGRect) {
super.init(frame: frame)
setupUI()
}
required init?(coder: NSCoder) {
fatalError("init(coder:) has not been implemented")
}
//title
private lazy var nameLable : UILabel = {
let lable0 = UILabel(text: "--")
lable0.textColor = UIColor(hex: 0x222222)
lable0.font = UIFont.PFSC_M(ofSize: 17)
lable0.numberOfLines = 0
lable0.lineBreakMode = .byWordWrapping
return lable0
}()
private lazy var bottomLine : UIView = {
let view = UIView()
view.backgroundColor = UIColor(hex: 0xF0F0F0)
return view
}()
private func setupUI() {
addSubview(bottomLine)
bottomLine.snp.makeConstraints { make in
make.left.right.bottom.equalToSuperview()
make.height.equalTo(0.5)
}
addSubview(nameLable)
nameLable.snp.makeConstraints { make in
make.left.right.equalToSuperview()
make.top.equalToSuperview().offset(16)
make.bottom.equalTo(bottomLine.snp.top).offset(-16)
}
}
}
extension YHPersonInfoSessionView {
func updateTitle(title : String) {
nameLable.text = title
}
}
......@@ -39,18 +39,18 @@ class YHContractCell: UITableViewCell {
lazy var contractNameLable = {
let lable = UILabel()
lable.textColor = UIColor(red: 0.133, green: 0.133, blue: 0.133, alpha: 1)
lable.font = kFont(name: "PingFangSC-Medium", size: 17)
lable.textColor = UIColor.mainTextColor
lable.font = UIFont.PFSC_M(ofSize: 17)
lable.text = ""
return lable
}()
lazy var contractIdLable = {
let lable = UILabel()
lable.font = kFont(name: "PingFangSC-Medium", size: 17)
lable.textColor = UIColor.labelTextColor2
lable.font = UIFont.PFSC_R(ofSize: 12)
lable.text = ""
lable.textColor = UIColor(red: 0.533, green: 0.561, blue: 0.596, alpha: 1)
lable.font = kFont(name: "PingFangSC-Regular", size: 12)
return lable
}()
......@@ -71,7 +71,7 @@ extension YHContractCell {
func setupUI() {
let holdView = UIView()
holdView.backgroundColor = .white
holdView.layer.cornerRadius = 12
holdView.layer.cornerRadius = kCornerRadius6
holdView.clipsToBounds = true
backgroundColor = .clear
......@@ -80,8 +80,8 @@ extension YHContractCell {
contentView.addSubview(holdView)
holdView.snp.makeConstraints { make in
make.top.bottom.equalToSuperview()
make.left.equalTo(16)
make.right.equalTo(-16)
make.left.equalTo(kMargin)
make.right.equalTo(-kMargin)
}
......@@ -91,14 +91,14 @@ extension YHContractCell {
holdView.addSubview(nextImgV)
nextImgV.snp.makeConstraints { make in
make.centerY.equalToSuperview()
make.right.equalTo(-16)
make.width.height.equalTo(16)
make.right.equalTo(-kMargin)
make.width.height.equalTo(kMargin)
}
holdView.addSubview(contractNameLable)
contractNameLable.snp.makeConstraints { make in
make.top.equalTo(16)
make.top.equalTo(kMargin)
make.left.equalTo(21)
make.right.equalTo(nextImgV.snp.left).offset(-10)
make.height.equalTo(24)
......@@ -111,7 +111,7 @@ extension YHContractCell {
make.left.equalTo(contractNameLable)
make.right.equalTo(contractNameLable)
make.height.equalTo(20)
make.bottom.equalToSuperview().offset(-16)
make.bottom.equalToSuperview().offset(-kMargin)
}
}
......
......@@ -7,7 +7,7 @@
//
import UIKit
import SwifterSwift
//import SwifterSwift
class YHContractMainItemStatusCell: UITableViewCell {
......@@ -60,7 +60,7 @@ class YHContractMainItemStatusCell: UITableViewCell {
let gradientLayer = CAGradientLayer()
gradientLayer.frame = bounds
gradientLayer.colors = [UIColor(red: 0.302, green: 0.624, blue: 0.973, alpha: 1),UIColor(red: 0.231, green: 0.525, blue: 0.969, alpha: 1)].map(\.cgColor)
gradientLayer.colors = UIColor.arrBrandGradaterColors
gradientLayer.locations = [0,1].map { NSNumber(value: $0) }
gradientLayer.startPoint = CGPoint(x: 0.12, y: 0.25)
gradientLayer.endPoint = CGPoint(x: 0.38, y: 0.25)
......
......@@ -42,7 +42,7 @@ class YHInformationFillTipsAlertView: UIView {
tableView.showsHorizontalScrollIndicator = true
tableView.showsVerticalScrollIndicator = false
tableView.rowHeight = UITableView.automaticDimension
// tableView.estimatedRowHeight = 100
// tableView.estimatedRowHeight = 100
tableView.register(YHInformationFillTipsCell.self,forCellReuseIdentifier: YHInformationFillTipsCell.cellReuseIdentifier)
return tableView
}()
......@@ -60,9 +60,9 @@ class YHInformationFillTipsAlertView: UIView {
override init(frame: CGRect) {
super.init(frame: frame)
backgroundColor = UIColor(white: 0.5, alpha: 0.1)
// let tap = UITapGestureRecognizer(target: self, action: #selector(handleTap))
// tap.delegate = self
// addGestureRecognizer(tap)
// let tap = UITapGestureRecognizer(target: self, action: #selector(handleTap))
// tap.delegate = self
// addGestureRecognizer(tap)
setView()
}
......@@ -72,11 +72,11 @@ class YHInformationFillTipsAlertView: UIView {
}
func setView() {
backgroundColor = UIColor(hex: 0x0000, alpha: 0.5)
backgroundColor = UIColor(hex: 0x000000, alpha: 0.5)
centerView = {
let view = UIView()
view.backgroundColor = .white
view.layer.cornerRadius = 12
view.layer.cornerRadius = 8
return view
}()
addSubview(centerView)
......@@ -96,12 +96,12 @@ class YHInformationFillTipsAlertView: UIView {
}
let checkBtn = UIButton(type: .custom)
checkBtn.setBackgroundImage(UIImage.from(color: UIColor(hex:0x4D9FF8)), for: .normal)
checkBtn.addTarget(self, action: #selector(onClickReadyBtn), for: .touchUpInside)
checkBtn.setTitle("准备完毕", for: .normal)
checkBtn.setTitleColor(.white, for: .normal)
checkBtn.addTarget(self, action: #selector(onClickReadyBtn), for: .touchUpInside)
checkBtn.layer.cornerRadius = 8
checkBtn.clipsToBounds = true
bottomView.addSubview(checkBtn)
checkBtn.snp.makeConstraints { make in
make.bottom.equalToSuperview().offset(-40)
......@@ -109,6 +109,10 @@ class YHInformationFillTipsAlertView: UIView {
make.right.equalTo(-16)
make.height.equalTo(48)
}
checkBtn.layoutIfNeeded()//非常重要!!!!
checkBtn.backgroundGradient()
let lable00 = UILabel(text: "我确认我所提供的材料真实有效,并知悉其中内容。")
lable00.font = kFont(size: 12)
......@@ -147,7 +151,7 @@ class YHInformationFillTipsAlertView: UIView {
let lable01 = UILabel(text: "信息填写提示")
lable01.font = UIFont.PingFangScB(ofSize: 18)
lable01.font = UIFont.PFSC_B(ofSize: 18)
lable01.textColor = UIColor(red: 0.133, green: 0.133, blue: 0.133, alpha: 1)
topView.addSubview(lable01)
......@@ -262,7 +266,7 @@ extension YHInformationFillTipsAlertView : UITableViewDelegate,UITableViewDataSo
return UIView()
}
func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat {
......
......@@ -71,13 +71,13 @@ extension YHInformationFillTipsCell {
let lable1 = UILabel(text: " 1. 如您填写途中想离开系统,记得点击保存,在您有空闲的时间再继续进行填写;")
lable1.font = UIFont.PingFangScR(ofSize: 14)
lable1.font = UIFont.PFSC_R(ofSize: 14)
lable1.textColor = UIColor(red: 0.133, green: 0.133, blue: 0.133, alpha: 1)
lable1.numberOfLines = 0
lable1.lineBreakMode = .byWordWrapping
let a: ASAttributedString = .init(" 1. 如您填写途中想离开系统,", .font(UIFont.PingFangScR(ofSize: 14)),.foreground(UIColor(red: 0.133, green: 0.133, blue: 0.133, alpha: 1)))
let b: ASAttributedString = .init("记得点击保存", .font(UIFont.PingFangScR(ofSize: 14)),.foreground(UIColor(hex:0x3271F5)))
let c: ASAttributedString = .init(",在您有空闲的时间再继续进行填写;", .font(UIFont.PingFangScR(ofSize: 14)),.foreground(UIColor(red: 0.133, green: 0.133, blue: 0.133, alpha: 1)))
let a: ASAttributedString = .init(" 1. 如您填写途中想离开系统,", .font(UIFont.PFSC_R(ofSize: 14)),.foreground(UIColor(red: 0.133, green: 0.133, blue: 0.133, alpha: 1)))
let b: ASAttributedString = .init("记得点击保存", .font(UIFont.PFSC_R(ofSize: 14)),.foreground(UIColor(hex:0x3271F5)))
let c: ASAttributedString = .init(",在您有空闲的时间再继续进行填写;", .font(UIFont.PFSC_R(ofSize: 14)),.foreground(UIColor(red: 0.133, green: 0.133, blue: 0.133, alpha: 1)))
lable1.attributed.text = a + b + c
holdView.addSubview(lable1)
......@@ -87,14 +87,14 @@ extension YHInformationFillTipsCell {
}
let lable2 = UILabel(text: " 2. 此次填写将花费您30-40分钟,系统将根据您所填写的信息,形成详细资料清单,一起为香港身份起航吧~")
lable2.font = UIFont.PingFangScR(ofSize: 14)
lable2.font = UIFont.PFSC_R(ofSize: 14)
lable2.textColor = UIColor(red: 0.133, green: 0.133, blue: 0.133, alpha: 1)
lable2.numberOfLines = 0
lable2.lineBreakMode = .byWordWrapping
let aa: ASAttributedString = .init(" 2. 此次填写将花费您", .font(UIFont.PingFangScR(ofSize: 14)),.foreground(UIColor(red: 0.133, green: 0.133, blue: 0.133, alpha: 1)))
let bb: ASAttributedString = .init("30-40分钟", .font(UIFont.PingFangScR(ofSize: 14)),.foreground(UIColor(hex:0x3271F5)))
let cc: ASAttributedString = .init(",系统将根据您所填写的信息,形成详细资料清单,一起为香港身份起航吧~", .font(UIFont.PingFangScR(ofSize: 14)),.foreground(UIColor(red: 0.133, green: 0.133, blue: 0.133, alpha: 1)))
let aa: ASAttributedString = .init(" 2. 此次填写将花费您", .font(UIFont.PFSC_R(ofSize: 14)),.foreground(UIColor(red: 0.133, green: 0.133, blue: 0.133, alpha: 1)))
let bb: ASAttributedString = .init("30-40分钟", .font(UIFont.PFSC_R(ofSize: 14)),.foreground(UIColor(hex:0x3271F5)))
let cc: ASAttributedString = .init(",系统将根据您所填写的信息,形成详细资料清单,一起为香港身份起航吧~", .font(UIFont.PFSC_R(ofSize: 14)),.foreground(UIColor(red: 0.133, green: 0.133, blue: 0.133, alpha: 1)))
lable2.attributed.text = aa + bb + cc
......@@ -129,7 +129,7 @@ extension YHInformationFillTipsCell {
let lable3 = UILabel(text: "准备材料:")
lable3.font = UIFont.PingFangScM(ofSize: 14)
lable3.font = UIFont.PFSC_M(ofSize: 14)
lable3.textColor = UIColor(red: 0.133, green: 0.133, blue: 0.133, alpha: 1)
holdView2.addSubview(lable3)
lable3.snp.makeConstraints { make in
......@@ -154,7 +154,7 @@ extension YHInformationFillTipsCell {
}
let lable4 = UILabel(text: "身份证正反面照片(外国国籍准备护照)")
lable4.font = UIFont.PingFangScR(ofSize: 14)
lable4.font = UIFont.PFSC_R(ofSize: 14)
lable4.textColor = UIColor(red: 0.133, green: 0.133, blue: 0.133, alpha: 1)
holdView2.addSubview(lable4)
lable4.snp.makeConstraints { make in
......@@ -175,7 +175,7 @@ extension YHInformationFillTipsCell {
}
let lable5 = UILabel(text: "护照(如有)")
lable5.font = UIFont.PingFangScR(ofSize: 14)
lable5.font = UIFont.PFSC_R(ofSize: 14)
lable5.textColor = UIColor(red: 0.133, green: 0.133, blue: 0.133, alpha: 1)
holdView2.addSubview(lable5)
lable5.snp.makeConstraints { make in
......@@ -197,7 +197,7 @@ extension YHInformationFillTipsCell {
}
let lable6 = UILabel(text: "港澳通行证正反面照片(如有)")
lable6.font = UIFont.PingFangScR(ofSize: 14)
lable6.font = UIFont.PFSC_R(ofSize: 14)
lable6.textColor = UIColor(red: 0.133, green: 0.133, blue: 0.133, alpha: 1)
holdView2.addSubview(lable6)
lable6.snp.makeConstraints { make in
......@@ -219,7 +219,7 @@ extension YHInformationFillTipsCell {
}
let lable7 = UILabel(text: "简历/工作总结")
lable7.font = UIFont.PingFangScR(ofSize: 14)
lable7.font = UIFont.PFSC_R(ofSize: 14)
lable7.textColor = UIColor(red: 0.133, green: 0.133, blue: 0.133, alpha: 1)
holdView2.addSubview(lable7)
lable7.snp.makeConstraints { make in
......@@ -255,7 +255,7 @@ extension YHInformationFillTipsCell {
let lable8 = UILabel(text: "温馨提示:")
lable8.font = UIFont.PingFangScR(ofSize: 12)
lable8.font = UIFont.PFSC_R(ofSize: 12)
lable8.textColor = UIColor(red: 0.263, green: 0.533, blue: 1, alpha: 1)
holdView3.addSubview(lable8)
lable8.snp.makeConstraints { make in
......@@ -269,7 +269,7 @@ extension YHInformationFillTipsCell {
let lable9 = UILabel(text: "请确认您所上传的资料真实有效,避免因递交资料存在问题给您造成不便。")
lable9.numberOfLines = 0
lable9.lineBreakMode = .byWordWrapping
lable9.font = UIFont.PingFangScR(ofSize: 12)
lable9.font = UIFont.PFSC_R(ofSize: 12)
lable9.textColor = UIColor(red: 0.263, green: 0.533, blue: 1, alpha: 1)
holdView3.addSubview(lable9)
lable9.snp.makeConstraints { make in
......@@ -283,7 +283,7 @@ extension YHInformationFillTipsCell {
let lable10 = UILabel(text: "* 申请过程中有任何疑问,请随时联系专属服务群内的专业文案老师为您解答护航。")
lable10.numberOfLines = 0
lable10.lineBreakMode = .byWordWrapping
lable10.font = UIFont.PingFangScR(ofSize: 12)
lable10.font = UIFont.PFSC_R(ofSize: 12)
lable10.textColor = UIColor(red: 0.533, green: 0.561, blue: 0.596, alpha: 1)
holdView3.addSubview(lable10)
lable10.snp.makeConstraints { make in
......
......@@ -127,8 +127,8 @@ class YHSubmintAllInfoSuccessTipView: UIView {
make.height.equalTo(50)
}
let a: ASAttributedString = .init("90", .font(UIFont.PingFangScR(ofSize: 32)),.foreground(UIColor(hex:0xFF9900)))
let b: ASAttributedString = .init("分", .font(UIFont.PingFangScR(ofSize: 12)),.foreground(UIColor(hex:0x888F98)))
let a: ASAttributedString = .init("90", .font(UIFont.PFSC_R(ofSize: 32)),.foreground(UIColor(hex:0xFF9900)))
let b: ASAttributedString = .init("分", .font(UIFont.PFSC_R(ofSize: 12)),.foreground(UIColor(hex:0x888F98)))
messageLabel.attributed.text = a + b
disAgressButton = {
......
//
// YHScoreItemCellForAge.swift
// galaxy
//
// Created by davidhuangA on 2024/1/28.
// Copyright © 2024 https://www.galaxy-immi.com. All rights reserved.
//
import UIKit
import AttributedString
class YHScoreItemCellForAge: UITableViewCell {
static let cellReuseIdentifier = "YHScoreItemCellForAge"
var optionData : YHScoreSessionModel? {
didSet {
updateUI()
}
}
private lazy var holdView : UIView = {
let view = UIView()
view.backgroundColor = .white
view.layer.cornerRadius = 12
view.clipsToBounds = true
return view
}()
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
}
override init(style: UITableViewCell.CellStyle, reuseIdentifier: String?) {
super.init(style: style, reuseIdentifier: reuseIdentifier)
setupUI()
}
required init?(coder: NSCoder) {
fatalError("init(coder:) has not been implemented")
}
var titleView : YHScoreTitleView!
private var scoreOptionsView1 : YHScoreOptionsView!
private var scoreOptionsView2 : YHScoreOptionsView!
private var scoreOptionsView3 : YHScoreOptionsView!
private var scoreOptionsView4 : YHScoreOptionsView!
}
extension YHScoreItemCellForAge {
func setupUI() {
backgroundColor = .clear
contentView.backgroundColor = .clear
contentView.addSubview(holdView)
holdView.snp.makeConstraints { make in
make.top.right.left.equalToSuperview()
make.bottom.equalToSuperview().offset(-14)
}
titleView = YHScoreTitleView()
holdView.addSubview(titleView)
titleView.snp.makeConstraints { make in
make.top.equalToSuperview()
make.left.equalTo(18)
make.right.equalTo(-18)
make.height.equalTo(YHScoreTitleView.viewH)
}
let resultView = YHScoreResultView()
holdView.addSubview(resultView)
resultView.snp.makeConstraints { make in
make.top.equalTo(titleView.snp.bottom)
make.left.equalTo(titleView.snp.left)
make.right.equalTo(titleView.snp.right)
make.height.equalTo(YHScoreTitleView.viewH)
}
scoreOptionsView1 = YHScoreOptionsView()
holdView.addSubview(scoreOptionsView1)
scoreOptionsView1.snp.makeConstraints { make in
make.top.equalTo(resultView.snp.bottom)
make.left.equalTo(titleView.snp.left)
make.right.equalTo(titleView.snp.right)
}
scoreOptionsView2 = YHScoreOptionsView()
holdView.addSubview(scoreOptionsView2)
scoreOptionsView2.snp.makeConstraints { make in
make.top.equalTo(scoreOptionsView1.snp.bottom)
make.left.equalTo(titleView.snp.left)
make.right.equalTo(titleView.snp.right)
}
scoreOptionsView3 = YHScoreOptionsView()
holdView.addSubview(scoreOptionsView3)
scoreOptionsView3.snp.makeConstraints { make in
make.top.equalTo(scoreOptionsView2.snp.bottom)
make.left.equalTo(titleView.snp.left)
make.right.equalTo(titleView.snp.right)
}
scoreOptionsView4 = YHScoreOptionsView()
holdView.addSubview(scoreOptionsView4)
scoreOptionsView4.snp.makeConstraints { make in
make.top.equalTo(scoreOptionsView3.snp.bottom)
make.left.equalTo(titleView.snp.left)
make.right.equalTo(titleView.snp.right)
make.bottom.equalToSuperview()
}
}
func updateUI() {
guard let arrData = optionData?.options else {
return
}
titleView.updateWith(optionData?.name, optionData?.score)
for (index,item) in arrData.enumerated() {
if index == 0 {
scoreOptionsView1.dataModel = item
} else if index == 1 {
scoreOptionsView2.dataModel = item
} else if index == 2 {
scoreOptionsView3.dataModel = item
} else if index == 3 {
scoreOptionsView4.dataModel = item
}
}
}
}
......@@ -60,7 +60,7 @@ class YHAboutUsViewController: YHBaseViewController {
var label = UILabel()
label.text = "银河集团专注海外服务17年,总部设立在深圳,现已分别在北京、上海、广州等地建立分公司,立足于香港身份规划服务,业务逐步多元化发展。"
label.numberOfLines = 0
label.textColor = UIColor(hexString:"#888F98")
label.textColor = .labelTextColor2
label.textAlignment = NSTextAlignment.left
label.font = UIFont.systemFont(ofSize: 14)
return label
......
......@@ -40,7 +40,7 @@ class YHAboutUsAdvantageCell: UICollectionViewCell {
lazy var detailLabel:UILabel = {
let label = UILabel()
label.text = "sdfasfdasfasdfasfasdfasdfsafasdfasdfasdfasfdas"
label.textColor = UIColor(hexString:"#888F98")
label.textColor = .labelTextColor2
label.numberOfLines = 0
label.textAlignment = .center
label.font = UIFont.systemFont(ofSize: 12)
......
......@@ -7,41 +7,6 @@
//
import UIKit
// MARK: - 设置导航栏样式
extension AppDelegate{
func customAppearance() {
setNavigationBarAppearanceWhenContainedInInstancesOf(containers: [YHNavigationController.self])
setNavigationBarAppearanceWhenContainedInInstancesOf(containers: [YHBaseViewController.self])
}
func setNavigationBarAppearanceWhenContainedInInstancesOf(containers: [UIAppearanceContainer.Type]){
let navigationBarAppearance = UINavigationBar.appearance(whenContainedInInstancesOf: containers)
navigationBarAppearance.titleTextAttributes = [NSAttributedString.Key.foregroundColor : UIColor.commonColor100,NSAttributedString.Key.font:UIFont.PingFangScM(ofSize: 16)]
navigationBarAppearance.barTintColor = UIColor.yellow
navigationBarAppearance.tintColor = UIColor.commonColor100
navigationBarAppearance.backIndicatorImage = UIImage(named: "back_icon")
navigationBarAppearance.backIndicatorTransitionMaskImage = UIImage(named: "back_icon")
navigationBarAppearance.setBackgroundImage(UIImage.from(color: UIColor.clear),for: .default)
navigationBarAppearance.isOpaque = true
navigationBarAppearance.shadowImage = nil
//隐藏返回文字
if #available(iOS 13, *) {
UIBarButtonItem.appearance().setBackButtonTitlePositionAdjustment(UIOffset( horizontal: -UIDevice.kScreenW, vertical: 0), for: .default)
}
let barItemAppearance = UIBarButtonItem.appearance(whenContainedInInstancesOf: containers)
barItemAppearance.setTitleTextAttributes([NSAttributedString.Key.foregroundColor : UIColor.clear,NSAttributedString.Key.font:UIFont.systemFont(ofSize: 14)], for: UIControl.State.normal)
barItemAppearance.setTitleTextAttributes([NSAttributedString.Key.foregroundColor : UIColor.clear,NSAttributedString.Key.font:UIFont.systemFont(ofSize: 14)], for: UIControl.State.highlighted)
}
}
// MARK: - Pay 支付
extension AppDelegate {
......
......@@ -7,6 +7,7 @@
//
import UIKit
import SwifterSwift
extension String {
/// JSONString转换为字典
func toDictionary() -> Dictionary<String, Any> {
......
......@@ -98,5 +98,31 @@ extension UIButton {
return btn
}
}
extension UIButton {
/// 渐变背景
@discardableResult
func backgroundGradient<T: UIButton>() -> T {
let gradientLayer = CAGradientLayer()
//几个颜色
gradientLayer.colors = UIColor.arrBrandGradaterColors.map { $0.cgColor }
//颜色的分界点
gradientLayer.locations = [0, 1.0]
//开始
gradientLayer.startPoint = CGPoint(x: 0.12, y: 0.25)
//结束,主要是控制渐变方向
gradientLayer.endPoint = CGPoint(x: 0.38, y: 0.25)
//多大区域
gradientLayer.frame = bounds
UIGraphicsBeginImageContext(gradientLayer.frame.size)
if let context = UIGraphicsGetCurrentContext() {
gradientLayer.render(in: context)
let outputImage = UIGraphicsGetImageFromCurrentImageContext()
UIGraphicsEndImageContext()
setBackgroundImage(outputImage, for: .normal)
}
return self as! T
}
}
......@@ -7,30 +7,59 @@
//
import UIKit
import SwifterSwift
//import SwifterSwift
extension UIColor {
// MARK: - 当前 app 主颜色
static let mainColor : UIColor = UIColor(hexString: "#46E0BB")!
static let commonColor100 : UIColor = UIColor(hexString: "#333333",transparency: 1.0)!
static let commonColor90 : UIColor = UIColor(hexString: "#333333",transparency: 0.9)!
static let commonColor65 : UIColor = UIColor(hexString: "#333333",transparency: 0.65)!
static let commonColor45 : UIColor = UIColor(hexString: "#333333",transparency: 0.45)!
static let commonColor25 : UIColor = UIColor(hexString: "#333333",transparency: 0.25)!
static let commonColor15 : UIColor = UIColor(hexString: "#333333",transparency: 0.15)!
static let commonColor10 : UIColor = UIColor(hexString: "#333333",transparency: 0.10)!
static let commonColor6 : UIColor = UIColor(hexString: "#333333",transparency: 0.06)!
static let commonColor4 : UIColor = UIColor(hexString: "#333333",transparency: 0.04)!
static let commonColor3 : UIColor = UIColor(hexString: "#333333",transparency: 0.03)!
static let backgroundColor : UIColor = UIColor(hexString: "#F2F7F6",transparency: 1.0)!
//品牌主色
static let brandMainColor : UIColor = UIColor(hexString: "#2F7EF6")!
//品牌渐变色
static let arrBrandGradaterColors : [UIColor] = [UIColor(hexString: "#2274EE")!,UIColor(hexString: "#3A85FC")!]
//品牌主色 16
static let brandMainColor16 : UIColor = UIColor(hexString: "#2F7EF6",transparency: 0.16)!
//品牌主色 8
static let brandMainColor8: UIColor = UIColor(hexString: "#2F7EF6",transparency: 0.16)!
//标题/主内容
static let mainTextColor : UIColor = UIColor(hexString: "#222222")!
//次内容一
static let subTextColor : UIColor = UIColor(hexString: "#4E4E4E")!
//次内容二
static let subTextColor2 : UIColor = UIColor(hexString: "#7A7A7A")!
//标注内容一
static let labelTextColor : UIColor = UIColor(hexString: "#D3D3D3")!
//标注内容二
static let labelTextColor2 : UIColor = UIColor(hexString: "#888F98")!
//成功 color
static let successColor : UIColor = UIColor(hexString: "#49D2B1")!
//失败 color
static let failColor : UIColor = UIColor(hexString: "#F81D22")!
//警告 color
static let warnColor : UIColor = UIColor(hexString: "#FF9900")!
//提示 color
static let tipsColor : UIColor = UIColor(hexString: "#2F7EF6")!
//页面背景
static let pageBkgColor : UIColor = UIColor(hexString: "#F8F8F8")!
//内容背景色
static let contentBkgColor : UIColor = UIColor(hexString: "#F8F9FB")!
static let mainTextColor : UIColor = UIColor(hexString: "#00D19F")!
static let selectBgColor : UIColor = UIColor(hexString: "#D9FCF7")!
//黑色 50透明
static let black50Persent : UIColor = UIColor.black.withAlphaComponent(0.5)
public convenience init(r : CGFloat, g : CGFloat, b : CGFloat,alpha:CGFloat = 1.0) {
......@@ -54,6 +83,5 @@ extension UIColor {
UIGraphicsEndImageContext()
return image!
}
}
......@@ -8,36 +8,33 @@
import UIKit
extension UIFont {
// PingFangSC-ExtraLight 苹方 特细
// PingFangSC-Light 苹方 细体
// PingFangSC-Regular 苹方 常规
// PingFangSC-Medium 苹方 中等
// PingFangSC-Bold 苹方 粗体
// PingFangSC-Heavy 苹方 特粗
// MARK: - 苹果字体
// MARK: - 苹果平方字体
//特细
class func PingFangScEL(ofSize size : CGFloat = 17) -> UIFont {
class func PFSC_Thin(ofSize size : CGFloat = 15) -> UIFont {
return UIFont(name: "PingFangSC-Thin", size: size)!
}
//细体
class func PingFangScL(ofSize size : CGFloat = 17) -> UIFont {
class func PFSC_L(ofSize size : CGFloat = 15) -> UIFont {
return UIFont(name: "PingFangSC-Light", size: size)!
}
//常规
class func PingFangScR(ofSize size : CGFloat = 17) -> UIFont {
class func PFSC_R(ofSize size : CGFloat = 15) -> UIFont {
return UIFont(name: "PingFangSC-Regular", size: size)!
}
//中等
class func PingFangScM(ofSize size : CGFloat = 17) -> UIFont {
class func PFSC_M(ofSize size : CGFloat = 15) -> UIFont {
return UIFont(name: "PingFangSC-Medium", size: size)!
}
//粗体
static func PingFangScB(ofSize size : CGFloat = 17) -> UIFont {
static func PFSC_B(ofSize size : CGFloat = 15) -> UIFont {
return UIFont(name: "PingFangSC-Semibold", size: size)!
}
//特粗体
static func PFSC_UL(ofSize size : CGFloat = 15) -> UIFont {
return UIFont(name: "PingFangTC-Ultralight", size: size)!
}
}
......@@ -13,7 +13,7 @@ extension UILabel {
let temp = UILabel()
temp.textColor = UIColor(hexString: "#333333", transparency: 0.45)
temp.textAlignment = .center
temp.font = UIFont.PingFangScM(ofSize: 10)
temp.font = UIFont.PFSC_M(ofSize: 10)
temp.backgroundColor = UIColor(hexString: "#333333", transparency: 0.04)
temp.layer.cornerRadius = 2
temp.clipsToBounds = true
......
......@@ -10,23 +10,25 @@ import Foundation
import QuartzCore
extension UIView {
func image(with colors: [Any]) -> UIImage? {
addGradualLayer(colors)
return convertToImage()
}
func addGradualLayer(_ colors: [Any]) {
if colors.count == 0 { return }
//添加银河渐变色 //从左到右
func addYinHeGradualLayer() {
let gradientLayer = CAGradientLayer()
gradientLayer.colors = colors
gradientLayer.colors = UIColor.arrBrandGradaterColors.map(\.cgColor)
gradientLayer.locations = [0, 1.0]
gradientLayer.startPoint = CGPoint(x: 0.12, y: 0.25)
gradientLayer.endPoint = CGPoint(x: 0.38, y: 0.25)
gradientLayer.frame = self.bounds
self.layer.addSublayer(gradientLayer)
gradientLayer.frame = bounds
layer.addSublayer(gradientLayer)
}
func image(with colors: [Any]) -> UIImage? {
addYinHeGradualLayer()
return convertToImage()
}
func convertToImage() -> UIImage? {
let size = self.bounds.size
if size.width <= 0 || size.height <= 0 { return nil }
......
......@@ -97,7 +97,7 @@ extension UIViewController {
}
if font == nil {
button?.titleLabel?.font = UIFont.PingFangScM(ofSize: 16)
button?.titleLabel?.font = UIFont.PFSC_M(ofSize: 16)
} else {
button?.titleLabel?.font = font
}
......@@ -150,13 +150,13 @@ extension UIViewController {
///设置全局标题属性
func bs_setupTitleAttributedAll(font: UIFont = UIFont.PingFangScM(ofSize: 16), color: UIColor = .black) {
func bs_setupTitleAttributedAll(font: UIFont = UIFont.PFSC_M(ofSize: 16), color: UIColor = .black) {
let titleDict = [NSAttributedString.Key.font: font, NSAttributedString.Key.foregroundColor: color]
self.navigationController?.navigationBar.titleTextAttributes = titleDict
}
///设置独立标题属性
func bs_setupTitleAttributed(title: String, font: UIFont = UIFont.PingFangScM(ofSize: 16), color: UIColor = .black, reset: Bool = false) {
func bs_setupTitleAttributed(title: String, font: UIFont = UIFont.PFSC_M(ofSize: 16), color: UIColor = .black, reset: Bool = false) {
var titleLabel: UILabel?
if let label = self.navigationItem.titleView as? UILabel,
reset == false {
......@@ -208,7 +208,7 @@ extension UIViewController {
}
button?.setImage(image, for: .normal)
button?.setImage(image, for: .highlighted)
button?.titleLabel?.font = UIFont.PingFangScM(ofSize: 16)
button?.titleLabel?.font = UIFont.PFSC_M(ofSize: 16)
button?.setTitle(title, for: .normal)
button?.setTitleColor(color, for: .normal)
button?.tintColor = color
......
//
// BsHUD.swift
// YHHUD.swift
// PKHUD Demo
//
// Created by ahao on 2018/3/20.
......@@ -76,17 +76,17 @@ class YHHUD {
let todoView: UIView
switch content {
case let .progress(message):
todoView = BsHUDProgressView(title: message)
todoView = YHHUDProgressView(title: message)
case let .success(message):
todoView = BsHUDSuccessView(title: message)
todoView = YHHUDSuccessView(title: message)
case let .error(message):
todoView = BsHUDErrorView(title: message)
todoView = YHHUDErrorView(title: message)
case let .warning(message):
todoView = BsHUDWariningView(title: message)
todoView = YHHUDWariningView(title: message)
case let .rotatingImage(image, message):
todoView = BsHUDSquareBaseView(image: image, title: message)
todoView = YHHUDSquareBaseView(image: image, title: message)
case let .image(image, message):
todoView = BsHUDSquareBaseView(image: image, title: message)
todoView = YHHUDSquareBaseView(image: image, title: message)
}
return todoView
}
......
......@@ -8,7 +8,7 @@
import UIKit
class BsHUDContainerView: UIView {
class YHHUDContainerView: UIView {
static let defaultFrame = CGRect(origin: CGPoint.zero, size: CGSize(width: 156.0, height: 156.0))
......@@ -18,12 +18,12 @@ class BsHUDContainerView: UIView {
init(contentView:UIView,offSet: CGFloat = 0) {
self.contentView = contentView
self.offSet = offSet
super.init(frame: BsHUDContainerView.adjustFrame(contentViewFrame: contentView.frame, offSet: offSet))
super.init(frame: YHHUDContainerView.adjustFrame(contentViewFrame: contentView.frame, offSet: offSet))
addSubview(contentView)
}
func adjustFrame() -> CGRect{
return BsHUDContainerView.adjustFrame(contentViewFrame: contentView.frame, offSet: offSet)
return YHHUDContainerView.adjustFrame(contentViewFrame: contentView.frame, offSet: offSet)
}
class func adjustFrame(contentViewFrame: CGRect, offSet: CGFloat) -> CGRect{
......
//
// BsHUDErrorView.swift
// YHHUDErrorView.swift
// PKHUD Demo
//
// Created by ahao on 2018/3/20.
......@@ -9,7 +9,7 @@
import UIKit
import PKHUD
class BsHUDErrorView: BsHUDSquareBaseView {
class YHHUDErrorView: YHHUDSquareBaseView {
public init(title: String? = nil) {
super.init(image: UIImage(named: "float_icon_error"), title: title)
......
//
// BsHUDProgressView.swift
// YHHUDProgressView.swift
// PKHUD Demo
//
// Created by ahao on 2018/4/19.
......@@ -9,7 +9,7 @@
import UIKit
import PKHUD
class BsHUDProgressView: BsHUDSquareBaseView,PKHUDAnimating {
class YHHUDProgressView: YHHUDSquareBaseView,PKHUDAnimating {
public init(title: String? = nil) {
super.init(image:UIImage(named:"float_icon_loading"), title: title)
......
//
// BsHUDRotatingImageView.swift
// YHHUDRotatingImageView.swift
// PKHUD Demo
//
// Created by ahao on 2018/4/19.
......@@ -9,7 +9,7 @@
import UIKit
import PKHUD
class BsHUDRotatingImageView: BsHUDSquareBaseView,PKHUDAnimating {
class YHHUDRotatingImageView: YHHUDSquareBaseView,PKHUDAnimating {
public func startAnimation() {
imageView.layer.add(PKHUDAnimation.discreteRotation, forKey: "progressAnimation")
......
//
// BsHUDSquareBaseView.swift
// YHHUDSquareBaseView.swift
// PKHUD Demo
//
// Created by ahao on 2018/4/19.
......@@ -9,7 +9,7 @@
import UIKit
import PKHUD
class BsHUDSquareBaseView: UIView {
class YHHUDSquareBaseView: UIView {
static let defaultSquareBaseViewFrame = CGRect(origin: CGPoint.zero, size: CGSize(width: 120, height: 120))
......@@ -22,7 +22,7 @@ class BsHUDSquareBaseView: UIView {
}
init(image: UIImage? = nil, title: String? = nil) {
super.init(frame: BsHUDSquareBaseView.defaultSquareBaseViewFrame)
super.init(frame: YHHUDSquareBaseView.defaultSquareBaseViewFrame)
backgroundColor = UIColor.black
imageView.image = image
titleLabel.text = title
......
//
// BsHUDSuccessView.swift
// YHHUDSuccessView.swift
// PKHUD Demo
//
// Created by ahao on 2018/3/20.
......@@ -9,7 +9,7 @@
import UIKit
import PKHUD
class BsHUDSuccessView: BsHUDSquareBaseView {
class YHHUDSuccessView: YHHUDSquareBaseView {
public init(title: String? = nil) {
super.init(image: UIImage(named:"float_icon_success"), title: title)
}
......
//
// BsHUDWariningView.swift
// YHHUDWariningView.swift
// PKHUD Demo
//
// Created by ahao on 2018/4/19.
......@@ -8,7 +8,7 @@
import UIKit
class BsHUDWariningView: BsHUDSquareBaseView {
class YHHUDWariningView: YHHUDSquareBaseView {
public init(title: String? = nil) {
super.init(image: UIImage(named:"float_icon_caveat"), title: title)
......
......@@ -25,6 +25,15 @@ public func printLog<T>(_ message: T, file: String = #file, method: String = #fu
#endif
}
//边距
let kMargin : CGFloat = 16.0
//圆角
let kCornerRadius6 : CGFloat = 6.0
let kCornerRadius8 : CGFloat = 8.0
///屏幕宽度
let KScreenWidth = UIScreen.main.bounds.size.width
......
......@@ -20,5 +20,7 @@ class YHAllApiName {
struct Order {
//合同列表
static let contractListApi = "frontend/order/list"
//
static let familyInfoApi = "frontend/order/information/family"
}
}
......@@ -93,7 +93,11 @@ class YHNetRequest: NSObject {
print("sign = \(sign)")
requestHeader.add(name:"sign",value:sign)
<<<<<<< HEAD
requestHeader.add(name: "token", value: "eyJpdiI6InVtUkVKaWtrU1BxWmJ6ZWNcL3lBaFVRPT0iLCJ2YWx1ZSI6InN6aEtRWWl6Yk51cVdKWDFwQmp6QzBcLzRKbUFhaW5GUkxkZ0RpcVZEbFo0UG5LelhaQzhpVmdRZXg5QXdqMm9vWnJ3WldHMzM1dVpcL0hWaTBtRm5OeGo3bFRUVzdEdzIreE9qSEZLWm80MTB2R0wwMlhFc0NWWVlZTGdkWUd0cWZtM29xR2lITTBhVzJDenB6bGNhdENpeXAwOWtsM3FzN21nZk9NQXQ3M2hFVDJcL2V2dzlUenJxY0MrTzk2VkJnSkVcL2NEM3dCSUV0YnkwbWxtNzBNZjYzZ1ZQNExEZFZ5a3VQcDdtS2kxNzM2SFJiRVArQnV0NHBYcXNuQ1J3SG95d2tMb3VJcWtXMlUxbHl6STJhWjJacDUxcUhJVTdZOG9FU2VFSVg5a3hhaVc3dkJWcTVoenBcLzFkbitSY2cyOVU1aU8zVFwvMXFtZmo4bDNGcFwvalZ1YmVnZVBVbFhmem9ZdUxadXNhRVwvVGs3WWMrUmY0OEJhTmtmYmhONUY4OUk5OFBocFZiVXhSQ0pmcFgzU0xXdTJqWThqXC81eGNLR0g5QnAyblpZWTJqNzVhV2MxR2JtTUZ1TElpd0haMFFIeFVcLzArWHloc082XC9tS3VkY3B6c2lrZDFsUms2Y1dRRnpKSVdOMnlzMFMyQmJhd0xMV1k2VklFNUxnY3BQTDlkNSthZngzY1BpclNOemdYcXlDTUNnaG5YUXQ4ZlMwMmEyTHRCMTZ5aUVZa09ZYkFzWXVHMWc5c0RtNHdhcnQ1UlRGOEw4YTRCdE5WaExQcXF2YWFlb3QreTY5U0tGd01mOHRTWm9hVEwwclRMOW8yT21aSVlrWGplU0JCalVDTmFXWVNxMEttbU1Fc1d6WFdJQ0h2a1BWdUxpMFpkdng2bnAyUmRtUCs2ZDNMVURtM3lGMTcyRDFabUF6NHVOeW5zVkwxRVJaZXl4WmlYemV5MENyYnFqcjV3SzRTNjhEcFhSbVdNSGRtOWd6UmhqRCtzRVwvbDh2UUVjMlZyMkRQbDdHQkdlZ0VwbVk0QVBuXC9qVEhWVjlPM2NWZndxZXY3RWtaQ2QrUks4bFVpNUFNcXB0Yjd3TnAxd0NKSmdjT3FIZHhPNURRZHZ0cVBZSFV6TkIyVVJKWUdaTXBwamE2c3ZUYjkrckFaMnkxRnI3aEZ4NkhZdUtocjRPTWFLRmc4cFJYNUNuYkxZZDVIUnl2bUY2QlNXMEk0OHVkb1VQbUxHMzc5SjZDMDF6c01FckhWSnZLaW1BWUhHVTJUcm9NcFQrRVpFK0hMbnZINXR0dWFHMTVuTzNTWFJpZDZpSWd5d1R5RmtidFVOS0V2cVJIMmR5K2VDUE1TZGU3bHAwZEYzSXhUWG54eks5ZkJSYzQxMTRoaDlcL1RkTWJEMzB3ekVFSGFnSXM1b29wWjN3K0Ercmlxd004RzZZMmV0ZktrVHNabFlRMjNrN0p3MTk0TWdpUE16aW5xM0NNamJvNGlrK1Y3bEtXZnJRN0lBZ1ZTdXNzYllEU0p6ZFpYeWxQcEZWcDFqb1h3UEQ0RGdMNVhmUFY0dWI1T2hYSzdWUlVQZWVEbHBrREJNbm5cL3FIM2NmVUp6U1piWXd6WlZSMEFON1Jyc2pyYklXdjMxSVwvQ3QyZlZRWUJIdnNHdkVFcDQwU0s4OTlmWTllYlFDaDBqTTM5emtGdWJ4KytXcUk2NVB4cmlKak5hK0lETUV4ODZvdzRNVXkyZ1o5K05IWk4zbnF4OWpBV0VPSXBFYzYwRm9XdGthWlNzdzI0ajIyaytlUmxTZ1FudUthTGQwWk9McGZvMkdEXC9RbzdiODRGWVZVS01XZ0EyQjlFVW56Mmp3ZkV1RHl5WXlHbzdJRFwvNkFROVQ3K2dscHdVMVlpNHRcL1lmM2Fjek0yNFwvREE9PSIsIm1hYyI6IjBiNjA0MWQ1YWY2OWQwMzdiNmVkZTE3ZmE5MWRjYzI2Yjk4YTNhNTJkZGRiMjMzYTAwZGM2NDkxOTU0MzAzZmYifQ==")
=======
requestHeader.add(name: "token", value: "eyJpdiI6IkEwZ1pCTnJVUytcLzNPXC9pazV3bVYyUT09IiwidmFsdWUiOiJyWHBrb084SndjV0tvdVR0SnBuZGlKTFhhdVRPd1NUVlRuc3VMYTZHMCtiNUVcL1g3SGNGeG9oTmQ0NXNyZnBzVGMwSEc2bjJhdnd6ZzBReWR4QldtMXU5THZKMWFPVHJHQkZuSmExQzFKUldiV2ZhVys4VVJOZXd1enVZMXREc3VaaitudVdtdVVwV04zOEs3Slgxbk0yS21IZTEzYitoZkV5RWhBTlJ5TjhTd0Z1dTBCTlIxY1hSNE50TjBsVHhtQ2dqUmVXQnBpZkJ2N0F3bWtFU3NYSjBSNGVyRzlqZEJKdllYQXBIWEZjQWlGSlZNT2pCdStsUVwvT0Y2QkMrQjNnSDc2bmlhTjE3NjMxZGJyUGViWjhZb3JOWXpsKzg5b3o0VFU3emVVQ2FOUnpmcVRNU3JYbFwvOTlTZnVJcGlqN2tvOEQ2NWxpcWdlRndwK3R2dU9CUE1PUGpIa2Z4RjZBUGdOYXBVMEdmbXJFRStwTmxrejRqNmVSMjZ6dUgwclBNUlgwZGRVcTlqMzdUSzF3VXNFcFVNeU5FTXJjbmNLcWhheXBiNkZSMHhBa3V3dHk4XC9LWXI0d1pXeTQ4d0ltUHhRUFUrZnpQaUtvT0VCR1FWZTR1TlFFMGFxZUFqcysxZ2J3U1NSUkJTT29tdmY3UWR3RWN3OG55dldPM2ZWYXY5OVBNTVlwZWY0M3pXSGJ5OHVmV2lXZGExaVBRa3Z5RkFUREpLTDdRcHh6SW5ERDhVNVpGemR0K0RiYnRCaFI1MzFRQzZlalR5a09mTFwvNUd5eFFWb2p5OGRvMGxEQzlNbnBkdFwvdktLWit2b3pJTlRBNE5zcUsrSkRUUkRNZVZsdkljZncycHFBNldnYnFydnpcL2lDYmprdWdWZ1BEMk5CNzU3UVJtQnFvN1BJTm0rcVp6S1pmT3dyYXppQnhvT3ZIMWdJN2ExVGJYb3RVb2hnTlNUU2p2TmN1VDJmdVFDNU92TG1XUHI3UmlxWXVVQVhzbFwveDRxZUQyVU9VblcxNTNQdUJHOGRTaHB6a0cwU0FhbEJxK2tkeHNFMUJWNXgzb0g1WnJzdHBtdmRTREV2V3pqdDlLbTZEb2VPV0VPRll3M1dwSGx0cm16ODFlSWRCOTBkcUVrMXpkT3cwOUNLNTRPQW93OFNOUTg0NUpxZDZGa3IyUDRKWGR3NWRiK1wvQVhPTzlKdGR3SHB6cmZ2UjhBRlwvVWg2NStuQW5OcFVtNEFzQ3J0Y0VtTTI2RWF3a3J4MzJxcE1YWUtJYUc0bXY5NFwvYTBjb0FoZlhiSnQrOHhsUERhcVpcL0lsMTNtY2xzbFN1Umpob2czU3k2Sk9NcHFZamZVZlBCZTBTVFo2c08wOUNvRVpDQTNGR0YwaVdWbHk0Z3FKWHd5ZjJBUzhQanprR2lMdnBtZ2VQSEJKclNSd1QxdGxIVWRhQzF6UWRVXC9HQzlFbzRRc21RUVNwZ3B4RVozV2VSMXFHUTdsU04rNm5VeHdnbStnN014MGFrK2s1VUIxT0VNZkpjaVc2bEtFQkt1ekZDQ1hseWJROElnTXdNYkFjcGs2T2prY0pDakZMVWN5N1N1bjRcL0NCeWE1WElzM2l2UEZ2TkpiUm90cUhyeGFMOWFcL1wvRzlmZ0Z0dXA4bGhsNmFkTjgzcXhyME9MSlBQcFwvcWlCZW5MNEJ0RTd5MXZGeGx2djQzdmNwQXRrQ2QyU3QzMzRMUmVvTXlHYlNFcFpPSjROdGNzOXRGXC9OMGw3cE1nVzdxNHZwb2lCU3ZWaXFqOEVmUmFodmVsdDkxZFNKRjJHWURSVGNsMUlOdUMxRDFJV0NLYStmTHJ4WG5Lc1d6bGNNa0c2Q2ZzMXRYZkNHUzFvTmNBcHNrOWFQRDhtVmExc016c0RJbDNrVCtvdm94UT09IiwibWFjIjoiNTYyNGEzYWE3YjllODY5NmQ0NjdlMTg1NzQ4OGU1Y2I4MTE0MGQ2ZjFjNTQ0MTdkOTc0ODRmYjZhNDNhM2EwNiJ9")
>>>>>>> develop
headers = requestHeader
}
......@@ -109,7 +113,7 @@ class YHNetRequest: NSObject {
return self
}
///请求参数
func params(_params: [String:Any]?) -> Self {
func params(_ params: [String:Any]?) -> Self {
self.params = params
return self
}
......@@ -234,11 +238,11 @@ extension YHNetRequest {
class func getRequest(url:String, params:[String:Any] = [:], successBlock: SuccessHandlerType!, failBlock: FailureHandlerType!) -> Request? {
printLog("\n发起请求的URL是===> url = \(url)")
return YHNetRequest().url(url).requestType(.get).success(successBlock).failed(failBlock).startRequest()
return YHNetRequest().url(url).requestType(.get).params(params).success(successBlock).failed(failBlock).startRequest()
}
class func postRequest(url:String, params:[String:Any] = [:], successBlock: SuccessHandlerType!, failBlock: FailureHandlerType!) -> Request? {
printLog("\n发起请求的URL是===> url = \(url)")
return YHNetRequest().url(url).requestType(.post).success(successBlock).failed(failBlock).startRequest()
return YHNetRequest().url(url).requestType(.post).params(params).success(successBlock).failed(failBlock).startRequest()
}
}
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "advisory_btn_uploadphoto@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "advisory_btn_uploadphoto@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "advisory_icon_delete@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "advisory_icon_delete@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "float_icon_caveat@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "float_icon_caveat@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "float_icon_error@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "float_icon_error@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