fix(系统模板):修复优惠券添加背景图,切换时,背景不展示

This commit is contained in:
Apple 2022-10-12 11:40:45 +08:00
parent da538eabda
commit 44a240172a
3 changed files with 6 additions and 10 deletions

View File

@ -10,7 +10,7 @@ export default class backPicture extends React.Component {
constructor(props) {
super(props)
this.state = {
bgimg: '',
bgImg: '',
bgColor: '#f2f3f4'
}
}
@ -18,9 +18,8 @@ export default class backPicture extends React.Component {
componentWillMount(e) {
let config = JSON.parse(sessionStorage.getItem('editorConfig'));
if (config && config.coupon && config.coupon.product_list) {
let bgimg = config.coupon.product_list.backgroundImg.bgImg;
let {bgColor} = config.coupon.product_list.backgroundImg;
this.setState({ bgimg,bgColor });
let {bgColor,bgImg} = config.coupon.product_list.backgroundImg;
this.setState({ bgImg,bgColor });
}
}
bgColorFn(color){
@ -36,7 +35,7 @@ export default class backPicture extends React.Component {
if (files.length > 0 && files[0].status == "success") {
bgImage=files[0].src;
}
this.setState({ bgimg: bgImage })
this.setState({ bgImg: bgImage })
Bus.emit('bgImgConfig',{attr:'bgImg',value:bgImage})
};
@ -119,7 +118,7 @@ export default class backPicture extends React.Component {
tips="单张图片不超过 5M"
onChange={(e) => { this.onUploadChange(e) }}
onUpload={this.onUpload}
defaultFileList={this.state.bgimg ? [{ 'src': this.state.bgimg }] : null}
defaultFileList={this.state.bgImg ? [{ 'src': this.state.bgImg }] : null}
onError={this.onUploadError}
/>
</FormItem>

View File

@ -11,7 +11,7 @@ export default class edittemplate extends React.Component {
constructor(props) {
super(props)
this.state = {
iswitch:true,
iswitch:1,
img:'',
jumpType:'0',//0不跳转 1跳转
jumpUrl:''

View File

@ -555,9 +555,6 @@
.detailstemplate{
transform: scale(0.387);
transform-origin: 0 0;
img{
width: auto!important;
}
.iptbg{
width: 100%!important;
}