更改模板分类传值

This commit is contained in:
red-deng-deng 2022-01-26 13:59:20 +08:00
parent 054e12ce5e
commit 6d44944964
2 changed files with 7 additions and 30 deletions

View File

@ -16,9 +16,7 @@ export default class edittemplate extends React.Component{
super(props) super(props)
this.state={ this.state={
isSystemModel:false, isSystemModel:false,
mouldWay:[{ key:0,text:'节日'},{ key:1,text:'通用'},{ key:2,text:'银行'} mouldWay:[],
,{ key:3,text:'运动'},{ key:4,text:'汽车'}
],
model:{ model:{
title:"落地页标题", title:"落地页标题",
top_image: "", top_image: "",

View File

@ -26,7 +26,7 @@ let model={
describe: {type:"",content :"",bg_image:''}, describe: {type:"",content :"",bg_image:''},
bg_color:"#EEEEEE", bg_color:"#EEEEEE",
sort:1, sort:1,
type_id:{ key:1,text:'通用'}, type_id:{ key:2,text:'通用'},
font_color:"#000000", font_color:"#000000",
thumb:'' thumb:''
} }
@ -113,7 +113,6 @@ getLandingdata(val){
this.setState({showType:Number(typePage)}); this.setState({showType:Number(typePage)});
template=typePage; template=typePage;
} }
console.log(107,typePage);
let exchangeList=newEditor.exchange; let exchangeList=newEditor.exchange;
exchangeList['land'].title=newEditor.title; exchangeList['land'].title=newEditor.title;
exchangeList['land'].sort=newEditor.sort; exchangeList['land'].sort=newEditor.sort;
@ -122,32 +121,12 @@ getLandingdata(val){
whiteList['land'].sort=newEditor.sort; whiteList['land'].sort=newEditor.sort;
newEditor.exchangeList=exchangeList; newEditor.exchangeList=exchangeList;
newEditor.whiteList=whiteList; newEditor.whiteList=whiteList;
if(mouldType==0){//系统模板 if(template==1){
if(template==1){ this.setState({model:newEditor.whiteList.land,product_list:newEditor.whiteList.product_list,product_detail:newEditor.whiteList.product_detail});
this.setState({model:newEditor.whiteList.land,product_list:newEditor.whiteList.product_list,product_detail:newEditor.whiteList.product_detail}); }else{
}else{ this.setState({model:newEditor.exchangeList.land,product_list:newEditor.exchangeList.product_list,product_detail:newEditor.exchangeList.product_detail});
this.setState({model:newEditor.exchangeList.land,product_list:newEditor.exchangeList.product_list,product_detail:newEditor.exchangeList.product_detail});
}
}else{//落地页模板&我的模板(只有一套)
console.log(119,template);
if(template==1){
this.setState({model:newEditor.whiteList.land,product_list:newEditor.whiteList.product_list,product_detail:newEditor.whiteList.product_detail});
}else{
this.setState({model:newEditor.exchangeList.land,product_list:newEditor.exchangeList.product_list,product_detail:newEditor.exchangeList.product_detail});
}
} }
// if(mouldType!=0){
// if(this.state.showType==3){//兑换码
// this.setState({model:newEditor.exchangeList.land,product_list:newEditor.exchangeList.product_list,product_detail:newEditor.exchangeList.product_detail});
// }else if(this.state.showType==1){
// this.setState({model:newEditor.whiteList.land,product_list:newEditor.whiteList.product_list,product_detail:newEditor.whiteList.product_detail});
// }
// }
sessionStorage.setItem('editorConfig',JSON.stringify(newEditor)); sessionStorage.setItem('editorConfig',JSON.stringify(newEditor));
if(mouldType!=0&&pageChange==1){ if(mouldType!=0&&pageChange==1){
this.setState({pagedisable:true}); this.setState({pagedisable:true});