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
982a38b9
Commit
982a38b9
authored
Oct 23, 2024
by
pete谢兆麟
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
UI 细节修复
parent
dc913ce3
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
47 additions
and
6 deletions
+47
-6
YHResignUploadDocListViewController.swift
...loadDoc(续签补件)/C/YHResignUploadDocListViewController.swift
+28
-2
YHResignUploadDocListCell.swift
...)/ResignUploadDoc(续签补件)/V/YHResignUploadDocListCell.swift
+17
-2
YHResignUploadTravelHKViewController.swift
...Crad(上传旅行证件)/C/YHResignUploadTravelHKViewController.swift
+2
-2
No files found.
galaxy/galaxy/Classes/Modules/IntelligentService(服务中心)/Resign(续签)/ResignUploadDoc(续签补件)/C/YHResignUploadDocListViewController.swift
View file @
982a38b9
...
...
@@ -175,6 +175,20 @@ private extension YHResignUploadDocListViewController {
make
.
top
.
equalTo
(
k_Height_NavigationtBarAndStatuBar
+
152
)
}
}
func
getHeight
(
_
value
:
String
)
->
CGFloat
{
let
text
=
value
// 要显示的文本内容
let
font
=
UIFont
.
PFSC_B
(
ofSize
:
14
)
// 字体大小
let
maxWidth
=
KScreenWidth
-
146
// 最大宽度限制
// 创建NSAttributedString对象并设置属性
let
attributes
=
[
NSAttributedString
.
Key
.
font
:
font
]
as
[
NSAttributedString
.
Key
:
Any
]
_
=
NSMutableAttributedString
(
string
:
text
,
attributes
:
attributes
)
// 根据指定的最大宽度和字体大小计算文本的高度
let
size
=
(
text
as
NSString
)
.
boundingRect
(
with
:
CGSize
(
width
:
maxWidth
,
height
:
.
greatestFiniteMagnitude
),
options
:
.
usesLineFragmentOrigin
,
attributes
:
attributes
,
context
:
nil
)
.
size
return
size
.
height
}
}
...
...
@@ -241,9 +255,21 @@ extension YHResignUploadDocListViewController: UITableViewDelegate, UITableViewD
func
tableView
(
_
tableView
:
UITableView
,
heightForRowAt
indexPath
:
IndexPath
)
->
CGFloat
{
if
self
.
viewModel
.
mainModel
.
supplement_voucher_url
.
count
==
0
{
if
indexPath
.
section
==
0
{
return
CGFloat
(
52
*
(
self
.
viewModel
.
mainModel
.
upload_list
.
count
+
1
))
var
height
:
CGFloat
=
0
for
item
in
self
.
viewModel
.
mainModel
.
upload_list
{
height
=
height
+
32
let
value
=
getHeight
(
item
.
name
)
height
=
height
+
value
}
return
CGFloat
(
52
+
height
)
}
else
{
return
CGFloat
(
52
*
(
self
.
viewModel
.
mainModel
.
doc_list
.
count
+
1
))
var
height
:
CGFloat
=
0
for
item
in
self
.
viewModel
.
mainModel
.
doc_list
{
height
=
height
+
32
let
value
=
getHeight
(
item
.
name
)
height
=
height
+
value
}
return
CGFloat
(
52
+
height
)
}
}
return
67
...
...
galaxy/galaxy/Classes/Modules/IntelligentService(服务中心)/Resign(续签)/ResignUploadDoc(续签补件)/V/YHResignUploadDocListCell.swift
View file @
982a38b9
...
...
@@ -104,6 +104,20 @@ class YHResignUploadDocListCell: UITableViewCell {
}
}
func
getHeight
(
_
value
:
String
)
->
CGFloat
{
let
text
=
value
// 要显示的文本内容
let
font
=
UIFont
.
PFSC_B
(
ofSize
:
14
)
// 字体大小
let
maxWidth
=
KScreenWidth
-
146
// 最大宽度限制
// 创建NSAttributedString对象并设置属性
let
attributes
=
[
NSAttributedString
.
Key
.
font
:
font
]
as
[
NSAttributedString
.
Key
:
Any
]
_
=
NSMutableAttributedString
(
string
:
text
,
attributes
:
attributes
)
// 根据指定的最大宽度和字体大小计算文本的高度
let
size
=
(
text
as
NSString
)
.
boundingRect
(
with
:
CGSize
(
width
:
maxWidth
,
height
:
.
greatestFiniteMagnitude
),
options
:
.
usesLineFragmentOrigin
,
attributes
:
attributes
,
context
:
nil
)
.
size
return
size
.
height
}
func
updateAllViews
()
{
mainItemView
.
removeSubviews
()
guard
let
dataSource
=
dataSource
else
{
...
...
@@ -136,14 +150,15 @@ class YHResignUploadDocListCell: UITableViewCell {
}
else
{
itemView
.
docDataSource
=
dataSource
[
i
]
}
let
height
=
getHeight
(
dataSource
[
i
]
.
name
)
mainItemView
.
addSubview
(
itemView
)
itemView
.
snp
.
makeConstraints
{
make
in
make
.
left
.
equalTo
(
18
)
make
.
top
.
equalTo
(
total
)
make
.
height
.
equalTo
(
5
1
)
make
.
height
.
equalTo
(
height
+
3
1
)
make
.
right
.
equalTo
(
-
18
)
}
total
=
total
+
51
total
=
total
+
Int
(
height
+
31
)
}
}
...
...
galaxy/galaxy/Classes/Modules/IntelligentService(服务中心)/Resign(续签)/UploadTravelCrad(上传旅行证件)/C/YHResignUploadTravelHKViewController.swift
View file @
982a38b9
...
...
@@ -172,7 +172,7 @@ class YHResignUploadTravelHKViewController: YHBaseViewController {
return
false
}
if
urls
.
last
?
.
count
==
0
{
failString
=
"请上传港澳通行证
反
面"
failString
=
"请上传港澳通行证
背
面"
return
false
}
if
self
.
viewModel
.
dataModel
.
issue_start
.
count
==
0
{
...
...
@@ -252,7 +252,7 @@ extension YHResignUploadTravelHKViewController: UITableViewDelegate, UITableView
cell
.
firstImageName
=
"service_adopter_card_travel_front"
cell
.
lastImageName
=
"service_adopter_card_travel_back"
cell
.
firstLabelName
=
"港澳通行证正面"
cell
.
lastLabelName
=
"港澳通行证
反
面"
cell
.
lastLabelName
=
"港澳通行证
背
面"
cell
.
dataModel
=
dataModel
cell
.
failString
=
failString
cell
.
data
=
data
...
...
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