优化落地页预览动态尺寸计算

This commit is contained in:
Apple 2022-08-25 14:36:03 +08:00
parent 9e7cb54f82
commit f01f22a563
3 changed files with 5 additions and 43 deletions

View File

@ -571,24 +571,6 @@ export default class edittemplate extends React.Component {
this.setState({ detailactiveshow: false }) 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() { componentWillUnmount() {
if (document.querySelector('canvas')) { if (document.querySelector('canvas')) {
document.querySelector('canvas').remove() document.querySelector('canvas').remove()

View File

@ -1,5 +1,5 @@
import ReactDOM from 'react-dom'
import React, { Component } from 'react' import React from 'react'
import '../main/main.less' import '../main/main.less'
import '../../../assets/comm.css' import '../../../assets/comm.css'
import { RadioButton, Icon,RadioGroup } from 'zent' import { RadioButton, Icon,RadioGroup } from 'zent'
@ -22,21 +22,7 @@ export default class previewEffect extends React.Component {
this.props.onCloseFn(); this.props.onCloseFn();
} }
handleSize(width, height) { handleSize(width, height) {
let style = { width: width + 'px', height: height + 'px' } let style = { width: width + 'px', height: height + 'px',transform: 'scale(0.75)' }
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 }) this.setState({ setStyle: style, activeHeight: height })
} }
onpageChange(e) { onpageChange(e) {

View File

@ -309,13 +309,7 @@ export default class mytemplate extends React.Component {
this.setState({ toTopshow: false }); this.setState({ toTopshow: false });
} }
handleSize(width, height) { handleSize(width, height) {
let style = { width: width + 'px', height: height + 'px' }; let style = { width: width + 'px', height: height + 'px',transform: 'scale(0.75)' };
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 }); this.setState({ setStyle: style, activeHeight: height });
} }
render() { render() {