diff --git a/src/pages/exchangepage/couponTemplate/goodsPage/config/backPicture.js b/src/pages/exchangepage/couponTemplate/goodsPage/config/backPicture.js index ab305ac3..579bce0a 100644 --- a/src/pages/exchangepage/couponTemplate/goodsPage/config/backPicture.js +++ b/src/pages/exchangepage/couponTemplate/goodsPage/config/backPicture.js @@ -23,6 +23,12 @@ export default class edittemplate extends React.Component { this.setState({ bgimg }); } } + bgColorFn(color){ + this.setState({ + bgColor: color + }); + Bus.emit('globalColor',color) + } handleChange1 = (color) => { this.setState({ bgColor: color @@ -125,11 +131,11 @@ export default class edittemplate extends React.Component {
- { this.bgColor('#fff') }}> - { this.bgColor('#04C160') }}> - { this.bgColor('#AE99D3') }}> - { this.bgColor('#FACD6A') }}> - { this.bgColor('#FE7962') }}> + { this.bgColorFn('#fff') }}> + { this.bgColorFn('#04C160') }}> + { this.bgColorFn('#AE99D3') }}> + { this.bgColorFn('#FACD6A') }}> + { this.bgColorFn('#FE7962') }}>
diff --git a/src/pages/exchangepage/edittemplate/goodstemplate.js b/src/pages/exchangepage/edittemplate/goodstemplate.js index 3bb453fe..20a75aa4 100644 --- a/src/pages/exchangepage/edittemplate/goodstemplate.js +++ b/src/pages/exchangepage/edittemplate/goodstemplate.js @@ -1,104 +1,206 @@ -import React from 'react'; +import React from 'react'; + import "./main.less" + import "../../../assets/comm.css" + import './goodstemplate.less' + import SearchBarView from './couponConfig/searchBar' //商品详情搜索栏 + import BottomBarView from './couponConfig/bottomBar' //底部栏 -import { Sweetalert } from 'zent' + +import {Sweetalert} from 'zent' + import Bus from '@/assets/eventBus.js' + export default class edittemplate extends React.Component { + constructor(props) { + super(props) - this.state = { - clientY: 0, - selectDom: '', - icon: '', + + this.state={ + + clientY:0, + + selectDom:'', + + icon:'' + } + } + opendescFn() { + this.props.opendesc(true) + } - customComponent(e, name, icon) { + + customComponent(e,name,icon){ + //getBoundingClientRect().top ;获取div最顶边距离浏览器的位置 - let b = this.refs[name]; - let offset_top = this.refs[name].getBoundingClientRect().top; - this.setState({ clientY: (offset_top - 125), selectDom: name, icon: icon }); - if (name == 'searchBar') { - this.setState({ clientY: 0 }); + + let b=this.refs[name]; + + let offset_top=this.refs[name].getBoundingClientRect().top; + + this.setState({clientY:(offset_top-125),selectDom:name,icon:icon}); + + if(name=='searchBar'){ + + this.setState({clientY:0}); + } - if (name == 'bottomBar') { - this.setState({ clientY: 600 }); + + if(name=='bottomBar'){ + + this.setState({clientY:600}); + } + } - deleteFn() { - let selectDom = this.state.selectDom;//需删除组件名称 + + deleteFn(){ + + let selectDom=this.state.selectDom;//需删除组件名称 + Sweetalert.confirm({ - title: '确认信息', + + title:'确认信息', + content:

确认删除该模块?

