Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
php
/
pingan-maruko
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
b6139a9b
authored
Jul 08, 2020
by
doszhang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dos
parent
733121a0
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
25 additions
and
31 deletions
+25
-31
Public/static/js/common.js
+25
-31
No files found.
Public/static/js/common.js
View file @
b6139a9b
...
@@ -139,41 +139,37 @@ $(document).ready(function () {
...
@@ -139,41 +139,37 @@ $(document).ready(function () {
$
(
'.page7 .btn-close-second'
).
on
(
'click'
,
hideSecond
)
$
(
'.page7 .btn-close-second'
).
on
(
'click'
,
hideSecond
)
$
(
'.page7 .btn-share'
).
on
(
'click'
,
showShare
)
$
(
'.page7 .btn-share'
).
on
(
'click'
,
showShare
)
$
(
'.share-block'
).
on
(
'click'
,
hideShare
)
$
(
'.share-block'
).
on
(
'click'
,
hideShare
)
$
(
'.btn-close-first'
).
on
(
'click'
,
hideFirst
)
$
(
'.btn-close-first'
).
on
(
'click'
,
hideFirst
)
$
(
'.btn-submit'
).
on
(
'click'
,
submitInfo
)
$
(
'.btn-submit'
).
on
(
'click'
,
submitInfo
)
$
(
'.page'
).
on
(
'
click
'
,
function
()
{
$
(
'.page'
).
on
(
'
touchstart
'
,
function
()
{
var
audio
=
document
.
getElementById
(
'music'
);
var
audio
=
document
.
getElementById
(
'music'
);
audio
.
play
();
audio
.
play
();
})
})
});
});
function
submitInfo
(){
function
submitInfo
()
{
if
(
!
submitLock
)
{
if
(
!
submitLock
)
{
submitLock
=
true
;
submitLock
=
true
;
const
name
=
$
(
'input[name=name]'
).
val
()
const
name
=
$
(
'input[name=name]'
).
val
()
const
tel
=
$
(
'input[name=tel]'
).
val
()
const
tel
=
$
(
'input[name=tel]'
).
val
()
const
address
=
$
(
'input[name=address]'
).
val
()
const
address
=
$
(
'input[name=address]'
).
val
()
if
(
name
.
match
(
/^
\s
*$/
))
if
(
name
.
match
(
/^
\s
*$/
))
{
{
$
(
'#notification_area'
).
remove
();
$
(
'#notification_area'
).
remove
();
my_notify
(
'请输入姓名'
)
my_notify
(
'请输入姓名'
)
return
false
;
return
false
;
}
}
if
(
tel
.
match
(
/^
\s
*$/
))
if
(
tel
.
match
(
/^
\s
*$/
))
{
{
$
(
'#notification_area'
).
remove
();
$
(
'#notification_area'
).
remove
();
my_notify
(
'请输入电话'
)
my_notify
(
'请输入电话'
)
return
false
;
return
false
;
}
}
if
(
!
tel
.
match
(
/^1
\d{10}
$/
))
if
(
!
tel
.
match
(
/^1
\d{10}
$/
))
{
{
$
(
'#notification_area'
).
remove
();
$
(
'#notification_area'
).
remove
();
my_notify
(
'电话号码输入有误'
)
my_notify
(
'电话号码输入有误'
)
return
false
;
return
false
;
}
}
if
(
address
.
match
(
/^
\s
*$/
))
if
(
address
.
match
(
/^
\s
*$/
))
{
{
$
(
'#notification_area'
).
remove
();
$
(
'#notification_area'
).
remove
();
my_notify
(
'请输入地址'
)
my_notify
(
'请输入地址'
)
return
false
;
return
false
;
...
@@ -187,19 +183,18 @@ function submitInfo(){
...
@@ -187,19 +183,18 @@ function submitInfo(){
tel
:
tel
,
tel
:
tel
,
address
:
address
address
:
address
},
},
success
:
function
(
resp
){
success
:
function
(
resp
)
{
if
(
resp
.
status
==
1
)
if
(
resp
.
status
==
1
)
{
{
$
(
'#notification_area'
).
remove
();
$
(
'#notification_area'
).
remove
();
my_notify
(
'信息已成功提交'
,
2000
);
my_notify
(
'信息已成功提交'
,
2000
);
setTimeout
(
function
()
{
setTimeout
(
function
()
{
$
(
'.first-block'
).
hide
();
$
(
'.first-block'
).
hide
();
$
(
'#notification_area'
).
remove
();
$
(
'#notification_area'
).
remove
();
my_notify
(
'请长按页面保存海报'
);
my_notify
(
'请长按页面保存海报'
);
submitLock
=
false
;
submitLock
=
false
;
},
2000
)
},
2000
)
}
else
{
}
else
{
$
(
'#notification_area'
).
remove
();
$
(
'#notification_area'
).
remove
();
my_notify
(
'网络错误,请重试'
);
my_notify
(
'网络错误,请重试'
);
}
}
...
@@ -208,9 +203,8 @@ function submitInfo(){
...
@@ -208,9 +203,8 @@ function submitInfo(){
}
}
}
}
function
hideFirst
(){
function
hideFirst
()
{
if
(
!
submitLock
)
if
(
!
submitLock
)
{
{
$
(
'.first-block'
).
hide
();
$
(
'.first-block'
).
hide
();
$
(
'#notification_area'
).
remove
();
$
(
'#notification_area'
).
remove
();
my_notify
(
'请长按页面保存海报'
);
my_notify
(
'请长按页面保存海报'
);
...
@@ -277,7 +271,7 @@ function showIntro() {
...
@@ -277,7 +271,7 @@ function showIntro() {
// introScrolltop = $('.wrap-inner').scrollTop();
// introScrolltop = $('.wrap-inner').scrollTop();
$
(
'.wrap-inner'
).
scrollTop
(
0
);
$
(
'.wrap-inner'
).
scrollTop
(
0
);
$
(
'.page1'
).
hide
();
$
(
'.page1'
).
hide
();
$
(
'.intro-page'
).
css
(
'height'
,
'100%'
).
show
();
$
(
'.intro-page'
).
css
(
'height'
,
'100%'
).
show
();
$
(
'.wrap-inner'
).
css
({
$
(
'.wrap-inner'
).
css
({
height
:
'100%'
,
height
:
'100%'
,
overflow
:
'hidden'
,
overflow
:
'hidden'
,
...
@@ -351,7 +345,7 @@ function toPage2() {
...
@@ -351,7 +345,7 @@ function toPage2() {
top
:
'50%'
top
:
'50%'
});
});
$
(
'.maruko'
).
css
(
'top'
,
837
-
parseInt
(
getTranslateDistance
())
+
'px'
)
$
(
'.maruko'
).
css
(
'top'
,
837
-
parseInt
(
getTranslateDistance
())
+
'px'
)
$
(
'.page1'
).
hide
();
$
(
'.page1'
).
hide
();
$
(
'.page2'
).
show
();
$
(
'.page2'
).
show
();
...
@@ -378,14 +372,14 @@ function showResult(event) {
...
@@ -378,14 +372,14 @@ function showResult(event) {
success
:
function
(
resp
)
{
success
:
function
(
resp
)
{
if
(
resp
.
status
==
1
)
{
if
(
resp
.
status
==
1
)
{
resultFlag
=
10
resultFlag
=
10
setTimeout
(
function
()
{
setTimeout
(
function
()
{
$
(
'.page7 .first-block'
).
show
();
$
(
'.page7 .first-block'
).
show
();
},
1000
);
},
1000
);
window
.
pt
=
'1'
window
.
pt
=
'1'
}
else
{
}
else
{
setTimeout
(
function
()
{
setTimeout
(
function
()
{
$
(
'.page7 .second-block'
).
show
();
$
(
'.page7 .second-block'
).
show
();
},
1000
);
},
1000
);
window
.
pt
=
'2'
window
.
pt
=
'2'
}
}
createPoster
(
resultFlag
)
createPoster
(
resultFlag
)
...
@@ -517,8 +511,8 @@ function getTranslateDistance(cardinal = 0, abs = false) {
...
@@ -517,8 +511,8 @@ function getTranslateDistance(cardinal = 0, abs = false) {
function
init
()
{
function
init
()
{
inited
=
true
;
inited
=
true
;
$
(
'input[name=name]'
).
attr
(
'maxLength'
,
10
)
$
(
'input[name=name]'
).
attr
(
'maxLength'
,
10
)
$
(
'input[name=tel]'
).
attr
(
'maxLength'
,
11
).
attr
(
'type'
,
'number'
)
$
(
'input[name=tel]'
).
attr
(
'maxLength'
,
11
).
attr
(
'type'
,
'number'
)
$
(
'.page6'
).
append
(
'<div class="leaves leaves-1"></div><div class="leaves leaves-2"></div><div class="leaves leaves-3"></div>'
);
$
(
'.page6'
).
append
(
'<div class="leaves leaves-1"></div><div class="leaves leaves-2"></div><div class="leaves leaves-3"></div>'
);
$
(
'.page1'
).
show
();
$
(
'.page1'
).
show
();
resizeCanvas
();
resizeCanvas
();
...
...
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