From aa47a2e622b7090a2ce5db78eb6b5d34b7c1e5e0 Mon Sep 17 00:00:00 2001
From: Apple <>
Date: Fri, 23 Sep 2022 14:32:26 +0800
Subject: [PATCH] =?UTF-8?q?=E7=BC=96=E8=BE=91=E5=99=A8=E5=BA=95=E9=83=A8?=
=?UTF-8?q?=E6=A0=8F=E5=88=A0=E9=99=A4/=E6=B7=BB=E5=8A=A0=E7=BB=84?=
=?UTF-8?q?=E4=BB=B6=E8=81=94=E5=8A=A8?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../couponCard/couponViewConfig/bottomBar.js | 14 +-
.../couponCard/couponViewConfig/comm.less | 3 +-
.../couponCard/goodsPage/componentLib/main.js | 1 +
.../couponCard/goodsPage/config/bottomBar.js | 141 +++++-------------
.../couponCard/goodsPage/config/picture.js | 5 -
.../couponCard/goodsPage/config/searchBar.js | 6 -
.../couponCard/goodsPage/config/title.js | 5 -
.../edittemplate/goodstemplate.js | 4 +-
src/pages/exchangepage/edittemplate/main.js | 36 ++---
9 files changed, 58 insertions(+), 157 deletions(-)
diff --git a/src/pages/exchangepage/edittemplate/couponCard/couponViewConfig/bottomBar.js b/src/pages/exchangepage/edittemplate/couponCard/couponViewConfig/bottomBar.js
index 3f665fc6..4976e6c8 100644
--- a/src/pages/exchangepage/edittemplate/couponCard/couponViewConfig/bottomBar.js
+++ b/src/pages/exchangepage/edittemplate/couponCard/couponViewConfig/bottomBar.js
@@ -8,7 +8,7 @@ export default class bottomBar extends React.Component {
navList:[
{
id:1,
- iswitch:true,
+ iswitch:1,
name:'index',
pic:{
show:'',
@@ -18,7 +18,7 @@ export default class bottomBar extends React.Component {
},
{
id:2,
- iswitch:true,
+ iswitch:1,
name:'order',
pic:{
show:'',
@@ -28,7 +28,7 @@ export default class bottomBar extends React.Component {
},
{
id:3,
- iswitch:true,
+ iswitch:1,
name:'coupon',
pic:{
show:'',
@@ -41,7 +41,6 @@ export default class bottomBar extends React.Component {
}
}
componentWillReceiveProps(nextProps){
- console.log(44,nextProps);
let navList=nextProps.bottomBarConfig.navlist;
let naVisual=navList.filter(item=>item.iswitch);
this.setState({navList:naVisual});
@@ -50,7 +49,6 @@ export default class bottomBar extends React.Component {
this.setState({active:index});
}
componentDidMount(){
- console.log(53);
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;
@@ -65,14 +63,14 @@ export default class bottomBar extends React.Component {
return (
{
- this.state.navList.map((item,index)=>{
+ this.state.navList.length>1?this.state.navList.map((item,index)=>{
return(
- - this.clickIcon(e,index)}>
+
- this.clickIcon(e,index)} key={item.id}>
{item.text}
)
- })
+ }):null
}
)
diff --git a/src/pages/exchangepage/edittemplate/couponCard/couponViewConfig/comm.less b/src/pages/exchangepage/edittemplate/couponCard/couponViewConfig/comm.less
index 4af860a2..7ddffb3c 100644
--- a/src/pages/exchangepage/edittemplate/couponCard/couponViewConfig/comm.less
+++ b/src/pages/exchangepage/edittemplate/couponCard/couponViewConfig/comm.less
@@ -26,7 +26,7 @@
//底部栏目
.bottomBar-view {
width: 100%;
- height: 50px;
+ // height: 50px;
background: #f00;
// position: absolute;
// bottom: 0;
@@ -36,6 +36,7 @@
.bottomBar-view>li {
flex: 1;
+ height: 50px;
display: flex;
flex-direction: column;
align-items: center;
diff --git a/src/pages/exchangepage/edittemplate/couponCard/goodsPage/componentLib/main.js b/src/pages/exchangepage/edittemplate/couponCard/goodsPage/componentLib/main.js
index 33276d60..98e0f9fb 100644
--- a/src/pages/exchangepage/edittemplate/couponCard/goodsPage/componentLib/main.js
+++ b/src/pages/exchangepage/edittemplate/couponCard/goodsPage/componentLib/main.js
@@ -33,6 +33,7 @@ export default class componentLib extends React.Component {
}
propcomponentName(item){
this.props.componentName(item.name);
+ console.log(36,item);
if(item.name){
Bus.emit('componentLib', {attr:item.name,value:1})
}
diff --git a/src/pages/exchangepage/edittemplate/couponCard/goodsPage/config/bottomBar.js b/src/pages/exchangepage/edittemplate/couponCard/goodsPage/config/bottomBar.js
index 3d5fac9c..a48e34d9 100644
--- a/src/pages/exchangepage/edittemplate/couponCard/goodsPage/config/bottomBar.js
+++ b/src/pages/exchangepage/edittemplate/couponCard/goodsPage/config/bottomBar.js
@@ -25,64 +25,25 @@ export default class edittemplate extends React.Component {
constructor(props) {
super(props)
this.state = {
- iswitch: true,
+ iswitch: 1,
comType: 1,
- navlist: [
- {
- id: 1,
- iswitch: true,
- name: 'index',
- pic: {
- show: 'https://lsxdemall.oss-cn-beijing.aliyuncs.com/MarketingSystem/img/coupon/bottombar/home.png',
- selectShow: 'https://lsxdemall.oss-cn-beijing.aliyuncs.com/MarketingSystem/img/coupon/bottombar/home_check.png'
- },
- text: '首页'
- },
- {
- id: 2,
- iswitch: true,
- name: 'order',
- pic: {
- show: 'https://lsxdemall.oss-cn-beijing.aliyuncs.com/MarketingSystem/img/coupon/bottombar/order.png',
- selectShow: 'https://lsxdemall.oss-cn-beijing.aliyuncs.com/MarketingSystem/img/coupon/bottombar/order_check.png'
- },
- text: '订单'
- },
- {
- id: 3,
- iswitch: true,
- name: 'coupon',
- pic: {
- show: 'https://lsxdemall.oss-cn-beijing.aliyuncs.com/MarketingSystem/img/coupon/bottombar/coupon.png',
- selectShow: 'https://lsxdemall.oss-cn-beijing.aliyuncs.com/MarketingSystem/img/coupon/bottombar/coupon_check.png'
- },
- text: '我的券'
- }
- ],
+ navlist: [],
defaultText: '#A6A5B2',
selectText: '#FD6932',
background: 'http://lsxdemall.oss-cn-beijing.aliyuncs.com/MarketingSystem/img/coupon/bottombar/bottom_bg.png'
}
}
componentWillMount(e) {
- Bus.addListener('componentLib', (prop) => {
- if (prop.attr == 'bottomBar') {
- this.setState({ iswitch: prop.value })
- }
- })
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;
- this.setState({ navlist, defaultText, selectText, background, iswitch });
+ this.setState({...config.coupon.product_list.bottomBar});
}
}
-
- //样式
- onstyleChange(e) {
- this.setState({ comType: e.target.value });
-
+ changeConfig(attr,value){
+ console.log(36,attr,value);
+ this.setState({ [attr]: value })
+ Bus.emit('bottomBarConfig', {attr,value})
}
-
hasItemFn(c) {
let bottomNav = _.cloneDeep(this.state.navlist);
if (c == 1) {//默认
@@ -93,42 +54,37 @@ export default class edittemplate extends React.Component {
bottomNav.forEach(item => {
item.pic.show = '';
item.pic.selectShow = '';
-
});
}
- console.log(8383, bottomNav);
this.setState({ navlist: bottomNav });
+ Bus.emit('bottomBarConfig', {attr:'navlist',value:bottomNav})
}
//首页/订单/我的券
upImgChange(index, type, files) {
+ let model = this.state.navlist;
+ model[index].pic[type] = '';
if (files.length > 0 && files[0].status == "success") {
- let model = this.state.navlist;
model[index].pic[type] = files[0].src;
- this.setState({ navlist: model })
- Bus.emit('navlist', model)
- } else {
- let model = this.state.navlist;
- model[index].pic[type] = '';
- this.setState({ navlist: model })
- Bus.emit('navlist', model)
}
+ this.setState({ navlist: model })
+ Bus.emit('bottomBarConfig', {attr:'navlist',value:model})
};
//背景图
onUploadChange(files) {
+ let bgImage='';
if (files.length > 0 && files[0].status == "success") {
- this.setState({ background: files[0].src })
- Bus.emit('background', files[0].src)
- } else {
- this.setState({ background: '' })
- Bus.emit('background', '')
+ bgImage=files[0].src;
}
+ this.setState({ background: bgImage })
+ Bus.emit('bottomBarConfig', {attr:'background',value:bgImage})
}
handleChangeStatus = (index, checked) => {
let model = this.state.navlist;
- model[index].iswitch = checked;
+ model[index].iswitch = checked?1:0;
this.setState({ navlist: model })
- Bus.emit('navlist', model)
+ console.log(86,model);
+ Bus.emit('bottomBarConfig', {attr:'navlist',value:model})
}
onUploadError = (type, data) => {
@@ -138,30 +94,6 @@ export default class edittemplate extends React.Component {
Notify.error(`图片大小不能超过 ${data.formattedMaxSize}`);
}
};
- handleFont = (color) => {
- this.setState({
- defaultText: color
- });
- Bus.emit('defaultText', color)
- }
- handleSelectFont = (color) => {
- this.setState({
- selectText: color
- });
- Bus.emit('selectText', color)
- }
-
- // 字体颜色
- fontcolor(cor) {
- this.setState({ defaultText: cor });
- Bus.emit('defaultText', cor)
- }
- //选中颜色
- selectfontcolor(cor) {
- this.setState({ selectText: cor });
- Bus.emit('selectText', cor)
- }
-
onUpload = (file, report) => {
let self = this;
return new Promise((resolve, reject) => {
@@ -211,12 +143,11 @@ export default class edittemplate extends React.Component {
底部栏设置
-