Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
E
epidemic
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
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
史锦峰
epidemic
Commits
d4d0284a
Commit
d4d0284a
authored
Feb 16, 2020
by
lrw
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
手机、身份证 检验
parent
bde3dd45
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
32 additions
and
1 deletion
+32
-1
fillIn.vue
pages/fillIn/fillIn.vue
+31
-1
fillInDay.vue
pages/fillInDay/fillInDay.vue
+1
-0
No files found.
pages/fillIn/fillIn.vue
View file @
d4d0284a
...
...
@@ -74,7 +74,7 @@
<span
style=
"color:red;display: inline-block; vertical-align:inherit;margin-right:4upx"
v-if=
"item.required"
>
*
</span>
{{
index
+
1
}}
、
{{
item
.
label
}}
</view>
<input
class=
"text-right"
:placeholder=
"item.placeholder"
:type=
"item.controType"
:value=
"form[item.value]"
name=
"input"
@
input=
"updateInputVal($event,item.value)"
></input>
@
input=
"updateInputVal($event,item.value)"
@
blur=
"inputBlur($event,item)"
></input>
</view>
</
template
>
<view
class=
"margin-top-xs"
v-show=
"item.child && childItem.show"
v-for=
"(childItem,childIndex) in item.child"
:key=
"childItem.value"
>
...
...
@@ -488,6 +488,7 @@
titleClass
:
'
title
'
,
placeholder
:
'
请输入联系方式
'
,
type
:
'
input
'
,
validator
:
validate
.
isPhone
},
{
label
:
'
国籍
'
,
...
...
@@ -1314,6 +1315,8 @@
titleClass
:
'
title
'
,
placeholder
:
'
请输入身份证号/护照号
'
,
type
:
'
input
'
,
validator
:
validate
.
isIdCard
},
{
label
:
'
户籍地址
'
,
...
...
@@ -2063,6 +2066,17 @@
updateInputVal
(
event
,
props
)
{
this
.
form
[
props
]
=
event
.
target
.
value
},
// 输入框失去焦点
inputBlur
(
e
,
item
)
{
const
val
=
e
.
detail
.
value
if
(
item
.
validator
&&
!
item
.
validator
(
val
))
{
uni
.
showToast
({
icon
:
'
none
'
,
title
:
`
${
item
.
label
}
填写错误`
})
}
},
// 更新下拉框绑定的表单内容
updatePickerVal
(
event
,
item
)
{
const
opts
=
item
.
opts
...
...
@@ -2087,6 +2101,13 @@
formSubmit
()
{
let
flag
=
true
let
msg
=
''
if
(
this
.
form
.
agree
!=
1
)
{
uni
.
showToast
({
icon
:
'
none
'
,
title
:
`请勾选知情同意书`
})
return
}
for
(
let
i
=
0
;
i
<
this
.
list
.
length
;
i
++
)
{
if
(
this
.
list
[
i
].
required
)
{
const
val
=
this
.
form
[
this
.
list
[
i
].
value
]
...
...
@@ -2098,6 +2119,14 @@
})
break
}
if
(
this
.
list
[
i
].
validator
&&
!
this
.
list
[
i
].
validator
(
val
))
{
flag
=
false
uni
.
showToast
({
icon
:
'
none
'
,
title
:
`第
${
i
+
1
}
项
${
this
.
list
[
i
].
label
}
填写错误`
})
break
}
if
(
!
flag
)
{
break
}
...
...
@@ -2113,6 +2142,7 @@
uni
.
navigateBack
()
uni
.
showToast
({
icon
:
'
success
'
,
title
:
'
提交成功
'
})
}
else
{
uni
.
showToast
({
...
...
pages/fillInDay/fillInDay.vue
View file @
d4d0284a
...
...
@@ -820,6 +820,7 @@
uni
.
navigateBack
()
uni
.
showToast
({
icon
:
'
success
'
,
title
:
'
提交成功
'
})
}
else
{
uni
.
showToast
({
...
...
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