编辑器活动说明处理
This commit is contained in:
parent
a5b6ec64a3
commit
205c83d32b
|
@ -188,6 +188,6 @@ resize: none;
|
|||
left: 0;
|
||||
top: 0;
|
||||
background-color: rgba(0,0,0,0.5);
|
||||
z-index: 6;
|
||||
z-index: 66666;
|
||||
|
||||
}
|
|
@ -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{
|
|||
<div className="activeTip">
|
||||
<FormItem required={false} labelname="活动说明:" prop="bottom" id="bottom" labelwidth="100px">
|
||||
<RadioGroup onChange={(e)=>{this.onactivityChange(e)} } value={this.state.model.activityType}>
|
||||
<RadioButton value={1}>图片</RadioButton>
|
||||
<RadioButton value={2}>悬浮</RadioButton>
|
||||
<RadioButton value={3}>富文本</RadioButton>
|
||||
<RadioButton onClick={()=>this.hasItemFn(1)} value={1}>图片</RadioButton>
|
||||
<RadioButton onClick={()=>this.hasItemFn(2)} value={2}>悬浮</RadioButton>
|
||||
<RadioButton onClick={()=>this.hasItemFn(3)} value={3}>富文本</RadioButton>
|
||||
</RadioGroup>
|
||||
</FormItem>
|
||||
|
||||
|
@ -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}
|
||||
/>
|
||||
</FormItem>:this.state.model.activityType==2?<Wangeditor pageType="goodsuseditor" setEdittext={c=>this.getsusEditext(c)} />:<Wangeditor pageType="goodeditor" setEdittext={c=>this.getEditext(c)}/>
|
||||
</FormItem>:this.state.model.activityType==2?<Wangeditor pageType="goodsuseditor" setEdittext={c=>this.getsusEditext(c)} />:this.state.model.activityType==3?<Wangeditor pageType="goodeditor" setEdittext={c=>this.getEditext(c)}/>:null
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -11,6 +11,7 @@ export default class edittemplate extends React.Component{
|
|||
this.props.opendesc(true)
|
||||
}
|
||||
render(){
|
||||
console.log(14,this.props);
|
||||
return(
|
||||
<div className="editor-main goodstemplate" tabindex="0" >
|
||||
|
||||
|
|
|
@ -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(
|
||||
<div style={{width:"92%","margin":"0 auto 60px","overflow":"auto", "maxHeight":"100%"}}>
|
||||
<div style={{fontWeight:'bold'}}>基础设置</div>
|
||||
|
||||
<Form model={this.state.model} rules={rules} ref="form1">
|
||||
<Form model={this.state.model} ref="form1">
|
||||
<FormItem labelname="落地页标题:" prop="title" id="title" labelwidth="100px">
|
||||
<Ipt onChange={(e)=>{
|
||||
let model2 = this.state.model;
|
||||
|
@ -294,8 +295,8 @@ export default class edittemplate extends React.Component{
|
|||
</FormItem>
|
||||
<FormItem myClassName="activeSet" required={false} labelname="活动说明:" prop="bottom" id="bottom" labelwidth="100px">
|
||||
<RadioGroup onChange={(e)=>{this.onactivityChange(e)} } value={this.state.model.activityType}>
|
||||
<RadioButton value={1}>图片</RadioButton>
|
||||
<RadioButton value={2}>富文本</RadioButton>
|
||||
<RadioButton value={1} onClick={()=>this.hasItemFn(1)}>图片</RadioButton>
|
||||
<RadioButton value={2} onClick={()=>this.hasItemFn(2)}>富文本</RadioButton>
|
||||
</RadioGroup>
|
||||
</FormItem>
|
||||
{
|
||||
|
|
|
@ -278,7 +278,7 @@ getLandingdata(val){
|
|||
//获取落地页数据
|
||||
getlandbgcolor(c){
|
||||
let landConfig=this.state.model;
|
||||
landConfig.bgcolor=c;
|
||||
landConfig.bg_color=c;
|
||||
this.setState({model:landConfig});
|
||||
}
|
||||
//
|
||||
|
@ -499,11 +499,14 @@ getLandingdata(val){
|
|||
}
|
||||
// 背景颜色
|
||||
bgcolor(cor){
|
||||
this.setState({bg_color:cor});
|
||||
this.setState({bgcolor:cor});
|
||||
}
|
||||
showactiveIcon(c){
|
||||
this.setState({activeshow:false});
|
||||
}
|
||||
showactivedetail(c){
|
||||
this.setState({detailactiveshow:false});
|
||||
}
|
||||
onUpload = (file, report) => {
|
||||
let self=this;
|
||||
console.log('上传头像',file);
|
||||
|
@ -558,18 +561,7 @@ getLandingdata(val){
|
|||
|
||||
|
||||
render(){
|
||||
|
||||
const rules = {
|
||||
title: [
|
||||
{ type: "required", message: "请输入营销计划名称"},
|
||||
],
|
||||
level:[
|
||||
{ type: "required", message: "请输入权重"},
|
||||
{ type: "regExp", message: "请输入正整数",reg:"^([1-9][0-9]*){1,3}$"},
|
||||
]
|
||||
}
|
||||
|
||||
|
||||
console.log(564,this.state);
|
||||
return(
|
||||
<div className="edittemplate">
|
||||
<div className="topHeader">
|
||||
|
@ -682,7 +674,7 @@ getLandingdata(val){
|
|||
</div>
|
||||
<div className="xj-viewer-bg">
|
||||
<div className="xj-viewer-out">
|
||||
<div className="xj-viewer-mask" style={{background:this.state.model.bgcolor}} ref={this.canvasImgDomScr}>
|
||||
<div className="xj-viewer-mask" style={{background:this.state.model.bg_color}} ref={this.canvasImgDomScr}>
|
||||
<div className="top">
|
||||
{
|
||||
!this.state.model.images[0]? <img src={'https://lsxd-yunshanfu.oss-cn-hangzhou.aliyuncs.com/common_image/20220105/59ba305520d3229e7fc53d5229bfec0c.png'} id="top" />: <img crossOrigin="anonymous" src={this.state.model.images[0]} id="top" />
|
||||
|
@ -716,7 +708,7 @@ getLandingdata(val){
|
|||
this.state.activeNavStatus!=2?null:this.state.activeshow&&this.state.goodsConfigure.activeType==2&&this.state.goodsConfigure.editorHtml?<Descteplate backPrepage={c=>this.showactiveIcon(c)} goodsdata={this.state.goodsConfigure}/>:<Goodstemplate opendesc={c=>this.setState({activeshow:true})} goodsdata={this.state.goodsConfigure}/>
|
||||
}
|
||||
{
|
||||
this.state.activeNavStatus!=3?null:this.state.detailactiveshow&&this.state.detailConfigure.activeType==2&&this.state.detailConfigure.editorHtml?<Descteplate backPrepage={c=>this.showactiveIcon(c)} goodsdata={this.state.goodsConfigure}/>:<Detailstemplate opendesc={c=>this.setState({detailactiveshow:true})} detaildata={this.state.detailConfigure}/>
|
||||
this.state.activeNavStatus!=3?null:this.state.detailactiveshow&&this.state.detailConfigure.activeType==2&&this.state.detailConfigure.editorHtml?<Descteplate backPrepage={c=>this.showactivedetail(c)} goodsdata={this.state.detailConfigure}/>:<Detailstemplate opendesc={c=>this.setState({detailactiveshow:true})} detaildata={this.state.detailConfigure}/>
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue