Toggle navigation
Toggle navigation
This project
Loading...
Sign in
fe
/
yoho-blk
·
Commits
Go to a project
GitLab
Go to group
Project
Activity
Files
Commits
Pipelines
0
Builds
0
Graphs
Milestones
Issues
0
Merge Requests
1
Members
Labels
Wiki
Forks
Network
Create a new issue
Download as
Email Patches
Plain Diff
Browse Files
Authored by
郝肖肖
9 years ago
Commit
b79bead2cd4341ecc9058fd31f217cf0e8141d64
1 parent
46bbe537
退换货手机号带星号处理
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
24 additions
and
4 deletions
public/js/me/exchange.page.js
public/js/me/exchange.page.js
View file @
b79bead
...
...
@@ -11,7 +11,7 @@ var addr;
var
addressReg
=
/^
[\s\S]{2,100}
$/
;
var
phoneReg
=
/^
(
13
[
0-9
]
|15
[
012356789
]
|17
[
678
]
|18
[
0-9
]
|14
[
57
])[
0-9
]{8}
$/
;
var
mobDefault
=
$
(
'#mob'
).
val
();
// 手机号默认值
var
validate
=
require
(
'./order/validation'
);
var
imgBoxTpl
=
require
(
'../../tpl/me/thumbnail.hbs'
);
...
...
@@ -42,6 +42,13 @@ var validateMap = {
reg
:
phoneReg
,
errMsg
:
'您输入的联系电话格式不正确'
}
},
mob1
:
{
sl
:
'#mob'
,
v
:
{
reg
:
/^
(
13
[
0-9
]
|15
[
012356789
]
|17
[
678
]
|18
[
0-9
]
|14
[
57
])[
0-9, *
]{8}
$/
,
errMsg
:
'您输入的联系电话格式不正确'
}
}
};
...
...
@@ -259,9 +266,16 @@ function validateData() {
$inputs
.
each
(
function
(
idx
,
input
)
{
var
k
=
input
.
id
;
var
v
=
null
;
if
(
k
&&
validateMap
[
k
])
{
if
(
!
validate
.
start
(
validateMap
[
k
].
sl
,
validateMap
[
k
].
v
))
{
v
=
validateMap
[
k
];
if
(
validateMap
[
k
].
sl
===
'#mob'
&&
mobDefault
===
$
(
this
).
val
())
{
v
=
validateMap
.
mob1
;
}
if
(
!
validate
.
start
(
v
.
sl
,
v
.
v
))
{
pass
=
false
;
}
}
...
...
@@ -346,9 +360,15 @@ function bindConfirmEvent() {
function
bindBlurEvent
()
{
$
(
'.express-info-box .require input'
).
on
(
'blur'
,
function
()
{
var
$this
=
$
(
this
);
var
v
=
validateMap
[
this
.
id
];
var
v
=
null
;
if
(
$this
.
val
().
length
>
0
&&
validateMap
[
this
.
id
])
{
v
=
validateMap
[
this
.
id
];
if
(
v
.
sl
===
'#mob'
&&
mobDefault
===
$
(
this
).
val
())
{
v
=
validateMap
.
mob1
;
}
if
(
$this
.
val
().
length
>
0
)
{
validate
.
start
(
v
.
sl
,
v
.
v
);
}
});
...
...
Please
register
or
login
to post a comment