This commit is contained in:
姜棚 2021-11-28 16:14:33 +08:00
parent 4d2ca74c56
commit 263d85843b
3 changed files with 29 additions and 11 deletions

View File

@ -73,7 +73,7 @@ export default class edittemplate extends React.Component{
if(myInfo.href != "") if(myInfo.href != "")
{ {
this.setState({pageInfo:true}) this.setState({pageInfo:true})
model.list = myInfo.list model.list = parseInt(myInfo.list)
model.use = myInfo.use model.use = myInfo.use
model.link = myInfo.link model.link = myInfo.link
model.edit= myInfo.edit model.edit= myInfo.edit
@ -165,6 +165,16 @@ export default class edittemplate extends React.Component{
} }
onListChange(e){
console.log(77788899)
let model = this.state.model;
model.list = e.target.value;
this.setState({model:model})
}
onPreview(){ onPreview(){
this.setState({previewData:this.state.model}) this.setState({previewData:this.state.model})
this.setState({preview_visible:true}) this.setState({preview_visible:true})
@ -505,19 +515,19 @@ export default class edittemplate extends React.Component{
}} }}
value={this.state.model.title} placeholder={"请输入"} labelWidth={'0px'} maxLength={12} height={'36px'} width={'250px'} alignment={'left'}/> value={this.state.model.title} placeholder={"请输入"} labelWidth={'0px'} maxLength={12} height={'36px'} width={'250px'} alignment={'left'}/>
</FormItem> </FormItem>
<FormItem labelname="背景" prop="title" id="title" labelwidth="80px"> <FormItem labelname="背景" prop="bg_color" id="bg_color" labelwidth="80px">
<div className="colorItem"> <div className="colorItem">
<ColorPicker color={this.state.model.bg_color} onChange={(e)=>{this.colorChange(e)}} /> <ColorPicker color={this.state.model.bg_color} onChange={(e)=>{this.colorChange(e)}} />
<span style={{"margin-top":"10px","margin-left":"10px","font-size":"16px"}}>{this.state.model.bg_color}</span> <span style={{"margin-top":"10px","margin-left":"10px","font-size":"16px"}}>{this.state.model.bg_color}</span>
</div> </div>
</FormItem> </FormItem>
<FormItem labelname="按钮颜色" prop="title" id="title" labelwidth="80px"> <FormItem labelname="按钮颜色" prop="button_color" id="button_color" labelwidth="80px">
<div className="colorItem"> <div className="colorItem">
<ColorPicker color={this.state.model.button_color} onChange={(e)=>{this.colorChange1(e)}} /> <ColorPicker color={this.state.model.button_color} onChange={(e)=>{this.colorChange1(e)}} />
<span style={{"margin-top":"10px","margin-left":"10px","font-size":"16px"}}>{this.state.model.button_color}</span> <span style={{"margin-top":"10px","margin-left":"10px","font-size":"16px"}}>{this.state.model.button_color}</span>
</div> </div>
</FormItem> </FormItem>
<FormItem labelname="顶图" prop="title" id="title" labelwidth="80px"> <FormItem labelname="顶图" prop="top" id="top" labelwidth="80px">
<ImageUpload <ImageUpload
className="zent-image-upload-demo" className="zent-image-upload-demo"
maxSize={5 * 1024 * 1024} maxSize={5 * 1024 * 1024}
@ -527,14 +537,14 @@ export default class edittemplate extends React.Component{
tips="单张图片不超过 5M" tips="单张图片不超过 5M"
onChange={(e)=>{this.onUploadChange(e)} } onChange={(e)=>{this.onUploadChange(e)} }
onUpload={this.onUpload} onUpload={this.onUpload}
defaultFileList={ this.state.model.images[0] ? [{'src':this.state.model.images[0]}] : null }
onError={this.onUploadError} onError={this.onUploadError}
/> />
</FormItem> </FormItem>
<FormItem labelname="中位图" prop="title" id="title" labelwidth="80px"> <FormItem labelname="中位图" prop="center" id="center" labelwidth="80px">
<ImageUpload <ImageUpload
className="zent-image-upload-demo" className="zent-image-upload-demo"
maxSize={5 * 1024 * 1024} maxSize={5 * 1024 * 1024}
@ -544,13 +554,14 @@ export default class edittemplate extends React.Component{
sortable sortable
tips="单张图片不超过 5M" tips="单张图片不超过 5M"
onChange={(e)=>{this.onUploadChange1(e)}} onChange={(e)=>{this.onUploadChange1(e)}}
defaultFileList={this.state.model.images[1] ? [{'src':this.state.model.images[1]}] : null}
onUpload={this.onUpload1} onUpload={this.onUpload1}
onError={this.onUploadError} onError={this.onUploadError}
/> />
</FormItem> </FormItem>
<FormItem labelname="底部图" prop="title" id="title" labelwidth="80px"> <FormItem labelname="底部图" prop="bottom" id="bottom" labelwidth="80px">
<ImageUpload <ImageUpload
className="zent-image-upload-demo" className="zent-image-upload-demo"
maxSize={5 * 1024 * 1024} maxSize={5 * 1024 * 1024}
@ -561,10 +572,11 @@ export default class edittemplate extends React.Component{
onChange={(e)=>{this.onUploadChange2(e)} } onChange={(e)=>{this.onUploadChange2(e)} }
onUpload={this.onUpload2} onUpload={this.onUpload2}
onError={this.onUploadError} onError={this.onUploadError}
defaultFileList={this.state.model.images[2] ? [{'src':this.state.model.images[2]}] : null}
/> />
</FormItem> </FormItem>
<FormItem labelname="缩略图" prop="title" id="title" labelwidth="80px"> <FormItem labelname="缩略图" prop="thumb" id="thumb" labelwidth="80px">
<ImageUpload <ImageUpload
className="zent-image-upload-demo" className="zent-image-upload-demo"
maxSize={5 * 1024 * 1024} maxSize={5 * 1024 * 1024}
@ -575,10 +587,11 @@ export default class edittemplate extends React.Component{
onChange={(e)=>{this.onUploadChange3(e)} } onChange={(e)=>{this.onUploadChange3(e)} }
onUpload={this.onUpload3} onUpload={this.onUpload3}
onError={this.onUploadError} onError={this.onUploadError}
defaultFileList={this.state.model.thumb ? [{'src':this.state.model.thumb}] : null}
/> />
</FormItem> </FormItem>
<FormItem labelname="顶部内图" prop="title" id="title" labelwidth="80px"> <FormItem labelname="顶部内图" prop="top_img" id="top_img" labelwidth="80px">
<ImageUpload <ImageUpload
className="zent-image-upload-demo" className="zent-image-upload-demo"
maxSize={5 * 1024 * 1024} maxSize={5 * 1024 * 1024}
@ -586,6 +599,8 @@ export default class edittemplate extends React.Component{
multiple multiple
sortable sortable
tips="单张图片不超过 5M" tips="单张图片不超过 5M"
defaultFileList={this.state.model.top_img ? [{'src':this.state.model.top_img}] : null}
onChange={(e)=>{this.onUploadChange4(e)} } onChange={(e)=>{this.onUploadChange4(e)} }
onUpload={this.onUpload4} onUpload={this.onUpload4}
onError={this.onUploadError} onError={this.onUploadError}

View File

@ -259,7 +259,10 @@ export default class acclist extends React.Component {
} }
onPreview(e,row){ onPreview(e,row){
this.setState({preview_url:row.preview_url}) console.log("预览")
console.log(row)
this.setState({preview_url:row.href})
this.setState({preview_visible:true}) this.setState({preview_visible:true})
} }
closePhone(e){ closePhone(e){

View File

@ -24,7 +24,7 @@ export default class acclist extends React.Component{
limit:10, limit:10,
tabList:[{title:"营销计划列表"}], tabList:[{title:"营销计划列表"}],
distdata:[{title:'士大夫大师傅'}], distdata:[{title:'士大夫大师傅'}],
filterList:[{id:0,label:"状态",menuList:[{id:0,name:"创建中"},{id:2,name:"审核中"},{id:4,name:"生效中"},{id:5,name:"暂停中"},{id:1,name:"生成中"},{id:3,name:"待生效"},{id:6,name:"已完结"}]}, filterList:[{id:0,label:"状态",menuList:[{id:0,name:"创建中"},{id:2,name:"审核中"},{id:4,name:"生效中"},{id:5,name:"暂停中"},{id:3,name:"待生效"},{id:6,name:"已完结"}]},
], ],
tableHeight:500, tableHeight:500,
menuList:[{id:0,name:"状态",check:false}], menuList:[{id:0,name:"状态",check:false}],