Merge branch 'couponV1.5' of https://codeup.aliyun.com/5f9118049cffa29cfdd3be1c/marketing/frontend into couponV1.5
This commit is contained in:
commit
d4b062df7e
|
@ -100,6 +100,8 @@ const menu={
|
||||||
case 3:return '兑换码';break;
|
case 3:return '兑换码';break;
|
||||||
case 1:return '白名单';break;
|
case 1:return '白名单';break;
|
||||||
case 2:return '立减金';break;
|
case 2:return '立减金';break;
|
||||||
|
case 4:return '优惠券';break;
|
||||||
|
case 8:return '优惠券白名单';break;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
pageTypeStatusBg(params) {
|
pageTypeStatusBg(params) {
|
||||||
|
@ -107,6 +109,8 @@ const menu={
|
||||||
case 1:return '#ffaa00';break;
|
case 1:return '#ffaa00';break;
|
||||||
case 2:return '#e64c00';break;
|
case 2:return '#e64c00';break;
|
||||||
case 3:return '#55aaff';break;
|
case 3:return '#55aaff';break;
|
||||||
|
case 4:return '#79AF83';break;
|
||||||
|
case 8:return '#F2A505';break;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
keysStatus(params) {
|
keysStatus(params) {
|
||||||
|
|
|
@ -18,8 +18,8 @@ export default class edittemplate extends React.Component {
|
||||||
|
|
||||||
componentWillMount(e) {
|
componentWillMount(e) {
|
||||||
let config = JSON.parse(sessionStorage.getItem('editorConfig'));
|
let config = JSON.parse(sessionStorage.getItem('editorConfig'));
|
||||||
if (config && config.couponList && config.couponList.product_list) {
|
if (config && config.coupon && config.coupon.product_list) {
|
||||||
let { bgimg } = config.couponList.product_list.backgroundImg;
|
let { bgimg } = config.coupon.product_list.backgroundImg;
|
||||||
this.setState({ bgimg });
|
this.setState({ bgimg });
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -102,9 +102,9 @@ export default class edittemplate extends React.Component {
|
||||||
|
|
||||||
componentWillUnmount() {
|
componentWillUnmount() {
|
||||||
let oldobj = JSON.parse(sessionStorage.getItem('editorConfig'));
|
let oldobj = JSON.parse(sessionStorage.getItem('editorConfig'));
|
||||||
let couponList = oldobj.couponList;
|
let coupon = oldobj.coupon;
|
||||||
couponList.product_list.backgroundImg = _.cloneDeep(this.state);
|
coupon.product_list.backgroundImg = _.cloneDeep(this.state);
|
||||||
oldobj.couponList = couponList;
|
oldobj.coupon = coupon;
|
||||||
sessionStorage.setItem('editorConfig', JSON.stringify(oldobj));
|
sessionStorage.setItem('editorConfig', JSON.stringify(oldobj));
|
||||||
}
|
}
|
||||||
render() {
|
render() {
|
||||||
|
|
|
@ -13,7 +13,7 @@ export default class edittemplate extends React.Component {
|
||||||
constructor(props) {
|
constructor(props) {
|
||||||
super(props)
|
super(props)
|
||||||
this.state = {
|
this.state = {
|
||||||
iswitch:false,
|
iswitch:true,
|
||||||
comType:1,
|
comType:1,
|
||||||
navlist:[
|
navlist:[
|
||||||
{
|
{
|
||||||
|
@ -53,9 +53,14 @@ export default class edittemplate extends React.Component {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
componentWillMount(e) {
|
componentWillMount(e) {
|
||||||
|
Bus.addListener('componentLibClose', (prop) => {
|
||||||
|
if(prop=='bottomBar'){
|
||||||
|
this.setState({iswitch:false})
|
||||||
|
}
|
||||||
|
})
|
||||||
let config = JSON.parse(sessionStorage.getItem('editorConfig'));
|
let config = JSON.parse(sessionStorage.getItem('editorConfig'));
|
||||||
if (config && config.couponList && config.couponList.product_list) {
|
if (config && config.coupon && config.coupon.product_list) {
|
||||||
let { navlist, defaultText, selectText, background,iswitch } = config.couponList.product_list.bottomBar;
|
let { navlist, defaultText, selectText, background,iswitch } = config.coupon.product_list.bottomBar;
|
||||||
this.setState({ navlist, defaultText, selectText, background,iswitch });
|
this.setState({ navlist, defaultText, selectText, background,iswitch });
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -169,9 +174,9 @@ export default class edittemplate extends React.Component {
|
||||||
};
|
};
|
||||||
componentWillUnmount() {
|
componentWillUnmount() {
|
||||||
let oldobj = JSON.parse(sessionStorage.getItem('editorConfig'));
|
let oldobj = JSON.parse(sessionStorage.getItem('editorConfig'));
|
||||||
let couponList = oldobj.couponList;
|
let coupon = oldobj.coupon;
|
||||||
couponList.product_list.bottomBar = _.cloneDeep(this.state);
|
coupon.product_list.bottomBar = _.cloneDeep(this.state);
|
||||||
oldobj.couponList = couponList;
|
oldobj.coupon = coupon;
|
||||||
sessionStorage.setItem('editorConfig', JSON.stringify(oldobj));
|
sessionStorage.setItem('editorConfig', JSON.stringify(oldobj));
|
||||||
}
|
}
|
||||||
render() {
|
render() {
|
||||||
|
|
|
@ -25,8 +25,8 @@ export default class edittemplate extends React.Component {
|
||||||
}
|
}
|
||||||
componentWillMount(e) {
|
componentWillMount(e) {
|
||||||
let config = JSON.parse(sessionStorage.getItem('editorConfig'));
|
let config = JSON.parse(sessionStorage.getItem('editorConfig'));
|
||||||
if (config && config.couponList && config.couponList.product_list) {
|
if (config && config.coupon && config.coupon.product_list) {
|
||||||
this.setState({ model: config.couponList.product_list });
|
this.setState({ model: config.coupon.product_list });
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
onListChange(e) {
|
onListChange(e) {
|
||||||
|
@ -187,15 +187,15 @@ export default class edittemplate extends React.Component {
|
||||||
};
|
};
|
||||||
componentWillUnmount() {
|
componentWillUnmount() {
|
||||||
let oldobj = JSON.parse(sessionStorage.getItem('editorConfig'));
|
let oldobj = JSON.parse(sessionStorage.getItem('editorConfig'));
|
||||||
if (oldobj && oldobj.couponList) {
|
if (oldobj && oldobj.coupon) {
|
||||||
let couponList = oldobj.couponList
|
let coupon = oldobj.coupon
|
||||||
couponList.product_list = this.state.model;
|
coupon.product_list = this.state.model;
|
||||||
oldobj.couponList = couponList;
|
oldobj.coupon = coupon;
|
||||||
} else {
|
} else {
|
||||||
oldobj = {}
|
oldobj = {}
|
||||||
let couponList = {}
|
let coupon = {}
|
||||||
couponList.product_list = this.state.model;
|
coupon.product_list = this.state.model;
|
||||||
oldobj.couponList = couponList;
|
oldobj.coupon = coupon;
|
||||||
}
|
}
|
||||||
sessionStorage.setItem('editorConfig', JSON.stringify(oldobj));
|
sessionStorage.setItem('editorConfig', JSON.stringify(oldobj));
|
||||||
}
|
}
|
||||||
|
|
|
@ -11,19 +11,22 @@ export default class edittemplate extends React.Component {
|
||||||
constructor(props) {
|
constructor(props) {
|
||||||
super(props)
|
super(props)
|
||||||
this.state = {
|
this.state = {
|
||||||
iswitch:false,
|
iswitch:true,
|
||||||
img:'',
|
img:'',
|
||||||
jumpType:'0',//0不跳转 1跳转
|
jumpType:'0',//0不跳转 1跳转
|
||||||
jumpUrl:''
|
jumpUrl:''
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
componentWillMount(e) {
|
componentWillMount(e) {
|
||||||
|
Bus.addListener('componentLibClose', (prop) => {
|
||||||
|
if(prop=='picture'){
|
||||||
|
this.setState({iswitch:false})
|
||||||
|
}
|
||||||
|
})
|
||||||
let config = JSON.parse(sessionStorage.getItem('editorConfig'));
|
let config = JSON.parse(sessionStorage.getItem('editorConfig'));
|
||||||
if (config && config.couponList && config.couponList.product_list) {
|
if (config && config.coupon && config.coupon.product_list) {
|
||||||
let {img,jumpType,jumpUrl,iswitch}=config.couponList.product_list.picture;
|
let {img,jumpType,jumpUrl}=config.coupon.product_list.picture;
|
||||||
console.log(21,config.couponList.product_list.picture);
|
this.setState({ img,jumpType,jumpUrl});
|
||||||
this.setState({ img,jumpType,jumpUrl,iswitch});
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -97,13 +100,14 @@ export default class edittemplate extends React.Component {
|
||||||
};
|
};
|
||||||
componentWillUnmount() {
|
componentWillUnmount() {
|
||||||
let oldobj = JSON.parse(sessionStorage.getItem('editorConfig'));
|
let oldobj = JSON.parse(sessionStorage.getItem('editorConfig'));
|
||||||
let couponList = oldobj.couponList;
|
let coupon = oldobj.coupon;
|
||||||
couponList.product_list.picture = _.cloneDeep(this.state);
|
console.log(105,this.state);
|
||||||
oldobj.couponList = couponList;
|
coupon.product_list.picture = _.cloneDeep(this.state);
|
||||||
|
oldobj.coupon = coupon;
|
||||||
sessionStorage.setItem('editorConfig', JSON.stringify(oldobj));
|
sessionStorage.setItem('editorConfig', JSON.stringify(oldobj));
|
||||||
}
|
}
|
||||||
render() {
|
render() {
|
||||||
console.log(105,this.state);
|
|
||||||
return (
|
return (
|
||||||
<div className="assembly">
|
<div className="assembly">
|
||||||
<div className='control page-title-control'>
|
<div className='control page-title-control'>
|
||||||
|
|
|
@ -11,7 +11,7 @@ export default class Searchbar extends React.Component {
|
||||||
constructor(props) {
|
constructor(props) {
|
||||||
super(props)
|
super(props)
|
||||||
this.state = {
|
this.state = {
|
||||||
switch:false,
|
iswitch:true,
|
||||||
shape: 'circular',
|
shape: 'circular',
|
||||||
textAlign: 'center',
|
textAlign: 'center',
|
||||||
borderColor: '#333',
|
borderColor: '#333',
|
||||||
|
@ -21,9 +21,16 @@ export default class Searchbar extends React.Component {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
componentWillMount(e) {
|
componentWillMount(e) {
|
||||||
|
//关闭
|
||||||
|
Bus.addListener('componentLibClose', (prop) => {
|
||||||
|
console.log(999,prop);
|
||||||
|
if(prop=='search'){
|
||||||
|
this.setState({iswitch:false})
|
||||||
|
}
|
||||||
|
})
|
||||||
let config = JSON.parse(sessionStorage.getItem('editorConfig'));
|
let config = JSON.parse(sessionStorage.getItem('editorConfig'));
|
||||||
if (config && config.couponList && config.couponList.product_list) {
|
if (config && config.coupon && config.coupon.product_list) {
|
||||||
let { shape, textAlign, borderColor, placeholder } = config.couponList.product_list.search;
|
let { shape, textAlign, borderColor, placeholder } = config.coupon.product_list.search;
|
||||||
this.setState({ shape, textAlign, borderColor, placeholder });
|
this.setState({ shape, textAlign, borderColor, placeholder });
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -72,9 +79,9 @@ export default class Searchbar extends React.Component {
|
||||||
}
|
}
|
||||||
componentWillUnmount() {
|
componentWillUnmount() {
|
||||||
let oldobj = JSON.parse(sessionStorage.getItem('editorConfig'));
|
let oldobj = JSON.parse(sessionStorage.getItem('editorConfig'));
|
||||||
let couponList = oldobj.couponList;
|
let coupon = oldobj.coupon;
|
||||||
couponList.product_list.search = _.cloneDeep(this.state);
|
coupon.product_list.search = _.cloneDeep(this.state);
|
||||||
oldobj.couponList = couponList;
|
oldobj.coupon = coupon;
|
||||||
sessionStorage.setItem('editorConfig', JSON.stringify(oldobj));
|
sessionStorage.setItem('editorConfig', JSON.stringify(oldobj));
|
||||||
}
|
}
|
||||||
render() {
|
render() {
|
||||||
|
|
|
@ -11,7 +11,7 @@ export default class Title extends React.Component {
|
||||||
constructor(props) {
|
constructor(props) {
|
||||||
super(props)
|
super(props)
|
||||||
this.state = {
|
this.state = {
|
||||||
switch:false,
|
switch:true,
|
||||||
text: '商品标题',
|
text: '商品标题',
|
||||||
textAlign: 'left',
|
textAlign: 'left',
|
||||||
fontColor: '#333',
|
fontColor: '#333',
|
||||||
|
@ -21,9 +21,15 @@ export default class Title extends React.Component {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
componentWillMount(e) {
|
componentWillMount(e) {
|
||||||
|
Bus.addListener('componentLibClose', (prop) => {
|
||||||
|
console.log(999,prop);
|
||||||
|
if(prop=='title'){
|
||||||
|
this.setState({iswitch:false})
|
||||||
|
}
|
||||||
|
})
|
||||||
let config = JSON.parse(sessionStorage.getItem('editorConfig'));
|
let config = JSON.parse(sessionStorage.getItem('editorConfig'));
|
||||||
if (config && config.couponList && config.couponList.product_list) {
|
if (config && config.coupon && config.coupon.product_list) {
|
||||||
let { text, textAlign, fontColor, fontSize } = config.couponList.product_list.title;
|
let { text, textAlign, fontColor, fontSize } = config.coupon.product_list.title;
|
||||||
this.setState({ text, textAlign, fontColor, fontSize });
|
this.setState({ text, textAlign, fontColor, fontSize });
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -122,9 +128,9 @@ export default class Title extends React.Component {
|
||||||
|
|
||||||
componentWillUnmount() {
|
componentWillUnmount() {
|
||||||
let oldobj = JSON.parse(sessionStorage.getItem('editorConfig'));
|
let oldobj = JSON.parse(sessionStorage.getItem('editorConfig'));
|
||||||
let couponList = oldobj.couponList;
|
let coupon = oldobj.coupon;
|
||||||
couponList.product_list.title = _.cloneDeep(this.state);
|
coupon.product_list.title = _.cloneDeep(this.state);
|
||||||
oldobj.couponList = couponList;
|
oldobj.coupon = coupon;
|
||||||
sessionStorage.setItem('editorConfig', JSON.stringify(oldobj));
|
sessionStorage.setItem('editorConfig', JSON.stringify(oldobj));
|
||||||
}
|
}
|
||||||
render() {
|
render() {
|
||||||
|
|
|
@ -1,11 +1,11 @@
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
import { Button, Select, ImageUpload, ColorPicker, NumberInput } from 'zent';
|
import { Button, Select, ImageUpload, ColorPicker, NumberInput } from 'zent';
|
||||||
import "./main.less"
|
|
||||||
import "../../../edittemplate/goodstemplate.less"
|
import "../../../edittemplate/goodstemplate.less"
|
||||||
import { Notify, RadioGroup, RadioButton } from 'zent';
|
import { Notify, RadioGroup, RadioButton } from 'zent';
|
||||||
import Ipt from "@/components/input/main"
|
import Ipt from "@/components/input/main"
|
||||||
import Form from "@/components/form/main"
|
import Form from "@/components/form/main"
|
||||||
import FormItem from "@/components/form-item/main"
|
import FormItem from "@/components/form-item/main"
|
||||||
|
import Bus from '@/assets/eventBus.js'
|
||||||
import { uploadImg, handelResponse, getThemeType } from "@/assets/api.js"
|
import { uploadImg, handelResponse, getThemeType } from "@/assets/api.js"
|
||||||
import Wangeditor from '@/pages/exchangepage/edittemplate/wangeditorCom.js'
|
import Wangeditor from '@/pages/exchangepage/edittemplate/wangeditorCom.js'
|
||||||
export default class edittemplate extends React.Component {
|
export default class edittemplate extends React.Component {
|
||||||
|
@ -28,18 +28,25 @@ export default class edittemplate extends React.Component {
|
||||||
}
|
}
|
||||||
|
|
||||||
componentWillMount(e) {
|
componentWillMount(e) {
|
||||||
|
console.log(1,'组件');
|
||||||
let self = this;
|
let self = this;
|
||||||
let config = JSON.parse(sessionStorage.getItem('editorConfig'));
|
let config = JSON.parse(sessionStorage.getItem('editorConfig'));
|
||||||
let moudTyle = sessionStorage.getItem('mouldType');
|
let moudTyle = sessionStorage.getItem('mouldType');
|
||||||
if (moudTyle && moudTyle == 0) {
|
if (moudTyle && moudTyle == 0) {
|
||||||
this.setState({ isSystemModel: true });
|
this.setState({ isSystemModel: true });
|
||||||
}
|
}
|
||||||
if (config && config.couponList && config.couponList.land) {
|
let data = config.coupon.land;
|
||||||
let data = config.couponList.land;
|
console.log(111,data);
|
||||||
this.setState({ model: data });
|
this.setState({ model: data });
|
||||||
} else {
|
// 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 => {
|
getThemeType().then(res => {
|
||||||
handelResponse(res, (req, msg) => {
|
handelResponse(res, (req, msg) => {
|
||||||
let typeListSource = res.data.map(it => {
|
let typeListSource = res.data.map(it => {
|
||||||
|
@ -223,17 +230,11 @@ export default class edittemplate extends React.Component {
|
||||||
|
|
||||||
//组件将要销毁阶段
|
//组件将要销毁阶段
|
||||||
componentWillUnmount() {
|
componentWillUnmount() {
|
||||||
|
console.log(2,'jieshu');
|
||||||
let oldobj = JSON.parse(sessionStorage.getItem('editorConfig'));
|
let oldobj = JSON.parse(sessionStorage.getItem('editorConfig'));
|
||||||
if (oldobj && oldobj.couponList) {
|
let coupon= oldobj.coupon
|
||||||
let couponList = oldobj.couponList
|
coupon.land = this.state.model;
|
||||||
couponList.land = this.state.model;
|
oldobj.coupon = coupon;
|
||||||
oldobj.couponList = couponList;
|
|
||||||
} else {
|
|
||||||
oldobj = {}
|
|
||||||
let couponList = {}
|
|
||||||
couponList.land = this.state.model;
|
|
||||||
oldobj.couponList = couponList;
|
|
||||||
}
|
|
||||||
sessionStorage.setItem('editorConfig', JSON.stringify(oldobj));
|
sessionStorage.setItem('editorConfig', JSON.stringify(oldobj));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -243,7 +244,7 @@ export default class edittemplate extends React.Component {
|
||||||
return (
|
return (
|
||||||
<div>
|
<div>
|
||||||
<div className='control page-title-control'>
|
<div className='control page-title-control'>
|
||||||
<h1 style={{ fontSize: '16px' }}>落地页设置</h1>
|
<h1 style={{ fontSize: '16px' }}>落地页设置123</h1>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div style={{ width: "92%", "margin": "0 auto 60px", "overflow": "auto", "maxHeight": "100%" }}>
|
<div style={{ width: "92%", "margin": "0 auto 60px", "overflow": "auto", "maxHeight": "100%" }}>
|
||||||
|
|
|
@ -37,16 +37,16 @@ export default class edittemplate extends React.Component {
|
||||||
}
|
}
|
||||||
componentWillMount(e) {
|
componentWillMount(e) {
|
||||||
let config = JSON.parse(sessionStorage.getItem('editorConfig'));
|
let config = JSON.parse(sessionStorage.getItem('editorConfig'));
|
||||||
if (config && config.couponList && config.couponList.product_detail) {
|
if (config && config.coupon && config.coupon.product_detail) {
|
||||||
let { font_color, button_color } = config.couponList.product_detail.reduce;
|
let { font_color, button_color } = config.coupon.product_detail.reduce;
|
||||||
this.setState({ font_color, button_color });
|
this.setState({ font_color, button_color });
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
componentWillUnmount() {
|
componentWillUnmount() {
|
||||||
let oldobj = JSON.parse(sessionStorage.getItem('editorConfig'));
|
let oldobj = JSON.parse(sessionStorage.getItem('editorConfig'));
|
||||||
let couponList = oldobj.couponList;
|
let coupon = oldobj.coupon;
|
||||||
couponList.product_detail.reduce = _.cloneDeep(this.state);
|
coupon.product_detail.reduce = _.cloneDeep(this.state);
|
||||||
oldobj.couponList = couponList;
|
oldobj.coupon = coupon;
|
||||||
sessionStorage.setItem('editorConfig', JSON.stringify(oldobj));
|
sessionStorage.setItem('editorConfig', JSON.stringify(oldobj));
|
||||||
}
|
}
|
||||||
render() {
|
render() {
|
||||||
|
|
|
@ -139,15 +139,15 @@ export default class edittemplate extends React.Component {
|
||||||
}
|
}
|
||||||
componentWillMount() {
|
componentWillMount() {
|
||||||
let config = JSON.parse(sessionStorage.getItem('editorConfig'));
|
let config = JSON.parse(sessionStorage.getItem('editorConfig'));
|
||||||
if (config && config.couponList && config.couponList.product_detail) {
|
if (config && config.coupon && config.coupon.product_detail) {
|
||||||
this.setState({ model: config.couponList.product_detail });
|
this.setState({ model: config.coupon.product_detail });
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
componentWillUnmount() {
|
componentWillUnmount() {
|
||||||
let oldobj = JSON.parse(sessionStorage.getItem('editorConfig'));
|
let oldobj = JSON.parse(sessionStorage.getItem('editorConfig'));
|
||||||
let couponList = oldobj.couponList;
|
let coupon = oldobj.coupon;
|
||||||
couponList.product_detail = _.cloneDeep(this.state.model);
|
coupon.product_detail = _.cloneDeep(this.state.model);
|
||||||
oldobj.couponList = couponList;
|
oldobj.coupon = coupon;
|
||||||
sessionStorage.setItem('editorConfig', JSON.stringify(oldobj));
|
sessionStorage.setItem('editorConfig', JSON.stringify(oldobj));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -24,7 +24,7 @@ export default class edittemplate extends React.Component{
|
||||||
this.props.detaildata.describe.type==2?<img className="susactive_tip" onClick={this.opendescFn.bind(this)} src={'https://lsxdemall.oss-cn-beijing.aliyuncs.com/MarketingSystem/img/acticeTextTip.png'}/>:null
|
this.props.detaildata.describe.type==2?<img className="susactive_tip" onClick={this.opendescFn.bind(this)} src={'https://lsxdemall.oss-cn-beijing.aliyuncs.com/MarketingSystem/img/acticeTextTip.png'}/>:null
|
||||||
}
|
}
|
||||||
{
|
{
|
||||||
this.props.templateType!=2?<button className="exchangeBtn" style={{background:this.props.detaildata.button_color,color:this.props.detaildata.font_color}}>立即兑换</button>:
|
[1,3].includes(this.props.templateType)?<button className="exchangeBtn" style={{background:this.props.detaildata.button_color,color:this.props.detaildata.font_color}}>立即兑换</button>:
|
||||||
<div className="dflexaj payBtn-view">
|
<div className="dflexaj payBtn-view">
|
||||||
<div className="coupon-price">
|
<div className="coupon-price">
|
||||||
<p>¥0.00</p>
|
<p>¥0.00</p>
|
||||||
|
|
|
@ -25,7 +25,6 @@ import CouponGoodsListForm from '../couponTemplate/goodsPage/config/main' //优
|
||||||
import CouponGoodsDetailForm from './couponconfig' //优惠券商品详情页
|
import CouponGoodsDetailForm from './couponconfig' //优惠券商品详情页
|
||||||
import CouponReduceDetailForm from './couponReduceDetail' //优惠券立减金详情页
|
import CouponReduceDetailForm from './couponReduceDetail' //优惠券立减金详情页
|
||||||
import CouponComLib from '../couponTemplate/goodsPage/componentLib/main' //优惠券组件库
|
import CouponComLib from '../couponTemplate/goodsPage/componentLib/main' //优惠券组件库
|
||||||
// import
|
|
||||||
import _ from 'lodash'
|
import _ from 'lodash'
|
||||||
//落地页
|
//落地页
|
||||||
let model = {
|
let model = {
|
||||||
|
@ -332,37 +331,45 @@ export default class edittemplate extends React.Component {
|
||||||
whiteList['land'].title = newEditor.title
|
whiteList['land'].title = newEditor.title
|
||||||
whiteList['land'].sort = newEditor.sort
|
whiteList['land'].sort = newEditor.sort
|
||||||
//优惠券
|
//优惠券
|
||||||
let couponList = newEditor.couponList
|
let coupon = newEditor.coupon
|
||||||
if (!couponList) {
|
if (!coupon) {
|
||||||
couponList = {}
|
coupon = {}
|
||||||
couponList.land = model
|
coupon.land = model
|
||||||
couponList.product_list = couponProduct_list
|
coupon.product_list = couponProduct_list
|
||||||
couponList.product_detail = product_detail
|
coupon.product_detail = product_detail
|
||||||
}
|
}
|
||||||
couponList['land'].title = newEditor.title
|
coupon['land'].title = newEditor.title
|
||||||
couponList['land'].sort = newEditor.sort
|
coupon['land'].sort = newEditor.sort
|
||||||
|
|
||||||
newEditor.exchangeList = exchangeList
|
newEditor.exchangeList = exchangeList
|
||||||
newEditor.whiteList = whiteList
|
newEditor.whiteList = whiteList
|
||||||
newEditor.couponList = couponList;
|
newEditor.coupon = coupon;
|
||||||
if (template == 1) { //1-白名单 2-兑换码
|
if (template == 1) { //1-白名单 3-兑换码
|
||||||
this.setState({
|
this.setState({
|
||||||
model: newEditor.whiteList.land,
|
model: newEditor.whiteList.land,
|
||||||
product_list: newEditor.whiteList.product_list,
|
product_list: newEditor.whiteList.product_list,
|
||||||
product_detail: newEditor.whiteList.product_detail
|
product_detail: newEditor.whiteList.product_detail
|
||||||
})
|
})
|
||||||
} else {
|
} else if (template ==3){
|
||||||
this.setState({
|
this.setState({
|
||||||
model: newEditor.exchangeList.land,
|
model: newEditor.exchangeList.land,
|
||||||
product_list: newEditor.exchangeList.product_list,
|
product_list: newEditor.exchangeList.product_list,
|
||||||
product_detail: newEditor.exchangeList.product_detail
|
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))
|
sessionStorage.setItem('editorConfig', JSON.stringify(newEditor))
|
||||||
if (mouldType != 0 && pageChange == 1) {
|
if (mouldType != 0 && pageChange == 1) {
|
||||||
this.setState({ pagedisable: true })
|
this.setState({ pagedisable: true })
|
||||||
}
|
}
|
||||||
} else {//新增数据
|
} else {//新增数据
|
||||||
let obj = {}, whiteList = {}, exchangeList = {}, couponList = {}
|
console.log(369,sessionStorage.getItem('editorConfig'));
|
||||||
|
let obj = {}, whiteList = {}, exchangeList = {}, coupon = {}
|
||||||
let sourceObj = {//模板数据结构
|
let sourceObj = {//模板数据结构
|
||||||
land: model,
|
land: model,
|
||||||
product_list,
|
product_list,
|
||||||
|
@ -375,10 +382,10 @@ export default class edittemplate extends React.Component {
|
||||||
}
|
}
|
||||||
whiteList = _.cloneDeep(sourceObj);
|
whiteList = _.cloneDeep(sourceObj);
|
||||||
exchangeList = _.cloneDeep(sourceObj);
|
exchangeList = _.cloneDeep(sourceObj);
|
||||||
couponList = _.cloneDeep(sourcecouponObj);
|
coupon = _.cloneDeep(sourcecouponObj);
|
||||||
obj.exchangeList = exchangeList
|
obj.exchangeList = exchangeList
|
||||||
obj.whiteList = whiteList
|
obj.whiteList = whiteList
|
||||||
obj.couponList = couponList
|
obj.coupon = coupon
|
||||||
sessionStorage.setItem('editorConfig', JSON.stringify(obj))
|
sessionStorage.setItem('editorConfig', JSON.stringify(obj))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -488,11 +495,21 @@ export default class edittemplate extends React.Component {
|
||||||
infoExchange.product_detail = exchangeState.product_detail
|
infoExchange.product_detail = exchangeState.product_detail
|
||||||
delete infoExchange.land.sort
|
delete infoExchange.land.sort
|
||||||
delete infoExchange.land.title
|
delete infoExchange.land.title
|
||||||
if (this.state.showType == 3) {
|
switch(this.state.showType){
|
||||||
//兑换码
|
case 3://兑换码
|
||||||
formdata.exchange = infoExchange
|
formdata.exchange = infoExchange;
|
||||||
} else if (this.state.showType == 1) {
|
break;
|
||||||
|
case 1://白名单
|
||||||
formdata.access_conf = infoExchange
|
formdata.access_conf = infoExchange
|
||||||
|
break;
|
||||||
|
case 4://优惠券
|
||||||
|
formdata.coupon = infoExchange;
|
||||||
|
break;
|
||||||
|
case 8://优惠券白名单
|
||||||
|
formdata.coupon = infoExchange;
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
if (myInfoData) {
|
if (myInfoData) {
|
||||||
//编辑
|
//编辑
|
||||||
|
@ -638,7 +655,7 @@ export default class edittemplate extends React.Component {
|
||||||
}
|
}
|
||||||
onmodelChange(e) {
|
onmodelChange(e) {
|
||||||
this.setState({ showType: e.target.value, activeNavStatus: 1 })
|
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) {
|
if (e.target.value == 1) {
|
||||||
let whiteData = editorData.whiteList
|
let whiteData = editorData.whiteList
|
||||||
let { land, product_list, product_detail } = whiteData;
|
let { land, product_list, product_detail } = whiteData;
|
||||||
|
@ -652,9 +669,10 @@ export default class edittemplate extends React.Component {
|
||||||
let exchangeData = editorData.exchangeList
|
let exchangeData = editorData.exchangeList
|
||||||
let { land, product_list, product_detail } = exchangeData;
|
let { land, product_list, product_detail } = exchangeData;
|
||||||
this.setState({ model: land, product_list, product_detail })
|
this.setState({ model: land, product_list, product_detail })
|
||||||
} else if (e.target.value == 2) {
|
} else{//优惠券+优惠券白名单
|
||||||
let couponData = editorData.couponList
|
let couponData = editorData.coupon
|
||||||
let { land, product_list, product_detail } = couponData;
|
let { land, product_list, product_detail } = couponData;
|
||||||
|
console.log(222,this.state.model);
|
||||||
this.setState({ model: land, product_list, product_detail })
|
this.setState({ model: land, product_list, product_detail })
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -800,7 +818,7 @@ export default class edittemplate extends React.Component {
|
||||||
this.setState({ componentOfconfig: c });
|
this.setState({ componentOfconfig: c });
|
||||||
}
|
}
|
||||||
render() {
|
render() {
|
||||||
console.log(761,window.screen.width / 1920 * 100);
|
console.log(761,this.state);
|
||||||
return (
|
return (
|
||||||
<div className='edittemplate'>
|
<div className='edittemplate'>
|
||||||
<div className='topHeader'>
|
<div className='topHeader'>
|
||||||
|
@ -838,9 +856,12 @@ export default class edittemplate extends React.Component {
|
||||||
<RadioButton value={1} disabled={this.state.pagedisable}>
|
<RadioButton value={1} disabled={this.state.pagedisable}>
|
||||||
白名单
|
白名单
|
||||||
</RadioButton>
|
</RadioButton>
|
||||||
<RadioButton value={2} disabled={this.state.pagedisable}>
|
<RadioButton value={4} disabled={this.state.pagedisable}>
|
||||||
优惠券
|
优惠券
|
||||||
</RadioButton>
|
</RadioButton>
|
||||||
|
<RadioButton value={8} disabled={this.state.pagedisable}>
|
||||||
|
优惠券白名单
|
||||||
|
</RadioButton>
|
||||||
</RadioGroup>
|
</RadioGroup>
|
||||||
</div>
|
</div>
|
||||||
{/* 兑换码 */}
|
{/* 兑换码 */}
|
||||||
|
@ -877,7 +898,7 @@ export default class edittemplate extends React.Component {
|
||||||
) : (
|
) : (
|
||||||
<img src={this.state.model.middle_image} id='top' />
|
<img src={this.state.model.middle_image} id='top' />
|
||||||
)}
|
)}
|
||||||
{this.state.showType == 1 ? (
|
{[1,4].includes(this.state.showType)? (
|
||||||
<img
|
<img
|
||||||
src={
|
src={
|
||||||
'https://lsxd-yunshanfu.oss-cn-hangzhou.aliyuncs.com/common_image/20220127/22e5d4c1b1190a0a7bc8db43e1490d67.png'
|
'https://lsxd-yunshanfu.oss-cn-hangzhou.aliyuncs.com/common_image/20220127/22e5d4c1b1190a0a7bc8db43e1490d67.png'
|
||||||
|
@ -938,12 +959,12 @@ export default class edittemplate extends React.Component {
|
||||||
</div>
|
</div>
|
||||||
{/* 组件库 */}
|
{/* 组件库 */}
|
||||||
{
|
{
|
||||||
this.state.showType == 2 && this.state.activeNavStatus == 2 ? <CouponComLib componentName={(c) => this.componentName(c)} /> : null
|
[4,8].includes(this.state.showType) && this.state.activeNavStatus == 2 ? <CouponComLib componentName={(c) => this.componentName(c)} /> : null
|
||||||
}
|
}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div className='xj-wrapper' style={{ 'zIndex': '1' }}>
|
<div className='xj-wrapper' style={{ 'zIndex': '1' }}>
|
||||||
<div className={this.state.showType == 2 && this.state.activeNavStatus == 2 ? 'xj-center-small' : 'xj-center'}>
|
<div className={[4,8].includes(this.state.showType)&& this.state.activeNavStatus == 2 ? 'xj-center-small' : 'xj-center'}>
|
||||||
{this.state.activeNavStatus == 1 ? (
|
{this.state.activeNavStatus == 1 ? (
|
||||||
<div>
|
<div>
|
||||||
<img
|
<img
|
||||||
|
@ -1047,7 +1068,7 @@ export default class edittemplate extends React.Component {
|
||||||
src={this.state.model.middle_image}
|
src={this.state.model.middle_image}
|
||||||
/>
|
/>
|
||||||
)}
|
)}
|
||||||
{this.state.showType == 1 ? (
|
{[1,4].includes(this.state.showType) ? (
|
||||||
<img
|
<img
|
||||||
src={
|
src={
|
||||||
'https://lsxd-yunshanfu.oss-cn-hangzhou.aliyuncs.com/common_image/20220127/22e5d4c1b1190a0a7bc8db43e1490d67.png'
|
'https://lsxd-yunshanfu.oss-cn-hangzhou.aliyuncs.com/common_image/20220127/22e5d4c1b1190a0a7bc8db43e1490d67.png'
|
||||||
|
@ -1155,8 +1176,7 @@ export default class edittemplate extends React.Component {
|
||||||
<div
|
<div
|
||||||
className='schema-editor-container'
|
className='schema-editor-container'
|
||||||
data-editor-role='XJWebsitePage'>
|
data-editor-role='XJWebsitePage'>
|
||||||
{
|
{[1,3].includes(this.state.showType)? (
|
||||||
this.state.showType != 2 ? (
|
|
||||||
<div className='control page-title-control'>
|
<div className='control page-title-control'>
|
||||||
{this.state.activeNavStatus == 1 ? (
|
{this.state.activeNavStatus == 1 ? (
|
||||||
<h1 style={{ fontSize: '16px' }}>落地页设置</h1>
|
<h1 style={{ fontSize: '16px' }}>落地页设置</h1>
|
||||||
|
|
|
@ -18,7 +18,7 @@ export default class edittemplate extends React.Component{
|
||||||
<img src={'https://lsxdemall.oss-cn-beijing.aliyuncs.com/MarketingSystem/img/backprepageBtn.png'} className="preBtn"/>
|
<img src={'https://lsxdemall.oss-cn-beijing.aliyuncs.com/MarketingSystem/img/backprepageBtn.png'} className="preBtn"/>
|
||||||
<img src="https://lsxdemall.oss-cn-beijing.aliyuncs.com/MarketingSystem/img/coupon/reduce_pic.png" alt="" className="reduce-pic"/>
|
<img src="https://lsxdemall.oss-cn-beijing.aliyuncs.com/MarketingSystem/img/coupon/reduce_pic.png" alt="" className="reduce-pic"/>
|
||||||
{
|
{
|
||||||
this.props.templateType==2?
|
[2,4].includes(this.props.templateType)?
|
||||||
<div className="dflexaj payBtn-view">
|
<div className="dflexaj payBtn-view">
|
||||||
<div className="coupon-price">
|
<div className="coupon-price">
|
||||||
<p>¥0.00</p>
|
<p>¥0.00</p>
|
||||||
|
|
Loading…
Reference in New Issue