优化落地页预览动态尺寸计算
This commit is contained in:
parent
9e7cb54f82
commit
f01f22a563
|
@ -571,24 +571,6 @@ export default class edittemplate extends React.Component {
|
|||
this.setState({ detailactiveshow: false })
|
||||
}
|
||||
|
||||
handleSize(width, height) {
|
||||
let style = { width: width + 'px', height: height + 'px' }
|
||||
switch (height) {
|
||||
case 667:
|
||||
style = { width: '375px', height: '667px', transform: 'scale(0.75)' }
|
||||
break
|
||||
case 750:
|
||||
style = { width: '375px', height: '750px', transform: 'scale(0.75)' }
|
||||
break
|
||||
case 812:
|
||||
style = { width: '375px', height: '812px', transform: 'scale(0.75)' }
|
||||
break
|
||||
case 500:
|
||||
style = { width: '375px', height: '500px', transform: 'scale(0.75)' }
|
||||
break
|
||||
}
|
||||
this.setState({ setStyle: style, activeHeight: height })
|
||||
}
|
||||
componentWillUnmount() {
|
||||
if (document.querySelector('canvas')) {
|
||||
document.querySelector('canvas').remove()
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import ReactDOM from 'react-dom'
|
||||
import React, { Component } from 'react'
|
||||
|
||||
import React from 'react'
|
||||
import '../main/main.less'
|
||||
import '../../../assets/comm.css'
|
||||
import { RadioButton, Icon,RadioGroup } from 'zent'
|
||||
|
@ -22,21 +22,7 @@ export default class previewEffect extends React.Component {
|
|||
this.props.onCloseFn();
|
||||
}
|
||||
handleSize(width, height) {
|
||||
let style = { width: width + 'px', height: height + 'px' }
|
||||
switch (height) {
|
||||
case 667:
|
||||
style = { width: '375px', height: '667px', transform: 'scale(0.75)' }
|
||||
break
|
||||
case 750:
|
||||
style = { width: '375px', height: '750px', transform: 'scale(0.75)' }
|
||||
break
|
||||
case 812:
|
||||
style = { width: '375px', height: '812px', transform: 'scale(0.75)' }
|
||||
break
|
||||
case 500:
|
||||
style = { width: '375px', height: '500px', transform: 'scale(0.75)' }
|
||||
break
|
||||
}
|
||||
let style = { width: width + 'px', height: height + 'px',transform: 'scale(0.75)' }
|
||||
this.setState({ setStyle: style, activeHeight: height })
|
||||
}
|
||||
onpageChange(e) {
|
||||
|
|
|
@ -309,13 +309,7 @@ export default class mytemplate extends React.Component {
|
|||
this.setState({ toTopshow: false });
|
||||
}
|
||||
handleSize(width, height) {
|
||||
let style = { width: width + 'px', height: height + 'px' };
|
||||
switch (height) {
|
||||
case 667: style = { width: '375px', height: '667px', transform: 'scale(0.75)' }; break;
|
||||
case 750: style = { width: '375px', height: '750px', transform: 'scale(0.75)' }; break;
|
||||
case 812: style = { width: '375px', height: '812px', transform: 'scale(0.75)' }; break;
|
||||
case 500: style = { width: '375px', height: '500px', transform: 'scale(0.75)' }; break;
|
||||
}
|
||||
let style = { width: width + 'px', height: height + 'px',transform: 'scale(0.75)' };
|
||||
this.setState({ setStyle: style, activeHeight: height });
|
||||
}
|
||||
render() {
|
||||
|
|
Loading…
Reference in New Issue