Commit abeb0139 by doszhang

dos

parent 8a2b7155
...@@ -67,62 +67,21 @@ let noInfo = { ...@@ -67,62 +67,21 @@ let noInfo = {
let createPosterLock = false; let createPosterLock = false;
$('.loading-page').show();
preloadimages(preloadImageList, function () { preloadimages(preloadImageList, function () {
// initPage();
$('.page1').show();
let progress = 0.3; $('input[name=name]').attr('placeholder', '请输入姓名').attr('id', 'name');;
let timer = setInterval(function () { $('input[name=job-number]').attr('placeholder', '请输入工号').attr('type', 'tel');
if (progress < 1) { // blackUrl = $('.black').css('background-image').replace(/^url\((['"]?)(.*)\1\)$/, '$2');
progress += 0.05; // $('.black').css('background-image', 'none');
$('.loading-page .loading-text').text(Math.floor(progress * 100) + '%'); // let canvasinfo = initCanvas('.black', 'uploadCanvas', 259, 259);
$('.loading-page .progress').css('width', 368 * progress + 'px'); // uploadCanvas = canvasinfo[0];
$('.loading-page .plant').css('transform', 'translateX(' + (-368 + (368 * progress)) + 'px)'); // uploadCtx = canvasinfo[1];
} else {
clearInterval(timer); }, function (progress) {});
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)');
});
const originalHeight = document.documentElement.clientHeight || document.body.clientHeight; // const originalHeight = document.documentElement.clientHeight || document.body.clientHeight;
$(document).ready(function () { $(document).ready(function () {
...@@ -131,43 +90,38 @@ $(document).ready(function () { ...@@ -131,43 +90,38 @@ $(document).ready(function () {
window.scroll(0, 0); //失焦后强制让页面归位 window.scroll(0, 0); //失焦后强制让页面归位
}); });
$('.music').click(function () { //提交信息
if ($('#music')[0].paused) { $('.page1 .btn-next').on('click', toUploadPage);
$('#music')[0].play();
$('.music.stop').hide(); // $('input[name=btn-upload]').change(function () {
$('.music.play').show(); // $('.regulate-block').show();
musicStatus = true; // imgInfo = {};
} else { // img = '';
$('#music')[0].pause(); // bindUpload(this, uploadCtx, uploadCanvas, 1, function (img) {
$('.music.play').hide(); // avatar = img;
$('.music.stop').show(); // var mc = new Hammer($('#uploadCanvas').get(0));
musicStatus = false; // bindMc(mc, uploadCtx, uploadCanvas, img, imgInfo);
} // }, imgInfo);
}); // return false;
$('input[name=btn-upload]').change(function () { // });
$('.regulate-block').show(); // $('.btn-retry').on('click', () => {
imgInfo = {}; // $('input[name=btn-upload]').click()
img = ''; // });
bindUpload(this, uploadCtx, uploadCanvas, 1, function (img) { // //上传头像确认
avatar = img; // $('.page1 .btn-ok').on('click', confirmAvatar);
var mc = new Hammer($('#uploadCanvas').get(0)); // //检查用户输入后生成海报
bindMc(mc, uploadCtx, uploadCanvas, img, imgInfo); // $('.page1 .btn-go').on('click', checkInfo);
}, imgInfo); // //返回到首页
return false; // $('.poster-page .btn-backtohome').on('click', backToHome);
}); // //换一句
$('.btn-retry').on('click', () => { // $('.poster-page .btn-change').on('click', changePoster);
$('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() { function initPage() {
const headerHeight = 313; const headerHeight = 313;
const logoHeight = parseFloat($('.logo').css('height')); const logoHeight = parseFloat($('.logo').css('height'));
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment