diff --git a/src/pages/exchangepage/edittemplate/main.js b/src/pages/exchangepage/edittemplate/main.js index 621ac759..8932a520 100644 --- a/src/pages/exchangepage/edittemplate/main.js +++ b/src/pages/exchangepage/edittemplate/main.js @@ -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){ { this.state.showType==3?this.state.activeNavStatus==1?this.getTitle(c)} landbgcolor={(c)=>this.getlandbgcolor(c)} landftcolor={(c)=>this.getlandftcolor(c)} setbanner={(e)=>this.getLandingdata(e)} />:this.state.activeNavStatus==2?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)}/>: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?this.getTitle(c)} landbgcolor={(c)=>this.getlandbgcolor(c)} landftcolor={(c)=>this.getlandftcolor(c)} setbanner={(e)=>this.getLandingdata(e)} />:this.state.activeNavStatus==2?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)}/>: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?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?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)}/>: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 ? (
diff --git a/src/pages/exchangepage/edittemplate/whiteLand.js b/src/pages/exchangepage/edittemplate/whiteLand.js index d2e5c128..8c16d2ba 100644 --- a/src/pages/exchangepage/edittemplate/whiteLand.js +++ b/src/pages/exchangepage/edittemplate/whiteLand.js @@ -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{
基础设置
- + { + { 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'}/> + }
样式