解决优惠券白名单商品列表页面基础组建增加删除数据不匹配

This commit is contained in:
许红梅 2022-09-16 11:01:03 +08:00
parent 17f38c3491
commit 10b4d02838
5 changed files with 32 additions and 10 deletions

View File

@ -13,7 +13,7 @@ export default class edittemplate extends React.Component {
constructor(props) { constructor(props) {
super(props) super(props)
this.state = { this.state = {
iswitch:false, iswitch:true,
comType:1, comType:1,
navlist:[ navlist:[
{ {
@ -53,6 +53,11 @@ export default class edittemplate extends React.Component {
} }
} }
componentWillMount(e) { componentWillMount(e) {
Bus.addListener('componentLibClose', (prop) => {
if(prop=='bottomBar'){
this.setState({iswitch:false})
}
})
let config = JSON.parse(sessionStorage.getItem('editorConfig')); let config = JSON.parse(sessionStorage.getItem('editorConfig'));
if (config && config.couponList && config.couponList.product_list) { if (config && config.couponList && config.couponList.product_list) {
let { navlist, defaultText, selectText, background,iswitch } = config.couponList.product_list.bottomBar; let { navlist, defaultText, selectText, background,iswitch } = config.couponList.product_list.bottomBar;

View File

@ -11,19 +11,22 @@ export default class edittemplate extends React.Component {
constructor(props) { constructor(props) {
super(props) super(props)
this.state = { this.state = {
iswitch:false, iswitch:true,
img:'', img:'',
jumpType:'0',//0不跳转 1跳转 jumpType:'0',//0不跳转 1跳转
jumpUrl:'' jumpUrl:''
} }
} }
componentWillMount(e) { componentWillMount(e) {
Bus.addListener('componentLibClose', (prop) => {
if(prop=='picture'){
this.setState({iswitch:false})
}
})
let config = JSON.parse(sessionStorage.getItem('editorConfig')); let config = JSON.parse(sessionStorage.getItem('editorConfig'));
if (config && config.couponList && config.couponList.product_list) { if (config && config.couponList && config.couponList.product_list) {
let {img,jumpType,jumpUrl,iswitch}=config.couponList.product_list.picture; let {img,jumpType,jumpUrl}=config.couponList.product_list.picture;
console.log(21,config.couponList.product_list.picture); this.setState({ img,jumpType,jumpUrl});
this.setState({ img,jumpType,jumpUrl,iswitch});
} }
} }
@ -98,12 +101,13 @@ export default class edittemplate extends React.Component {
componentWillUnmount() { componentWillUnmount() {
let oldobj = JSON.parse(sessionStorage.getItem('editorConfig')); let oldobj = JSON.parse(sessionStorage.getItem('editorConfig'));
let couponList = oldobj.couponList; let couponList = oldobj.couponList;
console.log(105,this.state);
couponList.product_list.picture = _.cloneDeep(this.state); couponList.product_list.picture = _.cloneDeep(this.state);
oldobj.couponList = couponList; oldobj.couponList = couponList;
sessionStorage.setItem('editorConfig', JSON.stringify(oldobj)); sessionStorage.setItem('editorConfig', JSON.stringify(oldobj));
} }
render() { render() {
console.log(105,this.state);
return ( return (
<div className="assembly"> <div className="assembly">
<div className='control page-title-control'> <div className='control page-title-control'>

View File

@ -11,7 +11,7 @@ export default class Searchbar extends React.Component {
constructor(props) { constructor(props) {
super(props) super(props)
this.state = { this.state = {
switch:false, iswitch:true,
shape: 'circular', shape: 'circular',
textAlign: 'center', textAlign: 'center',
borderColor: '#333', borderColor: '#333',
@ -21,6 +21,13 @@ export default class Searchbar extends React.Component {
} }
} }
componentWillMount(e) { componentWillMount(e) {
//关闭
Bus.addListener('componentLibClose', (prop) => {
console.log(999,prop);
if(prop=='search'){
this.setState({iswitch:false})
}
})
let config = JSON.parse(sessionStorage.getItem('editorConfig')); let config = JSON.parse(sessionStorage.getItem('editorConfig'));
if (config && config.couponList && config.couponList.product_list) { if (config && config.couponList && config.couponList.product_list) {
let { shape, textAlign, borderColor, placeholder } = config.couponList.product_list.search; let { shape, textAlign, borderColor, placeholder } = config.couponList.product_list.search;

View File

@ -11,7 +11,7 @@ export default class Title extends React.Component {
constructor(props) { constructor(props) {
super(props) super(props)
this.state = { this.state = {
switch:false, switch:true,
text: '商品标题', text: '商品标题',
textAlign: 'left', textAlign: 'left',
fontColor: '#333', fontColor: '#333',
@ -21,6 +21,12 @@ export default class Title extends React.Component {
} }
} }
componentWillMount(e) { componentWillMount(e) {
Bus.addListener('componentLibClose', (prop) => {
console.log(999,prop);
if(prop=='title'){
this.setState({iswitch:false})
}
})
let config = JSON.parse(sessionStorage.getItem('editorConfig')); let config = JSON.parse(sessionStorage.getItem('editorConfig'));
if (config && config.couponList && config.couponList.product_list) { if (config && config.couponList && config.couponList.product_list) {
let { text, textAlign, fontColor, fontSize } = config.couponList.product_list.title; let { text, textAlign, fontColor, fontSize } = config.couponList.product_list.title;

View File

@ -822,7 +822,7 @@ export default class edittemplate extends React.Component {
this.setState({ componentOfconfig: c }); this.setState({ componentOfconfig: c });
} }
render() { render() {
console.log(761,this.state.model); console.log(761,this.state);
return ( return (
<div className='edittemplate'> <div className='edittemplate'>
<div className='topHeader'> <div className='topHeader'>