优化落地页编辑模块代码
This commit is contained in:
parent
3d733e2205
commit
2241437012
|
@ -1,21 +1,13 @@
|
|||
import ReactDOM from 'react-dom'
|
||||
import React, { Component } from 'react'
|
||||
import React from 'react'
|
||||
import './main.less'
|
||||
import '../../../assets/comm.css'
|
||||
import {
|
||||
Notify,
|
||||
BlockLoading,
|
||||
Button,
|
||||
Input,
|
||||
onUpload,
|
||||
RadioGroup,
|
||||
RadioButton,
|
||||
Dropdown,
|
||||
Icon
|
||||
RadioButton
|
||||
} from 'zent'
|
||||
import Ipt from '../../../components/input/main'
|
||||
import Form from '../../../components/form/main'
|
||||
import FormItem from '../../../components/form-item/main'
|
||||
import {
|
||||
uploadImg,
|
||||
handelResponse,
|
||||
|
@ -88,7 +80,6 @@ export default class edittemplate extends React.Component {
|
|||
activeHeight: 667,
|
||||
pageStep: 1,
|
||||
showPage: 1,
|
||||
fontSize: 10000 / (375 * 0.75),
|
||||
setStyle: { width: '375px', height: '667px', transform: 'scale(0.75)' },
|
||||
detailType: 1 //详情页1 权益 2-立减金
|
||||
}
|
||||
|
@ -579,44 +570,9 @@ export default class edittemplate extends React.Component {
|
|||
showactivedetail(c) {
|
||||
this.setState({ detailactiveshow: false })
|
||||
}
|
||||
onUpload = (file, report) => {
|
||||
return new Promise((resolve, reject) => {
|
||||
let path = ''
|
||||
let formdata = new FormData()
|
||||
formdata.append('file', file)
|
||||
formdata.append('path', 'common_image')
|
||||
uploadImg(formdata).then((res) => {
|
||||
handelResponse(
|
||||
res,
|
||||
(req, msg) => {
|
||||
path = req.path
|
||||
},
|
||||
(err) => {
|
||||
reject()
|
||||
}
|
||||
)
|
||||
})
|
||||
|
||||
let count = 0
|
||||
const update = () => {
|
||||
if (path) {
|
||||
resolve(path)
|
||||
} else {
|
||||
if (count < 100) {
|
||||
count += 2
|
||||
report(count)
|
||||
setTimeout(update, 500)
|
||||
} else {
|
||||
reject()
|
||||
}
|
||||
}
|
||||
}
|
||||
setTimeout(update, 500)
|
||||
})
|
||||
}
|
||||
handleSize(width, height) {
|
||||
let style = { width: width + 'px', height: height + 'px' }
|
||||
let fontSize = null
|
||||
switch (height) {
|
||||
case 667:
|
||||
style = { width: '375px', height: '667px', transform: 'scale(0.75)' }
|
||||
|
|
|
@ -23,7 +23,6 @@ export default class previewEffect extends React.Component {
|
|||
}
|
||||
handleSize(width, height) {
|
||||
let style = { width: width + 'px', height: height + 'px' }
|
||||
let fontSize = null
|
||||
switch (height) {
|
||||
case 667:
|
||||
style = { width: '375px', height: '667px', transform: 'scale(0.75)' }
|
||||
|
|
Loading…
Reference in New Issue