Toggle navigation
Toggle navigation
This project
Loading...
Sign in
fe
/
yoho-activity-platform
·
Commits
Go to a project
GitLab
Go to group
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
李奇
8 years ago
Commit
f0fe6a6d46a935f217ae1ad28183b09c30316d07
1 parent
eb94c7fe
创建活动验证添加
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
31 additions
and
3 deletions
apps/admin/views/action/activity/create.hbs
public/js/admin/activity.page.js
apps/admin/views/action/activity/create.hbs
View file @
f0fe6a6
...
...
@@ -16,7 +16,8 @@
</label>
<div
class=
"col-md-6 col-sm-6 col-xs-12"
>
<input
id=
"actName"
class=
"form-control col-md-7 col-xs-12"
data-validate-length-range=
"6"
data-validate-words=
"2"
name=
"actName"
data-toggle=
"tooltip"
data-placement=
"bottom"
title=
"活动名称不能为空"
name=
"actName"
type=
"text"
maxlength=
"50"
>
</div>
</div>
...
...
public/js/admin/activity.page.js
View file @
f0fe6a6
...
...
@@ -23,12 +23,17 @@ function bind_date_picker() {
function
bind_create_act
()
{
const
createFn
=
function
()
{
const
$form
=
$
(
'#createForm'
);
const
actName
=
$form
.
find
(
'#actName'
).
val
();
const
actTime
=
$form
.
find
(
'#activityTime'
).
val
();
const
$actName
=
$form
.
find
(
'#actName'
);
const
actName
=
$actName
.
val
().
trim
();
const
actTime
=
$form
.
find
(
'#activityTime'
).
val
().
trim
();
const
timeArray
=
actTime
.
split
(
' - '
);
const
startTime
=
toUnixTimestamp
(
timeArray
[
0
]);
const
endTime
=
toUnixTimestamp
(
timeArray
[
1
]);
if
(
!
actName
.
length
)
{
return
$actName
.
tooltip
(
'show'
);
}
$
.
ajax
({
method
:
'post'
,
url
:
'/admin/api/activity/create'
,
...
...
@@ -98,12 +103,34 @@ function bind_export_article_list() {
$
(
'.btn-export-article'
).
on
(
'click'
,
deleteFn
);
}
function
bind_act_name_blur
()
{
const
$name
=
$
(
'input[name=actName]'
);
$name
.
tooltip
({
trigger
:
'manual'
});
const
blurFn
=
function
()
{
const
$el
=
$
(
this
);
const
val
=
$el
.
val
().
trim
();
if
(
val
.
length
)
{
return
$name
.
tooltip
(
'hide'
);
}
$name
.
tooltip
(
'show'
);
};
$name
.
on
(
'blur'
,
blurFn
);
}
(
function
()
{
bind_date_picker
();
bind_create_act
();
bind_delete_act
();
bind_delete_article
();
bind_export_article_list
();
bind_act_name_blur
();
}());
...
...
Please
register
or
login
to post a comment