Commit 1bbac200 by doszhang

dos

parent e43b6c29
...@@ -496,4 +496,12 @@ input[name=signature]::-webkit-input-placeholder { ...@@ -496,4 +496,12 @@ input[name=signature]::-webkit-input-placeholder {
.poster-tip { .poster-tip {
z-index: 1; z-index: 1;
}
.posterImg {
position: absolute;
top: 0;
z-index: 1;
width: 100%;
height: 100%;
} }
\ No newline at end of file
...@@ -338,6 +338,8 @@ $(document).ready(function () { ...@@ -338,6 +338,8 @@ $(document).ready(function () {
}); });
function createPoster() { function createPoster() {
$('.poster-page .poster-canvas-block').append('<img class="posterImg" src="" />');
// 创建海报页面的flag列表 // 创建海报页面的flag列表
for (let i = 0; i < flagStack.length; i++) { for (let i = 0; i < flagStack.length; i++) {
createList('.poster-page .poster-list', flagStack[i], i + 1); createList('.poster-page .poster-list', flagStack[i], i + 1);
...@@ -393,7 +395,7 @@ function createPoster() { ...@@ -393,7 +395,7 @@ function createPoster() {
posterCtx.drawImage(decorate, pxToRem(170), pxToRem(305), pxToRem(300), pxToRem(150)); posterCtx.drawImage(decorate, pxToRem(170), pxToRem(305), pxToRem(300), pxToRem(150));
flagTextDraw(posterCtx, signature, pxToRem(40), '#222222', pxToRem(230), bottomHalfTop + pxToRem(103)); flagTextDraw(posterCtx, signature, pxToRem(40), '#222222', pxToRem(230), bottomHalfTop + pxToRem(103));
flagTextDraw(posterCtx, getTime(), pxToRem(20), '#222222', pxToRem(230), bottomHalfTop + pxToRem(136)); flagTextDraw(posterCtx, getTime(), pxToRem(20), '#222222', pxToRem(230), bottomHalfTop + pxToRem(136));
$('.posterImg').attr('src', getManBase64(posterCanvas));
} }
} }
} }
...@@ -938,4 +940,8 @@ function getTime() { ...@@ -938,4 +940,8 @@ function getTime() {
let minute = date.getMinutes() < 10 ? "0" + date.getMinutes() : date.getMinutes(); let minute = date.getMinutes() < 10 ? "0" + date.getMinutes() : date.getMinutes();
return '立于' + year + '/' + month + '/' + day + ' ' + hour + ':' + minute; return '立于' + year + '/' + month + '/' + day + ' ' + hour + ':' + minute;
}
function getManBase64(canvas) {
return canvas.toDataURL('image/png');
} }
\ No newline at end of file
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