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
457f82b9
Commit
457f82b9
authored
Aug 26, 2019
by
FE
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
modify username in poster page
parent
051b45b8
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
2 deletions
+3
-2
src/components/sharePoster/index.js
+3
-2
No files found.
src/components/sharePoster/index.js
View file @
457f82b9
...
@@ -23,6 +23,7 @@ class SharePoster extends Component {
...
@@ -23,6 +23,7 @@ class SharePoster extends Component {
componentDidMount
()
{
componentDidMount
()
{
this
.
getCodeWe
();
this
.
getCodeWe
();
http
.
get
(
`
${
API
.
home
}
/m/dist/posters/
${
getParam
(
'courseId'
)}
/
${
getParam
(
'uid'
)}
`
).
then
((
res
)
=>
{
http
.
get
(
`
${
API
.
home
}
/m/dist/posters/
${
getParam
(
'courseId'
)}
/
${
getParam
(
'uid'
)}
`
).
then
((
res
)
=>
{
console
.
log
(
res
);
if
(
res
.
data
.
code
===
200
)
{
if
(
res
.
data
.
code
===
200
)
{
this
.
setState
({
this
.
setState
({
imgUrl
:
res
.
data
.
data
.
avatar
,
imgUrl
:
res
.
data
.
data
.
avatar
,
...
@@ -58,7 +59,7 @@ class SharePoster extends Component {
...
@@ -58,7 +59,7 @@ class SharePoster extends Component {
var
canvas
=
document
.
getElementById
(
"canvas"
),
var
canvas
=
document
.
getElementById
(
"canvas"
),
context
=
canvas
.
getContext
(
"2d"
);
context
=
canvas
.
getContext
(
"2d"
);
console
.
log
(
_this
);
_this
.
getBase64
(
imgSrc1
)
_this
.
getBase64
(
imgSrc1
)
// 背景图片合成
// 背景图片合成
.
then
((
img
)
=>
{
.
then
((
img
)
=>
{
...
@@ -84,7 +85,7 @@ class SharePoster extends Component {
...
@@ -84,7 +85,7 @@ class SharePoster extends Component {
context
.
drawImage
(
qrCodeImg
,
320
,
685
,
100
,
100
);
context
.
drawImage
(
qrCodeImg
,
320
,
685
,
100
,
100
);
context
.
fillStyle
=
imgList
[
index
].
username_color
;
context
.
fillStyle
=
imgList
[
index
].
username_color
;
context
.
font
=
"16px serif"
;
context
.
font
=
"16px serif"
;
context
.
fillText
(
'@'
+
_this
.
name
,
(
avatarPositionX
+
avatarWidth
)
+
20
,
(
avatarPositionY
+
avatarHeight
/
2
));
context
.
fillText
(
'@'
+
_this
.
state
.
name
,
(
avatarPositionX
+
avatarWidth
)
+
20
,
(
avatarPositionY
+
avatarHeight
/
2
));
context
.
font
=
"14px serif"
;
context
.
font
=
"14px serif"
;
context
.
fillText
(
'正在学习该课程'
,
(
avatarPositionX
+
avatarWidth
)
+
20
,
(
avatarPositionY
+
avatarHeight
/
2
)
+
20
);
context
.
fillText
(
'正在学习该课程'
,
(
avatarPositionX
+
avatarWidth
)
+
20
,
(
avatarPositionY
+
avatarHeight
/
2
)
+
20
);
context
.
restore
();
context
.
restore
();
...
...
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