diff --git a/src/assets/enum.js b/src/assets/enum.js index f239951d..37faec91 100644 --- a/src/assets/enum.js +++ b/src/assets/enum.js @@ -100,6 +100,8 @@ const menu={ case 3:return '兑换码';break; case 1:return '白名单';break; case 2:return '立减金';break; + case 4:return '优惠券';break; + case 8:return '优惠券白名单';break; } }, pageTypeStatusBg(params) { @@ -107,6 +109,8 @@ const menu={ case 1:return '#ffaa00';break; case 2:return '#e64c00';break; case 3:return '#55aaff';break; + case 4:return '#79AF83';break; + case 8:return '#F2A505';break; } }, keysStatus(params) { diff --git a/src/pages/exchangepage/couponTemplate/goodsPage/config/backPicture.js b/src/pages/exchangepage/couponTemplate/goodsPage/config/backPicture.js index 579bce0a..6373852b 100644 --- a/src/pages/exchangepage/couponTemplate/goodsPage/config/backPicture.js +++ b/src/pages/exchangepage/couponTemplate/goodsPage/config/backPicture.js @@ -18,8 +18,8 @@ export default class edittemplate extends React.Component { componentWillMount(e) { let config = JSON.parse(sessionStorage.getItem('editorConfig')); - if (config && config.couponList && config.couponList.product_list) { - let { bgimg } = config.couponList.product_list.backgroundImg; + if (config && config.coupon && config.coupon.product_list) { + let { bgimg } = config.coupon.product_list.backgroundImg; this.setState({ bgimg }); } } @@ -102,9 +102,9 @@ export default class edittemplate extends React.Component { componentWillUnmount() { let oldobj = JSON.parse(sessionStorage.getItem('editorConfig')); - let couponList = oldobj.couponList; - couponList.product_list.backgroundImg = _.cloneDeep(this.state); - oldobj.couponList = couponList; + let coupon = oldobj.coupon; + coupon.product_list.backgroundImg = _.cloneDeep(this.state); + oldobj.coupon = coupon; sessionStorage.setItem('editorConfig', JSON.stringify(oldobj)); } render() { diff --git a/src/pages/exchangepage/couponTemplate/goodsPage/config/bottomBar.js b/src/pages/exchangepage/couponTemplate/goodsPage/config/bottomBar.js index 8a719ce9..49b16364 100644 --- a/src/pages/exchangepage/couponTemplate/goodsPage/config/bottomBar.js +++ b/src/pages/exchangepage/couponTemplate/goodsPage/config/bottomBar.js @@ -13,7 +13,7 @@ export default class edittemplate extends React.Component { constructor(props) { super(props) this.state = { - iswitch:false, + iswitch:true, comType:1, navlist:[ { @@ -53,9 +53,14 @@ export default class edittemplate extends React.Component { } } componentWillMount(e) { + Bus.addListener('componentLibClose', (prop) => { + if(prop=='bottomBar'){ + this.setState({iswitch:false}) + } + }) let config = JSON.parse(sessionStorage.getItem('editorConfig')); - if (config && config.couponList && config.couponList.product_list) { - let { navlist, defaultText, selectText, background,iswitch } = config.couponList.product_list.bottomBar; + 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 }); } } @@ -169,9 +174,9 @@ export default class edittemplate extends React.Component { }; componentWillUnmount() { let oldobj = JSON.parse(sessionStorage.getItem('editorConfig')); - let couponList = oldobj.couponList; - couponList.product_list.bottomBar = _.cloneDeep(this.state); - oldobj.couponList = couponList; + let coupon = oldobj.coupon; + coupon.product_list.bottomBar = _.cloneDeep(this.state); + oldobj.coupon = coupon; sessionStorage.setItem('editorConfig', JSON.stringify(oldobj)); } render() { diff --git a/src/pages/exchangepage/couponTemplate/goodsPage/config/main.js b/src/pages/exchangepage/couponTemplate/goodsPage/config/main.js index 2f9060ad..1e6f5e26 100644 --- a/src/pages/exchangepage/couponTemplate/goodsPage/config/main.js +++ b/src/pages/exchangepage/couponTemplate/goodsPage/config/main.js @@ -25,8 +25,8 @@ export default class edittemplate extends React.Component { } componentWillMount(e) { let config = JSON.parse(sessionStorage.getItem('editorConfig')); - if (config && config.couponList && config.couponList.product_list) { - this.setState({ model: config.couponList.product_list }); + if (config && config.coupon && config.coupon.product_list) { + this.setState({ model: config.coupon.product_list }); } } onListChange(e) { @@ -187,15 +187,15 @@ export default class edittemplate extends React.Component { }; componentWillUnmount() { let oldobj = JSON.parse(sessionStorage.getItem('editorConfig')); - if (oldobj && oldobj.couponList) { - let couponList = oldobj.couponList - couponList.product_list = this.state.model; - oldobj.couponList = couponList; + if (oldobj && oldobj.coupon) { + let coupon = oldobj.coupon + coupon.product_list = this.state.model; + oldobj.coupon = coupon; } else { oldobj = {} - let couponList = {} - couponList.product_list = this.state.model; - oldobj.couponList = couponList; + let coupon = {} + coupon.product_list = this.state.model; + oldobj.coupon = coupon; } sessionStorage.setItem('editorConfig', JSON.stringify(oldobj)); } diff --git a/src/pages/exchangepage/couponTemplate/goodsPage/config/picture.js b/src/pages/exchangepage/couponTemplate/goodsPage/config/picture.js index 577b8dee..bd8587e6 100644 --- a/src/pages/exchangepage/couponTemplate/goodsPage/config/picture.js +++ b/src/pages/exchangepage/couponTemplate/goodsPage/config/picture.js @@ -11,19 +11,22 @@ export default class edittemplate extends React.Component { constructor(props) { super(props) this.state = { - iswitch:false, + iswitch:true, img:'', jumpType:'0',//0不跳转 1跳转 jumpUrl:'' } } componentWillMount(e) { - + Bus.addListener('componentLibClose', (prop) => { + if(prop=='picture'){ + this.setState({iswitch:false}) + } + }) let config = JSON.parse(sessionStorage.getItem('editorConfig')); - if (config && config.couponList && config.couponList.product_list) { - let {img,jumpType,jumpUrl,iswitch}=config.couponList.product_list.picture; - console.log(21,config.couponList.product_list.picture); - this.setState({ img,jumpType,jumpUrl,iswitch}); + if (config && config.coupon && config.coupon.product_list) { + let {img,jumpType,jumpUrl}=config.coupon.product_list.picture; + this.setState({ img,jumpType,jumpUrl}); } } @@ -97,13 +100,14 @@ export default class edittemplate extends React.Component { }; componentWillUnmount() { let oldobj = JSON.parse(sessionStorage.getItem('editorConfig')); - let couponList = oldobj.couponList; - couponList.product_list.picture = _.cloneDeep(this.state); - oldobj.couponList = couponList; + let coupon = oldobj.coupon; + console.log(105,this.state); + coupon.product_list.picture = _.cloneDeep(this.state); + oldobj.coupon = coupon; sessionStorage.setItem('editorConfig', JSON.stringify(oldobj)); } render() { - console.log(105,this.state); + return (
diff --git a/src/pages/exchangepage/couponTemplate/goodsPage/config/searchBar.js b/src/pages/exchangepage/couponTemplate/goodsPage/config/searchBar.js index 5a4cc81f..af27e048 100644 --- a/src/pages/exchangepage/couponTemplate/goodsPage/config/searchBar.js +++ b/src/pages/exchangepage/couponTemplate/goodsPage/config/searchBar.js @@ -11,7 +11,7 @@ export default class Searchbar extends React.Component { constructor(props) { super(props) this.state = { - switch:false, + iswitch:true, shape: 'circular', textAlign: 'center', borderColor: '#333', @@ -21,9 +21,16 @@ export default class Searchbar extends React.Component { } } componentWillMount(e) { + //关闭 + Bus.addListener('componentLibClose', (prop) => { + console.log(999,prop); + if(prop=='search'){ + this.setState({iswitch:false}) + } + }) let config = JSON.parse(sessionStorage.getItem('editorConfig')); - if (config && config.couponList && config.couponList.product_list) { - let { shape, textAlign, borderColor, placeholder } = config.couponList.product_list.search; + if (config && config.coupon && config.coupon.product_list) { + let { shape, textAlign, borderColor, placeholder } = config.coupon.product_list.search; this.setState({ shape, textAlign, borderColor, placeholder }); } } @@ -72,9 +79,9 @@ export default class Searchbar extends React.Component { } componentWillUnmount() { let oldobj = JSON.parse(sessionStorage.getItem('editorConfig')); - let couponList = oldobj.couponList; - couponList.product_list.search = _.cloneDeep(this.state); - oldobj.couponList = couponList; + let coupon = oldobj.coupon; + coupon.product_list.search = _.cloneDeep(this.state); + oldobj.coupon = coupon; sessionStorage.setItem('editorConfig', JSON.stringify(oldobj)); } render() { diff --git a/src/pages/exchangepage/couponTemplate/goodsPage/config/title.js b/src/pages/exchangepage/couponTemplate/goodsPage/config/title.js index f7828b4e..89e7cd97 100644 --- a/src/pages/exchangepage/couponTemplate/goodsPage/config/title.js +++ b/src/pages/exchangepage/couponTemplate/goodsPage/config/title.js @@ -11,7 +11,7 @@ export default class Title extends React.Component { constructor(props) { super(props) this.state = { - switch:false, + switch:true, text: '商品标题', textAlign: 'left', fontColor: '#333', @@ -21,9 +21,15 @@ export default class Title extends React.Component { } } componentWillMount(e) { + Bus.addListener('componentLibClose', (prop) => { + console.log(999,prop); + if(prop=='title'){ + this.setState({iswitch:false}) + } + }) let config = JSON.parse(sessionStorage.getItem('editorConfig')); - if (config && config.couponList && config.couponList.product_list) { - let { text, textAlign, fontColor, fontSize } = config.couponList.product_list.title; + if (config && config.coupon && config.coupon.product_list) { + let { text, textAlign, fontColor, fontSize } = config.coupon.product_list.title; this.setState({ text, textAlign, fontColor, fontSize }); } } @@ -122,9 +128,9 @@ export default class Title extends React.Component { componentWillUnmount() { let oldobj = JSON.parse(sessionStorage.getItem('editorConfig')); - let couponList = oldobj.couponList; - couponList.product_list.title = _.cloneDeep(this.state); - oldobj.couponList = couponList; + let coupon = oldobj.coupon; + coupon.product_list.title = _.cloneDeep(this.state); + oldobj.coupon = coupon; sessionStorage.setItem('editorConfig', JSON.stringify(oldobj)); } render() { diff --git a/src/pages/exchangepage/couponTemplate/goodsPage/preview/main.js b/src/pages/exchangepage/couponTemplate/goodsPage/preview/main.js deleted file mode 100644 index e69de29b..00000000 diff --git a/src/pages/exchangepage/couponTemplate/landingPage/config/main.js b/src/pages/exchangepage/couponTemplate/landingPage/config/main.js index ee3660a2..ca207126 100644 --- a/src/pages/exchangepage/couponTemplate/landingPage/config/main.js +++ b/src/pages/exchangepage/couponTemplate/landingPage/config/main.js @@ -1,11 +1,11 @@ import React from 'react'; import { Button, Select, ImageUpload, ColorPicker, NumberInput } from 'zent'; -import "./main.less" import "../../../edittemplate/goodstemplate.less" import { Notify, RadioGroup, RadioButton } from 'zent'; import Ipt from "@/components/input/main" import Form from "@/components/form/main" import FormItem from "@/components/form-item/main" +import Bus from '@/assets/eventBus.js' import { uploadImg, handelResponse, getThemeType } from "@/assets/api.js" import Wangeditor from '@/pages/exchangepage/edittemplate/wangeditorCom.js' export default class edittemplate extends React.Component { @@ -28,18 +28,25 @@ export default class edittemplate extends React.Component { } componentWillMount(e) { + console.log(1,'组件'); let self = this; let config = JSON.parse(sessionStorage.getItem('editorConfig')); let moudTyle = sessionStorage.getItem('mouldType'); if (moudTyle && moudTyle == 0) { this.setState({ isSystemModel: true }); } - if (config && config.couponList && config.couponList.land) { - let data = config.couponList.land; - this.setState({ model: data }); - } else { - - } + let data = config.coupon.land; + console.log(111,data); + this.setState({ model: data }); + // Bus.addListener('refreshcoupon', (prop) => { + // console.log(46, config); + // if (config && config.coupon && config.coupon.land) { + // let data = config.coupon.land; + // this.setState({ model: data }); + // } + // config.coupon.land = this.state.model; + // sessionStorage.setItem('editorConfig', JSON.stringify(config)); + // }) getThemeType().then(res => { handelResponse(res, (req, msg) => { let typeListSource = res.data.map(it => { @@ -223,120 +230,79 @@ export default class edittemplate extends React.Component { //组件将要销毁阶段 componentWillUnmount() { + console.log(2,'jieshu'); let oldobj = JSON.parse(sessionStorage.getItem('editorConfig')); - if (oldobj && oldobj.couponList) { - let couponList = oldobj.couponList - couponList.land = this.state.model; - oldobj.couponList = couponList; - } else { - oldobj = {} - let couponList = {} - couponList.land = this.state.model; - oldobj.couponList = couponList; - } + let coupon= oldobj.coupon + coupon.land = this.state.model; + oldobj.coupon = coupon; sessionStorage.setItem('editorConfig', JSON.stringify(oldobj)); } - + render() { return (
-

落地页设置

+

落地页设置123

-
-
基础设置
+
+
基础设置
-
- - { - let model2 = this.state.model; - model2.title = e; - this.setState({ model: model2 }) - this.props.settitle(e) - }} - onClearItem={(e) => { + + + { let model2 = this.state.model; - model2.title = ""; + model2.title = e; this.setState({ model: model2 }) + this.props.settitle(e) }} - value={this.state.model.title} placeholder={"请输入"} labelWidth={'0px'} maxLength={12} height={'36px'} width={'300px'} alignment={'left'} /> - - { - this.state.isSystemModel ? ( - - this.sortFn(c)} value={this.state.model.sort} placeholder="请输入数字" integer={true} max={999} /> - ) : null - } - { - this.state.isSystemModel ? ( - - { this.onmouldChange(e) }} placeholder="选择一项" width={300} value={this.state.model.type_id} /> + + ) : null + } +
样式
+ +
+ { this.bgcolor('#ffffff') }}> + { this.bgcolor('#EEEEEE') }}> + { this.bgcolor('#000000') }}> +
+ +
-
- - -
- { this.fontcolor('#ffffff') }}> - { this.fontcolor('#04C160') }}> - { this.fontcolor('#AE99D3') }}> - { this.fontcolor('#FACD6A') }}> - { this.fontcolor('#FE7962') }}> -
- + + +
+ { this.fontcolor('#ffffff') }}> + { this.fontcolor('#04C160') }}> + { this.fontcolor('#AE99D3') }}> + { this.fontcolor('#FACD6A') }}> + { this.fontcolor('#FE7962') }}> +
+ +
-
- -
基础图层
- - { this.onUploadChange(e) }} - onUpload={this.onUpload} - defaultFileList={this.state.model.top_image ? [{ 'src': this.state.model.top_image }] : null} - onError={this.onUploadError} - /> - - - { this.onUploadChange1(e) }} - defaultFileList={this.state.model.middle_image ? [{ 'src': this.state.model.middle_image }] : null} - onUpload={this.onUpload} - onError={this.onUploadError} - /> - - - { this.onactivityChange(e) }} value={this.state.model.describe.type}> - this.hasItemFn(1)}>图片 - this.hasItemFn(2)}>富文本 - - - { - this.state.model.describe.type == 1 ? + +
基础图层
+ { this.onUploadChange2(e) }} + onChange={(e) => { this.onUploadChange(e) }} onUpload={this.onUpload} + defaultFileList={this.state.model.top_image ? [{ 'src': this.state.model.top_image }] : null} onError={this.onUploadError} - defaultFileList={this.state.model.describe.bg_image ? [{ 'src': this.state.model.describe.bg_image }] : null} /> - : null - } - { - this.state.model.describe.type == 2 ? + + { this.onUploadChange2(e) }} + onChange={(e) => { this.onUploadChange1(e) }} + defaultFileList={this.state.model.middle_image ? [{ 'src': this.state.model.middle_image }] : null} onUpload={this.onUpload} onError={this.onUploadError} - defaultFileList={this.state.model.describe.bg_image ? [{ 'src': this.state.model.describe.bg_image }] : null} /> - : null - } - {this.state.model.describe.type == 2 ? this.getEditext(c)} /> : null} - -
+
+ + { this.onactivityChange(e) }} value={this.state.model.describe.type}> + this.hasItemFn(1)}>图片 + this.hasItemFn(2)}>富文本 + + + { + this.state.model.describe.type == 1 ? + { this.onUploadChange2(e) }} + onUpload={this.onUpload} + onError={this.onUploadError} + defaultFileList={this.state.model.describe.bg_image ? [{ 'src': this.state.model.describe.bg_image }] : null} + /> + : null + } + { + this.state.model.describe.type == 2 ? + { this.onUploadChange2(e) }} + onUpload={this.onUpload} + onError={this.onUploadError} + defaultFileList={this.state.model.describe.bg_image ? [{ 'src': this.state.model.describe.bg_image }] : null} + /> + : null + } + {this.state.model.describe.type == 2 ? this.getEditext(c)} /> : null} + +
) } diff --git a/src/pages/exchangepage/couponTemplate/landingPage/config/main.less b/src/pages/exchangepage/couponTemplate/landingPage/config/main.less deleted file mode 100644 index e69de29b..00000000 diff --git a/src/pages/exchangepage/edittemplate/couponReduceDetail.js b/src/pages/exchangepage/edittemplate/couponReduceDetail.js index 680fb84a..ceec2e7e 100644 --- a/src/pages/exchangepage/edittemplate/couponReduceDetail.js +++ b/src/pages/exchangepage/edittemplate/couponReduceDetail.js @@ -37,16 +37,16 @@ export default class edittemplate extends React.Component { } componentWillMount(e) { let config = JSON.parse(sessionStorage.getItem('editorConfig')); - if (config && config.couponList && config.couponList.product_detail) { - let { font_color, button_color } = config.couponList.product_detail.reduce; + if (config && config.coupon && config.coupon.product_detail) { + let { font_color, button_color } = config.coupon.product_detail.reduce; this.setState({ font_color, button_color }); } } componentWillUnmount() { let oldobj = JSON.parse(sessionStorage.getItem('editorConfig')); - let couponList = oldobj.couponList; - couponList.product_detail.reduce = _.cloneDeep(this.state); - oldobj.couponList = couponList; + let coupon = oldobj.coupon; + coupon.product_detail.reduce = _.cloneDeep(this.state); + oldobj.coupon = coupon; sessionStorage.setItem('editorConfig', JSON.stringify(oldobj)); } render() { diff --git a/src/pages/exchangepage/edittemplate/couponconfig.js b/src/pages/exchangepage/edittemplate/couponconfig.js index e58a0e04..cf4e9f8f 100644 --- a/src/pages/exchangepage/edittemplate/couponconfig.js +++ b/src/pages/exchangepage/edittemplate/couponconfig.js @@ -139,15 +139,15 @@ export default class edittemplate extends React.Component { } componentWillMount() { let config = JSON.parse(sessionStorage.getItem('editorConfig')); - if (config && config.couponList && config.couponList.product_detail) { - this.setState({ model: config.couponList.product_detail }); + if (config && config.coupon && config.coupon.product_detail) { + this.setState({ model: config.coupon.product_detail }); } } componentWillUnmount() { let oldobj = JSON.parse(sessionStorage.getItem('editorConfig')); - let couponList = oldobj.couponList; - couponList.product_detail = _.cloneDeep(this.state.model); - oldobj.couponList = couponList; + let coupon = oldobj.coupon; + coupon.product_detail = _.cloneDeep(this.state.model); + oldobj.coupon = coupon; sessionStorage.setItem('editorConfig', JSON.stringify(oldobj)); } diff --git a/src/pages/exchangepage/edittemplate/detailstemplate.js b/src/pages/exchangepage/edittemplate/detailstemplate.js index 620d556c..d6ceae6c 100644 --- a/src/pages/exchangepage/edittemplate/detailstemplate.js +++ b/src/pages/exchangepage/edittemplate/detailstemplate.js @@ -24,7 +24,7 @@ export default class edittemplate extends React.Component{ this.props.detaildata.describe.type==2?:null } { - this.props.templateType!=2?: + [1,3].includes(this.props.templateType)?:

¥0.00

diff --git a/src/pages/exchangepage/edittemplate/main.js b/src/pages/exchangepage/edittemplate/main.js index 81dce7a8..af7d6b4f 100644 --- a/src/pages/exchangepage/edittemplate/main.js +++ b/src/pages/exchangepage/edittemplate/main.js @@ -25,7 +25,6 @@ import CouponGoodsListForm from '../couponTemplate/goodsPage/config/main' //优 import CouponGoodsDetailForm from './couponconfig' //优惠券商品详情页 import CouponReduceDetailForm from './couponReduceDetail' //优惠券立减金详情页 import CouponComLib from '../couponTemplate/goodsPage/componentLib/main' //优惠券组件库 -// import import _ from 'lodash' //落地页 let model = { @@ -332,37 +331,45 @@ export default class edittemplate extends React.Component { whiteList['land'].title = newEditor.title whiteList['land'].sort = newEditor.sort //优惠券 - let couponList = newEditor.couponList - if (!couponList) { - couponList = {} - couponList.land = model - couponList.product_list = couponProduct_list - couponList.product_detail = product_detail + let coupon = newEditor.coupon + if (!coupon) { + coupon = {} + coupon.land = model + coupon.product_list = couponProduct_list + coupon.product_detail = product_detail } - couponList['land'].title = newEditor.title - couponList['land'].sort = newEditor.sort - newEditor.exchangeList = exchangeList - newEditor.whiteList = whiteList - newEditor.couponList = couponList; - if (template == 1) { //1-白名单 2-兑换码 + coupon['land'].title = newEditor.title + coupon['land'].sort = newEditor.sort + + newEditor.exchangeList = exchangeList + newEditor.whiteList = whiteList + newEditor.coupon = coupon; + if (template == 1) { //1-白名单 3-兑换码 this.setState({ model: newEditor.whiteList.land, product_list: newEditor.whiteList.product_list, product_detail: newEditor.whiteList.product_detail }) - } else { + } else if (template ==3){ this.setState({ model: newEditor.exchangeList.land, product_list: newEditor.exchangeList.product_list, product_detail: newEditor.exchangeList.product_detail }) + }else{ + this.setState({ + model: newEditor.coupon.land, + product_list: newEditor.coupon.product_list, + product_detail: newEditor.coupon.product_detail + }) } sessionStorage.setItem('editorConfig', JSON.stringify(newEditor)) if (mouldType != 0 && pageChange == 1) { this.setState({ pagedisable: true }) } } else {//新增数据 - let obj = {}, whiteList = {}, exchangeList = {}, couponList = {} + console.log(369,sessionStorage.getItem('editorConfig')); + let obj = {}, whiteList = {}, exchangeList = {}, coupon = {} let sourceObj = {//模板数据结构 land: model, product_list, @@ -375,10 +382,10 @@ export default class edittemplate extends React.Component { } whiteList = _.cloneDeep(sourceObj); exchangeList = _.cloneDeep(sourceObj); - couponList = _.cloneDeep(sourcecouponObj); + coupon = _.cloneDeep(sourcecouponObj); obj.exchangeList = exchangeList obj.whiteList = whiteList - obj.couponList = couponList + obj.coupon = coupon sessionStorage.setItem('editorConfig', JSON.stringify(obj)) } } @@ -488,11 +495,21 @@ export default class edittemplate extends React.Component { infoExchange.product_detail = exchangeState.product_detail delete infoExchange.land.sort delete infoExchange.land.title - if (this.state.showType == 3) { - //兑换码 - formdata.exchange = infoExchange - } else if (this.state.showType == 1) { - formdata.access_conf = infoExchange + switch(this.state.showType){ + case 3://兑换码 + formdata.exchange = infoExchange; + break; + case 1://白名单 + formdata.access_conf = infoExchange + break; + case 4://优惠券 + formdata.coupon = infoExchange; + break; + case 8://优惠券白名单 + formdata.coupon = infoExchange; + break; + default: + break; } if (myInfoData) { //编辑 @@ -638,7 +655,7 @@ export default class edittemplate extends React.Component { } onmodelChange(e) { this.setState({ showType: e.target.value, activeNavStatus: 1 }) - let editorData = JSON.parse(sessionStorage.getItem('editorConfig')) + let editorData = _.cloneDeep(JSON.parse(sessionStorage.getItem('editorConfig'))) if (e.target.value == 1) { let whiteData = editorData.whiteList let { land, product_list, product_detail } = whiteData; @@ -652,9 +669,10 @@ export default class edittemplate extends React.Component { let exchangeData = editorData.exchangeList let { land, product_list, product_detail } = exchangeData; this.setState({ model: land, product_list, product_detail }) - } else if (e.target.value == 2) { - let couponData = editorData.couponList + } else{//优惠券+优惠券白名单 + let couponData = editorData.coupon let { land, product_list, product_detail } = couponData; + console.log(222,this.state.model); this.setState({ model: land, product_list, product_detail }) } } @@ -800,7 +818,7 @@ export default class edittemplate extends React.Component { this.setState({ componentOfconfig: c }); } render() { - console.log(761,window.screen.width / 1920 * 100); + console.log(761,this.state); return (
@@ -838,9 +856,12 @@ export default class edittemplate extends React.Component { 白名单 - + 优惠券 + + 优惠券白名单 +
{/* 兑换码 */} @@ -877,7 +898,7 @@ export default class edittemplate extends React.Component { ) : ( )} - {this.state.showType == 1 ? ( + {[1,4].includes(this.state.showType)? ( {/* 组件库 */} { - this.state.showType == 2 && this.state.activeNavStatus == 2 ? this.componentName(c)} /> : null + [4,8].includes(this.state.showType) && this.state.activeNavStatus == 2 ? this.componentName(c)} /> : null }
-
+
{this.state.activeNavStatus == 1 ? (
)} - {this.state.showType == 1 ? ( + {[1,4].includes(this.state.showType) ? ( - { - this.state.showType != 2 ? ( + {[1,3].includes(this.state.showType)? (
{this.state.activeNavStatus == 1 ? (

落地页设置

diff --git a/src/pages/exchangepage/edittemplate/reduce.js b/src/pages/exchangepage/edittemplate/reduce.js index f2700941..6f3a5240 100644 --- a/src/pages/exchangepage/edittemplate/reduce.js +++ b/src/pages/exchangepage/edittemplate/reduce.js @@ -18,7 +18,7 @@ export default class edittemplate extends React.Component{ { - this.props.templateType==2? + [2,4].includes(this.props.templateType)?

¥0.00