diff --git a/src/assets/comm.css b/src/assets/comm.css index c40edada..bbbeae09 100644 --- a/src/assets/comm.css +++ b/src/assets/comm.css @@ -172,15 +172,15 @@ input { } .center { - text-align: center; + justify-content: center!important;; } .left { - text-align: left; + justify-content: flex-start!important;; } .right { - text-align: right; + justify-content: flex-end!important;; } .square { diff --git a/src/pages/exchangepage/couponTemplate/goodsPage/componentLib/main.js b/src/pages/exchangepage/couponTemplate/goodsPage/componentLib/main.js index 1a7c6a56..76103274 100644 --- a/src/pages/exchangepage/couponTemplate/goodsPage/componentLib/main.js +++ b/src/pages/exchangepage/couponTemplate/goodsPage/componentLib/main.js @@ -37,7 +37,10 @@ export default class componentLib extends React.Component { componentWillUnmount() {} propcomponentName(item){ this.props.componentName(item.name); - Bus.emit('componentLib',item) + if(item.name){ + Bus.emit('componentLib',item) + } + } render() { return ( diff --git a/src/pages/exchangepage/couponTemplate/goodsPage/config/searchBar.js b/src/pages/exchangepage/couponTemplate/goodsPage/config/searchBar.js index c77686c4..b8ced255 100644 --- a/src/pages/exchangepage/couponTemplate/goodsPage/config/searchBar.js +++ b/src/pages/exchangepage/couponTemplate/goodsPage/config/searchBar.js @@ -15,6 +15,8 @@ export default class Searchbar extends React.Component { shape: 'circular', textAlign: 'left', borderColor: '#333', + bgColor:'#a00', + fontColor:'#333', placeholder: '请输入关键字搜索' } } @@ -43,11 +45,31 @@ export default class Searchbar extends React.Component { }); 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) + } componentWillUnmount() { let oldobj = JSON.parse(sessionStorage.getItem('editorConfig')); let couponList = oldobj.couponList; @@ -56,7 +78,7 @@ export default class Searchbar extends React.Component { sessionStorage.setItem('editorConfig', JSON.stringify(oldobj)); } render() { - let { shape, textAlign, borderColor, placeholder } = this.state; + let { shape, textAlign, borderColor, placeholder,bgColor,fontColor } = this.state; return (
@@ -80,7 +102,7 @@ export default class Searchbar extends React.Component { 居右 - +
{ this.borderColorFn('#fff') }}> { this.borderColorFn('#04C160') }}> @@ -92,7 +114,31 @@ export default class Searchbar extends React.Component {
- + +
+ { this.bgColorFn('#fff') }}> + { this.bgColorFn('#04C160') }}> + { this.bgColorFn('#AE99D3') }}> + { this.bgColorFn('#FACD6A') }}> + { this.bgColorFn('#FE7962') }}> +
+ +
+
+
+ +
+ { this.fontColorFn('#fff') }}> + { this.fontColorFn('#04C160') }}> + { this.fontColorFn('#AE99D3') }}> + { this.fontColorFn('#FACD6A') }}> + { this.fontColorFn('#FE7962') }}> +
+ +
+
+
+ { this.setState({ placeholder: e }) Bus.emit('placeholder', e) diff --git a/src/pages/exchangepage/edittemplate/couponConfig/comm.less b/src/pages/exchangepage/edittemplate/couponConfig/comm.less index 8188ee93..b03c6194 100644 --- a/src/pages/exchangepage/edittemplate/couponConfig/comm.less +++ b/src/pages/exchangepage/edittemplate/couponConfig/comm.less @@ -1,14 +1,16 @@ +.searchBar-container{ + padding: 4px 0; + box-sizing: border-box; +} .searchBar{ display: flex; - justify-content: flex-end; - justify-content: space-between; - padding:0 15px; + justify-content: center; + padding:0 10px; box-sizing: border-box; i{ width: 16px; } .placeholder{ - flex: 1; white-space:nowrap; /* 不换行 */ overflow:hidden; /* 内容超出宽度时隐藏超出部分的内容 */ diff --git a/src/pages/exchangepage/edittemplate/couponConfig/searchBar.js b/src/pages/exchangepage/edittemplate/couponConfig/searchBar.js index 342c1761..1e779896 100644 --- a/src/pages/exchangepage/edittemplate/couponConfig/searchBar.js +++ b/src/pages/exchangepage/edittemplate/couponConfig/searchBar.js @@ -7,15 +7,16 @@ export default class searchBar extends React.Component { } render() { let searchConfig=this.props.searchConfig; - console.log(10,searchConfig); return ( -
+
+
-
+
{searchConfig.placeholder}
+
) } } \ No newline at end of file diff --git a/src/pages/exchangepage/edittemplate/goodstemplate.less b/src/pages/exchangepage/edittemplate/goodstemplate.less index d745fb74..814628d7 100644 --- a/src/pages/exchangepage/edittemplate/goodstemplate.less +++ b/src/pages/exchangepage/edittemplate/goodstemplate.less @@ -118,7 +118,7 @@ } .goodstemplate { - overflow-y: auto; + // overflow-y: auto; .selectBorder { z-index: 2; -webkit-box-sizing: border-box; @@ -153,12 +153,12 @@ .searchBar { width: 80%; - margin: 2% 10%; + margin: 2% 15%; height: 40px; line-height: 40px; padding-left: 15px; box-sizing: border-box; - border: 1px solid #333; + border:0; border-radius: 20px; } } diff --git a/src/pages/exchangepage/edittemplate/main.js b/src/pages/exchangepage/edittemplate/main.js index b02791b6..04bf0d15 100644 --- a/src/pages/exchangepage/edittemplate/main.js +++ b/src/pages/exchangepage/edittemplate/main.js @@ -87,6 +87,8 @@ let couponProduct_list = { shape: 'circular', textAlign: 'left', borderColor: '#333', + bgColor:'#a00', + fontColor:'#333', placeholder: '请输入关键字搜索' }, title: { @@ -212,6 +214,16 @@ export default class edittemplate extends React.Component { 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('title', (prop) => { let titleConfig = this.state.product_list diff --git a/src/pages/exchangepage/edittemplate/main.less b/src/pages/exchangepage/edittemplate/main.less index 5c031010..9effa13c 100644 --- a/src/pages/exchangepage/edittemplate/main.less +++ b/src/pages/exchangepage/edittemplate/main.less @@ -8,7 +8,7 @@ // background-color: #f5f7f8; height: 100%; left: 0; - margin: 0 485px 0 250px; + margin: 0 430px 0 325px; overflow-y: scroll; position: absolute; right: 0;