解决bug,更新

This commit is contained in:
red-deng-deng 2022-01-21 20:19:10 +08:00
parent 5b35accf4e
commit 3d4d0d1ea0
5 changed files with 24 additions and 19 deletions

View File

@ -746,7 +746,7 @@ getLandingdata(val){
</div> </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.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)} 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.activeNavStatus==1?<WhiteLand landTitle={this.state.model.title} 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 ? ( this.state.preview_visible ? (
<div> <div>

View File

@ -31,16 +31,20 @@ export default class wangeditor extends React.Component{
'justify', 'justify',
] ]
// 注意,先配置 height ,再执行 create()
// 注意,先配置 height ,再执行 create() // 注意,先配置 height ,再执行 create()
editor.config.onchange = function (newHtml) { editor.config.onchange = function (newHtml) {
console.log(35,newHtml);
var text = editor.txt.text(); var text = editor.txt.text();
console.log(38,text); if(text.length==0){//没有文字
// if(text.length>10){ self.props.setEdittext("");
// console.log('结束',text.length); }
// return; if(text.length>10){
// } let str = text.slice(0,10);
self.setState({editorHtml:str});
editor.txt.html(str)
self.props.setEdittext(str);
return;
}
self.setState({editorHtml:newHtml}); self.setState({editorHtml:newHtml});
self.props.setEdittext(newHtml); self.props.setEdittext(newHtml);

View File

@ -44,7 +44,7 @@ export default class edittemplate extends React.Component{
if(moudTyle&&moudTyle==0){ if(moudTyle&&moudTyle==0){
this.setState({isSystemModel:true}); this.setState({isSystemModel:true});
let data=config.whiteList.land; let data=config.whiteList.land;
data.title=config.exchangeList.land.title; data.title=this.props.landTitle;
this.setState({model:data}); this.setState({model:data});
} }

View File

@ -30,17 +30,18 @@ export default class wangeditor extends React.Component{
'link', 'link',
'justify', 'justify',
] ]
// 注意,先配置 height ,再执行 create()
editor.config.onchange = function (newHtml) { editor.config.onchange = function (newHtml) {
console.log(35,newHtml);
var text = editor.txt.text(); var text = editor.txt.text();
console.log(38,text); if(text.length==0){//没有文字
// if(text.length>10){ self.props.setEdittext("");
// console.log('结束',text.length); }
// return; if(text.length>10){
// } let str = text.slice(0,10);
self.setState({editorHtml:str});
editor.txt.html(str)
self.props.setEdittext(str);
return;
}
self.setState({editorHtml:newHtml}); self.setState({editorHtml:newHtml});
self.props.setEdittext(newHtml); self.props.setEdittext(newHtml);

View File

@ -266,7 +266,7 @@ export default class mytemplate extends React.Component{
// window.open(link, "_blank") // window.open(link, "_blank")
sessionStorage.setItem('mouldType',1); sessionStorage.setItem('mouldType',1);
window.location.href='/#/edittemplate'; window.location.href='/#/edittemplate';
sessionStorage.setItem('pageChange',0); sessionStorage.setItem('pageChange',1);
} }
} }