Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
php
/
citic-mdrt
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
abeb0139
authored
Apr 20, 2020
by
doszhang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dos
parent
8a2b7155
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
41 additions
and
87 deletions
+41
-87
Public/static/js/common.js
+41
-87
No files found.
Public/static/js/common.js
View file @
abeb0139
...
...
@@ -67,62 +67,21 @@ let noInfo = {
let
createPosterLock
=
false
;
$
(
'.loading-page'
).
show
();
preloadimages
(
preloadImageList
,
function
()
{
// initPage();
$
(
'.page1'
).
show
();
let
progress
=
0.3
;
let
timer
=
setInterval
(
function
()
{
if
(
progress
<
1
)
{
progress
+=
0.05
;
$
(
'.loading-page .loading-text'
).
text
(
Math
.
floor
(
progress
*
100
)
+
'%'
);
$
(
'.loading-page .progress'
).
css
(
'width'
,
368
*
progress
+
'px'
);
$
(
'.loading-page .plant'
).
css
(
'transform'
,
'translateX('
+
(
-
368
+
(
368
*
progress
))
+
'px)'
);
}
else
{
$
(
'input[name=name]'
).
attr
(
'placeholder'
,
'请输入姓名'
).
attr
(
'id'
,
'name'
);;
$
(
'input[name=job-number]'
).
attr
(
'placeholder'
,
'请输入工号'
).
attr
(
'type'
,
'tel'
);
// blackUrl = $('.black').css('background-image').replace(/^url\((['"]?)(.*)\1\)$/, '$2');
// $('.black').css('background-image', 'none');
// let canvasinfo = initCanvas('.black', 'uploadCanvas', 259, 259);
// uploadCanvas = canvasinfo[0];
// uploadCtx = canvasinfo[1];
clearInterval
(
timer
);
const
timestamp
=
timest
();
if
(
browser
.
versions
.
weixin
)
{
let
musicTime
=
setInterval
(
function
()
{
if
(
$
(
'#music'
)[
0
].
currentTime
>
0
)
{
initPage
();
$
(
'.loading-page'
).
hide
();
$
(
'.page1'
).
show
();
if
(
timestamp
>
1584720000
)
{
$
(
'.end-page'
).
show
();
}
clearInterval
(
musicTime
);
}
},
100
);
}
else
{
initPage
();
$
(
'.loading-page'
).
hide
();
$
(
'.page1'
).
show
();
if
(
timestamp
>
1584720000
)
{
$
(
'.end-page'
).
show
();
}
}
}
},
60
);
$
(
'input[name=name]'
).
attr
(
'placeholder'
,
'姓名'
).
attr
(
'id'
,
'name'
);;
$
(
'input[name=business]'
).
attr
(
'placeholder'
,
'业务号'
).
attr
(
'type'
,
'tel'
).
attr
(
'maxlength'
,
10
);
$
(
'.page1 .num'
).
html
(
'已有<span class="numbig">'
+
window
.
num
+
'</span>人发起承诺'
);
blackUrl
=
$
(
'.black'
).
css
(
'background-image'
).
replace
(
/^url
\(([
'"
]?)(
.*
)\1\)
$/
,
'$2'
);
$
(
'.black'
).
css
(
'background-image'
,
'none'
);
let
canvasinfo
=
initCanvas
(
'.black'
,
'uploadCanvas'
,
259
,
259
);
uploadCanvas
=
canvasinfo
[
0
];
uploadCtx
=
canvasinfo
[
1
];
},
function
(
progress
)
{
progress
=
progress
*
0.3
;
$
(
'.loading-page .loading-text'
).
text
(
Math
.
floor
(
progress
*
100
)
+
'%'
);
$
(
'.loading-page .progress'
).
css
(
'width'
,
368
*
progress
+
'px'
);
$
(
'.loading-page .plant'
).
css
(
'transform'
,
'translateX('
+
(
-
368
+
(
368
*
progress
))
+
'px)'
);
});
},
function
(
progress
)
{});
const
originalHeight
=
document
.
documentElement
.
clientHeight
||
document
.
body
.
clientHeight
;
//
const originalHeight = document.documentElement.clientHeight || document.body.clientHeight;
$
(
document
).
ready
(
function
()
{
...
...
@@ -131,43 +90,38 @@ $(document).ready(function () {
window
.
scroll
(
0
,
0
);
//失焦后强制让页面归位
});
$
(
'.music'
).
click
(
function
()
{
if
(
$
(
'#music'
)[
0
].
paused
)
{
$
(
'#music'
)[
0
].
play
();
$
(
'.music.stop'
).
hide
();
$
(
'.music.play'
).
show
();
musicStatus
=
true
;
}
else
{
$
(
'#music'
)[
0
].
pause
();
$
(
'.music.play'
).
hide
();
$
(
'.music.stop'
).
show
();
musicStatus
=
false
;
}
});
$
(
'input[name=btn-upload]'
).
change
(
function
()
{
$
(
'.regulate-block'
).
show
();
imgInfo
=
{};
img
=
''
;
bindUpload
(
this
,
uploadCtx
,
uploadCanvas
,
1
,
function
(
img
)
{
avatar
=
img
;
var
mc
=
new
Hammer
(
$
(
'#uploadCanvas'
).
get
(
0
));
bindMc
(
mc
,
uploadCtx
,
uploadCanvas
,
img
,
imgInfo
);
},
imgInfo
);
return
false
;
});
$
(
'.btn-retry'
).
on
(
'click'
,
()
=>
{
$
(
'input[name=btn-upload]'
).
click
()
});
//上传头像确认
$
(
'.page1 .btn-ok'
).
on
(
'click'
,
confirmAvatar
);
//检查用户输入后生成海报
$
(
'.page1 .btn-go'
).
on
(
'click'
,
checkInfo
);
//返回到首页
$
(
'.poster-page .btn-backtohome'
).
on
(
'click'
,
backToHome
);
//换一句
$
(
'.poster-page .btn-change'
).
on
(
'click'
,
changePoster
);
//提交信息
$
(
'.page1 .btn-next'
).
on
(
'click'
,
toUploadPage
);
// $('input[name=btn-upload]').change(function () {
// $('.regulate-block').show();
// imgInfo = {};
// img = '';
// bindUpload(this, uploadCtx, uploadCanvas, 1, function (img) {
// avatar = img;
// var mc = new Hammer($('#uploadCanvas').get(0));
// bindMc(mc, uploadCtx, uploadCanvas, img, imgInfo);
// }, imgInfo);
// return false;
// });
// $('.btn-retry').on('click', () => {
// $('input[name=btn-upload]').click()
// });
// //上传头像确认
// $('.page1 .btn-ok').on('click', confirmAvatar);
// //检查用户输入后生成海报
// $('.page1 .btn-go').on('click', checkInfo);
// //返回到首页
// $('.poster-page .btn-backtohome').on('click', backToHome);
// //换一句
// $('.poster-page .btn-change').on('click', changePoster);
});
function
toUploadPage
()
{
$
(
'.page1'
).
hide
();
$
(
'.upload-page'
).
show
();
}
function
initPage
()
{
const
headerHeight
=
313
;
const
logoHeight
=
parseFloat
(
$
(
'.logo'
).
css
(
'height'
));
...
...
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