Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
M
mr-julyedu
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
baiguangyao
mr-julyedu
Commits
e1663110
Commit
e1663110
authored
Apr 15, 2020
by
xuzhenghua
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
海报
parent
43d32701
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
3 deletions
+3
-3
src/components/sharePoster/index.js
+3
-3
No files found.
src/components/sharePoster/index.js
View file @
e1663110
...
...
@@ -48,10 +48,10 @@ class SharePoster extends Component {
let
avatarWidth
=
50
// imgList[index].poster_width // 头像宽度
let
avatarHeight
=
50
// imgList[index].poster_height // 头像高度
let
avatarPositionX
=
(
imgList
[
index
].
header_position_x
*
$width
)
// 头像x轴位置
let
avatarPositionY
=
(
imgList
[
index
].
header_position_y
*
$height
)
// 头像Y轴位置
let
avatarPositionY
=
(
imgList
[
index
].
header_position_y
*
$height
)
-
18
// 头像Y轴位置
let
qrCodePositionX
=
imgList
[
index
].
qr_code_x
*
$width
// 二维码x轴位置
let
qrCodePositionY
=
imgList
[
index
].
qr_code_y
*
$height
// 二维码y轴位置
let
qrCodePositionY
=
imgList
[
index
].
qr_code_y
*
$height
+
7
// 二维码y轴位置
let
qrCodeWidth
=
(
imgList
[
index
].
qr_code_width
*
$width
)
// 二维码宽度
let
qrCodeHeight
=
(
imgList
[
index
].
qr_code_height
*
$height
)
-
avatarHeight
/
2
// 二维码高度
...
...
@@ -82,7 +82,7 @@ class SharePoster extends Component {
bgImage
.
setAttribute
(
'crossOrigin'
,
'anonymous'
);
bgImage
.
onload
=
function
()
{
context
.
drawImage
(
bgImage
,
0
,
0
,
450
,
800
);
context
.
drawImage
(
qrCodeImg
,
320
,
685
,
100
,
100
);
context
.
drawImage
(
qrCodeImg
,
qrCodePositionX
,
qrCodePositionY
,
100
,
100
);
context
.
fillStyle
=
imgList
[
index
].
username_color
;
context
.
font
=
"16px serif"
;
context
.
fillText
(
'@'
+
_this
.
state
.
name
,
(
avatarPositionX
+
avatarWidth
)
+
20
,
(
avatarPositionY
+
avatarHeight
/
2
));
...
...
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