Commit e45d78ee by doszhang

dos

parent 86cbfed2
......@@ -445,6 +445,12 @@ function calculationWrap() {
}
function createPoster() {
//海报相关参数
let posterLeft = pxToRem(45 * 2);
let posterTop = pxToRem(107 * 2);
let flagListTop = pxToRem((45 + 107) * 2);
//初始化海报canvas
let canvasinfo = initCanvas('.poster-canvas-block', 'posterCanvas', 640 * 2, 1238 * 2, true);
posterCanvas = canvasinfo[0];
......@@ -465,7 +471,7 @@ function createPoster() {
let topHalfHeight = 390;
let bottomHalfHeight = 207;
let posterCanvasHeight = 0;
// flagListHeight = flagListHeight + 60;
flagListHeight = flagListHeight + 60;
//计算海报总高度
if (flagListHeight < 400) {
......@@ -475,6 +481,8 @@ function createPoster() {
posterCanvasHeight = topHalfHeight + flagListHeight + bottomHalfHeight;
}
posterCanvasHeight += 90;
//创建海报canvas
$('#posterCanvas').remove();
canvasinfo = initCanvas('.poster-canvas-block', 'posterCanvas', 640 * 2, posterCanvasHeight * 2, true);
......@@ -491,12 +499,12 @@ function createPoster() {
topHalf.src = "/Public/static/image2/poster-tophalf.png";
topHalf.onload = function () {
//画海报上半部分
posterCtx.drawImage(topHalf, pxToRem(45 * 2), pxToRem(107 * 2), pxToRem(550 * 2), pxToRem(350 * 2));
posterCtx.drawImage(topHalf, posterLeft, posterTop, pxToRem(550 * 2), pxToRem(350 * 2));
posterCtx.save();
posterCtx.restore();
//画海报中部背景
posterCtx.fillStyle = '#ffffff';
posterCtx.fillRect(pxToRem(45 * 2), pxToRem(457 * 2), pxToRem(550 * 2), pxToRem(flagListHeight * 2));
posterCtx.fillRect(posterLeft, flagListTop, pxToRem(550 * 2), pxToRem(flagListHeight * 2));
posterCtx.save();
posterCtx.restore();
//画海报底部
......@@ -505,7 +513,7 @@ function createPoster() {
bottomHalf.onload = function () {
bottomHalfTop = pxToRem(457) + pxToRem(flagListHeight);
$('.poster-tip').css('top', bottomHalfTop + pxToRem(181));
posterCtx.drawImage(bottomHalf, pxToRem(45 * 2), bottomHalfTop * 2, pxToRem(550 * 2), pxToRem(207 * 2));
posterCtx.drawImage(bottomHalf, posterLeft, bottomHalfTop * 2, pxToRem(550 * 2), pxToRem(207 * 2));
// drawFlagItem(pxToRem(489 + 20));
// let decorate = new Image();
// decorate.src = checkedDecorate;
......
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