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
4e278faa
Commit
4e278faa
authored
Mar 11, 2024
by
Steven杜宇
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
// sheetView
parent
831653eb
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
40 additions
and
7 deletions
+40
-7
YHCertificateUploadSheetView.swift
...MyCertificates(我的证书)/V/YHCertificateUploadSheetView.swift
+40
-7
No files found.
galaxy/galaxy/Classes/Modules/IntelligentService(服务中心)/ServiceProcess(流程)/MyCertificates(我的证书)/V/YHCertificateUploadSheetView.swift
View file @
4e278faa
...
@@ -5,21 +5,33 @@
...
@@ -5,21 +5,33 @@
// Created by edy on 2024/3/11.
// Created by edy on 2024/3/11.
// Copyright © 2024 https://www.galaxy-immi.com. All rights reserved.
// Copyright © 2024 https://www.galaxy-immi.com. All rights reserved.
//
//
/*
【Usage】
YHCertificateUploadSheetView.sheetView.show {
[weak self] actionType in
guard let self = self else { return }
print("%d", actionType.rawValue)
}
*/
import
UIKit
import
UIKit
enum
YHCertificateUploadType
:
Int
{
enum
YHCertificateActionType
:
Int
{
case
phoneFile
=
1
case
sample
=
1
case
camera
=
2
case
camera
=
2
case
photo
=
3
case
photo
=
3
case
cancel
=
4
case
phoneFile
=
4
case
cancel
=
5
}
}
class
YHCertificateUploadItem
{
class
YHCertificateUploadItem
{
var
type
:
YHCertificate
Upload
Type
var
type
:
YHCertificate
Action
Type
var
title
:
String
var
title
:
String
var
subtitle
:
String
var
subtitle
:
String
init
(
type
:
YHCertificate
Upload
Type
,
title
:
String
,
subtitle
:
String
=
""
)
{
init
(
type
:
YHCertificate
Action
Type
,
title
:
String
,
subtitle
:
String
=
""
)
{
self
.
type
=
type
self
.
type
=
type
self
.
title
=
title
self
.
title
=
title
self
.
subtitle
=
subtitle
self
.
subtitle
=
subtitle
...
@@ -63,10 +75,12 @@ class YHCertificateUploadItemView: UIView {
...
@@ -63,10 +75,12 @@ class YHCertificateUploadItemView: UIView {
func
createUI
()
{
func
createUI
()
{
self
.
tag
=
self
.
item
.
type
.
rawValue
self
.
addSubview
(
titleLabel
)
self
.
addSubview
(
titleLabel
)
self
.
addSubview
(
subTitleLabel
)
self
.
addSubview
(
subTitleLabel
)
self
.
addSubview
(
topLine
)
self
.
addSubview
(
topLine
)
titleLabel
.
text
=
item
.
title
titleLabel
.
text
=
item
.
title
subTitleLabel
.
text
=
item
.
subtitle
subTitleLabel
.
text
=
item
.
subtitle
subTitleLabel
.
isHidden
=
item
.
subtitle
.
isEmpty
subTitleLabel
.
isHidden
=
item
.
subtitle
.
isEmpty
...
@@ -162,6 +176,7 @@ class YHCertificateUploadSheetView: UIView {
...
@@ -162,6 +176,7 @@ class YHCertificateUploadSheetView: UIView {
static
let
sheetView
=
YHCertificateUploadSheetView
(
frame
:
UIScreen
.
main
.
bounds
)
static
let
sheetView
=
YHCertificateUploadSheetView
(
frame
:
UIScreen
.
main
.
bounds
)
var
action
:((
YHCertificateActionType
)
->
())?
lazy
var
blackMaskView
:
UIView
=
{
lazy
var
blackMaskView
:
UIView
=
{
let
view
=
UIView
()
let
view
=
UIView
()
view
.
backgroundColor
=
UIColor
(
hex
:
0x0F1214
,
alpha
:
0.5
)
view
.
backgroundColor
=
UIColor
(
hex
:
0x0F1214
,
alpha
:
0.5
)
...
@@ -233,9 +248,12 @@ class YHCertificateUploadSheetView: UIView {
...
@@ -233,9 +248,12 @@ class YHCertificateUploadSheetView: UIView {
lazy
var
templateView
:
YHCertificateSampleTemplateView
=
{
lazy
var
templateView
:
YHCertificateSampleTemplateView
=
{
let
view
=
YHCertificateSampleTemplateView
(
frame
:
CGRectZero
)
let
view
=
YHCertificateSampleTemplateView
(
frame
:
CGRectZero
)
view
.
tag
=
YHCertificateActionType
.
sample
.
rawValue
view
.
backgroundColor
=
.
contentBkgColor
view
.
backgroundColor
=
.
contentBkgColor
view
.
layer
.
cornerRadius
=
6.0
view
.
layer
.
cornerRadius
=
6.0
view
.
clipsToBounds
=
true
view
.
clipsToBounds
=
true
let
tap
=
UITapGestureRecognizer
(
target
:
self
,
action
:
#selector(
action(_:)
)
)
view
.
addGestureRecognizer
(
tap
)
return
view
return
view
}()
}()
...
@@ -249,6 +267,7 @@ class YHCertificateUploadSheetView: UIView {
...
@@ -249,6 +267,7 @@ class YHCertificateUploadSheetView: UIView {
}
}
func
createUI
()
{
func
createUI
()
{
self
.
addSubview
(
blackMaskView
)
self
.
addSubview
(
blackMaskView
)
self
.
addSubview
(
whiteContentView
)
self
.
addSubview
(
whiteContentView
)
whiteContentView
.
addSubview
(
topView
)
whiteContentView
.
addSubview
(
topView
)
...
@@ -259,6 +278,8 @@ class YHCertificateUploadSheetView: UIView {
...
@@ -259,6 +278,8 @@ class YHCertificateUploadSheetView: UIView {
let
itemView2
=
YHCertificateUploadItemView
(
YHCertificateUploadItem
(
type
:
.
photo
,
title
:
"相册上传"
))
let
itemView2
=
YHCertificateUploadItemView
(
YHCertificateUploadItem
(
type
:
.
photo
,
title
:
"相册上传"
))
let
itemView3
=
YHCertificateUploadItemView
(
YHCertificateUploadItem
(
type
:
.
phoneFile
,
title
:
"手机文件上传"
,
subtitle
:
"从手机文件管理中上传"
))
let
itemView3
=
YHCertificateUploadItemView
(
YHCertificateUploadItem
(
type
:
.
phoneFile
,
title
:
"手机文件上传"
,
subtitle
:
"从手机文件管理中上传"
))
let
itemView4
=
YHCertificateUploadItemView
(
YHCertificateUploadItem
(
type
:
.
cancel
,
title
:
"取消"
))
let
itemView4
=
YHCertificateUploadItemView
(
YHCertificateUploadItem
(
type
:
.
cancel
,
title
:
"取消"
))
let
itemViewArr
=
[
itemView1
,
itemView2
,
itemView3
,
itemView4
]
let
itemViewArr
=
[
itemView1
,
itemView2
,
itemView3
,
itemView4
]
whiteContentView
.
addSubviews
(
itemViewArr
)
whiteContentView
.
addSubviews
(
itemViewArr
)
...
@@ -295,6 +316,8 @@ class YHCertificateUploadSheetView: UIView {
...
@@ -295,6 +316,8 @@ class YHCertificateUploadSheetView: UIView {
}
}
for
(
index
,
itemView
)
in
itemViewArr
.
enumerated
()
{
for
(
index
,
itemView
)
in
itemViewArr
.
enumerated
()
{
let
tap
=
UITapGestureRecognizer
(
target
:
self
,
action
:
#selector(
action(_:)
)
)
itemView
.
addGestureRecognizer
(
tap
)
itemView
.
snp
.
makeConstraints
{
make
in
itemView
.
snp
.
makeConstraints
{
make
in
make
.
left
.
right
.
equalToSuperview
()
make
.
left
.
right
.
equalToSuperview
()
make
.
top
.
equalTo
(
templateView
.
snp
.
bottom
)
.
offset
(
20
+
index
*
52
)
make
.
top
.
equalTo
(
templateView
.
snp
.
bottom
)
.
offset
(
20
+
index
*
52
)
...
@@ -306,7 +329,8 @@ class YHCertificateUploadSheetView: UIView {
...
@@ -306,7 +329,8 @@ class YHCertificateUploadSheetView: UIView {
extension
YHCertificateUploadSheetView
{
extension
YHCertificateUploadSheetView
{
func
show
()
{
func
show
(
_
action
:((
YHCertificateActionType
)
->
())?)
{
self
.
action
=
action
UIApplication
.
shared
.
yhKeyWindow
()?
.
addSubview
(
self
)
UIApplication
.
shared
.
yhKeyWindow
()?
.
addSubview
(
self
)
}
}
...
@@ -314,5 +338,14 @@ extension YHCertificateUploadSheetView {
...
@@ -314,5 +338,14 @@ extension YHCertificateUploadSheetView {
self
.
removeFromSuperview
()
self
.
removeFromSuperview
()
}
}
@objc
func
action
(
_
sender
:
UITapGestureRecognizer
)
{
if
let
targetView
=
sender
.
view
{
let
tag
=
targetView
.
tag
if
let
type
=
YHCertificateActionType
(
rawValue
:
tag
),
let
action
=
action
{
action
(
type
)
}
}
}
}
}
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