Toggle navigation
Toggle navigation
This project
Loading...
Sign in
liuloulou
/
yohobuy-portal-fe2
·
Commits
Go to a project
GitLab
Go to dashboard
Project
Activity
Files
Commits
Pipelines
0
Builds
0
Graphs
Milestones
Issues
0
Merge Requests
0
Members
Labels
Wiki
Forks
Network
Create a new issue
Download as
Email Patches
Plain Diff
Browse Files
Authored by
ZhongW
9 years ago
Commit
9774ad3220005e958d6025671655621c60ad88a0
1 parent
ce857747
优惠折扣修改
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
9 additions
and
7 deletions
code/apps/marketing/views/PromotionCode/Edit.html
code/static/js.jquery/common/edit.js
code/static/js.jquery/common/validate.js
code/apps/marketing/views/PromotionCode/Edit.html
View file @
9774ad3
...
...
@@ -143,9 +143,9 @@
<
div
class
=
"form-inline"
>
<
div
class
=
"form-group"
id
=
"resultdiscount"
>
打
<
input
type
=
"text"
class
=
"form-control observe"
placeholder
=
"
0.0
0"
<
input
type
=
"text"
class
=
"form-control observe"
placeholder
=
"
优惠结果,格式:0.
0"
id
=
"discount"
value
=
"[[discount]]"
required
pattern
=
"^
0(.\d{1,2
})?$"
value
=
"[[discount]]"
required
pattern
=
"^
\d(.\d{1,1
})?$"
data
-
field
=
"discount"
>
折
,
<
/div
>
...
...
code/static/js.jquery/common/edit.js
View file @
9774ad3
...
...
@@ -273,13 +273,13 @@ edit.prototype = {
err
.
push
(
"<p>"
+
name
+
"不可为空</p>"
);
});
}
if
((
id
||
name
)
&&
$
(
this
).
attr
(
"
match
"
)
&&
$
.
trim
(
$
(
this
).
val
()))
{
if
((
id
||
name
)
&&
$
(
this
).
attr
(
"
pattern
"
)
&&
$
.
trim
(
$
(
this
).
val
()))
{
new
Validator
.
init
(
$
(
this
)[
0
],
{
rules
:
{
match
:
$
(
this
).
attr
(
"
match
"
)
match
:
$
(
this
).
attr
(
"
pattern
"
)
}
}).
validate
(
function
(
obj
)
{
err
.
push
(
"<p>"
+
name
+
"请输入正确的格式</p>"
);
err
.
push
(
"<p>"
+
name
.
split
(
","
)[
0
]
+
"请输入正确的格式</p>"
);
});
}
...
...
code/static/js.jquery/common/validate.js
View file @
9774ad3
...
...
@@ -86,8 +86,10 @@ fn.max = function(param) {
fn
.
match
=
function
(
param
)
{
var
re
=
this
.
regExps
[
param
];
if
(
!
re
)
{
throw
new
Error
(
param
+
':'
+
Object
.
keys
(
this
.
options
.
regExps
).
join
(
', '
));
var
regrex
=
new
RegExp
(
param
,
'g'
)
return
regrex
.
test
(
this
.
value
);
//throw new Error(param + ':'
// + Object.keys(this.options.regExps).join(', '));
}
return
this
.
regExps
[
param
].
test
(
this
.
value
);
};
...
...
Please
register
or
login
to post a comment