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
6e689919
Commit
6e689919
authored
Jul 11, 2024
by
Steven杜宇
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
// 二维码处理
parent
d96c9186
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
44 additions
and
15 deletions
+44
-15
YHHomeWebViewController.swift
.../Classes/Modules/Home(首页)/C/YHHomeWebViewController.swift
+2
-1
YHWebModel.swift
galaxy/galaxy/Classes/Modules/Home(首页)/M/YHWebModel.swift
+1
-0
YHConsultantQRCodeView.swift
...y/Classes/Modules/Home(首页)/V/YHConsultantQRCodeView.swift
+21
-7
YHAboutGalaxyViewController.swift
...sses/Modules/Mine(我的)/C/YHAboutGalaxyViewController.swift
+20
-7
No files found.
galaxy/galaxy/Classes/Modules/Home(首页)/C/YHHomeWebViewController.swift
View file @
6e689919
...
...
@@ -453,7 +453,8 @@ class YHHomeWebViewController: YHBaseViewController, WKUIDelegate, WKNavigationD
@objc
func
didConsultViewTapped
()
{
let
codeUrl
=
self
.
viewModel
.
mainModel
?
.
clue_classify_img_url
??
""
YHConsultantQRCodeView
.
codeView
(
codeUrl
)
.
show
()
let
downloadUrl
=
self
.
viewModel
.
mainModel
?
.
clue_classify_img_url_download
??
""
YHConsultantQRCodeView
.
codeView
(
codeUrl
,
downloadUrl
:
downloadUrl
)
.
show
()
}
@objc
func
loginSuccess
()
{
...
...
galaxy/galaxy/Classes/Modules/Home(首页)/M/YHWebModel.swift
View file @
6e689919
...
...
@@ -19,4 +19,5 @@ class YHWebModel: YHBaseModel {
var
title
:
String
=
""
var
img_url
:
String
=
""
var
clue_classify_img_url
=
""
var
clue_classify_img_url_download
=
""
}
galaxy/galaxy/Classes/Modules/Home(首页)/V/YHConsultantQRCodeView.swift
View file @
6e689919
...
...
@@ -14,13 +14,21 @@ class YHConsultantQRCodeView: UIView {
var
codeUrl
:
String
=
""
{
didSet
{
if
!
codeUrl
.
isEmpty
{
self
.
qrCodeImgView
.
kf
.
setImage
(
with
:
URL
(
string
:
codeUrl
),
placeholder
:
UIImage
(
named
:
"global_default_image"
))
{
result
in
self
.
qrCodeImgView
.
kf
.
setImage
(
with
:
URL
(
string
:
codeUrl
),
placeholder
:
UIImage
(
named
:
"global_default_image"
))
}
}
}
var
downloadUrl
:
String
=
""
{
didSet
{
if
!
downloadUrl
.
isEmpty
{
self
.
downloadCodeImgView
.
kf
.
setImage
(
with
:
URL
(
string
:
downloadUrl
))
{
result
in
switch
result
{
case
.
success
(
let
value
):
self
.
c
odeImage
=
value
.
image
self
.
downloadC
odeImage
=
value
.
image
self
.
saveBtn
.
alpha
=
1.0
self
.
saveBtn
.
isUserInteractionEnabled
=
true
case
.
failure
(
let
value
):
self
.
saveBtn
.
alpha
=
0.3
self
.
saveBtn
.
isUserInteractionEnabled
=
false
...
...
@@ -30,7 +38,7 @@ class YHConsultantQRCodeView: UIView {
}
}
var
c
odeImage
:
UIImage
?
=
nil
var
downloadC
odeImage
:
UIImage
?
=
nil
// 底层蒙版
lazy
var
blackMaskView
:
UIView
=
{
let
view
=
UIView
()
...
...
@@ -67,6 +75,11 @@ class YHConsultantQRCodeView: UIView {
return
view
}()
lazy
var
downloadCodeImgView
:
UIImageView
=
{
let
view
=
UIImageView
()
return
view
}()
lazy
var
saveBtn
:
UIButton
=
{
let
button
=
UIButton
()
button
.
titleLabel
?
.
font
=
UIFont
.
PFSC_M
(
ofSize
:
14
)
...
...
@@ -96,9 +109,10 @@ class YHConsultantQRCodeView: UIView {
createUI
()
}
static
func
codeView
(
_
url
:
String
)
->
YHConsultantQRCodeView
{
static
func
codeView
(
_
url
:
String
,
downloadUrl
:
String
)
->
YHConsultantQRCodeView
{
let
alertView
=
YHConsultantQRCodeView
(
frame
:
UIScreen
.
main
.
bounds
)
alertView
.
codeUrl
=
url
alertView
.
downloadUrl
=
downloadUrl
return
alertView
}
...
...
@@ -163,7 +177,7 @@ class YHConsultantQRCodeView: UIView {
}
@objc
func
didSaveQRCodeBtnClicked
()
{
if
let
img
=
self
.
c
odeImage
{
if
let
img
=
self
.
downloadC
odeImage
{
self
.
saveImage
(
img
)
}
}
...
...
@@ -171,7 +185,7 @@ class YHConsultantQRCodeView: UIView {
@objc
func
didCloseBtnClicked
()
{
self
.
dismiss
()
}
func
saveImage
(
_
image
:
UIImage
)
{
// 确保应用有权访问相册
PHPhotoLibrary
.
requestAuthorization
{
status
in
...
...
galaxy/galaxy/Classes/Modules/Mine(我的)/C/YHAboutGalaxyViewController.swift
View file @
6e689919
...
...
@@ -60,11 +60,17 @@ class YHAboutGalaxyViewController: YHBaseViewController {
lazy
var
detailLabel
=
{
var
label
=
UILabel
()
label
.
text
=
"专注海外服务17年,总部设立在深圳,现已分别在北京、上海、广州等地建立分公司,立足于香港身份规划服务,业务逐步多元化发展。"
.
local
// label.text = "专注海外服务17年,总部设立在深圳,现已分别在北京、上海、广州等地建立分公司,立足于香港身份规划服务,业务逐步多元化发展。"
label
.
textColor
=
UIColor
.
white
label
.
textAlignment
=
NSTextAlignment
.
left
label
.
font
=
UIFont
.
PFSC_R
(
ofSize
:
1
2
)
label
.
font
=
UIFont
.
PFSC_R
(
ofSize
:
1
3
)
label
.
numberOfLines
=
0
label
.
lineBreakMode
=
.
byTruncatingTail
let
paragraphStyle
=
NSMutableParagraphStyle
()
paragraphStyle
.
lineSpacing
=
5.0
// 设置行间距
let
attributedString
=
NSMutableAttributedString
(
string
:
"专注海外服务17年,总部设立在深圳,现已分别在北京、上海、广州等地建立分公司,立足于香港身份规划服务,业务逐步多元化发展。"
.
local
)
attributedString
.
addAttribute
(
.
paragraphStyle
,
value
:
paragraphStyle
,
range
:
NSRange
(
location
:
0
,
length
:
attributedString
.
length
))
label
.
attributedText
=
attributedString
return
label
}()
...
...
@@ -202,14 +208,21 @@ extension YHAboutGalaxyViewController : UITableViewDelegate, UITableViewDataSour
}
func
scrollViewDidScroll
(
_
scrollView
:
UIScrollView
)
{
if
scrollView
.
contentOffset
.
y
>=
12.5
{
self
.
navBar
.
backgroundColor
=
.
white
self
.
statusBar
.
backgroundColor
=
.
white
printLog
(
"
\(
scrollView
.
contentOffset
.
y
)
"
)
var
alpha
=
scrollView
.
contentOffset
.
y
/
k_Height_NavigationtBarAndStatuBar
if
alpha
>
1.0
{
alpha
=
1.0
}
else
if
alpha
<
0.0
{
alpha
=
0.0
}
self
.
navBar
.
backgroundColor
=
UIColor
.
init
(
hex
:
0xFFFFFF
,
alpha
:
alpha
)
self
.
statusBar
.
backgroundColor
=
UIColor
.
init
(
hex
:
0xFFFFFF
,
alpha
:
alpha
)
if
scrollView
.
contentOffset
.
y
>=
0
{
self
.
navBar
.
backButton
.
setImage
(
UIImage
(
named
:
"back_icon"
),
for
:
.
normal
)
}
else
{
self
.
navBar
.
backgroundColor
=
.
clear
self
.
statusBar
.
backgroundColor
=
.
clear
self
.
navBar
.
backButton
.
setImage
(
UIImage
(
named
:
"back_icon_for_code_input"
),
for
:
.
normal
)
}
}
...
...
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