Commit 23cc3dd7 authored by wangzhujun's avatar wangzhujun

poster

parent 874789ab
......@@ -29,25 +29,25 @@
font-size: 40px;
color: #fff;
}
.poster {
width: 2988px;
height: 4924px;
.noRem-poster {
width: 596px;
height: 983px;
left: 777px;
top: 286px;
position: absolute;
.posteriimg {
width: 2988px;
height: 4924px;
width: 596px;
height: 983px;
left: 0px;
top: 0px;
position: absolute;
.sparkBg("posterPop/posteriimg2.png");
.sparkBg("posterPop/posteriimg.png");
}
.qrcode {
width: 875px;
height: 875px;
left: 240px;
top: 3740px;
width: 175px;
height: 175px;
left: 46px;
top: 748px;
position: absolute;
border-radius: 20px;
}
......
......@@ -3,7 +3,6 @@
import React from 'react';
import { observer } from 'mobx-react';
import './posterpop.less';
import QRCode from 'qrcode';
import html2canvas from 'html2canvas';
import API from '@/api';
......@@ -41,12 +40,12 @@ class Posterpop extends React.Component<{}, PosterpopState> {
return (
<div className="posterpop modal_center md33">
<div className='back' onClick={this.closePop}></div>
<div className="poster" id='poster'>
<div className="noRem-poster" id='poster'>
<span className="posteriimg"></span>
{
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()
this.setState({
shareImg: base64
......
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 to comment