Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
h5
/
account
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit 6f7f2537
authored
Apr 22, 2022
by
匡雅琴
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
驻店电话校验规则修改
1 parent
2d1c705b
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
14 additions
and
7 deletions
html/merchant/add.html
html/merchant/addSubMerchant.html
html/merchant/edit.html
js/validator.js
html/merchant/add.html
View file @
6f7f253
...
@@ -378,7 +378,7 @@
...
@@ -378,7 +378,7 @@
<div
class=
"layui-form-item"
>
<div
class=
"layui-form-item"
>
<label
class=
"layui-form-label"
>
驻店电话:
</label>
<label
class=
"layui-form-label"
>
驻店电话:
</label>
<div
class=
"layui-input-inline"
>
<div
class=
"layui-input-inline"
>
<input
class=
"layui-input"
name=
"residentPhone"
maxlength=
"1
1
"
placeholder=
"请输入驻店电话"
<input
class=
"layui-input"
name=
"residentPhone"
maxlength=
"1
3
"
placeholder=
"请输入驻店电话"
lay-verify=
"residentPhone"
/>
lay-verify=
"residentPhone"
/>
</div>
</div>
</div>
</div>
...
@@ -797,7 +797,7 @@
...
@@ -797,7 +797,7 @@
},
},
residentPhone
:
function
(
value
)
{
residentPhone
:
function
(
value
)
{
if
(
value
&&
!
validator
.
checkPhoneNumber
(
value
))
{
if
(
value
&&
!
validator
.
checkPhoneNumber
Two
(
value
))
{
return
'请填入正确的驻店电话'
return
'请填入正确的驻店电话'
}
}
},
},
...
...
html/merchant/addSubMerchant.html
View file @
6f7f253
...
@@ -366,7 +366,7 @@
...
@@ -366,7 +366,7 @@
<div
class=
"layui-form-item"
>
<div
class=
"layui-form-item"
>
<label
class=
"layui-form-label"
>
驻店电话:
</label>
<label
class=
"layui-form-label"
>
驻店电话:
</label>
<div
class=
"layui-input-inline"
>
<div
class=
"layui-input-inline"
>
<input
class=
"layui-input"
name=
"residentPhone"
maxlength=
"1
1
"
placeholder=
"请输入驻店电话"
<input
class=
"layui-input"
name=
"residentPhone"
maxlength=
"1
3
"
placeholder=
"请输入驻店电话"
lay-verify=
"residentPhone"
/>
lay-verify=
"residentPhone"
/>
</div>
</div>
</div>
</div>
...
@@ -794,7 +794,7 @@
...
@@ -794,7 +794,7 @@
}
}
},
},
residentPhone
:
function
(
value
)
{
residentPhone
:
function
(
value
)
{
if
(
value
&&
!
validator
.
checkPhoneNumber
(
value
))
{
if
(
value
&&
!
validator
.
checkPhoneNumber
Two
(
value
))
{
return
'请填入正确的驻店电话'
return
'请填入正确的驻店电话'
}
}
},
},
...
...
html/merchant/edit.html
View file @
6f7f253
...
@@ -450,7 +450,7 @@
...
@@ -450,7 +450,7 @@
<div
class=
"layui-form-item"
>
<div
class=
"layui-form-item"
>
<label
class=
"layui-form-label"
>
驻店电话:
</label>
<label
class=
"layui-form-label"
>
驻店电话:
</label>
<div
class=
"layui-input-inline"
>
<div
class=
"layui-input-inline"
>
<input
class=
"layui-input"
name=
"residentPhone"
maxlength=
"1
1
"
placeholder=
"请输入驻店电话"
<input
class=
"layui-input"
name=
"residentPhone"
maxlength=
"1
3
"
placeholder=
"请输入驻店电话"
lay-verify=
"residentPhone"
/>
lay-verify=
"residentPhone"
/>
</div>
</div>
</div>
</div>
...
@@ -794,7 +794,7 @@
...
@@ -794,7 +794,7 @@
}
}
},
},
residentPhone
:
function
(
value
)
{
residentPhone
:
function
(
value
)
{
if
(
value
&&
!
validator
.
checkPhoneNumber
(
value
))
{
if
(
value
&&
!
validator
.
checkPhoneNumber
Two
(
value
))
{
return
'请填入正确的驻店电话'
return
'请填入正确的驻店电话'
}
}
},
},
...
...
js/validator.js
View file @
6f7f253
...
@@ -3,6 +3,9 @@ layui.define(['store'], function (exports) {
...
@@ -3,6 +3,9 @@ layui.define(['store'], function (exports) {
/* 手机号码格式校验正则 */
/* 手机号码格式校验正则 */
PHONEREG
:
/^
(
13
[
0-9
]
|15
[
0-9
]
|16
[
0-9
]
|17
[
0-9
]
|18
[
0-9
]
|19
[
0-9
]
|14
[
0-9
])[
0-9
]{8}
$/
,
PHONEREG
:
/^
(
13
[
0-9
]
|15
[
0-9
]
|16
[
0-9
]
|17
[
0-9
]
|18
[
0-9
]
|19
[
0-9
]
|14
[
0-9
])[
0-9
]{8}
$/
,
/* 手机号码或固话格式校验正则 */
PHONETWO
:
/^
((
0
\d{2,3}
-
\d{7,8})
|
(
1
[
34578
]\d{9}))
$/
,
/* 同时包含字母和数字 */
/* 同时包含字母和数字 */
ISNUMANDLETTERS
:
/^
[
a-zA-Z0-9
]
+$/
,
ISNUMANDLETTERS
:
/^
[
a-zA-Z0-9
]
+$/
,
...
@@ -39,6 +42,10 @@ layui.define(['store'], function (exports) {
...
@@ -39,6 +42,10 @@ layui.define(['store'], function (exports) {
checkPhoneNumber
:
function
(
str
)
{
checkPhoneNumber
:
function
(
str
)
{
return
validator
.
PHONEREG
.
test
(
str
)
return
validator
.
PHONEREG
.
test
(
str
)
},
},
// 驻店电话校验规则
checkPhoneNumberTwo
:
function
(
str
)
{
return
validator
.
PHONETWO
.
test
(
str
)
},
// 判断是否含有数字或字母
// 判断是否含有数字或字母
checkNumOrLetters
:
function
(
str
)
{
checkNumOrLetters
:
function
(
str
)
{
...
@@ -88,7 +95,7 @@ layui.define(['store'], function (exports) {
...
@@ -88,7 +95,7 @@ layui.define(['store'], function (exports) {
var
pass
=
true
var
pass
=
true
// 身份证位数为15或18位
// 身份证位数为15或18位
// if (![15, 18].includes(code.length)) {
// if (![15, 18].includes(code.length)) {
if
(
!
(
(
code
.
length
==
15
)
||
(
code
.
length
==
18
)
))
{
if
(
!
(
code
.
length
==
15
||
code
.
length
==
18
))
{
pass
=
false
pass
=
false
}
else
if
(
!
code
||
(
code
.
length
===
18
&&
!
/^
\d{6}(
18|19|20
)\d{2}(
0
[
1-9
]
|1
[
012
])(
0
[
1-9
]
|
[
12
]\d
|3
[
01
])\d{3}(\d
|X
)
$/i
.
test
(
code
)))
{
}
else
if
(
!
code
||
(
code
.
length
===
18
&&
!
/^
\d{6}(
18|19|20
)\d{2}(
0
[
1-9
]
|1
[
012
])(
0
[
1-9
]
|
[
12
]\d
|3
[
01
])\d{3}(\d
|X
)
$/i
.
test
(
code
)))
{
// tip = '身份证号格式错误'
// tip = '身份证号格式错误'
...
...
Write
Preview
Markdown
is supported
Attach a file
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 post a comment