Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
php
/
samsung-christmas
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
d200c348
authored
Dec 18, 2019
by
doszhang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dos
parent
d2c1eed8
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
37 additions
and
29 deletions
+37
-29
Public/static/js/common.js
+37
-29
No files found.
Public/static/js/common.js
View file @
d200c348
...
...
@@ -71,6 +71,7 @@ var video = document.getElementsByClassName('video');
video
=
video
[
0
];
var
allowChangeTel
=
false
;
var
allowPrize
=
false
;
$
(
document
).
ready
(
function
()
{
$
(
"input"
).
on
(
"blur"
,
function
(){
...
...
@@ -97,6 +98,8 @@ $(document).ready(function () {
$
(
'input[name=tel]'
).
on
(
'input'
,
changeTel
);
//提交手机号
$
(
'.prize-page .btn-submit'
).
on
(
'click'
,
submitTel
);
//点击视频跳转抽奖
$
(
'.video-block'
).
on
(
'click'
,
tryPrize
);
});
function
submitTel
()
{
...
...
@@ -141,37 +144,42 @@ function backToMap () {
$
(
'.map-page'
).
show
();
}
function
videoEnd
(
event
)
{
$
(
'.video-block'
).
hide
();
if
(
window
.
type
==
0
)
function
videoEnd
()
{
allowPrize
=
true
;
video
.
removeEventListener
(
'ended'
,
videoEnd
);
}
function
tryPrize
()
{
if
(
allowPrize
)
{
$
.
ajax
({
url
:
'/index/tryprize'
,
type
:
'POST'
,
success
:
function
(
resp
)
{
if
(
resp
.
status
==
1
||
resp
.
status
==
0
)
{
$
(
'.map-page'
).
hide
();
$
(
'.prize-page'
).
show
();
showPrize
(
resp
.
prize_type
);
window
.
type
=
resp
.
prize_type
;
video
.
removeEventListener
(
'ended'
,
videoEnd
);
allowPrize
=
false
;
$
(
'.video-block'
).
hide
();
if
(
window
.
type
==
0
)
{
$
.
ajax
({
url
:
'/index/tryprize'
,
type
:
'POST'
,
success
:
function
(
resp
)
{
if
(
resp
.
status
==
1
||
resp
.
status
==
0
)
{
$
(
'.map-page'
).
hide
();
$
(
'.prize-page'
).
show
();
showPrize
(
resp
.
prize_type
);
window
.
type
=
resp
.
prize_type
;
}
}
}
});
}
else
{
$
(
'.map-page'
).
hide
();
$
(
'.prize-page'
).
show
();
showPrize
(
window
.
type
);
//提示领过奖并显示手机号
$
(
'#notification_area'
).
remove
();
my_notify
(
'您已经中过奖啦!'
);
$
(
'input[name=tel]'
).
val
(
window
.
tel
);
$
(
'.btn-submit'
).
hide
();
allowChangeTel
=
true
;
video
.
removeEventListener
(
'ended'
,
videoEnd
);
});
}
else
{
$
(
'.map-page'
).
hide
();
$
(
'.prize-page'
).
show
();
showPrize
(
window
.
type
);
//提示领过奖并显示手机号
$
(
'#notification_area'
).
remove
();
my_notify
(
'您已经中过奖啦!'
);
$
(
'input[name=tel]'
).
val
(
window
.
tel
);
$
(
'.btn-submit'
).
hide
();
allowChangeTel
=
true
;
}
}
}
...
...
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