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
c06f990d
Commit
c06f990d
authored
Mar 13, 2024
by
Steven杜宇
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
// 重命名View
parent
f5186503
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
525 additions
and
9 deletions
+525
-9
project.pbxproj
galaxy/galaxy.xcodeproj/project.pbxproj
+9
-1
YHUploadContentVC.swift
...rocess(流程)/MyCertificates(我的证书)/C/YHUploadContentVC.swift
+90
-1
YHCertificateEditSheetView.swift
...)/MyCertificates(我的证书)/V/YHCertificateEditSheetView.swift
+221
-0
YHCertificateUploadSheetView.swift
...MyCertificates(我的证书)/V/YHCertificateUploadSheetView.swift
+7
-7
YHFileRenameInputView.swift
...ss(流程)/MyCertificates(我的证书)/V/YHFileRenameInputView.swift
+198
-0
No files found.
galaxy/galaxy.xcodeproj/project.pbxproj
View file @
c06f990d
...
@@ -201,6 +201,8 @@
...
@@ -201,6 +201,8 @@
04A671592B9F18C800C1FB91
/* YHCertificateUploadSheetView.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
04A671582B9F18C800C1FB91
/* YHCertificateUploadSheetView.swift */
;
};
04A671592B9F18C800C1FB91
/* YHCertificateUploadSheetView.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
04A671582B9F18C800C1FB91
/* YHCertificateUploadSheetView.swift */
;
};
04A6715C2B9FE9EA00C1FB91
/* YHUploadContentVC.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
04A6715B2B9FE9EA00C1FB91
/* YHUploadContentVC.swift */
;
};
04A6715C2B9FE9EA00C1FB91
/* YHUploadContentVC.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
04A6715B2B9FE9EA00C1FB91
/* YHUploadContentVC.swift */
;
};
04A6715E2B9FFCA700C1FB91
/* YHCertificateInfoCell.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
04A6715D2B9FFCA700C1FB91
/* YHCertificateInfoCell.swift */
;
};
04A6715E2B9FFCA700C1FB91
/* YHCertificateInfoCell.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
04A6715D2B9FFCA700C1FB91
/* YHCertificateInfoCell.swift */
;
};
04A671602BA0280800C1FB91
/* YHFileRenameInputView.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
04A6715F2BA0280800C1FB91
/* YHFileRenameInputView.swift */
;
};
04A671622BA058DE00C1FB91
/* YHCertificateEditSheetView.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
04A671612BA058DE00C1FB91
/* YHCertificateEditSheetView.swift */
;
};
04A7BC912B6B7B89000E8D47
/* YHTwoOptionAlertView.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
04A7BC902B6B7B89000E8D47
/* YHTwoOptionAlertView.swift */
;
};
04A7BC912B6B7B89000E8D47
/* YHTwoOptionAlertView.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
04A7BC902B6B7B89000E8D47
/* YHTwoOptionAlertView.swift */
;
};
04AF58C42B4FC51C0066011A
/* YHLocalizable.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
04AF58C32B4FC51C0066011A
/* YHLocalizable.swift */
;
};
04AF58C42B4FC51C0066011A
/* YHLocalizable.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
04AF58C32B4FC51C0066011A
/* YHLocalizable.swift */
;
};
04C693622B723AB8004C1758
/* YHMySettingViewController.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
04C693612B723AB8004C1758
/* YHMySettingViewController.swift */
;
};
04C693622B723AB8004C1758
/* YHMySettingViewController.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
04C693612B723AB8004C1758
/* YHMySettingViewController.swift */
;
};
...
@@ -534,6 +536,8 @@
...
@@ -534,6 +536,8 @@
04A671582B9F18C800C1FB91
/* YHCertificateUploadSheetView.swift */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.swift
;
path
=
YHCertificateUploadSheetView.swift
;
sourceTree
=
"<group>"
;
};
04A671582B9F18C800C1FB91
/* YHCertificateUploadSheetView.swift */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.swift
;
path
=
YHCertificateUploadSheetView.swift
;
sourceTree
=
"<group>"
;
};
04A6715B2B9FE9EA00C1FB91
/* YHUploadContentVC.swift */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
sourcecode.swift
;
path
=
YHUploadContentVC.swift
;
sourceTree
=
"<group>"
;
};
04A6715B2B9FE9EA00C1FB91
/* YHUploadContentVC.swift */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
sourcecode.swift
;
path
=
YHUploadContentVC.swift
;
sourceTree
=
"<group>"
;
};
04A6715D2B9FFCA700C1FB91
/* YHCertificateInfoCell.swift */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
sourcecode.swift
;
path
=
YHCertificateInfoCell.swift
;
sourceTree
=
"<group>"
;
};
04A6715D2B9FFCA700C1FB91
/* YHCertificateInfoCell.swift */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
sourcecode.swift
;
path
=
YHCertificateInfoCell.swift
;
sourceTree
=
"<group>"
;
};
04A6715F2BA0280800C1FB91
/* YHFileRenameInputView.swift */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
sourcecode.swift
;
path
=
YHFileRenameInputView.swift
;
sourceTree
=
"<group>"
;
};
04A671612BA058DE00C1FB91
/* YHCertificateEditSheetView.swift */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
sourcecode.swift
;
path
=
YHCertificateEditSheetView.swift
;
sourceTree
=
"<group>"
;
};
04A7BC902B6B7B89000E8D47
/* YHTwoOptionAlertView.swift */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
sourcecode.swift
;
path
=
YHTwoOptionAlertView.swift
;
sourceTree
=
"<group>"
;
};
04A7BC902B6B7B89000E8D47
/* YHTwoOptionAlertView.swift */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
sourcecode.swift
;
path
=
YHTwoOptionAlertView.swift
;
sourceTree
=
"<group>"
;
};
04AF58C32B4FC51C0066011A
/* YHLocalizable.swift */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
sourcecode.swift
;
path
=
YHLocalizable.swift
;
sourceTree
=
"<group>"
;
};
04AF58C32B4FC51C0066011A
/* YHLocalizable.swift */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
sourcecode.swift
;
path
=
YHLocalizable.swift
;
sourceTree
=
"<group>"
;
};
04C693612B723AB8004C1758
/* YHMySettingViewController.swift */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
sourcecode.swift
;
path
=
YHMySettingViewController.swift
;
sourceTree
=
"<group>"
;
};
04C693612B723AB8004C1758
/* YHMySettingViewController.swift */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
sourcecode.swift
;
path
=
YHMySettingViewController.swift
;
sourceTree
=
"<group>"
;
};
...
@@ -1121,10 +1125,10 @@
...
@@ -1121,10 +1125,10 @@
045EEE3D2B9F171A0022A143
/* V */
=
{
045EEE3D2B9F171A0022A143
/* V */
=
{
isa
=
PBXGroup
;
isa
=
PBXGroup
;
children
=
(
children
=
(
045EEE412B9F171A0022A143
/* PickerView */
,
045EEE3E2B9F171A0022A143
/* YHFormItemAddCell.swift */
,
045EEE3E2B9F171A0022A143
/* YHFormItemAddCell.swift */
,
045EEE3F2B9F171A0022A143
/* YHFormItemOnlyDoubleChoiceCell.swift */
,
045EEE3F2B9F171A0022A143
/* YHFormItemOnlyDoubleChoiceCell.swift */
,
045EEE402B9F171A0022A143
/* YHFormItemTitleCell.swift */
,
045EEE402B9F171A0022A143
/* YHFormItemTitleCell.swift */
,
045EEE412B9F171A0022A143
/* PickerView */
,
045EEE462B9F171A0022A143
/* YHFormItemInputTextCell.swift */
,
045EEE462B9F171A0022A143
/* YHFormItemInputTextCell.swift */
,
045EEE472B9F171A0022A143
/* YHSaveAndSubmitView.swift */
,
045EEE472B9F171A0022A143
/* YHSaveAndSubmitView.swift */
,
045EEE482B9F171A0022A143
/* YHFormItemEnterDetailCell.swift */
,
045EEE482B9F171A0022A143
/* YHFormItemEnterDetailCell.swift */
,
...
@@ -1320,6 +1324,8 @@
...
@@ -1320,6 +1324,8 @@
isa
=
PBXGroup
;
isa
=
PBXGroup
;
children
=
(
children
=
(
04A671582B9F18C800C1FB91
/* YHCertificateUploadSheetView.swift */
,
04A671582B9F18C800C1FB91
/* YHCertificateUploadSheetView.swift */
,
04A671612BA058DE00C1FB91
/* YHCertificateEditSheetView.swift */
,
04A6715F2BA0280800C1FB91
/* YHFileRenameInputView.swift */
,
04A6715D2B9FFCA700C1FB91
/* YHCertificateInfoCell.swift */
,
04A6715D2B9FFCA700C1FB91
/* YHCertificateInfoCell.swift */
,
);
);
path
=
V
;
path
=
V
;
...
@@ -2081,6 +2087,7 @@
...
@@ -2081,6 +2087,7 @@
045EEEAE2B9F171A0022A143
/* YHWorkHighlightsTableViewCell.swift in Sources */
,
045EEEAE2B9F171A0022A143
/* YHWorkHighlightsTableViewCell.swift in Sources */
,
045EEF062B9F171A0022A143
/* YHFormItemQuestionsCell.swift in Sources */
,
045EEF062B9F171A0022A143
/* YHFormItemQuestionsCell.swift in Sources */
,
0468D4242B494BEA00CFB916
/* YHCodeResultViewController.swift in Sources */
,
0468D4242B494BEA00CFB916
/* YHCodeResultViewController.swift in Sources */
,
04A671602BA0280800C1FB91
/* YHFileRenameInputView.swift in Sources */
,
A5ACE93F2B4564F7002C94D2
/* UIViewController+Extension.swift in Sources */
,
A5ACE93F2B4564F7002C94D2
/* UIViewController+Extension.swift in Sources */
,
045EEF082B9F171A0022A143
/* YHBasicInfoCellModel.swift in Sources */
,
045EEF082B9F171A0022A143
/* YHBasicInfoCellModel.swift in Sources */
,
A5ACE9472B4564F7002C94D2
/* YHHUD.swift in Sources */
,
A5ACE9472B4564F7002C94D2
/* YHHUD.swift in Sources */
,
...
@@ -2162,6 +2169,7 @@
...
@@ -2162,6 +2169,7 @@
045EEECB2B9F171A0022A143
/* YHScoreResultBaseModel.swift in Sources */
,
045EEECB2B9F171A0022A143
/* YHScoreResultBaseModel.swift in Sources */
,
045EEEA62B9F171A0022A143
/* YHCompanySelectViewController.swift in Sources */
,
045EEEA62B9F171A0022A143
/* YHCompanySelectViewController.swift in Sources */
,
045EEEA92B9F171A0022A143
/* YHWorkExperienceListViewController.swift in Sources */
,
045EEEA92B9F171A0022A143
/* YHWorkExperienceListViewController.swift in Sources */
,
04A671622BA058DE00C1FB91
/* YHCertificateEditSheetView.swift in Sources */
,
A5ACE9432B4564F7002C94D2
/* UILable+Extension.swift in Sources */
,
A5ACE9432B4564F7002C94D2
/* UILable+Extension.swift in Sources */
,
045EEE882B9F171A0022A143
/* YHPreviewAcademicAndProfessionalQualificationViewController.swift in Sources */
,
045EEE882B9F171A0022A143
/* YHPreviewAcademicAndProfessionalQualificationViewController.swift in Sources */
,
A5ACE9382B4564F7002C94D2
/* UIApplication+Extension.swift in Sources */
,
A5ACE9382B4564F7002C94D2
/* UIApplication+Extension.swift in Sources */
,
...
...
galaxy/galaxy/Classes/Modules/IntelligentService(服务中心)/ServiceProcess(流程)/MyCertificates(我的证书)/C/YHUploadContentVC.swift
View file @
c06f990d
...
@@ -7,10 +7,29 @@
...
@@ -7,10 +7,29 @@
//
//
import
UIKit
import
UIKit
import
IQKeyboardManagerSwift
class
YHUploadContentVC
:
YHBaseViewController
{
class
YHUploadContentVC
:
YHBaseViewController
{
var
items
:[
String
]
=
[
"1"
,
"2"
,
"2"
,
"2"
,
"2"
,
"2"
,
"2"
,
"2"
]
var
items
:[
String
]
=
[
"1"
,
"2"
,
"2"
,
"2"
,
"2"
,
"2"
,
"2"
,
"2"
]
var
renameInputView
:
YHFileRenameInputView
=
{
let
view
=
YHFileRenameInputView
.
inputView
(
defalutText
:
"adfasfsf"
,
editBlock
:
{
text
in
print
(
"
\(
text
)
"
)
})
return
view
}()
lazy
var
blackMaskView
:
UIView
=
{
let
view
=
UIView
(
frame
:
UIScreen
.
main
.
bounds
)
view
.
backgroundColor
=
UIColor
(
hex
:
0x0F1214
,
alpha
:
0.5
)
let
tap
=
UITapGestureRecognizer
(
target
:
self
,
action
:
#selector(
dismissed
)
)
view
.
addGestureRecognizer
(
tap
)
view
.
isHidden
=
true
return
view
}()
lazy
var
tableView
:
UITableView
=
{
lazy
var
tableView
:
UITableView
=
{
let
tableView
=
UITableView
(
frame
:
.
zero
,
style
:
.
grouped
)
let
tableView
=
UITableView
(
frame
:
.
zero
,
style
:
.
grouped
)
...
@@ -25,7 +44,6 @@ class YHUploadContentVC: YHBaseViewController {
...
@@ -25,7 +44,6 @@ class YHUploadContentVC: YHBaseViewController {
tableView
.
dataSource
=
self
tableView
.
dataSource
=
self
tableView
.
register
(
UITableViewCell
.
self
,
forCellReuseIdentifier
:
"UITableViewCell"
)
tableView
.
register
(
UITableViewCell
.
self
,
forCellReuseIdentifier
:
"UITableViewCell"
)
tableView
.
register
(
YHCertificateInfoCell
.
self
,
forCellReuseIdentifier
:
YHCertificateInfoCell
.
cellReuseIdentifier
)
tableView
.
register
(
YHCertificateInfoCell
.
self
,
forCellReuseIdentifier
:
YHCertificateInfoCell
.
cellReuseIdentifier
)
let
size
=
headView
.
systemLayoutSizeFitting
(
UIView
.
layoutFittingCompressedSize
)
let
size
=
headView
.
systemLayoutSizeFitting
(
UIView
.
layoutFittingCompressedSize
)
let
rect
=
CGRect
(
x
:
0
,
y
:
0
,
width
:
0
,
height
:
size
.
height
)
let
rect
=
CGRect
(
x
:
0
,
y
:
0
,
width
:
0
,
height
:
size
.
height
)
headView
.
frame
=
rect
headView
.
frame
=
rect
...
@@ -93,16 +111,29 @@ class YHUploadContentVC: YHBaseViewController {
...
@@ -93,16 +111,29 @@ class YHUploadContentVC: YHBaseViewController {
super
.
viewDidLoad
()
super
.
viewDidLoad
()
self
.
view
.
backgroundColor
=
.
white
self
.
view
.
backgroundColor
=
.
white
self
.
gk_navTitle
=
"上传内容"
self
.
gk_navTitle
=
"上传内容"
addKeyBoardNotify
()
createUI
()
createUI
()
}
}
deinit
{
removeNotify
()
}
func
createUI
()
{
func
createUI
()
{
view
.
addSubview
(
tableView
)
view
.
addSubview
(
tableView
)
view
.
addSubview
(
blackMaskView
)
view
.
addSubview
(
renameInputView
)
tableView
.
snp
.
makeConstraints
{
make
in
tableView
.
snp
.
makeConstraints
{
make
in
make
.
top
.
equalTo
(
k_Height_NavigationtBarAndStatuBar
)
make
.
top
.
equalTo
(
k_Height_NavigationtBarAndStatuBar
)
make
.
left
.
right
.
equalTo
(
view
)
make
.
left
.
right
.
equalTo
(
view
)
make
.
bottom
.
equalToSuperview
()
.
offset
(
-
k_Height_safeAreaInsetsBottom
())
make
.
bottom
.
equalToSuperview
()
.
offset
(
-
k_Height_safeAreaInsetsBottom
())
}
}
renameInputView
.
snp
.
makeConstraints
{
make
in
make
.
left
.
right
.
equalTo
(
view
)
make
.
height
.
equalTo
(
YHFileRenameInputView
.
height
)
make
.
bottom
.
equalToSuperview
()
.
offset
(
YHFileRenameInputView
.
height
)
}
}
}
}
}
...
@@ -179,5 +210,63 @@ extension YHUploadContentVC: UITableViewDelegate, UITableViewDataSource {
...
@@ -179,5 +210,63 @@ extension YHUploadContentVC: UITableViewDelegate, UITableViewDataSource {
return
view
return
view
}
}
func
tableView
(
_
tableView
:
UITableView
,
didSelectRowAt
indexPath
:
IndexPath
)
{
if
true
{
let
items
=
[
YHCertificateEditItem
(
type
:
.
rename
,
title
:
"重命名"
),
YHCertificateEditItem
(
type
:
.
preview
,
title
:
"预览"
),
YHCertificateEditItem
(
type
:
.
delete
,
title
:
"删除"
),
YHCertificateEditItem
(
type
:
.
cancel
,
title
:
"取消"
)]
YHCertificateEditSheetView
.
sheetView
(
items
:
items
)
{
[
weak
self
]
editType
in
guard
let
self
=
self
else
{
return
}
print
(
"editType:
\(
editType
.
rawValue
)
"
)
if
editType
==
.
rename
{
IQKeyboardManager
.
shared
.
enable
=
false
renameInputView
.
textField
.
becomeFirstResponder
()
}
}
.
show
()
return
}
}
@objc
func
dismissed
()
{
renameInputView
.
textField
.
resignFirstResponder
()
}
}
extension
YHUploadContentVC
{
func
addKeyBoardNotify
()
{
NotificationCenter
.
default
.
addObserver
(
self
,
selector
:
#selector(
handleKeyboardNotification
)
,
name
:
UIResponder
.
keyboardWillShowNotification
,
object
:
nil
)
NotificationCenter
.
default
.
addObserver
(
self
,
selector
:
#selector(
handleKeyboardNotification
)
,
name
:
UIResponder
.
keyboardWillHideNotification
,
object
:
nil
)
}
func
removeNotify
()
{
NotificationCenter
.
default
.
removeObserver
(
self
)
}
@objc
func
handleKeyboardNotification
(
_
notification
:
Notification
)
{
if
let
userInfo
=
notification
.
userInfo
{
guard
let
keyboardFrame
=
(
notification
.
userInfo
?[
UIResponder
.
keyboardFrameEndUserInfoKey
]
as
AnyObject
)
.
cgRectValue
else
{
return
}
let
isKeyboardShow
=
notification
.
name
==
UIResponder
.
keyboardWillShowNotification
self
.
blackMaskView
.
isHidden
=
!
isKeyboardShow
let
bottomMargin
=
(
isKeyboardShow
?
-
keyboardFrame
.
height
:
YHFileRenameInputView
.
height
)
if
!
isKeyboardShow
{
IQKeyboardManager
.
shared
.
enable
=
true
}
self
.
renameInputView
.
snp
.
updateConstraints
{
make
in
make
.
bottom
.
equalToSuperview
()
.
offset
(
bottomMargin
)
}
self
.
view
.
setNeedsLayout
()
self
.
view
.
layoutIfNeeded
()
}
}
}
}
galaxy/galaxy/Classes/Modules/IntelligentService(服务中心)/ServiceProcess(流程)/MyCertificates(我的证书)/V/YHCertificateEditSheetView.swift
0 → 100644
View file @
c06f990d
//
// YHCertificateActionSheetView.swift
// galaxy
//
// Created by edy on 2024/3/12.
// Copyright © 2024 https://www.galaxy-immi.com. All rights reserved.
//
/*
【Usage】
let items = [YHCertificateEditItem(type:.rename, title:"重命名"),
YHCertificateEditItem(type:.preview, title:"预览"),
YHCertificateEditItem(type:.delete, title:"删除"),
YHCertificateEditItem(type:.cancel, title:"取消")]
YHCertificateEditSheetView.sheetView(items:items) {
[weak self] editType in
guard let self = self else { return }
print("editType:\(editType.rawValue)")
}.show()
*/
import
UIKit
enum
YHCertificateEditType
:
Int
{
case
rename
=
1
case
preview
=
2
case
delete
=
3
case
cancel
=
4
}
class
YHCertificateEditItem
{
var
type
:
YHCertificateEditType
var
title
:
String
init
(
type
:
YHCertificateEditType
,
title
:
String
)
{
self
.
type
=
type
self
.
title
=
title
}
}
class
YHCertificateEditItemView
:
UIView
{
let
item
:
YHCertificateEditItem
lazy
var
topLine
:
UIView
=
{
let
view
=
UIView
()
view
.
backgroundColor
=
.
separatorColor
return
view
}()
lazy
var
titleLabel
:
UILabel
=
{
let
label
=
UILabel
()
label
.
textColor
=
UIColor
.
mainTextColor
label
.
textAlignment
=
.
center
label
.
font
=
UIFont
.
PFSC_M
(
ofSize
:
14
)
return
label
}()
init
(
item
:
YHCertificateEditItem
)
{
self
.
item
=
item
super
.
init
(
frame
:
CGRect
(
x
:
0
,
y
:
0
,
width
:
KScreenWidth
,
height
:
52.0
))
self
.
tag
=
item
.
type
.
rawValue
self
.
createUI
()
}
required
init
?(
coder
:
NSCoder
)
{
fatalError
(
"init(coder:) has not been implemented"
)
}
func
createUI
()
{
self
.
addSubview
(
titleLabel
)
self
.
addSubview
(
topLine
)
self
.
titleLabel
.
text
=
item
.
title
if
self
.
item
.
type
==
.
delete
{
titleLabel
.
textColor
=
.
failColor
}
else
if
self
.
item
.
type
==
.
cancel
{
titleLabel
.
textColor
=
UIColor
(
hexString
:
"#909090"
)
}
else
{
titleLabel
.
textColor
=
.
mainTextColor
}
titleLabel
.
snp
.
makeConstraints
{
make
in
make
.
height
.
equalTo
(
20
)
make
.
left
.
right
.
equalToSuperview
()
make
.
centerY
.
equalToSuperview
()
}
topLine
.
snp
.
makeConstraints
{
make
in
make
.
left
.
equalToSuperview
()
.
offset
(
24
)
make
.
right
.
equalToSuperview
()
.
offset
(
-
24
)
make
.
top
.
equalToSuperview
()
make
.
height
.
equalTo
(
0.5
)
}
}
}
class
YHCertificateEditSheetView
:
UIView
{
var
items
:[
YHCertificateEditItem
]
var
action
:((
YHCertificateEditType
)
->
())?
lazy
var
blackMaskView
:
UIView
=
{
let
view
=
UIView
(
frame
:
UIScreen
.
main
.
bounds
)
view
.
backgroundColor
=
UIColor
(
hex
:
0x0F1214
,
alpha
:
0.5
)
let
tap
=
UITapGestureRecognizer
(
target
:
self
,
action
:
#selector(
dismiss
)
)
view
.
addGestureRecognizer
(
tap
)
return
view
}()
lazy
var
whiteContentView
:
UIView
=
{
let
view
=
UIView
()
view
.
backgroundColor
=
.
white
return
view
}()
lazy
var
titleLabel
:
UILabel
=
{
let
label
=
UILabel
()
label
.
textColor
=
UIColor
.
mainTextColor
label
.
textAlignment
=
.
center
label
.
font
=
UIFont
.
PFSC_B
(
ofSize
:
17
)
label
.
text
=
"请选择操作"
return
label
}()
lazy
var
closeBtn
:
UIButton
=
{
let
btn
=
UIButton
()
btn
.
setImage
(
UIImage
(
named
:
"my_cer_sheet_close"
),
for
:
.
normal
)
btn
.
addTarget
(
self
,
action
:
#selector(
dismiss
)
,
for
:
.
touchUpInside
)
return
btn
}()
init
(
items
:[
YHCertificateEditItem
])
{
self
.
items
=
items
super
.
init
(
frame
:
UIScreen
.
main
.
bounds
)
createUI
()
}
required
init
?(
coder
:
NSCoder
)
{
fatalError
(
"init(coder:) has not been implemented"
)
}
static
func
sheetView
(
items
:[
YHCertificateEditItem
],
action
:((
YHCertificateEditType
)
->
())?)
->
YHCertificateEditSheetView
{
let
view
=
YHCertificateEditSheetView
(
items
:
items
)
view
.
action
=
action
return
view
}
func
createUI
()
{
self
.
addSubview
(
blackMaskView
)
self
.
addSubview
(
whiteContentView
)
let
corner
=
UIRectCorner
(
rawValue
:
UIRectCorner
.
topLeft
.
rawValue
|
UIRectCorner
.
topRight
.
rawValue
)
let
path
=
UIBezierPath
(
roundedRect
:
bounds
,
byRoundingCorners
:
corner
,
cornerRadii
:
CGSizeMake
(
16.0
,
16.0
));
let
layer
=
CAShapeLayer
();
layer
.
frame
=
whiteContentView
.
bounds
;
layer
.
path
=
path
.
cgPath
;
whiteContentView
.
layer
.
mask
=
layer
;
whiteContentView
.
addSubview
(
titleLabel
)
whiteContentView
.
addSubview
(
closeBtn
)
blackMaskView
.
snp
.
makeConstraints
{
make
in
make
.
edges
.
equalToSuperview
()
}
whiteContentView
.
snp
.
makeConstraints
{
make
in
make
.
left
.
right
.
bottom
.
equalToSuperview
()
make
.
height
.
equalTo
(
52.0
+
CGFloat
(
items
.
count
)
*
52.0
+
k_Height_safeAreaInsetsBottom
())
}
titleLabel
.
snp
.
makeConstraints
{
make
in
make
.
height
.
equalTo
(
52
)
make
.
left
.
right
.
top
.
equalToSuperview
()
}
closeBtn
.
snp
.
makeConstraints
{
make
in
make
.
centerY
.
equalTo
(
titleLabel
)
make
.
right
.
equalToSuperview
()
.
offset
(
-
20
)
make
.
width
.
height
.
equalTo
(
24
)
}
for
(
index
,
item
)
in
items
.
enumerated
()
{
let
itemView
=
YHCertificateEditItemView
(
item
:
item
)
whiteContentView
.
addSubview
(
itemView
)
let
tap
=
UITapGestureRecognizer
(
target
:
self
,
action
:
#selector(
action(_:)
)
)
itemView
.
addGestureRecognizer
(
tap
)
itemView
.
snp
.
makeConstraints
{
make
in
make
.
left
.
right
.
equalToSuperview
()
make
.
height
.
equalTo
(
52.0
)
make
.
top
.
equalTo
(
titleLabel
.
snp
.
bottom
)
.
offset
(
index
*
52
)
}
}
}
}
extension
YHCertificateEditSheetView
{
func
show
()
{
UIApplication
.
shared
.
yhKeyWindow
()?
.
addSubview
(
self
)
}
@objc
func
dismiss
()
{
self
.
removeFromSuperview
()
}
@objc
func
action
(
_
sender
:
UITapGestureRecognizer
)
{
if
let
targetView
=
sender
.
view
{
let
tag
=
targetView
.
tag
if
let
type
=
YHCertificateEditType
(
rawValue
:
tag
),
let
action
=
action
{
action
(
type
)
dismiss
()
}
}
}
}
galaxy/galaxy/Classes/Modules/IntelligentService(服务中心)/ServiceProcess(流程)/MyCertificates(我的证书)/V/YHCertificateUploadSheetView.swift
View file @
c06f990d
...
@@ -18,7 +18,7 @@
...
@@ -18,7 +18,7 @@
import
UIKit
import
UIKit
enum
YHCertificate
Action
Type
:
Int
{
enum
YHCertificate
Upload
Type
:
Int
{
case
sample
=
1
case
sample
=
1
case
camera
=
2
case
camera
=
2
...
@@ -28,10 +28,10 @@ enum YHCertificateActionType: Int {
...
@@ -28,10 +28,10 @@ enum YHCertificateActionType: Int {
}
}
class
YHCertificateUploadItem
{
class
YHCertificateUploadItem
{
var
type
:
YHCertificate
Action
Type
var
type
:
YHCertificate
Upload
Type
var
title
:
String
var
title
:
String
var
subtitle
:
String
var
subtitle
:
String
init
(
type
:
YHCertificate
Action
Type
,
title
:
String
,
subtitle
:
String
=
""
)
{
init
(
type
:
YHCertificate
Upload
Type
,
title
:
String
,
subtitle
:
String
=
""
)
{
self
.
type
=
type
self
.
type
=
type
self
.
title
=
title
self
.
title
=
title
self
.
subtitle
=
subtitle
self
.
subtitle
=
subtitle
...
@@ -181,7 +181,7 @@ class YHCertificateUploadSheetView: UIView {
...
@@ -181,7 +181,7 @@ class YHCertificateUploadSheetView: UIView {
static
let
sheetView
=
YHCertificateUploadSheetView
(
frame
:
UIScreen
.
main
.
bounds
)
static
let
sheetView
=
YHCertificateUploadSheetView
(
frame
:
UIScreen
.
main
.
bounds
)
var
action
:((
YHCertificate
Action
Type
)
->
())?
var
action
:((
YHCertificate
Upload
Type
)
->
())?
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
)
...
@@ -253,7 +253,7 @@ class YHCertificateUploadSheetView: UIView {
...
@@ -253,7 +253,7 @@ class YHCertificateUploadSheetView: UIView {
lazy
var
templateView
:
YHCertificateSampleTemplateView
=
{
lazy
var
templateView
:
YHCertificateSampleTemplateView
=
{
let
view
=
YHCertificateSampleTemplateView
(
frame
:
CGRectZero
)
let
view
=
YHCertificateSampleTemplateView
(
frame
:
CGRectZero
)
view
.
tag
=
YHCertificate
Action
Type
.
sample
.
rawValue
view
.
tag
=
YHCertificate
Upload
Type
.
sample
.
rawValue
let
tap
=
UITapGestureRecognizer
(
target
:
self
,
action
:
#selector(
action(_:)
)
)
let
tap
=
UITapGestureRecognizer
(
target
:
self
,
action
:
#selector(
action(_:)
)
)
view
.
addGestureRecognizer
(
tap
)
view
.
addGestureRecognizer
(
tap
)
return
view
return
view
...
@@ -331,7 +331,7 @@ class YHCertificateUploadSheetView: UIView {
...
@@ -331,7 +331,7 @@ class YHCertificateUploadSheetView: UIView {
extension
YHCertificateUploadSheetView
{
extension
YHCertificateUploadSheetView
{
func
show
(
_
action
:((
YHCertificate
Action
Type
)
->
())?)
{
func
show
(
_
action
:((
YHCertificate
Upload
Type
)
->
())?)
{
self
.
action
=
action
self
.
action
=
action
UIApplication
.
shared
.
yhKeyWindow
()?
.
addSubview
(
self
)
UIApplication
.
shared
.
yhKeyWindow
()?
.
addSubview
(
self
)
}
}
...
@@ -344,7 +344,7 @@ extension YHCertificateUploadSheetView {
...
@@ -344,7 +344,7 @@ extension YHCertificateUploadSheetView {
if
let
targetView
=
sender
.
view
{
if
let
targetView
=
sender
.
view
{
let
tag
=
targetView
.
tag
let
tag
=
targetView
.
tag
if
let
type
=
YHCertificate
Action
Type
(
rawValue
:
tag
),
let
action
=
action
{
if
let
type
=
YHCertificate
Upload
Type
(
rawValue
:
tag
),
let
action
=
action
{
action
(
type
)
action
(
type
)
}
}
}
}
...
...
galaxy/galaxy/Classes/Modules/IntelligentService(服务中心)/ServiceProcess(流程)/MyCertificates(我的证书)/V/YHFileRenameInputView.swift
0 → 100644
View file @
c06f990d
//
// YHFileRenameInputView.swift
// galaxy
//
// Created by edy on 2024/3/12.
// Copyright © 2024 https://www.galaxy-immi.com. All rights reserved.
//
/*
【Usage】
let view = YHFileRenameInputView.inputView(defalutText:"adfasfsf", editBlock: {
text in
print("\(text)")
})
*/
import
UIKit
class
YHFileRenameInputView
:
UIView
{
static
let
height
=
217.0
var
editBlock
:((
String
?)
->
())?
lazy
var
blackMaskView
:
UIView
=
{
let
view
=
UIView
(
frame
:
UIScreen
.
main
.
bounds
)
view
.
backgroundColor
=
UIColor
(
hex
:
0x0F1214
,
alpha
:
0.5
)
let
tap
=
UITapGestureRecognizer
(
target
:
self
,
action
:
#selector(
dismiss
)
)
view
.
addGestureRecognizer
(
tap
)
return
view
}()
lazy
var
whiteContentView
:
UIView
=
{
let
view
=
UIView
()
view
.
backgroundColor
=
.
white
return
view
}()
lazy
var
titleLabel
:
UILabel
=
{
let
label
=
UILabel
()
label
.
textColor
=
UIColor
.
mainTextColor
label
.
textAlignment
=
.
center
label
.
font
=
UIFont
.
PFSC_B
(
ofSize
:
17
)
label
.
text
=
"请选择上传方式"
return
label
}()
lazy
var
closeBtn
:
UIButton
=
{
let
btn
=
UIButton
()
btn
.
setImage
(
UIImage
(
named
:
"my_cer_sheet_close"
),
for
:
.
normal
)
btn
.
addTarget
(
self
,
action
:
#selector(
dismiss
)
,
for
:
.
touchUpInside
)
return
btn
}()
lazy
var
topLine
:
UIView
=
{
let
view
=
UIView
()
view
.
backgroundColor
=
.
separatorColor
return
view
}()
lazy
var
inputContentView
:
UIView
=
{
let
view
=
UIView
()
view
.
backgroundColor
=
.
contentBkgColor
view
.
layer
.
cornerRadius
=
6.0
view
.
clipsToBounds
=
true
return
view
}()
lazy
var
textField
:
UITextField
=
{
let
textField
=
UITextField
()
textField
.
backgroundColor
=
.
clear
textField
.
placeholder
=
"请输入文件名称"
textField
.
font
=
UIFont
.
PFSC_M
(
ofSize
:
16
)
textField
.
tintColor
=
UIColor
.
brandMainColor
textField
.
textColor
=
UIColor
.
mainTextColor
// textField.addTarget(self, action: #selector(textFieldChanged(textField:)), for: .editingChanged)
// textField.addTarget(self, action: #selector(textFieldEditEnd(textField:)), for: .editingDidEnd)
return
textField
}()
lazy
var
cancelBtn
:
UIButton
=
{
let
btn
=
UIButton
()
btn
.
setTitle
(
"取消"
,
for
:
.
normal
)
btn
.
titleLabel
?
.
font
=
UIFont
.
PFSC_M
(
ofSize
:
14
)
btn
.
setTitleColor
(
UIColor
.
mainTextColor
,
for
:
.
normal
)
btn
.
backgroundColor
=
.
contentBkgColor
btn
.
layer
.
cornerRadius
=
6.0
btn
.
addTarget
(
self
,
action
:
#selector(
didClickCancelBtn
)
,
for
:
.
touchUpInside
)
return
btn
}()
lazy
var
confirmBtn
:
UIButton
=
{
let
btn
=
UIButton
()
btn
.
setTitle
(
"确定"
.
local
,
for
:
.
normal
)
btn
.
titleLabel
?
.
font
=
UIFont
.
PFSC_M
(
ofSize
:
14
)
btn
.
setTitleColor
(
.
white
,
for
:
.
normal
)
btn
.
backgroundColor
=
UIColor
(
hexString
:
"#4388FF"
)
btn
.
layer
.
cornerRadius
=
6.0
btn
.
addTarget
(
self
,
action
:
#selector(
didClickConfirmBtn
)
,
for
:
.
touchUpInside
)
return
btn
}()
override
init
(
frame
:
CGRect
)
{
super
.
init
(
frame
:
frame
)
createUI
()
}
required
init
?(
coder
:
NSCoder
)
{
fatalError
(
"init(coder:) has not been implemented"
)
}
static
func
inputView
(
defalutText
:
String
?,
editBlock
:((
String
?)
->
())?)
->
YHFileRenameInputView
{
let
view
=
YHFileRenameInputView
(
frame
:
CGRect
(
x
:
0
,
y
:
0
,
width
:
KScreenWidth
,
height
:
Self
.
height
))
view
.
textField
.
text
=
defalutText
view
.
editBlock
=
editBlock
return
view
}
func
createUI
()
{
self
.
addSubview
(
whiteContentView
)
whiteContentView
.
addSubview
(
titleLabel
)
whiteContentView
.
addSubview
(
closeBtn
)
whiteContentView
.
addSubview
(
topLine
)
whiteContentView
.
addSubview
(
inputContentView
)
inputContentView
.
addSubview
(
textField
)
whiteContentView
.
addSubview
(
cancelBtn
)
whiteContentView
.
addSubview
(
confirmBtn
)
let
corner
=
UIRectCorner
(
rawValue
:
UIRectCorner
.
topLeft
.
rawValue
|
UIRectCorner
.
topRight
.
rawValue
)
let
path
=
UIBezierPath
(
roundedRect
:
bounds
,
byRoundingCorners
:
corner
,
cornerRadii
:
CGSizeMake
(
16.0
,
16.0
));
let
layer
=
CAShapeLayer
();
layer
.
frame
=
whiteContentView
.
bounds
;
layer
.
path
=
path
.
cgPath
;
whiteContentView
.
layer
.
mask
=
layer
;
whiteContentView
.
snp
.
makeConstraints
{
make
in
make
.
left
.
right
.
top
.
bottom
.
equalToSuperview
()
}
titleLabel
.
snp
.
makeConstraints
{
make
in
make
.
left
.
right
.
top
.
equalToSuperview
()
make
.
height
.
equalTo
(
52.0
)
}
closeBtn
.
snp
.
makeConstraints
{
make
in
make
.
width
.
height
.
equalTo
(
24.0
)
make
.
right
.
equalToSuperview
()
.
offset
(
-
20
)
make
.
centerY
.
equalTo
(
titleLabel
)
}
topLine
.
snp
.
makeConstraints
{
make
in
make
.
left
.
equalToSuperview
()
.
offset
(
20
)
make
.
right
.
equalToSuperview
()
.
offset
(
-
20
)
make
.
top
.
equalTo
(
titleLabel
.
snp
.
bottom
)
make
.
height
.
equalTo
(
1
)
}
inputContentView
.
snp
.
makeConstraints
{
make
in
make
.
left
.
equalToSuperview
()
.
offset
(
20
)
make
.
right
.
equalToSuperview
()
.
offset
(
-
20
)
make
.
top
.
equalTo
(
topLine
.
snp
.
bottom
)
.
offset
(
20
)
make
.
height
.
equalTo
(
48
)
}
textField
.
snp
.
makeConstraints
{
make
in
make
.
left
.
equalToSuperview
()
.
offset
(
16
)
make
.
right
.
equalToSuperview
()
.
offset
(
-
16
)
make
.
height
.
equalTo
(
20
)
make
.
centerY
.
equalToSuperview
()
}
cancelBtn
.
snp
.
makeConstraints
{
make
in
make
.
left
.
equalToSuperview
()
.
offset
(
16
)
make
.
right
.
equalTo
(
whiteContentView
.
snp
.
centerX
)
.
offset
(
-
6
)
make
.
top
.
equalTo
(
inputContentView
.
snp
.
bottom
)
.
offset
(
30
)
make
.
height
.
equalTo
(
45
)
}
confirmBtn
.
snp
.
makeConstraints
{
make
in
make
.
right
.
equalToSuperview
()
.
offset
(
-
16
)
make
.
left
.
equalTo
(
whiteContentView
.
snp
.
centerX
)
.
offset
(
6
)
make
.
top
.
equalTo
(
cancelBtn
)
make
.
height
.
equalTo
(
45
)
}
}
}
extension
YHFileRenameInputView
{
@objc
func
dismiss
()
{
self
.
textField
.
resignFirstResponder
()
UIApplication
.
shared
.
yhKeyWindow
()?
.
endEditing
(
true
)
}
@objc
func
didClickCancelBtn
()
{
dismiss
()
}
@objc
func
didClickConfirmBtn
()
{
dismiss
()
if
let
editBlock
=
editBlock
{
editBlock
(
textField
.
text
)
}
}
}
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