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
0b467705
Commit
0b467705
authored
Nov 19, 2024
by
David黄金龙
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
其他信息优化
parent
a7b8e5c7
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
151 additions
and
54 deletions
+151
-54
YHOtherInfoFillViewController.swift
...erInformation(其他信息)/C/YHOtherInfoFillViewController.swift
+83
-16
YHOtherLanguageSelecteView.swift
...OtherInformation(其他信息)/V/YHOtherLanguageSelecteView.swift
+15
-7
YHSingleOptionalItemsView.swift
.../OtherInformation(其他信息)/V/YHSingleOptionalItemsView.swift
+52
-31
YHOtherInfoFillViewModel.swift
.../OtherInformation(其他信息)/VM/YHOtherInfoFillViewModel.swift
+1
-0
No files found.
galaxy/galaxy/Classes/Modules/IntelligentService(服务中心)/QMAS(优才)/ServiceProcess(我的信息流程)/OtherInformation(其他信息)/C/YHOtherInfoFillViewController.swift
View file @
0b467705
...
@@ -34,6 +34,11 @@ class YHOtherInfoFillViewController: YHBaseViewController {
...
@@ -34,6 +34,11 @@ class YHOtherInfoFillViewController: YHBaseViewController {
//2.0
//2.0
loadData
()
loadData
()
}
deinit
{
NotificationCenter
.
default
.
removeObserver
(
self
)
}
}
}
}
...
@@ -74,8 +79,27 @@ extension YHOtherInfoFillViewController {
...
@@ -74,8 +79,27 @@ extension YHOtherInfoFillViewController {
make
.
left
.
equalTo
(
kMargin
)
make
.
left
.
equalTo
(
kMargin
)
make
.
right
.
equalTo
(
-
kMargin
)
make
.
right
.
equalTo
(
-
kMargin
)
}
}
NotificationCenter
.
default
.
addObserver
(
self
,
selector
:
#selector(
didRevModelChanged(_:)
)
,
name
:
Notification
.
Name
(
rawValue
:
"com.yinhe.myCertificate.wechat.otherInfo_remark_notification"
),
object
:
nil
)
}
@objc
func
didRevModelChanged
(
_
notification
:
Notification
)
{
if
let
model
=
notification
.
object
as?
LanguageDetailModel
{
printLog
(
model
)
if
let
tModel
=
otherInfoVM
.
otherInfoFillData
,
tModel
.
language_detail_new
.
count
>
0
{
for
(
index
,
item
)
in
tModel
.
language_detail_new_data
.
enumerated
()
{
if
item
.
id
==
model
.
id
{
tModel
.
language_detail_new_data
[
index
]
=
model
break
}
}
}
}
}
}
private
func
loadData
()
{
private
func
loadData
()
{
guard
let
orderId
=
orderId
else
{
return
}
guard
let
orderId
=
orderId
else
{
return
}
let
param
=
[
"order_id"
:
orderId
]
let
param
=
[
"order_id"
:
orderId
]
...
@@ -112,25 +136,47 @@ extension YHOtherInfoFillViewController {
...
@@ -112,25 +136,47 @@ extension YHOtherInfoFillViewController {
private
func
submitDataOp
(
flag
:
Bool
)
{
private
func
submitDataOp
(
flag
:
Bool
)
{
//提交
//提交
let
model
=
otherInfoVM
.
otherInfoFillData
let
model
=
otherInfoVM
.
otherInfoFillData
//处理提交的数据 //for test hjl
var
tID
=
0
var
tID
=
0
if
let
arr
=
model
?
.
language_detail_new
,
arr
.
count
>
0
{
if
let
arrr
=
model
?
.
language_detail_new_data
,
arrr
.
count
>
0
{
tID
=
arr
[
0
]
.
id
var
arrO
:
[
LanguageDetailNew
]
=
[]
for
(
_
,
item
)
in
arrr
.
enumerated
()
{
if
item
.
select
{
let
fakeData
:
LanguageDetailNew
=
LanguageDetailNew
()
if
let
arr
=
model
?
.
language_detail_new
,
arr
.
count
>
0
{
for
(
_
,
tttt
)
in
arr
.
enumerated
()
{
if
tttt
.
first_select
==
item
.
id
{
tID
=
tttt
.
id
}
}
}
fakeData
.
id
=
tID
fakeData
.
first_select
=
item
.
id
fakeData
.
other_instructions
=
item
.
other_instructions
arrO
.
append
(
fakeData
)
var
isFirst
:
Bool
=
true
for
(
_
,
tt
)
in
item
.
options
.
enumerated
()
{
if
tt
.
select
{
if
isFirst
{
fakeData
.
second_select
=
String
(
tt
.
id
)
isFirst
=
false
}
else
{
fakeData
.
second_select
=
fakeData
.
second_select
+
","
+
String
(
tt
.
id
)
}
}
}
}
}
model
?
.
language_detail_new
=
arrO
}
else
{
model
?
.
language_detail_new
=
[]
}
}
let
fakeData
:
LanguageDetailNew
=
LanguageDetailNew
()
fakeData
.
id
=
tID
fakeData
.
first_select
=
3
fakeData
.
second_select
=
"1"
fakeData
.
other_instructions
=
"DavidTest"
model
?
.
language_detail_new
=
[
fakeData
]
model
?
.
is_update
=
flag
model
?
.
is_update
=
flag
//保存
//保存
if
let
param
=
model
?
.
toDictionary
()
{
if
let
param
=
model
?
.
toDictionary
()
{
...
@@ -186,6 +232,27 @@ extension YHOtherInfoFillViewController {
...
@@ -186,6 +232,27 @@ extension YHOtherInfoFillViewController {
//
//
// }
// }
if
!
model
.
language_detail_new_data
.
isEmpty
{
var
mutilFlag
:
Bool
=
false
var
singleFlag
:
Bool
=
false
for
(
_
,
item
)
in
model
.
language_detail_new_data
.
enumerated
()
{
mutilFlag
=
item
.
select
||
mutilFlag
if
mutilFlag
{
for
(
_
,
iitem
)
in
item
.
options
.
enumerated
()
{
singleFlag
=
singleFlag
||
iitem
.
select
}
if
!
singleFlag
{
return
false
}
}
}
if
!
mutilFlag
{
return
false
}
}
//3.专业技能行业
//3.专业技能行业
if
model
.
profession
?
.
optionDes
.
isEmpty
==
true
{
if
model
.
profession
?
.
optionDes
.
isEmpty
==
true
{
returnValue
=
false
returnValue
=
false
...
...
galaxy/galaxy/Classes/Modules/IntelligentService(服务中心)/QMAS(优才)/ServiceProcess(我的信息流程)/OtherInformation(其他信息)/V/YHOtherLanguageSelecteView.swift
View file @
0b467705
...
@@ -54,8 +54,8 @@ class YHOtherLanguageSelecteView: UIView {
...
@@ -54,8 +54,8 @@ class YHOtherLanguageSelecteView: UIView {
}()
}()
//
//
private
var
arrLanguage
:
[
UI
View
]
=
[]
private
var
arrLanguage
:
[
YHOtherMultipleChoiceItem
View
]
=
[]
private
var
arrLanguageOptions
:
[
UI
View
]
=
[]
private
var
arrLanguageOptions
:
[
YHSingleOptionalItems
View
]
=
[]
var
dataModel
:
[
LanguageDetailModel
]
=
[]
{
var
dataModel
:
[
LanguageDetailModel
]
=
[]
{
...
@@ -64,11 +64,11 @@ class YHOtherLanguageSelecteView: UIView {
...
@@ -64,11 +64,11 @@ class YHOtherLanguageSelecteView: UIView {
}
}
}
}
override
func
layoutSubviews
()
{
//
override func layoutSubviews() {
super
.
layoutSubviews
()
//
super.layoutSubviews()
//
updateUI
()
//
updateUI()
}
//
}
}
}
...
@@ -162,6 +162,10 @@ extension YHOtherLanguageSelecteView {
...
@@ -162,6 +162,10 @@ extension YHOtherLanguageSelecteView {
make
.
height
.
equalTo
(
YHOtherMultipleChoiceItemView
.
viewH
)
//占位置
make
.
height
.
equalTo
(
YHOtherMultipleChoiceItemView
.
viewH
)
//占位置
}
}
optionView
.
block
=
{
model
in
self
.
block
?(
model
)
}
arrLanguageOptions
.
append
(
optionView
)
arrLanguageOptions
.
append
(
optionView
)
optionView
.
isHidden
=
true
optionView
.
isHidden
=
true
}
}
...
@@ -186,7 +190,11 @@ extension YHOtherLanguageSelecteView {
...
@@ -186,7 +190,11 @@ extension YHOtherLanguageSelecteView {
for
(
index
,
item
)
in
dataModel
.
enumerated
()
{
for
(
index
,
item
)
in
dataModel
.
enumerated
()
{
let
multiCheckView
=
arrLanguage
[
index
]
let
multiCheckView
=
arrLanguage
[
index
]
multiCheckView
.
dataModel
=
item
let
optionView
=
arrLanguageOptions
[
index
]
let
optionView
=
arrLanguageOptions
[
index
]
optionView
.
dataModel
=
item
if
index
==
0
{
if
index
==
0
{
multiCheckView
.
snp
.
remakeConstraints
{
make
in
multiCheckView
.
snp
.
remakeConstraints
{
make
in
make
.
top
.
left
.
right
.
equalToSuperview
()
make
.
top
.
left
.
right
.
equalToSuperview
()
...
...
galaxy/galaxy/Classes/Modules/IntelligentService(服务中心)/QMAS(优才)/ServiceProcess(我的信息流程)/OtherInformation(其他信息)/V/YHSingleOptionalItemsView.swift
View file @
0b467705
...
@@ -70,6 +70,12 @@ class YHSingleOptionalItemsView: UIView {
...
@@ -70,6 +70,12 @@ class YHSingleOptionalItemsView: UIView {
updateUI
()
updateUI
()
}
}
}
}
private
var
arrHoldView
:
[
YHOtherSingleChoiceItemView
]
=
[]
typealias
Block
=
(
LanguageDetailModel
?)
->
()
var
block
:
Block
?
}
}
...
@@ -94,43 +100,21 @@ private extension YHSingleOptionalItemsView {
...
@@ -94,43 +100,21 @@ private extension YHSingleOptionalItemsView {
make
.
top
.
equalTo
(
textFieldHoldView
.
snp
.
bottom
)
.
offset
(
8
)
make
.
top
.
equalTo
(
textFieldHoldView
.
snp
.
bottom
)
.
offset
(
8
)
make
.
left
.
right
.
equalToSuperview
()
make
.
left
.
right
.
equalToSuperview
()
make
.
height
.
equalTo
(
6
0
)
//for test hjl
make
.
height
.
equalTo
(
2
0
)
//for test hjl
make
.
bottom
.
equalToSuperview
()
make
.
bottom
.
equalToSuperview
()
}
}
//for test hjl
let
tmpOption
=
YHOtherSingleChoiceItemView
()
optionsHoldView
.
addSubview
(
tmpOption
)
tmpOption
.
snp
.
makeConstraints
{
make
in
make
.
top
.
equalToSuperview
()
.
offset
(
kMargin
)
make
.
left
.
equalToSuperview
()
.
offset
(
kMargin
)
make
.
right
.
equalToSuperview
()
.
offset
(
-
kMargin
)
}
let
tmpOption1
=
YHOtherSingleChoiceItemView
()
tmpOption1
.
isSelected
=
true
optionsHoldView
.
addSubview
(
tmpOption1
)
tmpOption1
.
snp
.
makeConstraints
{
make
in
make
.
top
.
equalTo
(
tmpOption
.
snp
.
bottom
)
.
offset
(
kMargin
)
make
.
left
.
equalToSuperview
()
.
offset
(
kMargin
)
make
.
right
.
equalToSuperview
()
.
offset
(
-
kMargin
)
}
let
tmpOption2
=
YHOtherSingleChoiceItemView
()
optionsHoldView
.
addSubview
(
tmpOption2
)
tmpOption2
.
snp
.
makeConstraints
{
make
in
make
.
top
.
equalTo
(
tmpOption1
.
snp
.
bottom
)
.
offset
(
kMargin
)
make
.
left
.
equalToSuperview
()
.
offset
(
kMargin
)
make
.
right
.
equalToSuperview
()
.
offset
(
-
kMargin
)
make
.
bottom
.
equalToSuperview
()
.
offset
(
-
kMargin
)
}
}
}
@objc
func
textFieldChanged
(
textField
:
UITextField
)
{
@objc
func
textFieldChanged
(
textField
:
UITextField
)
{
printLog
(
textField
.
text
)
printLog
(
textField
.
text
)
guard
let
model
=
dataModel
else
{
return
}
model
.
other_instructions
=
textField
.
text
??
""
// self.block?(model)
NotificationCenter
.
default
.
post
(
name
:
Notification
.
Name
(
rawValue
:
"com.yinhe.myCertificate.wechat.otherInfo_remark_notification"
),
object
:
model
)
}
}
func
updateUI
()
{
func
updateUI
()
{
...
@@ -144,6 +128,8 @@ private extension YHSingleOptionalItemsView {
...
@@ -144,6 +128,8 @@ private extension YHSingleOptionalItemsView {
if
model
.
id
==
3
{
if
model
.
id
==
3
{
languageTextField
.
text
=
model
.
other_instructions
textFieldHoldView
.
isHidden
=
false
textFieldHoldView
.
isHidden
=
false
optionsHoldView
.
snp
.
remakeConstraints
()
{
make
in
optionsHoldView
.
snp
.
remakeConstraints
()
{
make
in
make
.
top
.
equalTo
(
textFieldHoldView
.
snp
.
bottom
)
.
offset
(
8
)
make
.
top
.
equalTo
(
textFieldHoldView
.
snp
.
bottom
)
.
offset
(
8
)
...
@@ -165,11 +151,19 @@ private extension YHSingleOptionalItemsView {
...
@@ -165,11 +151,19 @@ private extension YHSingleOptionalItemsView {
var
lastView
:
UIView
?
var
lastView
:
UIView
?
arrHoldView
.
removeAll
()
for
(
index
,
item
)
in
model
.
options
.
enumerated
()
{
for
(
index
,
item
)
in
model
.
options
.
enumerated
()
{
let
tmpOption
=
YHOtherSingleChoiceItemView
()
let
tmpOption
=
YHOtherSingleChoiceItemView
()
tmpOption
.
dataModel
=
item
tmpOption
.
dataModel
=
item
optionsHoldView
.
addSubview
(
tmpOption
)
optionsHoldView
.
addSubview
(
tmpOption
)
arrHoldView
.
append
(
tmpOption
)
tmpOption
.
tag
=
index
let
tap
:
UITapGestureRecognizer
=
UITapGestureRecognizer
(
target
:
self
,
action
:
#selector(
tapItem(gestureRecognizer:)
)
)
tmpOption
.
addGestureRecognizer
(
tap
)
if
index
==
0
{
if
index
==
0
{
//第一个
//第一个
tmpOption
.
snp
.
makeConstraints
{
make
in
tmpOption
.
snp
.
makeConstraints
{
make
in
...
@@ -201,6 +195,33 @@ private extension YHSingleOptionalItemsView {
...
@@ -201,6 +195,33 @@ private extension YHSingleOptionalItemsView {
}
}
}
}
}
}
@objc
func
tapItem
(
gestureRecognizer
:
UITapGestureRecognizer
)
{
guard
let
model
=
dataModel
else
{
return
}
let
clickIndex
=
gestureRecognizer
.
view
?
.
tag
for
(
index
,
item
)
in
model
.
options
.
enumerated
()
{
if
clickIndex
==
index
{
if
!
item
.
select
{
item
.
select
=
true
}
else
{
return
}
}
else
{
item
.
select
=
false
}
}
for
(
index
,
item
)
in
arrHoldView
.
enumerated
()
{
let
data
=
model
.
options
[
index
]
item
.
dataModel
=
data
}
self
.
block
?(
model
)
}
}
}
...
...
galaxy/galaxy/Classes/Modules/IntelligentService(服务中心)/QMAS(优才)/ServiceProcess(我的信息流程)/OtherInformation(其他信息)/VM/YHOtherInfoFillViewModel.swift
View file @
0b467705
...
@@ -299,6 +299,7 @@ extension YHOtherInfoFillViewModel {
...
@@ -299,6 +299,7 @@ extension YHOtherInfoFillViewModel {
for
(
ii
,
tt
)
in
arr
.
enumerated
()
{
for
(
ii
,
tt
)
in
arr
.
enumerated
()
{
if
item
.
first_select
==
tt
.
id
{
if
item
.
first_select
==
tt
.
id
{
tt
.
select
=
true
tt
.
select
=
true
tt
.
other_instructions
=
item
.
other_instructions
let
arrTTT
=
item
.
second_select
.
split
(
separator
:
","
)
let
arrTTT
=
item
.
second_select
.
split
(
separator
:
","
)
...
...
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