diff --git a/src/pages/exchangepage/edittemplate/couponCard/goodsPage/componentLib/main.js b/src/pages/exchangepage/edittemplate/couponCard/goodsPage/componentLib/main.js index ab104510..33276d60 100644 --- a/src/pages/exchangepage/edittemplate/couponCard/goodsPage/componentLib/main.js +++ b/src/pages/exchangepage/edittemplate/couponCard/goodsPage/componentLib/main.js @@ -34,7 +34,7 @@ export default class componentLib extends React.Component { propcomponentName(item){ this.props.componentName(item.name); if(item.name){ - Bus.emit('componentLib',item) + Bus.emit('componentLib', {attr:item.name,value:1}) } } diff --git a/src/pages/exchangepage/edittemplate/couponCard/goodsPage/config/backPicture.js b/src/pages/exchangepage/edittemplate/couponCard/goodsPage/config/backPicture.js index 221d09b7..68133f96 100644 --- a/src/pages/exchangepage/edittemplate/couponCard/goodsPage/config/backPicture.js +++ b/src/pages/exchangepage/edittemplate/couponCard/goodsPage/config/backPicture.js @@ -26,23 +26,17 @@ export default class backPicture extends React.Component { this.setState({ bgColor: color }); - Bus.emit('globalColor',color) - } - handleChange1 = (color) => { - this.setState({ - bgColor: color - }); - Bus.emit('globalColor',color) + Bus.emit('bgImgConfig',{attr:'bgColor',value:color}) + } //顶部banner onUploadChange(files) { + let bgImage=''; if (files.length > 0 && files[0].status == "success") { - this.setState({ bgimg: files[0].src }) - Bus.emit('bgImg', files[0].src) - } else { - this.setState({ bgimg: '' }) - Bus.emit('bgImg', '') + bgImage=files[0].src; } + this.setState({ bgimg: bgImage }) + Bus.emit('bgImgConfig',{attr:'bgImg',value:bgImage}) }; onUploadError = (type, data) => { @@ -136,7 +130,7 @@ export default class backPicture extends React.Component { { this.bgColorFn('#FACD6A') }}> { this.bgColorFn('#FE7962') }}>
- + { this.bgColorFn(c)}} />
diff --git a/src/pages/exchangepage/edittemplate/couponCard/goodsPage/config/bottomBar.js b/src/pages/exchangepage/edittemplate/couponCard/goodsPage/config/bottomBar.js index 892bff15..3d5fac9c 100644 --- a/src/pages/exchangepage/edittemplate/couponCard/goodsPage/config/bottomBar.js +++ b/src/pages/exchangepage/edittemplate/couponCard/goodsPage/config/bottomBar.js @@ -65,9 +65,9 @@ export default class edittemplate extends React.Component { } } componentWillMount(e) { - Bus.addListener('componentLibClose', (prop) => { - if (prop == 'bottomBar') { - this.setState({ iswitch: false }) + Bus.addListener('componentLib', (prop) => { + if (prop.attr == 'bottomBar') { + this.setState({ iswitch: prop.value }) } }) let config = JSON.parse(sessionStorage.getItem('editorConfig')); diff --git a/src/pages/exchangepage/edittemplate/couponCard/goodsPage/config/picture.js b/src/pages/exchangepage/edittemplate/couponCard/goodsPage/config/picture.js index 25b6fc7a..a5aed06b 100644 --- a/src/pages/exchangepage/edittemplate/couponCard/goodsPage/config/picture.js +++ b/src/pages/exchangepage/edittemplate/couponCard/goodsPage/config/picture.js @@ -18,9 +18,9 @@ export default class edittemplate extends React.Component { } } componentWillMount(e) { - Bus.addListener('componentLibClose', (prop) => { - if(prop=='picture'){ - this.setState({iswitch:false}) + Bus.addListener('componentLib', (prop) => { + if (prop.attr == 'picture') { + this.setState({ iswitch: prop.value }) } }) let config = JSON.parse(sessionStorage.getItem('editorConfig')); diff --git a/src/pages/exchangepage/edittemplate/couponCard/goodsPage/config/searchBar.js b/src/pages/exchangepage/edittemplate/couponCard/goodsPage/config/searchBar.js index 5156a31c..73649e6e 100644 --- a/src/pages/exchangepage/edittemplate/couponCard/goodsPage/config/searchBar.js +++ b/src/pages/exchangepage/edittemplate/couponCard/goodsPage/config/searchBar.js @@ -10,7 +10,7 @@ export default class Searchbar extends React.Component { constructor(props) { super(props) this.state = { - iswitch:true, + iswitch:1, shape: 'circular', textAlign: 'center', borderColor: '#FFFAF5', @@ -21,9 +21,10 @@ export default class Searchbar extends React.Component { } componentWillMount(e) { //关闭 - Bus.addListener('componentLibClose', (prop) => { - if(prop=='search'){ - this.setState({iswitch:false}) + Bus.addListener('componentLib', (prop) => { + console.log(25,prop); + if (prop.attr == 'search') { + this.setState({ iswitch: prop.value }) } }) let config = JSON.parse(sessionStorage.getItem('editorConfig')); @@ -31,46 +32,13 @@ export default class Searchbar extends React.Component { this.setState({...config.coupon.product_list.search}); } } - //形状 - shapeChange(e) { - this.setState({ shape: e.target.value }) - Bus.emit('shape', e.target.value) - } - //文字 - textChange(e) { - this.setState({ textAlign: e.target.value }) - Bus.emit('textAlign', e.target.value) - } - changeBorder = (color) => { - this.setState({ - borderColor: color - }); - Bus.emit('borderColor', color) - } - changebgColor = (color) => { - this.setState({ - bgColor: color - }); - Bus.emit('searchbgColor', color) - } - changefontColor = (color) => { - this.setState({ - fontColor: color - }); - Bus.emit('searchfontColor', color) - } - borderColorFn(cor) { - this.setState({ borderColor: cor }); - Bus.emit('borderColor', cor) - } - bgColorFn(cor) { - this.setState({ bgColor: cor }); - Bus.emit('searchbgColor', cor) - } - fontColorFn(cor) { - this.setState({ fontColor: cor }); - Bus.emit('searchfontColor', cor) + //形状+颜色+框体颜色+背景颜色+文字颜色 + changeConfig(attr,value){ + console.log(36,attr,value); + this.setState({ [attr]: value }) + Bus.emit('searchBarConfig', {attr,value}) } + componentWillUnmount() { let oldobj = JSON.parse(sessionStorage.getItem('editorConfig')); let coupon = oldobj.coupon; @@ -79,6 +47,7 @@ export default class Searchbar extends React.Component { sessionStorage.setItem('editorConfig', JSON.stringify(oldobj)); } render() { + console.log(83,this.state); let { shape, textAlign, borderColor, placeholder,bgColor,fontColor } = this.state; return (
@@ -89,14 +58,14 @@ export default class Searchbar extends React.Component {
- { this.shapeChange(e) }} value={shape}> + { this.changeConfig('shape',e.target.value) }} value={shape}> 圆形 方形
- { this.textChange(e) }} value={textAlign}> + { this.changeConfig('textAlign',e.target.value) }} value={textAlign}> 居左 居中 居右 @@ -104,48 +73,46 @@ export default class Searchbar extends React.Component {
- { this.borderColorFn('#fff') }}> - { this.borderColorFn('#04C160') }}> - { this.borderColorFn('#AE99D3') }}> - { this.borderColorFn('#FACD6A') }}> - { this.borderColorFn('#FE7962') }}> + { this.changeConfig('borderColor','#ffffff')}}> + { this.changeConfig('borderColor','#04C160') }}> + { this.changeConfig('borderColor','#AE99D3') }}> + { this.changeConfig('borderColor','#FACD6A') }}> + { this.changeConfig('borderColor','#FE7962') }}>
- + {this.changeConfig('borderColor',c)}} />
- { this.bgColorFn('#fff') }}> - { this.bgColorFn('#04C160') }}> - { this.bgColorFn('#AE99D3') }}> - { this.bgColorFn('#FACD6A') }}> - { this.bgColorFn('#FE7962') }}> + { this.changeConfig('bgColor','#fff') }}> + { this.changeConfig('bgColor','#04C160') }}> + { this.changeConfig('bgColor','#AE99D3') }}> + { this.changeConfig('bgColor','#FACD6A') }}> + { this.changeConfig('bgColor','#FE7962') }}>
- + {this.changeConfig('bgColor',c)}} />
- { this.fontColorFn('#fff') }}> - { this.fontColorFn('#04C160') }}> - { this.fontColorFn('#AE99D3') }}> - { this.fontColorFn('#FACD6A') }}> - { this.fontColorFn('#FE7962') }}> + { this.changeConfig('fontColor','#fff') }}> + { this.changeConfig('fontColor','#04C160') }}> + { this.changeConfig('fontColor','#AE99D3') }}> + { this.changeConfig('fontColor','#FACD6A') }}> + { this.changeConfig('fontColor','#FE7962') }}>
- + {this.changeConfig('fontColor',c)}} />
{ - this.setState({ placeholder: e }) - Bus.emit('placeholder', e) + this.changeConfig('placeholder', e) }} onClearItem={(e) => { - this.setState({ placeholder: '' }) - Bus.emit('placeholder', '') + this.changeConfig('placeholder','') }} value={placeholder} placeholder={"请输入"} labelWidth={'0px'} maxLength={9} height={'36px'} width={'300px'} alignment={'left'} /> diff --git a/src/pages/exchangepage/edittemplate/couponCard/goodsPage/config/title.js b/src/pages/exchangepage/edittemplate/couponCard/goodsPage/config/title.js index dfc4b997..f5363d99 100644 --- a/src/pages/exchangepage/edittemplate/couponCard/goodsPage/config/title.js +++ b/src/pages/exchangepage/edittemplate/couponCard/goodsPage/config/title.js @@ -11,7 +11,7 @@ export default class Title extends React.Component { constructor(props) { super(props) this.state = { - switch:true, + switch:1, text: '商品列表', textAlign: 'left', fontColor: '#333', @@ -21,54 +21,28 @@ export default class Title extends React.Component { } } componentWillMount(e) { - Bus.addListener('componentLibClose', (prop) => { - if(prop=='title'){ - this.setState({iswitch:false}) + Bus.addListener('componentLib', (prop) => { + if (prop.attr == 'title') { + this.setState({ iswitch: prop.value }) } }) let config = JSON.parse(sessionStorage.getItem('editorConfig')); if (config && config.coupon && config.coupon.product_list) { - let { text, textAlign, fontColor, fontSize } = config.coupon.product_list.title; - this.setState({ text, textAlign, fontColor, fontSize }); + this.setState({...config.coupon.product_list.title}); } } - - - //文字格式 - textAlignChange(e) { - this.setState({ textAlign: e.target.value }) - Bus.emit('titleAlign',e.target.value) - } - - - handleChange1 = (color) => { - this.setState({ - fontColor: color - }); - Bus.emit('fontColor',color) - } - - // 字体颜色 - fontcolor(cor) { - this.setState({ fontColor: cor }); - Bus.emit('fontColor', cor) - } - fontSizeChange(e) { - this.setState({ fontSize: e.target.value }) - Bus.emit('fontSize', e.target.value) - } - styleChange(e){ - this.setState({ comstyle: e.target.value }) - Bus.emit('comstyle', e.target.value) + changeConfig(attr,value){ + console.log(36,attr,value); + this.setState({ [attr]: value }) + Bus.emit('titleBarConfig', {attr,value}) } onUploadChange(files) { + let image='' if (files.length > 0 && files[0].status == "success") { - this.setState({ pic: files[0].src }) - Bus.emit('titlePic', files[0].src) - } else { - this.setState({ pic: ''}) - Bus.emit('titlePic','') + image=files[0].src; } + this.setState({ pic:image}) + Bus.emit('titleBarConfig', {attr:'pic',value:image}) }; onUploadError = (type, data) => { @@ -80,7 +54,6 @@ export default class Title extends React.Component { }; onUpload = (file, report) => { let self = this; - console.log('上传头像', file); return new Promise((resolve, reject) => { let path = "" let formdata = new FormData(); @@ -141,7 +114,7 @@ export default class Title extends React.Component {
- { this.styleChange(e) }} value={this.state.comstyle}> + { this.changeConfig('comstyle',e.target.value) }} value={this.state.comstyle}> 文字 图片 @@ -150,17 +123,15 @@ export default class Title extends React.Component { this.state.comstyle==1?
{ - this.setState({ text: e }) - Bus.emit('title', e) + this.changeConfig('text',e) }} onClearItem={(e) => { - this.setState({ text: '' }) - Bus.emit('title', '') + this.changeConfig('text','') }} value={this.state.text} placeholder={"请输入"} labelWidth={'0px'} maxLength={12} height={'36px'} width={'300px'} alignment={'left'} /> - { this.textAlignChange(e) }} value={this.state.textAlign}> + { this.changeConfig('textAlign',e.target.value)}} value={this.state.textAlign}> 居左 居中 居右 @@ -168,18 +139,18 @@ export default class Title extends React.Component {
- { this.fontcolor('#fff') }}> - { this.fontcolor('#04C160') }}> - { this.fontcolor('#AE99D3') }}> - { this.fontcolor('#FACD6A') }}> - { this.fontcolor('#FE7962') }}> + { this.changeConfig('fontColor','#fff') }}> + { this.changeConfig('fontColor','#04C160') }}> + { this.changeConfig('fontColor','#AE99D3') }}> + { this.changeConfig('fontColor','#FACD6A') }}> + { this.changeConfig('fontColor','#FE7962') }}>
- + {this.changeConfig('fontColor',c)}} />
- { this.fontSizeChange(e) }} value={this.state.fontSize}> + { this.changeConfig('fontSize',e.target.value) }} value={this.state.fontSize}> A- A A+ diff --git a/src/pages/exchangepage/edittemplate/goodstemplate.js b/src/pages/exchangepage/edittemplate/goodstemplate.js index b5768430..f2b7ed3c 100644 --- a/src/pages/exchangepage/edittemplate/goodstemplate.js +++ b/src/pages/exchangepage/edittemplate/goodstemplate.js @@ -30,140 +30,80 @@ export default class edittemplate extends React.Component { } deleteFn() { - let selectDom = this.state.selectDom;//需删除组件名称 - Sweetalert.confirm({ - title: '确认信息', - content:

确认删除该模块?

, - onConfirm: () => { - this.setState({ selectDom: '' }); - - Bus.emit('componentLibClose', selectDom) - + Bus.emit('componentLib', {attr:selectDom,value:0}) }, - onCancel: () => { - - - }, - parentComponent: this - }); - } - - render() { let goodsConfig = this.props.goodsdata; - console.log(48, goodsConfig); let naVisual = [] if (goodsConfig.bottomBar) { naVisual = goodsConfig.bottomBar.navlist.filter(item => item.iswitch); } - return ( - -
-
+
+
{ - goodsConfig.search && goodsConfig.search.iswitch ?
this.customComponent(e, 'search', 'marketing-sousuolan-', '搜索栏')} className={this.state.selectDom == 'search' ? 'selectBorder' : ''} ref="search">
: null - } - - { - !goodsConfig.top_image ? : } - { - goodsConfig.picture && goodsConfig.picture.iswitch ?
this.customComponent(e, 'picture', 'marketing-tupian', '图片')} ref="picture" className={this.state.selectDom == 'picture' ? 'selectBorder' : ''}>
: null } - { - goodsConfig.title && goodsConfig.title.iswitch && goodsConfig.title.comstyle == 1 ?
this.customComponent(e, 'title', 'marketing-fuwenbenkuang', '标题')} ref="title" className={this.state.selectDom == 'title' ? 'selectBorder' : ''}>
{goodsConfig.title.text}
: null - } { - goodsConfig.title && goodsConfig.title.iswitch && goodsConfig.title.comstyle == 2 ?
this.customComponent(e, 'title', 'marketing-fuwenbenkuang', '标题')} ref="title" className={this.state.selectDom == 'title' ? 'selectBorder' : ''}>
: null - } - { - goodsConfig.title && goodsConfig.title.iswitch && goodsConfig.title.text || goodsConfig.picture && goodsConfig.picture.iswitch && goodsConfig.picture.img ?
: null - } - { - goodsConfig.list == 2 ? : goodsConfig.list == 3 ? : - } - - - { - goodsConfig.describe.type == 1 ? : goodsConfig.describe.type == 3 ?
: null - } - { - goodsConfig.describe.type == 2 ? : null - } { - goodsConfig.list == 2 ? : null - } { goodsConfig.bottomBar && goodsConfig.bottomBar.iswitch && naVisual.length > 1 ?
this.customComponent(e, 'bottomBar', 'marketing-list', '底部栏')} className={this.state.selectDom == 'bottomBar' ? 'selectBottomBorder' : ''}>
: null } - -
- { - this.state.selectDom ?
- {this.state.comName} - | - 删除 -
: null - }
- ) - } - } \ No newline at end of file diff --git a/src/pages/exchangepage/edittemplate/main.js b/src/pages/exchangepage/edittemplate/main.js index fecd6dcc..e474379d 100644 --- a/src/pages/exchangepage/edittemplate/main.js +++ b/src/pages/exchangepage/edittemplate/main.js @@ -5,25 +5,25 @@ import React from 'react' import { BlockLoading, Button, Notify, RadioButton, RadioGroup } from 'zent' import { addSystemTemplate, addTheme, handelResponse, putMyTheme, putSystemTemplate, putTheme, uploadImg } from '../../../assets/api.js' import '../../../assets/comm.css' -import PreviewEffect from '../previewEffect/main' -import CouponGoodsDetailForm from './couponCard/couponDetailconfig'; //优惠券商品详情页 -import CouponReduceDetailForm from './couponCard/couponReduceDetail'; //优惠券立减金详情页 -// 优惠券 -import CouponLandingForm from './couponCard/landPage'; //优惠券落地页表单 -import CouponComLib from './couponCard/goodsPage/componentLib/main'; //优惠券组件库 -import CouponGoodsListForm from './couponCard/goodsPage/config/main'; //优惠券商品列表页 -import DetailsPage from './exchange/detailsPage'; //商品详情form页面 -import Detailstemplate from './detailstemplate' -import Descteplate from './goodsdesc' -import GoodsForm from './exchange/goodsPage'; //商品页表单 -import Goodstemplate from './goodstemplate' -import LandingForm from './exchange/landingPage'; //落地页表单 import './main.less' +import PreviewEffect from '../previewEffect/main' +import Detailstemplate from './detailstemplate' +import DetailsPage from './exchange/detailsPage'; //商品详情form页面 +import GoodsForm from './exchange/goodsPage'; //商品页表单 +import LandingForm from './exchange/landingPage'; //落地页表单 +import Descteplate from './goodsdesc' +import Goodstemplate from './goodstemplate' import Reduce from './reduce'; //商品详情页立减金 import ReduceConfig from './reduceConfig'; //商品详情立减金页面 import Whitedetails from './whiteList/whitedetails'; //白名单详情页 import Whitegoods from './whiteList/whitegoods'; //白名单商品页面 import WhiteLand from './whiteList/whiteLand'; //白名单落地页 +// 优惠券 +import CouponLandingForm from './couponCard/landPage'; //优惠券落地页表单 +import CouponGoodsDetailForm from './couponCard/couponDetailconfig'; //优惠券商品详情页 +import CouponReduceDetailForm from './couponCard/couponReduceDetail'; //优惠券立减金详情页 +import CouponComLib from './couponCard/goodsPage/componentLib/main'; //优惠券组件库 +import CouponGoodsListForm from './couponCard/goodsPage/config/main'; //优惠券商品列表页 //落地页 let model = { title: '落地页标题', @@ -64,18 +64,18 @@ let couponProduct_list = { button_color: '#FACD6A', describe: { type: '', content: '', bg_image: '' }, picture: { - iswitch: false, + iswitch: 0, //0 不显示 1显示 img: '', jumpType: '0',//0不跳转 1跳转 jumpUrl: '' }, backgroundImg: { - iswitch: false, + iswitch: 0, bgImg: '', bgColor: '#f2f3f4' }, search: { - iswitch: false, + iswitch: 0, shape: 'circular', textAlign: 'center', borderColor: '#FFFAF5', @@ -84,7 +84,7 @@ let couponProduct_list = { placeholder: '请输入商品名称' }, title: { - iswitch: false, + iswitch: 0, text: '商品列表', textAlign: 'left', fontColor: '#333', @@ -93,11 +93,11 @@ let couponProduct_list = { pic: '' }, bottomBar: { - iswitch: false, + iswitch: 0, navlist: [ { id: 1, - iswitch: true, + iswitch: 1, name: 'index', pic: { show: 'https://lsxdemall.oss-cn-beijing.aliyuncs.com/MarketingSystem/img/coupon/bottombar/home.png', @@ -107,7 +107,7 @@ let couponProduct_list = { }, { id: 2, - iswitch: true, + iswitch: 1, name: 'order', pic: { show: 'https://lsxdemall.oss-cn-beijing.aliyuncs.com/MarketingSystem/img/coupon/bottombar/order.png', @@ -117,7 +117,7 @@ let couponProduct_list = { }, { id: 3, - iswitch: true, + iswitch: 1, name: 'coupon', pic: { show: 'https://lsxdemall.oss-cn-beijing.aliyuncs.com/MarketingSystem/img/coupon/bottombar/coupon.png', @@ -139,10 +139,10 @@ export default class edittemplate extends React.Component { systemTitle: '',//控制系统模版标题回显 activeshow: true, //控制商品列表页活动说明显示与否 loading_visible: false,//保存加载效果 - componentOfconfig: '',//选择组件库 + componentOfconfig: '',//自定义基础组件库 detailactiveshow: true, pagedisable: false, - showType: 3, //兑换码/白名单/立减金 + showType: 3, //兑换码3/白名单1/优惠券4 优惠券白名单8 //落地页 model, //商品列表 @@ -156,105 +156,41 @@ export default class edittemplate extends React.Component { pageStep: 1, showPage: 1, setStyle: { width: '375px', height: '667px', transform: 'scale(0.75)' }, - detailType: 1 //详情页1 权益 2-立减金 + detailType: 1 //详情页1 权益 2立减金 } this.canvasImgDom = this.canvasImgDom.bind(this) this.canvasImgDomScr = this.canvasImgDomScr.bind(this) } - //获取落地页表单数据 - getLandingdata(val) { - this.setState({ model: val }) - } + componentDidMount() { - //开启 + //开启/关闭自定义组件 Bus.addListener('componentLib', (prop) => { let coupongoodsConfig = this.state.product_list - coupongoodsConfig[prop.name].iswitch = true + console.log(169,prop); + coupongoodsConfig[prop.attr].iswitch = prop.value this.setState({ product_list: coupongoodsConfig }) }) - //关闭 - Bus.addListener('componentLibClose', (prop) => { - let coupongoodsConfig = this.state.product_list - coupongoodsConfig[prop].iswitch = false - this.setState({ product_list: coupongoodsConfig, componentOfconfig: '' }) - }) Bus.addListener('picture', (prop) => { let coupongoodsConfig = this.state.product_list coupongoodsConfig.picture.img = prop this.setState({ product_list: coupongoodsConfig }) }) //背景图 - Bus.addListener('bgImg', (prop) => { + Bus.addListener('bgImgConfig', (prop) => { let bgImgConfig = this.state.product_list - bgImgConfig.backgroundImg.bgImg = prop + bgImgConfig.backgroundImg[prop.attr] = prop.value; this.setState({ product_list: bgImgConfig }) }) - Bus.addListener('globalColor', (prop) => { - let bgImgConfig = this.state.product_list - bgImgConfig.backgroundImg.bgColor = prop - this.setState({ product_list: bgImgConfig }) - }) - - Bus.addListener('shape', (prop) => { - let searchConfig = this.state.product_list - searchConfig.search.shape = prop + //搜索栏 + Bus.addListener('searchBarConfig', (prop) => { + let searchConfig = this.state.product_list + searchConfig.search[prop.attr] = prop.value this.setState({ product_list: searchConfig }) - }) - Bus.addListener('textAlign', (prop) => { - let searchConfig = this.state.product_list - searchConfig.search.textAlign = prop - this.setState({ product_list: searchConfig }) - }) - Bus.addListener('placeholder', (prop) => { - let searchConfig = this.state.product_list - searchConfig.search.placeholder = prop - this.setState({ product_list: searchConfig }) - }) - Bus.addListener('borderColor', (prop) => { - let searchConfig = this.state.product_list - searchConfig.search.borderColor = prop - this.setState({ product_list: searchConfig }) - }) - Bus.addListener('searchbgColor', (prop) => { - let searchConfig = this.state.product_list - searchConfig.search.bgColor = prop - this.setState({ product_list: searchConfig }) - }) - Bus.addListener('searchfontColor', (prop) => { - let searchConfig = this.state.product_list - searchConfig.search.fontColor = prop - this.setState({ product_list: searchConfig }) - }) + }) //标题设置 - Bus.addListener('comstyle', (prop) => { + Bus.addListener('titleBarConfig', (prop) => { let titleConfig = this.state.product_list - titleConfig.title.comstyle = prop - this.setState({ product_list: titleConfig }) - }) - Bus.addListener('titlePic', (prop) => { - let titleConfig = this.state.product_list - titleConfig.title.pic = prop - this.setState({ product_list: titleConfig }) - }) - - Bus.addListener('title', (prop) => { - let titleConfig = this.state.product_list - titleConfig.title.text = prop - this.setState({ product_list: titleConfig }) - }) - Bus.addListener('titleAlign', (prop) => { - let titleConfig = this.state.product_list - titleConfig.title.textAlign = prop - this.setState({ product_list: titleConfig }) - }) - Bus.addListener('fontColor', (prop) => { - let titleConfig = this.state.product_list - titleConfig.title.fontColor = prop - this.setState({ product_list: titleConfig }) - }) - Bus.addListener('fontSize', (prop) => { - let titleConfig = this.state.product_list - titleConfig.title.fontSize = prop + titleConfig.title[prop.attr] = prop.value this.setState({ product_list: titleConfig }) }) //底部栏 @@ -585,6 +521,10 @@ export default class edittemplate extends React.Component { }) } } + //获取落地页表单数据 + getLandingdata(val) { + this.setState({ model: val }) + } //获取落地页数据 getlandConfig(c) { console.log(578);