Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
S
ShenghuoquanBusiness
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
bp
ShenghuoquanBusiness
Commits
40033022
Commit
40033022
authored
Jun 22, 2021
by
yinjiacheng
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix SHQBD-103 统一社会信用代码输入限制18位字符、数字+大小写英文字母
parent
5f0dc74f
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
12 additions
and
4 deletions
+12
-4
LifeAccountBusinessLicenseAuthFragment.kt
...content/ui/auth/LifeAccountBusinessLicenseAuthFragment.kt
+7
-1
InputFilterUtil.kt
.../yidian/shenghuoquan/newscontent/utils/InputFilterUtil.kt
+3
-3
LifeAccountAuthBusinessInfoEditView.kt
...newscontent/widget/LifeAccountAuthBusinessInfoEditView.kt
+2
-0
No files found.
Components/newscontent/src/main/java/com/yidian/shenghuoquan/newscontent/ui/auth/LifeAccountBusinessLicenseAuthFragment.kt
View file @
40033022
...
...
@@ -78,8 +78,14 @@ class LifeAccountBusinessLicenseAuthFragment :
private
fun
initView
()
{
// 输入过滤
// 企业名称限制40汉字
viewBinding
.
evRegistrationName
.
setInputFilters
(
InputFilterUtil
.
getRegistrationNameFilter
(),
InputFilter
.
LengthFilter
(
40
))
viewBinding
.
evRegistrationCode
.
setInputFilters
(
InputFilterUtil
.
getRegistrationCodeFilter
(),
InputFilter
.
LengthFilter
(
18
))
// 统一信用代码限制18位数字+大小写英文字母 小写字母自动转换大写字母
viewBinding
.
evRegistrationCode
.
setInputFilters
(
InputFilterUtil
.
getRegistrationCodeFilter
(),
InputFilter
.
LengthFilter
(
18
),
InputFilter
.
AllCaps
()
)
}
...
...
Components/newscontent/src/main/java/com/yidian/shenghuoquan/newscontent/utils/InputFilterUtil.kt
View file @
40033022
...
...
@@ -66,11 +66,11 @@ class InputFilterUtil {
/**
* 统一社会信用代码过滤
* 数字 + 大写字母
* 数字 + 大
小
写字母
*/
fun
getRegistrationCodeFilter
():
InputFilter
{
return
InputFilter
{
source
,
_
,
_
,
_
,
_
,
_
->
val
pattern
=
Pattern
.
compile
(
"[0-9A-Z]+"
)
val
pattern
=
Pattern
.
compile
(
"[0-9A-Z
a-z
]+"
)
val
matcher
=
pattern
.
matcher
(
source
.
toString
())
if
(!
matcher
.
matches
())
return
@InputFilter
""
return
@InputFilter
null
...
...
@@ -81,7 +81,7 @@ class InputFilterUtil {
* 带回调的输入长度过滤
*/
fun
getLengthFilter
(
maxLength
:
Int
,
callback
:
OnLengthFilterCallback
?):
InputFilter
{
return
InputFilter
{
source
,
start
,
end
,
dest
,
dstart
,
dend
->
return
InputFilter
{
_
,
_
,
end
,
_
,
dstart
,
_
->
if
(
dstart
+
end
>=
maxLength
+
1
)
{
callback
?.
onLengthOverrun
(
maxLength
)
return
@InputFilter
""
...
...
Components/newscontent/src/main/java/com/yidian/shenghuoquan/newscontent/widget/LifeAccountAuthBusinessInfoEditView.kt
View file @
40033022
...
...
@@ -58,6 +58,7 @@ class LifeAccountAuthBusinessInfoEditView @JvmOverloads constructor(
fun
showErrorTips
(
tips
:
String
)
{
viewBinding
.
tvErrorTips
.
isVisible
=
true
viewBinding
.
tvErrorTips
.
text
=
tips
highLightEditContent
()
}
/**
...
...
@@ -66,6 +67,7 @@ class LifeAccountAuthBusinessInfoEditView @JvmOverloads constructor(
private
fun
dismissErrorTips
()
{
viewBinding
.
tvErrorTips
.
isVisible
=
false
viewBinding
.
tvErrorTips
.
text
=
""
cancelHighLightEditContent
()
}
/**
...
...
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