Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
L
LuzhouLaojiaoSnake_250428
Project
Project
Details
Activity
Releases
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
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
SparkProjects
LuzhouLaojiaoSnake_250428
Commits
23cc3dd7
Commit
23cc3dd7
authored
May 13, 2025
by
wangzhujun
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
poster
parent
874789ab
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
13 deletions
+12
-13
posterpop.less
src/components/posterpop/posterpop.less
+10
-10
posterpop.tsx
src/components/posterpop/posterpop.tsx
+2
-3
No files found.
src/components/posterpop/posterpop.less
View file @
23cc3dd7
...
@@ -29,25 +29,25 @@
...
@@ -29,25 +29,25 @@
font-size: 40px;
font-size: 40px;
color: #fff;
color: #fff;
}
}
.poster {
.
noRem-
poster {
width:
2988
px;
width:
596
px;
height:
4924
px;
height:
983
px;
left: 777px;
left: 777px;
top: 286px;
top: 286px;
position: absolute;
position: absolute;
.posteriimg {
.posteriimg {
width:
2988
px;
width:
596
px;
height:
4924
px;
height:
983
px;
left: 0px;
left: 0px;
top: 0px;
top: 0px;
position: absolute;
position: absolute;
.sparkBg("posterPop/posteriimg
2
.png");
.sparkBg("posterPop/posteriimg.png");
}
}
.qrcode {
.qrcode {
width:
8
75px;
width:
1
75px;
height:
8
75px;
height:
1
75px;
left:
240
px;
left:
46
px;
top:
3740
px;
top:
748
px;
position: absolute;
position: absolute;
border-radius: 20px;
border-radius: 20px;
}
}
...
...
src/components/posterpop/posterpop.tsx
View file @
23cc3dd7
...
@@ -3,7 +3,6 @@
...
@@ -3,7 +3,6 @@
import
React
from
'react'
;
import
React
from
'react'
;
import
{
observer
}
from
'mobx-react'
;
import
{
observer
}
from
'mobx-react'
;
import
'./posterpop.less'
;
import
'./posterpop.less'
;
import
QRCode
from
'qrcode'
;
import
QRCode
from
'qrcode'
;
import
html2canvas
from
'html2canvas'
;
import
html2canvas
from
'html2canvas'
;
import
API
from
'@/api'
;
import
API
from
'@/api'
;
...
@@ -41,12 +40,12 @@ class Posterpop extends React.Component<{}, PosterpopState> {
...
@@ -41,12 +40,12 @@ class Posterpop extends React.Component<{}, PosterpopState> {
return
(
return
(
<
div
className=
"posterpop modal_center md33"
>
<
div
className=
"posterpop modal_center md33"
>
<
div
className=
'back'
onClick=
{
this
.
closePop
}
></
div
>
<
div
className=
'back'
onClick=
{
this
.
closePop
}
></
div
>
<
div
className=
"poster"
id=
'poster'
>
<
div
className=
"
noRem-
poster"
id=
'poster'
>
<
span
className=
"posteriimg"
></
span
>
<
span
className=
"posteriimg"
></
span
>
{
{
this
.
state
.
codeImg
&&
<
img
className=
'qrcode'
src=
{
this
.
state
.
codeImg
}
onLoad=
{
()
=>
{
this
.
state
.
codeImg
&&
<
img
className=
'qrcode'
src=
{
this
.
state
.
codeImg
}
onLoad=
{
()
=>
{
// 开始截图
// 开始截图
html2canvas
(
document
.
querySelector
(
"
.poster"
),
{
useCORS
:
true
,
scale
:
5
}).
then
(
canvas
=>
{
html2canvas
(
document
.
querySelector
(
"
#poster"
),
{
useCORS
:
true
}).
then
(
canvas
=>
{
const
base64
=
canvas
.
toDataURL
()
const
base64
=
canvas
.
toDataURL
()
this
.
setState
({
this
.
setState
({
shareImg
:
base64
shareImg
:
base64
...
...
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