Commit b62e20a9 authored by David黄金龙's avatar David黄金龙

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

* 'develop' of http://gitlab.galaxy-immi.com/mobile-group/galaxy-iOS:
  加载按钮
  使用
parents fd2c8c81 34a6de03
...@@ -236,6 +236,7 @@ ...@@ -236,6 +236,7 @@
049537852BA9B28500AF7E59 /* YHCertificateTemplateCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 049537842BA9B28500AF7E59 /* YHCertificateTemplateCell.swift */; }; 049537852BA9B28500AF7E59 /* YHCertificateTemplateCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 049537842BA9B28500AF7E59 /* YHCertificateTemplateCell.swift */; };
049A48A82B49417300D0C641 /* YHAboutUsViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 049A48A72B49417300D0C641 /* YHAboutUsViewController.swift */; }; 049A48A82B49417300D0C641 /* YHAboutUsViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 049A48A72B49417300D0C641 /* YHAboutUsViewController.swift */; };
049A48AA2B49536000D0C641 /* YHAboutUsAdvantageCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 049A48A92B49536000D0C641 /* YHAboutUsAdvantageCell.swift */; }; 049A48AA2B49536000D0C641 /* YHAboutUsAdvantageCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 049A48A92B49536000D0C641 /* YHAboutUsAdvantageCell.swift */; };
049AC4C62BC3E55300F857F4 /* YHServiceSectionView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 049AC4C52BC3E55300F857F4 /* YHServiceSectionView.swift */; };
04A271232BABFF3200652B1B /* YHCertificateUploadTypeCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04A271222BABFF3200652B1B /* YHCertificateUploadTypeCell.swift */; }; 04A271232BABFF3200652B1B /* YHCertificateUploadTypeCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04A271222BABFF3200652B1B /* YHCertificateUploadTypeCell.swift */; };
04A271252BAC33BB00652B1B /* YHFilePreviewTool.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04A271242BAC33BB00652B1B /* YHFilePreviewTool.swift */; }; 04A271252BAC33BB00652B1B /* YHFilePreviewTool.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04A271242BAC33BB00652B1B /* YHFilePreviewTool.swift */; };
04A671592B9F18C800C1FB91 /* YHCertificateUploadSheetView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04A671582B9F18C800C1FB91 /* YHCertificateUploadSheetView.swift */; }; 04A671592B9F18C800C1FB91 /* YHCertificateUploadSheetView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04A671582B9F18C800C1FB91 /* YHCertificateUploadSheetView.swift */; };
...@@ -255,6 +256,7 @@ ...@@ -255,6 +256,7 @@
04C693622B723AB8004C1758 /* YHMySettingViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04C693612B723AB8004C1758 /* YHMySettingViewController.swift */; }; 04C693622B723AB8004C1758 /* YHMySettingViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04C693612B723AB8004C1758 /* YHMySettingViewController.swift */; };
04C693642B723B56004C1758 /* YHMySettingCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04C693632B723B56004C1758 /* YHMySettingCell.swift */; }; 04C693642B723B56004C1758 /* YHMySettingCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04C693632B723B56004C1758 /* YHMySettingCell.swift */; };
04C8F4832B7216D800ADF59B /* YHUserInfoHeaderView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04C8F4822B7216D800ADF59B /* YHUserInfoHeaderView.swift */; }; 04C8F4832B7216D800ADF59B /* YHUserInfoHeaderView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04C8F4822B7216D800ADF59B /* YHUserInfoHeaderView.swift */; };
04CC2EF02BC3DDB2000305DD /* YHServiceBannerView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04CC2EEF2BC3DDB2000305DD /* YHServiceBannerView.swift */; };
04D5C5662B8ED92600190021 /* YHBaseModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04D5C5652B8ED92600190021 /* YHBaseModel.swift */; }; 04D5C5662B8ED92600190021 /* YHBaseModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04D5C5652B8ED92600190021 /* YHBaseModel.swift */; };
04E86E092B707ACE00A35F4B /* YHPhoneLoginViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04E86E082B707ACE00A35F4B /* YHPhoneLoginViewController.swift */; }; 04E86E092B707ACE00A35F4B /* YHPhoneLoginViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04E86E082B707ACE00A35F4B /* YHPhoneLoginViewController.swift */; };
04E86E0B2B70C13300A35F4B /* YHCodeSueecssViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04E86E0A2B70C13300A35F4B /* YHCodeSueecssViewController.swift */; }; 04E86E0B2B70C13300A35F4B /* YHCodeSueecssViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04E86E0A2B70C13300A35F4B /* YHCodeSueecssViewController.swift */; };
...@@ -665,6 +667,7 @@ ...@@ -665,6 +667,7 @@
049537842BA9B28500AF7E59 /* YHCertificateTemplateCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHCertificateTemplateCell.swift; sourceTree = "<group>"; }; 049537842BA9B28500AF7E59 /* YHCertificateTemplateCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHCertificateTemplateCell.swift; sourceTree = "<group>"; };
049A48A72B49417300D0C641 /* YHAboutUsViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHAboutUsViewController.swift; sourceTree = "<group>"; }; 049A48A72B49417300D0C641 /* YHAboutUsViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHAboutUsViewController.swift; sourceTree = "<group>"; };
049A48A92B49536000D0C641 /* YHAboutUsAdvantageCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHAboutUsAdvantageCell.swift; sourceTree = "<group>"; }; 049A48A92B49536000D0C641 /* YHAboutUsAdvantageCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHAboutUsAdvantageCell.swift; sourceTree = "<group>"; };
049AC4C52BC3E55300F857F4 /* YHServiceSectionView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHServiceSectionView.swift; sourceTree = "<group>"; };
04A271222BABFF3200652B1B /* YHCertificateUploadTypeCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHCertificateUploadTypeCell.swift; sourceTree = "<group>"; }; 04A271222BABFF3200652B1B /* YHCertificateUploadTypeCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHCertificateUploadTypeCell.swift; sourceTree = "<group>"; };
04A271242BAC33BB00652B1B /* YHFilePreviewTool.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHFilePreviewTool.swift; sourceTree = "<group>"; }; 04A271242BAC33BB00652B1B /* YHFilePreviewTool.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHFilePreviewTool.swift; sourceTree = "<group>"; };
04A671582B9F18C800C1FB91 /* YHCertificateUploadSheetView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = YHCertificateUploadSheetView.swift; sourceTree = "<group>"; }; 04A671582B9F18C800C1FB91 /* YHCertificateUploadSheetView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = YHCertificateUploadSheetView.swift; sourceTree = "<group>"; };
...@@ -685,6 +688,7 @@ ...@@ -685,6 +688,7 @@
04C693612B723AB8004C1758 /* YHMySettingViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHMySettingViewController.swift; sourceTree = "<group>"; }; 04C693612B723AB8004C1758 /* YHMySettingViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHMySettingViewController.swift; sourceTree = "<group>"; };
04C693632B723B56004C1758 /* YHMySettingCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHMySettingCell.swift; sourceTree = "<group>"; }; 04C693632B723B56004C1758 /* YHMySettingCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHMySettingCell.swift; sourceTree = "<group>"; };
04C8F4822B7216D800ADF59B /* YHUserInfoHeaderView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHUserInfoHeaderView.swift; sourceTree = "<group>"; }; 04C8F4822B7216D800ADF59B /* YHUserInfoHeaderView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHUserInfoHeaderView.swift; sourceTree = "<group>"; };
04CC2EEF2BC3DDB2000305DD /* YHServiceBannerView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHServiceBannerView.swift; sourceTree = "<group>"; };
04D5C5652B8ED92600190021 /* YHBaseModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHBaseModel.swift; sourceTree = "<group>"; }; 04D5C5652B8ED92600190021 /* YHBaseModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHBaseModel.swift; sourceTree = "<group>"; };
04E86E082B707ACE00A35F4B /* YHPhoneLoginViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHPhoneLoginViewController.swift; sourceTree = "<group>"; }; 04E86E082B707ACE00A35F4B /* YHPhoneLoginViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHPhoneLoginViewController.swift; sourceTree = "<group>"; };
04E86E0A2B70C13300A35F4B /* YHCodeSueecssViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHCodeSueecssViewController.swift; sourceTree = "<group>"; }; 04E86E0A2B70C13300A35F4B /* YHCodeSueecssViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHCodeSueecssViewController.swift; sourceTree = "<group>"; };
...@@ -2070,9 +2074,11 @@ ...@@ -2070,9 +2074,11 @@
A5FD63C82B63A35B00D1D9DA /* YHInformationFillTipsAlertView.swift */, A5FD63C82B63A35B00D1D9DA /* YHInformationFillTipsAlertView.swift */,
A5FD63CA2B63D6C300D1D9DA /* YHInformationFillTipsCell.swift */, A5FD63CA2B63D6C300D1D9DA /* YHInformationFillTipsCell.swift */,
044414022BC39B8D00784A14 /* YHServerTableHeadView.swift */, 044414022BC39B8D00784A14 /* YHServerTableHeadView.swift */,
049AC4C52BC3E55300F857F4 /* YHServiceSectionView.swift */,
044414042BC3B9DE00784A14 /* YHServiceTableFootView.swift */, 044414042BC3B9DE00784A14 /* YHServiceTableFootView.swift */,
044414062BC3C54B00784A14 /* YHHomeCollectionViewCell.swift */, 044414062BC3C54B00784A14 /* YHHomeCollectionViewCell.swift */,
044414082BC3CE8500784A14 /* YHHomeCollectionLayout.swift */, 044414082BC3CE8500784A14 /* YHHomeCollectionLayout.swift */,
04CC2EEF2BC3DDB2000305DD /* YHServiceBannerView.swift */,
); );
path = V; path = V;
sourceTree = "<group>"; sourceTree = "<group>";
...@@ -2457,6 +2463,7 @@ ...@@ -2457,6 +2463,7 @@
045EEE8D2B9F171A0022A143 /* YHPreviewInfoCell.swift in Sources */, 045EEE8D2B9F171A0022A143 /* YHPreviewInfoCell.swift in Sources */,
045EEF0C2B9F171A0022A143 /* YHBasicInfoFillBottomView.swift in Sources */, 045EEF0C2B9F171A0022A143 /* YHBasicInfoFillBottomView.swift in Sources */,
A5ACE93D2B4564F7002C94D2 /* UIButton+Extension.swift in Sources */, A5ACE93D2B4564F7002C94D2 /* UIButton+Extension.swift in Sources */,
04CC2EF02BC3DDB2000305DD /* YHServiceBannerView.swift in Sources */,
045EEEA32B9F171A0022A143 /* YHCompanyModel.swift in Sources */, 045EEEA32B9F171A0022A143 /* YHCompanyModel.swift in Sources */,
045EEEC62B9F171A0022A143 /* YHOtherTextViewItemView.swift in Sources */, 045EEEC62B9F171A0022A143 /* YHOtherTextViewItemView.swift in Sources */,
044413F72BC2786200784A14 /* YHHomeWebViewController.swift in Sources */, 044413F72BC2786200784A14 /* YHHomeWebViewController.swift in Sources */,
...@@ -2551,6 +2558,7 @@ ...@@ -2551,6 +2558,7 @@
04C693642B723B56004C1758 /* YHMySettingCell.swift in Sources */, 04C693642B723B56004C1758 /* YHMySettingCell.swift in Sources */,
A5FD63C92B63A35B00D1D9DA /* YHInformationFillTipsAlertView.swift in Sources */, A5FD63C92B63A35B00D1D9DA /* YHInformationFillTipsAlertView.swift in Sources */,
045EEEE32B9F171A0022A143 /* YHMySignatureListModel.swift in Sources */, 045EEEE32B9F171A0022A143 /* YHMySignatureListModel.swift in Sources */,
049AC4C62BC3E55300F857F4 /* YHServiceSectionView.swift in Sources */,
A582B2432BB95E20009D098C /* YHHKPlanCell.swift in Sources */, A582B2432BB95E20009D098C /* YHHKPlanCell.swift in Sources */,
045EEEC52B9F171A0022A143 /* YHOtherPickerView.swift in Sources */, 045EEEC52B9F171A0022A143 /* YHOtherPickerView.swift in Sources */,
045EEE842B9F171A0022A143 /* YHPreviewBasiceInformationViewController.swift in Sources */, 045EEE842B9F171A0022A143 /* YHPreviewBasiceInformationViewController.swift in Sources */,
......
...@@ -14,9 +14,10 @@ class YHServerHKLifeViewController: YHBaseViewController { ...@@ -14,9 +14,10 @@ class YHServerHKLifeViewController: YHBaseViewController {
private let serviceCenterMainReqVM : YHServiceCenterMainViewModel = YHServiceCenterMainViewModel() private let serviceCenterMainReqVM : YHServiceCenterMainViewModel = YHServiceCenterMainViewModel()
var tableHeadView: YHServerTableHeadView! var tableHeadView: YHServerTableHeadView!
var tableFootView: YHServiceTableFootView! var tableFootView: YHServiceTableFootView!
var sectionView: YHServiceSectionView!
var homeTableView: UITableView = { var homeTableView: UITableView = {
let tableView = UITableView(frame: .zero, style: .grouped) let tableView = UITableView(frame: .zero, style: .plain)
tableView.backgroundColor = .clear tableView.backgroundColor = .clear
tableView.separatorStyle = .none tableView.separatorStyle = .none
tableView.showsHorizontalScrollIndicator = false tableView.showsHorizontalScrollIndicator = false
...@@ -60,10 +61,15 @@ extension YHServerHKLifeViewController { ...@@ -60,10 +61,15 @@ extension YHServerHKLifeViewController {
gk_navBarAlpha = 0 gk_navBarAlpha = 0
gk_navigationBar.isHidden = true gk_navigationBar.isHidden = true
sectionView = {
let view = YHServiceSectionView()
return view
}()
tableHeadView = YHServerTableHeadView() tableHeadView = YHServerTableHeadView()
tableHeadView.frame = CGRect(x: 0, y: 0, width: KScreenWidth, height: 365) tableHeadView.frame = CGRect(x: 0, y: 0, width: KScreenWidth, height: 365)
tableFootView = YHServiceTableFootView() tableFootView = YHServiceTableFootView()
tableFootView.frame = CGRect(x: 0, y: 0, width: KScreenWidth, height: KScreenHeight - k_Height_safeAreaInsetsTop() - 48 - k_Height_TabBar) tableFootView.frame = CGRect(x: 0, y: 0, width: KScreenWidth, height: KScreenHeight)
view.addSubview(homeTableView) view.addSubview(homeTableView)
homeTableView.tableHeaderView = tableHeadView homeTableView.tableHeaderView = tableHeadView
homeTableView.tableFooterView = tableFootView homeTableView.tableFooterView = tableFootView
...@@ -95,12 +101,11 @@ extension YHServerHKLifeViewController : UITableViewDelegate,UITableViewDataSour ...@@ -95,12 +101,11 @@ extension YHServerHKLifeViewController : UITableViewDelegate,UITableViewDataSour
} }
func tableView(_ tableView: UITableView, heightForHeaderInSection section: Int) -> CGFloat { func tableView(_ tableView: UITableView, heightForHeaderInSection section: Int) -> CGFloat {
return kMargin return 48
} }
func tableView(_ tableView: UITableView, viewForHeaderInSection section: Int) -> UIView? { func tableView(_ tableView: UITableView, viewForHeaderInSection section: Int) -> UIView? {
let view = UIView(frame: CGRect(x: 0, y: 0, width: KScreenWidth, height: kMargin)) return sectionView
return view
} }
func tableView(_ tableView: UITableView, heightForFooterInSection section: Int) -> CGFloat { func tableView(_ tableView: UITableView, heightForFooterInSection section: Int) -> CGFloat {
...@@ -113,33 +118,16 @@ extension YHServerHKLifeViewController : UITableViewDelegate,UITableViewDataSour ...@@ -113,33 +118,16 @@ extension YHServerHKLifeViewController : UITableViewDelegate,UITableViewDataSour
func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat { func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat {
return 81 return 0.1
} }
func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell { func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
let cell0 = tableView.dequeueReusableCell(withClass: YHContractCell.self) let cell0 = UITableViewCell()
cell0.selectionStyle = .none
if indexPath.section < self.serviceCenterMainReqVM.arrContactList.count {
cell0.dataModel = self.serviceCenterMainReqVM.arrContactList[indexPath.section]
}
return cell0 return cell0
} }
func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) { func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
tableView.deselectRow(at: indexPath, animated: true)
printLog("点击了 tableView Cell \(indexPath.section)")
//获取订单号
let orderId = serviceCenterMainReqVM.arrContactList[indexPath.section].id
UserDefaults.standard.set(orderId, forKey: "orderIdForPreview")
UserDefaults.standard.synchronize()
let vc = YHServiceCenterSecondViewController()
vc.orderId = orderId
vc.mobile = serviceCenterMainReqVM.arrContactList[indexPath.section].mobile
self.navigationController?.pushViewController(vc)
} }
} }
......
...@@ -290,7 +290,9 @@ class YHMyDocumentsDetailViewController: YHBaseViewController { ...@@ -290,7 +290,9 @@ class YHMyDocumentsDetailViewController: YHBaseViewController {
func showSureAlert() { func showSureAlert() {
YHCommonAlertView.show("", "请确认是否已完成编辑并提交", "取消", "确认") {[weak self] in YHCommonAlertView.show("", "请确认是否已完成编辑并提交", "取消", "确认") {[weak self] in
guard let self = self else { return } guard let self = self else { return }
YHHUD.show(.progress(message: ""))
self.viewModel.requestDocumentSubmit("\(self.id)") {[weak self] success, error in self.viewModel.requestDocumentSubmit("\(self.id)") {[weak self] success, error in
YHHUD.hide()
guard let self = self else { return } guard let self = self else { return }
if success { if success {
YHHUD.flash(message: "提交成功") YHHUD.flash(message: "提交成功")
......
...@@ -9,8 +9,8 @@ ...@@ -9,8 +9,8 @@
import UIKit import UIKit
class YHServerTableHeadView: UIView { class YHServerTableHeadView: UIView {
var search: UIView! var search: YHHomeSearchView!
var bannarView: UIView! var bannarView: YHServiceBannerView!
var titleLabel: UILabel! var titleLabel: UILabel!
var dataSource: YHScemeHeadModel? { var dataSource: YHScemeHeadModel? {
...@@ -30,7 +30,7 @@ class YHServerTableHeadView: UIView { ...@@ -30,7 +30,7 @@ class YHServerTableHeadView: UIView {
func setUpView() { func setUpView() {
search = { search = {
let view = UIView() let view = YHHomeSearchView()
return view return view
}() }()
addSubview(search) addSubview(search)
...@@ -42,8 +42,7 @@ class YHServerTableHeadView: UIView { ...@@ -42,8 +42,7 @@ class YHServerTableHeadView: UIView {
} }
bannarView = { bannarView = {
let view = UIView() let view = YHServiceBannerView()
view.backgroundColor = .white
return view return view
}() }()
addSubview(bannarView) addSubview(bannarView)
......
//
// YHServiceBannerView.swift
// galaxy
//
// Created by EDY on 2024/4/8.
// Copyright © 2024 https://www.galaxy-immi.com. All rights reserved.
//
import UIKit
import FSPagerView
class YHServiceBannerView: UIView {
// 位置、大小、图片、文本
fileprivate var dataArr: [YHBannerModel] = [YHBannerModel(),YHBannerModel(),YHBannerModel(),YHBannerModel(),YHBannerModel()]
override init(frame: CGRect) {
super.init(frame: frame)
initView()
}
required init?(coder: NSCoder) {
fatalError("init(coder:) has not been implemented")
}
private lazy var bannerView: FSPagerView = {
let view = FSPagerView()
view.delegate = self
view.dataSource = self
view.automaticSlidingInterval = 3
view.register(FSPagerViewCell.self, forCellWithReuseIdentifier: "cell")
view.itemSize = FSPagerView.automaticSize
view.interitemSpacing = 10
return view
}()
lazy var pageControl: FSPageControl = {
let view = FSPageControl()
return view
}()
}
private extension YHServiceBannerView {
func initView() {
addSubview(bannerView)
bannerView.snp.makeConstraints { make in
make.top.left.right.bottom.equalToSuperview()
}
bannerView.addSubview(pageControl)
pageControl.snp.makeConstraints { make in
make.left.bottom.right.equalToSuperview()
make.height.equalTo(25)
}
setupPageControl()
bannerView.reloadData()
}
func setupPageControl() {
self.pageControl.numberOfPages = self.dataArr.count
self.pageControl.contentHorizontalAlignment = .center
self.pageControl.contentInsets = UIEdgeInsets(top: 0, left: 12, bottom: 10, right: 12)
let normalImage = UIImage(color: UIColor(hex: 0xff0000, alpha: 1.0), size: CGSize(width: 5, height: 5))
let selectImage = UIImage(color: .white, size: CGSize(width: 8, height: 5))
self.pageControl.setImage(normalImage, for: .normal)
self.pageControl.setImage(selectImage, for: .selected)
self.pageControl.interitemSpacing = 3
}
}
extension YHServiceBannerView: FSPagerViewDataSource, FSPagerViewDelegate {
public func numberOfItems(in pagerView: FSPagerView) -> Int {
return self.dataArr.count
}
public func pagerView(_ pagerView: FSPagerView, cellForItemAt index: Int) -> FSPagerViewCell {
let cell = pagerView.dequeueReusableCell(withReuseIdentifier: "cell", at: index)
let image = UIImage(named: "default_placeholder_image")?.bs_scaled(toWidth: UIDevice.kScreenW - 16*2, opaque: false)
cell.imageView?.image = image
if index < dataArr.count {
let model = dataArr[index]
if let url = URL(string: model.img_url) {
cell.imageView?.kf.setImage(with: url)
}
cell.textLabel?.text = model.title
}
cell.imageView?.contentMode = .scaleAspectFill
cell.backgroundColor = .contentBkgColor
cell.contentView.layer.shadowColor = UIColor.clear.cgColor
return cell
}
// MARK: - FSPagerView Delegate
func pagerView(_ pagerView: FSPagerView, didSelectItemAt index: Int) {
pagerView.deselectItem(at: index, animated: true)
pagerView.scrollToItem(at: index, animated: true)
if index >= dataArr.count {
return
}
let model = dataArr[index]
switch model.link_type {
case 10: //跳转H5
// let vc = BsWebViewController()
// vc.urlString = model.link_url
// UIViewController.navTopViewController?.navigationController?.pushViewController(vc, animated: true)
break
case 20: //跳转原生页面
if let vc = UIViewController.classFromString(model.link_url) {
UIViewController.navTopViewController?.navigationController?.pushViewController(vc, animated: true)
}
break
default:
break
}
}
func pagerViewWillEndDragging(_ pagerView: FSPagerView, targetIndex: Int) {
self.pageControl.currentPage = targetIndex
}
func pagerViewDidEndScrollAnimation(_ pagerView: FSPagerView) {
self.pageControl.currentPage = pagerView.currentIndex
}
}
//
// YHServiceSectionView.swift
// galaxy
//
// Created by EDY on 2024/4/8.
// Copyright © 2024 https://www.galaxy-immi.com. All rights reserved.
//
import UIKit
class YHServiceSectionView: UIView {
var items: [String] = []
lazy var myCollectView = {
// 设置布局方向
let flowLayout = UICollectionViewFlowLayout()
flowLayout.itemSize = CGSize(width: 75, height: 32)
flowLayout.minimumInteritemSpacing = 12.0
flowLayout.minimumLineSpacing = 12.0
flowLayout.scrollDirection = .horizontal
let collectinoView = UICollectionView(frame: .zero, collectionViewLayout: flowLayout)
collectinoView.backgroundColor = .white
collectinoView.contentInset = UIEdgeInsets(top: 10, left: 20, bottom: 0, right: 20)
collectinoView.register(YHServiceSectionCollectionViewCell.self, forCellWithReuseIdentifier:YHServiceSectionCollectionViewCell.cellReuseIdentifier)
collectinoView.delegate = self
collectinoView.dataSource = self
collectinoView.showsVerticalScrollIndicator = false
collectinoView.translatesAutoresizingMaskIntoConstraints = false
collectinoView.alwaysBounceVertical = true
return collectinoView
}()
var dataSource: YHScemeHeadModel? {
didSet {
updateAllViews()
}
}
override init(frame: CGRect) {
super.init(frame: frame)
backgroundColor = .white
setUpView()
self.items = ["优才","高才","留学","专才"]
self.myCollectView.reloadData()
}
required init?(coder: NSCoder) {
fatalError("init(coder:) has not been implemented")
}
func setUpView() {
backgroundColor = .white
addSubview(myCollectView)
myCollectView.snp.makeConstraints { make in
make.top.left.right.bottom.equalToSuperview()
}
// self.myCollectView.es.addInfiniteScrolling {
// self.loadFakeData()
// }
}
func updateAllViews() {
guard let model = dataSource else { return }
}
}
extension YHServiceSectionView: UICollectionViewDelegate, UICollectionViewDataSource {
func collectionView(_ collectionView: UICollectionView, numberOfItemsInSection section: Int) -> Int {
return items.count
}
func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell {
let cell = collectionView.dequeueReusableCell(withReuseIdentifier: YHServiceSectionCollectionViewCell.cellReuseIdentifier, for: indexPath) as! YHServiceSectionCollectionViewCell
cell.dataSource = items[indexPath.row]
return cell
}
private func collectionView(collectionView: UICollectionView, didSelectItemAtIndexPath indexPath: NSIndexPath) {
print("index is \(indexPath.row)")
}
}
class YHServiceSectionCollectionViewCell: UICollectionViewCell {
static let cellReuseIdentifier = "YHServiceSectionCollectionViewCell"
var dataSource: String? {
didSet {
updataAllSubViews()
}
}
lazy var descripeLable:UILabel = {
let label = UILabel()
label.text = "赴港"
label.textColor = UIColor(hex: 0x94a3bb)
label.font = UIFont.PFSC_R(ofSize: 13)
label.textAlignment = .center
return label
}()
required init?(coder: NSCoder) {
super.init(coder: coder)
}
override init(frame: CGRect) {
super.init(frame: frame)
setupUI()
}
private func setupUI() {
contentView.backgroundColor = UIColor(hex: 0xf4f6fa)
contentView.clipsToBounds = true
contentView.layer.cornerRadius = 16
contentView.addSubview(descripeLable)
descripeLable.snp.makeConstraints { make in
make.top.left.right.bottom.equalToSuperview()
}
}
func updataAllSubViews() {
guard let dataSource = dataSource else { return }
descripeLable.text = dataSource
}
}
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