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
4a0d12cd
Commit
4a0d12cd
authored
Mar 04, 2024
by
pete谢兆麟
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
工作经验上传逻辑 工作经验step步骤逻辑 工作经验字段校验
parent
70009ba4
Changes
20
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
20 changed files
with
254 additions
and
46 deletions
+254
-46
YHMainApplicantInformationViewController.swift
...(主申请人信息)/C/YHMainApplicantInformationViewController.swift
+2
-1
YHStepView.swift
...s(流程)/MainApplicantInformation(主申请人信息)/V/YHStepView.swift
+1
-0
YHMainApplicantInformationViewModel.swift
...tion(主申请人信息)/VM/YHMainApplicantInformationViewModel.swift
+2
-2
YHWorkExperienceListViewController.swift
...WorkExperience/C/YHWorkExperienceListViewController.swift
+7
-3
YHWorkExperienceViewController.swift
...流程)/WorkExperience/C/YHWorkExperienceViewController.swift
+0
-0
YHWorkIntroductionViewController.swift
...)/WorkExperience/C/YHWorkIntroductionViewController.swift
+28
-1
YHWorkExampleModel.swift
...Process(流程)/WorkExperience/Model/YHWorkExampleModel.swift
+4
-0
YHWorkExperienceDetailModel.swift
...程)/WorkExperience/Model/YHWorkExperienceDetailModel.swift
+6
-1
YHWorkExperienceModel.swift
...cess(流程)/WorkExperience/Model/YHWorkExperienceModel.swift
+5
-1
YHWorkActionView.swift
...erviceProcess(流程)/WorkExperience/V/YHWorkActionView.swift
+18
-14
YHWorkExperienceItemView.swift
...ocess(流程)/WorkExperience/V/YHWorkExperienceItemView.swift
+31
-2
YHWorkExperienceTableViewCell.swift
...(流程)/WorkExperience/V/YHWorkExperienceTableViewCell.swift
+11
-3
YHWorkFileItemView.swift
...viceProcess(流程)/WorkExperience/V/YHWorkFileItemView.swift
+24
-11
YHWorkFileSyncTableViewCell.swift
...ss(流程)/WorkExperience/V/YHWorkFileSyncTableViewCell.swift
+5
-5
YHWorkHighlightsTableViewCell.swift
...(流程)/WorkExperience/V/YHWorkHighlightsTableViewCell.swift
+7
-0
YHWorkResponsibilitiesTableViewCell.swift
...orkExperience/V/YHWorkResponsibilitiesTableViewCell.swift
+8
-0
YHWorkExperienceViewModel.swift
.../WorkExperience/ViewModel/YHWorkExperienceViewModel.swift
+0
-0
YHWorkIntroductionViewModel.swift
...orkExperience/ViewModel/YHWorkIntroductionViewModel.swift
+61
-0
UIButton+Extension.swift
...y/galaxy/Classes/Tools/Extention/UIButton+Extension.swift
+32
-0
YHNetRequest.swift
galaxy/galaxy/Classes/Tools/NetWork/YHNetRequest.swift
+2
-2
No files found.
galaxy/galaxy/Classes/Modules/IntelligentService(服务中心)/ServiceProcess(流程)/MainApplicantInformation(主申请人信息)/C/YHMainApplicantInformationViewController.swift
View file @
4a0d12cd
...
...
@@ -92,12 +92,13 @@ class YHMainApplicantInformationViewController: YHBaseViewController {
bottom
.
nextblock
=
{
[
weak
self
]
in
guard
let
self
=
self
else
{
return
}
if
self
.
viewModel
.
isCanNext
(
self
.
stepView
.
currentIndex
)
{
self
.
stepView
.
currentIndex
=
self
.
stepView
.
currentIndex
+
1
self
.
viewModel
.
mainModel
.
step
=
self
.
stepView
.
currentIndex
self
.
viewModel
.
updateMainInformation
(
.
submit
,
self
.
orderId
)
{[
weak
self
]
success
,
error
in
guard
let
self
=
self
else
{
return
}
if
let
error
=
error
{
YHHUD
.
flash
(
message
:
error
.
errorMsg
)
}
else
{
self
.
stepView
.
currentIndex
=
self
.
stepView
.
currentIndex
+
1
self
.
isShowPrompt
=
false
self
.
stepView
.
currentIndex
=
self
.
stepView
.
currentIndex
if
self
.
stepView
.
currentIndex
==
self
.
stepView
.
dataSource
?
.
count
{
...
...
galaxy/galaxy/Classes/Modules/IntelligentService(服务中心)/ServiceProcess(流程)/MainApplicantInformation(主申请人信息)/V/YHStepView.swift
View file @
4a0d12cd
...
...
@@ -68,6 +68,7 @@ class YHStepView: UIScrollView {
make
.
left
.
equalTo
(
spaceWidth
+
i
.
cgFloat
*
(
lineWidth
+
stepSpace
*
2
+
14
))
make
.
width
.
height
.
equalTo
(
14
)
}
button
.
YH_clickEdgeInsets
=
UIEdgeInsets
(
top
:
50
,
left
:
50
,
bottom
:
50
,
right
:
50
)
let
label
=
UILabel
()
label
.
text
=
array
[
i
]
label
.
font
=
UIFont
.
PFSC_R
(
ofSize
:
13
)
...
...
galaxy/galaxy/Classes/Modules/IntelligentService(服务中心)/ServiceProcess(流程)/MainApplicantInformation(主申请人信息)/VM/YHMainApplicantInformationViewModel.swift
View file @
4a0d12cd
...
...
@@ -474,13 +474,13 @@ class YHMainApplicantInformationViewModel: YHBaseViewModel {
func
isCanNext
(
_
step
:
Int
)
->
Bool
{
if
step
==
0
{
let
nationality
=
mainModel
.
nationality
let
nationality
=
mainModel
.
nationality
let
country
=
mainModel
.
address
.
country
let
area
=
mainModel
.
address
.
area
let
details
=
mainModel
.
address
.
details
let
foreign
=
mainModel
.
address
.
foreign
let
is_live_oversea_year
=
mainModel
.
is_live_oversea_year
let
has_hk_id
=
mainModel
.
has_hk_id
let
has_hk_id
=
mainModel
.
has_hk_id
if
country
.
contains
(
"中国"
)
{
if
nationality
.
count
!=
0
&&
country
.
count
!=
0
&&
area
.
count
!=
0
&&
details
.
count
!=
0
{
return
true
...
...
galaxy/galaxy/Classes/Modules/IntelligentService(服务中心)/ServiceProcess(流程)/WorkExperience/C/YHWorkExperienceListViewController.swift
View file @
4a0d12cd
...
...
@@ -148,9 +148,13 @@ extension YHWorkExperienceListViewController: UITableViewDelegate, UITableViewDa
}
cell
.
newWorkBlock
=
{[
weak
self
]
in
guard
let
self
=
self
else
{
return
}
let
vc
=
YHWorkExperienceViewController
()
vc
.
orderID
=
self
.
orderId
self
.
navigationController
?
.
pushViewController
(
vc
,
animated
:
true
)
if
self
.
dataSource
?
.
count
==
10
{
YHHUD
.
flash
(
message
:
"新增工作经历不能超过10条"
)
}
else
{
let
vc
=
YHWorkExperienceViewController
()
vc
.
orderID
=
self
.
orderId
self
.
navigationController
?
.
pushViewController
(
vc
,
animated
:
true
)
}
}
return
cell
}
...
...
galaxy/galaxy/Classes/Modules/IntelligentService(服务中心)/ServiceProcess(流程)/WorkExperience/C/YHWorkExperienceViewController.swift
View file @
4a0d12cd
This diff is collapsed.
Click to expand it.
galaxy/galaxy/Classes/Modules/IntelligentService(服务中心)/ServiceProcess(流程)/WorkExperience/C/YHWorkIntroductionViewController.swift
View file @
4a0d12cd
...
...
@@ -19,7 +19,7 @@ class YHWorkIntroductionViewController: YHBaseViewController {
var
actionView
:
YHWorkActionView
!
var
bottomView
:
UIView
!
var
bottomButton
:
UIButton
!
var
viewModel
:
YHWorkIntroductionViewModel
?
var
viewModel
:
YHWorkIntroductionViewModel
!
var
workModel
:
YHWorkExperienceDetailModel
?
var
dataSource
:
YHWorkExperienceProjectModel
=
YHWorkExperienceProjectModel
()
...
...
@@ -201,6 +201,33 @@ class YHWorkIntroductionViewController: YHBaseViewController {
vc
.
modalPresentationStyle
=
.
pageSheet
self
.
navigationController
?
.
present
(
vc
,
animated
:
true
)
}
view
.
photoBlock
=
{[
weak
self
]
in
guard
let
self
=
self
else
{
return
}
YHImagePickerView
.
show
()
{[
weak
self
]
image
in
guard
let
self
=
self
else
{
return
}
YHHUD
.
show
(
.
progress
(
message
:
"加载中"
))
self
.
viewModel
.
uploadImage
(
image
)
{[
weak
self
]
success
,
error
in
guard
let
self
=
self
else
{
return
}
guard
let
url
=
success
else
{
return
}
self
.
viewModel
.
getPublicImageUrl
(
url
)
{[
weak
self
]
success
,
error
in
guard
let
self
=
self
else
{
return
}
guard
let
url
=
success
else
{
return
}
self
.
viewModel
.
requestFileMessage
(
url
)
{[
weak
self
]
success
,
model
,
error
in
guard
let
self
=
self
else
{
return
}
if
success
{
YHHUD
.
hide
()
self
.
dataSource
.
project_highlights
=
model
?
.
content
self
.
messageTextField
.
text
=
model
?
.
content
}
else
{
YHHUD
.
hide
()
YHHUD
.
flash
(
message
:
error
?
.
errorMsg
??
""
)
}
}
}
}
}
}
return
view
}()
view
.
addSubview
(
actionView
)
...
...
galaxy/galaxy/Classes/Modules/IntelligentService(服务中心)/ServiceProcess(流程)/WorkExperience/Model/YHWorkExampleModel.swift
View file @
4a0d12cd
...
...
@@ -15,3 +15,7 @@ class YHWorkExampleModel: YHBaseModel {
var
highlights_list
:
[
String
]?
var
template
:
[
String
]?
}
class
YHFileContent
:
YHBaseModel
{
var
content
:
String
?
}
galaxy/galaxy/Classes/Modules/IntelligentService(服务中心)/ServiceProcess(流程)/WorkExperience/Model/YHWorkExperienceDetailModel.swift
View file @
4a0d12cd
...
...
@@ -36,7 +36,7 @@ class YHWorkExperienceDetailModel: YHBaseModel {
var
is_executives
:
Int
=
0
var
wduty
:
String
=
""
var
highlights
:
String
=
""
var
file
:
[
String
]
=
[]
var
file
:
[
YHWorkExperienceFileModel
]
=
[]
var
not_need_upload_file
:
Int
=
0
var
company_member_total
:
Int
=
0
var
administrative_level
:
Int
=
0
...
...
@@ -59,3 +59,8 @@ class YHWorkExperienceDetailModel: YHBaseModel {
var
customer_center_id
:
Int
=
0
var
projects
:
[
String
]
=
[]
}
class
YHWorkExperienceFileModel
:
YHBaseModel
{
var
fileName
:
String
=
""
var
fileUrl
:
String
=
""
}
galaxy/galaxy/Classes/Modules/IntelligentService(服务中心)/ServiceProcess(流程)/WorkExperience/Model/YHWorkExperienceModel.swift
View file @
4a0d12cd
...
...
@@ -58,8 +58,10 @@ struct YHWorkExperienceModel {
var
rightButtonString
:
String
?
var
type
:
YHWorkExperienceSelectType
?
var
value
:
[
String
]?
var
isShowPrompts
:
Bool
?
var
alertMessage
:
String
?
init
(
id
:
YHWorkExperienceID
?
=
nil
,
isNeed
:
Bool
?
=
nil
,
title
:
String
?
=
nil
,
isUserKeyBoard
:
Bool
?
=
nil
,
prompts
:
String
?
=
nil
,
message
:
String
?
=
nil
,
leftButtonString
:
String
?
=
nil
,
rightButtonString
:
String
?
=
nil
,
type
:
YHWorkExperienceSelectType
?
=
nil
,
value
:
[
String
]?
=
nil
)
{
init
(
id
:
YHWorkExperienceID
?
=
nil
,
isNeed
:
Bool
?
=
nil
,
title
:
String
?
=
nil
,
isUserKeyBoard
:
Bool
?
=
nil
,
prompts
:
String
?
=
nil
,
message
:
String
?
=
nil
,
leftButtonString
:
String
?
=
nil
,
rightButtonString
:
String
?
=
nil
,
type
:
YHWorkExperienceSelectType
?
=
nil
,
value
:
[
String
]?
=
nil
,
isShowPrompts
:
Bool
?
=
nil
,
alertMessage
:
String
?
=
nil
)
{
self
.
id
=
id
self
.
isNeed
=
isNeed
self
.
title
=
title
...
...
@@ -70,6 +72,8 @@ struct YHWorkExperienceModel {
self
.
rightButtonString
=
rightButtonString
self
.
type
=
type
self
.
value
=
value
self
.
isShowPrompts
=
isShowPrompts
self
.
alertMessage
=
alertMessage
}
}
...
...
galaxy/galaxy/Classes/Modules/IntelligentService(服务中心)/ServiceProcess(流程)/WorkExperience/V/YHWorkActionView.swift
View file @
4a0d12cd
...
...
@@ -10,9 +10,11 @@ import UIKit
class
YHWorkActionView
:
UIView
{
typealias
ExampleBlock
=
()
->
()
typealias
PhotoBlock
=
()
->
()
var
exampleBlock
:
ExampleBlock
?
var
photoBlock
:
PhotoBlock
?
var
photoButton
:
UIButton
!
var
wxButton
:
UIButton
!
//
var wxButton: UIButton!
var
exampleButton
:
UIButton
!
override
init
(
frame
:
CGRect
)
{
...
...
@@ -40,18 +42,18 @@ class YHWorkActionView: UIView {
make
.
height
.
width
.
equalTo
(
21
)
}
wxButton
=
{
let
button
=
UIButton
(
type
:
.
custom
)
button
.
setBackgroundImage
(
UIImage
(
named
:
"work_experience_wx"
),
for
:
.
normal
)
button
.
addTarget
(
self
,
action
:
#selector(
wxClick
)
,
for
:
.
touchUpInside
)
return
button
}()
addSubview
(
wxButton
)
wxButton
.
snp
.
makeConstraints
{
make
in
make
.
centerY
.
equalToSuperview
()
make
.
left
.
equalTo
(
49
)
make
.
height
.
width
.
equalTo
(
21
)
}
//
wxButton = {
//
let button = UIButton(type: .custom)
//
button.setBackgroundImage(UIImage(named: "work_experience_wx"), for: .normal)
//
button.addTarget(self, action: #selector(wxClick), for: .touchUpInside)
//
return button
//
}()
//
addSubview(wxButton)
//
wxButton.snp.makeConstraints { make in
//
make.centerY.equalToSuperview()
//
make.left.equalTo(49)
//
make.height.width.equalTo(21)
//
}
exampleButton
=
{
let
button
=
UIButton
(
type
:
.
custom
)
...
...
@@ -76,7 +78,9 @@ class YHWorkActionView: UIView {
}
@objc
func
photoClick
()
{
if
let
block
=
photoBlock
{
block
()
}
}
@objc
func
wxClick
()
{
...
...
galaxy/galaxy/Classes/Modules/IntelligentService(服务中心)/ServiceProcess(流程)/WorkExperience/V/YHWorkExperienceItemView.swift
View file @
4a0d12cd
...
...
@@ -17,7 +17,8 @@ class YHWorkExperienceItemView: UIView {
var
centerButton
:
UIButton
!
var
leftButton
:
UIButton
!
var
rightButton
:
UIButton
!
var
showPromptLabel
:
UILabel
!
var
dataSource
:
YHWorkExperienceModel
?
{
didSet
{
updateAllViews
()
...
...
@@ -48,6 +49,8 @@ class YHWorkExperienceItemView: UIView {
messageTextField
=
{
let
textField
=
UITextField
()
textField
.
delegate
=
self
textField
.
textColor
=
UIColor
.
mainTextColor
textField
.
font
=
UIFont
.
PFSC_M
(
ofSize
:
14
)
return
textField
}()
addSubview
(
messageTextField
)
...
...
@@ -56,6 +59,19 @@ class YHWorkExperienceItemView: UIView {
make
.
left
.
equalTo
(
112
)
}
showPromptLabel
=
{
let
label
=
UILabel
()
label
.
textColor
=
UIColor
.
red
label
.
font
=
UIFont
.
PFSC_M
(
ofSize
:
12
)
return
label
}()
addSubview
(
showPromptLabel
)
showPromptLabel
.
snp
.
makeConstraints
{
make
in
make
.
left
.
equalTo
(
messageTextField
.
snp
.
left
)
make
.
height
.
equalTo
(
20
)
make
.
right
.
bottom
.
equalToSuperview
()
}
nextStepImageView
=
{
let
imageView
=
UIImageView
()
imageView
.
image
=
UIImage
(
named
:
"form_right_arrow"
)
...
...
@@ -115,7 +131,6 @@ class YHWorkExperienceItemView: UIView {
make
.
height
.
equalTo
(
32
)
make
.
width
.
equalTo
(
74
)
}
}
func
updateAllViews
()
{
...
...
@@ -141,6 +156,10 @@ class YHWorkExperienceItemView: UIView {
}
messageTextField
.
placeholder
=
dataSource
.
prompts
messageTextField
.
text
=
dataSource
.
message
if
dataSource
.
message
==
"0"
{
messageTextField
.
text
=
""
}
showPromptLabel
.
text
=
dataSource
.
alertMessage
if
dataSource
.
isUserKeyBoard
??
false
{
nextStepImageView
.
isHidden
=
true
centerButton
.
isHidden
=
true
...
...
@@ -205,6 +224,16 @@ class YHWorkExperienceItemView: UIView {
}
else
{
rightButton
.
isHidden
=
true
}
if
dataSource
.
isShowPrompts
??
false
{
if
dataSource
.
message
?
.
count
!=
0
&&
dataSource
.
message
!=
"0"
{
showPromptLabel
.
isHidden
=
true
}
else
{
showPromptLabel
.
isHidden
=
false
}
}
else
{
showPromptLabel
.
isHidden
=
true
}
}
func
buttonState
(
isLeft
:
Bool
)
{
...
...
galaxy/galaxy/Classes/Modules/IntelligentService(服务中心)/ServiceProcess(流程)/WorkExperience/V/YHWorkExperienceTableViewCell.swift
View file @
4a0d12cd
...
...
@@ -99,8 +99,13 @@ class YHWorkExperienceTableViewCell: UITableViewCell {
}
y
=
y
+
1
let
data
=
dataSource
?
.
models
?[
i
]
let
isShow
=
data
?
.
isShowPrompts
??
false
let
message
=
data
?
.
message
??
""
if
data
?
.
id
==
.
id3
||
data
?
.
id
==
.
id4
||
data
?
.
id
==
.
id18
{
var
h
=
131
if
isShow
&&
message
.
count
==
0
{
h
=
h
+
20
}
let
itemView
=
YHWorkExperienceTextItemView
()
itemView
.
dataSource
=
data
itemView
.
block
=
{[
weak
self
]
model
in
...
...
@@ -113,15 +118,18 @@ class YHWorkExperienceTableViewCell: UITableViewCell {
itemView
.
snp
.
makeConstraints
{
make
in
make
.
left
.
equalTo
(
18
)
make
.
top
.
equalTo
(
y
)
make
.
height
.
equalTo
(
131
)
make
.
height
.
equalTo
(
h
)
make
.
right
.
equalTo
(
-
18
)
}
y
=
y
+
131
y
=
y
+
h
}
else
{
var
h
=
51
if
data
?
.
id
==
.
id13
{
h
=
71
}
if
isShow
&&
message
.
count
==
0
{
h
=
h
+
20
}
let
itemView
=
YHWorkExperienceItemView
()
itemView
.
dataSource
=
data
itemView
.
block
=
{[
weak
self
]
model
in
...
...
galaxy/galaxy/Classes/Modules/IntelligentService(服务中心)/ServiceProcess(流程)/WorkExperience/V/YHWorkFileItemView.swift
View file @
4a0d12cd
...
...
@@ -8,13 +8,18 @@
import
UIKit
enum
YHWorkFileClickType
{
case
delete
case
click
}
class
YHWorkFileItemView
:
UIView
{
typealias
ItemBlock
=
(
_
model
:
YH
ItemModel
)
->
()
typealias
ItemBlock
=
(
_
model
:
YH
WorkExperienceFileModel
,
_
type
:
YHWorkFileClickType
)
->
()
var
block
:
ItemBlock
?
var
titleLabel
:
UI
Label
!
var
titleLabel
:
UI
Button
!
var
deleteButton
:
UIButton
!
var
dataSource
:
YHWork
ItemList
Model
?
{
var
dataSource
:
YHWork
ExperienceFile
Model
?
{
didSet
{
updateAllViews
()
}
...
...
@@ -31,10 +36,11 @@ class YHWorkFileItemView: UIView {
func
setUpView
()
{
titleLabel
=
{
let
label
=
UILabel
()
label
.
font
=
UIFont
.
PFSC_M
(
ofSize
:
14
)
label
.
textAlignment
=
.
left
label
.
textColor
=
UIColor
.
mainTextColor
let
label
=
UIButton
(
type
:
.
custom
)
label
.
setTitleColor
(
UIColor
.
mainTextColor
,
for
:
.
normal
)
label
.
titleLabel
?
.
font
=
UIFont
.
PFSC_M
(
ofSize
:
14
)
label
.
addTarget
(
self
,
action
:
#selector(
itemClick
)
,
for
:
.
touchUpInside
)
label
.
contentHorizontalAlignment
=
.
left
return
label
}()
addSubview
(
titleLabel
)
...
...
@@ -48,11 +54,10 @@ class YHWorkFileItemView: UIView {
deleteButton
=
{
let
button
=
UIButton
(
type
:
.
custom
)
button
.
titleLabel
?
.
font
=
UIFont
.
PFSC_R
(
ofSize
:
14
)
button
.
contentHorizontalAlignment
=
.
center
button
.
contentHorizontalAlignment
=
.
right
button
.
setTitle
(
"删除"
,
for
:
.
normal
)
button
.
setTitleColor
(
UIColor
(
hex
:
0xf81d22
)
,
for
:
.
normal
)
button
.
setTitleColor
(
.
red
,
for
:
.
normal
)
button
.
addTarget
(
self
,
action
:
#selector(
deleteClick
)
,
for
:
.
touchUpInside
)
button
.
isHidden
=
true
return
button
}()
addSubview
(
deleteButton
)
...
...
@@ -66,10 +71,18 @@ class YHWorkFileItemView: UIView {
func
updateAllViews
()
{
guard
let
dataSource
=
dataSource
else
{
return
}
titleLabel
.
setTitle
(
dataSource
.
fileName
,
for
:
.
normal
)
}
@objc
func
itemClick
()
{
if
let
block
=
block
,
let
dataSource
=
dataSource
{
block
(
dataSource
,
.
click
)
}
}
@objc
func
deleteClick
()
{
if
let
block
=
block
,
let
dataSource
=
dataSource
{
block
(
dataSource
,
.
delete
)
}
}
}
galaxy/galaxy/Classes/Modules/IntelligentService(服务中心)/ServiceProcess(流程)/WorkExperience/V/YHWorkFileSyncTableViewCell.swift
View file @
4a0d12cd
...
...
@@ -10,7 +10,7 @@ import UIKit
class
YHWorkFileSyncTableViewCell
:
UITableViewCell
{
typealias
ExperienceListBlock
=
(
_
model
:
YH
ItemModel
)
->
()
typealias
ExperienceListBlock
=
(
_
model
:
YH
WorkExperienceFileModel
,
_
type
:
YHWorkFileClickType
)
->
()
typealias
AddIntroductionBlock
=
()
->
()
var
experienceListBlock
:
ExperienceListBlock
?
var
addIntroductionBlock
:
AddIntroductionBlock
?
...
...
@@ -18,7 +18,7 @@ class YHWorkFileSyncTableViewCell: UITableViewCell {
var
titleLabel
:
UILabel
!
var
mainItemView
:
UIView
!
var
bottomView
:
YHWorkItemAddView
!
var
dataSource
:
[
YHWork
ItemList
Model
]?{
var
dataSource
:
[
YHWork
ExperienceFile
Model
]?{
didSet
{
updateAllViews
()
}
...
...
@@ -91,7 +91,7 @@ class YHWorkFileSyncTableViewCell: UITableViewCell {
mainItemView
.
snp
.
makeConstraints
{
make
in
make
.
left
.
right
.
equalToSuperview
()
make
.
bottom
.
equalTo
(
-
65
)
make
.
top
.
equalTo
(
85
)
make
.
top
.
equalTo
(
52
)
}
bottomView
=
{
...
...
@@ -127,10 +127,10 @@ class YHWorkFileSyncTableViewCell: UITableViewCell {
}
let
itemView
=
YHWorkFileItemView
()
itemView
.
dataSource
=
dataSource
?[
i
]
itemView
.
block
=
{[
weak
self
]
model
in
itemView
.
block
=
{[
weak
self
]
model
,
type
in
guard
let
self
=
self
else
{
return
}
if
let
block
=
self
.
experienceListBlock
{
block
(
model
)
block
(
model
,
type
)
}
}
mainItemView
.
addSubview
(
itemView
)
...
...
galaxy/galaxy/Classes/Modules/IntelligentService(服务中心)/ServiceProcess(流程)/WorkExperience/V/YHWorkHighlightsTableViewCell.swift
View file @
4a0d12cd
...
...
@@ -13,6 +13,7 @@ class YHWorkHighlightsTableViewCell: UITableViewCell {
typealias
MessageBlock
=
(
_
message
:
String
)
->
()
typealias
SwitchBlock
=
(
_
isOn
:
Bool
)
->
()
var
exampleBlock
:
ExampleBlock
?
var
photoBlock
:
ExampleBlock
?
var
messageBlock
:
MessageBlock
?
var
switchBlock
:
SwitchBlock
?
var
centerView
:
UIView
!
...
...
@@ -179,6 +180,12 @@ class YHWorkHighlightsTableViewCell: UITableViewCell {
block
()
}
}
view
.
photoBlock
=
{[
weak
self
]
in
guard
let
self
=
self
else
{
return
}
if
let
block
=
self
.
photoBlock
{
block
()
}
}
return
view
}()
centerView
.
addSubview
(
bottomView
)
...
...
galaxy/galaxy/Classes/Modules/IntelligentService(服务中心)/ServiceProcess(流程)/WorkExperience/V/YHWorkResponsibilitiesTableViewCell.swift
View file @
4a0d12cd
...
...
@@ -11,6 +11,7 @@ import UIKit
class
YHWorkResponsibilitiesTableViewCell
:
UITableViewCell
{
typealias
ExampleBlock
=
()
->
()
typealias
MessageBlock
=
(
_
message
:
String
)
->
()
var
photoBlock
:
ExampleBlock
?
var
exampleBlock
:
ExampleBlock
?
var
messageBlock
:
MessageBlock
?
var
centerView
:
UIView
!
...
...
@@ -146,6 +147,13 @@ class YHWorkResponsibilitiesTableViewCell: UITableViewCell {
block
()
}
}
view
.
photoBlock
=
{[
weak
self
]
in
guard
let
self
=
self
else
{
return
}
if
let
block
=
self
.
photoBlock
{
block
()
}
}
return
view
}()
centerView
.
addSubview
(
bottomView
)
...
...
galaxy/galaxy/Classes/Modules/IntelligentService(服务中心)/ServiceProcess(流程)/WorkExperience/ViewModel/YHWorkExperienceViewModel.swift
View file @
4a0d12cd
This diff is collapsed.
Click to expand it.
galaxy/galaxy/Classes/Modules/IntelligentService(服务中心)/ServiceProcess(流程)/WorkExperience/ViewModel/YHWorkIntroductionViewModel.swift
View file @
4a0d12cd
...
...
@@ -7,6 +7,7 @@
//
import
UIKit
import
Alamofire
class
YHWorkIntroductionViewModel
:
YHBaseViewModel
{
var
introducetionExampleModels
:
[
YHWorkExampleModel
]?
...
...
@@ -52,5 +53,65 @@ class YHWorkIntroductionViewModel: YHBaseViewModel {
callBackBlock
(
false
,
err
)
}
}
// 上传方法
func
uploadImage
(
_
image
:
UIImage
,
callBackBlock
:
@escaping
(
_
success
:
String
?,
_
error
:
YHErrorModel
?)
->
())
{
let
strUrl
=
"https://test-comserver.galaxy-immi.com/oss/upload/storage"
let
boundary
=
UUID
()
.
uuidString
let
headers
:
HTTPHeaders
=
[
"Content-type"
:
"multipart/form-data; boundary=
\(
boundary
)
"
,
"businessCode"
:
"4001001"
]
let
_
=
YHNetRequest
.
uplaodRequest
(
url
:
strUrl
,
headers
:
headers
,
image
:
image
)
{
[
weak
self
]
json
,
code
in
guard
let
_
=
self
else
{
return
}
if
json
.
code
==
200
{
callBackBlock
(
json
.
data
as?
String
,
nil
)
}
else
{
let
error
:
YHErrorModel
=
YHErrorModel
(
errorCode
:
Int32
(
json
.
code
),
errorMsg
:
json
.
msg
)
callBackBlock
(
nil
,
error
)
}
}
failBlock
:
{
err
in
callBackBlock
(
nil
,
err
)
}
}
func
getPublicImageUrl
(
_
url
:
String
,
callBackBlock
:
@escaping
(
_
success
:
String
?,
_
error
:
YHErrorModel
?)
->
())
{
let
strUrl
=
"https://test-comserver.galaxy-immi.com/oss/storage/convertToPublicURL"
+
"?fileUrl=
\(
url
)
"
let
_
=
YHNetRequest
.
getRequest
(
url
:
strUrl
)
{
[
weak
self
]
json
,
code
in
//1. json字符串 转 对象
guard
let
_
=
self
else
{
return
}
if
json
.
code
==
200
{
callBackBlock
(
json
.
data
as?
String
,
nil
)
}
else
{
let
error
:
YHErrorModel
=
YHErrorModel
(
errorCode
:
Int32
(
json
.
code
),
errorMsg
:
json
.
msg
)
callBackBlock
(
nil
,
error
)
}
}
failBlock
:
{
err
in
callBackBlock
(
nil
,
err
)
}
}
func
requestFileMessage
(
_
url
:
String
,
callBackBlock
:
@escaping
(
_
success
:
Bool
,
_
model
:
YHFileContent
?,
_
error
:
YHErrorModel
?)
->
())
{
let
strUrl
=
YHBaseUrlManager
.
shared
.
curURL
()
+
YHAllApiName
.
WorkExperience
.
ocrFileContent
+
"?file_url=
\(
url
)
"
// let params: [String : Any] = ["url": url]
let
_
=
YHNetRequest
.
getRequest
(
url
:
strUrl
)
{
[
weak
self
]
json
,
code
in
//1. json字符串 转 对象
guard
let
self
=
self
else
{
return
}
if
json
.
code
==
200
{
let
dic
=
json
.
data
guard
let
result
=
YHFileContent
.
deserialize
(
from
:
dic
as?
Dictionary
)
else
{
callBackBlock
(
false
,
nil
,
nil
)
return
}
callBackBlock
(
true
,
result
,
nil
)
}
else
{
let
error
:
YHErrorModel
=
YHErrorModel
(
errorCode
:
Int32
(
json
.
code
),
errorMsg
:
json
.
msg
)
callBackBlock
(
false
,
nil
,
error
)
}
}
failBlock
:
{
err
in
callBackBlock
(
false
,
nil
,
err
)
}
}
}
galaxy/galaxy/Classes/Tools/Extention/UIButton+Extension.swift
View file @
4a0d12cd
...
...
@@ -126,3 +126,35 @@ extension UIButton {
return
self
as!
T
}
}
// 扩大点击范围
extension
UIButton
{
private
struct
RuntimeKey
{
static
let
clickEdgeInsets
=
UnsafeRawPointer
.
init
(
bitPattern
:
"clickEdgeInsets"
.
hashValue
)
}
/// 需要扩充的点击边距
public
var
YH_clickEdgeInsets
:
UIEdgeInsets
?
{
set
{
objc_setAssociatedObject
(
self
,
UIButton
.
RuntimeKey
.
clickEdgeInsets
!
,
newValue
,
objc_AssociationPolicy
.
OBJC_ASSOCIATION_COPY
)
}
get
{
return
objc_getAssociatedObject
(
self
,
UIButton
.
RuntimeKey
.
clickEdgeInsets
!
)
as?
UIEdgeInsets
??
UIEdgeInsets
.
zero
}
}
// 重写系统方法修改点击区域
open
override
func
point
(
inside
point
:
CGPoint
,
with
event
:
UIEvent
?)
->
Bool
{
super
.
point
(
inside
:
point
,
with
:
event
)
var
bounds
=
self
.
bounds
if
(
YH_clickEdgeInsets
!=
nil
)
{
let
x
:
CGFloat
=
-
(
YH_clickEdgeInsets
?
.
left
??
0
)
let
y
:
CGFloat
=
-
(
YH_clickEdgeInsets
?
.
top
??
0
)
let
width
:
CGFloat
=
bounds
.
width
+
(
YH_clickEdgeInsets
?
.
left
??
0
)
+
(
YH_clickEdgeInsets
?
.
right
??
0
)
let
height
:
CGFloat
=
bounds
.
height
+
(
YH_clickEdgeInsets
?
.
top
??
0
)
+
(
YH_clickEdgeInsets
?
.
bottom
??
0
)
bounds
=
CGRect
(
x
:
x
,
y
:
y
,
width
:
width
,
height
:
height
)
//负值是方法响应范围
}
return
bounds
.
contains
(
point
)
}
}
galaxy/galaxy/Classes/Tools/NetWork/YHNetRequest.swift
View file @
4a0d12cd
...
...
@@ -95,13 +95,13 @@ class YHNetRequest: NSObject {
requestHeader
.
add
(
name
:
"sign"
,
value
:
sign
)
requestHeader
.
add
(
name
:
"token"
,
value
:
YHLoginManager
.
shared
.
userModel
?
.
token
??
"-"
)
testToken
(
&
requestHeader
)
//for test hjl 使用固定token
//
testToken(&requestHeader) //for test hjl 使用固定token
headers
=
requestHeader
}
private
func
testToken
(
_
requestHeader
:
inout
HTTPHeaders
)
{
//金龙的账号
requestHeader
.
add
(
name
:
"token"
,
value
:
"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE3MTE2MDcwNjQsImkiOjE0NDg0MTczMjc0MjE2LCJ1Ijoi6ZO25rKz6ZuG5ZuiIiwiciI6InN1cGVyX2FwcCJ9.KwTWdaLy5UG4LLs6i-D9ne0RflRTT5v4zvu-66yihDE"
)
// requestHeader.add(name: "token", value:/* "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE3MTE2MDcwNjQsImkiOjE0NDg0MTczMjc0MjE2LCJ1Ijoi6ZO25rKz6ZuG5ZuiIiwiciI6InN1cGVyX2FwcCJ9.KwTWdaLy5UG4LLs6i-D9ne0RflRTT5v4zvu-66yihDE")*/
// requestHeader.add(name: "token", value:"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE3MTE3ODI1OTUsImkiOjEyNDMwMTA1MTY0OTA0LCJ1Ijoi6ZO25rKz6ZuG5ZuiIiwiciI6InN1cGVyX2FwcCJ9.jqWpIf3SmbetApdErmBIYh-YEhX1zF_WqgqgOq5oI2A")
}
...
...
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