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

View File

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

View File

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