Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
G
galaxy-iOS
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
mobile-group
galaxy-iOS
Commits
c8fa828f
Commit
c8fa828f
authored
Apr 03, 2025
by
pete谢兆麟
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bug修复
parent
58413931
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
79 additions
and
6 deletions
+79
-6
YHMakePlanViewController.swift
...odules/Plan(方案)/MakePlan/C/YHMakePlanViewController.swift
+37
-0
YHMakePlanCell.swift
.../Classes/Modules/Plan(方案)/MakePlan/V/YHMakePlanCell.swift
+0
-1
YHMakePlanCusttomHeadView.swift
...dules/Plan(方案)/MakePlan/V/YHMakePlanCusttomHeadView.swift
+25
-2
YHMakePlanHeadView.swift
...sses/Modules/Plan(方案)/MakePlan/V/YHMakePlanHeadView.swift
+7
-2
YHMakePlanPriceAlertView.swift
...odules/Plan(方案)/MakePlan/V/YHMakePlanPriceAlertView.swift
+4
-0
YHMakePlanTopView.swift
...asses/Modules/Plan(方案)/MakePlan/V/YHMakePlanTopView.swift
+6
-1
No files found.
galaxy/galaxy/Classes/Modules/Plan(方案)/MakePlan/C/YHMakePlanViewController.swift
View file @
c8fa828f
...
@@ -14,6 +14,10 @@ class YHMakePlanViewController: YHBaseViewController {
...
@@ -14,6 +14,10 @@ class YHMakePlanViewController: YHBaseViewController {
lazy
var
headView
:
YHMakePlanHeadView
=
{
lazy
var
headView
:
YHMakePlanHeadView
=
{
let
view
=
YHMakePlanHeadView
(
frame
:
CGRect
(
x
:
0
,
y
:
0
,
width
:
KScreenWidth
,
height
:
333
.
fix
+
44
))
let
view
=
YHMakePlanHeadView
(
frame
:
CGRect
(
x
:
0
,
y
:
0
,
width
:
KScreenWidth
,
height
:
333
.
fix
+
44
))
view
.
block
=
{
tag
in
self
.
tableView
.
scrollToRow
(
at
:
IndexPath
(
row
:
tag
,
section
:
0
),
at
:
.
top
,
animated
:
true
)
self
.
topView
.
custtomView
.
updataData
(
tag
)
}
return
view
return
view
}()
}()
...
@@ -41,6 +45,10 @@ class YHMakePlanViewController: YHBaseViewController {
...
@@ -41,6 +45,10 @@ class YHMakePlanViewController: YHBaseViewController {
lazy
var
topView
:
YHMakePlanTopView
=
{
lazy
var
topView
:
YHMakePlanTopView
=
{
let
view
=
YHMakePlanTopView
()
let
view
=
YHMakePlanTopView
()
view
.
isHidden
=
true
view
.
isHidden
=
true
view
.
block
=
{
tag
in
self
.
tableView
.
scrollToRow
(
at
:
IndexPath
(
row
:
tag
,
section
:
0
),
at
:
.
top
,
animated
:
true
)
self
.
headView
.
custtomView
.
updataData
(
tag
)
}
return
view
return
view
}()
}()
...
@@ -161,12 +169,16 @@ extension YHMakePlanViewController: UITableViewDelegate, UITableViewDataSource {
...
@@ -161,12 +169,16 @@ extension YHMakePlanViewController: UITableViewDelegate, UITableViewDataSource {
var
dataSource
:
[
YHMakePlanMainModel
]
=
[]
var
dataSource
:
[
YHMakePlanMainModel
]
=
[]
if
indexPath
.
row
==
0
{
if
indexPath
.
row
==
0
{
dataSource
=
viewModel
.
makePlanModel
.
basic
dataSource
=
viewModel
.
makePlanModel
.
basic
cell
.
titleLabel
.
text
=
"基础身份续签"
}
else
if
indexPath
.
row
==
1
{
}
else
if
indexPath
.
row
==
1
{
dataSource
=
viewModel
.
makePlanModel
.
work
dataSource
=
viewModel
.
makePlanModel
.
work
cell
.
titleLabel
.
text
=
"工作联系提升"
}
else
if
indexPath
.
row
==
2
{
}
else
if
indexPath
.
row
==
2
{
dataSource
=
viewModel
.
makePlanModel
.
live
dataSource
=
viewModel
.
makePlanModel
.
live
cell
.
titleLabel
.
text
=
"生活联系提升"
}
else
if
indexPath
.
row
==
3
{
}
else
if
indexPath
.
row
==
3
{
dataSource
=
viewModel
.
makePlanModel
.
invest
dataSource
=
viewModel
.
makePlanModel
.
invest
cell
.
titleLabel
.
text
=
"投资联系提升"
}
}
cell
.
dataSource
=
dataSource
cell
.
dataSource
=
dataSource
cell
.
actionHandler
=
{
product
in
cell
.
actionHandler
=
{
product
in
...
@@ -239,5 +251,30 @@ extension YHMakePlanViewController: UITableViewDelegate, UITableViewDataSource {
...
@@ -239,5 +251,30 @@ extension YHMakePlanViewController: UITableViewDelegate, UITableViewDataSource {
}
else
{
}
else
{
topView
.
isHidden
=
true
topView
.
isHidden
=
true
}
}
if
let
topRow
=
tableView
.
topVisibleRowIndex
()
{
self
.
topView
.
custtomView
.
updataData
(
topRow
)
self
.
headView
.
custtomView
.
updataData
(
topRow
)
}
}
}
extension
UITableView
{
/// 获取当前显示在最顶部的行索引
func
topVisibleRowIndex
()
->
Int
?
{
// 获取所有可见行的indexPath(按从上到下的顺序排列)
guard
let
visibleIndexPaths
=
self
.
indexPathsForVisibleRows
?
.
sorted
()
else
{
return
nil
}
// 第一个就是最顶部的行
return
visibleIndexPaths
.
first
?
.
row
}
/// 获取当前显示在最顶部的单元格
func
topVisibleCell
()
->
UITableViewCell
?
{
guard
let
topRow
=
topVisibleRowIndex
()
else
{
return
nil
}
return
self
.
cellForRow
(
at
:
IndexPath
(
row
:
topRow
,
section
:
0
))
}
}
}
}
galaxy/galaxy/Classes/Modules/Plan(方案)/MakePlan/V/YHMakePlanCell.swift
View file @
c8fa828f
...
@@ -76,7 +76,6 @@ class YHMakePlanCell: UITableViewCell {
...
@@ -76,7 +76,6 @@ class YHMakePlanCell: UITableViewCell {
}
}
func
updateAllViews
()
{
func
updateAllViews
()
{
titleLabel
.
text
=
"基础身份续签"
mainItemView
.
removeSubviews
()
mainItemView
.
removeSubviews
()
var
y
=
0
var
y
=
0
for
i
in
0
..<
(
dataSource
?
.
count
??
0
)
{
for
i
in
0
..<
(
dataSource
?
.
count
??
0
)
{
...
...
galaxy/galaxy/Classes/Modules/Plan(方案)/MakePlan/V/YHMakePlanCusttomHeadView.swift
View file @
c8fa828f
...
@@ -9,8 +9,8 @@
...
@@ -9,8 +9,8 @@
import
UIKit
import
UIKit
class
YHMakePlanCusttomHeadView
:
UIView
{
class
YHMakePlanCusttomHeadView
:
UIView
{
typealias
Block
=
(
Int
)
->
Void
// Data
var
block
:
Block
?
private
let
tabs
=
[
"基础身份"
,
"工作联系"
,
"生活联系"
,
"投资联系"
]
private
let
tabs
=
[
"基础身份"
,
"工作联系"
,
"生活联系"
,
"投资联系"
]
private
var
buttons
:
[
UIButton
]
=
[]
private
var
buttons
:
[
UIButton
]
=
[]
private
var
selectedIndex
:
Int
=
0
private
var
selectedIndex
:
Int
=
0
...
@@ -97,6 +97,29 @@ class YHMakePlanCusttomHeadView: UIView {
...
@@ -97,6 +97,29 @@ class YHMakePlanCusttomHeadView: UIView {
self
.
layoutIfNeeded
()
self
.
layoutIfNeeded
()
}
}
selectedIndex
=
newIndex
self
.
block
?(
selectedIndex
)
}
func
updataData
(
_
tag
:
Int
)
{
let
newIndex
=
tag
guard
newIndex
!=
selectedIndex
else
{
return
}
// Update colors
buttons
[
selectedIndex
]
.
setTitleColor
(
UIColor
(
hex
:
0x6a7586
),
for
:
.
normal
)
buttons
[
newIndex
]
.
setTitleColor
(
UIColor
.
mainTextColor
,
for
:
.
normal
)
// Animate underline
UIView
.
animate
(
withDuration
:
0.3
)
{
self
.
underlineView
.
snp
.
remakeConstraints
{
make
in
make
.
top
.
equalTo
(
self
.
stackView
.
snp
.
bottom
)
make
.
height
.
equalTo
(
2
)
make
.
width
.
equalTo
(
16
)
make
.
centerX
.
equalTo
(
self
.
buttons
[
newIndex
]
.
snp
.
centerX
)
}
self
.
layoutIfNeeded
()
}
selectedIndex
=
newIndex
selectedIndex
=
newIndex
}
}
}
}
galaxy/galaxy/Classes/Modules/Plan(方案)/MakePlan/V/YHMakePlanHeadView.swift
View file @
c8fa828f
...
@@ -9,7 +9,9 @@
...
@@ -9,7 +9,9 @@
import
UIKit
import
UIKit
class
YHMakePlanHeadView
:
UIView
{
class
YHMakePlanHeadView
:
UIView
{
typealias
Block
=
(
Int
)
->
Void
var
block
:
Block
?
private
lazy
var
centerImageView
:
UIImageView
=
{
private
lazy
var
centerImageView
:
UIImageView
=
{
let
view
=
UIImageView
()
let
view
=
UIImageView
()
view
.
image
=
UIImage
(
named
:
"plan_head_bg"
)
view
.
image
=
UIImage
(
named
:
"plan_head_bg"
)
...
@@ -29,8 +31,11 @@ class YHMakePlanHeadView: UIView {
...
@@ -29,8 +31,11 @@ class YHMakePlanHeadView: UIView {
return
view
return
view
}()
}()
private
lazy
var
custtomView
:
YHMakePlanCusttomHeadView
=
{
lazy
var
custtomView
:
YHMakePlanCusttomHeadView
=
{
let
view
=
YHMakePlanCusttomHeadView
()
let
view
=
YHMakePlanCusttomHeadView
()
view
.
block
=
{
tag
in
self
.
block
?(
tag
)
}
return
view
return
view
}()
}()
...
...
galaxy/galaxy/Classes/Modules/Plan(方案)/MakePlan/V/YHMakePlanPriceAlertView.swift
View file @
c8fa828f
...
@@ -185,12 +185,16 @@ extension YHMakePlanPriceAlertView: UITableViewDelegate, UITableViewDataSource {
...
@@ -185,12 +185,16 @@ extension YHMakePlanPriceAlertView: UITableViewDelegate, UITableViewDataSource {
}
}
var
data
:
[
YHMakePlanMainModel
]
=
[]
var
data
:
[
YHMakePlanMainModel
]
=
[]
if
indexPath
.
row
==
0
{
if
indexPath
.
row
==
0
{
cell
.
titleLabel
.
text
=
"基础身份续签"
data
=
dataSource
.
basic
data
=
dataSource
.
basic
}
else
if
indexPath
.
row
==
1
{
}
else
if
indexPath
.
row
==
1
{
cell
.
titleLabel
.
text
=
"工作联系提升"
data
=
dataSource
.
work
data
=
dataSource
.
work
}
else
if
indexPath
.
row
==
2
{
}
else
if
indexPath
.
row
==
2
{
cell
.
titleLabel
.
text
=
"生活联系提升"
data
=
dataSource
.
live
data
=
dataSource
.
live
}
else
if
indexPath
.
row
==
3
{
}
else
if
indexPath
.
row
==
3
{
cell
.
titleLabel
.
text
=
"投资联系提升"
data
=
dataSource
.
invest
data
=
dataSource
.
invest
}
}
cell
.
dataSource
=
data
cell
.
dataSource
=
data
...
...
galaxy/galaxy/Classes/Modules/Plan(方案)/MakePlan/V/YHMakePlanTopView.swift
View file @
c8fa828f
...
@@ -10,6 +10,8 @@ import UIKit
...
@@ -10,6 +10,8 @@ import UIKit
import
AttributedString
import
AttributedString
class
YHMakePlanTopView
:
UIView
{
class
YHMakePlanTopView
:
UIView
{
typealias
Block
=
(
Int
)
->
Void
var
block
:
Block
?
var
dataSource
:
YHMakePlanScoreModel
?
{
var
dataSource
:
YHMakePlanScoreModel
?
{
didSet
{
didSet
{
let
year
=
dataSource
?
.
year
??
0
let
year
=
dataSource
?
.
year
??
0
...
@@ -41,8 +43,11 @@ class YHMakePlanTopView: UIView {
...
@@ -41,8 +43,11 @@ class YHMakePlanTopView: UIView {
return
label
return
label
}()
}()
private
lazy
var
custtomView
:
YHMakePlanCusttomHeadView
=
{
lazy
var
custtomView
:
YHMakePlanCusttomHeadView
=
{
let
view
=
YHMakePlanCusttomHeadView
()
let
view
=
YHMakePlanCusttomHeadView
()
view
.
block
=
{
tag
in
self
.
block
?(
tag
)
}
return
view
return
view
}()
}()
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment