Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
php
/
maf
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
d78a521c
authored
Jan 14, 2020
by
doszhang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dos
parent
ff42db25
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
37 additions
and
26 deletions
+37
-26
Public/static/js/common.js
+37
-26
No files found.
Public/static/js/common.js
View file @
d78a521c
...
@@ -66,6 +66,8 @@ let answerArr = [];
...
@@ -66,6 +66,8 @@ let answerArr = [];
let
watchedQuestion
=
[
1
];
let
watchedQuestion
=
[
1
];
//结果
//结果
let
resultType
=
8
;
let
resultType
=
8
;
//提交信息按钮防抖
let
submit
=
true
;
//记录初始状态下fontsize
//记录初始状态下fontsize
const
fontSize
=
parseFloat
(
$
(
'html'
).
css
(
'fontSize'
));
const
fontSize
=
parseFloat
(
$
(
'html'
).
css
(
'fontSize'
));
...
@@ -146,33 +148,42 @@ $(document).ready(function () {
...
@@ -146,33 +148,42 @@ $(document).ready(function () {
});
});
function
submit
()
{
function
submit
()
{
const
name
=
$
(
'input[name=name]'
).
val
();
if
(
submit
)
{
const
tel
=
$
(
'input[name=tel]'
).
val
();
submit
=
false
;
const
name
=
$
(
'input[name=name]'
).
val
();
if
(
name
.
match
(
/^
\s
*$/
))
{
const
tel
=
$
(
'input[name=tel]'
).
val
();
$
(
'#notification_area'
).
remove
();
my_notify
(
'请填写姓名'
);
if
(
name
.
match
(
/^
\s
*$/
))
{
return
false
;
$
(
'#notification_area'
).
remove
();
}
else
if
(
!
tel
.
match
(
/^1
\d{10}
$/
))
{
my_notify
(
'请填写姓名'
);
$
(
'#notification_area'
).
remove
();
return
false
;
my_notify
(
'电话填写有误'
);
}
else
if
(
!
tel
.
match
(
/^1
\d{10}
$/
))
{
return
false
;
$
(
'#notification_area'
).
remove
();
}
my_notify
(
'电话填写有误'
);
return
false
;
$
.
ajax
({
url
:
'/index/commit'
,
type
:
'POST'
,
data
:
{
name
:
name
,
tel
:
tel
},
success
:
function
()
{
$
(
'.prize-page'
).
hide
();
$
(
'.poster-page'
).
show
();
$
(
'input[name=name]'
).
val
(
''
);
$
(
'input[name=tel]'
).
val
(
''
);
}
}
})
$
.
ajax
({
url
:
'/index/commit'
,
type
:
'POST'
,
data
:
{
name
:
name
,
tel
:
tel
},
success
:
function
()
{
$
(
'#notification_area'
).
remove
();
my_notify
(
'提交成功'
,
1500
);
setTimeout
(
function
()
{
$
(
'.prize-page'
).
hide
();
$
(
'.poster-page'
).
show
();
$
(
'input[name=name]'
).
val
(
''
);
$
(
'input[name=tel]'
).
val
(
''
);
submit
=
true
;
},
1500
);
}
})
}
}
}
function
tryprize
()
{
function
tryprize
()
{
...
...
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