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
ac561645
Commit
ac561645
authored
Mar 24, 2024
by
David黄金龙
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
文件清单 截图
parent
98257603
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
60 additions
and
47 deletions
+60
-47
YHFileListViewController.swift
...ice(服务中心)/FileList(文件清单)/C/YHFileListViewController.swift
+59
-46
YHFileListBottomView.swift
...Service(服务中心)/FileList(文件清单)/V/YHFileListBottomView.swift
+1
-1
No files found.
galaxy/galaxy/Classes/Modules/IntelligentService(服务中心)/FileList(文件清单)/C/YHFileListViewController.swift
View file @
ac561645
...
@@ -41,7 +41,12 @@ class YHFileListViewController: YHBaseViewController {
...
@@ -41,7 +41,12 @@ class YHFileListViewController: YHBaseViewController {
}()
}()
let
bottomView
:
YHFileListBottomView
=
YHFileListBottomView
()
private
lazy
var
bottomView
:
YHFileListBottomView
=
{
var
bottomView
:
YHFileListBottomView
=
YHFileListBottomView
()
bottomView
.
nextButton
.
isEnabled
=
false
bottomView
.
layer
.
opacity
=
0.8
return
bottomView
}()
override
func
viewDidLoad
()
{
override
func
viewDidLoad
()
{
super
.
viewDidLoad
()
super
.
viewDidLoad
()
...
@@ -60,9 +65,11 @@ class YHFileListViewController: YHBaseViewController {
...
@@ -60,9 +65,11 @@ class YHFileListViewController: YHBaseViewController {
let
footLable
=
UILabel
()
let
footLable
=
UILabel
()
footLable
.
text
=
"*感谢您对银河移民的信赖,以上信息均用于香港优才签证申 请银河移民承诺对您所提供的信息将绝对保密"
footLable
.
text
=
"*感谢您对银河移民的信赖,以上信息均用于香港优才签证申 请银河移民承诺对您所提供的信息将绝对保密"
footLable
.
textColor
=
.
white
footLable
.
textColor
=
.
white
footLable
.
textAlignment
=
.
center
footLable
.
font
=
UIFont
.
PFSC_R
(
ofSize
:
12
)
footLable
.
font
=
UIFont
.
PFSC_R
(
ofSize
:
12
)
footLable
.
numberOfLines
=
0
footLable
.
numberOfLines
=
0
footLable
.
lineBreakMode
=
.
byWordWrapping
footLable
.
lineBreakMode
=
.
byWordWrapping
return
footLable
return
footLable
}()
}()
}
}
...
@@ -70,13 +77,24 @@ class YHFileListViewController: YHBaseViewController {
...
@@ -70,13 +77,24 @@ class YHFileListViewController: YHBaseViewController {
extension
YHFileListViewController
{
extension
YHFileListViewController
{
func
loadData
()
{
func
loadData
()
{
if
let
orderID
=
UserDefaults
.
standard
.
value
(
forKey
:
"orderIdForPreview"
)
{
if
let
orderID
=
UserDefaults
.
standard
.
value
(
forKey
:
"orderIdForPreview"
)
{
YHHUD
.
show
(
.
progress
(
message
:
""
))
let
param
=
[
"order_id"
:
orderID
,
"node"
:
"1"
,
"state"
:
"1"
]
let
param
=
[
"order_id"
:
orderID
,
"node"
:
"1"
,
"state"
:
"1"
]
// let param = ["order_id":"11758","node":"1","state":"1"] //for test hjl
certificateReqVM
.
getCertificateFileListData
(
params
:
param
)
{
success
,
error
in
certificateReqVM
.
getCertificateFileListData
(
params
:
param
)
{
success
,
error
in
YHHUD
.
hide
()
if
success
==
true
{
if
success
==
true
{
self
.
myContentView
.
dataModel
=
self
.
certificateReqVM
.
arrFileListData
self
.
myContentView
.
dataModel
=
self
.
certificateReqVM
.
arrFileListData
self
.
myContentView
.
layoutIfNeeded
()
let
r
=
self
.
myContentView
.
bounds
self
.
myContentView
.
frame
=
CGRect
(
x
:
kMargin
,
y
:
217
,
width
:
KScreenWidth
-
2*
kMargin
,
height
:
r
.
height
)
self
.
footLable
.
frame
=
CGRect
(
x
:
28
,
y
:
217
+
r
.
height
+
29
,
width
:
KScreenWidth
-
2*
28
,
height
:
36
)
self
.
myScrollView
.
contentSize
=
CGSize
(
width
:
KScreenWidth
,
height
:
r
.
height
+
217
+
29
+
36
+
41
)
self
.
bottomView
.
nextButton
.
isEnabled
=
true
self
.
bottomView
.
layer
.
opacity
=
1.0
}
else
{
}
else
{
YHHUD
.
flash
(
message
:
error
?
.
errorMsg
??
"请求出错"
)
YHHUD
.
flash
(
message
:
error
?
.
errorMsg
??
"请求出错"
)
}
}
...
@@ -117,29 +135,27 @@ extension YHFileListViewController {
...
@@ -117,29 +135,27 @@ extension YHFileListViewController {
bottomView
.
block
=
{
[
self
]
flag
in
bottomView
.
block
=
{
[
self
]
flag
in
if
flag
==
1
{
if
flag
==
1
{
printLog
(
"生成清单"
)
YHHUD
.
show
(
.
progress
(
message
:
"正在生成图片"
))
// if let image = self.captureScrollView(scrollView: self.myScrollView) {
if
let
image
=
self
.
captureScrollView
(
scrollView
:
self
.
myScrollView
)
{
// saveImageToPhotosAlbum(image: image)
YHHUD
.
hide
()
// } else {
saveImageToPhotosAlbum
(
image
:
image
)
// YHHUD.flash(message: "截图失败~~~")
}
else
{
// }
YHHUD
.
hide
()
YHHUD
.
flash
(
message
:
"生成图片失败"
)
}
}
}
}
}
myScrollView
.
backgroundColor
=
UIColor
(
hex
:
0x0D37C7
,
alpha
:
1.0
)
myScrollView
.
backgroundColor
=
UIColor
(
hex
:
0x0D37C7
,
alpha
:
1.0
)
view
.
addSubview
(
myScrollView
)
view
.
addSubview
(
myScrollView
)
myScrollView
.
snp
.
makeConstraints
{
make
in
myScrollView
.
frame
=
CGRect
(
x
:
0
,
y
:
k_Height_NavigationtBarAndStatuBar
,
width
:
KScreenWidth
,
height
:
KScreenHeight
-
k_Height_NavigationtBarAndStatuBar
-
YHFileListBottomView
.
viewH
)
make
.
top
.
equalToSuperview
()
.
offset
(
k_Height_NavigationtBarAndStatuBar
)
make
.
left
.
right
.
equalToSuperview
()
make
.
bottom
.
equalTo
(
bottomView
.
snp
.
top
)
myScrollView
.
contentSize
=
CGSize
(
width
:
KScreenWidth
,
height
:
2000
)
}
myScrollView
.
addSubview
(
headView
)
myScrollView
.
addSubview
(
headView
)
headView
.
snp
.
makeConstraints
{
make
in
headView
.
frame
=
CGRect
(
x
:
0
,
y
:
0
,
width
:
KScreenWidth
,
height
:
YHFileListHeaerView
.
viewH
)
make
.
top
.
left
.
right
.
equalToSuperview
()
make
.
height
.
equalTo
(
YHFileListHeaerView
.
viewH
)
}
myScrollView
.
addSubview
(
myContentView
)
myScrollView
.
addSubview
(
myContentView
)
myContentView
.
snp
.
makeConstraints
{
make
in
myContentView
.
snp
.
makeConstraints
{
make
in
...
@@ -149,39 +165,26 @@ extension YHFileListViewController {
...
@@ -149,39 +165,26 @@ extension YHFileListViewController {
}
}
myScrollView
.
addSubview
(
footLable
)
myScrollView
.
addSubview
(
footLable
)
footLable
.
snp
.
makeConstraints
{
make
in
make
.
top
.
equalTo
(
myContentView
.
snp
.
bottom
)
.
offset
(
29
)
make
.
left
.
equalTo
(
28
)
make
.
width
.
equalTo
(
KScreenWidth
-
2*
28
)
make
.
bottom
.
equalToSuperview
()
.
offset
(
-
41
)
}
return
}
}
func
captureScrollView
(
scrollView
:
UIScrollView
)
->
UIImage
?
{
func
captureScrollView
(
scrollView
:
UIScrollView
)
->
UIImage
?
{
var
image
:
UIImage
?
=
nil
scrollView
.
showsVerticalScrollIndicator
=
false
UIGraphicsBeginImageContextWithOptions
(
scrollView
.
contentSize
,
false
,
UIScreen
.
main
.
scale
)
let
savedContentOffset
=
scrollView
.
contentOffset
let
savedContentOffset
=
scrollView
.
contentOffset
let
savedFrame
=
scrollView
.
frame
let
savedFrame
=
scrollView
.
frame
scrollView
.
contentOffset
=
.
zero
scrollView
.
frame
=
CGRect
(
x
:
0
,
y
:
0
,
width
:
scrollView
.
contentSize
.
width
,
height
:
scrollView
.
contentSize
.
height
)
UIGraphicsBeginImageContext
(
scrollView
.
frame
.
size
)
UIGraphicsBeginImageContextWithOptions
(
CGSize
(
width
:
scrollView
.
frame
.
size
.
width
,
height
:
scrollView
.
frame
.
size
.
height
),
false
,
UIScreen
.
main
.
scale
)
scrollView
.
layer
.
render
(
in
:
UIGraphicsGetCurrentContext
()
!
)
image
=
UIGraphicsGetImageFromCurrentImageContext
()
UIGraphicsEndImageContext
()
print
(
"contentSize ==
\(
scrollView
.
contentSize
)
"
)
scrollView
.
contentOffset
=
CGPoint
.
zero
scrollView
.
frame
=
CGRect
(
x
:
0
,
y
:
0
,
width
:
scrollView
.
contentSize
.
width
,
height
:
scrollView
.
contentSize
.
height
)
scrollView
.
layer
.
render
(
in
:
UIGraphicsGetCurrentContext
()
!
)
let
image
=
UIGraphicsGetImageFromCurrentImageContext
()
scrollView
.
contentOffset
=
savedContentOffset
scrollView
.
contentOffset
=
savedContentOffset
scrollView
.
frame
=
savedFrame
scrollView
.
frame
=
savedFrame
return
image
UIGraphicsEndImageContext
()
scrollView
.
showsVerticalScrollIndicator
=
true
return
image
}
}
...
@@ -190,11 +193,21 @@ extension YHFileListViewController {
...
@@ -190,11 +193,21 @@ extension YHFileListViewController {
PHPhotoLibrary
.
requestAuthorization
{
status
in
PHPhotoLibrary
.
requestAuthorization
{
status
in
if
status
==
.
authorized
{
if
status
==
.
authorized
{
// 保存图片到相册
// 保存图片到相册
UIImageWriteToSavedPhotosAlbum
(
image
,
nil
,
nil
,
nil
)
DispatchQueue
.
main
.
sync
{
YHHUD
.
flash
(
message
:
"保存成功"
)
UIImageWriteToSavedPhotosAlbum
(
image
,
self
,
#selector(
self.image(image:didFinishSavingWithError:contextInfo:)
)
,
nil
)
}
}
else
{
}
else
{
YHHUD
.
flash
(
message
:
"
范围图库权限不足
"
)
YHHUD
.
flash
(
message
:
"
没有访问图库权限
"
)
}
}
}
}
}
}
@objc
func
image
(
image
:
UIImage
,
didFinishSavingWithError
:
NSError
?,
contextInfo
:
AnyObject
)
{
if
didFinishSavingWithError
!=
nil
{
YHHUD
.
flash
(
message
:
"保存失败"
)
return
}
YHHUD
.
flash
(
message
:
"保存成功"
)
}
}
}
galaxy/galaxy/Classes/Modules/IntelligentService(服务中心)/FileList(文件清单)/V/YHFileListBottomView.swift
View file @
ac561645
...
@@ -24,7 +24,7 @@ class YHFileListBottomView: UIView {
...
@@ -24,7 +24,7 @@ class YHFileListBottomView: UIView {
typealias
Block
=
(
Int
)
->
()
typealias
Block
=
(
Int
)
->
()
var
block
:
Block
?
var
block
:
Block
?
var
saveButton
:
UIButton
!
//
var saveButton: UIButton!
var
nextButton
:
UIButton
!
var
nextButton
:
UIButton
!
}
}
...
...
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