From 205c83d32b95d6582e10af3e195c2edaf6cb781c Mon Sep 17 00:00:00 2001
From: red-deng-deng <1924913374@qq.com>
Date: Sat, 8 Jan 2022 09:52:05 +0800
Subject: [PATCH] =?UTF-8?q?=E7=BC=96=E8=BE=91=E5=99=A8=E6=B4=BB=E5=8A=A8?=
=?UTF-8?q?=E8=AF=B4=E6=98=8E=E5=A4=84=E7=90=86?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/App.css | 2 +-
.../exchangepage/edittemplate/goodsPage.js | 27 +++++++++------
.../edittemplate/goodstemplate.js | 1 +
.../exchangepage/edittemplate/landingPage.js | 33 ++++++++++---------
src/pages/exchangepage/edittemplate/main.js | 24 +++++---------
5 files changed, 44 insertions(+), 43 deletions(-)
diff --git a/src/App.css b/src/App.css
index cfa2dd36..7a796c84 100644
--- a/src/App.css
+++ b/src/App.css
@@ -188,6 +188,6 @@ resize: none;
left: 0;
top: 0;
background-color: rgba(0,0,0,0.5);
- z-index: 6;
+ z-index: 66666;
}
\ No newline at end of file
diff --git a/src/pages/exchangepage/edittemplate/goodsPage.js b/src/pages/exchangepage/edittemplate/goodsPage.js
index be0f5a03..1b0d1b15 100644
--- a/src/pages/exchangepage/edittemplate/goodsPage.js
+++ b/src/pages/exchangepage/edittemplate/goodsPage.js
@@ -69,7 +69,14 @@ export default class edittemplate extends React.Component{
this.setState({model:model1})
this.props.setactiveType(e.target.value);
}
-
+ hasItemFn(c){
+ let model1=this.state.model;
+ if(c==model1.activityType){
+ model1.activityType='';
+ this.setState({model:model1});
+ this.props.setactiveType('');
+ }
+ }
//顶部banner
onUploadChange(files){
if(files.length > 0 && files[0].status == "success")
@@ -104,13 +111,13 @@ export default class edittemplate extends React.Component{
onUploadChange2(files){
if(files.length > 0 && files[0].status == "success")
{
- let model = this.state.model;
- model.images[2] = files[0].src;
- this.setState({model:model})
+ let model1 = this.state.model;
+ model1.images[1] = files[0].src;
+ this.setState({model:model1})
this.props.setbottomImg(files[0].src);
}else{
let model = this.state.model;
- model.images[2] ='';
+ model.images[1] ='';
this.setState({model:model})
this.props.setbottomImg("");
}
@@ -282,9 +289,9 @@ export default class edittemplate extends React.Component{
{this.onactivityChange(e)} } value={this.state.model.activityType}>
- 图片
- 悬浮
- 富文本
+ this.hasItemFn(1)} value={1}>图片
+ this.hasItemFn(2)} value={2}>悬浮
+ this.hasItemFn(3)} value={3}>富文本
@@ -304,9 +311,9 @@ export default class edittemplate extends React.Component{
onChange={(e)=>{this.onUploadChange2(e)} }
onUpload={this.onUpload}
onError={this.onUploadError}
- defaultFileList={this.state.model.images[2] ? [{'src':this.state.model.images[2]}] : null}
+ defaultFileList={this.state.model.images[1] ? [{'src':this.state.model.images[1]}] : null}
/>
- :this.state.model.activityType==2?
this.getsusEditext(c)} />:this.getEditext(c)}/>
+ :this.state.model.activityType==2?this.getsusEditext(c)} />:this.state.model.activityType==3?this.getEditext(c)}/>:null
}
diff --git a/src/pages/exchangepage/edittemplate/goodstemplate.js b/src/pages/exchangepage/edittemplate/goodstemplate.js
index 81ae6c62..3be4f72a 100644
--- a/src/pages/exchangepage/edittemplate/goodstemplate.js
+++ b/src/pages/exchangepage/edittemplate/goodstemplate.js
@@ -11,6 +11,7 @@ export default class edittemplate extends React.Component{
this.props.opendesc(true)
}
render(){
+ console.log(14,this.props);
return(
diff --git a/src/pages/exchangepage/edittemplate/landingPage.js b/src/pages/exchangepage/edittemplate/landingPage.js
index ae84d8b9..688a70e5 100644
--- a/src/pages/exchangepage/edittemplate/landingPage.js
+++ b/src/pages/exchangepage/edittemplate/landingPage.js
@@ -53,9 +53,22 @@ export default class edittemplate extends React.Component{
let active=this.state.model;
active.activityType=e.target.value;
active.editorHtml='';
+ if(active.images&&active.images.length==3){
+ active.images[2]="";
+ }
this.setState({model:active})
+
this.props.setbanner(this.state.model);
- }
+ }
+ hasItemFn(c){
+ let model1=this.state.model;
+ if(c==model1.activityType){
+ model1.activityType='';
+ model1.activityType=0;
+ this.setState({model:model1});
+ this.props.setbanner(this.state.model);
+ }
+ }
//上传顶部banner
onUploadChange(files){
if(files.length > 0 && files[0].status == "success")
@@ -200,23 +213,11 @@ export default class edittemplate extends React.Component{
render(){
-
- const rules = {
- title: [
- { type: "required", message: "请输入营销计划名称"},
- ],
- level:[
- { type: "required", message: "请输入权重"},
- { type: "regExp", message: "请输入正整数",reg:"^([1-9][0-9]*){1,3}$"},
- ]
- }
-
-
return(