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
219de0e9
Commit
219de0e9
authored
Jul 09, 2024
by
pete谢兆麟
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
保存图片逻辑兼容
parent
48bce148
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
62 additions
and
5 deletions
+62
-5
YHHKEventWebViewController.swift
...asses/Modules/Home(首页)/C/YHHKEventWebViewController.swift
+11
-3
YHHomeWebViewBottomForSavePicView.swift
...odules/Home(首页)/V/YHHomeWebViewBottomForSavePicView.swift
+51
-2
No files found.
galaxy/galaxy/Classes/Modules/Home(首页)/C/YHHKEventWebViewController.swift
View file @
219de0e9
...
@@ -26,8 +26,8 @@ class YHHKEventWebViewController: YHBaseViewController {
...
@@ -26,8 +26,8 @@ class YHHKEventWebViewController: YHBaseViewController {
// loadData()
// loadData()
}
}
lazy
var
bottomViewForSavePic
:
YH
Home
WebViewBottomForSavePicView
=
{
lazy
var
bottomViewForSavePic
:
YHWebViewBottomForSavePicView
=
{
let
view
=
YH
Home
WebViewBottomForSavePicView
()
let
view
=
YHWebViewBottomForSavePicView
()
view
.
isHidden
=
true
view
.
isHidden
=
true
return
view
return
view
}()
}()
...
@@ -47,7 +47,7 @@ extension YHHKEventWebViewController {
...
@@ -47,7 +47,7 @@ extension YHHKEventWebViewController {
if
model
.
tag
.
contains
(
"日历"
)
{
if
model
.
tag
.
contains
(
"日历"
)
{
picUrl
=
urlString
picUrl
=
urlString
bottomViewForSavePic
.
isHidden
=
false
//
bottomViewForSavePic.isHidden = false
// 创建wkwebview
// 创建wkwebview
webview
.
frame
=
CGRect
(
x
:
0
,
y
:
0
,
width
:
self
.
view
.
frame
.
width
,
height
:
self
.
view
.
frame
.
height
-
YHHomeWebViewBottomForSavePicView
.
viewH
-
55
-
k_Height_NavigationtBarAndStatuBar
)
webview
.
frame
=
CGRect
(
x
:
0
,
y
:
0
,
width
:
self
.
view
.
frame
.
width
,
height
:
self
.
view
.
frame
.
height
-
YHHomeWebViewBottomForSavePicView
.
viewH
-
55
-
k_Height_NavigationtBarAndStatuBar
)
...
@@ -62,6 +62,7 @@ extension YHHKEventWebViewController {
...
@@ -62,6 +62,7 @@ extension YHHKEventWebViewController {
// 创建wkwebview
// 创建wkwebview
webview
=
WKWebView
(
frame
:
CGRect
(
x
:
0
,
y
:
0
,
width
:
self
.
view
.
frame
.
width
,
height
:
self
.
view
.
frame
.
height
-
0
))
webview
=
WKWebView
(
frame
:
CGRect
(
x
:
0
,
y
:
0
,
width
:
self
.
view
.
frame
.
width
,
height
:
self
.
view
.
frame
.
height
-
0
))
webview
.
navigationDelegate
=
self
// 添加wkwebview
// 添加wkwebview
view
.
addSubview
(
webview
)
view
.
addSubview
(
webview
)
...
@@ -76,6 +77,13 @@ extension YHHKEventWebViewController {
...
@@ -76,6 +77,13 @@ extension YHHKEventWebViewController {
}
}
}
}
extension
YHHKEventWebViewController
:
WKNavigationDelegate
{
func
webView
(
_
webView
:
WKWebView
,
didFinish
navigation
:
WKNavigation
!
)
{
if
model
.
tag
.
contains
(
"日历"
)
{
bottomViewForSavePic
.
isHidden
=
false
}
}
}
extension
YHHKEventWebViewController
{
extension
YHHKEventWebViewController
{
func
saveImageToPhotoLib
()
{
func
saveImageToPhotoLib
()
{
...
...
galaxy/galaxy/Classes/Modules/Home(首页)/V/YHHomeWebViewBottomForSavePicView.swift
View file @
219de0e9
...
@@ -8,7 +8,7 @@
...
@@ -8,7 +8,7 @@
import
UIKit
import
UIKit
class
YH
Home
WebViewBottomForSavePicView
:
UIView
{
class
YHWebViewBottomForSavePicView
:
UIView
{
static
let
viewH
:
CGFloat
=
98.0
static
let
viewH
:
CGFloat
=
98.0
override
init
(
frame
:
CGRect
)
{
override
init
(
frame
:
CGRect
)
{
...
@@ -27,7 +27,7 @@ class YHHomeWebViewBottomForSavePicView: UIView {
...
@@ -27,7 +27,7 @@ class YHHomeWebViewBottomForSavePicView: UIView {
var
saveButton
:
UIButton
!
var
saveButton
:
UIButton
!
}
}
private
extension
YH
Home
WebViewBottomForSavePicView
{
private
extension
YHWebViewBottomForSavePicView
{
func
setupUI
()
{
func
setupUI
()
{
backgroundColor
=
UIColor
(
hex
:
0x00634A
)
backgroundColor
=
UIColor
(
hex
:
0x00634A
)
saveButton
=
{
saveButton
=
{
...
@@ -48,3 +48,52 @@ private extension YHHomeWebViewBottomForSavePicView {
...
@@ -48,3 +48,52 @@ private extension YHHomeWebViewBottomForSavePicView {
block
?(
0
)
block
?(
0
)
}
}
}
}
class
YHHomeWebViewBottomForSavePicView
:
UIView
{
static
let
viewH
:
CGFloat
=
98.0
override
init
(
frame
:
CGRect
)
{
super
.
init
(
frame
:
CGRect
(
x
:
0
,
y
:
0
,
width
:
KScreenWidth
,
height
:
YHBasicInfoFillBottomView
.
viewH
))
setupUI
()
}
required
init
?(
coder
:
NSCoder
)
{
fatalError
(
"init(coder:) has not been implemented"
)
}
typealias
Block
=
(
Int
)
->
()
var
block
:
Block
?
var
saveButton
:
UIButton
!
}
private
extension
YHHomeWebViewBottomForSavePicView
{
func
setupUI
()
{
backgroundColor
=
.
white
saveButton
=
{
let
button
=
UIButton
(
type
:
.
custom
)
button
.
backgroundColor
=
UIColor
.
contentBkgColor
button
.
titleLabel
?
.
font
=
UIFont
.
PFSC_M
(
ofSize
:
15
)
button
.
contentHorizontalAlignment
=
.
center
button
.
setTitle
(
"保存到相册"
,
for
:
.
normal
)
button
.
setTitleColor
(
UIColor
.
brandMainColor
,
for
:
.
normal
)
button
.
layer
.
cornerRadius
=
kCornerRadius3
button
.
layer
.
borderWidth
=
0.5
button
.
layer
.
borderColor
=
UIColor
.
brandMainColor
.
cgColor
button
.
addTarget
(
self
,
action
:
#selector(
save
)
,
for
:
.
touchUpInside
)
return
button
}()
addSubview
(
saveButton
)
saveButton
.
snp
.
makeConstraints
{
make
in
make
.
left
.
equalTo
(
kMargin
)
make
.
right
.
equalTo
(
-
kMargin
)
make
.
top
.
equalTo
(
12
)
make
.
height
.
equalTo
(
44
)
}
}
@objc
func
save
()
{
block
?(
0
)
}
}
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