优化系统白名单和兑换码标题联动

This commit is contained in:
red-deng-deng 2022-01-20 18:18:35 +08:00
parent faf11cd1a5
commit 8aa3bceb1e
2 changed files with 20 additions and 6 deletions

View File

@ -88,6 +88,7 @@ getLandingdata(val){
sessionStorage.removeItem('editorConfig');
let myInfoData = JSON.parse(sessionStorage.getItem("pageInfo"))
let mouldType=sessionStorage.getItem('mouldType');
this.setState({mouldType});
let pageChange=sessionStorage.getItem('pageChange');
if(myInfoData)
{
@ -382,6 +383,11 @@ getLandingdata(val){
this.setState({model:whiteData.land});
this.setState({product_list:whiteData.product_list});
this.setState({product_detail:whiteData.product_detail});
if(this.state.mouldType==0){
let whiteLand=whiteData.land;
whiteLand.title=this.state.model.title;
this.setState({model:whiteLand});
}
}else if(e.target.value==3){
let exchangeData=editorData.exchangeList;
this.setState({model:exchangeData.land});
@ -737,7 +743,7 @@ getLandingdata(val){
</div>
{
this.state.showType==3?this.state.activeNavStatus==1?<LandingForm settitle={(c)=>this.getTitle(c)} landbgcolor={(c)=>this.getlandbgcolor(c)} landftcolor={(c)=>this.getlandftcolor(c)} setbanner={(e)=>this.getLandingdata(e)} />:this.state.activeNavStatus==2?<GoodsForm setactiveType={c=>this.getactiveTypeFn(c)} seteditorHtml={c=>this.getEditorHtmlFn(c)} setButtonbgcolor={(c)=>{this.getButtonbgcolor(c)}} setButtoncolor={(c)=>{this.getButtoncolor(c)}} setbottomImg={c=>this.getgoodsbottomimgFn(c)} setbanner={(c)=>this.getGoodsbanner(c)} setarrayType={(c)=>this.getarrayType(c)}/>:<DetailsPage seteditorHtml={c=>this.getdetailEditorHtmlFn(c)} setdetailActive={c=>this.getdetailActiveFn(c)} setdetailbgc={c=>{this.getdetailbgcolor(c)}} setbottomImg={c=>this.getbottomimgFn(c)} setdetailftc={c=>this.getdetailfont_color(c)}/>
:this.state.activeNavStatus==1?<WhiteLand settitle={(c)=>this.getTitle(c)} landbgcolor={(c)=>this.getlandbgcolor(c)} landftcolor={(c)=>this.getlandftcolor(c)} setbanner={(e)=>this.getLandingdata(e)} />:this.state.activeNavStatus==2?<Whitegoods setactiveType={c=>this.getactiveTypeFn(c)} seteditorHtml={c=>this.getEditorHtmlFn(c)} setButtonbgcolor={(c)=>{this.getButtonbgcolor(c)}} setButtoncolor={(c)=>{this.getButtoncolor(c)}} setbottomImg={c=>this.getgoodsbottomimgFn(c)} setbanner={(c)=>this.getGoodsbanner(c)} setarrayType={(c)=>this.getarrayType(c)}/>:<Whitedetails seteditorHtml={c=>this.getdetailEditorHtmlFn(c)} setdetailActive={c=>this.getdetailActiveFn(c)} setdetailbgc={c=>{this.getdetailbgcolor(c)}} setbottomImg={c=>this.getbottomimgFn(c)} setdetailftc={c=>this.getdetailfont_color(c)}/>}
:this.state.activeNavStatus==1?<WhiteLand settitle={(c)=>this.getTitle(c)} mouldType={this.state.mouldType} landbgcolor={(c)=>this.getlandbgcolor(c)} landftcolor={(c)=>this.getlandftcolor(c)} setbanner={(e)=>this.getLandingdata(e)} />:this.state.activeNavStatus==2?<Whitegoods setactiveType={c=>this.getactiveTypeFn(c)} seteditorHtml={c=>this.getEditorHtmlFn(c)} setButtonbgcolor={(c)=>{this.getButtonbgcolor(c)}} setButtoncolor={(c)=>{this.getButtoncolor(c)}} setbottomImg={c=>this.getgoodsbottomimgFn(c)} setbanner={(c)=>this.getGoodsbanner(c)} setarrayType={(c)=>this.getarrayType(c)}/>:<Whitedetails seteditorHtml={c=>this.getdetailEditorHtmlFn(c)} setdetailActive={c=>this.getdetailActiveFn(c)} setdetailbgc={c=>{this.getdetailbgcolor(c)}} setbottomImg={c=>this.getbottomimgFn(c)} setdetailftc={c=>this.getdetailfont_color(c)}/>}
{
this.state.preview_visible ? (
<div>

View File

@ -32,17 +32,22 @@ export default class edittemplate extends React.Component{
}
}
componentWillMount(e){
componentDidMount(e){
let self=this;
let config=JSON.parse(sessionStorage.getItem('editorConfig'));
let moudTyle=sessionStorage.getItem('mouldType');
if(moudTyle&&moudTyle==0){
this.setState({isSystemModel:true});
}
if(config&&config.whiteList&&config.whiteList.land){
let data=config.whiteList.land;
this.setState({model:data});
}
if(moudTyle&&moudTyle==0){
this.setState({isSystemModel:true});
let data=config.whiteList.land;
data.title=config.exchangeList.land.title;
this.setState({model:data});
}
getThemeType().then(res=>{
handelResponse(res,(req,msg)=>{
let typeListSource=res.data.map(it=>{
@ -251,13 +256,15 @@ export default class edittemplate extends React.Component{
<div style={{fontWeight:'bold'}}>基础设置</div>
<Form model={this.state.model} ref="form1">
<FormItem labelname="落地页标题:" prop="title" id="title" labelwidth="100px">
{
<FormItem labelname="落地页标题:" prop="title" id="title" labelwidth="100px">
<Ipt onChange={(e)=>{
let model2 = this.state.model;
model2.title = e;
this.setState({model:model2})
this.props.settitle(e)
}}
disabled={this.props.mouldType==0}
onClearItem={(e)=>{
let model2 = this.state.model;
model2.title = "";
@ -265,6 +272,7 @@ export default class edittemplate extends React.Component{
}}
value={this.state.model.title} placeholder={"请输入"} labelWidth={'0px'} maxLength={12} height={'36px'} width={'300px'} alignment={'left'}/>
</FormItem>
}
<div style={{marginTop:'20px',marginBottom:'15px',fontWeight:'bold'}}>样式</div>
<FormItem labelname="背景颜色:" prop="font_color" id="font_color" labelwidth="80px">
<div className="colorItembg dfleac">