Merge branch 'couponV2.0' of https://codeup.aliyun.com/5f9118049cffa29cfdd3be1c/marketing/frontend into couponV2.0
This commit is contained in:
commit
85a0309e1c
|
@ -50,26 +50,24 @@ export default class bottomBar extends React.Component {
|
|||
}
|
||||
componentDidMount(){
|
||||
let config = JSON.parse(sessionStorage.getItem('editorConfig'));
|
||||
if (config && config.coupon && config.coupon.product_list) {
|
||||
let { navlist, defaultText, selectText, background, iswitch } = config.coupon.product_list.bottomBar;
|
||||
let { navlist, defaultText, selectText, background, iswitch } = this.props.bottomBarConfig?this.props.bottomBarConfig:config.coupon.product_list.bottomBar;
|
||||
this.setState({ defaultText, selectText, background, iswitch });
|
||||
let naVisual=navlist.filter(item=>item.iswitch);
|
||||
this.setState({navList:naVisual});
|
||||
}
|
||||
}
|
||||
render() {
|
||||
let active=this.state.active;
|
||||
return (
|
||||
<ul className='bottomBar-view' style={{ background:this.props.bottomBarConfig.background? `url('${this.props.bottomBarConfig.background}') center center /cover`:'#f9f9f9'}}>
|
||||
{
|
||||
this.state.navList.length>1?this.state.navList.map((item,index)=>{
|
||||
this.state.navList.map((item,index)=>{
|
||||
return(
|
||||
<li onClick={e=>this.clickIcon(e,index)} key={item.id}>
|
||||
<img src={active==index?item.pic.selectShow:item.pic.show} alt=""/>
|
||||
<span style={{color:active==index?this.props.bottomBarConfig.selectText:this.props.bottomBarConfig.defaultText}}>{item.text}</span>
|
||||
</li>
|
||||
)
|
||||
}):null
|
||||
})
|
||||
}
|
||||
</ul>
|
||||
)
|
||||
|
|
Loading…
Reference in New Issue