From 7457efe98fea45b4ed9713640638289de153bb28 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=AE=B8=E7=BA=A2=E6=A2=85?= <1924913374@qq.com> Date: Fri, 16 Sep 2022 16:44:50 +0800 Subject: [PATCH] =?UTF-8?q?=E7=B3=BB=E7=BB=9F=E6=A8=A1=E6=9D=BF=E6=96=B0?= =?UTF-8?q?=E5=A2=9E/=E7=BC=96=E8=BE=91=E6=8E=A5=E5=8F=A3=E8=81=94?= =?UTF-8?q?=E8=B0=83=EF=BC=8C=E6=95=B0=E6=8D=AE=E5=A4=84=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../couponTemplate/landingPage/config/main.js | 76 ++++++++----------- src/pages/exchangepage/edittemplate/main.js | 11 ++- 2 files changed, 38 insertions(+), 49 deletions(-) diff --git a/src/pages/exchangepage/couponTemplate/landingPage/config/main.js b/src/pages/exchangepage/couponTemplate/landingPage/config/main.js index ca207126..5300ab25 100644 --- a/src/pages/exchangepage/couponTemplate/landingPage/config/main.js +++ b/src/pages/exchangepage/couponTemplate/landingPage/config/main.js @@ -12,17 +12,14 @@ export default class edittemplate extends React.Component { constructor(props) { super(props) this.state = { - isSystemModel: false, - mouldWay: [], model: { title: "落地页标题12", top_image: "", middle_image: "", + white_image: "", describe: { type: "", content: "", bg_image: '' }, bg_color: "#EEEEEE", font_color: "#000000", - sort: 1, - type_id: { key: 1, text: '通用' } }, } } @@ -32,9 +29,6 @@ export default class edittemplate extends React.Component { let self = this; let config = JSON.parse(sessionStorage.getItem('editorConfig')); let moudTyle = sessionStorage.getItem('mouldType'); - if (moudTyle && moudTyle == 0) { - this.setState({ isSystemModel: true }); - } let data = config.coupon.land; console.log(111,data); this.setState({ model: data }); @@ -47,17 +41,6 @@ export default class edittemplate extends React.Component { // config.coupon.land = this.state.model; // sessionStorage.setItem('editorConfig', JSON.stringify(config)); // }) - getThemeType().then(res => { - handelResponse(res, (req, msg) => { - let typeListSource = res.data.map(it => { - return { key: it.id, text: it.name } - }); - self.setState({ mouldWay: typeListSource }); - }, (err) => { - - }) - }).catch(err => { - }); } handleChange = (color) => { let model1 = this.state.model; @@ -95,13 +78,6 @@ export default class edittemplate extends React.Component { this.props.setbanner(this.state.model); } } - onmouldChange(c) { - - let model1 = this.state.model; - model1.type_id = c; - this.setState({ model: model1 }); - this.props.setbanner(model1); - } //上传顶部banner onUploadChange(files) { if (files.length > 0 && files[0].status == "success") { @@ -118,15 +94,15 @@ export default class edittemplate extends React.Component { }; //上传输入框 - onUploadChange1(files) { + onUploadChange1(files,type) { if (files.length > 0 && files[0].status == "success") { let model = this.state.model; - model.middle_image = files[0].src; + model[type] = files[0].src; this.setState({ model: model }) this.props.setbanner(model); } else { let model = this.state.model; - model.middle_image = ''; + model[type] = ''; this.setState({ model: model }) this.props.setbanner(model); } @@ -241,10 +217,12 @@ export default class edittemplate extends React.Component { render() { + console.log(236,this.props.couponType); + console.log(237,this.state.model); return (
-

落地页设置123

+

落地页设置

@@ -265,19 +243,6 @@ export default class edittemplate extends React.Component { }} value={this.state.model.title} placeholder={"请输入"} labelWidth={'0px'} maxLength={12} height={'36px'} width={'300px'} alignment={'left'} /> - { - this.state.isSystemModel ? ( - - this.sortFn(c)} value={this.state.model.sort} placeholder="请输入数字" integer={true} max={999} /> - ) : null - } - { - this.state.isSystemModel ? ( - -