, - onConfirm: () => { - this.setState({ selectDom: '' }); - Bus.emit('componentLibClose', selectDom) - }, - onCancel: () => { + + onConfirm:()=>{ + + this.setState({selectDom:''}); + + Bus.emit('componentLibClose',selectDom) }, + + onCancel:()=>{ + + + + }, + parentComponent: this + }); + } + + render() { - let goodsConfig = this.props.goodsdata; - let {backgroundImg,search,picture,title,bottomBar}=goodsConfig; - let naVisual=bottomBar.navlist.filter(item=>item.iswitch); + + let goodsConfig=this.props.goodsdata; + + console.log(48,goodsConfig); + let naVisual=[] + if(goodsConfig.bottomBar){ + naVisual=goodsConfig.bottomBar.navlist.filter(item=>item.iswitch); + } + return ( -
+ +
+ { - search && search.iswitch ? -
this.customComponent(e, 'search', 'marketing-sousuolan-')} className={this.state.selectDom == 'search' ? 'selectBorder' : ''} ref="search">
: null + + goodsConfig.search&&goodsConfig.search.iswitch? + +
this.customComponent(e,'search','marketing-sousuolan-')} className={this.state.selectDom=='search'?'selectBorder':''} ref="search">
:null + } + + { + !goodsConfig.top_image ? : + } - { - picture && picture.iswitch ?
this.customComponent(e, 'picture', 'marketing-tupian')} ref="picture" className={this.state.selectDom == 'picture' ? 'selectBorder' : ''}>
: null + + { + + goodsConfig.picture&&goodsConfig.picture.iswitch?
this.customComponent(e,'picture','marketing-tupian')} ref="picture" className={this.state.selectDom=='picture'?'selectBorder':''}>
:null + } + { - title && title.iswitch && title.comstyle == 1 ?
this.customComponent(e, 'title', 'marketing-fuwenbenkuang')} ref="title" className={this.state.selectDom == 'title' ? 'selectBorder' : ''}> -
{title.text}
: null - } - { - title && title.iswitch && title.comstyle == 2 ?
this.customComponent(e, 'title', 'marketing-fuwenbenkuang')} ref="title" className={this.state.selectDom == 'title' ? 'selectBorder' : ''}> - -
: null - } - { - (title && title.iswitch && title.text||title.pic) || picture && picture.iswitch && picture.img ?
: null - } - { - goodsConfig.list == 2 ? : goodsConfig.list == 3 ? : - } - { - goodsConfig.list == 2 ? : null - } - { - goodsConfig.describe.type == 1 ? : goodsConfig.describe.type == 3 ?
: null - } - { - goodsConfig.describe.type == 2 ? : null - } - { - bottomBar && bottomBar.iswitch&&naVisual.length>1 ?
this.customComponent(e, 'bottomBar', 'marketing-list')} className={this.state.selectDom == 'bottomBar' ? 'selectBottomBorder' : ''}>
: 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 } { - this.state.selectDom ?
- - | - 删除 -
: 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.list == 2 ? : null + + } + + { + + goodsConfig.describe.type == 1 ? : goodsConfig.describe.type == 3 ?
: null + + } + + { + + goodsConfig.describe.type == 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?
+ + + + | + + 删除 + +
:null + + } + + +
+ ) + } + } \ No newline at end of file diff --git a/src/pages/exchangepage/edittemplate/main.js b/src/pages/exchangepage/edittemplate/main.js index 4d389b74..29ea91a3 100644 --- a/src/pages/exchangepage/edittemplate/main.js +++ b/src/pages/exchangepage/edittemplate/main.js @@ -1,22 +1,8 @@ import React from 'react' import './main.less' import '../../../assets/comm.css' -import { - Notify, - BlockLoading, - Button, - RadioGroup, - RadioButton -} from 'zent' -import { - uploadImg, - handelResponse, - addTheme, - putMyTheme, - putTheme, - putSystemTemplate, - addSystemTemplate -} from '../../../assets/api.js' +import {Notify,BlockLoading,Button,RadioGroup,RadioButton} from 'zent' +import {uploadImg,handelResponse,addTheme,putMyTheme, putTheme,putSystemTemplate,addSystemTemplate} from '../../../assets/api.js' import Bus from '@/assets/eventBus.js' import PreviewEffect from '../previewEffect/main' import html2canvas from 'html2canvas' @@ -900,13 +886,18 @@ export default class edittemplate extends React.Component {

商品列表页:

this.activeChoice(2)} - className={ this.state.activeNavStatus == 2 ? 'activeNav thumbheader' : 'thumbheader' }> -
+
+ this.setState({ activeshow: true })} + goodsdata={this.state.product_list} + /> +
+ {/*
{ this.state.product_list.search&&this.state.product_list.search.iswitch ? : null } @@ -1000,7 +991,7 @@ export default class edittemplate extends React.Component { { this.state.product_list.bottomBar&&this.state.product_list.bottomBar.iswitch? :null } -
+
*/}
diff --git a/src/pages/exchangepage/edittemplate/main.less b/src/pages/exchangepage/edittemplate/main.less index 9effa13c..2f062f4d 100644 --- a/src/pages/exchangepage/edittemplate/main.less +++ b/src/pages/exchangepage/edittemplate/main.less @@ -589,119 +589,135 @@ &.activeNav { border: 5px solid #DDEEFF; } - .goodsList-item { - position: relative; - height: 100%; - overflow: hidden; - .topbanner { - width: 100%; - height: 50px; + .goodstemplate{ + transform: scale(0.315); + transform-origin: 0 0; } - >.content-title{ - position: relative; - z-index: 999; - height: 20px; - padding:0 8px; - font-size: 8px; - } - .parting-line{ - height:15px; - } - .searchBar{ - transform: scale(0.8); - font-size: 10px; - padding: 0 5px; - border-radius: 10px; - } - .marketing{ - width: 10px; - } - .bottom_Img { - width: 100%; - } - - .bottom_activeTip { - width: 7.2vw; - margin-left: 0.4vw; - padding: 6px; - background: #fff; - border-radius: 2px; - box-shadow: 1px 1px 13px 2px #f1f2f3; - box-sizing: border-box; - line-height: 15px; - padding-bottom: 60px; - font-size: 8px; - } - - .susactive_Tip { - position: absolute; - top: 14px; - right: 0; - width: 14px; - // height: 24px; - } - - .preBtn { - position: absolute; - width: 14px; - height: 14px; - top: 4%; - left: 4%; - } - - .goodsPic, - .goodsPicMatrax { - width: 90%; - margin-left: 5%; - position: relative; - margin-top: -20px; - } - - .bottom_exchageBtn { - position: absolute; - bottom: 0; - left: 0; - margin: 0 5% 3% !important; - } - - .exchageBtn { - width: 90%; - height: 30px; - font-size: 8px; - color: #fff; - height: 20px; - background: #E8EAEC; - border-radius: 15px; - margin: 10% 5%; - } - .bottomBar-view{ - width: 100%; - height: 30px; - position: absolute; - bottom: 0; - display: flex; - justify-content: space-evenly; - } - .bottomBar-view>li{ - flex: 1; - display: flex; - flex-direction: column; - align-items: center; - justify-content: center; - cursor: pointer; - - } - .bottomBar-view>li>img{ - width: 8px; - height: 8px; - } - .bottomBar-view>li>span{ - font-size: 6px; + .editor-main{ + top: 0; + img{ + width: auto!important; + } } - } + // .goodsList-item { + // position: relative; + // height: 100%; + // overflow: hidden; + // .goodstemplate{ + // transform: scale(0.31); + // transform-origin: 0 0; + // } + // .topbanner { + // width: 100%; + // height: 50px; + // } + // >.content-title{ + // position: relative; + // z-index: 999; + // height: 20px; + // padding:0 8px; + // font-size: 8px; + // } + // .parting-line{ + // height:15px; + // } + // .searchBar{ + // transform: scale(0.8); + // font-size: 10px; + // padding: 0 5px; + // border-radius: 10px; + // } + // .marketing{ + // width: 10px; + // } + // .bottom_Img { + // width: 100%; + // } + + // .bottom_activeTip { + // width: 7.2vw; + // margin-left: 0.4vw; + // padding: 6px; + // background: #fff; + // border-radius: 2px; + // box-shadow: 1px 1px 13px 2px #f1f2f3; + // box-sizing: border-box; + // line-height: 15px; + // padding-bottom: 60px; + // font-size: 8px; + // } + + // .susactive_Tip { + // position: absolute; + // top: 14px; + // right: 0; + // width: 14px; + // // height: 24px; + // } + + // .preBtn { + // position: absolute; + // width: 14px; + // height: 14px; + // top: 4%; + // left: 4%; + // } + + // .goodsPic, + // .goodsPicMatrax { + // width: 90%; + // margin-left: 5%; + // position: relative; + // margin-top: -20px; + // } + + // .bottom_exchageBtn { + // position: absolute; + // bottom: 0; + // left: 0; + // margin: 0 5% 3% !important; + // } + + // .exchageBtn { + // width: 90%; + // height: 30px; + // font-size: 8px; + // color: #fff; + // height: 20px; + // background: #E8EAEC; + // border-radius: 15px; + // margin: 10% 5%; + // } + // .bottomBar-view{ + // width: 100%; + // height: 30px; + // position: absolute; + // bottom: 0; + // display: flex; + // justify-content: space-evenly; + // } + // .bottomBar-view>li{ + // flex: 1; + // display: flex; + // flex-direction: column; + // align-items: center; + // justify-content: center; + // cursor: pointer; + + // } + // .bottomBar-view>li>img{ + // width: 8px; + // height: 8px; + // } + // .bottomBar-view>li>span{ + // font-size: 6px; + // } + + + // } } } }