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
6e96038b
Commit
6e96038b
authored
Feb 06, 2024
by
David黄金龙
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
基本资料 完成 全部的UI展示
parent
5e30ed6e
Changes
13
Hide whitespace changes
Inline
Side-by-side
Showing
13 changed files
with
262 additions
and
35 deletions
+262
-35
YHBasicInfoCellModel.swift
...ss(流程)/BaseInformation(基本资料)/M/YHBasicInfoCellModel.swift
+5
-1
YHBasicInfoFillView.swift
...ess(流程)/BaseInformation(基本资料)/V/YHBasicInfoFillView.swift
+181
-31
YHBasicInfoFillViewModel.swift
...)/BaseInformation(基本资料)/VM/YHBasicInfoFillViewModel.swift
+4
-3
Contents.json
...laxy/Res/Assets.xcassets/ServiceCenter/基本资料/Contents.json
+6
-0
Contents.json
...viceCenter/基本资料/basic_info_check_0.imageset/Contents.json
+22
-0
Rectangle 2490@2x.png
...er/基本资料/basic_info_check_0.imageset/Rectangle 2490@2x.png
+0
-0
Rectangle 2490@3x.png
...er/基本资料/basic_info_check_0.imageset/Rectangle 2490@3x.png
+0
-0
Contents.json
...viceCenter/基本资料/basic_info_check_1.imageset/Contents.json
+22
-0
Group 3040@2x.png
...Center/基本资料/basic_info_check_1.imageset/Group 3040@2x.png
+0
-0
Group 3040@3x.png
...Center/基本资料/basic_info_check_1.imageset/Group 3040@3x.png
+0
-0
Contents.json
...viceCenter/基本资料/basic_info_red_dot.imageset/Contents.json
+22
-0
_@2x.png
...s/ServiceCenter/基本资料/basic_info_red_dot.imageset/_@2x.png
+0
-0
_@3x.png
...s/ServiceCenter/基本资料/basic_info_red_dot.imageset/_@3x.png
+0
-0
No files found.
galaxy/galaxy/Classes/Modules/IntelligentService(服务中心)/ServiceProcess(流程)/BaseInformation(基本资料)/M/YHBasicInfoCellModel.swift
View file @
6e96038b
...
...
@@ -12,9 +12,13 @@ class YHBasicInfoCellModel {
var
question
:
String
=
""
var
answer
:
String
=
""
var
additionDes
:
String
=
""
init
(
question
:
String
,
answer
:
String
,
additionDes
:
String
)
{
var
model
:
backgroundModel
?
var
type
:
Int
=
0
//0- 输入型 1-选择型
init
(
question
:
String
,
answer
:
String
,
additionDes
:
String
,
type
:
Int
=
0
)
{
self
.
question
=
question
self
.
answer
=
answer
self
.
additionDes
=
additionDes
self
.
type
=
type
}
}
galaxy/galaxy/Classes/Modules/IntelligentService(服务中心)/ServiceProcess(流程)/BaseInformation(基本资料)/V/YHBasicInfoFillView.swift
View file @
6e96038b
...
...
@@ -93,6 +93,16 @@ class YHBasicInfoFillView: UIView, UITextViewDelegate {
}()
//多选框 holdView
private
lazy
var
mutilChoiceHoldView
:
UIView
=
{
let
view
=
UIView
()
view
.
backgroundColor
=
UIColor
.
contentBkgColor
view
.
layer
.
cornerRadius
=
kCornerRadius6
view
.
clipsToBounds
=
true
return
view
}()
var
title
:
String
?
{
didSet
{
if
let
question
=
title
{
...
...
@@ -158,28 +168,37 @@ private extension YHBasicInfoFillView {
addSubview
(
additionHoldView
)
additionHoldView
.
isHidden
=
true
let
redStar
=
UILabel
()
redStar
.
text
=
"*"
redStar
.
textColor
=
UIColor
.
failColor
additionHoldView
.
addSubview
(
redStar
)
redStar
.
snp
.
makeConstraints
{
make
in
let
redDot
=
UIImageView
(
image
:
UIImage
(
named
:
"basic_info_red_dot"
))
additionHoldView
.
addSubview
(
redDot
)
redDot
.
snp
.
makeConstraints
{
make
in
make
.
left
.
equalTo
(
12
)
make
.
top
.
equalTo
(
19
)
make
.
width
.
height
.
equalTo
(
6
)
}
let
textView
:
UITextView
=
UITextView
()
textView
.
backgroundColor
=
.
clear
textView
.
font
=
UIFont
.
PFSC_R
(
ofSize
:
14
)
additionHoldView
.
addSubview
(
textView
)
textView
.
snp
.
makeConstraints
{
make
in
make
.
top
.
equalTo
(
red
Star
.
snp
.
top
)
.
offset
(
-
7
)
make
.
left
.
equalTo
(
red
Star
.
snp
.
right
)
.
offset
(
2
)
make
.
right
.
equalTo
(
12
)
make
.
height
.
lessThanOrEqualTo
(
6
6
)
make
.
top
.
equalTo
(
red
Dot
.
snp
.
top
)
.
offset
(
-
7
)
make
.
left
.
equalTo
(
red
Dot
.
snp
.
right
)
.
offset
(
2
)
make
.
right
.
equalTo
(
-
12
)
make
.
bottom
.
equalTo
(
-
6
)
}
myTextView
=
textView
myTextView
.
delegate
=
self
textView
.
contentInset
=
UIEdgeInsets
(
top
:
-
8
,
left
:
0
,
bottom
:
0
,
right
:
0
)
addSubview
(
mutilChoiceHoldView
)
mutilChoiceHoldView
.
isHidden
=
true
mutilChoiceHoldView
.
snp
.
makeConstraints
{
make
in
make
.
edges
.
equalTo
(
0
)
}
}
@objc
func
didClickResponseBtn
(
btn
:
UIButton
)
{
...
...
@@ -200,6 +219,8 @@ private extension YHBasicInfoFillView {
updateAnswerButton
(
answer2Btn
,
false
)
additionHoldView
.
snp
.
removeConstraints
()
mutilChoiceHoldView
.
snp
.
removeConstraints
()
bottomLine
.
snp
.
remakeConstraints
{
make
in
make
.
top
.
equalTo
(
answer1Btn
.
snp
.
bottom
)
.
offset
(
12
)
make
.
left
.
right
.
equalToSuperview
()
...
...
@@ -208,31 +229,55 @@ private extension YHBasicInfoFillView {
}
additionHoldView
.
isHidden
=
true
bottomLine
.
isHidden
=
false
mutilChoiceHoldView
.
isHidden
=
true
model
?
.
answer
=
"N"
}
else
{
answer1Btn
.
isSelected
=
false
updateAnswerButton
(
answer1Btn
,
false
)
bottomLine
.
snp
.
removeConstraints
()
additionHoldView
.
snp
.
remakeConstraints
{
make
in
make
.
top
.
equalTo
(
answer1Btn
.
snp
.
bottom
)
.
offset
(
12
)
make
.
left
.
right
.
equalToSuperview
()
make
.
height
.
equalTo
(
78
)
make
.
bottom
.
equalToSuperview
()
.
offset
(
-
18
)
}
model
?
.
answer
=
"Y"
if
model
?
.
type
==
0
{
additionHoldView
.
snp
.
remakeConstraints
{
make
in
make
.
top
.
equalTo
(
answer1Btn
.
snp
.
bottom
)
.
offset
(
12
)
make
.
left
.
right
.
equalToSuperview
()
make
.
height
.
equalTo
(
78
)
make
.
bottom
.
equalToSuperview
()
.
offset
(
-
18
)
}
model
?
.
answer
=
"Y"
additionHoldView
.
isHidden
=
false
bottomLine
.
isHidden
=
true
mutilChoiceHoldView
.
isHidden
=
true
}
else
{
mutilChoiceHoldView
.
snp
.
remakeConstraints
{
make
in
make
.
top
.
equalTo
(
answer1Btn
.
snp
.
bottom
)
.
offset
(
12
)
make
.
left
.
right
.
equalToSuperview
()
// make.height.equalTo(78)
make
.
bottom
.
equalToSuperview
()
.
offset
(
-
18
)
}
model
?
.
answer
=
"Y"
additionHoldView
.
isHidden
=
true
bottomLine
.
isHidden
=
true
mutilChoiceHoldView
.
isHidden
=
false
}
additionHoldView
.
isHidden
=
false
bottomLine
.
isHidden
=
true
}
additionHoldView
.
layoutIfNeeded
()
bottomLine
.
layoutIfNeeded
()
mutilChoiceHoldView
.
layoutIfNeeded
()
block
?()
}
...
...
@@ -248,12 +293,110 @@ private extension YHBasicInfoFillView {
private
func
updateUI
()
{
guard
let
model
=
model
else
{
return
}
title
=
model
.
question
if
model
.
answer
==
"Y"
{
didClickResponseBtn
(
btn
:
answer2Btn
)
if
model
.
type
==
1
{
additionHoldView
.
isHidden
=
true
mutilChoiceHoldView
.
isHidden
=
false
let
lable
=
UILabel
()
let
str
=
"*选择成员:"
let
attributes
:
[
NSAttributedString
.
Key
:
Any
]
=
[
.
font
:
UIFont
.
PFSC_R
(
ofSize
:
14
),
.
foregroundColor
:
UIColor
.
mainTextColor
]
let
questionAttrStr
=
NSMutableAttributedString
(
string
:
str
,
attributes
:
attributes
)
let
starRange
=
NSRange
(
location
:
0
,
length
:
1
)
questionAttrStr
.
addAttribute
(
NSAttributedString
.
Key
.
foregroundColor
,
value
:
UIColor
.
failColor
,
range
:
starRange
)
lable
.
attributedText
=
questionAttrStr
mutilChoiceHoldView
.
addSubview
(
lable
)
lable
.
snp
.
makeConstraints
{
make
in
make
.
top
.
equalTo
(
12
)
make
.
left
.
equalTo
(
12
)
make
.
height
.
equalTo
(
20
)
make
.
right
.
equalTo
(
-
12
)
}
guard
let
subModel
=
model
.
model
else
{
return
}
var
targetView
:
UIView
=
lable
let
targetId
=
Int
(
subModel
.
background_member
?
.
info
??
"0"
)
for
(
index
,
item
)
in
subModel
.
subset
.
enumerated
()
{
let
name
=
item
.
subset_name
.
count
>
0
?
item
.
subset_name
:
"--"
let
btn
=
UIButton
(
type
:
.
custom
)
btn
.
setTitle
(
name
,
for
:
.
normal
)
btn
.
setTitle
(
name
,
for
:
.
selected
)
btn
.
titleLabel
?
.
font
=
UIFont
.
PFSC_R
(
ofSize
:
13
)
btn
.
setTitleColor
(
UIColor
.
mainTextColor
,
for
:
.
normal
)
btn
.
setTitleColor
(
UIColor
.
brandMainColor
,
for
:
.
selected
)
btn
.
setImage
(
UIImage
(
named
:
"basic_info_check_0"
),
for
:
.
normal
)
btn
.
setImage
(
UIImage
(
named
:
"basic_info_check_1"
),
for
:
.
selected
)
btn
.
iconInLeft
(
spacing
:
6
)
btn
.
tag
=
item
.
id
btn
.
addTarget
(
self
,
action
:
#selector(
clickCheckBtn(sender:)
)
,
for
:
.
touchUpInside
)
mutilChoiceHoldView
.
addSubview
(
btn
)
// btn.backgroundColor = .red//for test hjl
if
targetId
==
item
.
id
{
btn
.
isSelected
=
true
}
else
{
btn
.
isSelected
=
false
}
if
index
==
subModel
.
subset
.
count
-
1
{
btn
.
snp
.
makeConstraints
{
make
in
make
.
top
.
equalTo
(
targetView
.
snp
.
bottom
)
.
offset
(
kMargin
)
make
.
left
.
equalTo
(
16
)
make
.
height
.
equalTo
(
30
)
make
.
bottom
.
equalToSuperview
()
.
offset
(
-
kMargin
)
}
}
else
{
btn
.
snp
.
makeConstraints
{
make
in
make
.
top
.
equalTo
(
targetView
.
snp
.
bottom
)
.
offset
(
kMargin
)
make
.
left
.
equalTo
(
16
)
make
.
height
.
equalTo
(
30
)
}
}
title
=
model
.
question
if
model
.
answer
==
"Y"
{
didClickResponseBtn
(
btn
:
answer2Btn
)
myTextView
.
text
=
model
.
additionDes
}
else
{
if
model
.
answer
==
"N"
{
didClickResponseBtn
(
btn
:
answer1Btn
)
}
}
targetView
=
btn
}
}
else
{
if
model
.
answer
==
"N"
{
didClickResponseBtn
(
btn
:
answer1Btn
)
additionHoldView
.
isHidden
=
false
mutilChoiceHoldView
.
isHidden
=
true
title
=
model
.
question
if
model
.
answer
==
"Y"
{
didClickResponseBtn
(
btn
:
answer2Btn
)
myTextView
.
text
=
model
.
additionDes
}
else
{
if
model
.
answer
==
"N"
{
didClickResponseBtn
(
btn
:
answer1Btn
)
}
}
}
}
...
...
@@ -263,7 +406,7 @@ private extension YHBasicInfoFillView {
extension
YHBasicInfoFillView
:
UITextFieldDelegate
{
private
func
textViewDidBeginEditing
(
textView
:
UITextView
)
{
// if myTextView.
textColor == ph_TextColor && myTextView.isFirstResponder()
{
// if myTextView.
isFirstResponder
{
// myTextView.text = nil
// myTextView.textColor = .white
// }
...
...
@@ -271,10 +414,17 @@ extension YHBasicInfoFillView : UITextFieldDelegate {
private
func
textViewDidEndEditing
(
textView
:
UITextView
)
{
// if myTxtView.text.isEmpty || myTxtView.text == "" {
// myTxtView.textColor = .lightGray
// myTxtView.text = "Type your thoughts here..."
// }
if
textView
.
text
.
isEmpty
||
textView
.
text
==
""
{
textView
.
textColor
=
UIColor
(
hexString
:
"#C0C0C0"
)
textView
.
text
=
"如选择“是”,请详细说明"
}
else
{
textView
.
textColor
=
UIColor
.
mainTextColor
}
}
@objc
func
clickCheckBtn
(
sender
:
UIButton
)
{
sender
.
isSelected
=
!
sender
.
isSelected
}
}
galaxy/galaxy/Classes/Modules/IntelligentService(服务中心)/ServiceProcess(流程)/BaseInformation(基本资料)/VM/YHBasicInfoFillViewModel.swift
View file @
6e96038b
...
...
@@ -127,7 +127,8 @@ extension YHBasicInfoFillViewModel {
do
{
//家庭背景
let
model1
=
YHBasicInfoCellModel
(
question
:
"1、至少一名直系家庭成员(已婚配偶、父母、兄弟姊妹、子女)是现居于香港的香港永久性居民"
,
answer
:
dataModelForBasicInfo
.
background
?
.
background_member
?
.
has
??
""
,
additionDes
:
dataModelForBasicInfo
.
background
?
.
background_member
?
.
info
??
""
)
let
model1
=
YHBasicInfoCellModel
(
question
:
"1、至少一名直系家庭成员(已婚配偶、父母、兄弟姊妹、子女)是现居于香港的香港永久性居民"
,
answer
:
dataModelForBasicInfo
.
background
?
.
background_member
?
.
has
??
""
,
additionDes
:
dataModelForBasicInfo
.
background
?
.
background_member
?
.
info
??
""
,
type
:
1
)
model1
.
model
=
dataModelForBasicInfo
.
background
let
arr
=
[
model1
]
let
sessionModel
=
YHBasicInfoSessionModel
(
sessionTitle
:
"家庭背景"
,
arrQuestionItem
:
arr
)
...
...
@@ -141,8 +142,8 @@ extension YHBasicInfoFillViewModel {
extension
YHBasicInfoFillViewModel
{
//获取我的评分结果
func
getBasicInfo
(
params
:[
String
:
Any
],
callBackBlock
:
@escaping
(
_
success
:
Bool
,
_
error
:
YHErrorModel
?)
->
())
{
createOrgBasiceInfoData
()
callBackBlock
(
true
,
nil
)
//先返回数据 让界面展示相关的UI
//
createOrgBasiceInfoData()
//
callBackBlock(true,nil)//先返回数据 让界面展示相关的UI
let
strUrl
=
YHBaseUrlManager
.
shared
.
curURL
()
+
YHAllApiName
.
Basics
.
basicInfoApi
...
...
galaxy/galaxy/Res/Assets.xcassets/ServiceCenter/基本资料/Contents.json
0 → 100644
View file @
6e96038b
{
"info"
:
{
"author"
:
"xcode"
,
"version"
:
1
}
}
galaxy/galaxy/Res/Assets.xcassets/ServiceCenter/基本资料/basic_info_check_0.imageset/Contents.json
0 → 100644
View file @
6e96038b
{
"images"
:
[
{
"idiom"
:
"universal"
,
"scale"
:
"1x"
},
{
"filename"
:
"Rectangle 2490@2x.png"
,
"idiom"
:
"universal"
,
"scale"
:
"2x"
},
{
"filename"
:
"Rectangle 2490@3x.png"
,
"idiom"
:
"universal"
,
"scale"
:
"3x"
}
],
"info"
:
{
"author"
:
"xcode"
,
"version"
:
1
}
}
galaxy/galaxy/Res/Assets.xcassets/ServiceCenter/基本资料/basic_info_check_0.imageset/Rectangle 2490@2x.png
0 → 100644
View file @
6e96038b
587 Bytes
galaxy/galaxy/Res/Assets.xcassets/ServiceCenter/基本资料/basic_info_check_0.imageset/Rectangle 2490@3x.png
0 → 100644
View file @
6e96038b
864 Bytes
galaxy/galaxy/Res/Assets.xcassets/ServiceCenter/基本资料/basic_info_check_1.imageset/Contents.json
0 → 100644
View file @
6e96038b
{
"images"
:
[
{
"idiom"
:
"universal"
,
"scale"
:
"1x"
},
{
"filename"
:
"Group 3040@2x.png"
,
"idiom"
:
"universal"
,
"scale"
:
"2x"
},
{
"filename"
:
"Group 3040@3x.png"
,
"idiom"
:
"universal"
,
"scale"
:
"3x"
}
],
"info"
:
{
"author"
:
"xcode"
,
"version"
:
1
}
}
galaxy/galaxy/Res/Assets.xcassets/ServiceCenter/基本资料/basic_info_check_1.imageset/Group 3040@2x.png
0 → 100644
View file @
6e96038b
784 Bytes
galaxy/galaxy/Res/Assets.xcassets/ServiceCenter/基本资料/basic_info_check_1.imageset/Group 3040@3x.png
0 → 100644
View file @
6e96038b
1.11 KB
galaxy/galaxy/Res/Assets.xcassets/ServiceCenter/基本资料/basic_info_red_dot.imageset/Contents.json
0 → 100644
View file @
6e96038b
{
"images"
:
[
{
"idiom"
:
"universal"
,
"scale"
:
"1x"
},
{
"filename"
:
"_@2x.png"
,
"idiom"
:
"universal"
,
"scale"
:
"2x"
},
{
"filename"
:
"_@3x.png"
,
"idiom"
:
"universal"
,
"scale"
:
"3x"
}
],
"info"
:
{
"author"
:
"xcode"
,
"version"
:
1
}
}
galaxy/galaxy/Res/Assets.xcassets/ServiceCenter/基本资料/basic_info_red_dot.imageset/_@2x.png
0 → 100644
View file @
6e96038b
689 Bytes
galaxy/galaxy/Res/Assets.xcassets/ServiceCenter/基本资料/basic_info_red_dot.imageset/_@3x.png
0 → 100644
View file @
6e96038b
952 Bytes
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