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
db5f18d2
Commit
db5f18d2
authored
Mar 25, 2024
by
Steven杜宇
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
// 我的证书
parent
047f5a71
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
52 additions
and
11 deletions
+52
-11
YHCertificateListVC.swift
...ce(服务中心)/MyCertificates(我的证书)/C/YHCertificateListVC.swift
+2
-2
YHCertificateSearchViewController.swift
...tificates(我的证书)/C/YHCertificateSearchViewController.swift
+31
-9
YHCertificateSearchBar.swift
...服务中心)/MyCertificates(我的证书)/V/YHCertificateSearchBar.swift
+19
-0
No files found.
galaxy/galaxy/Classes/Modules/IntelligentService(服务中心)/MyCertificates(我的证书)/C/YHCertificateListVC.swift
View file @
db5f18d2
...
@@ -326,7 +326,7 @@ extension YHCertificateListVC {
...
@@ -326,7 +326,7 @@ extension YHCertificateListVC {
guard
let
self
=
self
else
{
return
}
guard
let
self
=
self
else
{
return
}
print
(
fileUrl
)
print
(
fileUrl
)
uploadFile
(
fileUrl
,
supplementInfo
:
supplementInfo
)
{
uploadFile
(
fileUrl
,
supplementInfo
:
supplementInfo
)
{
//
非
待上传的进入详情
// 待上传的进入详情
DispatchQueue
.
main
.
async
{
DispatchQueue
.
main
.
async
{
let
vc
=
YHCertificateUploadContentListVC
()
let
vc
=
YHCertificateUploadContentListVC
()
vc
.
orderId
=
self
.
orderId
vc
.
orderId
=
self
.
orderId
...
@@ -340,7 +340,7 @@ extension YHCertificateListVC {
...
@@ -340,7 +340,7 @@ extension YHCertificateListVC {
[
weak
self
]
image
,
imageName
in
[
weak
self
]
image
,
imageName
in
guard
let
self
=
self
else
{
return
}
guard
let
self
=
self
else
{
return
}
uploadImage
(
image
,
imageName
:
imageName
,
supplementInfo
:
supplementInfo
)
{
uploadImage
(
image
,
imageName
:
imageName
,
supplementInfo
:
supplementInfo
)
{
//
非
待上传的进入详情
// 待上传的进入详情
DispatchQueue
.
main
.
async
{
DispatchQueue
.
main
.
async
{
let
vc
=
YHCertificateUploadContentListVC
()
let
vc
=
YHCertificateUploadContentListVC
()
vc
.
orderId
=
self
.
orderId
vc
.
orderId
=
self
.
orderId
...
...
galaxy/galaxy/Classes/Modules/IntelligentService(服务中心)/MyCertificates(我的证书)/C/YHCertificateSearchViewController.swift
View file @
db5f18d2
...
@@ -245,7 +245,7 @@ extension YHCertificateSearchViewController {
...
@@ -245,7 +245,7 @@ extension YHCertificateSearchViewController {
}
}
}
}
func
uploadImage
(
_
img
:
UIImage
,
imageName
:
String
,
supplementInfo
:
YHSupplementInfo
)
{
func
uploadImage
(
_
img
:
UIImage
,
imageName
:
String
,
supplementInfo
:
YHSupplementInfo
,
successBlock
:(()
->
())?
)
{
// 先OSS上传得到URL
// 先OSS上传得到URL
YHHUD
.
show
(
.
progress
(
message
:
"上传中..."
))
YHHUD
.
show
(
.
progress
(
message
:
"上传中..."
))
...
@@ -268,6 +268,9 @@ extension YHCertificateSearchViewController {
...
@@ -268,6 +268,9 @@ extension YHCertificateSearchViewController {
self
.
viewModel
.
updateCertificateItem
(
supplementId
:
supplementInfo
.
id
,
urlModel
:
model
,
operation
:
"add"
,
rename
:
""
)
{
self
.
viewModel
.
updateCertificateItem
(
supplementId
:
supplementInfo
.
id
,
urlModel
:
model
,
operation
:
"add"
,
rename
:
""
)
{
success
in
success
in
self
.
requestList
(
keyWord
:
self
.
searchBar
.
textField
.
text
)
self
.
requestList
(
keyWord
:
self
.
searchBar
.
textField
.
text
)
if
success
{
successBlock
?()
}
}
}
return
return
}
}
...
@@ -280,7 +283,7 @@ extension YHCertificateSearchViewController {
...
@@ -280,7 +283,7 @@ extension YHCertificateSearchViewController {
}
}
}
}
func
uploadFile
(
_
fileUrl
:
URL
,
supplementInfo
:
YHSupplementInfo
)
{
func
uploadFile
(
_
fileUrl
:
URL
,
supplementInfo
:
YHSupplementInfo
,
successBlock
:(()
->
())?)
{
if
let
fileData
=
try
?
Data
(
contentsOf
:
fileUrl
)
{
if
let
fileData
=
try
?
Data
(
contentsOf
:
fileUrl
)
{
// 将文件数据上传到服务器
// 将文件数据上传到服务器
let
size
=
String
(
format
:
"%.2fM"
,
Double
(
fileData
.
count
)
/
(
1024.0
*
1024.0
))
let
size
=
String
(
format
:
"%.2fM"
,
Double
(
fileData
.
count
)
/
(
1024.0
*
1024.0
))
...
@@ -302,6 +305,9 @@ extension YHCertificateSearchViewController {
...
@@ -302,6 +305,9 @@ extension YHCertificateSearchViewController {
self
.
viewModel
.
updateCertificateItem
(
supplementId
:
supplementInfo
.
id
,
urlModel
:
model
,
operation
:
"add"
,
rename
:
""
)
{
self
.
viewModel
.
updateCertificateItem
(
supplementId
:
supplementInfo
.
id
,
urlModel
:
model
,
operation
:
"add"
,
rename
:
""
)
{
success
in
success
in
self
.
requestList
(
keyWord
:
self
.
searchBar
.
textField
.
text
)
self
.
requestList
(
keyWord
:
self
.
searchBar
.
textField
.
text
)
if
success
{
successBlock
?()
}
}
}
return
return
}
}
...
@@ -317,10 +323,8 @@ extension YHCertificateSearchViewController {
...
@@ -317,10 +323,8 @@ extension YHCertificateSearchViewController {
}
}
}
}
func
showUploadSheetView
(
_
supplementInfo
:
YHSupplementInfo
?)
{
func
showUploadSheetView
(
_
supplementInfo
:
YHSupplementInfo
)
{
guard
let
supplementInfo
=
supplementInfo
else
{
return
}
let
sheetView
=
YHCertificateUploadSheetView
.
sheetView
()
let
sheetView
=
YHCertificateUploadSheetView
.
sheetView
()
sheetView
.
templateInfo
=
supplementInfo
.
templateInfo
sheetView
.
templateInfo
=
supplementInfo
.
templateInfo
sheetView
.
clickTemplateBlock
=
{
sheetView
.
clickTemplateBlock
=
{
...
@@ -328,19 +332,37 @@ extension YHCertificateSearchViewController {
...
@@ -328,19 +332,37 @@ extension YHCertificateSearchViewController {
if
let
url
=
path
?
.
url
,
!
url
.
isEmpty
{
if
let
url
=
path
?
.
url
,
!
url
.
isEmpty
{
guard
let
self
=
self
else
{
return
}
guard
let
self
=
self
else
{
return
}
print
(
url
)
print
(
url
)
self
.
previewFileTool
.
openXLSXRemoteFile
(
urlString
:
url
,
fileName
:
"预览"
)
self
.
previewFileTool
.
openXLSXRemoteFile
(
urlString
:
url
,
fileName
:
"预览"
)
}
}
}
}
sheetView
.
uploadFilesBlock
=
{
sheetView
.
uploadFilesBlock
=
{
[
weak
self
]
fileUrl
in
[
weak
self
]
fileUrl
in
guard
let
self
=
self
else
{
return
}
guard
let
self
=
self
else
{
return
}
print
(
fileUrl
)
print
(
fileUrl
)
uploadFile
(
fileUrl
,
supplementInfo
:
supplementInfo
)
uploadFile
(
fileUrl
,
supplementInfo
:
supplementInfo
)
{
// 待上传的进入详情
DispatchQueue
.
main
.
async
{
let
vc
=
YHCertificateUploadContentListVC
()
vc
.
orderId
=
self
.
orderId
vc
.
categoryInfo
=
self
.
categoryInfo
vc
.
supplementInfo
=
supplementInfo
self
.
navigationController
?
.
pushViewController
(
vc
)
}
}
}
}
sheetView
.
uploadImageBlock
=
{
sheetView
.
uploadImageBlock
=
{
[
weak
self
]
image
,
imageName
in
[
weak
self
]
image
,
imageName
in
guard
let
self
=
self
else
{
return
}
guard
let
self
=
self
else
{
return
}
uploadImage
(
image
,
imageName
:
imageName
,
supplementInfo
:
supplementInfo
)
uploadImage
(
image
,
imageName
:
imageName
,
supplementInfo
:
supplementInfo
)
{
// 待上传的进入详情
DispatchQueue
.
main
.
async
{
let
vc
=
YHCertificateUploadContentListVC
()
vc
.
orderId
=
self
.
orderId
vc
.
categoryInfo
=
self
.
categoryInfo
vc
.
supplementInfo
=
supplementInfo
self
.
navigationController
?
.
pushViewController
(
vc
)
}
}
}
}
sheetView
.
show
()
sheetView
.
show
()
}
}
...
...
galaxy/galaxy/Classes/Modules/IntelligentService(服务中心)/MyCertificates(我的证书)/V/YHCertificateSearchBar.swift
View file @
db5f18d2
...
@@ -12,6 +12,7 @@ class YHCertificateSearchBar: UIView {
...
@@ -12,6 +12,7 @@ class YHCertificateSearchBar: UIView {
static
let
height
=
40.0
static
let
height
=
40.0
static
let
cancelBtnHeight
=
height
-
8.0
static
let
cancelBtnHeight
=
height
-
8.0
static
let
maxWordsCount
=
50
var
textChange
:((
String
?)
->
Void
)?
var
textChange
:((
String
?)
->
Void
)?
var
searchBlock
:((
String
?)
->
Void
)?
var
searchBlock
:((
String
?)
->
Void
)?
...
@@ -39,6 +40,7 @@ class YHCertificateSearchBar: UIView {
...
@@ -39,6 +40,7 @@ class YHCertificateSearchBar: UIView {
textField
.
textColor
=
UIColor
.
mainTextColor
textField
.
textColor
=
UIColor
.
mainTextColor
textField
.
clearButtonMode
=
.
whileEditing
textField
.
clearButtonMode
=
.
whileEditing
textField
.
addTarget
(
self
,
action
:
#selector(
textFieldChanged(textField:)
)
,
for
:
.
editingChanged
)
textField
.
addTarget
(
self
,
action
:
#selector(
textFieldChanged(textField:)
)
,
for
:
.
editingChanged
)
textField
.
delegate
=
self
return
textField
return
textField
}()
}()
...
@@ -115,3 +117,20 @@ class YHCertificateSearchBar: UIView {
...
@@ -115,3 +117,20 @@ class YHCertificateSearchBar: UIView {
}
}
}
}
}
}
extension
YHCertificateSearchBar
:
UITextFieldDelegate
{
func
textField
(
_
textField
:
UITextField
,
shouldChangeCharactersIn
range
:
NSRange
,
replacementString
string
:
String
)
->
Bool
{
if
string
.
isEmpty
==
true
{
// 点击删除
return
true
}
var
newText
=
(
textField
.
text
!
as
NSString
)
.
replacingCharacters
(
in
:
range
,
with
:
string
)
if
newText
.
count
>
Self
.
maxWordsCount
{
YHHUD
.
flash
(
message
:
"搜索限制最多
\(
Self
.
maxWordsCount
)
个字符"
)
return
false
}
return
true
}
}
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