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
83270873
Commit
83270873
authored
Mar 26, 2025
by
Steven杜宇
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
// 方案
parent
789d2e49
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
80 additions
and
18 deletions
+80
-18
YHPlanViewController.swift
...axy/Classes/Modules/Plan(方案)/C/YHPlanViewController.swift
+49
-11
YHPlanCustomerCaseCollectionCell.swift
...Modules/Plan(方案)/V/YHPlanCustomerCaseCollectionCell.swift
+4
-3
YHPlanCustomerCaseListCell.swift
...asses/Modules/Plan(方案)/V/YHPlanCustomerCaseListCell.swift
+4
-3
YHPlanCustomerCaseListLayout.swift
...ses/Modules/Plan(方案)/V/YHPlanCustomerCaseListLayout.swift
+1
-1
BG@2x.png
...Assets.xcassets/Plan/plan_list_head_bg.imageset/BG@2x.png
+0
-0
BG@3x.png
...Assets.xcassets/Plan/plan_list_head_bg.imageset/BG@3x.png
+0
-0
Contents.json
...ts.xcassets/Plan/plan_list_head_bg.imageset/Contents.json
+22
-0
No files found.
galaxy/galaxy/Classes/Modules/Plan(方案)/C/YHPlanViewController.swift
View file @
83270873
...
@@ -11,7 +11,12 @@ import UIKit
...
@@ -11,7 +11,12 @@ import UIKit
class
YHPlanViewController
:
YHBaseViewController
{
class
YHPlanViewController
:
YHBaseViewController
{
var
infoArr
:
[
String
]
=
[
""
,
""
,
""
,
""
]
var
infoArr
:
[
String
]
=
[
""
,
""
,
""
,
""
]
var
cases
:
[
String
]
=
[
"水电费噶事多发结石冷风机拉萨反垃圾算法逻辑的山卡拉飞机啊索拉卡飞机啊拉卡萨"
,
"阿斯顿发发"
,
"阿斯顿发生大法师懂法守法说法大萨达法司法发沙发是打发三大发实达防擦是打发"
,
"啊所发生的发生的放假啦苏卡达飞机拉萨开发机阿萨拉法基阿萨拉开发"
,
"双法防"
,
"沙发上"
,
"啊防守打法"
]
lazy
var
tableView
:
UITableView
=
{
lazy
var
tableView
:
UITableView
=
{
let
tableView
=
UITableView
(
frame
:
.
zero
,
style
:
.
grouped
)
let
tableView
=
UITableView
(
frame
:
.
zero
,
style
:
.
grouped
)
...
@@ -33,12 +38,21 @@ class YHPlanViewController: YHBaseViewController {
...
@@ -33,12 +38,21 @@ class YHPlanViewController: YHBaseViewController {
return
tableView
return
tableView
}()
}()
let
v
=
YHPlanScoreChart
(
frame
:
.
zero
)
lazy
var
bgImgView
:
UIImageView
=
{
let
v
=
UIImageView
()
v
.
image
=
UIImage
(
named
:
"plan_list_head_bg"
)
return
v
}()
override
func
viewDidLoad
()
{
override
func
viewDidLoad
()
{
super
.
viewDidLoad
()
super
.
viewDidLoad
()
self
.
view
.
backgroundColor
=
.
black
self
.
view
.
backgroundColor
=
.
init
(
hex
:
0xF5F6F8
)
self
.
view
.
addSubview
(
bgImgView
)
self
.
view
.
addSubview
(
tableView
)
self
.
view
.
addSubview
(
tableView
)
bgImgView
.
snp
.
makeConstraints
{
make
in
make
.
left
.
right
.
top
.
equalToSuperview
()
make
.
height
.
equalTo
(
bgImgView
.
snp
.
width
)
}
tableView
.
snp
.
makeConstraints
{
make
in
tableView
.
snp
.
makeConstraints
{
make
in
make
.
left
.
right
.
bottom
.
equalToSuperview
()
make
.
left
.
right
.
bottom
.
equalToSuperview
()
make
.
top
.
equalTo
(
200
)
make
.
top
.
equalTo
(
200
)
...
@@ -75,12 +89,7 @@ extension YHPlanViewController: UITableViewDelegate, UITableViewDataSource {
...
@@ -75,12 +89,7 @@ extension YHPlanViewController: UITableViewDelegate, UITableViewDataSource {
guard
let
cell3
=
tableView
.
dequeueReusableCell
(
withIdentifier
:
YHPlanCustomerCaseListCell
.
cellReuseIdentifier
,
for
:
indexPath
)
as?
YHPlanCustomerCaseListCell
else
{
guard
let
cell3
=
tableView
.
dequeueReusableCell
(
withIdentifier
:
YHPlanCustomerCaseListCell
.
cellReuseIdentifier
,
for
:
indexPath
)
as?
YHPlanCustomerCaseListCell
else
{
return
UITableViewCell
()
return
UITableViewCell
()
}
}
cell3
.
cases
=
[
"水电费噶事多发结石冷风机拉萨反垃圾算法逻辑的山卡拉飞机啊索拉卡飞机啊拉卡萨"
,
cell3
.
cases
=
self
.
cases
"阿斯顿发发"
,
"阿斯顿发生大法师懂法守法说法大萨达法司法发沙发是打发三大发实达防擦是打发"
,
"啊所发生的发生的放假啦苏卡达飞机拉萨开发机阿萨拉法基阿萨拉开发"
,
"双法防"
,
"沙发上"
,
"啊防守打法"
]
return
cell3
return
cell3
}
}
}
}
...
@@ -89,8 +98,9 @@ extension YHPlanViewController: UITableViewDelegate, UITableViewDataSource {
...
@@ -89,8 +98,9 @@ extension YHPlanViewController: UITableViewDelegate, UITableViewDataSource {
}
}
func
tableView
(
_
tableView
:
UITableView
,
heightForRowAt
indexPath
:
IndexPath
)
->
CGFloat
{
func
tableView
(
_
tableView
:
UITableView
,
heightForRowAt
indexPath
:
IndexPath
)
->
CGFloat
{
if
indexPath
.
section
==
3
{
if
indexPath
.
section
==
3
{
return
2000
return
getCaseListHeight
()
}
}
return
UITableView
.
automaticDimension
return
UITableView
.
automaticDimension
}
}
...
@@ -111,5 +121,33 @@ extension YHPlanViewController: UITableViewDelegate, UITableViewDataSource {
...
@@ -111,5 +121,33 @@ extension YHPlanViewController: UITableViewDelegate, UITableViewDataSource {
func
tableView
(
_
tableView
:
UITableView
,
heightForHeaderInSection
section
:
Int
)
->
CGFloat
{
func
tableView
(
_
tableView
:
UITableView
,
heightForHeaderInSection
section
:
Int
)
->
CGFloat
{
return
1.0
return
1.0
}
}
// 计算文字宽度大小
func
getHeigt
(
font
:
UIFont
,
width
:
CGFloat
,
string
:
String
)
->
CGFloat
{
let
size
=
CGSize
.
init
(
width
:
width
,
height
:
CGFloat
(
MAXFLOAT
))
let
dic
=
[
NSAttributedString
.
Key
.
font
:
font
]
// swift 4.2
let
strSize
=
string
.
boundingRect
(
with
:
size
,
options
:
[
.
usesLineFragmentOrigin
],
attributes
:
dic
,
context
:
nil
)
.
size
return
ceil
(
strSize
.
height
)
}
func
getCaseListHeight
()
->
CGFloat
{
let
cellWidth
=
floor
((
KScreenWidth
-
16.0
*
2.0
-
10.0
)
/
2.0
)
var
yOffset1
=
0.0
var
yOffset2
=
0.0
for
(
index
,
item
)
in
cases
.
enumerated
()
{
var
textHeight
=
self
.
getHeigt
(
font
:
UIFont
.
PFSC_R
(
ofSize
:
14
),
width
:
cellWidth
-
8.0
*
2.0
,
string
:
cases
[
index
])
let
caseCellHeight
=
textHeight
+
(
cellWidth
*
(
200.0
/
166.0
)
+
8.0
+
12.0
+
10.0
)
if
index
%
2
==
0
{
yOffset1
+=
caseCellHeight
}
else
{
yOffset2
+=
caseCellHeight
}
}
let
contentHeight
=
max
(
yOffset1
,
yOffset2
)
+
20.0
+
12.0
return
contentHeight
}
}
}
galaxy/galaxy/Classes/Modules/Plan(方案)/V/YHPlanCustomerCaseCollectionCell.swift
View file @
83270873
...
@@ -52,7 +52,8 @@ class YHPlanCustomerCaseCollectionCell: UICollectionViewCell {
...
@@ -52,7 +52,8 @@ class YHPlanCustomerCaseCollectionCell: UICollectionViewCell {
whiteContentView
.
addSubview
(
descLabel
)
whiteContentView
.
addSubview
(
descLabel
)
whiteContentView
.
snp
.
makeConstraints
{
make
in
whiteContentView
.
snp
.
makeConstraints
{
make
in
make
.
edges
.
equalToSuperview
()
make
.
top
.
left
.
right
.
equalToSuperview
()
make
.
bottom
.
equalTo
(
-
10
)
}
}
iconImgV
.
snp
.
makeConstraints
{
make
in
iconImgV
.
snp
.
makeConstraints
{
make
in
...
@@ -63,8 +64,8 @@ class YHPlanCustomerCaseCollectionCell: UICollectionViewCell {
...
@@ -63,8 +64,8 @@ class YHPlanCustomerCaseCollectionCell: UICollectionViewCell {
descLabel
.
snp
.
makeConstraints
{
make
in
descLabel
.
snp
.
makeConstraints
{
make
in
make
.
top
.
equalTo
(
iconImgV
.
snp
.
bottom
)
.
offset
(
8
)
make
.
top
.
equalTo
(
iconImgV
.
snp
.
bottom
)
.
offset
(
8
)
make
.
bottom
.
equalTo
(
-
12
)
make
.
bottom
.
equalTo
(
-
12
)
make
.
left
.
equalTo
(
12
)
make
.
left
.
equalTo
(
8
)
make
.
right
.
equalTo
(
-
12
)
make
.
right
.
equalTo
(
-
8
)
}
}
}
}
}
}
galaxy/galaxy/Classes/Modules/Plan(方案)/V/YHPlanCustomerCaseListCell.swift
View file @
83270873
...
@@ -34,6 +34,7 @@ class YHPlanCustomerCaseListCell: UITableViewCell {
...
@@ -34,6 +34,7 @@ class YHPlanCustomerCaseListCell: UITableViewCell {
collectView
.
delegate
=
self
collectView
.
delegate
=
self
collectView
.
dataSource
=
self
collectView
.
dataSource
=
self
collectView
.
register
(
YHPlanCustomerCaseCollectionCell
.
self
,
forCellWithReuseIdentifier
:
YHPlanCustomerCaseCollectionCell
.
cellReuseIdentifier
)
collectView
.
register
(
YHPlanCustomerCaseCollectionCell
.
self
,
forCellWithReuseIdentifier
:
YHPlanCustomerCaseCollectionCell
.
cellReuseIdentifier
)
collectView
.
isScrollEnabled
=
false
return
collectView
return
collectView
}()
}()
...
@@ -103,9 +104,9 @@ extension YHPlanCustomerCaseListCell: UICollectionViewDelegate, UICollectionView
...
@@ -103,9 +104,9 @@ extension YHPlanCustomerCaseListCell: UICollectionViewDelegate, UICollectionView
// 返回每个单元格的大小
// 返回每个单元格的大小
func
collectionView
(
_
collectionView
:
UICollectionView
,
layout
collectionViewLayout
:
UICollectionViewLayout
,
sizeForItemAt
indexPath
:
IndexPath
)
->
CGSize
{
func
collectionView
(
_
collectionView
:
UICollectionView
,
layout
collectionViewLayout
:
UICollectionViewLayout
,
sizeForItemAt
indexPath
:
IndexPath
)
->
CGSize
{
let
cellWidth
=
floor
(
KScreenWidth
-
16.0
*
2.0
-
10.0
)
/
2.0
let
cellWidth
=
floor
(
(
KScreenWidth
-
16.0
*
2.0
-
10.0
)
/
2.0
)
var
height
=
self
.
getHeigt
(
font
:
UIFont
.
PFSC_R
(
ofSize
:
14
),
width
:
cellWidth
,
string
:
cases
[
indexPath
.
item
])
var
height
=
self
.
getHeigt
(
font
:
UIFont
.
PFSC_R
(
ofSize
:
14
),
width
:
cellWidth
-
8.0
*
2.0
,
string
:
cases
[
indexPath
.
item
])
height
+=
(
cellWidth
*
(
200.0
/
166.0
)
+
2
0.0
)
height
+=
(
cellWidth
*
(
200.0
/
166.0
)
+
8.0
+
12.0
+
1
0.0
)
return
CGSize
(
width
:
cellWidth
,
height
:
height
)
return
CGSize
(
width
:
cellWidth
,
height
:
height
)
}
}
...
...
galaxy/galaxy/Classes/Modules/Plan(方案)/V/YHPlanCustomerCaseListLayout.swift
View file @
83270873
...
@@ -11,7 +11,7 @@ import UIKit
...
@@ -11,7 +11,7 @@ import UIKit
class
YHPlanCustomerCaseListLayout
:
UICollectionViewLayout
{
class
YHPlanCustomerCaseListLayout
:
UICollectionViewLayout
{
// MARK: - 配置属性
// MARK: - 配置属性
let
cellWidth
=
floor
(
KScreenWidth
-
16.0
*
2.0
-
10.0
)
/
2.0
let
cellWidth
=
floor
(
(
KScreenWidth
-
16.0
*
2.0
-
10.0
)
/
2.0
)
let
cellPadding
=
10.0
let
cellPadding
=
10.0
let
cellGap
=
10.0
let
cellGap
=
10.0
private
var
contentHeight
:
CGFloat
=
0
private
var
contentHeight
:
CGFloat
=
0
...
...
galaxy/galaxy/Res/Assets.xcassets/Plan/plan_list_head_bg.imageset/BG@2x.png
0 → 100644
View file @
83270873
517 KB
galaxy/galaxy/Res/Assets.xcassets/Plan/plan_list_head_bg.imageset/BG@3x.png
0 → 100644
View file @
83270873
This diff is collapsed.
Click to expand it.
galaxy/galaxy/Res/Assets.xcassets/Plan/plan_list_head_bg.imageset/Contents.json
0 → 100644
View file @
83270873
{
"images"
:
[
{
"idiom"
:
"universal"
,
"scale"
:
"1x"
},
{
"filename"
:
"BG@2x.png"
,
"idiom"
:
"universal"
,
"scale"
:
"2x"
},
{
"filename"
:
"BG@3x.png"
,
"idiom"
:
"universal"
,
"scale"
:
"3x"
}
],
"info"
:
{
"author"
:
"xcode"
,
"version"
:
1
}
}
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