From 2241437012dd9dd4f4539e2208cd0da91511e305 Mon Sep 17 00:00:00 2001
From: Apple <>
Date: Thu, 25 Aug 2022 14:22:08 +0800
Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E8=90=BD=E5=9C=B0=E9=A1=B5?=
=?UTF-8?q?=E7=BC=96=E8=BE=91=E6=A8=A1=E5=9D=97=E4=BB=A3=E7=A0=81?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/pages/exchangepage/edittemplate/main.js | 296 ++++++++-----------
src/pages/exchangepage/previewEffect/main.js | 1 -
2 files changed, 126 insertions(+), 171 deletions(-)
diff --git a/src/pages/exchangepage/edittemplate/main.js b/src/pages/exchangepage/edittemplate/main.js
index d81a0b58..c63d67c1 100644
--- a/src/pages/exchangepage/edittemplate/main.js
+++ b/src/pages/exchangepage/edittemplate/main.js
@@ -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)' }
@@ -701,8 +657,8 @@ export default class edittemplate extends React.Component {
}
/>
) : (
-
- )}
+
+ )}
{!this.state.model.middle_image ? (
@@ -713,8 +669,8 @@ export default class edittemplate extends React.Component {
}
/>
) : (
-
- )}
+
+ )}
{this.state.showType == 1 ? (
) : (
-
- )}
+
+ )}
{this.state.model.describe &&
this.state.model.describe.bg_image ? (
-
- ) : null}
+
+ ) : null}
@@ -759,13 +715,13 @@ export default class edittemplate extends React.Component {
src={this.state.product_list.top_image}
/>
) : (
-
- )}
+
+ )}
{this.state.product_list.list == 2 ? (
) : (
-
- )}
+
+ )}
{this.state.product_list.list == 2 ? (
+
{this.state.product_detail.describe.type == 2 ? (
) : (
-
-
-
-
- )}
+
+
+
+
+ )}
) : (
-
- )}
+
+ )}
{!this.state.model.middle_image ? (
@@ -982,12 +938,12 @@ export default class edittemplate extends React.Component {
}
/>
) : (
-
- )}
+
+ )}
{this.state.showType == 1 ? (
) : (
-
- )}
+
+ )}
@@ -1012,29 +968,29 @@ export default class edittemplate extends React.Component {
this.state.model.describe.type == 0 ? null : this.state
.model.describe &&
this.state.model.describe.type == 1 ? (
+
+ ) : (
+
+ {this.state.model.describe &&
+ this.state.model.describe.bg_image ? (
- ) : (
-
- {this.state.model.describe &&
- this.state.model.describe.bg_image ? (
-
- ) : null}
- {this.state.model.describe &&
- this.state.model.describe.content ? (
-
- ) : null}
-
- )}
+ ) : null}
+ {this.state.model.describe &&
+ this.state.model.describe.content ? (
+
+ ) : null}
+
+ )}
@@ -1043,49 +999,49 @@ export default class edittemplate extends React.Component {
{this.state.activeNavStatus != 2 ? null : this.state.activeshow &&
this.state.product_list.describe.type == 2 &&
this.state.product_list.describe.content ? (
- this.showactiveIcon(c)}
- goodsdata={this.state.product_list}
- />
- ) : (
- this.setState({ activeshow: true })}
- goodsdata={this.state.product_list}
- />
- )}
+ this.showactiveIcon(c)}
+ goodsdata={this.state.product_list}
+ />
+ ) : (
+ this.setState({ activeshow: true })}
+ goodsdata={this.state.product_list}
+ />
+ )}
{this.state.activeNavStatus != 3 ? null : this.state
.detailactiveshow &&
this.state.product_detail.describe.type == 2 &&
this.state.product_detail.describe.content ? (
- this.showactivedetail(c)}
- goodsdata={this.state.product_detail}
- />
- ) : (
-
-
-
{
- this.ondetailTypeChange(e)
- }}
- value={this.state.detailType}>
-
- 权益
-
-
- 立减金
-
+ this.showactivedetail(c)}
+ goodsdata={this.state.product_detail}
+ />
+ ) : (
+
+
+ {
+ this.ondetailTypeChange(e)
+ }}
+ value={this.state.detailType}>
+
+ 权益
+
+
+ 立减金
+
-
-
- {
- this.state.detailType == 1 ?
this.setState({ detailactiveshow: true })}
- detaildata={this.state.product_detail}
- /> :
- }
+
- )}
+ {
+ this.state.detailType == 1 ? this.setState({ detailactiveshow: true })}
+ detaildata={this.state.product_detail}
+ /> :
+ }
+
+ )}
商品列表页设置
) : (
-
商品详情页设置
- )}
+ 商品详情页设置
+ )}
{this.state.showType == 3 ? (
this.state.activeNavStatus == 1 ? (
diff --git a/src/pages/exchangepage/previewEffect/main.js b/src/pages/exchangepage/previewEffect/main.js
index f6eedda4..c563b3ad 100644
--- a/src/pages/exchangepage/previewEffect/main.js
+++ b/src/pages/exchangepage/previewEffect/main.js
@@ -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)' }