Commit 23cc3dd7 authored by wangzhujun's avatar wangzhujun

poster

parent 874789ab
...@@ -29,25 +29,25 @@ ...@@ -29,25 +29,25 @@
font-size: 40px; font-size: 40px;
color: #fff; color: #fff;
} }
.poster { .noRem-poster {
width: 2988px; width: 596px;
height: 4924px; height: 983px;
left: 777px; left: 777px;
top: 286px; top: 286px;
position: absolute; position: absolute;
.posteriimg { .posteriimg {
width: 2988px; width: 596px;
height: 4924px; height: 983px;
left: 0px; left: 0px;
top: 0px; top: 0px;
position: absolute; position: absolute;
.sparkBg("posterPop/posteriimg2.png"); .sparkBg("posterPop/posteriimg.png");
} }
.qrcode { .qrcode {
width: 875px; width: 175px;
height: 875px; height: 175px;
left: 240px; left: 46px;
top: 3740px; top: 748px;
position: absolute; position: absolute;
border-radius: 20px; border-radius: 20px;
} }
......
...@@ -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
......
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