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
a9c42df9
Commit
a9c42df9
authored
Feb 06, 2024
by
David黄金龙
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
处理 一处展示
parent
6e96038b
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
51 additions
and
21 deletions
+51
-21
YHBasicInfoFillView.swift
...ess(流程)/BaseInformation(基本资料)/V/YHBasicInfoFillView.swift
+51
-21
No files found.
galaxy/galaxy/Classes/Modules/IntelligentService(服务中心)/ServiceProcess(流程)/BaseInformation(基本资料)/V/YHBasicInfoFillView.swift
View file @
a9c42df9
...
@@ -130,6 +130,9 @@ class YHBasicInfoFillView: UIView, UITextViewDelegate {
...
@@ -130,6 +130,9 @@ class YHBasicInfoFillView: UIView, UITextViewDelegate {
private
var
lastSelectedBtn
:
UIButton
?
private
var
lastSelectedBtn
:
UIButton
?
private
var
myTextView
:
UITextView
!
private
var
myTextView
:
UITextView
!
private
var
arrCheckBtns
:
[
UIButton
]
=
[]
private
let
kTipsString
:
String
=
"如选择“是”,请详细说明"
}
}
...
@@ -190,6 +193,8 @@ private extension YHBasicInfoFillView {
...
@@ -190,6 +193,8 @@ private extension YHBasicInfoFillView {
myTextView
=
textView
myTextView
=
textView
myTextView
.
delegate
=
self
myTextView
.
delegate
=
self
// NotificationCenter.default.addObserver(self, selector: #selector(textViewDidChange?(<#T##textView: UITextView##UITextView#>)), name: textDidChangeNotification, object: nil)
textView
.
contentInset
=
UIEdgeInsets
(
top
:
-
8
,
left
:
0
,
bottom
:
0
,
right
:
0
)
textView
.
contentInset
=
UIEdgeInsets
(
top
:
-
8
,
left
:
0
,
bottom
:
0
,
right
:
0
)
...
@@ -293,16 +298,13 @@ private extension YHBasicInfoFillView {
...
@@ -293,16 +298,13 @@ private extension YHBasicInfoFillView {
private
func
updateUI
()
{
private
func
updateUI
()
{
guard
let
model
=
model
else
{
return
}
guard
let
model
=
model
else
{
return
}
arrCheckBtns
.
removeAll
()
if
model
.
type
==
1
{
if
model
.
type
==
1
{
additionHoldView
.
isHidden
=
true
additionHoldView
.
isHidden
=
true
mutilChoiceHoldView
.
isHidden
=
false
mutilChoiceHoldView
.
isHidden
=
false
let
lable
=
UILabel
()
let
lable
=
UILabel
()
let
str
=
"*选择成员:"
let
str
=
"*
选择成员:"
let
attributes
:
[
NSAttributedString
.
Key
:
Any
]
=
[
let
attributes
:
[
NSAttributedString
.
Key
:
Any
]
=
[
.
font
:
UIFont
.
PFSC_R
(
ofSize
:
14
),
.
font
:
UIFont
.
PFSC_R
(
ofSize
:
14
),
.
foregroundColor
:
UIColor
.
mainTextColor
.
foregroundColor
:
UIColor
.
mainTextColor
...
@@ -332,7 +334,7 @@ private extension YHBasicInfoFillView {
...
@@ -332,7 +334,7 @@ private extension YHBasicInfoFillView {
let
btn
=
UIButton
(
type
:
.
custom
)
let
btn
=
UIButton
(
type
:
.
custom
)
btn
.
setTitle
(
name
,
for
:
.
normal
)
btn
.
setTitle
(
name
,
for
:
.
normal
)
btn
.
setTitle
(
name
,
for
:
.
selected
)
btn
.
setTitle
(
name
,
for
:
.
selected
)
btn
.
titleLabel
?
.
font
=
UIFont
.
PFSC_
R
(
ofSize
:
13
)
btn
.
titleLabel
?
.
font
=
UIFont
.
PFSC_
M
(
ofSize
:
14
)
btn
.
setTitleColor
(
UIColor
.
mainTextColor
,
for
:
.
normal
)
btn
.
setTitleColor
(
UIColor
.
mainTextColor
,
for
:
.
normal
)
btn
.
setTitleColor
(
UIColor
.
brandMainColor
,
for
:
.
selected
)
btn
.
setTitleColor
(
UIColor
.
brandMainColor
,
for
:
.
selected
)
btn
.
setImage
(
UIImage
(
named
:
"basic_info_check_0"
),
for
:
.
normal
)
btn
.
setImage
(
UIImage
(
named
:
"basic_info_check_0"
),
for
:
.
normal
)
...
@@ -342,8 +344,6 @@ private extension YHBasicInfoFillView {
...
@@ -342,8 +344,6 @@ private extension YHBasicInfoFillView {
btn
.
addTarget
(
self
,
action
:
#selector(
clickCheckBtn(sender:)
)
,
for
:
.
touchUpInside
)
btn
.
addTarget
(
self
,
action
:
#selector(
clickCheckBtn(sender:)
)
,
for
:
.
touchUpInside
)
mutilChoiceHoldView
.
addSubview
(
btn
)
mutilChoiceHoldView
.
addSubview
(
btn
)
// btn.backgroundColor = .red//for test hjl
if
targetId
==
item
.
id
{
if
targetId
==
item
.
id
{
btn
.
isSelected
=
true
btn
.
isSelected
=
true
}
else
{
}
else
{
...
@@ -374,7 +374,7 @@ private extension YHBasicInfoFillView {
...
@@ -374,7 +374,7 @@ private extension YHBasicInfoFillView {
title
=
model
.
question
title
=
model
.
question
if
model
.
answer
==
"Y"
{
if
model
.
answer
==
"Y"
{
didClickResponseBtn
(
btn
:
answer2Btn
)
didClickResponseBtn
(
btn
:
answer2Btn
)
myTextView
.
text
=
model
.
additionDes
myTextView
.
text
=
model
.
additionDes
.
count
>
0
?
model
.
additionDes
:
kTipsString
}
else
{
}
else
{
if
model
.
answer
==
"N"
{
if
model
.
answer
==
"N"
{
didClickResponseBtn
(
btn
:
answer1Btn
)
didClickResponseBtn
(
btn
:
answer1Btn
)
...
@@ -383,7 +383,7 @@ private extension YHBasicInfoFillView {
...
@@ -383,7 +383,7 @@ private extension YHBasicInfoFillView {
targetView
=
btn
targetView
=
btn
arrCheckBtns
.
append
(
btn
)
}
}
}
else
{
}
else
{
additionHoldView
.
isHidden
=
false
additionHoldView
.
isHidden
=
false
...
@@ -392,38 +392,68 @@ private extension YHBasicInfoFillView {
...
@@ -392,38 +392,68 @@ private extension YHBasicInfoFillView {
title
=
model
.
question
title
=
model
.
question
if
model
.
answer
==
"Y"
{
if
model
.
answer
==
"Y"
{
didClickResponseBtn
(
btn
:
answer2Btn
)
didClickResponseBtn
(
btn
:
answer2Btn
)
myTextView
.
text
=
model
.
additionDes
myTextView
.
text
=
model
.
additionDes
.
count
>
0
?
model
.
additionDes
:
kTipsString
}
else
{
}
else
{
if
model
.
answer
==
"N"
{
if
model
.
answer
==
"N"
{
didClickResponseBtn
(
btn
:
answer1Btn
)
didClickResponseBtn
(
btn
:
answer1Btn
)
}
}
}
}
}
}
if
myTextView
.
text
==
kTipsString
{
myTextView
.
textColor
=
UIColor
(
hexString
:
"#C0C0C0"
)
}
else
{
myTextView
.
textColor
=
UIColor
.
mainTextColor
}
}
}
}
}
extension
YHBasicInfoFillView
:
UITextFieldDelegate
{
extension
YHBasicInfoFillView
:
UITextFieldDelegate
{
private
func
textViewDidBeginEditing
(
textView
:
UITextView
)
{
// if myTextView.isFirstResponder {
// myTextView.text = nil
// myTextView.textColor = .white
// }
}
func
textViewShouldBeginEditing
(
_
textView
:
UITextView
)
->
Bool
{
if
textView
.
text
==
kTipsString
{
textView
.
text
=
""
}
textView
.
textColor
=
UIColor
.
mainTextColor
return
true
}
private
func
textViewDidEndEditing
(
textView
:
UITextView
)
{
func
textViewShouldEndEditing
(
_
textView
:
UITextView
)
->
Bool
{
if
textView
.
text
.
isEmpty
||
textView
.
text
==
""
{
if
textView
.
text
.
isEmpty
||
textView
.
text
==
""
{
textView
.
textColor
=
UIColor
(
hexString
:
"#C0C0C0"
)
textView
.
textColor
=
UIColor
(
hexString
:
"#C0C0C0"
)
textView
.
text
=
"如选择“是”,请详细说明"
textView
.
text
=
kTipsString
}
textView
.
textColor
=
UIColor
.
mainTextColor
return
true
}
internal
func
textViewDidChange
(
_
textView
:
UITextView
)
{
if
textView
.
text
==
kTipsString
{
model
?
.
additionDes
=
""
}
else
{
}
else
{
textView
.
textColor
=
UIColor
.
mainTextColor
model
?
.
additionDes
=
textView
.
text
}
}
textView
.
textColor
=
UIColor
.
mainTextColor
}
}
@objc
func
clickCheckBtn
(
sender
:
UIButton
)
{
@objc
func
clickCheckBtn
(
sender
:
UIButton
)
{
sender
.
isSelected
=
!
sender
.
isSelected
//修改成单选逻辑
if
sender
.
isSelected
!=
true
{
for
item
in
arrCheckBtns
{
item
.
isSelected
=
false
}
sender
.
isSelected
=
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