Commit 63688a86 authored by Steven杜宇's avatar Steven杜宇

// plan

parent 0827354f
......@@ -1239,6 +1239,8 @@
04D8FF692D93D4E500703C75 /* YHPlanCustomerCaseListLayout.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04D8FF682D93D4E500703C75 /* YHPlanCustomerCaseListLayout.swift */; };
04D8FF6B2D94EADE00703C75 /* YHPlanItemView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04D8FF6A2D94EADE00703C75 /* YHPlanItemView.swift */; };
04D8FF6D2D94EE1100703C75 /* YHLookPlanButton.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04D8FF6C2D94EE1100703C75 /* YHLookPlanButton.swift */; };
04D8FF6F2D954D9B00703C75 /* YHPlanPolicyCarouselView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04D8FF6E2D954D9B00703C75 /* YHPlanPolicyCarouselView.swift */; };
04D8FF712D9550E700703C75 /* YHPlanPolicyCarouselImageCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04D8FF702D9550E700703C75 /* YHPlanPolicyCarouselImageCell.swift */; };
04E4CF3E2D5C6D32004D4013 /* YHCountryMessageView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04E4CF3D2D5C6D32004D4013 /* YHCountryMessageView.swift */; };
04E4CF402D5C83AE004D4013 /* YHSelectPhoneCountryViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04E4CF3F2D5C83AE004D4013 /* YHSelectPhoneCountryViewController.swift */; };
04E507D62D6EE856005F758B /* YHUserLevelAlertView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04E507D52D6EE856005F758B /* YHUserLevelAlertView.swift */; };
......@@ -2517,6 +2519,8 @@
04D8FF682D93D4E500703C75 /* YHPlanCustomerCaseListLayout.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHPlanCustomerCaseListLayout.swift; sourceTree = "<group>"; };
04D8FF6A2D94EADE00703C75 /* YHPlanItemView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHPlanItemView.swift; sourceTree = "<group>"; };
04D8FF6C2D94EE1100703C75 /* YHLookPlanButton.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHLookPlanButton.swift; sourceTree = "<group>"; };
04D8FF6E2D954D9B00703C75 /* YHPlanPolicyCarouselView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHPlanPolicyCarouselView.swift; sourceTree = "<group>"; };
04D8FF702D9550E700703C75 /* YHPlanPolicyCarouselImageCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHPlanPolicyCarouselImageCell.swift; sourceTree = "<group>"; };
04E4CF3D2D5C6D32004D4013 /* YHCountryMessageView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHCountryMessageView.swift; sourceTree = "<group>"; };
04E4CF3F2D5C83AE004D4013 /* YHSelectPhoneCountryViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHSelectPhoneCountryViewController.swift; sourceTree = "<group>"; };
04E507D52D6EE856005F758B /* YHUserLevelAlertView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHUserLevelAlertView.swift; sourceTree = "<group>"; };
......@@ -6725,6 +6729,8 @@
04D8FF6A2D94EADE00703C75 /* YHPlanItemView.swift */,
04D8FF6C2D94EE1100703C75 /* YHLookPlanButton.swift */,
04A750D12D93ABCE00974E5F /* YHSurveyTableViewCell.swift */,
04D8FF6E2D954D9B00703C75 /* YHPlanPolicyCarouselView.swift */,
04D8FF702D9550E700703C75 /* YHPlanPolicyCarouselImageCell.swift */,
);
path = V;
sourceTree = "<group>";
......@@ -7389,6 +7395,7 @@
045C10BB2D12CA5F00BD2DC0 /* YHChildInfoContainerVC.swift in Sources */,
045C10BC2D12CA5F00BD2DC0 /* YHSignatureWebViewController.swift in Sources */,
04307BA32D1E4CA600ED8E8D /* YHGCInformationFillTipsCell.swift in Sources */,
04D8FF6F2D954D9B00703C75 /* YHPlanPolicyCarouselView.swift in Sources */,
045C10BD2D12CA5F00BD2DC0 /* YHPreviewMainViewController.swift in Sources */,
045C10BE2D12CA5F00BD2DC0 /* YHWorkExperienceViewController.swift in Sources */,
045C10BF2D12CA5F00BD2DC0 /* YHServiceOrderGuideTipsView.swift in Sources */,
......@@ -8042,6 +8049,7 @@
045C12F62D12CA5F00BD2DC0 /* YHPreviewInfoWorkExpView.swift in Sources */,
045C12F72D12CA5F00BD2DC0 /* YHHUDWariningView.swift in Sources */,
045C12F82D12CA5F00BD2DC0 /* YHHKVisaRenewalPaymentStepView.swift in Sources */,
04D8FF712D9550E700703C75 /* YHPlanPolicyCarouselImageCell.swift in Sources */,
045C12F92D12CA5F00BD2DC0 /* YHEducationCertificateConfirmCell.swift in Sources */,
045C12FA2D12CA5F00BD2DC0 /* YHAcademicPreviewModel.swift in Sources */,
045C12FB2D12CA5F00BD2DC0 /* YHHomeIdentityViewController.swift in Sources */,
......
......@@ -18,7 +18,11 @@ class YHPlanViewController: YHBaseViewController {
"双法防",
"沙发上",
"啊防守打法"]
let headerViewHeight = 146.0
let topScrollHeight = 146.0-44.0
var contentOffSetChangeBig = false
lazy var tableView: UITableView = {
let tableView = UITableView(frame: .zero, style: .grouped)
......@@ -43,7 +47,7 @@ class YHPlanViewController: YHBaseViewController {
}()
lazy var headerView: UIView = {
let v = UIView(frame: CGRect(x: 0, y: 0, width: KScreenWidth, height: 146.0))
let v = UIView(frame: CGRect(x: 0, y: 0, width: KScreenWidth, height: headerViewHeight))
v.addSubview(titleImgView)
v.addSubview(descLabel)
v.addSubview(revalueBtn)
......@@ -221,6 +225,12 @@ class YHPlanViewController: YHBaseViewController {
return v
}()
lazy var policyVieiw: YHPlanPolicyCarouselView = {
let v = YHPlanPolicyCarouselView(frame: CGRect(x: 0, y: 0, width: KScreenWidth, height: 268))
v.bannerArr = ["", "", "", ""]
return v
}()
@objc func didRevalueBtnClicked() {
}
......@@ -232,6 +242,7 @@ class YHPlanViewController: YHBaseViewController {
gk_navigationBar.alpha = 0.0
gk_navTitleColor = .mainTextColor
gk_navTitle = "续签至永居方案分析"
self.view.backgroundColor = .init(hex: 0xF8F9FB)
self.view.addSubview(bgImgView)
self.view.addSubview(tableView)
......@@ -312,10 +323,17 @@ extension YHPlanViewController: UITableViewDelegate, UITableViewDataSource {
}
func tableView(_ tableView: UITableView, heightForFooterInSection section: Int) -> CGFloat {
if section == 4 {
return 268.0
}
return 1.0
}
func tableView(_ tableView: UITableView, viewForFooterInSection section: Int) -> UIView? {
if section == 4 {
return self.policyVieiw
}
let view = UIView()
return view
}
......@@ -357,6 +375,8 @@ extension YHPlanViewController: UIScrollViewDelegate {
func scrollViewDidScroll(_ scrollView: UIScrollView) {
printLog("\(scrollView.contentOffset.y)")
bgImgView.y = scrollView.contentOffset.y > 0.0 ? -scrollView.contentOffset.y : 0.0
var percent = scrollView.contentOffset.y/20.0
......@@ -366,9 +386,51 @@ extension YHPlanViewController: UIScrollViewDelegate {
percent = 0.0
}
fixedSegmentView.alpha = scrollView.contentOffset.y >= topScrollHeight ? 1.0 : 0.0
tableView.y = scrollView.contentOffset.y > topScrollHeight ? k_Height_NavigationtBarAndStatuBar+44.0 : k_Height_NavigationtBarAndStatuBar
gk_navigationBar.alpha = percent
if scrollView.contentOffset.y > topScrollHeight {
if topScrollHeight <= scrollView.contentOffset.y, scrollView.contentOffset.y <= topScrollHeight+10 {
if !contentOffSetChangeBig {
contentOffSetChangeBig = true
tableView.y = k_Height_NavigationtBarAndStatuBar+44.0
printLog("BBBBBBBBB")
tableView.setContentOffset(CGPoint(x: 0, y: headerViewHeight), animated: false)
}
}
}
if scrollView.contentOffset.y < headerViewHeight {
if contentOffSetChangeBig {
contentOffSetChangeBig = false
tableView.y = k_Height_NavigationtBarAndStatuBar
printLog("AAAAAAAAAA")
tableView.setContentOffset(CGPoint(x: 0, y: topScrollHeight), animated: false)
}
}
var find = false
for index in 0...infoArr.count-1 {
let rect = self.tableView.rectForRow(at: IndexPath(row: 0, section: index))
let conditon = index == 0 ? scrollView.contentOffset.y <= rect.origin.y : scrollView.contentOffset.y < rect.origin.y-5
if conditon {
find = true
let targetIndex = index-1 >= 0 ? index-1 : 0
self.segmented2View.defaultSelectedIndex = targetIndex
self.segmented2View.reloadDataWithoutListContainer()
self.segmented1View.defaultSelectedIndex = targetIndex
self.segmented1View.reloadDataWithoutListContainer()
break
}
}
if !find {
self.segmented2View.defaultSelectedIndex = infoArr.count-1
self.segmented2View.reloadDataWithoutListContainer()
self.segmented1View.defaultSelectedIndex = infoArr.count-1
self.segmented1View.reloadDataWithoutListContainer()
}
}
}
......@@ -377,6 +439,11 @@ extension YHPlanViewController: JXSegmentedViewDelegate {
func segmentedView(_ segmentedView: JXSegmentedView, didSelectedItemAt index: Int) {
let index = segmentedView.selectedIndex
if index > 0 {
if self.tableView.contentOffset.y < topScrollHeight {
self.tableView.setContentOffset(CGPoint(x: 0, y: topScrollHeight+2), animated: false)
}
}
self.tableView.scrollToRow(at: IndexPath(row: 0, section: index), at: .top, animated: true)
if segmentedView == segmented1View {
......
......@@ -28,7 +28,6 @@ class YHMakePlanViewController: YHBaseViewController {
return tableView
}()
override func viewDidLoad() {
super.viewDidLoad()
......@@ -53,7 +52,6 @@ class YHMakePlanViewController: YHBaseViewController {
func submitTargets() {
}
}
......@@ -97,4 +95,3 @@ extension YHMakePlanViewController: UITableViewDelegate, UITableViewDataSource {
}
}
//
// YHPlanPolicyCarouselImageCell.swift
// galaxy
//
// Created by Dufet on 2025/3/27.
// Copyright © 2025 https://www.galaxy-immi.com. All rights reserved.
//
import UIKit
import FSPagerView
class YHPlanPolicyCarouselImageCell: FSPagerViewCell {
static let cellReuseIdentifier = "YHPlanPolicyCarouselImageCell"
lazy var imageV: UIImageView = {
let v = UIImageView()
return v
}()
override init(frame: CGRect) {
super.init(frame: frame)
initView()
}
required init?(coder aDecoder: NSCoder) {
fatalError("init(coder:) has not been implemented")
}
func initView() {
self.addSubview(imageV)
imageV.snp.makeConstraints { make in
make.edges.equalToSuperview()
}
}
}
//
// YHPlanPolicyCarouselView.swift
// galaxy
//
// Created by Dufet on 2025/3/27.
// Copyright © 2025 https://www.galaxy-immi.com. All rights reserved.
//
import UIKit
import FSPagerView
class YHPlanPolicyCarouselView: UIView {
var bannerArr: [String] = [] {
didSet {
// 设置为0是先停掉自动滑动定时器
bannerView.automaticSlidingInterval = 0
self.indicatorView.numberOfPages = self.bannerArr.count
bannerView.reloadData()
// 指定指示器为第一个
self.indicatorView.currentPage = 0
// 指定显示图片为第一个
// bannerView.selectItem(at: 0, animated: false)
// 开启定时器开始滚动
bannerView.automaticSlidingInterval = bannerSildingInterval
bannerView.removesInfiniteLoopForSingleItem = true
bannerView.alwaysBounceHorizontal = true
}
}
lazy var whiteContentView: UIView = {
let v = UIView()
v.backgroundColor = .white
v.layer.cornerRadius = 6.0
v.clipsToBounds = true
return v
}()
lazy var titleLabel: UILabel = {
let lable = UILabel()
lable.textColor = .mainTextColor
lable.textAlignment = .left
lable.font = UIFont.PFSC_B(ofSize: 18)
lable.text = "香港政策解读"
return lable
}()
lazy var bannerView: FSPagerView = {
let view = FSPagerView()
view.delegate = self
view.dataSource = self
view.bounces = false
view.isInfinite = true
view.automaticSlidingInterval = bannerSildingInterval
view.register(YHPlanPolicyCarouselImageCell.self, forCellWithReuseIdentifier: YHPlanPolicyCarouselImageCell.cellReuseIdentifier)
view.itemSize = CGSize(width: KScreenWidth-16.0*4.0, height: 175.0)// FSPagerView.automaticSize
return view
}()
lazy var indicatorView: YHPageControl = {
let pageControl = YHPageControl(frame: .zero)
let dotHeight = 3.0
pageControl.spacing = 2.0
pageControl.dotSize = CGSize(width: 5, height: dotHeight)
pageControl.selectedDotSize = CGSize(width: 12, height: dotHeight)
pageControl.numberOfPages = 0
pageControl.currentPage = 0
pageControl.dotColor = .init(hex: 0xD5DAE1)
pageControl.selectedDotColor = .brandMainColor
return pageControl
}()
override init(frame: CGRect) {
super.init(frame: frame)
createUI()
}
required init?(coder: NSCoder) {
fatalError("init(coder:) has not been implemented")
}
func createUI() {
backgroundColor = .clear
self.addSubview(whiteContentView)
whiteContentView.addSubview(titleLabel)
whiteContentView.addSubview(bannerView)
whiteContentView.addSubview(indicatorView)
whiteContentView.snp.makeConstraints { make in
make.left.equalTo(16)
make.right.equalTo(-16)
make.top.equalTo(0)
make.bottom.equalTo(-16)
}
titleLabel.snp.makeConstraints { make in
make.left.equalTo(16)
make.top.equalTo(20)
make.height.equalTo(25)
}
bannerView.snp.makeConstraints { make in
make.top.equalTo(titleLabel.snp.bottom).offset(12)
make.left.equalTo(16)
make.right.equalTo(-16)
make.height.equalTo(175)
}
indicatorView.snp.makeConstraints { make in
make.centerX.equalToSuperview()
make.bottom.equalTo(-10)
make.height.equalTo(3)
}
}
}
extension YHPlanPolicyCarouselView: FSPagerViewDataSource, FSPagerViewDelegate {
public func numberOfItems(in pagerView: FSPagerView) -> Int {
return self.bannerArr.count
}
public func pagerView(_ pagerView: FSPagerView, cellForItemAt index: Int) -> FSPagerViewCell {
guard let cell = pagerView.dequeueReusableCell(withReuseIdentifier: YHPlanPolicyCarouselImageCell.cellReuseIdentifier, at: index) as? YHPlanPolicyCarouselImageCell else {
return FSPagerViewCell()
}
if index < bannerArr.count {
let model = bannerArr[index]
cell.imageV.backgroundColor = .randomColor()
}
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 0 <= index, index < bannerArr.count {
let model = bannerArr[index]
// selectBannerItemBlock?(model)
return
}
}
func pagerViewWillEndDragging(_ pagerView: FSPagerView, targetIndex: Int) {
self.indicatorView.currentPage = targetIndex
}
func pagerViewDidEndScrollAnimation(_ pagerView: FSPagerView) {
self.indicatorView.currentPage = pagerView.currentIndex
}
}
......@@ -123,4 +123,11 @@ extension UIColor {
UIGraphicsEndImageContext()
return image!
}
static func randomColor() -> UIColor {
let red = CGFloat(arc4random_uniform(256)) / 255.0
let green = CGFloat(arc4random_uniform(256)) / 255.0
let blue = CGFloat(arc4random_uniform(256)) / 255.0
return UIColor(red: red, green: green, blue: blue, alpha: 1.0)
}
}
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