Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
php
/
ccb-lantern
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
e45d78ee
authored
Jan 28, 2020
by
doszhang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dos
parent
86cbfed2
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
4 deletions
+12
-4
Public/static/js/common.js
+12
-4
No files found.
Public/static/js/common.js
View file @
e45d78ee
...
...
@@ -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
,
p
xToRem
(
45
*
2
),
pxToRem
(
107
*
2
)
,
pxToRem
(
550
*
2
),
pxToRem
(
350
*
2
));
posterCtx
.
drawImage
(
topHalf
,
p
osterLeft
,
posterTop
,
pxToRem
(
550
*
2
),
pxToRem
(
350
*
2
));
posterCtx
.
save
();
posterCtx
.
restore
();
//画海报中部背景
posterCtx
.
fillStyle
=
'#ffffff'
;
posterCtx
.
fillRect
(
p
xToRem
(
45
*
2
),
pxToRem
(
457
*
2
)
,
pxToRem
(
550
*
2
),
pxToRem
(
flagListHeight
*
2
));
posterCtx
.
fillRect
(
p
osterLeft
,
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
,
p
xToRem
(
45
*
2
)
,
bottomHalfTop
*
2
,
pxToRem
(
550
*
2
),
pxToRem
(
207
*
2
));
posterCtx
.
drawImage
(
bottomHalf
,
p
osterLeft
,
bottomHalfTop
*
2
,
pxToRem
(
550
*
2
),
pxToRem
(
207
*
2
));
// drawFlagItem(pxToRem(489 + 20));
// let decorate = new Image();
// decorate.src = checkedDecorate;
...
...
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